From 1cfb2b4c7d9aede3a9d8593be816e4830dc52f17 Mon Sep 17 00:00:00 2001 From: Alex Spataru Date: Fri, 22 Nov 2024 08:50:28 -0500 Subject: [PATCH] Add edbee text editor --- .github/workflows/deploy.yml | 16 +- app/CMakeLists.txt | 6 +- .../ProjectEditor/Views/FrameParserView.qml | 4 +- app/rcc/edbee/README.md | 15 + app/rcc/edbee/config/default.json | 21 + app/rcc/edbee/config/default.osx.json | 4 + app/rcc/edbee/config/default.win.json | 3 + app/rcc/edbee/config/default.x11.json | 4 + app/rcc/edbee/keymaps/default.json | 120 + app/rcc/edbee/keymaps/default.osx.json | 20 + app/rcc/edbee/keymaps/default.win32.json | 20 + app/rcc/edbee/syntaxfiles/ASP.tmLanguage | 214 + .../edbee/syntaxfiles/ActionScript.tmLanguage | 267 + .../edbee/syntaxfiles/AppleScript.tmLanguage | 2142 ++ .../edbee/syntaxfiles/Batch File.tmLanguage | 111 + app/rcc/edbee/syntaxfiles/Bibtex.tmLanguage | 406 + app/rcc/edbee/syntaxfiles/Build.tmLanguage | 142 + app/rcc/edbee/syntaxfiles/C#.tmLanguage | 530 + app/rcc/edbee/syntaxfiles/C++.tmLanguage | 491 + app/rcc/edbee/syntaxfiles/C.tmLanguage | 1126 + app/rcc/edbee/syntaxfiles/CSS.tmLanguage | 1010 + app/rcc/edbee/syntaxfiles/Clojure.tmLanguage | 3415 +++ .../edbee/syntaxfiles/CoffeeScript.tmLanguage | 746 + app/rcc/edbee/syntaxfiles/D.tmLanguage | 908 + app/rcc/edbee/syntaxfiles/DOT.tmLanguage | 127 + app/rcc/edbee/syntaxfiles/Diff.tmLanguage | 229 + app/rcc/edbee/syntaxfiles/Doxyfile.tmLanguage | 70 + app/rcc/edbee/syntaxfiles/Erlang.tmLanguage | 2562 +++ app/rcc/edbee/syntaxfiles/Go.tmLanguage | 764 + app/rcc/edbee/syntaxfiles/Groovy.tmLanguage | 1356 ++ app/rcc/edbee/syntaxfiles/HTML-ASP.tmLanguage | 74 + app/rcc/edbee/syntaxfiles/HTML.tmLanguage | 978 + app/rcc/edbee/syntaxfiles/Haskell.tmLanguage | 646 + app/rcc/edbee/syntaxfiles/Java.tmLanguage | 1129 + app/rcc/edbee/syntaxfiles/JavaDoc.tmLanguage | 737 + .../edbee/syntaxfiles/JavaScript.tmLanguage | 723 + .../edbee/syntaxfiles/LaTeX Beamer.tmLanguage | 106 + app/rcc/edbee/syntaxfiles/LaTeX.tmLanguage | 1554 ++ app/rcc/edbee/syntaxfiles/Lisp.tmLanguage | 160 + app/rcc/edbee/syntaxfiles/Lua.tmLanguage | 234 + app/rcc/edbee/syntaxfiles/Makefile.tmLanguage | 98 + app/rcc/edbee/syntaxfiles/Markdown.tmLanguage | 1178 + app/rcc/edbee/syntaxfiles/Matlab.tmLanguage | 1205 + .../syntaxfiles/MultiMarkdown.tmLanguage | 80 + .../edbee/syntaxfiles/OCamlyacc.tmLanguage | 532 + .../syntaxfiles/Objective-C++.tmLanguage | 39 + .../edbee/syntaxfiles/Objective-C.tmLanguage | 1511 ++ app/rcc/edbee/syntaxfiles/PHP.tmLanguage | 3429 +++ app/rcc/edbee/syntaxfiles/Perl.tmLanguage | 3209 +++ .../edbee/syntaxfiles/Plain text.tmLanguage | 83 + app/rcc/edbee/syntaxfiles/Python.tmLanguage | 3025 +++ .../edbee/syntaxfiles/R Console.tmLanguage | 42 + .../Rd (R Documentation).tmLanguage | 243 + app/rcc/edbee/syntaxfiles/RegExp.tmLanguage | 142 + .../edbee/syntaxfiles/Ruby Haml.tmLanguage | 248 + .../syntaxfiles/Ruby on Rails.tmLanguage | 287 + app/rcc/edbee/syntaxfiles/Ruby.tmLanguage | 2854 +++ .../edbee/syntaxfiles/Rust.tmLanguage.json | 981 + app/rcc/edbee/syntaxfiles/SCSS.tmLanguage | 1986 ++ app/rcc/edbee/syntaxfiles/SQL.tmLanguage | 706 + app/rcc/edbee/syntaxfiles/Scala.tmLanguage | 652 + .../syntaxfiles/Shell-Unix-Generic.tmLanguage | 1856 ++ app/rcc/edbee/syntaxfiles/Tcl.tmLanguage | 432 + app/rcc/edbee/syntaxfiles/TeX Math.tmLanguage | 132 + app/rcc/edbee/syntaxfiles/TeX.tmLanguage | 246 + app/rcc/edbee/syntaxfiles/Textile.tmLanguage | 490 + app/rcc/edbee/syntaxfiles/XML.tmLanguage | 589 + app/rcc/edbee/syntaxfiles/XSL.tmLanguage | 157 + app/rcc/edbee/syntaxfiles/YAML.tmLanguage | 466 + .../syntaxfiles/reStructuredText.tmLanguage | 654 + app/rcc/edbee/themes/All Hallow's Eve.tmTheme | 277 + app/rcc/edbee/themes/Amy.tmTheme | 557 + app/rcc/edbee/themes/Blackboard.tmTheme | 350 + app/rcc/edbee/themes/Brilliance_Black.tmTheme | 2619 +++ app/rcc/edbee/themes/Brilliance_Dull.tmTheme | 2243 ++ app/rcc/edbee/themes/Cobalt.tmTheme | 559 + app/rcc/edbee/themes/Dawn.tmTheme | 441 + app/rcc/edbee/themes/Eiffel.tmTheme | 439 + app/rcc/edbee/themes/Espresso Libre.tmTheme | 402 + app/rcc/edbee/themes/IDLE.tmTheme | 235 + app/rcc/edbee/themes/LAZY.tmTheme | 291 + app/rcc/edbee/themes/Mac Classic.tmTheme | 450 + app/rcc/edbee/themes/MagicWB (Amiga).tmTheme | 376 + app/rcc/edbee/themes/Monokai Bright.tmTheme | 390 + app/rcc/edbee/themes/Monokai.tmTheme | 387 + app/rcc/edbee/themes/Pastels on Dark.tmTheme | 701 + app/rcc/edbee/themes/Solarized (Dark).tmTheme | 1897 ++ .../edbee/themes/Solarized (Light).tmTheme | 1875 ++ app/rcc/edbee/themes/SpaceCadet.tmTheme | 212 + app/rcc/edbee/themes/Sunburst.tmTheme | 665 + app/rcc/edbee/themes/Twilight.tmTheme | 514 + app/rcc/edbee/themes/Zenburnesque.tmTheme | 343 + app/rcc/edbee/themes/iPlastic.tmTheme | 286 + app/rcc/messages/Acknowledgements.txt | 29 +- app/rcc/rcc.qrc | 89 + app/rcc/themes/Breeze Dark.json | 1 + app/rcc/themes/Breeze Light.json | 1 + app/rcc/themes/Deep Blue.json | 1 + app/rcc/themes/Deep Green.json | 1 + app/rcc/themes/Deep Purple.json | 1 + app/rcc/themes/Deep Red.json | 1 + app/rcc/themes/Default.json | 1 + app/rcc/themes/Dominion.json | 1 + app/rcc/themes/Outdoor Day.json | 1 + app/rcc/themes/Outdoor Night.json | 1 + app/rcc/themes/Pulse.json | 1 + app/rcc/themes/Resistance.json | 1 + app/rcc/themes/Yaru Dark.json | 1 + app/rcc/themes/Yaru Light.json | 1 + app/rcc/themes/macOS Dark.json | 1 + app/rcc/themes/macOS Light.json | 1 + app/src/JSON/FrameParser.cpp | 179 +- app/src/JSON/FrameParser.h | 10 +- app/src/Misc/ThemeManager.cpp | 23 +- app/src/Misc/ThemeManager.h | 2 + app/src/SIMD/SIMD.h | 86 +- app/src/UI/Dashboard.cpp | 6 +- examples/HexadecimalADC/HexadecimalADC.json | 2 +- lib/CMakeLists.txt | 2 +- lib/QSourceHighlite/.clang-format | 38 - lib/QSourceHighlite/.gitignore | 2 - lib/QSourceHighlite/CMakeLists.txt | 87 - lib/QSourceHighlite/LICENSE | 20 - lib/QSourceHighlite/README.md | 65 - lib/QSourceHighlite/languagedata.cpp | 5698 ----- lib/QSourceHighlite/languagedata.h | 187 - lib/QSourceHighlite/qsourcehighliter.cpp | 1099 - lib/QSourceHighlite/qsourcehighliter.h | 172 - .../qsourcehighliterthemes.cpp | 83 - lib/QSourceHighlite/qsourcehighliterthemes.h | 39 - lib/edbee-lib/CMakeLists.txt | 197 + lib/edbee-lib/Doxyfile | 1801 ++ lib/edbee-lib/doc/coding-style.md | 126 + lib/edbee-lib/doc/index.md | 8 + lib/edbee-lib/edbee-lib.pri | 191 + lib/edbee-lib/edbee-lib.pro | 33 + .../edbee/commands/commentcommand.cpp | 524 + lib/edbee-lib/edbee/commands/commentcommand.h | 34 + lib/edbee-lib/edbee/commands/copycommand.cpp | 67 + lib/edbee-lib/edbee/commands/copycommand.h | 31 + lib/edbee-lib/edbee/commands/cutcommand.cpp | 88 + lib/edbee-lib/edbee/commands/cutcommand.h | 28 + lib/edbee-lib/edbee/commands/debugcommand.cpp | 120 + lib/edbee-lib/edbee/commands/debugcommand.h | 45 + .../edbee/commands/duplicatecommand.cpp | 78 + .../edbee/commands/duplicatecommand.h | 25 + lib/edbee-lib/edbee/commands/findcommand.cpp | 143 + lib/edbee-lib/edbee/commands/findcommand.h | 46 + .../edbee/commands/movelinecommand.cpp | 132 + .../edbee/commands/movelinecommand.h | 24 + .../edbee/commands/newlinecommand.cpp | 203 + lib/edbee-lib/edbee/commands/newlinecommand.h | 46 + lib/edbee-lib/edbee/commands/pastecommand.cpp | 95 + lib/edbee-lib/edbee/commands/pastecommand.h | 34 + lib/edbee-lib/edbee/commands/redocommand.cpp | 35 + lib/edbee-lib/edbee/commands/redocommand.h | 32 + .../edbee/commands/removecommand.cpp | 249 + lib/edbee-lib/edbee/commands/removecommand.h | 69 + .../commands/replaceselectioncommand.cpp | 38 + .../edbee/commands/replaceselectioncommand.h | 31 + .../edbee/commands/selectioncommand.cpp | 271 + .../edbee/commands/selectioncommand.h | 85 + lib/edbee-lib/edbee/commands/tabcommand.cpp | 213 + lib/edbee-lib/edbee/commands/tabcommand.h | 46 + .../edbee/commands/togglereadonlycommand.cpp | 32 + .../edbee/commands/togglereadonlycommand.h | 23 + lib/edbee-lib/edbee/commands/undocommand.cpp | 35 + lib/edbee-lib/edbee/commands/undocommand.h | 31 + .../edbee/data/factorycommandmap.cpp | 171 + lib/edbee-lib/edbee/data/factorycommandmap.h | 22 + lib/edbee-lib/edbee/data/factorykeymap.cpp | 137 + lib/edbee-lib/edbee/data/factorykeymap.h | 24 + lib/edbee-lib/edbee/debug.h | 21 + lib/edbee-lib/edbee/edbee.cpp | 298 + lib/edbee-lib/edbee/edbee.h | 81 + lib/edbee-lib/edbee/exports.h | 13 + lib/edbee-lib/edbee/io/baseplistparser.cpp | 203 + lib/edbee-lib/edbee/io/baseplistparser.h | 53 + lib/edbee-lib/edbee/io/jsonparser.cpp | 255 + lib/edbee-lib/edbee/io/jsonparser.h | 55 + lib/edbee-lib/edbee/io/keymapparser.cpp | 140 + lib/edbee-lib/edbee/io/keymapparser.h | 76 + .../edbee/io/textdocumentserializer.cpp | 268 + .../edbee/io/textdocumentserializer.h | 63 + lib/edbee-lib/edbee/io/tmlanguageparser.cpp | 299 + lib/edbee-lib/edbee/io/tmlanguageparser.h | 57 + lib/edbee-lib/edbee/io/tmthemeparser.cpp | 156 + lib/edbee-lib/edbee/io/tmthemeparser.h | 37 + .../edbee/lexers/grammartextlexer.cpp | 616 + lib/edbee-lib/edbee/lexers/grammartextlexer.h | 91 + lib/edbee-lib/edbee/models/change.cpp | 344 + lib/edbee-lib/edbee/models/change.h | 111 + .../models/changes/abstractrangedchange.cpp | 184 + .../models/changes/abstractrangedchange.h | 60 + .../edbee/models/changes/linedatachange.cpp | 107 + .../edbee/models/changes/linedatachange.h | 51 + .../models/changes/linedatalistchange.cpp | 252 + .../edbee/models/changes/linedatalistchange.h | 58 + .../models/changes/mergablechangegroup.cpp | 577 + .../models/changes/mergablechangegroup.h | 104 + .../edbee/models/changes/selectionchange.cpp | 129 + .../edbee/models/changes/selectionchange.h | 47 + .../edbee/models/changes/textchange.cpp | 185 + .../edbee/models/changes/textchange.h | 61 + .../models/changes/textchangewithcaret.cpp | 33 + .../models/changes/textchangewithcaret.h | 31 + .../models/chardocument/chartextbuffer.cpp | 184 + .../models/chardocument/chartextbuffer.h | 59 + .../models/chardocument/chartextdocument.cpp | 171 + .../models/chardocument/chartextdocument.h | 99 + .../edbee/models/dynamicvariables.cpp | 160 + lib/edbee-lib/edbee/models/dynamicvariables.h | 88 + .../edbee/models/textautocompleteprovider.cpp | 219 + .../edbee/models/textautocompleteprovider.h | 185 + lib/edbee-lib/edbee/models/textbuffer.cpp | 318 + lib/edbee-lib/edbee/models/textbuffer.h | 169 + lib/edbee-lib/edbee/models/textdocument.cpp | 492 + lib/edbee-lib/edbee/models/textdocument.h | 184 + .../edbee/models/textdocumentfilter.cpp | 39 + .../edbee/models/textdocumentfilter.h | 75 + .../edbee/models/textdocumentscopes.cpp | 1085 + .../edbee/models/textdocumentscopes.h | 387 + .../edbee/models/texteditorcommandmap.cpp | 54 + .../edbee/models/texteditorcommandmap.h | 37 + .../edbee/models/texteditorconfig.cpp | 456 + lib/edbee-lib/edbee/models/texteditorconfig.h | 139 + .../edbee/models/texteditorkeymap.cpp | 437 + lib/edbee-lib/edbee/models/texteditorkeymap.h | 98 + lib/edbee-lib/edbee/models/textgrammar.cpp | 422 + lib/edbee-lib/edbee/models/textgrammar.h | 204 + lib/edbee-lib/edbee/models/textlexer.cpp | 37 + lib/edbee-lib/edbee/models/textlexer.h | 51 + lib/edbee-lib/edbee/models/textlinedata.cpp | 331 + lib/edbee-lib/edbee/models/textlinedata.h | 132 + lib/edbee-lib/edbee/models/textrange.cpp | 1349 ++ lib/edbee-lib/edbee/models/textrange.h | 287 + lib/edbee-lib/edbee/models/textsearcher.cpp | 405 + lib/edbee-lib/edbee/models/textsearcher.h | 86 + lib/edbee-lib/edbee/models/textundostack.cpp | 817 + lib/edbee-lib/edbee/models/textundostack.h | 177 + lib/edbee-lib/edbee/texteditorcommand.cpp | 24 + lib/edbee-lib/edbee/texteditorcommand.h | 72 + lib/edbee-lib/edbee/texteditorcontroller.cpp | 808 + lib/edbee-lib/edbee/texteditorcontroller.h | 195 + lib/edbee-lib/edbee/texteditorwidget.cpp | 374 + lib/edbee-lib/edbee/texteditorwidget.h | 112 + .../edbee/util/cascadingqvariantmap.cpp | 106 + .../edbee/util/cascadingqvariantmap.h | 44 + lib/edbee-lib/edbee/util/gapvector.h | 764 + lib/edbee-lib/edbee/util/lineending.cpp | 122 + lib/edbee-lib/edbee/util/lineending.h | 63 + lib/edbee-lib/edbee/util/lineoffsetvector.cpp | 336 + lib/edbee-lib/edbee/util/lineoffsetvector.h | 76 + lib/edbee-lib/edbee/util/logging.h | 76 + lib/edbee-lib/edbee/util/mem/debug_allocs.cpp | 165 + lib/edbee-lib/edbee/util/mem/debug_allocs.h | 94 + lib/edbee-lib/edbee/util/mem/debug_new.cpp | 135 + lib/edbee-lib/edbee/util/mem/debug_new.h | 37 + .../edbee/util/rangelineiterator.cpp | 50 + lib/edbee-lib/edbee/util/rangelineiterator.h | 45 + .../edbee/util/rangesetlineiterator.cpp | 79 + .../edbee/util/rangesetlineiterator.h | 46 + lib/edbee-lib/edbee/util/regexp.cpp | 523 + lib/edbee-lib/edbee/util/regexp.h | 93 + lib/edbee-lib/edbee/util/simpleprofiler.cpp | 148 + lib/edbee-lib/edbee/util/simpleprofiler.h | 99 + lib/edbee-lib/edbee/util/test.cpp | 503 + lib/edbee-lib/edbee/util/test.h | 333 + lib/edbee-lib/edbee/util/textcodec.cpp | 111 + lib/edbee-lib/edbee/util/textcodec.h | 58 + .../edbee/util/textcodecdetector.cpp | 292 + lib/edbee-lib/edbee/util/textcodecdetector.h | 113 + lib/edbee-lib/edbee/util/util.cpp | 84 + lib/edbee-lib/edbee/util/util.h | 68 + .../views/accessibletexteditorwidget.cpp | 631 + .../edbee/views/accessibletexteditorwidget.h | 86 + .../texteditorautocompletecomponent.cpp | 690 + .../texteditorautocompletecomponent.h | 126 + .../views/components/texteditorcomponent.cpp | 743 + .../views/components/texteditorcomponent.h | 99 + .../views/components/texteditorrenderer.cpp | 280 + .../views/components/texteditorrenderer.h | 46 + .../views/components/textmargincomponent.cpp | 454 + .../views/components/textmargincomponent.h | 119 + lib/edbee-lib/edbee/views/textcaretcache.cpp | 119 + lib/edbee-lib/edbee/views/textcaretcache.h | 46 + .../edbee/views/texteditorscrollarea.cpp | 223 + .../edbee/views/texteditorscrollarea.h | 49 + lib/edbee-lib/edbee/views/textlayout.cpp | 192 + lib/edbee-lib/edbee/views/textlayout.h | 91 + lib/edbee-lib/edbee/views/textrenderer.cpp | 714 + lib/edbee-lib/edbee/views/textrenderer.h | 173 + lib/edbee-lib/edbee/views/textselection.cpp | 191 + lib/edbee-lib/edbee/views/textselection.h | 55 + lib/edbee-lib/edbee/views/texttheme.cpp | 504 + lib/edbee-lib/edbee/views/texttheme.h | 285 + lib/edbee-lib/images/doc-logo.png | Bin 0 -> 8498 bytes lib/edbee-lib/vendor/onig/.editorconfig | 42 + lib/edbee-lib/vendor/onig/.gitignore | 75 + lib/edbee-lib/vendor/onig/.travis.yml | 33 + lib/edbee-lib/vendor/onig/AUTHORS | 2 + lib/edbee-lib/vendor/onig/CMakeLists.txt | 86 + lib/edbee-lib/vendor/onig/COPYING | 87 + lib/edbee-lib/vendor/onig/HISTORY | 2673 +++ lib/edbee-lib/vendor/onig/INSTALL | 365 + lib/edbee-lib/vendor/onig/Makefile.am | 144 + lib/edbee-lib/vendor/onig/Makefile.in | 1569 ++ lib/edbee-lib/vendor/onig/README | 251 + lib/edbee-lib/vendor/onig/README.ja | 257 + lib/edbee-lib/vendor/onig/README.md | 217 + lib/edbee-lib/vendor/onig/aclocal.m4 | 1011 + lib/edbee-lib/vendor/onig/appveyor.yml | 42 + lib/edbee-lib/vendor/onig/build_nmake.cmd | 2 + lib/edbee-lib/vendor/onig/compile | 343 + lib/edbee-lib/vendor/onig/config-onig-edbee.h | 25 + lib/edbee-lib/vendor/onig/config.guess | 1459 ++ lib/edbee-lib/vendor/onig/config.h.in | 139 + lib/edbee-lib/vendor/onig/config.sub | 1823 ++ lib/edbee-lib/vendor/onig/configure | 15207 +++++++++++++ lib/edbee-lib/vendor/onig/configure.ac | 90 + lib/edbee-lib/vendor/onig/depcomp | 708 + lib/edbee-lib/vendor/onig/doc/API | 702 + lib/edbee-lib/vendor/onig/doc/API.ja | 710 + lib/edbee-lib/vendor/onig/doc/FAQ | 23 + lib/edbee-lib/vendor/onig/doc/FAQ.ja | 23 + lib/edbee-lib/vendor/onig/doc/RE | 569 + lib/edbee-lib/vendor/onig/doc/RE.ja | 565 + .../vendor/onig/doc/UnicodeProps.txt | 777 + lib/edbee-lib/vendor/onig/enc/ascii.c | 104 + lib/edbee-lib/vendor/onig/enc/big5.c | 370 + lib/edbee-lib/vendor/onig/enc/cp949.c | 218 + lib/edbee-lib/vendor/onig/enc/emacs_mule.c | 359 + lib/edbee-lib/vendor/onig/enc/euc_jp.c | 626 + lib/edbee-lib/vendor/onig/enc/euc_kr.c | 222 + lib/edbee-lib/vendor/onig/enc/euc_tw.c | 234 + lib/edbee-lib/vendor/onig/enc/gb18030.c | 663 + lib/edbee-lib/vendor/onig/enc/gb2312.c | 12 + lib/edbee-lib/vendor/onig/enc/gbk.c | 221 + lib/edbee-lib/vendor/onig/enc/iso_8859.h | 1 + lib/edbee-lib/vendor/onig/enc/iso_8859_1.c | 308 + lib/edbee-lib/vendor/onig/enc/iso_8859_10.c | 254 + lib/edbee-lib/vendor/onig/enc/iso_8859_11.c | 110 + lib/edbee-lib/vendor/onig/enc/iso_8859_13.c | 260 + lib/edbee-lib/vendor/onig/enc/iso_8859_14.c | 267 + lib/edbee-lib/vendor/onig/enc/iso_8859_15.c | 265 + lib/edbee-lib/vendor/onig/enc/iso_8859_16.c | 263 + lib/edbee-lib/vendor/onig/enc/iso_8859_2.c | 256 + lib/edbee-lib/vendor/onig/enc/iso_8859_3.c | 296 + lib/edbee-lib/vendor/onig/enc/iso_8859_4.c | 261 + lib/edbee-lib/vendor/onig/enc/iso_8859_5.c | 220 + lib/edbee-lib/vendor/onig/enc/iso_8859_6.c | 106 + lib/edbee-lib/vendor/onig/enc/iso_8859_7.c | 256 + lib/edbee-lib/vendor/onig/enc/iso_8859_8.c | 106 + lib/edbee-lib/vendor/onig/enc/iso_8859_9.c | 284 + lib/edbee-lib/vendor/onig/enc/jis/props.h | 229 + lib/edbee-lib/vendor/onig/enc/jis/props.kwd | 52 + lib/edbee-lib/vendor/onig/enc/koi8_r.c | 184 + lib/edbee-lib/vendor/onig/enc/koi8_u.c | 183 + lib/edbee-lib/vendor/onig/enc/mktable.c | 1665 ++ lib/edbee-lib/vendor/onig/enc/shift_jis.c | 67 + lib/edbee-lib/vendor/onig/enc/shift_jis.h | 541 + lib/edbee-lib/vendor/onig/enc/unicode.c | 935 + .../vendor/onig/enc/unicode/casefold.h | 9129 ++++++++ .../vendor/onig/enc/unicode/name2ctype.h | 18367 ++++++++++++++++ lib/edbee-lib/vendor/onig/enc/us_ascii.c | 41 + lib/edbee-lib/vendor/onig/enc/utf_16be.c | 263 + lib/edbee-lib/vendor/onig/enc/utf_16le.c | 253 + lib/edbee-lib/vendor/onig/enc/utf_32be.c | 210 + lib/edbee-lib/vendor/onig/enc/utf_32le.c | 210 + lib/edbee-lib/vendor/onig/enc/utf_8.c | 474 + lib/edbee-lib/vendor/onig/enc/windows_1250.c | 246 + lib/edbee-lib/vendor/onig/enc/windows_1251.c | 224 + lib/edbee-lib/vendor/onig/enc/windows_1252.c | 237 + lib/edbee-lib/vendor/onig/enc/windows_1253.c | 267 + lib/edbee-lib/vendor/onig/enc/windows_1254.c | 273 + lib/edbee-lib/vendor/onig/enc/windows_1257.c | 273 + lib/edbee-lib/vendor/onig/enc/windows_31j.c | 86 + lib/edbee-lib/vendor/onig/install-sh | 527 + lib/edbee-lib/vendor/onig/ltmain.sh | 11150 ++++++++++ lib/edbee-lib/vendor/onig/m4/libtool.m4 | 8369 +++++++ lib/edbee-lib/vendor/onig/m4/ltoptions.m4 | 437 + lib/edbee-lib/vendor/onig/m4/ltsugar.m4 | 124 + lib/edbee-lib/vendor/onig/m4/ltversion.m4 | 23 + lib/edbee-lib/vendor/onig/m4/lt~obsolete.m4 | 99 + lib/edbee-lib/vendor/onig/missing | 331 + lib/edbee-lib/vendor/onig/onig.pri | 90 + lib/edbee-lib/vendor/onig/onig.pro | 67 + .../onig/onig.xcodeproj/project.pbxproj | 1384 ++ .../onig/onig.xcodeproj/qt_makeqmake.mak | 77 + .../onig/onig.xcodeproj/qt_preprocess.mak | 55 + lib/edbee-lib/vendor/onig/onigmo-config.in | 78 + lib/edbee-lib/vendor/onig/onigmo.h | 1035 + lib/edbee-lib/vendor/onig/onigmo.pc.in | 14 + lib/edbee-lib/vendor/onig/onigmo.py | 627 + lib/edbee-lib/vendor/onig/onigmognu.h | 89 + lib/edbee-lib/vendor/onig/onigmoposix.h | 172 + lib/edbee-lib/vendor/onig/regcomp.c | 7497 +++++++ lib/edbee-lib/vendor/onig/regenc.c | 1045 + lib/edbee-lib/vendor/onig/regenc.h | 320 + lib/edbee-lib/vendor/onig/regerror.c | 483 + lib/edbee-lib/vendor/onig/regexec.c | 5382 +++++ lib/edbee-lib/vendor/onig/regext.c | 222 + lib/edbee-lib/vendor/onig/reggnu.c | 142 + lib/edbee-lib/vendor/onig/regint.h | 1024 + lib/edbee-lib/vendor/onig/regparse.c | 8064 +++++++ lib/edbee-lib/vendor/onig/regparse.h | 385 + lib/edbee-lib/vendor/onig/regposerr.c | 103 + lib/edbee-lib/vendor/onig/regposix.c | 312 + lib/edbee-lib/vendor/onig/regsyntax.c | 395 + lib/edbee-lib/vendor/onig/regtrav.c | 85 + lib/edbee-lib/vendor/onig/regversion.c | 53 + lib/edbee-lib/vendor/onig/sample/Makefile.am | 29 + lib/edbee-lib/vendor/onig/sample/Makefile.in | 596 + lib/edbee-lib/vendor/onig/sample/crnl.c | 229 + lib/edbee-lib/vendor/onig/sample/encode.c | 321 + lib/edbee-lib/vendor/onig/sample/listcap.c | 136 + lib/edbee-lib/vendor/onig/sample/names.c | 78 + lib/edbee-lib/vendor/onig/sample/posix.c | 111 + lib/edbee-lib/vendor/onig/sample/scan.c | 89 + lib/edbee-lib/vendor/onig/sample/simple.c | 64 + lib/edbee-lib/vendor/onig/sample/sql.c | 80 + lib/edbee-lib/vendor/onig/sample/syntax.c | 80 + lib/edbee-lib/vendor/onig/st.c | 2083 ++ lib/edbee-lib/vendor/onig/st.h | 179 + lib/edbee-lib/vendor/onig/test.rb | 1108 + lib/edbee-lib/vendor/onig/testc.c | 905 + lib/edbee-lib/vendor/onig/testconv.rb | 242 + lib/edbee-lib/vendor/onig/testconvu.rb | 414 + lib/edbee-lib/vendor/onig/testpy.py | 1700 ++ lib/edbee-lib/vendor/onig/testu.c | 1504 ++ lib/edbee-lib/vendor/onig/tool/.gitignore | 17 + .../vendor/onig/tool/case-folding.rb | 419 + .../vendor/onig/tool/convert-jis-props.sh | 11 + .../vendor/onig/tool/download-ucd.sh | 25 + lib/edbee-lib/vendor/onig/tool/enc-unicode.rb | 543 + lib/edbee-lib/vendor/onig/tool/update-doc.py | 144 + .../vendor/onig/win32/Makefile.mingw | 252 + lib/edbee-lib/vendor/onig/win32/config.h | 86 + lib/edbee-lib/vendor/onig/win32/makedef.py | 55 + lib/edbee-lib/vendor/onig/win32/onigmo.rc | 94 + lib/edbee-lib/vendor/onig/win32/testc.c | 905 + lib/edbee-lib/vendor/qslog/.gitignore | 2 + lib/edbee-lib/vendor/qslog/CMakeLists.txt | 118 + lib/edbee-lib/vendor/qslog/LICENSE.txt | 24 + lib/edbee-lib/vendor/qslog/QsLog.cpp | 286 + lib/edbee-lib/vendor/qslog/QsLog.h | 205 + lib/edbee-lib/vendor/qslog/QsLog.pri | 41 + lib/edbee-lib/vendor/qslog/QsLogChanges.txt | 69 + lib/edbee-lib/vendor/qslog/QsLogDest.cpp | 76 + lib/edbee-lib/vendor/qslog/QsLogDest.h | 122 + .../vendor/qslog/QsLogDestConsole.cpp | 65 + lib/edbee-lib/vendor/qslog/QsLogDestConsole.h | 56 + lib/edbee-lib/vendor/qslog/QsLogDestFile.cpp | 219 + lib/edbee-lib/vendor/qslog/QsLogDestFile.h | 123 + .../vendor/qslog/QsLogDestFunctor.cpp | 68 + lib/edbee-lib/vendor/qslog/QsLogDestFunctor.h | 66 + .../vendor/qslog/QsLogDisableForThisFile.h | 58 + lib/edbee-lib/vendor/qslog/QsLogLevel.cpp | 57 + lib/edbee-lib/vendor/qslog/QsLogLevel.h | 50 + lib/edbee-lib/vendor/qslog/QsLogMessage.cpp | 48 + lib/edbee-lib/vendor/qslog/QsLogMessage.h | 60 + .../vendor/qslog/QsLogSharedLibrary.h | 12 + .../vendor/qslog/QsLogSharedLibrary.pro | 46 + lib/edbee-lib/vendor/qslog/QsLogWindow.cpp | 309 + lib/edbee-lib/vendor/qslog/QsLogWindow.h | 82 + lib/edbee-lib/vendor/qslog/QsLogWindow.qrc | 9 + lib/edbee-lib/vendor/qslog/QsLogWindow.ui | 173 + .../vendor/qslog/QsLogWindowModel.cpp | 165 + lib/edbee-lib/vendor/qslog/QsLogWindowModel.h | 77 + lib/edbee-lib/vendor/qslog/README.md | 57 + .../vendor/qslog/cmake/FindPkgMacros.cmake | 165 + .../vendor/qslog/cmake/FindQsLog.cmake | 50 + .../qslog/cmake/QsLogConfigTargets.cmake | 52 + .../vendor/qslog/images/icon-clear-16.png | Bin 0 -> 231 bytes .../vendor/qslog/images/icon-copy-16.png | Bin 0 -> 310 bytes .../vendor/qslog/images/icon-pause-16.png | Bin 0 -> 269 bytes .../vendor/qslog/images/icon-resume-16.png | Bin 0 -> 316 bytes .../vendor/qslog/images/icon-save-16.png | Bin 0 -> 186 bytes lib/edbee-lib/vendor/qslog/source.txt | 1 + .../vendor/qslog/unittest/CMakeLists.txt | 37 + .../qslog/unittest/QtTestUtil/QtTestUtil.h | 31 + .../unittest/QtTestUtil/SimpleChecker.cpp | 18 + .../unittest/QtTestUtil/TestRegistration.h | 39 + .../unittest/QtTestUtil/TestRegistry.cpp | 35 + .../qslog/unittest/QtTestUtil/TestRegistry.h | 51 + .../vendor/qslog/unittest/TestLog.cpp | 349 + lib/edbee-lib/vendor/qslog/unittest/TestLog.h | 160 + .../vendor/qslog/unittest/unittest.pro | 29 + lib/simde/CMakeLists.txt | 14 + 489 files changed, 237432 insertions(+), 7632 deletions(-) create mode 100644 app/rcc/edbee/README.md create mode 100644 app/rcc/edbee/config/default.json create mode 100644 app/rcc/edbee/config/default.osx.json create mode 100644 app/rcc/edbee/config/default.win.json create mode 100644 app/rcc/edbee/config/default.x11.json create mode 100644 app/rcc/edbee/keymaps/default.json create mode 100644 app/rcc/edbee/keymaps/default.osx.json create mode 100644 app/rcc/edbee/keymaps/default.win32.json create mode 100644 app/rcc/edbee/syntaxfiles/ASP.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/ActionScript.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/AppleScript.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Batch File.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Bibtex.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Build.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/C#.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/C++.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/C.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/CSS.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Clojure.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/CoffeeScript.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/D.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/DOT.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Diff.tmLanguage create mode 100755 app/rcc/edbee/syntaxfiles/Doxyfile.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Erlang.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Go.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Groovy.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/HTML-ASP.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/HTML.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Haskell.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Java.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/JavaDoc.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/JavaScript.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/LaTeX Beamer.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/LaTeX.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Lisp.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Lua.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Makefile.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Markdown.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Matlab.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/MultiMarkdown.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/OCamlyacc.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Objective-C++.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Objective-C.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/PHP.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Perl.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Plain text.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Python.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/R Console.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Rd (R Documentation).tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/RegExp.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Ruby Haml.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Ruby on Rails.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Ruby.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Rust.tmLanguage.json create mode 100644 app/rcc/edbee/syntaxfiles/SCSS.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/SQL.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Scala.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Shell-Unix-Generic.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Tcl.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/TeX Math.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/TeX.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/Textile.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/XML.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/XSL.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/YAML.tmLanguage create mode 100644 app/rcc/edbee/syntaxfiles/reStructuredText.tmLanguage create mode 100644 app/rcc/edbee/themes/All Hallow's Eve.tmTheme create mode 100644 app/rcc/edbee/themes/Amy.tmTheme create mode 100644 app/rcc/edbee/themes/Blackboard.tmTheme create mode 100644 app/rcc/edbee/themes/Brilliance_Black.tmTheme create mode 100644 app/rcc/edbee/themes/Brilliance_Dull.tmTheme create mode 100644 app/rcc/edbee/themes/Cobalt.tmTheme create mode 100644 app/rcc/edbee/themes/Dawn.tmTheme create mode 100644 app/rcc/edbee/themes/Eiffel.tmTheme create mode 100644 app/rcc/edbee/themes/Espresso Libre.tmTheme create mode 100644 app/rcc/edbee/themes/IDLE.tmTheme create mode 100644 app/rcc/edbee/themes/LAZY.tmTheme create mode 100644 app/rcc/edbee/themes/Mac Classic.tmTheme create mode 100644 app/rcc/edbee/themes/MagicWB (Amiga).tmTheme create mode 100644 app/rcc/edbee/themes/Monokai Bright.tmTheme create mode 100644 app/rcc/edbee/themes/Monokai.tmTheme create mode 100644 app/rcc/edbee/themes/Pastels on Dark.tmTheme create mode 100644 app/rcc/edbee/themes/Solarized (Dark).tmTheme create mode 100644 app/rcc/edbee/themes/Solarized (Light).tmTheme create mode 100644 app/rcc/edbee/themes/SpaceCadet.tmTheme create mode 100644 app/rcc/edbee/themes/Sunburst.tmTheme create mode 100644 app/rcc/edbee/themes/Twilight.tmTheme create mode 100644 app/rcc/edbee/themes/Zenburnesque.tmTheme create mode 100644 app/rcc/edbee/themes/iPlastic.tmTheme delete mode 100644 lib/QSourceHighlite/.clang-format delete mode 100755 lib/QSourceHighlite/.gitignore delete mode 100644 lib/QSourceHighlite/CMakeLists.txt delete mode 100755 lib/QSourceHighlite/LICENSE delete mode 100755 lib/QSourceHighlite/README.md delete mode 100644 lib/QSourceHighlite/languagedata.cpp delete mode 100644 lib/QSourceHighlite/languagedata.h delete mode 100644 lib/QSourceHighlite/qsourcehighliter.cpp delete mode 100644 lib/QSourceHighlite/qsourcehighliter.h delete mode 100644 lib/QSourceHighlite/qsourcehighliterthemes.cpp delete mode 100644 lib/QSourceHighlite/qsourcehighliterthemes.h create mode 100644 lib/edbee-lib/CMakeLists.txt create mode 100644 lib/edbee-lib/Doxyfile create mode 100644 lib/edbee-lib/doc/coding-style.md create mode 100644 lib/edbee-lib/doc/index.md create mode 100644 lib/edbee-lib/edbee-lib.pri create mode 100644 lib/edbee-lib/edbee-lib.pro create mode 100644 lib/edbee-lib/edbee/commands/commentcommand.cpp create mode 100644 lib/edbee-lib/edbee/commands/commentcommand.h create mode 100644 lib/edbee-lib/edbee/commands/copycommand.cpp create mode 100644 lib/edbee-lib/edbee/commands/copycommand.h create mode 100644 lib/edbee-lib/edbee/commands/cutcommand.cpp create mode 100644 lib/edbee-lib/edbee/commands/cutcommand.h create mode 100644 lib/edbee-lib/edbee/commands/debugcommand.cpp create mode 100644 lib/edbee-lib/edbee/commands/debugcommand.h create mode 100644 lib/edbee-lib/edbee/commands/duplicatecommand.cpp create mode 100644 lib/edbee-lib/edbee/commands/duplicatecommand.h create mode 100644 lib/edbee-lib/edbee/commands/findcommand.cpp create mode 100644 lib/edbee-lib/edbee/commands/findcommand.h create mode 100644 lib/edbee-lib/edbee/commands/movelinecommand.cpp create mode 100644 lib/edbee-lib/edbee/commands/movelinecommand.h create mode 100644 lib/edbee-lib/edbee/commands/newlinecommand.cpp create mode 100644 lib/edbee-lib/edbee/commands/newlinecommand.h create mode 100644 lib/edbee-lib/edbee/commands/pastecommand.cpp create mode 100644 lib/edbee-lib/edbee/commands/pastecommand.h create mode 100644 lib/edbee-lib/edbee/commands/redocommand.cpp create mode 100644 lib/edbee-lib/edbee/commands/redocommand.h create mode 100644 lib/edbee-lib/edbee/commands/removecommand.cpp create mode 100644 lib/edbee-lib/edbee/commands/removecommand.h create mode 100644 lib/edbee-lib/edbee/commands/replaceselectioncommand.cpp create mode 100644 lib/edbee-lib/edbee/commands/replaceselectioncommand.h create mode 100644 lib/edbee-lib/edbee/commands/selectioncommand.cpp create mode 100644 lib/edbee-lib/edbee/commands/selectioncommand.h create mode 100644 lib/edbee-lib/edbee/commands/tabcommand.cpp create mode 100644 lib/edbee-lib/edbee/commands/tabcommand.h create mode 100644 lib/edbee-lib/edbee/commands/togglereadonlycommand.cpp create mode 100644 lib/edbee-lib/edbee/commands/togglereadonlycommand.h create mode 100644 lib/edbee-lib/edbee/commands/undocommand.cpp create mode 100644 lib/edbee-lib/edbee/commands/undocommand.h create mode 100644 lib/edbee-lib/edbee/data/factorycommandmap.cpp create mode 100644 lib/edbee-lib/edbee/data/factorycommandmap.h create mode 100644 lib/edbee-lib/edbee/data/factorykeymap.cpp create mode 100644 lib/edbee-lib/edbee/data/factorykeymap.h create mode 100644 lib/edbee-lib/edbee/debug.h create mode 100644 lib/edbee-lib/edbee/edbee.cpp create mode 100644 lib/edbee-lib/edbee/edbee.h create mode 100644 lib/edbee-lib/edbee/exports.h create mode 100644 lib/edbee-lib/edbee/io/baseplistparser.cpp create mode 100644 lib/edbee-lib/edbee/io/baseplistparser.h create mode 100644 lib/edbee-lib/edbee/io/jsonparser.cpp create mode 100644 lib/edbee-lib/edbee/io/jsonparser.h create mode 100644 lib/edbee-lib/edbee/io/keymapparser.cpp create mode 100644 lib/edbee-lib/edbee/io/keymapparser.h create mode 100644 lib/edbee-lib/edbee/io/textdocumentserializer.cpp create mode 100644 lib/edbee-lib/edbee/io/textdocumentserializer.h create mode 100644 lib/edbee-lib/edbee/io/tmlanguageparser.cpp create mode 100644 lib/edbee-lib/edbee/io/tmlanguageparser.h create mode 100644 lib/edbee-lib/edbee/io/tmthemeparser.cpp create mode 100644 lib/edbee-lib/edbee/io/tmthemeparser.h create mode 100644 lib/edbee-lib/edbee/lexers/grammartextlexer.cpp create mode 100644 lib/edbee-lib/edbee/lexers/grammartextlexer.h create mode 100644 lib/edbee-lib/edbee/models/change.cpp create mode 100644 lib/edbee-lib/edbee/models/change.h create mode 100644 lib/edbee-lib/edbee/models/changes/abstractrangedchange.cpp create mode 100644 lib/edbee-lib/edbee/models/changes/abstractrangedchange.h create mode 100644 lib/edbee-lib/edbee/models/changes/linedatachange.cpp create mode 100644 lib/edbee-lib/edbee/models/changes/linedatachange.h create mode 100644 lib/edbee-lib/edbee/models/changes/linedatalistchange.cpp create mode 100644 lib/edbee-lib/edbee/models/changes/linedatalistchange.h create mode 100644 lib/edbee-lib/edbee/models/changes/mergablechangegroup.cpp create mode 100644 lib/edbee-lib/edbee/models/changes/mergablechangegroup.h create mode 100644 lib/edbee-lib/edbee/models/changes/selectionchange.cpp create mode 100644 lib/edbee-lib/edbee/models/changes/selectionchange.h create mode 100644 lib/edbee-lib/edbee/models/changes/textchange.cpp create mode 100644 lib/edbee-lib/edbee/models/changes/textchange.h create mode 100644 lib/edbee-lib/edbee/models/changes/textchangewithcaret.cpp create mode 100644 lib/edbee-lib/edbee/models/changes/textchangewithcaret.h create mode 100644 lib/edbee-lib/edbee/models/chardocument/chartextbuffer.cpp create mode 100644 lib/edbee-lib/edbee/models/chardocument/chartextbuffer.h create mode 100644 lib/edbee-lib/edbee/models/chardocument/chartextdocument.cpp create mode 100644 lib/edbee-lib/edbee/models/chardocument/chartextdocument.h create mode 100644 lib/edbee-lib/edbee/models/dynamicvariables.cpp create mode 100644 lib/edbee-lib/edbee/models/dynamicvariables.h create mode 100644 lib/edbee-lib/edbee/models/textautocompleteprovider.cpp create mode 100644 lib/edbee-lib/edbee/models/textautocompleteprovider.h create mode 100644 lib/edbee-lib/edbee/models/textbuffer.cpp create mode 100644 lib/edbee-lib/edbee/models/textbuffer.h create mode 100644 lib/edbee-lib/edbee/models/textdocument.cpp create mode 100644 lib/edbee-lib/edbee/models/textdocument.h create mode 100644 lib/edbee-lib/edbee/models/textdocumentfilter.cpp create mode 100644 lib/edbee-lib/edbee/models/textdocumentfilter.h create mode 100644 lib/edbee-lib/edbee/models/textdocumentscopes.cpp create mode 100644 lib/edbee-lib/edbee/models/textdocumentscopes.h create mode 100644 lib/edbee-lib/edbee/models/texteditorcommandmap.cpp create mode 100644 lib/edbee-lib/edbee/models/texteditorcommandmap.h create mode 100644 lib/edbee-lib/edbee/models/texteditorconfig.cpp create mode 100644 lib/edbee-lib/edbee/models/texteditorconfig.h create mode 100644 lib/edbee-lib/edbee/models/texteditorkeymap.cpp create mode 100644 lib/edbee-lib/edbee/models/texteditorkeymap.h create mode 100644 lib/edbee-lib/edbee/models/textgrammar.cpp create mode 100644 lib/edbee-lib/edbee/models/textgrammar.h create mode 100644 lib/edbee-lib/edbee/models/textlexer.cpp create mode 100644 lib/edbee-lib/edbee/models/textlexer.h create mode 100644 lib/edbee-lib/edbee/models/textlinedata.cpp create mode 100644 lib/edbee-lib/edbee/models/textlinedata.h create mode 100644 lib/edbee-lib/edbee/models/textrange.cpp create mode 100644 lib/edbee-lib/edbee/models/textrange.h create mode 100644 lib/edbee-lib/edbee/models/textsearcher.cpp create mode 100644 lib/edbee-lib/edbee/models/textsearcher.h create mode 100644 lib/edbee-lib/edbee/models/textundostack.cpp create mode 100644 lib/edbee-lib/edbee/models/textundostack.h create mode 100644 lib/edbee-lib/edbee/texteditorcommand.cpp create mode 100644 lib/edbee-lib/edbee/texteditorcommand.h create mode 100644 lib/edbee-lib/edbee/texteditorcontroller.cpp create mode 100644 lib/edbee-lib/edbee/texteditorcontroller.h create mode 100644 lib/edbee-lib/edbee/texteditorwidget.cpp create mode 100644 lib/edbee-lib/edbee/texteditorwidget.h create mode 100644 lib/edbee-lib/edbee/util/cascadingqvariantmap.cpp create mode 100644 lib/edbee-lib/edbee/util/cascadingqvariantmap.h create mode 100644 lib/edbee-lib/edbee/util/gapvector.h create mode 100644 lib/edbee-lib/edbee/util/lineending.cpp create mode 100644 lib/edbee-lib/edbee/util/lineending.h create mode 100644 lib/edbee-lib/edbee/util/lineoffsetvector.cpp create mode 100644 lib/edbee-lib/edbee/util/lineoffsetvector.h create mode 100644 lib/edbee-lib/edbee/util/logging.h create mode 100644 lib/edbee-lib/edbee/util/mem/debug_allocs.cpp create mode 100644 lib/edbee-lib/edbee/util/mem/debug_allocs.h create mode 100644 lib/edbee-lib/edbee/util/mem/debug_new.cpp create mode 100644 lib/edbee-lib/edbee/util/mem/debug_new.h create mode 100644 lib/edbee-lib/edbee/util/rangelineiterator.cpp create mode 100644 lib/edbee-lib/edbee/util/rangelineiterator.h create mode 100644 lib/edbee-lib/edbee/util/rangesetlineiterator.cpp create mode 100644 lib/edbee-lib/edbee/util/rangesetlineiterator.h create mode 100644 lib/edbee-lib/edbee/util/regexp.cpp create mode 100644 lib/edbee-lib/edbee/util/regexp.h create mode 100644 lib/edbee-lib/edbee/util/simpleprofiler.cpp create mode 100644 lib/edbee-lib/edbee/util/simpleprofiler.h create mode 100644 lib/edbee-lib/edbee/util/test.cpp create mode 100644 lib/edbee-lib/edbee/util/test.h create mode 100644 lib/edbee-lib/edbee/util/textcodec.cpp create mode 100644 lib/edbee-lib/edbee/util/textcodec.h create mode 100644 lib/edbee-lib/edbee/util/textcodecdetector.cpp create mode 100644 lib/edbee-lib/edbee/util/textcodecdetector.h create mode 100644 lib/edbee-lib/edbee/util/util.cpp create mode 100644 lib/edbee-lib/edbee/util/util.h create mode 100644 lib/edbee-lib/edbee/views/accessibletexteditorwidget.cpp create mode 100644 lib/edbee-lib/edbee/views/accessibletexteditorwidget.h create mode 100644 lib/edbee-lib/edbee/views/components/texteditorautocompletecomponent.cpp create mode 100644 lib/edbee-lib/edbee/views/components/texteditorautocompletecomponent.h create mode 100644 lib/edbee-lib/edbee/views/components/texteditorcomponent.cpp create mode 100644 lib/edbee-lib/edbee/views/components/texteditorcomponent.h create mode 100644 lib/edbee-lib/edbee/views/components/texteditorrenderer.cpp create mode 100644 lib/edbee-lib/edbee/views/components/texteditorrenderer.h create mode 100644 lib/edbee-lib/edbee/views/components/textmargincomponent.cpp create mode 100644 lib/edbee-lib/edbee/views/components/textmargincomponent.h create mode 100644 lib/edbee-lib/edbee/views/textcaretcache.cpp create mode 100644 lib/edbee-lib/edbee/views/textcaretcache.h create mode 100644 lib/edbee-lib/edbee/views/texteditorscrollarea.cpp create mode 100644 lib/edbee-lib/edbee/views/texteditorscrollarea.h create mode 100644 lib/edbee-lib/edbee/views/textlayout.cpp create mode 100644 lib/edbee-lib/edbee/views/textlayout.h create mode 100644 lib/edbee-lib/edbee/views/textrenderer.cpp create mode 100644 lib/edbee-lib/edbee/views/textrenderer.h create mode 100644 lib/edbee-lib/edbee/views/textselection.cpp create mode 100644 lib/edbee-lib/edbee/views/textselection.h create mode 100644 lib/edbee-lib/edbee/views/texttheme.cpp create mode 100644 lib/edbee-lib/edbee/views/texttheme.h create mode 100644 lib/edbee-lib/images/doc-logo.png create mode 100644 lib/edbee-lib/vendor/onig/.editorconfig create mode 100644 lib/edbee-lib/vendor/onig/.gitignore create mode 100644 lib/edbee-lib/vendor/onig/.travis.yml create mode 100644 lib/edbee-lib/vendor/onig/AUTHORS create mode 100644 lib/edbee-lib/vendor/onig/CMakeLists.txt create mode 100644 lib/edbee-lib/vendor/onig/COPYING create mode 100644 lib/edbee-lib/vendor/onig/HISTORY create mode 100644 lib/edbee-lib/vendor/onig/INSTALL create mode 100644 lib/edbee-lib/vendor/onig/Makefile.am create mode 100644 lib/edbee-lib/vendor/onig/Makefile.in create mode 100644 lib/edbee-lib/vendor/onig/README create mode 100644 lib/edbee-lib/vendor/onig/README.ja create mode 100644 lib/edbee-lib/vendor/onig/README.md create mode 100644 lib/edbee-lib/vendor/onig/aclocal.m4 create mode 100644 lib/edbee-lib/vendor/onig/appveyor.yml create mode 100644 lib/edbee-lib/vendor/onig/build_nmake.cmd create mode 100755 lib/edbee-lib/vendor/onig/compile create mode 100644 lib/edbee-lib/vendor/onig/config-onig-edbee.h create mode 100755 lib/edbee-lib/vendor/onig/config.guess create mode 100644 lib/edbee-lib/vendor/onig/config.h.in create mode 100755 lib/edbee-lib/vendor/onig/config.sub create mode 100755 lib/edbee-lib/vendor/onig/configure create mode 100644 lib/edbee-lib/vendor/onig/configure.ac create mode 100755 lib/edbee-lib/vendor/onig/depcomp create mode 100644 lib/edbee-lib/vendor/onig/doc/API create mode 100644 lib/edbee-lib/vendor/onig/doc/API.ja create mode 100644 lib/edbee-lib/vendor/onig/doc/FAQ create mode 100644 lib/edbee-lib/vendor/onig/doc/FAQ.ja create mode 100644 lib/edbee-lib/vendor/onig/doc/RE create mode 100644 lib/edbee-lib/vendor/onig/doc/RE.ja create mode 100644 lib/edbee-lib/vendor/onig/doc/UnicodeProps.txt create mode 100644 lib/edbee-lib/vendor/onig/enc/ascii.c create mode 100644 lib/edbee-lib/vendor/onig/enc/big5.c create mode 100644 lib/edbee-lib/vendor/onig/enc/cp949.c create mode 100644 lib/edbee-lib/vendor/onig/enc/emacs_mule.c create mode 100644 lib/edbee-lib/vendor/onig/enc/euc_jp.c create mode 100644 lib/edbee-lib/vendor/onig/enc/euc_kr.c create mode 100644 lib/edbee-lib/vendor/onig/enc/euc_tw.c create mode 100644 lib/edbee-lib/vendor/onig/enc/gb18030.c create mode 100644 lib/edbee-lib/vendor/onig/enc/gb2312.c create mode 100644 lib/edbee-lib/vendor/onig/enc/gbk.c create mode 100644 lib/edbee-lib/vendor/onig/enc/iso_8859.h create mode 100644 lib/edbee-lib/vendor/onig/enc/iso_8859_1.c create mode 100644 lib/edbee-lib/vendor/onig/enc/iso_8859_10.c create mode 100644 lib/edbee-lib/vendor/onig/enc/iso_8859_11.c create mode 100644 lib/edbee-lib/vendor/onig/enc/iso_8859_13.c create mode 100644 lib/edbee-lib/vendor/onig/enc/iso_8859_14.c create mode 100644 lib/edbee-lib/vendor/onig/enc/iso_8859_15.c create mode 100644 lib/edbee-lib/vendor/onig/enc/iso_8859_16.c create mode 100644 lib/edbee-lib/vendor/onig/enc/iso_8859_2.c create mode 100644 lib/edbee-lib/vendor/onig/enc/iso_8859_3.c create mode 100644 lib/edbee-lib/vendor/onig/enc/iso_8859_4.c create mode 100644 lib/edbee-lib/vendor/onig/enc/iso_8859_5.c create mode 100644 lib/edbee-lib/vendor/onig/enc/iso_8859_6.c create mode 100644 lib/edbee-lib/vendor/onig/enc/iso_8859_7.c create mode 100644 lib/edbee-lib/vendor/onig/enc/iso_8859_8.c create mode 100644 lib/edbee-lib/vendor/onig/enc/iso_8859_9.c create mode 100644 lib/edbee-lib/vendor/onig/enc/jis/props.h create mode 100644 lib/edbee-lib/vendor/onig/enc/jis/props.kwd create mode 100644 lib/edbee-lib/vendor/onig/enc/koi8_r.c create mode 100644 lib/edbee-lib/vendor/onig/enc/koi8_u.c create mode 100644 lib/edbee-lib/vendor/onig/enc/mktable.c create mode 100644 lib/edbee-lib/vendor/onig/enc/shift_jis.c create mode 100644 lib/edbee-lib/vendor/onig/enc/shift_jis.h create mode 100644 lib/edbee-lib/vendor/onig/enc/unicode.c create mode 100644 lib/edbee-lib/vendor/onig/enc/unicode/casefold.h create mode 100644 lib/edbee-lib/vendor/onig/enc/unicode/name2ctype.h create mode 100644 lib/edbee-lib/vendor/onig/enc/us_ascii.c create mode 100644 lib/edbee-lib/vendor/onig/enc/utf_16be.c create mode 100644 lib/edbee-lib/vendor/onig/enc/utf_16le.c create mode 100644 lib/edbee-lib/vendor/onig/enc/utf_32be.c create mode 100644 lib/edbee-lib/vendor/onig/enc/utf_32le.c create mode 100644 lib/edbee-lib/vendor/onig/enc/utf_8.c create mode 100644 lib/edbee-lib/vendor/onig/enc/windows_1250.c create mode 100644 lib/edbee-lib/vendor/onig/enc/windows_1251.c create mode 100644 lib/edbee-lib/vendor/onig/enc/windows_1252.c create mode 100644 lib/edbee-lib/vendor/onig/enc/windows_1253.c create mode 100644 lib/edbee-lib/vendor/onig/enc/windows_1254.c create mode 100644 lib/edbee-lib/vendor/onig/enc/windows_1257.c create mode 100644 lib/edbee-lib/vendor/onig/enc/windows_31j.c create mode 100755 lib/edbee-lib/vendor/onig/install-sh create mode 100644 lib/edbee-lib/vendor/onig/ltmain.sh create mode 100644 lib/edbee-lib/vendor/onig/m4/libtool.m4 create mode 100644 lib/edbee-lib/vendor/onig/m4/ltoptions.m4 create mode 100644 lib/edbee-lib/vendor/onig/m4/ltsugar.m4 create mode 100644 lib/edbee-lib/vendor/onig/m4/ltversion.m4 create mode 100644 lib/edbee-lib/vendor/onig/m4/lt~obsolete.m4 create mode 100755 lib/edbee-lib/vendor/onig/missing create mode 100644 lib/edbee-lib/vendor/onig/onig.pri create mode 100644 lib/edbee-lib/vendor/onig/onig.pro create mode 100644 lib/edbee-lib/vendor/onig/onig.xcodeproj/project.pbxproj create mode 100644 lib/edbee-lib/vendor/onig/onig.xcodeproj/qt_makeqmake.mak create mode 100644 lib/edbee-lib/vendor/onig/onig.xcodeproj/qt_preprocess.mak create mode 100644 lib/edbee-lib/vendor/onig/onigmo-config.in create mode 100644 lib/edbee-lib/vendor/onig/onigmo.h create mode 100644 lib/edbee-lib/vendor/onig/onigmo.pc.in create mode 100644 lib/edbee-lib/vendor/onig/onigmo.py create mode 100644 lib/edbee-lib/vendor/onig/onigmognu.h create mode 100644 lib/edbee-lib/vendor/onig/onigmoposix.h create mode 100644 lib/edbee-lib/vendor/onig/regcomp.c create mode 100644 lib/edbee-lib/vendor/onig/regenc.c create mode 100644 lib/edbee-lib/vendor/onig/regenc.h create mode 100644 lib/edbee-lib/vendor/onig/regerror.c create mode 100644 lib/edbee-lib/vendor/onig/regexec.c create mode 100644 lib/edbee-lib/vendor/onig/regext.c create mode 100644 lib/edbee-lib/vendor/onig/reggnu.c create mode 100644 lib/edbee-lib/vendor/onig/regint.h create mode 100644 lib/edbee-lib/vendor/onig/regparse.c create mode 100644 lib/edbee-lib/vendor/onig/regparse.h create mode 100644 lib/edbee-lib/vendor/onig/regposerr.c create mode 100644 lib/edbee-lib/vendor/onig/regposix.c create mode 100644 lib/edbee-lib/vendor/onig/regsyntax.c create mode 100644 lib/edbee-lib/vendor/onig/regtrav.c create mode 100644 lib/edbee-lib/vendor/onig/regversion.c create mode 100644 lib/edbee-lib/vendor/onig/sample/Makefile.am create mode 100644 lib/edbee-lib/vendor/onig/sample/Makefile.in create mode 100644 lib/edbee-lib/vendor/onig/sample/crnl.c create mode 100644 lib/edbee-lib/vendor/onig/sample/encode.c create mode 100644 lib/edbee-lib/vendor/onig/sample/listcap.c create mode 100644 lib/edbee-lib/vendor/onig/sample/names.c create mode 100644 lib/edbee-lib/vendor/onig/sample/posix.c create mode 100644 lib/edbee-lib/vendor/onig/sample/scan.c create mode 100644 lib/edbee-lib/vendor/onig/sample/simple.c create mode 100644 lib/edbee-lib/vendor/onig/sample/sql.c create mode 100644 lib/edbee-lib/vendor/onig/sample/syntax.c create mode 100644 lib/edbee-lib/vendor/onig/st.c create mode 100644 lib/edbee-lib/vendor/onig/st.h create mode 100644 lib/edbee-lib/vendor/onig/test.rb create mode 100644 lib/edbee-lib/vendor/onig/testc.c create mode 100755 lib/edbee-lib/vendor/onig/testconv.rb create mode 100755 lib/edbee-lib/vendor/onig/testconvu.rb create mode 100755 lib/edbee-lib/vendor/onig/testpy.py create mode 100644 lib/edbee-lib/vendor/onig/testu.c create mode 100644 lib/edbee-lib/vendor/onig/tool/.gitignore create mode 100755 lib/edbee-lib/vendor/onig/tool/case-folding.rb create mode 100755 lib/edbee-lib/vendor/onig/tool/convert-jis-props.sh create mode 100755 lib/edbee-lib/vendor/onig/tool/download-ucd.sh create mode 100755 lib/edbee-lib/vendor/onig/tool/enc-unicode.rb create mode 100755 lib/edbee-lib/vendor/onig/tool/update-doc.py create mode 100644 lib/edbee-lib/vendor/onig/win32/Makefile.mingw create mode 100644 lib/edbee-lib/vendor/onig/win32/config.h create mode 100755 lib/edbee-lib/vendor/onig/win32/makedef.py create mode 100644 lib/edbee-lib/vendor/onig/win32/onigmo.rc create mode 100644 lib/edbee-lib/vendor/onig/win32/testc.c create mode 100644 lib/edbee-lib/vendor/qslog/.gitignore create mode 100644 lib/edbee-lib/vendor/qslog/CMakeLists.txt create mode 100644 lib/edbee-lib/vendor/qslog/LICENSE.txt create mode 100644 lib/edbee-lib/vendor/qslog/QsLog.cpp create mode 100644 lib/edbee-lib/vendor/qslog/QsLog.h create mode 100644 lib/edbee-lib/vendor/qslog/QsLog.pri create mode 100644 lib/edbee-lib/vendor/qslog/QsLogChanges.txt create mode 100644 lib/edbee-lib/vendor/qslog/QsLogDest.cpp create mode 100644 lib/edbee-lib/vendor/qslog/QsLogDest.h create mode 100644 lib/edbee-lib/vendor/qslog/QsLogDestConsole.cpp create mode 100644 lib/edbee-lib/vendor/qslog/QsLogDestConsole.h create mode 100644 lib/edbee-lib/vendor/qslog/QsLogDestFile.cpp create mode 100644 lib/edbee-lib/vendor/qslog/QsLogDestFile.h create mode 100644 lib/edbee-lib/vendor/qslog/QsLogDestFunctor.cpp create mode 100644 lib/edbee-lib/vendor/qslog/QsLogDestFunctor.h create mode 100644 lib/edbee-lib/vendor/qslog/QsLogDisableForThisFile.h create mode 100644 lib/edbee-lib/vendor/qslog/QsLogLevel.cpp create mode 100644 lib/edbee-lib/vendor/qslog/QsLogLevel.h create mode 100644 lib/edbee-lib/vendor/qslog/QsLogMessage.cpp create mode 100644 lib/edbee-lib/vendor/qslog/QsLogMessage.h create mode 100644 lib/edbee-lib/vendor/qslog/QsLogSharedLibrary.h create mode 100644 lib/edbee-lib/vendor/qslog/QsLogSharedLibrary.pro create mode 100644 lib/edbee-lib/vendor/qslog/QsLogWindow.cpp create mode 100644 lib/edbee-lib/vendor/qslog/QsLogWindow.h create mode 100644 lib/edbee-lib/vendor/qslog/QsLogWindow.qrc create mode 100644 lib/edbee-lib/vendor/qslog/QsLogWindow.ui create mode 100644 lib/edbee-lib/vendor/qslog/QsLogWindowModel.cpp create mode 100644 lib/edbee-lib/vendor/qslog/QsLogWindowModel.h create mode 100644 lib/edbee-lib/vendor/qslog/README.md create mode 100644 lib/edbee-lib/vendor/qslog/cmake/FindPkgMacros.cmake create mode 100644 lib/edbee-lib/vendor/qslog/cmake/FindQsLog.cmake create mode 100644 lib/edbee-lib/vendor/qslog/cmake/QsLogConfigTargets.cmake create mode 100644 lib/edbee-lib/vendor/qslog/images/icon-clear-16.png create mode 100644 lib/edbee-lib/vendor/qslog/images/icon-copy-16.png create mode 100644 lib/edbee-lib/vendor/qslog/images/icon-pause-16.png create mode 100644 lib/edbee-lib/vendor/qslog/images/icon-resume-16.png create mode 100644 lib/edbee-lib/vendor/qslog/images/icon-save-16.png create mode 100644 lib/edbee-lib/vendor/qslog/source.txt create mode 100644 lib/edbee-lib/vendor/qslog/unittest/CMakeLists.txt create mode 100644 lib/edbee-lib/vendor/qslog/unittest/QtTestUtil/QtTestUtil.h create mode 100644 lib/edbee-lib/vendor/qslog/unittest/QtTestUtil/SimpleChecker.cpp create mode 100644 lib/edbee-lib/vendor/qslog/unittest/QtTestUtil/TestRegistration.h create mode 100644 lib/edbee-lib/vendor/qslog/unittest/QtTestUtil/TestRegistry.cpp create mode 100644 lib/edbee-lib/vendor/qslog/unittest/QtTestUtil/TestRegistry.h create mode 100644 lib/edbee-lib/vendor/qslog/unittest/TestLog.cpp create mode 100644 lib/edbee-lib/vendor/qslog/unittest/TestLog.h create mode 100644 lib/edbee-lib/vendor/qslog/unittest/unittest.pro diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 765dfe26..43983f23 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -180,11 +180,16 @@ jobs: with: node-version: 20 + - name: '⚙️ Install OpenMp' + run: | + brew update + brew install llvm libomp + - name: '🚧 Configure with CMake' run: | mkdir build cd build - cmake ../ -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 -DCMAKE_OSX_ARCHITECTURES="arm64" + cmake ../ -DCMAKE_C_COMPILER="/opt/homebrew/opt/llvm/bin/clang" -DCMAKE_CXX_COMPILER="/opt/homebrew/opt/llvm/bin/clang++" -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 -DCMAKE_OSX_ARCHITECTURES="arm64" - name: '🚧 Build application' run: | @@ -239,7 +244,7 @@ jobs: # - # macOS (arm64) build + # macOS (intel) build # build-mac-x86_64: runs-on: macos-latest @@ -266,11 +271,16 @@ jobs: with: node-version: 20 + - name: '⚙️ Install OpenMp' + run: | + brew update + brew install llvm libomp + - name: '🚧 Configure with CMake' run: | mkdir build cd build - cmake ../ -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 -DCMAKE_OSX_ARCHITECTURES="x86_64" + cmake ../ -DCMAKE_C_COMPILER="/opt/homebrew/opt/llvm/bin/clang" -DCMAKE_CXX_COMPILER="/opt/homebrew/opt/llvm/bin/clang++" -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 -DCMAKE_OSX_ARCHITECTURES="x86_64" - name: '🚧 Build application' run: | diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 00c8d66c..07ce8a9c 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -54,6 +54,7 @@ find_package( Location Bluetooth SerialPort + Core5Compat Positioning PrintSupport LinguistTools @@ -63,7 +64,7 @@ find_package( qt_standard_project_setup() qt_policy(SET QTP0001 NEW) -qt_policy(SET QTP0004 NEW) +#qt_policy(SET QTP0004 NEW) #------------------------------------------------------------------------------- # Import source code @@ -223,15 +224,16 @@ target_link_libraries( Qt6::Location Qt6::Bluetooth Qt6::SerialPort + Qt6::Core5Compat Qt6::Positioning Qt6::PrintSupport Qt6::QuickControls2 simde qmqtt + edbee-lib QRealFourier QSimpleUpdater - QSourceHighlite ) target_link_openssl( diff --git a/app/qml/ProjectEditor/Views/FrameParserView.qml b/app/qml/ProjectEditor/Views/FrameParserView.qml index b20ebd4e..53d56e57 100644 --- a/app/qml/ProjectEditor/Views/FrameParserView.qml +++ b/app/qml/ProjectEditor/Views/FrameParserView.qml @@ -236,8 +236,8 @@ Widgets.Pane { text: qsTr("Undo") toolbarButton: false onClicked: frameParser.undo() - enabled: frameParser.isModified Layout.alignment: Qt.AlignVCenter + enabled: frameParser.undoAvailable icon.source: "qrc:/rcc/icons/code-editor/undo.svg" } @@ -249,8 +249,8 @@ Widgets.Pane { text: qsTr("Redo") toolbarButton: false onClicked: frameParser.redo() - enabled: frameParser.isModified Layout.alignment: Qt.AlignVCenter + enabled: frameParser.redoAvailable icon.source: "qrc:/rcc/icons/code-editor/redo.svg" } diff --git a/app/rcc/edbee/README.md b/app/rcc/edbee/README.md new file mode 100644 index 00000000..f7093cdc --- /dev/null +++ b/app/rcc/edbee/README.md @@ -0,0 +1,15 @@ +edbee-data +========== + +These are the data files used by the [edbee application](https://github.com/edbee/edbee-app). + +Originally these files were bundled in the code tree of edbee. Because most of these files have external origins, and are not required to use edbee, these are seperated into it's own repository. + +The data consists out of + * syntaxfiles: Here are some example Textmate grammar files. More definition can be found here on github. + * themes: Here are some example Textmate Theme files. Used for syntax highlighting. + * keymaps: These are the default keymaps used by edbee. + * config: These are the default configuration settings for edbee. + + + diff --git a/app/rcc/edbee/config/default.json b/app/rcc/edbee/config/default.json new file mode 100644 index 00000000..95dbf8d7 --- /dev/null +++ b/app/rcc/edbee/config/default.json @@ -0,0 +1,21 @@ +{ + "auto_reveal": false // When autoreveal is enabled it syncs the sidebar with the selected file + , "caret_blink_rate": 700 + , "caret_width": 2 + , "char_groups": "./\\()\"'-:,.;<>~!@#$%^&*|+=[]{}`~?" + , "extra_line_spacing": 0 + , "font": "Monospace" + , "font_size": 12 + , "indent_size": 4 + , "smart_tab": true +// , "line_seperator_pen": " #aaaaaa; 1.5; dashed" // we need to figure out a good format for this + + , "show_caret_offset": true + , "theme": "Monokai" + , "undo_group_per_space": true + , "use_line_seperator": false + , "use_tab": false + , "whitespaces": "\n\t " + , "witespace_without_newline": "\t " + , "scroll_past_end": false +} diff --git a/app/rcc/edbee/config/default.osx.json b/app/rcc/edbee/config/default.osx.json new file mode 100644 index 00000000..f03e4a0c --- /dev/null +++ b/app/rcc/edbee/config/default.osx.json @@ -0,0 +1,4 @@ +{ + "font": "Monaco", + "font_size": 12 +} diff --git a/app/rcc/edbee/config/default.win.json b/app/rcc/edbee/config/default.win.json new file mode 100644 index 00000000..9a3bbdb7 --- /dev/null +++ b/app/rcc/edbee/config/default.win.json @@ -0,0 +1,3 @@ +{ + "font": "Courier New" +} diff --git a/app/rcc/edbee/config/default.x11.json b/app/rcc/edbee/config/default.x11.json new file mode 100644 index 00000000..4a757cd6 --- /dev/null +++ b/app/rcc/edbee/config/default.x11.json @@ -0,0 +1,4 @@ +{ + "font": "monospace", + "font_size": 14 +} diff --git a/app/rcc/edbee/keymaps/default.json b/app/rcc/edbee/keymaps/default.json new file mode 100644 index 00000000..f8f17636 --- /dev/null +++ b/app/rcc/edbee/keymaps/default.json @@ -0,0 +1,120 @@ +// This is an extended json format, supporting comments +// standard json doesn't support comments (which I think is plain stupid) +// If you can parse a json file, skipping comments shouldn't be a problem +[ + { + // the default editor-key-bindings + // on Mac OS X Ctrl is automaticly swapped with Meta + // you can use Qt QKeySequence texts here, extended with the default key-names + "bindings": [ + { "keys": "move_to_next_char", "command": "goto_next_char" }, + { "keys": "move_to_previous_char", "command": "goto_prev_char" }, + { "keys": "move_to_next_word", "command": "goto_next_word" }, + { "keys": "move_to_previous_word", "command": "goto_prev_word" }, + { "keys": "move_to_start_of_line", "command": "goto_bol" }, + { "keys": "move_to_start_of_block", "command": "goto_bol" }, + { "keys": "move_to_end_of_line", "command": "goto_eol" }, + { "keys": "move_to_end_of_block", "command": "goto_eol" }, + { "keys": "move_to_next_line", "command": "goto_next_line" }, + { "keys": "move_to_previous_line", "command": "goto_prev_line" }, + { "keys": "move_to_start_of_document", "command": "goto_bof" }, + { "keys": "move_to_end_of_document", "command": "goto_eof" }, + { "keys": "move_to_next_page", "command": "goto_page_down" }, + { "keys": "move_to_previous_page", "command": "goto_page_up" }, + + // selection + { "keys": "select_next_char", "command": "sel_next_char" }, + { "keys": "select_previous_char", "command": "sel_prev_char" }, + { "keys": "select_next_word", "command": "sel_next_word" }, + { "keys": "select_previous_word", "command": "sel_prev_word" }, + { "keys": "select_start_of_line", "command": "sel_to_bol" }, + { "keys": "select_end_of_line", "command": "sel_to_eol" }, + { "keys": "select_next_line", "command": "sel_to_next_line" }, + { "keys": "select_previous_line", "command": "sel_to_prev_Line" }, + { "keys": "select_start_of_document", "command": "sel_to_bof" }, + { "keys": "select_end_of_document", "command": "sel_to_eof" }, + { "keys": "select_next_page", "command": "sel_page_down" }, + { "keys": "select_previous_page", "command": "sel_page_up" }, + + { "keys": "select_all", "command": "sel_all" }, + // { "keys": "Ctrl+D", "command": "sel_word" }, // is superseeded by 'find_under_expand' + { "keys": "Ctrl+L", "command": "sel_line" }, + { "keys": "Ctrl+Shift+L", "command": "sel_prev_line" }, + { "keys": "Meta+shift+Up", "command": "add_caret_prev_line" }, + { "keys": "Meta+shift+Down", "command": "add_caret_next_line" }, + { "keys": "Escape", "command": "sel_reset" }, + + // TODO: We need to build in support for alternative keymaps per platform + { "keys": "Ctrl+Alt+Up", "command": "add_caret_prev_line" }, + { "keys": "Ctrl+Alt+Down", "command": "add_caret_next_line" }, + + // line entry + { "keys": "Enter", "command": "ins_newline" }, + { "keys": "Return", "command": "ins_newline" }, + { "keys": "Shift+Enter", "command": "ins_newline" }, + { "keys": "Shift+Return", "command": "ins_newline" }, + + // deletion left + { "keys": "Backspace", "command": "del_left" }, + { "keys": "Shift+Backspace", "command": "del_left" }, + { "keys": "Alt+Backspace", "command": "del_word_left" }, + { "keys": "Ctrl+Backspace", "command": "del_line_left" }, + + // deletion right + { "keys": "Delete", "command": "del_right" }, + { "keys": "Alt+Delete", "command": "del_word_right" }, + { "keys": "Ctrl+Delete", "command": "del_line_right" }, + + // tab entry + { "keys": "Tab", "command": "tab" }, + // { "keys": "Backtab", "command": "tab_back" }, + { "keys": "Shift+Tab", "command": "tab_back" }, + { "keys": "Shift+Backtab", "command": "tab_back" }, + { "keys": "Ctrl+]", "command": "indent" }, + { "keys": "Ctrl+[", "command": "outdent" }, + + // special entry + { "keys": "Ctrl+Shift+D", "command": "duplicate" }, + { "keys": "Ctrl+/", "command": "toggle_comment" }, + { "keys": "Ctrl+Meta+/", "command": "toggle_block_comment" }, + + /// TODO: add a backtab action here + //set( QKeySequence( Qt::Key_BackTab ), new ) + + // undo / redo comamnqds + { "keys": "undo", "command": "undo" }, + { "keys": "redo", "command": "redo" }, + { "keys": "Ctrl+U", "command": "soft_undo" }, + { "keys": "Ctrl+Shift+U", "command": "soft_redo" }, + + // clipboard operations + { "keys": "Ctrl+Insert", "command": "copy" }, + { "keys": "Shift+Delete", "command": "cut" }, + { "keys": "Shift+Insert", "command": "paste" }, + { "keys": "copy", "command": "copy" }, + { "keys": "cut", "command": "cut" }, + { "keys": "paste", "command": "paste" }, + + // debug commands + { "keys": "Ctrl+Shift+X,S", "command": "debug_dump_scopes" }, + { "keys": "Ctrl+Shift+X,R", "command": "debug_rebuild_scopes" }, + { "keys": "Ctrl+Shift+X,U", "command": "debug_dump_undo_stack" }, + { "keys": "Ctrl+Shift+X,C", "command": "debug_dump_character_codes" }, + + // find commands + { "keys": "Ctrl+E", "command": "find_use_sel" }, + { "keys": "find_next", "command": "find_next_match" }, + { "keys": "find_previous", "command": "find_prev_match" }, + { "keys": "Meta+S", "command": "sel_next_match" }, + { "keys": "Meta+Shift+S", "command": "sel_prev_match" }, + { "keys": "Ctrl+Shift+Meta+A", "command": "sel_all_matches" }, + + { "keys": "Ctrl+D", "command": "select_under_expand" }, + { "keys": "Alt+F3", "command": "select_all_under" }, + + // move line command + { "keys": "Ctrl+Meta+Up", "command": "move_lines_up" }, + { "keys": "Ctrl+Meta+Down", "command": "move_lines_down" } + ] + } +] diff --git a/app/rcc/edbee/keymaps/default.osx.json b/app/rcc/edbee/keymaps/default.osx.json new file mode 100644 index 00000000..65584a24 --- /dev/null +++ b/app/rcc/edbee/keymaps/default.osx.json @@ -0,0 +1,20 @@ +// This is an extended json format, supporting comments +// standard json doesn't support comments (which I think is plain stupid) +// If you can parse a json file, skipping comments shouldn't be a problem +[ +{ + // "context": [ + // { "name": "env.os", "value": "osx" } + // ], + + // the default editor-key-bindings + // on Mac OS X Ctrl is automaticly swapped with Meta + // you can use Qt QKeySequence texts here, extended with the default key-names + "bindings": [ + + { "keys": "Meta+shift+Up", "command": "add_caret_prev_line" }, + { "keys": "Meta+shift+Down", "command": "add_caret_next_line" }, + { "keys": "Ctrl+Meta+G", "command": "select_all_under" } + ] +} +] diff --git a/app/rcc/edbee/keymaps/default.win32.json b/app/rcc/edbee/keymaps/default.win32.json new file mode 100644 index 00000000..accea5f5 --- /dev/null +++ b/app/rcc/edbee/keymaps/default.win32.json @@ -0,0 +1,20 @@ +// This is an extended json format, supporting comments +// standard json doesn't support comments (which I think is plain stupid) +// If you can parse a json file, skipping comments shouldn't be a problem +[ +{ + // "context": [ + // { "name": "env.os", "value": "win32" } + // ], + + + // the default editor-key-bindings + // on Mac OS X Ctrl is automaticly swapped with Meta + // you can use Qt QKeySequence texts here, extended with the default key-names + "bindings": [ + + { "keys": "Ctrl+Alt+Up", "command": "add_caret_prev_line" }, + { "keys": "Ctrl+Alt+Down", "command": "add_caret_next_line" } + ] +} +] \ No newline at end of file diff --git a/app/rcc/edbee/syntaxfiles/ASP.tmLanguage b/app/rcc/edbee/syntaxfiles/ASP.tmLanguage new file mode 100644 index 00000000..b5197574 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/ASP.tmLanguage @@ -0,0 +1,214 @@ + + + + + comment + ASP SCRIPTING DICTIONARY – By Rich Barton: Version 1.0 (based on PHP Scripting Dictionary by Justin French, Sune Foldager and Allan Odgaard) Note: .asp is handled by asp/html + fileTypes + + asa + + foldingStartMarker + (?i)^\s*(Public|Private)?\s*(Class|Function|Sub|Property)\s*([a-zA-Z_]\w*)\s*(\(.*\)\s*)?$ + foldingStopMarker + (?i)^\s*End (Class|Function|Sub|Property)\s*$ + keyEquivalent + ^~A + name + ASP + patterns + + + captures + + 1 + + name + storage.type.function.asp + + 2 + + name + entity.name.function.asp + + 3 + + name + punctuation.definition.parameters.asp + + 4 + + name + variable.parameter.function.asp + + 5 + + name + punctuation.definition.parameters.asp + + + match + ^\s*((?i:function|sub))\s*([a-zA-Z_]\w*)\s*(\()([^)]*)(\)).*\n? + name + meta.function.asp + + + captures + + 1 + + name + punctuation.definition.comment.asp + + + match + (').*$\n? + name + comment.line.apostrophe.asp + + + captures + + 1 + + name + punctuation.definition.comment.asp + + + match + (REM ).*$\n? + name + comment.line.rem.asp + + + match + (?i:\b(If|Then|Else|ElseIf|End If|While|Wend|For|To|Each|In|Step|Case|Select|End Select|Return|Continue|Do|Until|Loop|Next|With|Exit Do|Exit For|Exit Function|Exit Property|Exit Sub)\b) + name + keyword.control.asp + + + match + =|>=|<|>|<|<>|\+|-|\*|\^|&|\b(?i:(Mod|And|Not|Or|Xor|Is))\b + name + keyword.operator.asp + + + match + (?i:\b(Call|Class|Const|Dim|Redim|Function|Sub|Property|End Property|End sub|End Function|Set|Let|Get|New|Randomize|Option Explicit|On Error Resume Next|On Error GoTo)\b) + name + storage.type.asp + + + match + (?i:\b(Private|Public|Default)\b) + name + storage.modifier.asp + + + match + (?i:\b(Empty|False|Nothing|Null|True)\b) + name + constant.language.asp + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.asp + + + end + "(?!") + endCaptures + + 0 + + name + punctuation.definition.string.end.asp + + + name + string.quoted.double.asp + patterns + + + match + "" + name + constant.character.escape.apostrophe.asp + + + + + captures + + 1 + + name + punctuation.definition.variable.asp + + + match + (\$)[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\b + name + variable.other.asp + + + match + (?i:\b(Application|ObjectContext|Request|Response|Server|Session)\b) + name + support.class.asp + + + match + (?i:\b(Contents|StaticObjects|ClientCertificate|Cookies|Form|QueryString|ServerVariables)\b) + name + support.class.collection.asp + + + match + (?i:\b(TotalBytes|Buffer|CacheControl|Charset|ContentType|Expires|ExpiresAbsolute|IsClientConnected|PICS|Status|ScriptTimeout|CodePage|LCID|SessionID|Timeout)\b) + name + support.constant.asp + + + match + (?i:\b(Lock|Unlock|SetAbort|SetComplete|BianryRead|AddHeader|AppendToLog|BinaryWrite|Clear|End|Flush|Redirect|Write|CreateObject|HTMLEncode|MapPath|URLEncode|Abandon)\b) + name + support.function.asp + + + match + (?i:\b(Application_OnEnd|Application_OnStart|OnTransactionAbort|OnTransactionCommit|Session_OnEnd|Session_OnStart|Class_Initialize|Class_Terminate)\b) + name + support.function.event.asp + + + match + (?i:\b(Array|Add|Asc|Atn|CBool|CByte|CCur|CDate|CDbl|Chr|CInt|CLng|Conversions|Cos|CreateObject|CSng|CStr|Date|DateAdd|DateDiff|DatePart|DateSerial|DateValue|Day|Derived|Math|Escape|Eval|Exists|Exp|Filter|FormatCurrency|FormatDateTime|FormatNumber|FormatPercent|GetLocale|GetObject|GetRef|Hex|Hour|InputBox|InStr|InStrRev|Int|Fix|IsArray|IsDate|IsEmpty|IsNull|IsNumeric|IsObject|Item|Items|Join|Keys|LBound|LCase|Left|Len|LoadPicture|Log|LTrim|RTrim|Trim|Maths|Mid|Minute|Month|MonthName|MsgBox|Now|Oct|Remove|RemoveAll|Replace|RGB|Right|Rnd|Round|ScriptEngine|ScriptEngineBuildVersion|ScriptEngineMajorVersion|ScriptEngineMinorVersion|Second|SetLocale|Sgn|Sin|Space|Split|Sqr|StrComp|String|StrReverse|Tan|Time|Timer|TimeSerial|TimeValue|TypeName|UBound|UCase|Unescape|VarType|Weekday|WeekdayName|Year)\b) + name + support.function.vb.asp + + + match + \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\b + name + constant.numeric.asp + + + match + (?i:\b(vbtrue|fvbalse|vbcr|vbcrlf|vbformfeed|vblf|vbnewline|vbnullchar|vbnullstring|vbtab|vbverticaltab|vbbinarycompare|vbtextcomparevbsunday|vbmonday|vbtuesday|vbwednesday|vbthursday|vbfriday|vbsaturday|vbusesystemdayofweek|vbfirstjan1|vbfirstfourdays|vbfirstfullweek|vbgeneraldate|vblongdate|vbshortdate|vblongtime|vbshorttime|vbobjecterror|vbEmpty|vbNull|vbInteger|vbLong|vbSingle|vbDouble|vbCurrency|vbDate|vbString|vbObject|vbError|vbBoolean|vbVariant|vbDataObject|vbDecimal|vbByte|vbArray)\b) + name + support.type.vb.asp + + + scopeName + source.asp + uuid + 291022B4-6B1D-11D9-90EB-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/ActionScript.tmLanguage b/app/rcc/edbee/syntaxfiles/ActionScript.tmLanguage new file mode 100644 index 00000000..a407771c --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/ActionScript.tmLanguage @@ -0,0 +1,267 @@ + + + + + fileTypes + + as + + foldingStartMarker + (/\*\*|\{\s*$) + foldingStopMarker + (\*\*/|^\s*\}) + keyEquivalent + ^~A + name + ActionScript + patterns + + + match + \b(R(ecordset|DBMSResolver|adioButton(Group)?)|X(ML(Socket|Node|Connector)?|UpdateResolverDataHolder)|M(M(Save|Execute)|icrophoneMicrophone|o(use|vieClip(Loader)?)|e(nu(Bar)?|dia(Controller|Display|Playback))|ath)|B(yName|inding|utton)|S(haredObject|ystem|crollPane|t(yleSheet|age|ream)|ound|e(ndEvent|rviceObject)|OAPCall|lide)|N(umericStepper|et(stream|S(tream|ervices)|Connection|Debug(Config)?))|C(heckBox|o(ntextMenu(Item)?|okie|lor|m(ponentMixins|boBox))|ustomActions|lient|amera)|T(ypedValue|ext(Snapshot|Input|F(ield|ormat)|Area)|ree|AB)|Object|D(ownload|elta(Item|Packet)?|at(e(Chooser|Field)?|a(G(lue|rid)|Set|Type)))|U(RL|TC|IScrollBar)|P(opUpManager|endingCall|r(intJob|o(duct|gressBar)))|E(ndPoint|rror)|Video|Key|F(RadioButton|GridColumn|MessageBox|BarChart|S(croll(Bar|Pane)|tyleFormat|plitView)|orm|C(heckbox|omboBox|alendar)|unction|T(icker|ooltip(Lite)?|ree(Node)?)|IconButton|D(ataGrid|raggablePane)|P(ieChart|ushButton|ro(gressBar|mptBox))|L(i(stBox|neChart)|oadingBox)|AdvancedMessageBox)|W(indow|SDLURL|ebService(Connector)?)|L(ist|o(calConnection|ad(er|Vars)|g)|a(unch|bel))|A(sBroadcaster|cc(ordion|essibility)|S(Set(Native|PropFlags)|N(ew|ative)|C(onstructor|lamp(2)?)|InstanceOf)|pplication|lert|rray))\b + name + support.class.actionscript.2 + + + match + \b(s(h(ift|ow(GridLines|Menu|Border|Settings|Headers|ColumnHeaders|Today|Preferences)?|ad(ow|ePane))|c(hema|ale(X|Mode|Y|Content)|r(oll(Track|Drag)?|een(Resolution|Color|DPI)))|t(yleSheet|op(Drag|A(nimation|llSounds|gent))?|epSize|a(tus|rt(Drag|A(nimation|gent))?))|i(n|ze|lence(TimeOut|Level))|o(ngname|urce|rt(Items(By)?|On(HeaderRelease)?|able(Columns)?)?)|u(ppressInvalidCalls|bstr(ing)?)|p(li(ce|t)|aceCol(umnsEqually|lumnsEqually))|e(nd(DefaultPushButtonEvent|AndLoad)?|curity|t(R(GB|o(otNode|w(Height|Count))|esizable(Columns)?|a(nge|te))|G(ain|roupName)|X(AxisTitle)?|M(i(n(imum|utes)|lliseconds)|o(nth(Names)?|tionLevel|de)|ultilineMode|e(ssage|nu(ItemEnabled(At)?|EnabledAt)|dia)|a(sk|ximum))|B(u(tton(s|Width)|fferTime)|a(seTabIndex|ndwidthLimit|ckground))|S(howAsDisabled|croll(ing|Speed|Content|Target|P(osition|roperties)|barState|Location)|t(yle(Property)?|opOnFocus|at(us|e))|i(ze|lenceLevel)|ort(able(Columns)?|Function)|p(litterBarPosition|acing)|e(conds|lect(Multiple|ion(Required|Type)?|Style|Color|ed(Node(s)?|Cell|I(nd(ices|ex)|tem(s)?))?|able))|kin|m(oothness|allScroll))|H(ighlight(s|Color)|Scroll|o(urs|rizontal)|eader(Symbol|Height|Text|Property|Format|Width|Location)?|as(Shader|CloseBox))|Y(ear|AxisTitle)?|N(ode(Properties|ExpansionHandler)|ewTextFormat)|C(h(ildNodes|a(ngeHandler|rt(Title|EventHandler)))|o(ntent(Size)?|okie|lumns)|ell(Symbol|Data)|l(i(ckHandler|pboard)|oseHandler)|redentials)|T(ype(dVaule)?|i(tle(barHeight)?|p(Target|Offset)?|me(out(Handler)?)?)|oggle|extFormat|ransform)|I(s(Branch|Open)|n(terval|putProperty)|con(SymbolName)?|te(rator|m(ByKey|Symbol)))|Orientation|D(i(splay(Range|Graphics|Mode|Clip|Text|edMonth)|rection)|uration|e(pth(Below|To|Above)|fault(GatewayURL|Mappings|NodeIconSymbolName)|l(iveryMode|ay)|bug(ID)?)|a(yOfWeekNames|t(e(Filter)?|a(Mapping(s)?|Item(Text|Property|Format)|Provider|All(Height|Property|Format|Width))?))|ra(wConnectors|gContent))|U(se(Shadow|HandCursor|EchoSuppression|rInput|Fade)|TC(M(i(nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear))|P(osition|ercentComplete|an(e(M(inimumSize|aximumSize)|Size|Title))?|ro(pert(y(Data)?|iesAt)|gress))|E(nabled|dit(Handler|able)|xpand(NodeTrigger|erSymbolName))|V(Scroll|olume|alue(Source)?)|KeyFrameInterval|Quality|F(i(eld|rst(DayOfWeek|VisibleNode))|ocus|ullYear|ps|ade(InLength|OutLength)|rame(Color|Width))|Width|L(ine(Color|Weight)|o(opback|adTarget)|a(rgeScroll|bel(Source|Placement)?))|A(s(Boolean|String|Number)|n(yTypedValue|imation)|ctiv(e(State(Handler)?|Handler)|ateHandler)|utoH(ideScrollBar|eight)))?|paratorBefore|ek|lect(ion(Disabled|Unfocused)?|ed(Node(s)?|Child|I(nd(ices|ex)|tem(s)?)|Dat(e|a))?|able(Ranges)?)|rver(String)?)|kip|qrt|wapDepths|lice|aveToSharedObj|moothing)|h(scroll(Policy)?|tml(Text)?|i(t(Test(TextNearPos)?|Area)|de(BuiltInItems|Child)?|ghlight(2D|3D)?)|orizontal|e(ight|ader(Re(nderer|lease)|Height|Text))|P(osition|ageScrollSize)|a(s(childNodes|MP3|S(creen(Broadcast|Playback)|treaming(Video|Audio)|ort)|Next|OwnProperty|Pr(inting|evious)|EmbeddedVideo|VideoEncoder|A(ccesibility|udio(Encoder)?))|ndlerName)|LineScrollSize)|ye(sLabel|ar)|n(o(t|de(Name|Close|Type|Open|Value)|Label)|u(llValue|mChild(S(creens|lides)|ren|Forms))|e(w(Item|line|Value|LocationDialog)|xt(S(cene|ibling|lide)|TabIndex|Value|Frame)?)?|ame(s)?)|c(h(ildNodes|eck|a(nge(sPending)?|r(CodeAt|At))|r)|o(s|n(st(ant|ructor)|nect|c(urrency|at)|t(ent(Type|Path)?|ains|rol(Placement|lerPolicy))|denseWhite|version)|py|l(or|umn(Stretch|Name(s)?|Count))|m(p(onent|lete)|ment))|u(stomItems|ePoint(s)?|r(veTo|Value|rent(Slide|ChildSlide|Item|F(ocused(S(creen|lide)|Form)|ps))))|e(il|ll(Renderer|Press|Edit|Focus(In|Out)))|l(i(ck|ents)|o(se(Button|Pane)?|ne(Node)?)|ear(S(haredObjects|treams)|Timeout|Interval)?)|a(ncelLabel|tch|p(tion|abilities)|l(cFields|l(e(e|r))?))|reate(GatewayConnection|Menu|Se(rver|gment)|C(hild(AtDepth)?|l(ient|ass(ChildAtDepth|Object(AtDepth)?))|all)|Text(Node|Field)|Item|Object(AtDepth)?|PopUp|E(lement|mptyMovieClip)))|t(h(is|row)|ype(of|Name)?|i(tle(StyleDeclaration)?|me(out)?)|o(talTime|String|olTipText|p|UpperCase|ggle(HighQuality)?|Lo(caleString|werCase))|e(st|llTarget|xt(RightMargin|Bold|S(ize|elected)|Height|Color|I(ndent|talic)|Disabled|Underline|F(ield|ont)|Width|LeftMargin|Align)?)|a(n|rget(Path)?|b(Stops|Children|Index|Enabled|leName))|r(y|igger|ac(e|k(AsMenu)?)))|i(s(Running|Branch|NaN|Con(soleOpen|nected)|Toggled|Installed|Open|D(own|ebugger)|P(urchased|ro(totypeOf|pertyEnumerable))|Empty|F(inite|ullyPopulated)|Local|Active)|n(s(tall|ertBefore)|cludeDeltaPacketInfo|t|it(ialize|Component|Pod|A(pplication|gent))?|de(nt|terminate|x(InParent(Slide|Form)?|Of)?)|put|validate|finity|LocalInternetCache)?|con(F(ield|unction))?|t(e(ratorScrolled|m(s|RollO(ut|ver)|ClassName))|alic)|d3|p|fFrameLoaded|gnore(Case|White))|o(s|n(R(ollO(ut|ver)|e(s(ize|ult)|l(ease(Outside)?|aseOutside)))|XML|Mouse(Move|Down|Up|Wheel)|S(ync|croller|tatus|oundComplete|e(tFocus|lect(edItem)?))|N(oticeEvent|etworkChange)|C(hanged|onnect|l(ipEvent|ose))|ID3|D(isconnect|eactivate|ata|ragO(ut|ver))|Un(install|load)|P(aymentResult|ress)|EnterFrame|K(illFocus|ey(Down|Up))|Fault|Lo(ad|g)|A(ctiv(ity|ate)|ppSt(op|art)))?|pe(n|ration)|verLayChildren|kLabel|ldValue|r(d)?)|d(i(s(connect|play(Normal|ed(Month|Year)|Full)|able(Shader|d(Ranges|Days)|CloseBox|Events))|rection)|o(cTypeDecl|tall|Decoding|main|LazyDecoding)|u(plicateMovieClip|ration)|e(stroy(ChildAt|Object)|code|fault(PushButton(Enabled)?|KeydownHandler)?|l(ta(Packet(Changed)?)?|ete(PopUp|All)?)|blocking)|a(shBoardSave|yNames|ta(Provider)?|rkshadow)|r(opdown(Width)?|a(w|gO(ut|ver))))|u(se(Sort|HandCursor|Codepage|EchoSuppression)|n(shift|install|derline|escape|format|watch|lo(ck|ad(Movie(Num)?)?))|pdate(Results|Mode|I(nputProperties|tem(ByIndex)?)|P(acket|roperties)|View|AfterEvent)|rl)|join|p(ixelAspectRatio|o(sition|p|w)|u(sh|rge|blish)|ercen(tComplete|Loaded)|lay(head(Change|Time)|ing|Hidden|erType)?|a(ssword|use|r(se(XML|CSS|Int|Float)|ent(Node|Is(S(creen|lide)|Form))|ams))|r(int(Num|AsBitmap(Num)?)?|o(to(type)?|pert(y|ies)|gress)|e(ss|v(ious(S(ibling|lide)|Value)?|Scene|Frame)|ferred(Height|Width))))|e(scape|n(code(r)?|ter(Frame)?|dFill|able(Shader|d|CloseBox|Events))|dit(able|Field|LocationDialog)|v(ent|al(uate)?)|q|x(tended|p|ec(ute)?|actSettings)|m(phasized(StyleDeclaration)?|bedFonts))|v(i(sible|ewPod)|ScrollPolicy|o(id|lume)|ersion|P(osition|ageScrollSize)|a(l(idat(ionError|e(Property|ActivationKey)?)|ue(Of)?)|riable)|LineScrollSize)|k(ind|ey(Down|Up|Press|FrameInterval))|q(sort|uality)|f(scommand|i(n(d(Text|First|Last)?|ally)|eldInfo|lter(ed|Func)?|rst(Slide|Child|DayOfWeek|VisibleNode)?)|o(nt|cus(In|edCell|Out|Enabled)|r(egroundDisabled|mat(ter)?))|unctionName|ps|l(oor|ush)|ace|romCharCode)|w(i(th|dth)|ordWrap|atch|riteAccess)|l(t|i(st(Owner)?|ne(Style|To))|o(c(k|a(t(ion|eByld)|l(ToGlobal|FileReadDisable)))|opback|ad(Movie(Num)?|S(crollContent|ound)|ed|Variables(Num)?|Application)?|g(Changes)?)|e(ngth|ft(Margin)?|ading)?|a(st(Slide|Child|Index(Of)?)?|nguage|b(el(Placement|F(ield|unction))?|leField)))|a(s(scociate(Controller|Display)|in|pectRatio|function)|nd|c(ceptConnection|tiv(ityLevel|ePlayControl)|os)|t(t(ach(Movie|Sound|Video|Audio)|ributes)|an(2)?)|dd(header|RequestHeader|Menu(Item(At)?|At)?|Sort|Header|No(tice|de(At)?)|C(olumn(At)?|uePoint)|T(oLocalInternetCache|reeNode(At)?)|I(con|tem(s(At)?|At)?)|DeltaItem|P(od|age|roperty)|EventListener|View|FieldInfo|Listener|Animation)?|uto(Size|Play|KeyNav|Load)|pp(endChild|ly(Changes|Updates)?)|vHardwareDisable|fterLoaded|l(ternateRowColors|ign|l(ow(InsecureDomain|Domain)|Transitions(InDone|OutDone))|bum)|r(tist|row|g(uments|List))|gent|bs)|r(ight(Margin)?|o(ot(S(creen|lide)|Form)|und|w(Height|Count)|llO(ut|ver))|e(s(yncDepth|t(orePane|artAnimation|rict)|iz(e|able(Columns)?)|olveDelta|ult(s)?|ponse)|c(o(ncile(Results|Updates)|rd)|eive(Video|Audio))|draw|jectConnection|place(Sel|ItemAt|AllItems)?|ve(al(Child)?|rse)|quest(SizeChange|Payment)?|f(errer|resh(ScrollContent|Destinations|Pane|FromSources)?)|lease(Outside)?|ad(Only|Access)|gister(SkinElement|C(olor(Style|Name)|lass)|InheritingStyle|Proxy)|move(Range|M(ovieClip|enu(Item(At)?|At))|Background|Sort|No(tice|de(sAt|At)?)|C(olum(nAt|At)|uePoints)|T(extField|reeNode(At)?)|Item(At)?|Pod|EventListener|FromLocalInternetCache|Listener|All(C(olumns|uePoints)|Items)?))|a(ndom|te|dioDot))|g(t|oto(Slide|NextSlide|PreviousSlide|FirstSlide|LastSlide|And(Stop|Play))|e(nre|t(R(GB|o(otNode|wCount)|e(sizable|mote))|X(AxisTitle)?|M(i(n(imum(Size)?|utes)|lliseconds)|onth(Names)?|ultilineMode|e(ssage|nu(ItemAt|EnabledAt|At))|aximum(Size)?)|B(ytes(Total|Loaded)|ounds|utton(s|Width)|eginIndex|a(ndwidthLimit|ckground))|S(howAsDisabled|croll(ing|Speed|Content|Position|barState|Location)|t(yle(Names)?|opOnFocus|ate)|ize|o(urce|rtState)|p(litterBarPosition|acing)|e(conds|lect(Multiple|ion(Required|Type)|Style|ed(Node(s)?|Cell|Text|I(nd(ices|ex)|tem(s)?))?)|rvice)|moothness|WFVersion)|H(ighlight(s|Color)|ours|e(ight|ader(Height|Text|Property|Format|Width|Location)?)|as(Shader|CloseBox))|Y(ear|AxisTitle)?|N(o(tices|de(DisplayedAt|At))|um(Children|berAvailable)|e(wTextFormat|xtHighestDepth))|C(h(ild(S(creen|lide)|Nodes|Form|At)|artTitle)|o(n(tent|figInfo)|okie|de|unt|lumn(Names|Count|Index|At))|uePoint|ellIndex|loseHandler|a(ll|retIndex))|T(ypedValue|i(tle(barHeight)?|p(Target|Offset)?|me(stamp|zoneOffset|out(State|Handler)|r)?)|oggle|ext(Extent|Format)?|r(ee(NodeAt|Length)|ans(form|actionId)))|I(s(Branch|Open)|n(stanceAtDepth|d(icesByKey|exByKey))|con(SymbolName)?|te(rator|m(sByKey|By(Name|Key)|id|ID|At))|d)|O(utput(Parameter(s|ByName)?|Value(s)?)|peration|ri(entation|ginalCellData))|D(i(s(play(Range|Mode|Clip|Index|edMonth)|kUsage)|rection)|uration|e(pth|faultNodeIconSymbolName|l(taPacket|ay)|bug(Config|ID)?)|a(y(OfWeekNames)?|t(e|a(Mapping(s)?|Item(Text|Property|Format)|Label|All(Height|Property|Format|Width))?))|rawConnectors)|U(se(Shadow|HandCursor|rInput|Fade)|RL|TC(M(i(nutes|lliseconds)|onth)|Seconds|Hours|Da(y|te)|FullYear))|P(o(sition|ds)|ercentComplete|a(n(e(M(inimums|aximums)|Height|Title|Width))?|rentNode)|r(operty(Name|Data)?|efer(ences|red(Height|Width))))|E(n(dIndex|abled)|ditingData|x(panderSymbolName|andNodeTrigger))|V(iewed(Pods|Applications)|olume|ersion|alue(Source)?)|F(i(eld|rst(DayOfWeek|VisibleNode))|o(ntList|cus)|ullYear|ade(InLength|OutLength)|rame(Color|Width))|Width|L(ine(Color|Weight)|o(cal|adTarget)|ength|a(stTabIndex|bel(Source)?))|A(s(cii|Boolean|String|Number)|n(yTypedValue|imation)|ctiv(eState(Handler)?|ateHandler)|utoH(ideScrollBar|eight)|llItems|gent))?)?|lobal(StyleFormat|ToLocal)?|ain|roupName)|x(updatePackety|mlDecl)?|m(y(MethodName|Call)|in(imum)?|o(nthNames|tion(TimeOut|Level)|de(lChanged)?|use(Move|O(ut|ver)|Down(Somewhere|Outside)?|Up(Somewhere)?|WheelEnabled)|ve(To)?)|u(ted|lti(pleS(imultaneousAllowed|elections)|line))|e(ssage|nu(Show|Hide)?|th(od)?|diaType)|a(nufacturer|tch|x(scroll|hscroll|imum|HPosition|Chars|VPosition)?)|b(substring|chr|ord|length))|b(ytes(Total|Loaded)|indFormat(Strings|Function)|o(ttom(Scroll)?|ld|rder(Color)?)|u(tton(Height|Width)|iltInItems|ffer(Time|Length)|llet)|e(foreApplyUpdates|gin(GradientFill|Fill))|lockIndent|a(ndwidth|ckground(Style|Color|Disabled)?)|roadcastMessage)|onHTTPStatus)\b + name + support.function.actionscript.2 + + + match + \b(__proto__|__resolve|_accProps|_alpha|_changed|_currentframe|_droptarget|_flash|_focusrect|_framesloaded|_global|_height|_highquality|_level|_listeners|_lockroot|_name|_parent|_quality|_root|_rotation|_soundbuftime|_target|_totalframes|_url|_visible|_width|_x|_xmouse|_xscale|_y|_ymouse|_yscale)\b + name + support.constant.actionscript.2 + + + match + \b(dynamic|extends|import|implements|interface|public|private|new|static|super|var|for|in|break|continue|while|do|return|if|else|case|switch)\b + name + keyword.control.actionscript.2 + + + match + \b(Boolean|Number|String|Void)\b + name + storage.type.actionscript.2 + + + match + \b(null|undefined|true|false)\b + name + constant.language.actionscript.2 + + + match + \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\b + name + constant.numeric.actionscript.2 + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.actionscript.2 + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.actionscript.2 + + + name + string.quoted.double.actionscript.2 + patterns + + + match + \\. + name + constant.character.escape.actionscript.2 + + + + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.actionscript.2 + + + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.actionscript.2 + + + name + string.quoted.single.actionscript.2 + patterns + + + match + \\. + name + constant.character.escape.actionscript.2 + + + + + match + \b(BACKSPACE|CAPSLOCK|CONTROL|DELETEKEY|DOWN|END|ENTER|HOME|INSERT|LEFT|LN10|LN2|LOG10E|LOG2E|MAX_VALUE|MIN_VALUE|NEGATIVE_INFINITY|NaN|PGDN|PGUP|PI|POSITIVE_INFINITY|RIGHT|SPACE|SQRT1_2|SQRT2|UP)\b + name + support.constant.actionscript.2 + + + begin + /\* + captures + + 0 + + name + punctuation.definition.comment.actionscript.2 + + + end + \*/ + name + comment.block.actionscript.2 + + + captures + + 1 + + name + punctuation.definition.comment.actionscript.2 + + + match + (//).*$\n? + name + comment.line.double-slash.actionscript.2 + + + match + \b(instanceof)\b + name + keyword.operator.actionscript.2 + + + match + [-!%&*+=/?:] + name + keyword.operator.symbolic.actionscript.2 + + + captures + + 1 + + name + punctuation.definition.preprocessor.actionscript.2 + + + match + ^[ \t]*(#)[a-zA-Z]+ + name + meta.preprocessor.actionscript.2 + + + begin + \b(function)\s+([a-zA-Z_]\w*)\s*(\() + captures + + 1 + + name + storage.type.function.actionscript.2 + + 2 + + name + entity.name.function.actionscript.2 + + 3 + + name + punctuation.definition.parameters.begin.actionscript.2 + + + end + \) + endCaptures + + 0 + + name + punctuation.definition.parameters.end.actionscript.2 + + + name + meta.function.actionscript.2 + patterns + + + match + [^,)\n]+ + name + variable.parameter.function.actionscript.2 + + + + + captures + + 1 + + name + storage.type.class.actionscript.2 + + 2 + + name + entity.name.type.class.actionscript.2 + + 3 + + name + storage.modifier.extends.actionscript.2 + + 4 + + name + entity.other.inherited-class.actionscript.2 + + + match + \b(class)\s+([a-zA-Z_](?:\w|\.)*)(?:\s+(extends)\s+([a-zA-Z_](?:\w|\.)*))? + name + meta.class.actionscript.2 + + + scopeName + source.actionscript.2 + uuid + E5A6EC91-6EE4-11D9-BAB4-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/AppleScript.tmLanguage b/app/rcc/edbee/syntaxfiles/AppleScript.tmLanguage new file mode 100644 index 00000000..cc8123d4 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/AppleScript.tmLanguage @@ -0,0 +1,2142 @@ + + + + + fileTypes + + applescript + script editor + + firstLineMatch + ^#!.*(osascript) + foldingStartMarker + (?x) + ^\s* + ( + tell \s+ (?! .* \b(to)\b) .* + |tell\b.*?\bto\ tell \s+ (?! .* \b(to)\b) .* + |using \s+ terms \s+ from \s+ .* + |if\b .* \bthen\b + |repeat\b .* + |( on | to )\b (?!\s+ error) .* + |try\b + |with \s+ timeout\b .* + |script\b .* + |( considering | ignoring )\b .* + )\s*(--.*?)?$ + + foldingStopMarker + ^\s*end\b.*$ + keyEquivalent + ^~A + name + AppleScript + patterns + + + include + #blocks + + + include + #inline + + + repository + + attributes.considering-ignoring + + patterns + + + match + , + name + punctuation.separator.array.attributes.applescript + + + match + \b(and)\b + name + keyword.control.attributes.and.applescript + + + match + \b(?i:case|diacriticals|hyphens|numeric\s+strings|punctuation|white\s+space)\b + name + constant.other.attributes.text.applescript + + + match + \b(?i:application\s+responses)\b + name + constant.other.attributes.application.applescript + + + + blocks + + patterns + + + begin + ^\s*(script)\s+(\w+) + beginCaptures + + 1 + + name + keyword.control.script.applescript + + 2 + + name + entity.name.type.script-object.applescript + + + end + ^\s*(end(?:\s+script)?)(?=\s*(--.*?)?$) + endCaptures + + 1 + + name + keyword.control.script.applescript + + + name + meta.block.script.applescript + patterns + + + include + $self + + + + + begin + ^(?x) + \s*(to|on)\s+ # "on" or "to" + (\w+) # function name + (\() # opening paren + ((?:[\s,:\{\}]*(?:\w+)?)*) # parameters + (\)) # closing paren + + beginCaptures + + 1 + + name + keyword.control.function.applescript + + 2 + + name + entity.name.function.handler.applescript + + 3 + + name + punctuation.definition.parameters.applescript + + 4 + + name + variable.parameter.handler.applescript + + 5 + + name + punctuation.definition.parameters.applescript + + + comment + + This is not a very well-designed rule. For now, + we can leave it like this though, as it sorta works. + + end + ^\s*(end)(?:\s+(\2))?(?=\s*(--.*?)?$) + endCaptures + + 1 + + name + keyword.control.function.applescript + + + name + meta.function.positional.applescript + patterns + + + include + $self + + + + + begin + ^(?x) + \s*(to|on)\s+ # "on" or "to" + (\w+) # function name + (?:\s+ + (of|in)\s+ # "of" or "in" + (\w+) # direct parameter + )? + (?=\s+(above|against|apart\s+from|around|aside\s+from|at|below|beneath|beside|between|by|for|from|instead\s+of|into|on|onto|out\s+of|over|thru|under)\b) + + beginCaptures + + 1 + + name + keyword.control.function.applescript + + 2 + + name + entity.name.function.handler.applescript + + 3 + + name + keyword.control.function.applescript + + 4 + + name + variable.parameter.handler.direct.applescript + + + comment + TODO: match `given` parameters + end + ^\s*(end)(?:\s+(\2))?(?=\s*(--.*?)?$) + endCaptures + + 1 + + name + keyword.control.function.applescript + + + name + meta.function.prepositional.applescript + patterns + + + captures + + 1 + + name + keyword.control.preposition.applescript + + 2 + + name + variable.parameter.handler.applescript + + + match + \b(?i:above|against|apart\s+from|around|aside\s+from|at|below|beneath|beside|between|by|for|from|instead\s+of|into|on|onto|out\s+of|over|thru|under)\s+(\w+)\b + + + include + $self + + + + + begin + ^(?x) + \s*(to|on)\s+ # "on" or "to" + (\w+) # function name + (?=\s*(--.*?)?$) # nothing else + + beginCaptures + + 1 + + name + keyword.control.function.applescript + + 2 + + name + entity.name.function.handler.applescript + + + end + ^\s*(end)(?:\s+(\2))?(?=\s*(--.*?)?$) + endCaptures + + 1 + + name + keyword.control.function.applescript + + + name + meta.function.parameterless.applescript + patterns + + + include + $self + + + + + include + #blocks.tell + + + include + #blocks.repeat + + + include + #blocks.statement + + + include + #blocks.other + + + + blocks.other + + patterns + + + begin + ^\s*(considering)\b + end + ^\s*(end(?:\s+considering)?)(?=\s*(--.*?)?$) + name + meta.block.considering.applescript + patterns + + + begin + (?<=considering) + end + (?<!¬)$ + name + meta.array.attributes.considering.applescript + patterns + + + include + #attributes.considering-ignoring + + + + + begin + (?<=ignoring) + end + (?<!¬)$ + name + meta.array.attributes.ignoring.applescript + patterns + + + include + #attributes.considering-ignoring + + + + + match + \b(but)\b + name + keyword.control.but.applescript + + + include + $self + + + + + begin + ^\s*(ignoring)\b + end + ^\s*(end(?:\s+ignoring)?)(?=\s*(--.*?)?$) + name + meta.block.ignoring.applescript + patterns + + + begin + (?<=considering) + end + (?<!¬)$ + name + meta.array.attributes.considering.applescript + patterns + + + include + #attributes.considering-ignoring + + + + + begin + (?<=ignoring) + end + (?<!¬)$ + name + meta.array.attributes.ignoring.applescript + patterns + + + include + #attributes.considering-ignoring + + + + + match + \b(but)\b + name + keyword.control.but.applescript + + + include + $self + + + + + begin + ^\s*(if)\b + beginCaptures + + 1 + + name + keyword.control.if.applescript + + + end + ^\s*(end(?:\s+if)?)(?=\s*(--.*?)?$) + endCaptures + + 1 + + name + keyword.control.end.applescript + + + name + meta.block.if.applescript + patterns + + + match + \b(then)\b + name + keyword.control.then.applescript + + + match + \b(else\s+if)\b + name + keyword.control.else-if.applescript + + + match + \b(else)\b + name + keyword.control.else.applescript + + + include + $self + + + + + begin + ^\s*(try)\b + beginCaptures + + 1 + + name + keyword.control.try.applescript + + + end + ^\s*(end(?:\s+(try|error))?)(?=\s*(--.*?)?$) + endCaptures + + 1 + + name + keyword.control.end.applescript + + + name + meta.block.try.applescript + patterns + + + begin + ^\s*(on\s+error)\b + beginCaptures + + 1 + + name + keyword.control.exception.on-error.applescript + + + end + (?<!¬)$ + name + meta.property.error.applescript + patterns + + + match + \b(?i:number|partial|from|to)\b + name + keyword.control.exception.modifier.applescript + + + include + #inline + + + + + include + $self + + + + + begin + ^\s*(using\s+terms\s+from)\b + beginCaptures + + 1 + + name + keyword.control.terms.applescript + + + end + ^\s*(end(?:\s+using\s+terms\s+from)?)(?=\s*(--.*?)?$) + endCaptures + + 1 + + name + keyword.control.end.applescript + + + name + meta.block.terms.applescript + patterns + + + include + $self + + + + + begin + ^\s*(with\s+timeout(\s+of)?)\b + beginCaptures + + 1 + + name + keyword.control.timeout.applescript + + + end + ^\s*(end(?:\s+timeout)?)(?=\s*(--.*?)?$) + endCaptures + + 1 + + name + keyword.control.end.applescript + + + name + meta.block.timeout.applescript + patterns + + + include + $self + + + + + begin + ^\s*(with\s+transaction(\s+of)?)\b + beginCaptures + + 1 + + name + keyword.control.transaction.applescript + + + end + ^\s*(end(?:\s+transaction)?)(?=\s*(--.*?)?$) + endCaptures + + 1 + + name + keyword.control.end.applescript + + + name + meta.block.transaction.applescript + patterns + + + include + $self + + + + + + blocks.repeat + + patterns + + + begin + ^\s*(repeat)\s+(until)\b + beginCaptures + + 1 + + name + keyword.control.repeat.applescript + + 2 + + name + keyword.control.until.applescript + + + end + ^\s*(end(?:\s+repeat)?)(?=\s*(--.*?)?$) + endCaptures + + 1 + + name + keyword.control.end.applescript + + + name + meta.block.repeat.until.applescript + patterns + + + include + $self + + + + + begin + ^\s*(repeat)\s+(while)\b + beginCaptures + + 1 + + name + keyword.control.repeat.applescript + + 2 + + name + keyword.control.while.applescript + + + end + ^\s*(end(?:\s+repeat)?)(?=\s*(--.*?)?$) + endCaptures + + 1 + + name + keyword.control.end.applescript + + + name + meta.block.repeat.while.applescript + patterns + + + include + $self + + + + + begin + ^\s*(repeat)\s+(with)\s+(\w+)\b + beginCaptures + + 1 + + name + keyword.control.repeat.applescript + + 2 + + name + keyword.control.until.applescript + + 3 + + name + variable.parameter.loop.applescript + + + end + ^\s*(end(?:\s+repeat)?)(?=\s*(--.*?)?$) + endCaptures + + 1 + + name + keyword.control.end.applescript + + + name + meta.block.repeat.with.applescript + patterns + + + match + \b(from|to|by)\b + name + keyword.control.modifier.range.applescript + + + match + \b(in)\b + name + keyword.control.modifier.list.applescript + + + include + $self + + + + + begin + ^\s*(repeat)\b(?=\s*(--.*?)?$) + beginCaptures + + 1 + + name + keyword.control.repeat.applescript + + + end + ^\s*(end(?:\s+repeat)?)(?=\s*(--.*?)?$) + endCaptures + + 1 + + name + keyword.control.end.applescript + + + name + meta.block.repeat.forever.applescript + patterns + + + include + $self + + + + + begin + ^\s*(repeat)\b + beginCaptures + + 1 + + name + keyword.control.repeat.applescript + + + end + ^\s*(end(?:\s+repeat)?)(?=\s*(--.*?)?$) + endCaptures + + 1 + + name + keyword.control.end.applescript + + + name + meta.block.repeat.times.applescript + patterns + + + match + \b(times)\b + name + keyword.control.times.applescript + + + include + $self + + + + + + blocks.statement + + patterns + + + begin + \b(prop(?:erty)?)\s+(\w+)\b + beginCaptures + + 1 + + name + keyword.control.def.property.applescript + + 2 + + name + variable.other.property.applescript + + + end + (?<!¬)$ + name + meta.statement.property.applescript + patterns + + + match + : + name + punctuation.separator.key-value.property.applescript + + + include + #inline + + + + + begin + \b(set)\s+(\w+)\s+(to)\b + beginCaptures + + 1 + + name + keyword.control.def.set.applescript + + 2 + + name + variable.other.readwrite.set.applescript + + 3 + + name + keyword.control.def.set.applescript + + + end + (?<!¬)$ + name + meta.statement.set.applescript + patterns + + + include + #inline + + + + + begin + \b(local)\b + beginCaptures + + 1 + + name + keyword.control.def.local.applescript + + + end + (?<!¬)$ + name + meta.statement.local.applescript + patterns + + + match + , + name + punctuation.separator.variables.local.applescript + + + match + \b\w+ + name + variable.other.readwrite.local.applescript + + + include + #inline + + + + + begin + \b(global)\b + beginCaptures + + 1 + + name + keyword.control.def.global.applescript + + + end + (?<!¬)$ + name + meta.statement.global.applescript + patterns + + + match + , + name + punctuation.separator.variables.global.applescript + + + match + \b\w+ + name + variable.other.readwrite.global.applescript + + + include + #inline + + + + + begin + \b(error)\b + beginCaptures + + 1 + + name + keyword.control.exception.error.applescript + + + end + (?<!¬)$ + name + meta.statement.error.applescript + patterns + + + match + \b(number|partial|from|to)\b + name + keyword.control.exception.modifier.applescript + + + include + #inline + + + + + begin + \b(if)\b(?=.*\bthen\b(?!\s*(--.*?)?$)) + beginCaptures + + 1 + + name + keyword.control.if.applescript + + + end + (?<!¬)$ + name + meta.statement.if-then.applescript + patterns + + + include + #inline + + + + + + blocks.tell + + patterns + + + begin + ^\s*(tell)\s+(?=app(lication)?\s+"(?i:textmate)")(?!.*\bto(?!\s+tell)\b) + captures + + 1 + + name + keyword.control.tell.applescript + + + comment + tell Textmate + end + ^\s*(end(?:\s+tell)?)(?=\s*(--.*?)?$) + name + meta.block.tell.application.textmate.applescript + patterns + + + include + #textmate + + + include + #standard-suite + + + include + $self + + + + + begin + ^\s*(tell)\s+(?=app(lication)?\s+"(?i:finder)")(?!.*\bto(?!\s+tell)\b) + captures + + 1 + + name + keyword.control.tell.applescript + + + comment + tell Finder + end + ^\s*(end(?:\s+tell)?)(?=\s*(--.*?)?$) + name + meta.block.tell.application.finder.applescript + patterns + + + include + #finder + + + include + #standard-suite + + + include + $self + + + + + begin + ^\s*(tell)\s+(?=app(lication)?\s+"(?i:system events)")(?!.*\bto(?!\s+tell)\b) + captures + + 1 + + name + keyword.control.tell.applescript + + + comment + tell System Events + end + ^\s*(end(?:\s+tell)?)(?=\s*(--.*?)?$) + name + meta.block.tell.application.system-events.applescript + patterns + + + include + #system-events + + + include + #standard-suite + + + include + $self + + + + + begin + ^\s*(tell)\s+(?=app(lication)?\s+"(?i:itunes)")(?!.*\bto(?!\s+tell)\b) + captures + + 1 + + name + keyword.control.tell.applescript + + + comment + tell iTunes + end + ^\s*(end(?:\s+tell)?)(?=\s*(--.*?)?$) + name + meta.block.tell.application.itunes.applescript + patterns + + + include + #itunes + + + include + #standard-suite + + + include + $self + + + + + begin + ^\s*(tell)\s+(?=app(lication)?\s+process\b)(?!.*\bto(?!\s+tell)\b) + captures + + 1 + + name + keyword.control.tell.applescript + + + comment + tell generic application process + end + ^\s*(end(?:\s+tell)?)(?=\s*(--.*?)?$) + name + meta.block.tell.application-process.generic.applescript + patterns + + + include + #standard-suite + + + include + $self + + + + + begin + ^\s*(tell)\s+(?=app(lication)?\b)(?!.*\bto(?!\s+tell)\b) + captures + + 1 + + name + keyword.control.tell.applescript + + + comment + tell generic application + end + ^\s*(end(?:\s+tell)?)(?=\s*(--.*?)?$) + name + meta.block.tell.application.generic.applescript + patterns + + + include + #standard-suite + + + include + $self + + + + + begin + ^\s*(tell)\s+(?!.*\bto(?!\s+tell)\b) + captures + + 1 + + name + keyword.control.tell.applescript + + + comment + generic tell block + end + ^\s*(end(?:\s+tell)?)(?=\s*(--.*?)?$) + name + meta.block.tell.generic.applescript + patterns + + + include + $self + + + + + begin + ^\s*(tell)\s+(?=.*\bto\b) + captures + + 1 + + name + keyword.control.tell.applescript + + + comment + tell … to statement + end + (?<!¬)$ + name + meta.block.tell.generic.applescript + patterns + + + include + $self + + + + + + built-in + + patterns + + + include + #built-in.constant + + + include + #built-in.keyword + + + include + #built-in.support + + + include + #built-in.punctuation + + + + built-in.constant + + patterns + + + comment + yes/no can’t always be used as booleans, e.g. in an if() expression. But they work e.g. for boolean arguments. + match + \b(?i:true|false|yes|no)\b + name + constant.language.boolean.applescript + + + match + \b(?i:null|missing\s+value)\b + name + constant.language.null.applescript + + + match + -?\b\d+((\.(\d+\b)?)?(?i:e\+?\d*\b)?|\b) + name + constant.numeric.applescript + + + match + \b(?i:space|tab|return|linefeed|quote)\b + name + constant.other.text.applescript + + + match + \b(?i:all\s+(caps|lowercase)|bold|condensed|expanded|hidden|italic|outline|plain|shadow|small\s+caps|strikethrough|(sub|super)script|underline)\b + name + constant.other.styles.applescript + + + match + \b(?i:Jan(uary)?|Feb(ruary)?|Mar(ch)?|Apr(il)?|May|Jun(e)?|Jul(y)?|Aug(ust)?|Sep(tember)?|Oct(ober)?|Nov(ember)?|Dec(ember)?)\b + name + constant.other.time.month.applescript + + + match + \b(?i:Mon(day)?|Tue(sday)?|Wed(nesday)?|Thu(rsday)?|Fri(day)?|Sat(urday)?|Sun(day)?)\b + name + constant.other.time.weekday.applescript + + + match + \b(?i:AppleScript|pi|result|version|current\s+application|its?|m[ey])\b + name + constant.other.miscellaneous.applescript + + + match + \b(?i:text\s+item\s+delimiters|print\s+(length|depth))\b + name + variable.language.applescript + + + + built-in.keyword + + patterns + + + match + (&|\*|\+|-|/|÷|\^) + name + keyword.operator.arithmetic.applescript + + + match + (=|≠|>|<|≥|>=|≤|<=) + name + keyword.operator.comparison.applescript + + + match + (?ix)\b + (and|or|div|mod|as|not + |(a\s+)?(ref(\s+to)?|reference\s+to) + |equal(s|\s+to)|contains?|comes\s+(after|before)|(start|begin|end)s?\s+with + ) + \b + name + keyword.operator.word.applescript + + + comment + In double quotes so we can use a single quote in the keywords. + match + (?ix)\b + (is(n't|\s+not)?(\s+(equal(\s+to)?|(less|greater)\s+than(\s+or\s+equal(\s+to)?)?|in|contained\s+by))? + |does(n't|\s+not)\s+(equal|come\s+(before|after)|contain) + ) + \b + name + keyword.operator.word.applescript + + + match + \b(?i:some|every|whose|where|that|id|index|\d+(st|nd|rd|th)|first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|last|front|back|middle|named|beginning|end|from|to|thr(u|ough)|before|(front|back|beginning|end)\s+of|after|behind|in\s+(front|back|beginning|end)\s+of)\b + name + keyword.operator.reference.applescript + + + match + \b(?i:continue|return|exit(\s+repeat)?)\b + name + keyword.control.loop.applescript + + + match + \b(?i:about|above|after|against|and|apart\s+from|around|as|aside\s+from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|contain|contains|contains|copy|div|does|eighth|else|end|equal|equals|error|every|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead\s+of|into|is|it|its|last|local|me|middle|mod|my|ninth|not|of|on|onto|or|out\s+of|over|prop|property|put|ref|reference|repeat|returning|script|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b + name + keyword.other.applescript + + + + built-in.punctuation + + patterns + + + match + ¬ + name + punctuation.separator.continuation.line.applescript + + + comment + the : in property assignments + match + : + name + punctuation.separator.key-value.property.applescript + + + comment + the parentheses in groups + match + [()] + name + punctuation.section.group.applescript + + + + built-in.support + + patterns + + + match + \b(?i:POSIX\s+path|frontmost|id|name|running|version|days?|weekdays?|months?|years?|time|date\s+string|time\s+string|length|rest|reverse|items?|contents|quoted\s+form|characters?|paragraphs?|words?)\b + name + support.function.built-in.property.applescript + + + match + \b(?i:activate|log|clipboard\s+info|set\s+the\s+clipboard\s+to|the\s+clipboard|info\s+for|list\s+(disks|folder)|mount\s+volume|path\s+to(\s+resource)?|close\s+access|get\s+eof|open\s+for\s+access|read|set\s+eof|write|open\s+location|current\s+date|do\s+shell\s+script|get\s+volume\s+settings|random\s+number|round|set\s+volume|system\s+(attribute|info)|time\s+to\s+GMT|load\s+script|run\s+script|scripting\s+components|store\s+script|copy|count|get|launch|run|set|ASCII\s+(character|number)|localized\s+string|offset|summarize|beep|choose\s+(application|color|file(\s+name)?|folder|from\s+list|remote\s+application|URL)|delay|display\s+(alert|dialog)|say)\b + name + support.function.built-in.command.applescript + + + match + \b(?i:get|run)\b + name + support.function.built-in.applescript + + + match + \b(?i:anything|data|text|upper\s+case|propert(y|ies))\b + name + support.class.built-in.applescript + + + match + \b(?i:alias|class)(es)?\b + name + support.class.built-in.applescript + + + match + \b(?i:app(lication)?|boolean|character|constant|date|event|file(\s+specification)?|handler|integer|item|keystroke|linked\s+list|list|machine|number|picture|preposition|POSIX\s+file|real|record|reference(\s+form)?|RGB\s+color|script|sound|text\s+item|type\s+class|vector|writing\s+code(\s+info)?|zone|((international|styled(\s+(Clipboard|Unicode))?|Unicode)\s+)?text|((C|encoded|Pascal)\s+)?string)s?\b + name + support.class.built-in.applescript + + + match + (?ix)\b + ( (cubic\s+(centi)?|square\s+(kilo)?|centi|kilo)met(er|re)s + | square\s+(yards|feet|miles)|cubic\s+(yards|feet|inches)|miles|inches + | lit(re|er)s|gallons|quarts + | (kilo)?grams|ounces|pounds + | degrees\s+(Celsius|Fahrenheit|Kelvin) + ) + \b + name + support.class.built-in.unit.applescript + + + match + \b(?i:seconds|minutes|hours|days)\b + name + support.class.built-in.time.applescript + + + + comments + + patterns + + + captures + + 1 + + name + punctuation.definition.comment.applescript + + + match + ^\s*(#!).*$\n? + name + comment.line.number-sign.applescript + + + captures + + 1 + + name + punctuation.definition.comment.applescript + + + match + (--).*$\n? + name + comment.line.double-dash.applescript + + + begin + \(\* + captures + + 0 + + name + punctuation.definition.comment.applescript + + + end + \*\) + name + comment.block.applescript + patterns + + + include + #comments.nested + + + + + + comments.nested + + patterns + + + begin + \(\* + captures + + 0 + + name + punctuation.definition.comment.applescript + + + end + \*\) + name + comment.block.applescript + patterns + + + include + #comments.nested + + + + + + data-structures + + patterns + + + begin + (\{) + captures + + 1 + + name + punctuation.section.array.applescript + + + comment + We cannot necessarily distinguish "records" from "arrays", and so this could be either. + end + (\}) + name + meta.array.applescript + patterns + + + captures + + 1 + + name + constant.other.key.applescript + + 2 + + name + meta.identifier.applescript + + 3 + + name + punctuation.definition.identifier.applescript + + 4 + + name + punctuation.definition.identifier.applescript + + 5 + + name + punctuation.separator.key-value.applescript + + + match + (\w+|((\|)[^|\n]*(\|)))\s*(:) + + + match + : + name + punctuation.separator.key-value.applescript + + + match + , + name + punctuation.separator.array.applescript + + + include + #inline + + + + + begin + (?:(?<=application )|(?<=app ))(") + captures + + 1 + + name + punctuation.definition.string.applescript + + + end + (") + name + string.quoted.double.application-name.applescript + patterns + + + match + \\. + name + constant.character.escape.applescript + + + + + begin + (") + captures + + 1 + + name + punctuation.definition.string.applescript + + + end + (") + name + string.quoted.double.applescript + patterns + + + match + \\. + name + constant.character.escape.applescript + + + + + captures + + 1 + + name + punctuation.definition.identifier.applescript + + 2 + + name + punctuation.definition.identifier.applescript + + + match + (\|)[^|\n]*(\|) + name + meta.identifier.applescript + + + captures + + 1 + + name + punctuation.definition.data.applescript + + 2 + + name + support.class.built-in.applescript + + 3 + + name + storage.type.utxt.applescript + + 4 + + name + string.unquoted.data.applescript + + 5 + + name + punctuation.definition.data.applescript + + 6 + + name + keyword.operator.applescript + + 7 + + name + support.class.built-in.applescript + + + match + («)(data) (utxt|utf8)([[:xdigit:]]*)(»)(?:\s+(as)\s+(?i:Unicode\s+text))? + name + constant.other.data.utxt.applescript + + + begin + («)(\w+)\b(?=\s) + beginCaptures + + 1 + + name + punctuation.definition.data.applescript + + 2 + + name + support.class.built-in.applescript + + + end + (») + endCaptures + + 1 + + name + punctuation.definition.data.applescript + + + name + constant.other.data.raw.applescript + + + captures + + 1 + + name + punctuation.definition.data.applescript + + 2 + + name + punctuation.definition.data.applescript + + + match + («)[^»]*(») + name + invalid.illegal.data.applescript + + + + finder + + patterns + + + match + \b(item|container|(computer|disk|trash)-object|disk|folder|((alias|application|document|internet location) )?file|clipping|package)s?\b + name + support.class.finder.items.applescript + + + match + \b((Finder|desktop|information|preferences|clipping) )windows?\b + name + support.class.finder.window-classes.applescript + + + match + \b(preferences|(icon|column|list) view options|(label|column|alias list)s?)\b + name + support.class.finder.type-definitions.applescript + + + match + \b(copy|find|sort|clean up|eject|empty( trash)|erase|reveal|update)\b + name + support.function.finder.items.applescript + + + match + \b(insertion location|product version|startup disk|desktop|trash|home|computer container|finder preferences)\b + name + support.constant.finder.applescript + + + match + \b(visible)\b + name + support.variable.finder.applescript + + + + inline + + patterns + + + include + #comments + + + include + #data-structures + + + include + #built-in + + + include + #standardadditions + + + + itunes + + patterns + + + match + \b(artwork|application|encoder|EQ preset|item|source|visual|(EQ |browser )?window|((audio CD|device|shared|URL|file) )?track|playlist window|((audio CD|device|radio tuner|library|folder|user) )?playlist)s?\b + name + support.class.itunes.applescript + + + match + \b(add|back track|convert|fast forward|(next|previous) track|pause|play(pause)?|refresh|resume|rewind|search|stop|update|eject|subscribe|update(Podcast|AllPodcasts)|download)\b + name + support.function.itunes.applescript + + + match + \b(current (playlist|stream (title|URL)|track)|player state)\b + name + support.constant.itunes.applescript + + + match + \b(current (encoder|EQ preset|visual)|EQ enabled|fixed indexing|full screen|mute|player position|sound volume|visuals enabled|visual size)\b + name + support.variable.itunes.applescript + + + + standard-suite + + patterns + + + match + \b(colors?|documents?|items?|windows?)\b + name + support.class.standard-suite.applescript + + + match + \b(close|count|delete|duplicate|exists|make|move|open|print|quit|save|activate|select|data size)\b + name + support.function.standard-suite.applescript + + + match + \b(name|frontmost|version)\b + name + support.constant.standard-suite.applescript + + + match + \b(selection)\b + name + support.variable.standard-suite.applescript + + + match + \b(attachments?|attribute runs?|characters?|paragraphs?|texts?|words?)\b + name + support.class.text-suite.applescript + + + + standardadditions + + patterns + + + match + \b((alert|dialog) reply)\b + name + support.class.standardadditions.user-interaction.applescript + + + match + \b(file information)\b + name + support.class.standardadditions.file.applescript + + + match + \b(POSIX files?|system information|volume settings)\b + name + support.class.standardadditions.miscellaneous.applescript + + + match + \b(URLs?|internet address(es)?|web pages?|FTP items?)\b + name + support.class.standardadditions.internet.applescript + + + match + \b(info for|list (disks|folder)|mount volume|path to( resource)?)\b + name + support.function.standardadditions.file.applescript + + + match + \b(beep|choose (application|color|file( name)?|folder|from list|remote application|URL)|delay|display (alert|dialog)|say)\b + name + support.function.standardadditions.user-interaction.applescript + + + match + \b(ASCII (character|number)|localized string|offset|summarize)\b + name + support.function.standardadditions.string.applescript + + + match + \b(set the clipboard to|the clipboard|clipboard info)\b + name + support.function.standardadditions.clipboard.applescript + + + match + \b(open for access|close access|read|write|get eof|set eof)\b + name + support.function.standardadditions.file-i-o.applescript + + + match + \b((load|store|run) script|scripting components)\b + name + support.function.standardadditions.scripting.applescript + + + match + \b(current date|do shell script|get volume settings|random number|round|set volume|system attribute|system info|time to GMT)\b + name + support.function.standardadditions.miscellaneous.applescript + + + match + \b(opening folder|(closing|moving) folder window for|adding folder items to|removing folder items from)\b + name + support.function.standardadditions.folder-actions.applescript + + + match + \b(open location|handle CGI request)\b + name + support.function.standardadditions.internet.applescript + + + + system-events + + patterns + + + match + \b(audio (data|file))\b + name + support.class.system-events.audio-file.applescript + + + match + \b(alias(es)?|(Classic|local|network|system|user) domain objects?|disk( item)?s?|domains?|file( package)?s?|folders?|items?)\b + name + support.class.system-events.disk-folder-file.applescript + + + match + \b(delete|open|move)\b + name + support.function.system-events.disk-folder-file.applescript + + + match + \b(folder actions?|scripts?)\b + name + support.class.system-events.folder-actions.applescript + + + match + \b(attach action to|attached scripts|edit action of|remove action from)\b + name + support.function.system-events.folder-actions.applescript + + + match + \b(movie data|movie file)\b + name + support.class.system-events.movie-file.applescript + + + match + \b(log out|restart|shut down|sleep)\b + name + support.function.system-events.power.applescript + + + match + \b(((application |desk accessory )?process|(check|combo )?box)(es)?|(action|attribute|browser|(busy|progress|relevance) indicator|color well|column|drawer|group|grow area|image|incrementor|list|menu( bar)?( item)?|(menu |pop up |radio )?button|outline|(radio|tab|splitter) group|row|scroll (area|bar)|sheet|slider|splitter|static text|table|text (area|field)|tool bar|UI element|window)s?)\b + name + support.class.system-events.processes.applescript + + + match + \b(click|key code|keystroke|perform|select)\b + name + support.function.system-events.processes.applescript + + + match + \b(property list (file|item))\b + name + support.class.system-events.property-list.applescript + + + match + \b(annotation|QuickTime (data|file)|track)s?\b + name + support.class.system-events.quicktime-file.applescript + + + match + \b((abort|begin|end) transaction)\b + name + support.function.system-events.system-events.applescript + + + match + \b(XML (attribute|data|element|file)s?)\b + name + support.class.system-events.xml.applescript + + + match + \b(print settings|users?|login items?)\b + name + support.class.sytem-events.other.applescript + + + + textmate + + patterns + + + match + \b(print settings)\b + name + support.class.textmate.applescript + + + match + \b(get url|insert|reload bundles)\b + name + support.function.textmate.applescript + + + + + scopeName + source.applescript + uuid + 777CF925-14B9-428E-B07B-17FAAB8FA27E + + diff --git a/app/rcc/edbee/syntaxfiles/Batch File.tmLanguage b/app/rcc/edbee/syntaxfiles/Batch File.tmLanguage new file mode 100644 index 00000000..2a7752e5 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Batch File.tmLanguage @@ -0,0 +1,111 @@ + + + + + uuid + E07EC438-7B75-4437-8AA1-DA94C1E6EACC + patterns + + + name + keyword.command.dosbatch + match + \b(?i)(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|echo|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|rem|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\b + + + name + keyword.control.statement.dosbatch + match + \b(?i)(?:goto|call|exit)\b + + + name + keyword.control.conditional.if.dosbatch + match + \b(?i)if\s+((not)\s+)(exist|defined|errorlevel|cmdextversion)\b + + + name + keyword.control.conditional.dosbatch + match + \b(?i)(?:if|else)\b + + + name + keyword.control.repeat.dosbatch + match + \b(?i)for\b + + + name + keyword.operator.dosbatch + match + \b(?:EQU|NEQ|LSS|LEQ|GTR|GEQ)\b + + + captures + + 1 + + name + keyword.command.rem.dosbatch + + + name + comment.line.rem.dosbatch + match + (?:^|\s)((?i)rem)(?:$|\s.*$) + + + name + comment.line.colons.dosbatch + match + \s*:\s*:.*$ + + + begin + " + endCaptures + + 0 + + name + punctuation.definition.string.end.shell + + + beginCaptures + + 0 + + name + punctuation.definition.string.begin.shell + + + name + string.quoted.double.dosbatch + end + " + + + name + keyword.operator.pipe.dosbatch + match + [|] + + + name + keyword.operator.redirect.shell + match + &>|\d*>&\d*|\d*(>>|>|<)|\d*<&|\d*<> + + + name + Batch File + scopeName + source.dosbatch + fileTypes + + bat + + + \ No newline at end of file diff --git a/app/rcc/edbee/syntaxfiles/Bibtex.tmLanguage b/app/rcc/edbee/syntaxfiles/Bibtex.tmLanguage new file mode 100644 index 00000000..211aedda --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Bibtex.tmLanguage @@ -0,0 +1,406 @@ + + + + + comment + Grammar based on description from http://artis.imag.fr/~Xavier.Decoret/resources/xdkbibtex/bibtex_summary.html#comment + + TODO: Does not support @preamble + + fileTypes + + bib + + foldingStartMarker + \@[a-zA-Z]+\s*[{(].+, + foldingStopMarker + ^\s*[)}]\s*$ + name + BibTeX + patterns + + + begin + @Comment + beginCaptures + + 0 + + name + punctuation.definition.comment.bibtex + + + end + $\n? + name + comment.line.at-sign.bibtex + + + begin + ((@)String)\s*(\{)\s*([a-zA-Z]*) + beginCaptures + + 1 + + name + keyword.other.string-constant.bibtex + + 2 + + name + punctuation.definition.keyword.bibtex + + 3 + + name + punctuation.section.string-constant.begin.bibtex + + 4 + + name + variable.other.bibtex + + + end + \} + endCaptures + + 0 + + name + punctuation.section.string-constant.end.bibtex + + + name + meta.string-constant.braces.bibtex + patterns + + + include + #string_content + + + + + begin + ((@)String)\s*(\()\s*([a-zA-Z]*) + beginCaptures + + 1 + + name + keyword.other.string-constant.bibtex + + 2 + + name + punctuation.definition.keyword.bibtex + + 3 + + name + punctuation.section.string-constant.begin.bibtex + + 4 + + name + variable.other.bibtex + + + end + \) + endCaptures + + 0 + + name + punctuation.section.string-constant.end.bibtex + + + name + meta.string-constant.parenthesis.bibtex + patterns + + + include + #string_content + + + + + begin + ((@)[a-zA-Z]+)\s*(\{)\s*([^\s,]*) + beginCaptures + + 1 + + name + keyword.other.entry-type.bibtex + + 2 + + name + punctuation.definition.keyword.bibtex + + 3 + + name + punctuation.section.entry.begin.bibtex + + 4 + + name + entity.name.type.entry-key.bibtex + + + end + \} + endCaptures + + 0 + + name + punctuation.section.entry.end.bibtex + + + name + meta.entry.braces.bibtex + patterns + + + begin + ([a-zA-Z]+)\s*(\=) + beginCaptures + + 1 + + name + string.unquoted.key.bibtex + + 2 + + name + punctuation.separator.key-value.bibtex + + + end + (?=[,}]) + name + meta.key-assignment.bibtex + patterns + + + include + #string_content + + + include + #integer + + + + + + + begin + ((@)[a-zA-Z]+)\s*(\()\s*([^\s,]*) + beginCaptures + + 1 + + name + keyword.other.entry-type.bibtex + + 2 + + name + punctuation.definition.keyword.bibtex + + 3 + + name + punctuation.section.entry.begin.bibtex + + 4 + + name + entity.name.type.entry-key.bibtex + + + end + \) + endCaptures + + 0 + + name + punctuation.section.entry.end.bibtex + + + name + meta.entry.parenthesis.bibtex + patterns + + + begin + ([a-zA-Z]+)\s*(\=) + beginCaptures + + 1 + + name + string.unquoted.key.bibtex + + 2 + + name + punctuation.separator.key-value.bibtex + + + end + (?=[,)]) + name + meta.key-assignment.bibtex + patterns + + + include + #string_content + + + include + #integer + + + + + + + begin + [^@\n] + end + (?=@) + name + comment.block.bibtex + + + repository + + integer + + match + \d+ + name + constant.numeric.bibtex + + nested_braces + + begin + \{ + beginCaptures + + 0 + + name + punctuation.definition.group.begin.bibtex + + + end + \} + endCaptures + + 0 + + name + punctuation.definition.group.end.bibtex + + + patterns + + + include + #nested_braces + + + + string_content + + patterns + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.bibtex + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.bibtex + + + name + string.quoted.double.bibtex + patterns + + + include + #nested_braces + + + + + begin + \{ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.bibtex + + + end + \} + endCaptures + + 0 + + name + punctuation.definition.string.end.bibtex + + + name + string.quoted.other.braces.bibtex + patterns + + + match + @ + name + invalid.illegal.at-sign.bibtex + + + include + #nested_braces + + + + + + + scopeName + text.bibtex + uuid + 47F30BA1-6B1D-11D9-9A60-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/Build.tmLanguage b/app/rcc/edbee/syntaxfiles/Build.tmLanguage new file mode 100644 index 00000000..55191b47 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Build.tmLanguage @@ -0,0 +1,142 @@ + + + + + fileTypes + + build + + foldingStartMarker + <[^!?/>]+|<!-- + foldingStopMarker + />|</[^?>]+|--> + name + NAnt Build File + patterns + + + begin + <!-- + captures + + 0 + + name + punctuation.definition.comment.nant + + + end + --> + name + comment.block.nant + + + begin + (</?)([-_a-zA-Z0-9:]+) + captures + + 1 + + name + punctuation.definition.tag.nant + + 2 + + name + entity.name.tag.nant + + + end + (/?>) + name + meta.tag.nant + patterns + + + match + ([a-zA-Z-]+) + name + entity.other.attribute-name.nant + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.nant + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.nant + + + name + string.quoted.double.nant + + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.nant + + + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.nant + + + name + string.quoted.single.nant + + + + + captures + + 1 + + name + punctuation.definition.constant.nant + + 3 + + name + punctuation.definition.constant.nant + + + match + (&)([a-zA-Z]+|#[0-9]+|#x[0-9a-fA-F]+)(;) + name + constant.character.entity.nant + + + match + & + name + invalid.illegal.bad-ampersand.nant + + + scopeName + source.nant-build + uuid + 1BA72668-707C-11D9-A928-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/C#.tmLanguage b/app/rcc/edbee/syntaxfiles/C#.tmLanguage new file mode 100644 index 00000000..4d6bd9b9 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/C#.tmLanguage @@ -0,0 +1,530 @@ + + + + + fileTypes + + cs + + foldingStartMarker + ^\s*/\*|^(?![^{]*?//|[^{]*?/\*(?!.*?\*/.*?\{)).*?\{\s*($|//|/\*(?!.*?\*/.*\S)) + foldingStopMarker + ^\s*\*/|^\s*\} + keyEquivalent + ^~C + name + C# + patterns + + + begin + /// + captures + + 0 + + name + punctuation.definition.comment.source.cs + + + end + $\n? + name + comment.block.documentation.source.cs + patterns + + + begin + (</?)(?:([-_a-zA-Z0-9]+)((:)))?([-_a-zA-Z0-9:]+) + captures + + 1 + + name + punctuation.definition.tag.source.cs + + 2 + + name + entity.name.tag.namespace.source.cs + + 3 + + name + entity.name.tag.source.cs + + 4 + + name + punctuation.separator.namespace.source.cs + + 5 + + name + entity.name.tag.localname.source.cs + + + end + (/?>) + name + keyword.other.documentation.source.cs + patterns + + + captures + + 1 + + name + entity.other.attribute-name.namespace.source.cs + + 2 + + name + entity.other.attribute-name.source.cs + + 3 + + name + punctuation.separator.namespace.source.cs + + 4 + + name + entity.other.attribute-name.localname.source.cs + + + match + (?:([-_a-zA-Z0-9]+)((:)))?([_a-zA-Z-]+)= + + + include + #doubleQuotedString + + + include + #singleQuotedString + + + + + + + include + #comments + + + begin + (?x)^\s* +((?:\b(?:new|public|protected|internal|private|abstract|sealed|static)\b\s)*) +(class)\s+ +([A-Za-z_]\w+)\b + captures + + 1 + + name + storage.modifier.source.cs + + 2 + + name + storage.type.source.cs + + 3 + + name + entity.name.type.class.source.cs + + + end + { + name + meta.definition.class.source.cs + patterns + + + include + #classInheritance + + + + + + + match + \b(true|false|null|this|base)\b + name + constant.language.source.cs + + + match + \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\b + name + constant.numeric.source.cs + + + match + \b(if|else|while|for|foreach|do|return|continue|break|switch|case|default|goto|throw|try|catch|finally|lock|yield)\b + name + keyword.control.source.cs + + + match + \b(new|is|checked|unchecked|typeof|sizeof|override|in|out|ref|readonly|params|stackalloc|as)\b + name + keyword.operator.source.cs + + + match + \b(event|delegate|explicit|implicit|in|set|get)\b + name + keyword.other.source.cs + + + match + \b(internal|public|protected|private|static|const|new|sealed|abstract|override|extern|unsafe|readonly|volatile|operator)\b + name + storage.modifier.source.cs + + + include + #doubleQuotedStringLiteral + + + include + #doubleQuotedString + + + include + #singleQuotedString + + + captures + + 1 + + name + keyword.other.using.source.cs + + 2 + + name + entity.name.type.package.source.cs + + + match + ^\s*(using)\s+([^ ;]*); + name + meta.keyword.using.source.cs + + + include + #builtinTypes + + + captures + + 1 + + name + keyword.other.namespace.source.cs + + 2 + + name + entity.name.type.namespace.source.cs + + + match + ^\s*(namespace)\s+([^ ]+)(?:\s*{)?$ + name + meta.keyword.namespace.source.cs + + + captures + + 2 + + name + keyword.control.import.source.cs + + + match + ^(#)\s*(if|else|elif|endif|define|undef|warning|error|line|region|endregion)\b + name + meta.preprocessor.source.cs + + + repository + + builtinTypes + + patterns + + + match + \b(bool|byte|sbyte|char|decimal|double|float|int|uint|long|ulong|object|short|ushort|string|void|class|struct|enum|interface)\b + name + storage.type.source.cs + + + + classInheritance + + patterns + + + begin + : + end + (?={) + patterns + + + captures + + 1 + + name + storage.type.source.cs + + + match + \s*,?([A-Za-z_]\w*)\b + + + + + + comments + + patterns + + + begin + /\* + captures + + 0 + + name + punctuation.definition.comment.source.cs + + + end + \*/\n? + name + comment.block.source.cs + + + captures + + 1 + + name + punctuation.definition.comment.source.cs + + + match + (//).*$\n? + name + comment.line.double-slash.source.cs + + + + doubleQuotedString + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.source.cs + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.source.cs + + + name + string.quoted.double.source.cs + patterns + + + match + \\. + name + constant.character.escape.source.cs + + + + doubleQuotedStringLiteral + + captures + + 0 + + name + punctuation.definition.string.begin.source.cs + + + match + @"([^"]|"")*" + name + string.quoted.double.literal.source.cs + + singleQuotedString + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.source.cs + + + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.source.cs + + + name + string.quoted.single.xml + patterns + + + match + \\. + name + constant.character.escape.source.cs + + + + statementRemainder + + patterns + + + begin + \( + end + (?=\)) + name + meta.definition.param-list.source.cs + patterns + + + include + #builtinTypes + + + + + + + scopeName + source.cs + uuid + 1BA75B32-707C-11D9-A928-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/C++.tmLanguage b/app/rcc/edbee/syntaxfiles/C++.tmLanguage new file mode 100644 index 00000000..e6647c1a --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/C++.tmLanguage @@ -0,0 +1,491 @@ + + + + + comment + I don't think anyone uses .hp. .cp tends to be paired with .h. (I could be wrong. :) -- chris + fileTypes + + cpp + cc + cp + cxx + c++ + C + h + hh + hpp + hxx + h++ + inl + ipp + + firstLineMatch + -\*- C\+\+ -\*- + foldingStartMarker + (?x) + /\*\*(?!\*) + |^(?![^{]*?//|[^{]*?/\*(?!.*?\*/.*?\{)).*?\{\s*($|//|/\*(?!.*?\*/.*\S)) + + foldingStopMarker + (?<!\*)\*\*/|^\s*\} + keyEquivalent + ^~C + name + C++ + patterns + + + include + #special_block + + + include + source.c + + + match + \b(friend|explicit|virtual)\b + name + storage.modifier.c++ + + + match + \b(private:|protected:|public:) + name + storage.modifier.c++ + + + match + \b(catch|operator|try|throw|using)\b + name + keyword.control.c++ + + + match + \bdelete\b(\s*\[\])?|\bnew\b(?!]) + name + keyword.control.c++ + + + comment + common C++ instance var naming idiom -- fMemberName + match + \b(f|m)[A-Z]\w*\b + name + variable.other.readwrite.member.c++ + + + match + \b(this)\b + name + variable.language.c++ + + + match + \btemplate\b\s* + name + storage.type.template.c++ + + + match + \b(const_cast|dynamic_cast|reinterpret_cast|static_cast)\b\s* + name + keyword.operator.cast.c++ + + + match + \b(and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq)\b + name + keyword.operator.c++ + + + match + \b(class|wchar_t)\b + name + storage.type.c++ + + + match + \b(export|mutable|typename)\b + name + storage.modifier.c++ + + + begin + (?x) + (?: ^ # begin-of-line + | (?: (?<!else|new|=) ) # or word + space before name + ) + ((?:[A-Za-z_][A-Za-z0-9_]*::)*+~[A-Za-z_][A-Za-z0-9_]*) # actual name + \s*(\() # start bracket or end-of-line + + beginCaptures + + 1 + + name + entity.name.function.c++ + + 2 + + name + punctuation.definition.parameters.c + + + end + \) + endCaptures + + 0 + + name + punctuation.definition.parameters.c + + + name + meta.function.destructor.c++ + patterns + + + include + $base + + + + + begin + (?x) + (?: ^ # begin-of-line + | (?: (?<!else|new|=) ) # or word + space before name + ) + ((?:[A-Za-z_][A-Za-z0-9_]*::)*+~[A-Za-z_][A-Za-z0-9_]*) # actual name + \s*(\() # terminating semi-colon + + beginCaptures + + 1 + + name + entity.name.function.c++ + + 2 + + name + punctuation.definition.parameters.c + + + end + \) + endCaptures + + 0 + + name + punctuation.definition.parameters.c + + + name + meta.function.destructor.prototype.c++ + patterns + + + include + $base + + + + + repository + + angle_brackets + + begin + < + end + > + name + meta.angle-brackets.c++ + patterns + + + include + #angle_brackets + + + include + $base + + + + block + + begin + \{ + end + \} + name + meta.block.c++ + patterns + + + captures + + 1 + + name + support.function.any-method.c + + 2 + + name + punctuation.definition.parameters.c + + + match + (?x) + ( + (?!while|for|do|if|else|switch|catch|enumerate|return|r?iterate)(?: \b[A-Za-z_][A-Za-z0-9_]*+\b | :: )*+ # actual name + ) + \s*(\() + name + meta.function-call.c + + + include + $base + + + + constructor + + patterns + + + begin + (?x) + (?: ^\s*) # begin-of-line + ((?!while|for|do|if|else|switch|catch|enumerate|r?iterate)[A-Za-z_][A-Za-z0-9_:]*) # actual name + \s*(\() # start bracket or end-of-line + + beginCaptures + + 1 + + name + entity.name.function.c++ + + 2 + + name + punctuation.definition.parameters.c + + + end + \) + endCaptures + + 0 + + name + punctuation.definition.parameters.c + + + name + meta.function.constructor.c++ + patterns + + + include + $base + + + + + begin + (?x) + (:) # begin-of-line + ((?=\s*[A-Za-z_][A-Za-z0-9_:]* # actual name + \s*(\())) # start bracket or end-of-line + + beginCaptures + + 1 + + name + punctuation.definition.parameters.c + + + end + (?=\{) + name + meta.function.constructor.initializer-list.c++ + patterns + + + include + $base + + + + + + special_block + + patterns + + + begin + \b(namespace)\s+([A-Za-z_][_A-Za-z0-9:]*\b)?+(?!\s*?(;|=|,)) + end + (?<=\}) + name + meta.namespace-block.c++ + patterns + + + begin + \{ + end + \} + patterns + + + include + #special_block + + + include + #constructor + + + include + $base + + + + + + + begin + \b(class|struct)\s+([_A-Za-z][_A-Za-z0-9]*\b) + beginCaptures + + 1 + + name + storage.type.c++ + + 2 + + name + entity.name.type.c++ + + + end + (?<=\})|(?=(;|,|\(|\)|>|\[|\])) + name + meta.class-struct-block.c++ + patterns + + + include + #angle_brackets + + + begin + (\{) + beginCaptures + + 1 + + name + punctuation.definition.scope.c++ + + + end + (\})(\s*\n)? + endCaptures + + 1 + + name + punctuation.definition.invalid.c++ + + 2 + + name + invalid.illegal.you-forgot-semicolon.c++ + + + patterns + + + include + #special_block + + + include + #constructor + + + include + $base + + + + + include + $base + + + + + begin + \b(extern)(?=\s*") + beginCaptures + + 1 + + name + storage.modifier.c++ + + + end + (?<=\})|(?=\w) + name + meta.extern-block.c++ + patterns + + + begin + \{ + end + \} + patterns + + + include + #special_block + + + include + $base + + + + + include + $base + + + + + + + scopeName + source.c++ + uuid + 26251B18-6B1D-11D9-AFDB-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/C.tmLanguage b/app/rcc/edbee/syntaxfiles/C.tmLanguage new file mode 100644 index 00000000..925a8641 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/C.tmLanguage @@ -0,0 +1,1126 @@ + + + + + fileTypes + + c + h + + firstLineMatch + -[*]-( Mode:)? C -[*]- + foldingStartMarker + (?x) + /\*\*(?!\*) + |^(?![^{]*?//|[^{]*?/\*(?!.*?\*/.*?\{)).*?\{\s*($|//|/\*(?!.*?\*/.*\S)) + + foldingStopMarker + (?<!\*)\*\*/|^\s*\} + keyEquivalent + ^~C + name + C + patterns + + + include + #preprocessor-rule-enabled + + + include + #preprocessor-rule-disabled + + + include + #preprocessor-rule-other + + + include + #comments + + + match + \b(break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while)\b + name + keyword.control.c + + + match + \b(asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void)\b + name + storage.type.c + + + match + \b(const|extern|register|restrict|static|volatile|inline)\b + name + storage.modifier.c + + + comment + common C constant naming idiom -- kConstantVariable + match + \bk[A-Z]\w*\b + name + constant.other.variable.mac-classic.c + + + match + \bg[A-Z]\w*\b + name + variable.other.readwrite.global.mac-classic.c + + + match + \bs[A-Z]\w*\b + name + variable.other.readwrite.static.mac-classic.c + + + match + \b(NULL|true|false|TRUE|FALSE)\b + name + constant.language.c + + + include + #sizeof + + + match + \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\b + name + constant.numeric.c + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.c + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.c + + + name + string.quoted.double.c + patterns + + + include + #string_escaped_char + + + include + #string_placeholder + + + + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.c + + + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.c + + + name + string.quoted.single.c + patterns + + + include + #string_escaped_char + + + + + begin + (?x) + ^\s*\#\s*(define)\s+ # define + ((?<id>[a-zA-Z_][a-zA-Z0-9_]*)) # macro name + (?: # and optionally: + (\() # an open parenthesis + ( + \s* \g<id> \s* # first argument + ((,) \s* \g<id> \s*)* # additional arguments + (?:\.\.\.)? # varargs ellipsis? + ) + (\)) # a close parenthesis + )? + + beginCaptures + + 1 + + name + keyword.control.import.define.c + + 2 + + name + entity.name.function.preprocessor.c + + 4 + + name + punctuation.definition.parameters.c + + 5 + + name + variable.parameter.preprocessor.c + + 7 + + name + punctuation.separator.parameters.c + + 8 + + name + punctuation.definition.parameters.c + + + end + (?=(?://|/\*))|$ + name + meta.preprocessor.macro.c + patterns + + + match + (?>\\\s*\n) + name + punctuation.separator.continuation.c + + + include + $base + + + + + begin + ^\s*#\s*(error|warning)\b + captures + + 1 + + name + keyword.control.import.error.c + + + end + $ + name + meta.preprocessor.diagnostic.c + patterns + + + match + (?>\\\s*\n) + name + punctuation.separator.continuation.c + + + + + begin + ^\s*#\s*(include|import)\b\s+ + captures + + 1 + + name + keyword.control.import.include.c + + + end + (?=(?://|/\*))|$ + name + meta.preprocessor.c.include + patterns + + + match + (?>\\\s*\n) + name + punctuation.separator.continuation.c + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.c + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.c + + + name + string.quoted.double.include.c + + + begin + < + beginCaptures + + 0 + + name + punctuation.definition.string.begin.c + + + end + > + endCaptures + + 0 + + name + punctuation.definition.string.end.c + + + name + string.quoted.other.lt-gt.include.c + + + + + include + #pragma-mark + + + begin + ^\s*#\s*(define|defined|elif|else|if|ifdef|ifndef|line|pragma|undef)\b + captures + + 1 + + name + keyword.control.import.c + + + end + (?=(?://|/\*))|$ + name + meta.preprocessor.c + patterns + + + match + (?>\\\s*\n) + name + punctuation.separator.continuation.c + + + + + match + \b(u_char|u_short|u_int|u_long|ushort|uint|u_quad_t|quad_t|qaddr_t|caddr_t|daddr_t|dev_t|fixpt_t|blkcnt_t|blksize_t|gid_t|in_addr_t|in_port_t|ino_t|key_t|mode_t|nlink_t|id_t|pid_t|off_t|segsz_t|swblk_t|uid_t|id_t|clock_t|size_t|ssize_t|time_t|useconds_t|suseconds_t)\b + name + support.type.sys-types.c + + + match + \b(pthread_attr_t|pthread_cond_t|pthread_condattr_t|pthread_mutex_t|pthread_mutexattr_t|pthread_once_t|pthread_rwlock_t|pthread_rwlockattr_t|pthread_t|pthread_key_t)\b + name + support.type.pthread.c + + + match + \b(int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t|uintmax_t|uintmax_t)\b + name + support.type.stdint.c + + + match + \b(noErr|kNilOptions|kInvalidID|kVariableLengthArray)\b + name + support.constant.mac-classic.c + + + match + \b(AbsoluteTime|Boolean|Byte|ByteCount|ByteOffset|BytePtr|CompTimeValue|ConstLogicalAddress|ConstStrFileNameParam|ConstStringPtr|Duration|Fixed|FixedPtr|Float32|Float32Point|Float64|Float80|Float96|FourCharCode|Fract|FractPtr|Handle|ItemCount|LogicalAddress|OptionBits|OSErr|OSStatus|OSType|OSTypePtr|PhysicalAddress|ProcessSerialNumber|ProcessSerialNumberPtr|ProcHandle|Ptr|ResType|ResTypePtr|ShortFixed|ShortFixedPtr|SignedByte|SInt16|SInt32|SInt64|SInt8|Size|StrFileName|StringHandle|StringPtr|TimeBase|TimeRecord|TimeScale|TimeValue|TimeValue64|UInt16|UInt32|UInt64|UInt8|UniChar|UniCharCount|UniCharCountPtr|UniCharPtr|UnicodeScalarValue|UniversalProcHandle|UniversalProcPtr|UnsignedFixed|UnsignedFixedPtr|UnsignedWide|UTF16Char|UTF32Char|UTF8Char)\b + name + support.type.mac-classic.c + + + include + #block + + + begin + (?x) + (?: ^ # begin-of-line + | + (?: (?= \s ) (?<!else|new|return) (?<=\w) # or word + space before name + | (?= \s*[A-Za-z_] ) (?<!&&) (?<=[*&>]) # or type modifier before name + ) + ) + (\s*) (?!(while|for|do|if|else|switch|catch|enumerate|return|r?iterate)\s*\() + ( + (?: [A-Za-z_][A-Za-z0-9_]*+ | :: )++ | # actual name + (?: (?<=operator) (?: [-*&<>=+!]+ | \(\) | \[\] ) ) # if it is a C++ operator + ) + \s*(?=\() + beginCaptures + + 1 + + name + punctuation.whitespace.function.leading.c + + 3 + + name + entity.name.function.c + + 4 + + name + punctuation.definition.parameters.c + + + end + (?<=\})|(?=#)|(;) + name + meta.function.c + patterns + + + include + #comments + + + include + #parens + + + match + \bconst\b + name + storage.modifier.c + + + include + #block + + + + + repository + + access + + match + \.[a-zA-Z_][a-zA-Z_0-9]*\b(?!\s*\() + name + variable.other.dot-access.c + + block + + begin + \{ + end + \} + name + meta.block.c + patterns + + + include + #block_innards + + + + block_innards + + patterns + + + include + #preprocessor-rule-enabled-block + + + include + #preprocessor-rule-disabled-block + + + include + #preprocessor-rule-other-block + + + include + #sizeof + + + include + #access + + + captures + + 1 + + name + punctuation.whitespace.support.function.leading.c + + 2 + + name + support.function.C99.c + + + match + (\s*)\b(hypot(f|l)?|s(scanf|ystem|nprintf|ca(nf|lb(n(f|l)?|ln(f|l)?))|i(n(h(f|l)?|f|l)?|gn(al|bit))|tr(s(tr|pn)|nc(py|at|mp)|c(spn|hr|oll|py|at|mp)|to(imax|d|u(l(l)?|max)|k|f|l(d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(jmp|vbuf|locale|buf)|qrt(f|l)?|w(scanf|printf)|rand)|n(e(arbyint(f|l)?|xt(toward(f|l)?|after(f|l)?))|an(f|l)?)|c(s(in(h(f|l)?|f|l)?|qrt(f|l)?)|cos(h(f)?|f|l)?|imag(f|l)?|t(ime|an(h(f|l)?|f|l)?)|o(s(h(f|l)?|f|l)?|nj(f|l)?|pysign(f|l)?)|p(ow(f|l)?|roj(f|l)?)|e(il(f|l)?|xp(f|l)?)|l(o(ck|g(f|l)?)|earerr)|a(sin(h(f|l)?|f|l)?|cos(h(f|l)?|f|l)?|tan(h(f|l)?|f|l)?|lloc|rg(f|l)?|bs(f|l)?)|real(f|l)?|brt(f|l)?)|t(ime|o(upper|lower)|an(h(f|l)?|f|l)?|runc(f|l)?|gamma(f|l)?|mp(nam|file))|i(s(space|n(ormal|an)|cntrl|inf|digit|u(nordered|pper)|p(unct|rint)|finite|w(space|c(ntrl|type)|digit|upper|p(unct|rint)|lower|al(num|pha)|graph|xdigit|blank)|l(ower|ess(equal|greater)?)|al(num|pha)|gr(eater(equal)?|aph)|xdigit|blank)|logb(f|l)?|max(div|abs))|di(v|fftime)|_Exit|unget(c|wc)|p(ow(f|l)?|ut(s|c(har)?|wc(har)?)|error|rintf)|e(rf(c(f|l)?|f|l)?|x(it|p(2(f|l)?|f|l|m1(f|l)?)?))|v(s(scanf|nprintf|canf|printf|w(scanf|printf))|printf|f(scanf|printf|w(scanf|printf))|w(scanf|printf)|a_(start|copy|end|arg))|qsort|f(s(canf|e(tpos|ek))|close|tell|open|dim(f|l)?|p(classify|ut(s|c|w(s|c))|rintf)|e(holdexcept|set(e(nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(aiseexcept|ror)|get(e(nv|xceptflag)|round))|flush|w(scanf|ide|printf|rite)|loor(f|l)?|abs(f|l)?|get(s|c|pos|w(s|c))|re(open|e|ad|xp(f|l)?)|m(in(f|l)?|od(f|l)?|a(f|l|x(f|l)?)?))|l(d(iv|exp(f|l)?)|o(ngjmp|cal(time|econv)|g(1(p(f|l)?|0(f|l)?)|2(f|l)?|f|l|b(f|l)?)?)|abs|l(div|abs|r(int(f|l)?|ound(f|l)?))|r(int(f|l)?|ound(f|l)?)|gamma(f|l)?)|w(scanf|c(s(s(tr|pn)|nc(py|at|mp)|c(spn|hr|oll|py|at|mp)|to(imax|d|u(l(l)?|max)|k|f|l(d|l)?|mbs)|pbrk|ftime|len|r(chr|tombs)|xfrm)|to(b|mb)|rtomb)|printf|mem(set|c(hr|py|mp)|move))|a(s(sert|ctime|in(h(f|l)?|f|l)?)|cos(h(f|l)?|f|l)?|t(o(i|f|l(l)?)|exit|an(h(f|l)?|2(f|l)?|f|l)?)|b(s|ort))|g(et(s|c(har)?|env|wc(har)?)|mtime)|r(int(f|l)?|ound(f|l)?|e(name|alloc|wind|m(ove|quo(f|l)?|ainder(f|l)?))|a(nd|ise))|b(search|towc)|m(odf(f|l)?|em(set|c(hr|py|mp)|move)|ktime|alloc|b(s(init|towcs|rtowcs)|towc|len|r(towc|len))))\b + + + captures + + 1 + + name + punctuation.whitespace.function-call.leading.c + + 2 + + name + support.function.any-method.c + + 3 + + name + punctuation.definition.parameters.c + + + match + (?x) (?: (?= \s ) (?:(?<=else|new|return) | (?<!\w)) (\s+))? + (\b + (?!(while|for|do|if|else|switch|catch|enumerate|return|r?iterate)\s*\()(?:(?!NS)[A-Za-z_][A-Za-z0-9_]*+\b | :: )++ # actual name + ) + \s*(\() + name + meta.function-call.c + + + captures + + 1 + + name + variable.other.c + + 2 + + name + punctuation.definition.parameters.c + + + match + (?x) + (?x) + (?: + (?: (?= \s ) (?<!else|new|return) (?<=\w)\s+ # or word + space before name + ) + ) + ( + (?: [A-Za-z_][A-Za-z0-9_]*+ | :: )++ | # actual name + (?: (?<=operator) (?: [-*&<>=+!]+ | \(\) | \[\] ) )? # if it is a C++ operator + ) + \s*(\() + name + meta.initialization.c + + + include + #block + + + include + $base + + + + comments + + patterns + + + captures + + 1 + + name + meta.toc-list.banner.block.c + + + match + ^/\* =(\s*.*?)\s*= \*/$\n? + name + comment.block.c + + + begin + /\* + captures + + 0 + + name + punctuation.definition.comment.c + + + end + \*/ + name + comment.block.c + + + match + \*/.*\n + name + invalid.illegal.stray-comment-end.c + + + captures + + 1 + + name + meta.toc-list.banner.line.c + + + match + ^// =(\s*.*?)\s*=\s*$\n? + name + comment.line.banner.c++ + + + begin + // + beginCaptures + + 0 + + name + punctuation.definition.comment.c + + + end + $\n? + name + comment.line.double-slash.c++ + patterns + + + match + (?>\\\s*\n) + name + punctuation.separator.continuation.c++ + + + + + + disabled + + begin + ^\s*#\s*if(n?def)?\b.*$ + comment + eat nested preprocessor if(def)s + end + ^\s*#\s*endif\b.*$ + patterns + + + include + #disabled + + + include + #pragma-mark + + + + parens + + begin + \( + end + \) + name + meta.parens.c + patterns + + + include + $base + + + + pragma-mark + + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.pragma.c + + 3 + + name + meta.toc-list.pragma-mark.c + + + match + ^\s*(#\s*(pragma\s+mark)\s+(.*)) + name + meta.section + + preprocessor-rule-disabled + + begin + ^\s*(#(if)\s+(0)\b).* + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.if.c + + 3 + + name + constant.numeric.preprocessor.c + + + end + ^\s*(#\s*(endif)\b) + patterns + + + begin + ^\s*(#\s*(else)\b) + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.else.c + + + end + (?=^\s*#\s*endif\b.*$) + patterns + + + include + $base + + + + + begin + + end + (?=^\s*#\s*(else|endif)\b.*$) + name + comment.block.preprocessor.if-branch + patterns + + + include + #disabled + + + include + #pragma-mark + + + + + + preprocessor-rule-disabled-block + + begin + ^\s*(#(if)\s+(0)\b).* + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.if.c + + 3 + + name + constant.numeric.preprocessor.c + + + end + ^\s*(#\s*(endif)\b) + patterns + + + begin + ^\s*(#\s*(else)\b) + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.else.c + + + end + (?=^\s*#\s*endif\b.*$) + patterns + + + include + #block_innards + + + + + begin + + end + (?=^\s*#\s*(else|endif)\b.*$) + name + comment.block.preprocessor.if-branch.in-block + patterns + + + include + #disabled + + + include + #pragma-mark + + + + + + preprocessor-rule-enabled + + begin + ^\s*(#(if)\s+(0*1)\b) + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.if.c + + 3 + + name + constant.numeric.preprocessor.c + + + end + ^\s*(#\s*(endif)\b) + patterns + + + begin + ^\s*(#\s*(else)\b).* + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.else.c + + + contentName + comment.block.preprocessor.else-branch + end + (?=^\s*#\s*endif\b.*$) + patterns + + + include + #disabled + + + include + #pragma-mark + + + + + begin + + end + (?=^\s*#\s*(else|endif)\b.*$) + patterns + + + include + $base + + + + + + preprocessor-rule-enabled-block + + begin + ^\s*(#(if)\s+(0*1)\b) + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.if.c + + 3 + + name + constant.numeric.preprocessor.c + + + end + ^\s*(#\s*(endif)\b) + patterns + + + begin + ^\s*(#\s*(else)\b).* + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.else.c + + + contentName + comment.block.preprocessor.else-branch.in-block + end + (?=^\s*#\s*endif\b.*$) + patterns + + + include + #disabled + + + include + #pragma-mark + + + + + begin + + end + (?=^\s*#\s*(else|endif)\b.*$) + patterns + + + include + #block_innards + + + + + + preprocessor-rule-other + + begin + ^\s*(#\s*(if(n?def)?)\b.*?(?:(?=(?://|/\*))|$)) + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.c + + + end + ^\s*(#\s*(endif)\b).*$ + patterns + + + include + $base + + + + preprocessor-rule-other-block + + begin + ^\s*(#\s*(if(n?def)?)\b.*?(?:(?=(?://|/\*))|$)) + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.c + + + end + ^\s*(#\s*(endif)\b).*$ + patterns + + + include + #block_innards + + + + sizeof + + match + \b(sizeof)\b + name + keyword.operator.sizeof.c + + string_escaped_char + + patterns + + + match + \\(\\|[abefnprtv'"?]|[0-3]\d{,2}|[4-7]\d?|x[a-fA-F0-9]{,2}|u[a-fA-F0-9]{,4}|U[a-fA-F0-9]{,8}) + name + constant.character.escape.c + + + match + \\. + name + invalid.illegal.unknown-escape.c + + + + string_placeholder + + patterns + + + match + (?x)% + (\d+\$)? # field (argument #) + [#0\- +']* # flags + [,;:_]? # separator character (AltiVec) + ((-?\d+)|\*(-?\d+\$)?)? # minimum field width + (\.((-?\d+)|\*(-?\d+\$)?)?)? # precision + (hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)? # length modifier + [diouxXDOUeEfFgGaACcSspn%] # conversion type + + name + constant.other.placeholder.c + + + match + % + name + invalid.illegal.placeholder.c + + + + + scopeName + source.c + uuid + 25066DC2-6B1D-11D9-9D5B-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/CSS.tmLanguage b/app/rcc/edbee/syntaxfiles/CSS.tmLanguage new file mode 100644 index 00000000..926773cd --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/CSS.tmLanguage @@ -0,0 +1,1010 @@ + + + + + comment + + fileTypes + + css + css.erb + + foldingStartMarker + /\*\*(?!\*)|\{\s*($|/\*(?!.*?\*/.*\S)) + foldingStopMarker + (?<!\*)\*\*/|^\s*\} + keyEquivalent + ^~C + name + CSS + patterns + + + include + #comment-block + + + include + #selector + + + begin + \s*((@)charset\b)\s* + captures + + 1 + + name + keyword.control.at-rule.charset.css + + 2 + + name + punctuation.definition.keyword.css + + + end + \s*((?=;|$)) + name + meta.at-rule.charset.css + patterns + + + include + #string-double + + + include + #string-single + + + + + begin + \s*((@)import\b)\s* + captures + + 1 + + name + keyword.control.at-rule.import.css + + 2 + + name + punctuation.definition.keyword.css + + + end + \s*((?=;|\})) + name + meta.at-rule.import.css + patterns + + + include + #string-double + + + include + #string-single + + + begin + \s*(url)\s*(\()\s* + beginCaptures + + 1 + + name + support.function.url.css + + 2 + + name + punctuation.section.function.css + + + end + \s*(\))\s* + endCaptures + + 1 + + name + punctuation.section.function.css + + + patterns + + + match + [^'") \t]+ + name + variable.parameter.url.css + + + include + #string-single + + + include + #string-double + + + + + include + #media-query-list + + + + + begin + ^\s*((@)font-face)\s*(?=\{) + beginCaptures + + 1 + + name + keyword.control.at-rule.font-face.css + + 2 + + name + punctuation.definition.keyword.css + + + end + \s*(\}) + endCaptures + + 1 + + name + punctuation.section.property-list.css + + + name + meta.at-rule.font-face.css + patterns + + + include + #rule-list + + + + + begin + (?=^\s*@media\s*.*?\{) + end + \s*(\}) + endCaptures + + 1 + + name + punctuation.section.property-list.css + + + patterns + + + begin + ^\s*((@)media)(?=.*?\{) + beginCaptures + + 1 + + name + keyword.control.at-rule.media.css + + 2 + + name + punctuation.definition.keyword.css + + 3 + + name + support.constant.media.css + + + end + \s*(?=\{) + name + meta.at-rule.media.css + patterns + + + include + #media-query-list + + + + + begin + \s*(\{) + beginCaptures + + 1 + + name + punctuation.section.property-list.css + + + end + (?=\}) + patterns + + + include + $self + + + + + + + begin + (?=\{) + end + \} + endCaptures + + 1 + + name + punctuation.section.property-list.css + + + patterns + + + include + #rule-list + + + + + repository + + color-values + + patterns + + + comment + http://www.w3.org/TR/CSS21/syndata.html#value-def-color + match + \b(aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow)\b + name + support.constant.color.w3c-standard-color-name.css + + + comment + These colours are mostly recognised but will not validate. ref: http://www.w3schools.com/css/css_colornames.asp + match + \b(aliceblue|antiquewhite|aquamarine|azure|beige|bisque|blanchedalmond|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|gainsboro|ghostwhite|gold|goldenrod|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|limegreen|linen|magenta|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|oldlace|olivedrab|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|thistle|tomato|turquoise|violet|wheat|whitesmoke|yellowgreen)\b + name + invalid.deprecated.color.w3c-non-standard-color-name.css + + + begin + (hsla?|rgba?)\s*(\() + beginCaptures + + 1 + + name + support.function.misc.css + + 2 + + name + punctuation.section.function.css + + + end + (\)) + endCaptures + + 1 + + name + punctuation.section.function.css + + + patterns + + + match + (?x)\b + (0*((1?[0-9]{1,2})|(2([0-4][0-9]|5[0-5])))\s*,\s*){2} + (0*((1?[0-9]{1,2})|(2([0-4][0-9]|5[0-5])))\b) + (\s*,\s*((0?\.[0-9]+)|[0-1]))? + + name + constant.other.color.rgb-value.css + + + match + \b([0-9]{1,2}|100)\s*%,\s*([0-9]{1,2}|100)\s*%,\s*([0-9]{1,2}|100)\s*% + name + constant.other.color.rgb-percentage.css + + + include + #numeric-values + + + + + + comment-block + + begin + /\* + captures + + 0 + + name + punctuation.definition.comment.css + + + end + \*/ + name + comment.block.css + + media-query + + begin + (?i)\s*(only|not)?\s*(all|aural|braille|embossed|handheld|print|projection|screen|tty|tv)? + beginCaptures + + 1 + + name + keyword.operator.logic.media.css + + 2 + + name + support.constant.media.css + + + end + \s*(?:(,)|(?=[{;])) + endCaptures + + 1 + + name + punctuation.definition.arbitrary-repitition.css + + + patterns + + + begin + \s*(and)?\s*(\()\s* + beginCaptures + + 1 + + name + keyword.operator.logic.media.css + + + end + \) + patterns + + + begin + (?x) + ( + ((min|max)-)? + ( + ((device-)?(height|width|aspect-ratio))| + (color(-index)?)|monochrome|resolution + ) + )|grid|scan|orientation + \s*(?=[:)]) + beginCaptures + + 0 + + name + support.type.property-name.media.css + + + end + (:)|(?=\)) + endCaptures + + 1 + + name + punctuation.separator.key-value.css + + + + + match + \b(portrait|landscape|progressive|interlace) + name + support.constant.property-value.css + + + captures + + 1 + + name + constant.numeric.css + + 2 + + name + keyword.operator.arithmetic.css + + 3 + + name + constant.numeric.css + + + match + \s*(\d+)(/)(\d+) + + + include + #numeric-values + + + + + + media-query-list + + begin + \s*(?=[^{;]) + end + \s*(?=[{;]) + patterns + + + include + #media-query + + + + numeric-values + + patterns + + + captures + + 1 + + name + punctuation.definition.constant.css + + + match + (#)([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b + name + constant.other.color.rgb-value.css + + + captures + + 1 + + name + keyword.other.unit.css + + + match + (?x) + (?:-|\+)?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+)) + ((?:px|pt|ch|cm|mm|in|r?em|ex|pc|deg|g?rad|dpi|dpcm|s)\b|%)? + + name + constant.numeric.css + + + + property-values + + patterns + + + match + \b(absolute|all(-scroll)?|always|armenian|auto|avoid|baseline|below|bidi-override|block|bold|bolder|both|bottom|break-all|break-word|capitalize|center|char|circle|cjk-ideographic|col-resize|collapse|crosshair|dashed|decimal-leading-zero|decimal|default|disabled|disc|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ellipsis|fixed|geometricPrecision|georgian|groove|hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|inactive|inherit|inline-block|inline|inset|inside|inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|keep-all|left|lighter|line-edge|line-through|line|list-item|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|nw-resize|none|normal|not-allowed|nowrap|oblique|optimize(Legibility|Quality|Speed)|outset|outside|overline|pointer|pre(-(wrap|line))?|progress|relative|repeat-x|repeat-y|repeat|right|ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|solid|square|static|strict|sub|super|sw-resize|table-footer-group|table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|vertical(-(ideographic|text))?|visible(Painted|Fill|Stroke)?|w-resize|wait|whitespace|zero|smaller|larger|((xx?-)?(small|large))|painted|fill|stroke)\b + name + support.constant.property-value.css + + + match + (\b(?i:arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace)\b) + name + support.constant.font-name.css + + + include + #numeric-values + + + include + #color-values + + + include + #string-double + + + include + #string-single + + + begin + (rect)\s*(\() + beginCaptures + + 1 + + name + support.function.misc.css + + 2 + + name + punctuation.section.function.css + + + end + (\)) + endCaptures + + 1 + + name + punctuation.section.function.css + + + patterns + + + include + #numeric-values + + + + + begin + (format|local|url|attr|counter|counters)\s*(\() + beginCaptures + + 1 + + name + support.function.misc.css + + 2 + + name + punctuation.section.function.css + + + end + (\)) + endCaptures + + 1 + + name + punctuation.section.function.css + + + patterns + + + include + #string-single + + + include + #string-double + + + match + [^'") \t]+ + name + variable.parameter.misc.css + + + + + match + \!\s*important + name + keyword.other.important.css + + + + rule-list + + begin + \{ + beginCaptures + + 0 + + name + punctuation.section.property-list.css + + + end + (?=\s*\}) + name + meta.property-list.css + patterns + + + include + #comment-block + + + begin + (?<![-a-z])(?=[-a-z]) + end + $|(?![-a-z]) + name + meta.property-name.css + patterns + + + match + \b(azimuth|background-attachment|background-color|background-image|background-position|background-repeat|background|box-shadow|border-radius|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top|border-width|border|bottom|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size-adjust|font-size|font-stretch|font-style|font-variant|font-weight|font|height|image-rendering|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|marker-offset|margin|marks|max-height|max-width|min-height|min-width|-moz-border-radius|opacity|orphans|outline-color|outline-style|outline-width|outline|overflow(-[xy])?|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|src|stress|table-layout|text-(align|decoration|indent|rendering|shadow|transform)|top|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-(spacing|wrap)|zoom|z-index)\b + name + support.type.property-name.css + + + + + begin + (:)\s* + beginCaptures + + 1 + + name + punctuation.separator.key-value.css + + + end + \s*(;|(?=\})) + endCaptures + + 1 + + name + punctuation.terminator.rule.css + + + name + meta.property-value.css + patterns + + + include + #property-values + + + + + + selector + + begin + \s*(?=[:.*#a-zA-Z]) + end + (?=[/@{)]) + name + meta.selector.css + patterns + + + match + \b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|eventsource|fieldset|figure|figcaption|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|label|legend|li|link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|samp|script|section|select|small|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\b + name + entity.name.tag.css + + + captures + + 1 + + name + punctuation.definition.entity.css + + + match + (\.)[a-zA-Z0-9_-]+ + name + entity.other.attribute-name.class.css + + + captures + + 1 + + name + punctuation.definition.entity.css + + + match + (#)[a-zA-Z][a-zA-Z0-9_-]* + name + entity.other.attribute-name.id.css + + + match + \* + name + entity.name.tag.wildcard.css + + + captures + + 1 + + name + punctuation.definition.entity.css + + + match + (:+)(after|before|first-letter|first-line|selection)\b + name + entity.other.attribute-name.pseudo-element.css + + + captures + + 1 + + name + punctuation.definition.entity.css + + + match + (:)((first|last)-child|(first|last|only)-of-type|empty|root|target|first|left|right)\b + name + entity.other.attribute-name.pseudo-class.css + + + captures + + 1 + + name + punctuation.definition.entity.css + + + match + (:)(checked|enabled|default|disabled|indeterminate|invalid|optional|required|valid)\b + name + entity.other.attribute-name.pseudo-class.ui-state.css + + + begin + ((:)not)(\() + beginCaptures + + 1 + + name + entity.other.attribute-name.pseudo-class.css + + 2 + + name + punctuation.definition.entity.css + + 3 + + name + punctuation.section.function.css + + + end + \) + endCaptures + + 0 + + name + punctuation.section.function.css + + + patterns + + + include + #selector + + + + + captures + + 1 + + name + entity.other.attribute-name.pseudo-class.css + + 2 + + name + punctuation.definition.entity.css + + 3 + + name + punctuation.section.function.css + + 4 + + name + constant.numeric.css + + 5 + + name + punctuation.section.function.css + + + match + ((:)nth-(?:(?:last-)?child|(?:last-)?of-type))(\()(\-?(?:\d+n?|n)(?:\+\d+)?|even|odd)(\)) + + + captures + + 1 + + name + punctuation.definition.entity.css + + + match + (:)(active|hover|link|visited|focus)\b + name + entity.other.attribute-name.pseudo-class.css + + + captures + + 1 + + name + punctuation.definition.entity.css + + 2 + + name + entity.other.attribute-name.attribute.css + + 3 + + name + punctuation.separator.operator.css + + 4 + + name + string.unquoted.attribute-value.css + + 5 + + name + string.quoted.double.attribute-value.css + + 6 + + name + punctuation.definition.string.begin.css + + 7 + + name + punctuation.definition.string.end.css + + + match + (?i)(\[)\s*(-?[_a-z\\[[:^ascii:]]][_a-z0-9\-\\[[:^ascii:]]]*)(?:\s*([~|^$*]?=)\s*(?:(-?[_a-z\\[[:^ascii:]]][_a-z0-9\-\\[[:^ascii:]]]*)|((?>(['"])(?:[^\\]|\\.)*?(\6)))))?\s*(\]) + name + meta.attribute-selector.css + + + + string-double + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.css + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.css + + + name + string.quoted.double.css + patterns + + + match + \\. + name + constant.character.escape.css + + + + string-single + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.css + + + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.css + + + name + string.quoted.single.css + patterns + + + match + \\. + name + constant.character.escape.css + + + + + scopeName + source.css + uuid + 69AA0917-B7BB-11D9-A7E2-000D93C8BE28 + + diff --git a/app/rcc/edbee/syntaxfiles/Clojure.tmLanguage b/app/rcc/edbee/syntaxfiles/Clojure.tmLanguage new file mode 100644 index 00000000..8cb89e76 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Clojure.tmLanguage @@ -0,0 +1,3415 @@ + + + + + comment + Symbol pattern : [a-zA-Z+!\-_?0-9*~#@'`/.$=] + fileTypes + + clj + + foldingStartMarker + (?x)^ [ \t]* \( + (?<par> + ( [^()\n]++ | \( \g<par> \)? )*+ + ) + $ + foldingStopMarker + ^\s*$ + keyEquivalent + ^~C + name + Clojure + patterns + + + include + #comment + + + include + #function + + + include + #function_multi_method + + + include + #macro + + + include + #namespace + + + include + #sexpr + + + repository + + all + + patterns + + + include + #function + + + include + #function_multi_method + + + include + #lambda + + + include + #macro + + + include + #comment + + + include + #expr + + + include + #sexpr + + + + binding + + comment + consume bindings to the end, dual recursive with binding_exp + patterns + + + include + #comment + + + include + #metadata + + + begin + \[ + beginCaptures + + 0 + + name + punctuation.definition.vector.begin.clojure + + + end + (?=\]) + name + meta.structure.binding.vector.clojure + patterns + + + begin + (?<=\[) + comment + TODO: merge with parameters ?? + end + \] + endCaptures + + 0 + + name + punctuation.definition.vector.end.clojure + + + name + meta.parameters.vector.clojure + patterns + + + include + #comment + + + include + #metadata + + + include + #parameters_variable + + + match + \& + name + keyword.operator.varargs.clojure + + + match + (:as)(?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + keyword.operator.symbolargs.clojure + + + include + #parameters + + + include + #parameters_map + + + include + #all + + + + + include + #binding_exp + + + + + begin + \{ + beginCaptures + + 0 + + name + punctuation.definition.map.begin.clojure + + + end + (?=\]) + name + meta.structure.binding.map.clojure + patterns + + + begin + (?<=\{) + comment + TODO: merge with map ?? + end + \} + endCaptures + + 0 + + name + punctuation.definition.map.end.clojure + + + name + meta.function.parameters.map.clojure + patterns + + + include + #comment + + + include + #metadata + + + include + #parameters_variable + + + match + (:as|:or|:keys|:strs|:syms)(?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + keyword.operator.symbolargs.clojure + + + include + #parameters + + + include + #parameters_map + + + include + #all + + + + + include + #binding_exp + + + + + begin + (:let|:when|:while)(?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + beginCaptures + + 1 + + name + keyword.operator.symbolargs.clojure + + + end + (?=\]) + name + meta.structure.binding.symbolargs.clojure + patterns + + + include + #binding_exp + + + + + begin + (?=[a-zA-Z+!\-_?0-9*~#@'`/.$=]) + comment + symbol matching + end + (?=\]) + name + meta.structure.binding.symbole.clojure + patterns + + + begin + (?=[a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?<=[a-zA-Z+!\-_?0-9*~#@'`/.$=])(?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + variable.parameter.clojure + patterns + + + include + #keyword + + + include + #operator + + + include + #number + + + include + #symbol + + + + + begin + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?=\]) + patterns + + + include + #binding_exp + + + + + + + begin + [^\s] + end + [^\]] + name + invalid.illegal.bindings.clojure + + + + binding_exp + + comment + consume bindings to the end, dual recursive with binding + patterns + + + include + #comment + + + include + #metadata + + + include + #operator_special + + + begin + (\(\)|{}|\[\]|#{}) + beginCaptures + + 1 + + name + constant.language.clojure + + + end + (?=\]) + name + meta.structure.binding_exp.constant.language.clojure + patterns + + + include + #binding + + + + + begin + (?=#?\() + end + (?=\]) + name + meta.structure.binding_exp.sexp.clojure + patterns + + + begin + (?=#?\() + end + (?<=\)) + patterns + + + include + #function + + + include + #function_multi_method + + + include + #lambda + + + include + #macro + + + include + #sexpr + + + + + include + #binding + + + + + begin + (\[) + end + (?=\]) + name + meta.structure.binding_exp.vector.clojure + patterns + + + begin + (?<=\[) + beginCaptures + + 0 + + name + punctuation.definition.vector.begin.clojure + + + comment + TODO: merge with vector + end + \] + endCaptures + + 0 + + name + punctuation.definition.vector.end.clojure + + + name + meta.expression.vector.clojure + patterns + + + include + #all + + + + + include + #binding + + + + + begin + (\{) + end + (?=\]) + name + meta.structure.binding_exp.map.clojure + patterns + + + begin + (?<=\{) + beginCaptures + + 0 + + name + punctuation.definition.map.begin.clojure + + + comment + TODO: merge with map + end + } + endCaptures + + 0 + + name + punctuation.definition.map.end.clojure + + + name + meta.expression.map.clojure + patterns + + + include + #all + + + + + include + #binding + + + + + begin + (?=#\{) + end + (?=\]) + name + meta.structure.binding_exp.set.clojure + patterns + + + include + #set + + + include + #binding + + + + + begin + (?=")|(?=\\)|(?=\:)|(?=\#") + end + (?=\]) + name + meta.structure.binding_exp.string.clojure + patterns + + + include + #string + + + include + #binding + + + + + begin + (?=[a-zA-Z+!\-_?0-9*~#@'`/.$=]) + comment + symbol matching + end + (?=\]) + name + meta.structure.binding_exp.symbole.clojure + patterns + + + begin + (?=[a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?<=[a-zA-Z+!\-_?0-9*~#@'`/.$=])(?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + patterns + + + include + #keyword + + + include + #operator + + + include + #number + + + include + #symbol + + + + + begin + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?=\]) + patterns + + + include + #binding + + + + + + + begin + [^\s] + end + [^\]] + name + invalid.illegal.bindings.clojure + + + + bindings_form + + begin + \[ + comment + bindings followed by all + end + (?=\)) + name + meta.structure.bindings.clojure + patterns + + + begin + (?<=\[) + end + \] + patterns + + + include + #binding + + + + + begin + (?<=\]) + end + (?=\)) + patterns + + + include + #all + + + + + + comment + + patterns + + + captures + + 1 + + name + punctuation.definition.comment.clojure + + + match + (;;).*(;;)$\n? + name + comment.line.semicolon.double.banner.clojure + + + captures + + 1 + + name + punctuation.definition.comment.clojure + + + match + (;;).*$\n? + name + comment.line.semicolon.double.clojure + + + captures + + 1 + + name + punctuation.definition.comment.clojure + + + match + ^(;).*$\n? + name + comment.line.semicolon.start.clojure + + + captures + + 1 + + name + punctuation.definition.comment.clojure + + + match + (;).*$\n? + name + comment.line.semicolon.clojure + + + + expr + + name + meta.expr.clojure + patterns + + + include + #keyword + + + include + #operator + + + include + #string + + + include + #vector + + + include + #map + + + include + #set + + + include + #metadata + + + include + #number + + + include + #symbol + + + + function + + begin + \(\s*(defn\-?)\s + beginCaptures + + 1 + + name + storage.type.function.type.clojure + + + end + \) + endCaptures + + 1 + + name + punctuation.terminator.function.clojure + + + name + meta.function.clojure + patterns + + + include + #comment + + + include + #metadata + + + match + \s* + + + include + #function_name + + + include + #function_body_comment + + + + function_body + + patterns + + + begin + \(\s*(?=\[) + end + \) + name + meta.function.body.code.clojure + patterns + + + include + #parameters_body + + + + + begin + (?=\[) + end + (?=\)) + name + meta.function.body.clojure + patterns + + + include + #parameters_body + + + + + + function_body_comment + + patterns + + + begin + " + beginCaptures + + 0 + + name + string.quoted.double.begin.clojure + + + end + " + endCaptures + + 0 + + name + string.quoted.double.end.clojure + + + name + string.docstring.clojure + patterns + + + include + #string_escape + + + + + begin + \{ + beginCaptures + + 0 + + name + comment.punctuation.definition.metadata.begin.clojure + + + end + \} + endCaptures + + 0 + + name + comment.punctuation.definition.metadata.end.clojure + + + name + meta.metadata.map.clojure + patterns + + + include + #metadata_patterns + + + + + include + #function_body + + + + function_multi_method + + begin + \(\s*(defmethod\-?)\s+ + beginCaptures + + 1 + + name + storage.type.function.type.clojure + + + end + \) + name + meta.function.multi_method.clojure + patterns + + + include + #comment + + + begin + (?=[a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?=\)) + patterns + + + begin + (?=[a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?<=[a-zA-Z+!\-_?0-9*~#@'`/.$=])(?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + meta.function.multi_method.name.clojure + patterns + + + include + #function_name + + + + + begin + (?<=[a-zA-Z+!\-_?0-9*~#@'`/.$=])(?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?=\)) + patterns + + + include + #comment + + + include + #metadata + + + include + #operator_special + + + begin + (\(\)|{}|\[\]|#{}) + beginCaptures + + 1 + + name + constant.language.clojure + + + end + (?=\)) + name + meta.structure.multi_method_exp.constant.language.clojure + patterns + + + include + #parameters_body + + + + + begin + (?=#?\() + end + (?=\)) + name + meta.structure.multi_method_exp.sexp.clojure + patterns + + + begin + (?=#?\() + end + (?<=\)) + patterns + + + include + #function + + + include + #function_multi_method + + + include + #lambda + + + include + #macro + + + include + #sexpr + + + + + include + #parameters_body + + + + + begin + (\[) + end + (?=\)) + name + meta.structure.multi_method_exp.vector.clojure + patterns + + + begin + (?<=\[) + beginCaptures + + 0 + + name + punctuation.definition.vector.begin.clojure + + + comment + TODO: merge with vector + end + (\]) + endCaptures + + 1 + + name + punctuation.definition.vector.end.clojure + + + name + meta.expression.vector.clojure + patterns + + + include + #all + + + + + begin + (?<=\])\s* + end + (?=\)) + patterns + + + include + #parameters_body + + + + + + + begin + (\{) + end + (?=\)) + name + meta.structure.multi_method_exp.map.clojure + patterns + + + begin + (?<=\{) + beginCaptures + + 0 + + name + punctuation.definition.map.begin.clojure + + + comment + TODO: merge with map + end + } + endCaptures + + 0 + + name + punctuation.definition.map.end.clojure + + + name + meta.expression.map.clojure + patterns + + + include + #all + + + + + include + #parameters_body + + + + + begin + (?=#\{) + end + (?=\)) + name + meta.structure.multi_method_exp.set.clojure + patterns + + + include + #set + + + include + #parameters_body + + + + + begin + (?=")|(?=\\)|(?=\:)|(?=\#") + end + (?=\)) + name + meta.structure.multi_method_exp.string.clojure + patterns + + + include + #string + + + include + #parameters_body + + + + + begin + (?=[a-zA-Z+!\-_?0-9*~#@'`/.$=]) + comment + symbol matching + end + (?=\)) + name + meta.structure.multi_method_exp.symbole.clojure + patterns + + + begin + (?=[a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?<=[a-zA-Z+!\-_?0-9*~#@'`/.$=])(?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + patterns + + + include + #symbol_java_inherited_class + + + include + #keyword + + + include + #operator + + + include + #number + + + include + #symbol + + + + + begin + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?=\)) + patterns + + + include + #parameters_body + + + + + + + + + + + comment + Need to match a single expression like binding-exp + + + + function_name + + begin + (?=[a-zA-Z+!\-_?0-9*~#@'`/.$=]) + comment + symbol matching + end + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + entity.name.function.clojure + patterns + + + include + #keyword + + + include + #operator + + + begin + -(?=[a-zA-Z+!\-_?*~#@'`/.$=]) + beginCaptures + + 0 + + name + keyword.operator.prefix.genclass.clojure + + + end + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + patterns + + + include + #symbol + + + + + include + #symbol + + + + genclass_parameters + + patterns + + + include + #gencommon_parameters + + + begin + (:extends)\s+ + beginCaptures + + 1 + + name + support.other.keyword.genclass.clojure + + + end + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + meta.other.genclass.extends.clojure + patterns + + + include + #symbol_java_inherited_class + + + + + begin + (:implements)\s+(\[) + beginCaptures + + 1 + + name + support.other.keyword.genclass.clojure + + + end + \] + name + meta.other.genclass.implements.clojure + patterns + + + include + #symbol_java_inherited_class + + + include + #all + + + + + begin + (:constructors)\s+(\{) + beginCaptures + + 1 + + name + support.other.keyword.genclass.clojure + + + end + \} + name + meta.other.genclass.constructors.clojure + patterns + + + begin + \[ + end + \] + name + meta.other.genclass.constructor.signature.clojure + patterns + + + begin + (?=[a-zA-Z+!\-_?0-9*~#@'`/.$=]) + comment + TODO: make a rule java Class (storage) + end + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + storage.type.java.clojure + patterns + + + include + #symbol + + + + + include + #all + + + + + include + #all + + + + + begin + (:exposes)\s+(\{) + beginCaptures + + 1 + + name + support.other.keyword.genclass.clojure + + + end + \} + name + meta.other.genclass.exposes.clojure + patterns + + + begin + \{ + end + \} + name + meta.other.genclass.exposes.get_set.clojure + patterns + + + match + :(get|set) + name + support.other.keyword.genclass.clojure + + + include + #all + + + + + include + #all + + + + + captures + + 0 + + name + support.other.keyword.genclass.clojure + + + match + :(init|main|factory|state|prefix|load-impl-ns|implements|constructors|exposes|impl-ns|exposes-methods|methods)(?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + + + include + #all + + + + gencommon_parameters + + patterns + + + include + #comment + + + begin + (:name)\s+(?=[a-zA-Z+!\-_?0-9*~#@'`/.$=]) + beginCaptures + + 1 + + name + support.other.keyword.genclass.clojure + + + end + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + meta.other.genclass.name.clojure + patterns + + + begin + (?=[a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + entity.name.namespace.clojure + patterns + + + include + #symbol + + + + + + + begin + (:methods)\s+(\[) + beginCaptures + + 1 + + name + support.other.keyword.genclass.clojure + + + end + \] + name + meta.other.genclass.methods.clojure + patterns + + + begin + \[ + end + \] + name + meta.other.genclass.method.signature.clojure + patterns + + + begin + \[ + end + \] + name + meta.other.genclass.method.args.signature.clojure + patterns + + + begin + (?=[a-zA-Z+!\-_?0-9*~#@'`/.$=]) + comment + TODO: make a rule java Class (storage) + end + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + storage.type.java.clojure + patterns + + + include + #symbol + + + + + include + #all + + + + + begin + (?=[a-zA-Z+!\-_?0-9*~#@'`/.$=]+\s*]) + end + .|$ + name + storage.type.java.genclass.return_type.clojure + patterns + + + include + #symbol + + + + + include + #all + + + + + include + #all + + + + + + geninterface_parameters + + patterns + + + include + #gencommon_parameters + + + begin + (:extends)\s+(\[) + beginCaptures + + 1 + + name + support.other.keyword.genclass.clojure + + + end + \] + name + meta.other.genclass.implements.clojure + patterns + + + include + #symbol_java_inherited_class + + + include + #all + + + + + + keyword + + patterns + + + match + (?<![*+!_?\-])\b((if-not|if|cond|do|let|loop|recur|throw|try|catch|finally|new|trampoline)\b|(set!|swap!|compare-and-set!))(?![*+!_?\-]) + name + keyword.control.clojure + + + match + (?<![*+!_?\-])\b(monitor-enter|monitor-exit|assoc|touch|drop|take|concat|prn|into|cons|first|flatten|rest|frest|rrest|second|lazy-cat|lazy-cons|conj|await|range|iterate)\b(?![*+!_?\-]) + name + keyword.other.clojure + + + match + (?<![*+!_?\-])\b(str|print(ln)?|eval|def|defmacro|defn|quote|var|fn|defmulti|defmethod|map|list|hash-map|vector|agent|declare|intern|macroexpand|macroexpand-1)\b(?![*+!_?\-]) + name + storage.clojure + + + match + (?<![*+!_?\-])\b(->|\.\.|amap|and|areduce|assert|binding|comment|cond|definline|(def[a-z\-]*)|defmatch|defmethod|defmulti|defn|defn-|defonce|defstruct|delay|doc|doseq|dosync|dotimes|doto|fn|for|if-let|lazy-cons|let|locking|loop|memfn|ns|or|prefer-method|proxy-super|proxy|refer-clojure|remove-method|sync|time|when-first|when-let|when-not|when|while|with-in-str|with-local-vars|with-open|with-out-str|with-precision|memoize)\b(?![*+!_?\-]) + name + support.function.match.clojure + + + captures + + 2 + + name + keyword.other.mark.clojure + + + match + (?<![*+!_?\-])\b(rational|associative|branch|class|coll|contains|decimal|delay|distinct|empty|end|even|every|false|float|fn|identical|instance|integer|isa|keyword|list|map|neg|nil|not-any|not-every|number|odd|pos|ratio|reversible|seq|sequential|set|sorted|special-symbol|string|symbol|true|var|zero|vector|ifn)(\?)(?![*+!_?\-]) + name + support.function.tester.clojure + + + captures + + 2 + + name + keyword.other.mark.clojure + + 3 + + name + keyword.other.mark.clojure + + 4 + + name + keyword.other.mark.clojure + + + match + (?<![*+!_?\-])\b(not(=)|list(\*)|io(!))(?![*+!_?\-]) + name + support.function.clojure + + + match + (?<![*+!_?\-])\b(zipper|zipmap|xml-zip|xml-seq|with-meta|vector-zip|vector|vec|var-set|var-get|vals|val|use|update-proxy|update-in|up|union|underive|unchecked-subtract|unchecked-negate|unchecked-multiply|unchecked-inc|unchecked-divide|unchecked-dec|unchecked-add|tree-seq|to-array-2d|to-array|test|take-while|take-nth|symbol|supers|subvec|subseq|subs|struct-map|struct|str|split-with|split-at|sorted-set|sorted-map-by|sorted-map|sort-by|sort|some|slurp|shutdown-agents|short|set-validator|set|seque|seq-zip|seq|send-off|send|select-keys|select|rsubseq|rseq|root|rights|right|rfirst|reverse|resultset-seq|resolve|require|replicate|replace|repeatedly|repeat|rename-keys|rename|remove-ns|remove|rem|refer|ref-set|ref|reduce|read-string|read-line|read|re-seq|re-pattern|re-matches|re-matcher|re-groups|re-find|rationalize|rand-int|rand|quot|pvec|psummary|psort|proxy-mappings|project|prn-str|println-str|println|printf|print-str|print|preduce|pr-str|pr|pop|pmin|pmax|pmap|pfilter-nils|pfilter-dupes|peek|pdistinct|path|partition|partial|parse|parents|par|pany|num|nthrest|nth|ns-unmap|ns-unalias|ns-resolve|ns-refers|ns-publics|ns-name|ns-map|ns-interns|ns-imports|ns-aliases|not=|not-empty|not|node|next|newline|namespace|name|min-key|min|meta|merge-with|merge|max-key|max|matchexpand-1|matchexpand|mapcat|map-invert|map|make-node|make-hierarchy|make-array|long-array|long|loaded-libs|load-string|load-reader|load-file|load|list*|list|line-seq|lefts|left|last|keyword|keys|key|join|iterator-seq|into-array|intersection|interpose|interleave|int-array|int|inspect-tree|inspect-table|insert-right|insert-left|insert-child|index|inc|in-ns|import|identity|hash-set|hash-map|hash|get-validator|get-proxy-class|get-in|get|gensym|gen-class|gen-interface|gen-and-save-class|gen-and-load-class|format|force|fnseq|flush|float-array|float|find-var|find-ns|find-doc|find|filter|file-seq|ffirst|eval|enumeration-seq|ensure|empty|edit|drop-while|drop-last|down|double-array|double|dorun|doall|distinct|dissoc|disj|difference|descendants|derive|deref|dec|cycle|create-struct|create-ns|count|construct-proxy|constantly|conj|complement|compare|comparator|comp|commute|clojure.set|clojure.parallel|clojure.inspector|clear-agent-errors|class|children|char|cast|cache-seq|byte|butlast|boolean|bit-xor|bit-test|bit-shift-right|bit-shift-left|bit-set|bit-or|bit-not|bit-flip|bit-clear|bit-and-not|bit-and|bigint|bigdec|bean|bases|await-for|assoc-in|aset-short|aset-long|aset-int|aset-float|aset-double|aset-char|aset-byte|aset-boolean|aset|array-map|apply|append-child|ancestors|alter-var-root|alter|all-ns|alias|alength|aget|agent-errors|agent|add-classpath|aclone|accessor|compile|longs|doubles|ints|floats|atom)\b(?![*+!_?\-]) + name + support.function.clojure + + + match + (?<![*+!_?\-])\b(true|false|nil)\b(?![*+!_?\-]) + name + constant.language.clojure + + + match + (\(\)|{}|\[\]|#{}) + name + constant.language.clojure + + + comment + TODO : clean this ? + match + (?<![*+!_?\-])\b:(private|doc|test|tag)\b(?![*+!_?\-]) + name + storage.modifier.clojure + + + comment + TODO : clean this ? + match + (?<![*+!_?\-])\b:(file|line|name|ns|match|argslist)\b(?![*+!_?\-]) + name + support.variable.clojure + + + match + (?<![*+!_?\-])\*(agent|allow-unresolved-vars|command-line-args|compile-files|compile-path|err|file|flush-on-newline|in|macro-meta|math-context|ns|out|print-dup|print-length|print-level|print-meta|print-readably|proxy-classes|use-context-classloader|warn-on-reflection)\*(?![*+!_?\-]) + name + support.variable.global.clojure + + + + lambda + + patterns + + + begin + \(\s*(fn)\s+ + beginCaptures + + 1 + + name + storage.type.function.type.clojure + + + end + \) + name + meta.function.lambda.clojure + patterns + + + include + #comment + + + include + #function_name + + + include + #function_body + + + + + begin + (#)\( + beginCaptures + + 1 + + name + storage.type.function.type.clojure + + + end + \) + name + meta.function.lambda.clojure + patterns + + + include + #sexpr_special + + + include + #all + + + + + + macro + + begin + \(\s*(\b(defmacro\-?))\s+ + beginCaptures + + 1 + + name + storage.type.function.type.clojure + + + end + \) + name + meta.function.macro.clojure + patterns + + + include + #comment + + + include + #metadata + + + match + \s* + + + include + #function_name + + + include + #function_body_comment + + + + map + + begin + {(?!}) + beginCaptures + + 0 + + name + punctuation.definition.map.begin.clojure + + + end + (?<!{)} + endCaptures + + 0 + + name + punctuation.definition.map.end.clojure + + + name + meta.expression.map.clojure + patterns + + + include + #all + + + + metadata + + patterns + + + begin + #?\^{ + beginCaptures + + 0 + + name + comment.punctuation.definition.metadata.begin.clojure + + + end + } + endCaptures + + 0 + + name + comment.punctuation.definition.metadata.end.clojure + + + name + punctuation.metadata.map.clojure + patterns + + + include + #metadata_patterns + + + + + begin + #?\^" + beginCaptures + + 0 + + name + comment.punctuation.definition.metadata.begin.clojure + + + end + " + endCaptures + + 0 + + name + comment.punctuation.definition.metadata.end.clojure + + + name + string.metadata.clojure + + + captures + + 1 + + name + comment.punctuation.definition.metadata.begin.clojure + + 2 + + name + storage.type.java.clojure + + + match + (#?\^)([a-zA-Z+!\-_?0-9*/.$=]+) + name + punctuation.metadata.class.clojure + + + + metadata_patterns + + patterns + + + match + (:tag|:doc|:arglists|:private|:macro|:name|:ns|:inline-arities|:inline|:line|:file)(?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + support.other.keyword.namespace.clojure + + + match + (?<=:tag)\s+([a-zA-Z+!\-_?0-9*/.$=]+) + name + storage.type.java.clojure + + + begin + (?<=:doc)\s+" + beginCaptures + + 0 + + name + string.quoted.double.begin.clojure + + + end + " + endCaptures + + 0 + + name + string.quoted.double.end.clojure + + + name + string.docstring.clojure + patterns + + + include + #string_escape + + + + + include + #all + + + + namespace + + begin + \(\s*(ns)\b + beginCaptures + + 1 + + name + support.function.namespace.clojure + + + end + \) + name + meta.function.namespace.clojure + patterns + + + begin + (?=[a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + entity.name.namespace.clojure + patterns + + + include + #symbol + + + + + include + #namespace_body + + + + namespace_body + + patterns + + + match + (:refer-clojure|:require|:use|:import|:load|:exclude|:as|:only)(?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + support.other.keyword.namespace.clojure + + + begin + \(\s*(:gen-class) + beginCaptures + + 1 + + name + support.other.keyword.genclass.clojure + + + end + \) + name + meta.function.genclass_form.clojure + patterns + + + include + #genclass_parameters + + + + + include + #symbol + + + include + #string + + + begin + \( + end + \) + patterns + + + include + #namespace_body + + + + + begin + \[ + end + \] + patterns + + + include + #namespace_body + + + + + + number + + patterns + + + captures + + 2 + + name + keyword.operator.arithmetic.ratio.clojure + + + match + (-|\+)?\b[0-9]+(/)[0-9]+\b + name + constant.numeric.float.ratio.clojure + + + match + [-+]?\b[0-9]+((\.[0-9]+([eE][-+]?[0-9]+)?)|((\.[0-9]+)?[eE][-+]?[0-9]+))?\b + name + constant.numeric.float.clojure + + + match + [-+]?\b[0-9]+(((\.[0-9])?+([eE][-+]?[0-9]+)?)|((\.[0-9]+)?[eE][-+]?[0-9]+))[M]?\b + name + constant.numeric.big_decimal.clojure + + + captures + + 2 + + name + keyword.operator.arithmetic.octal.clojure + + 4 + + name + invalid.illegal.integer.octal.clojure + + 5 + + name + invalid.illegal.integer.octal.clojure + + + match + (-|\+)?\b(0)([0-7]+|([89]))([0-9]*)\b + name + constant.numeric.integer.octal.clojure + + + match + (-|\+)?\b[0-9]+\b + name + constant.numeric.integer.clojure + + + captures + + 2 + + name + keyword.operator.arithmetic.hexa.clojure + + + match + (-|\+)?\b(0[xX])[0-9A-Fa-f]+\b + name + constant.numeric.integer.hexa.clojure + + + + operator + + patterns + + + match + (?<![a-zA-Z0-9*+!_?\-])(\*|/|\<|\<=|=|==|\>|\>=|-\>)(?![a-zA-Z0-9*+!_?\-]) + name + keyword.operator.clojure + + + match + (?<![a-zA-Z0-9*+!_?\-])(-|\+)(?![a-zA-Z0-9*+!_?\-]) + name + keyword.operator.clojure + + + match + (?<![a-zA-Z0-9*+!_?\-])(\.|\.\.)(?![a-zA-Z0-9*+!_?\-]) + name + keyword.operator.class.clojure + + + match + %(\d+|&)? + name + variable.parameter.literal.clojure + + + include + #operator_special + + + + operator_special + + patterns + + + match + `|~@|~ + name + keyword.control.operator.clojure + + + match + #'|@ + name + storage.type.function.type.clojure + + + match + ' + name + constant.other.quote + + + match + \^ + name + constant.other.metadata.read.clojure + + + + parameters + + begin + \[ + beginCaptures + + 0 + + name + punctuation.definition.vector.begin.clojure + + + end + \] + endCaptures + + 0 + + name + punctuation.definition.vector.end.clojure + + + name + meta.parameters.vector.clojure + patterns + + + match + \& + name + keyword.operator.varargs.clojure + + + match + (:as)(?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + keyword.operator.symbolargs.clojure + + + include + #comment + + + include + #metadata + + + include + #parameters_variable + + + include + #parameters + + + include + #parameters_map + + + + parameters_body + + name + meta.function.body + patterns + + + include + #parameters_function + + + begin + (?<=\]) + end + (?=\)) + name + meta.function.body.code.clojure + patterns + + + include + #all + + + + + + parameters_function + + begin + \[ + beginCaptures + + 0 + + name + punctuation.definition.vector.begin.clojure + + + end + \] + endCaptures + + 0 + + name + punctuation.definition.vector.end.clojure + + + name + meta.function.parameters.vector.clojure + patterns + + + match + \& + name + keyword.operator.varargs.clojure + + + match + (:as)(?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + keyword.operator.symbolargs.clojure + + + include + #comment + + + include + #metadata + + + include + #parameters_variable + + + include + #parameters + + + include + #parameters_map + + + + parameters_map + + begin + \{ + beginCaptures + + 0 + + name + punctuation.definition.map.begin.clojure + + + end + \} + endCaptures + + 0 + + name + punctuation.definition.map.end.clojure + + + name + meta.function.parameters.map.clojure + patterns + + + include + #parameters_variable + + + match + (:as|:or|:keys|:strs|:syms)(?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + keyword.operator.symbolargs.clojure + + + include + #parameters + + + include + #parameters_map + + + include + #all + + + + parameters_variable + + begin + (?=[a-zA-Z+!\-_?0-9*~@'`/.$=]) + comment + symbol matching TODO:operator number => error ? + end + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + variable.parameter.clojure + patterns + + + include + #keyword + + + include + #operator + + + include + #number + + + include + #symbol + + + + set + + begin + #{ + beginCaptures + + 0 + + name + punctuation.definition.set.begin.clojure + + + end + } + endCaptures + + 0 + + name + punctuation.definition.set.end.clojure + + + name + meta.expression.set.clojure + patterns + + + include + #all + + + + sexpr + + begin + \((?!\)) + end + (?<!\()\) + name + meta.sexpr.clojure + patterns + + + include + #sexpr_special + + + include + #all + + + + sexpr_special + + patterns + + + begin + (?<=\()\s*(let|loop|doseq|dotimes|binding|for|if-let|when-let|with-local-vars|with-open)\s+(?=\[) + beginCaptures + + 1 + + name + keyword.control.clojure + + + end + (?=\)) + name + meta.function.let_form.clojure + patterns + + + include + #bindings_form + + + + + begin + (?<=\()\s*(def|declare|defstruct|defonce|defmulti)\s+ + beginCaptures + + 1 + + name + storage.type.variable.clojure + + + end + (?=\)) + name + meta.function.def_form.clojure + patterns + + + include + #metadata + + + match + \s* + + + include + #function_name + + + begin + (?<=$|.) + end + (?=\)) + patterns + + + include + #all + + + + + + + begin + (?<=\()\s*(prefer-method)\s+ + beginCaptures + + 1 + + name + storage.type.variable.clojure + + + end + (?=\)) + name + meta.function.def_form.clojure + patterns + + + include + #metadata + + + match + \s* + + + include + #function_name + + + begin + (?<=$|.) + end + (?=\)) + patterns + + + include + #symbol_java_inherited_class + + + include + #all + + + + + + + begin + (?<=\()\s*(instance(\?))\s+ + beginCaptures + + 1 + + name + support.function.tester.clojure + + 2 + + name + keyword.other.mark.clojure + + + end + (?=\)) + name + meta.function.isInstance_form.clojure + patterns + + + include + #symbol_java_class_form_body + + + + + begin + (?<=\()\s*(cast)\s+ + beginCaptures + + 1 + + name + support.function.clojure + + + end + (?=\)) + name + meta.function.cast_form.clojure + patterns + + + include + #symbol_java_class_form_body + + + + + begin + (?<=\()\s*((new)\s+|(?=[a-zA-Z][a-zA-Z.]*\.(\s+|$|\)))) + beginCaptures + + 2 + + name + keyword.control.clojure + + + end + (?=\)) + name + meta.function.new_form.clojure + patterns + + + begin + (?=([a-z]+\.)*[A-Z][a-zA-Z]*(\$[A-Z][a-zA-Z]*)?) + end + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + storage.type.java.clojure + patterns + + + include + #symbol + + + + + begin + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?=\)) + patterns + + + include + #all + + + + + include + #all + + + + + begin + (?<=\()\s*((\.\.?)\s+(?=([a-z]+\.)*[A-Z][a-zA-Z]*(\$[A-Z][a-zA-Z]*)?)) + beginCaptures + + 2 + + name + keyword.control.clojure + + + end + (?=\)) + name + meta.function.member_access_form.clojure + patterns + + + begin + (?=[a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + storage.type.java.clojure + patterns + + + include + #symbol + + + + + begin + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?=\)) + patterns + + + include + #all + + + + + include + #all + + + + + begin + (?<=\()\s*(gen-class)\s+ + beginCaptures + + 1 + + name + support.function.clojure + + + end + (?=\)) + name + meta.function.genclass_form.clojure + patterns + + + include + #genclass_parameters + + + + + begin + (?<=\()\s*(gen-interface)\s+ + beginCaptures + + 1 + + name + support.function.clojure + + + end + (?=\)) + name + meta.function.geninterface_form.clojure + patterns + + + include + #geninterface_parameters + + + + + begin + (?<=\()\s*((catch)\s+) + beginCaptures + + 2 + + name + keyword.control.clojure + + + end + (?=\)) + name + meta.function.catch_form.clojure + patterns + + + begin + (?=[a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + patterns + + + include + #symbol_java_class_form_body + + + + + begin + \s+(?=[a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + variable.parameter.clojure + patterns + + + include + #symbol + + + + + begin + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?=\)) + patterns + + + include + #all + + + + + include + #all + + + + + begin + (?<=\()\s*(((set|swap|compare-and-set)(\!))\s+) + beginCaptures + + 2 + + name + keyword.control.clojure + + 3 + + name + keyword.other.mark.clojure + + + end + (?=\)) + name + meta.function.setvar_form.clojure + patterns + + + begin + (?=[a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + variable.parameter.clojure + patterns + + + include + #symbol + + + + + begin + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?=\)) + patterns + + + include + #all + + + + + include + #all + + + + + begin + (?<=\()\s*(proxy)\s+ + beginCaptures + + 1 + + name + keyword.control.clojure + + + end + (?=\)) + name + meta.function.proxy_form.clojure + patterns + + + include + #comment + + + begin + (?=\[) + end + (?=\)) + patterns + + + include + #comment + + + begin + \[ + end + \] + patterns + + + begin + (?=([a-z]+\.)*[A-Z][a-zA-Z]*) + end + (?![a-zA-Z.]) + name + entity.other.inherited-class.java.proxy.clojure + patterns + + + include + #symbol + + + + + include + #all + + + + + begin + (?<=\]) + end + (?=\)) + patterns + + + include + #comment + + + begin + (?=\[) + end + (?=\)) + name + meta.function.body.proxy_form.clojure + patterns + + + include + #comment + + + include + #parameters + + + begin + (?<=\]) + end + (?=\)) + patterns + + + include + #comment + + + begin + \(\s* + end + \) + name + meta.function.proxy.method.clojure + patterns + + + include + #comment + + + include + #function_name + + + include + #function_body_comment + + + + + + + + + + + + + + + + string + + patterns + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.clojure + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.clojure + + + name + string.quoted.double.clojure + patterns + + + include + #string_escape + + + + + match + \\(u[0-9a-fA-F]{4}|newline|tab|space|backspace|formfeed|return|[^\s]) + name + constant.character.escape.clojure + + + begin + (\:{1,2})(?=[a-zA-Z+!\-_?0-9*/.$=]) + beginCaptures + + 1 + + name + keyword.operator.symbole.clojure + + + comment + . is OK in symbol ? + end + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + name + constant.string.symbole.clojure + patterns + + + include + #symbol + + + + + begin + #" + beginCaptures + + 0 + + name + punctuation.definition.string.begin.clojure + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.clojure + + + name + string.regexp.clojure + patterns + + + include + source.regexp.oniguruma + + + + + + string_escape + + captures + + 2 + + name + invalid.illegal.escape.string.clojure + + + match + \\(u[0-9a-fA-F]{4}|b|t|n|f|r|"|'|\\|[0-3]?[0-7]{1,2}|(.)) + name + constant.character.escape.clojure + + symbol + + patterns + + + match + \b[A-Z_]{2,}\b + name + constant.other.java.clojure + + + match + (?<![a-zA-Z+!\-_?0-9*])\*[a-z\-]{2,}\*(?![a-zA-Z+!\-_?0-9*]) + name + source.symbol.global.clojure + + + begin + (?=[a-zA-Z+!\-_?0-9*=]) + end + (?![a-zA-Z+!\-_?0-9*=]) + name + source.symbol.clojure + patterns + + + begin + [0-9] + end + (?![a-zA-Z+!\-_?0-9*=]) + name + invalid.illegal.symbol.clojure + + + begin + [a-zA-Z] + end + ([+!\-_?*=#])?(?![a-zA-Z+!\-_?0-9*=]) + endCaptures + + 1 + + name + keyword.other.mark.clojure + + + + + begin + [+!\-_?*=] + end + (?![a-zA-Z+!\-_?0-9*=]) + + + + + match + (?<=[a-zA-Z+!\-_?0-9*])\.(?=[a-zA-Z+!\-_?0-9*]) + name + keyword.operator.classpath.clojure + + + match + (?<=[a-zA-Z+!\-_?0-9*])(/|\$)(?=[a-zA-Z+!\-_?0-9*]) + name + keyword.operator.qualified.clojure + + + + symbol_java_class + + begin + (?=([a-z]+\.)*[A-Z][a-zA-Z]*(\$[A-Z][a-zA-Z]*)?) + comment + TODO : use it + end + (?![a-zA-Z.$]) + name + storage.type.java.clojure + patterns + + + include + #symbol + + + + symbol_java_class_form_body + + patterns + + + begin + (?=[a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + patterns + + + include + #symbol_java_inherited_class + + + + + begin + (?![a-zA-Z+!\-_?0-9*~#@'`/.$=]) + end + (?=\)) + patterns + + + include + #all + + + + + include + #all + + + + symbol_java_inherited_class + + begin + (?=([a-z]+\.)*[A-Z][a-zA-Z]*(\$[A-Z][a-zA-Z]*)?) + end + (?![a-zA-Z.$]) + name + entity.other.inherited-class.java.clojure + patterns + + + include + #symbol + + + + vector + + begin + \[(?!\]) + beginCaptures + + 0 + + name + punctuation.definition.vector.begin.clojure + + + end + (?<!\[)\] + endCaptures + + 0 + + name + punctuation.definition.vector.end.clojure + + + name + meta.expression.vector.clojure + patterns + + + include + #all + + + + + scopeName + source.clojure + uuid + 6A87759F-F746-4E84-B788-965B46363202 + + diff --git a/app/rcc/edbee/syntaxfiles/CoffeeScript.tmLanguage b/app/rcc/edbee/syntaxfiles/CoffeeScript.tmLanguage new file mode 100644 index 00000000..bd063484 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/CoffeeScript.tmLanguage @@ -0,0 +1,746 @@ + + + + + comment + CoffeeScript Syntax: version 1 + fileTypes + + coffee + Cakefile + coffee.erb + cson + + firstLineMatch + ^#!.*\bcoffee + foldingStartMarker + ^\s*class\s+\S.*$|.*(->|=>)\s*$|.*[\[{]\s*$ + foldingStopMarker + ^\s*$|^\s*[}\]]\s*$ + keyEquivalent + ^~C + name + CoffeeScript + patterns + + + captures + + 1 + + name + variable.parameter.function.coffee + + 2 + + name + storage.type.function.coffee + + + comment + match stuff like: a -> … + match + (\([^()]*?\))\s*([=-]>) + name + meta.inline.function.coffee + + + captures + + 1 + + name + keyword.operator.new.coffee + + 2 + + name + support.class.coffee + + + match + (new)\s+(\w+(?:\.\w*)*) + name + meta.class.instance.constructor + + + begin + ''' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.coffee + + + end + ''' + endCaptures + + 0 + + name + punctuation.definition.string.end.coffee + + + name + string.quoted.heredoc.coffee + + + begin + """ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.coffee + + + end + """ + endCaptures + + 0 + + name + punctuation.definition.string.end.coffee + + + name + string.quoted.double.heredoc.coffee + patterns + + + match + \\. + name + constant.character.escape.coffee + + + include + #interpolated_coffee + + + + + begin + ` + beginCaptures + + 0 + + name + punctuation.definition.string.begin.coffee + + + end + ` + endCaptures + + 0 + + name + punctuation.definition.string.end.coffee + + + name + string.quoted.script.coffee + patterns + + + match + \\(x\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.) + name + constant.character.escape.coffee + + + + + begin + (?<!#)###(?!#) + captures + + 0 + + name + punctuation.definition.comment.coffee + + + end + ###(?:[ \t]*\n) + name + comment.block.coffee + patterns + + + match + @\w* + name + storage.type.annotation.coffeescript + + + + + captures + + 1 + + name + punctuation.definition.comment.coffee + + + match + (#)(?!\{).*$\n? + name + comment.line.number-sign.coffee + + + begin + /{3} + end + /{3}[imgy]{0,4} + name + string.regexp.coffee + patterns + + + include + #interpolated_coffee + + + include + #embedded_comment + + + + + match + /(?![\s=/*+{}?]).*?[^\\]/[igmy]{0,4}(?![a-zA-Z0-9]) + name + string.regexp.coffee + + + match + (?x) + \b(?<![\.\$])( + break|by|catch|continue|else|finally|for|in|of|if|return|switch| + then|throw|try|unless|when|while|until|loop|do|(?<=for)\s+own + )(?!\s*:)\b + + name + keyword.control.coffee + + + match + (?x) + and=|or=|!|%|&|\^|\*|\/|(\-)?\-(?!>)|\+\+|\+|~|==|=(?!>)|!=|<=|>=|<<=|>>=| + >>>=|<>|<|>|!|&&|\.\.(\.)?|\?|\||\|\||\:|\*=|(?<!\()/=|%=|\+=|\-=|&=| + \^=|\b(?<![\.\$])(instanceof|new|delete|typeof|and|or|is|isnt|not|super)\b + + name + keyword.operator.coffee + + + captures + + 1 + + name + variable.assignment.coffee + + 4 + + name + punctuation.separator.key-value + + 5 + + name + keyword.operator.coffee + + + match + ([a-zA-Z\$_](\w|\$|\.)*\s*(?!\::)((:)|(=[^=]))(?!(\s*\(.*\))?\s*((=|-)>))) + name + variable.assignment.coffee + + + begin + (?<=\s|^)([\[\{])(?=.*?[\]\}]\s+[:=]) + beginCaptures + + 0 + + name + keyword.operator.coffee + + + end + ([\]\}]\s*[:=]) + endCaptures + + 0 + + name + keyword.operator.coffee + + + name + meta.variable.assignment.destructured.coffee + patterns + + + include + #variable_name + + + include + #instance_variable + + + include + #single_quoted_string + + + include + #double_quoted_string + + + include + #numeric + + + + + captures + + 2 + + name + entity.name.function.coffee + + 3 + + name + entity.name.function.coffee + + 4 + + name + variable.parameter.function.coffee + + 5 + + name + storage.type.function.coffee + + + match + (?x) + (\s*) + (?=[a-zA-Z\$_]) + ( + [a-zA-Z\$_](\w|\$|:|\.)*\s* + (?=[:=](\s*\(.*\))?\s*([=-]>)) + ) + + name + meta.function.coffee + + + comment + Show well-known functions from Express and Mocha in Go To Symbol view + name + meta.function.symbols.coffee + begin + ^\s*(describe|it|app\.(get|post|put|all|del|delete)) + end + $ + patterns + + + include + $self + + + + + match + [=-]> + name + storage.type.function.coffee + + + match + \b(?<!\.)(true|on|yes)(?!\s*[:=])\b + name + constant.language.boolean.true.coffee + + + match + \b(?<!\.)(false|off|no)(?!\s*[:=])\b + name + constant.language.boolean.false.coffee + + + match + \b(?<!\.)null(?!\s*[:=])\b + name + constant.language.null.coffee + + + match + \b(?<!\.)(this|extends)(?!\s*[:=])\b + name + variable.language.coffee + + + captures + + 1 + + name + storage.type.class.coffee + + 2 + + name + entity.name.type.class.coffee + + 3 + + name + keyword.control.inheritance.coffee + + 4 + + name + entity.other.inherited-class.coffee + + + match + (class\b)\s+(@?[a-zA-Z\$_][\w\.]*)?(?:\s+(extends)\s+(@?[a-zA-Z\$\._][\w\.]*))? + name + meta.class.coffee + + + match + \b(debugger|\\)\b + name + keyword.other.coffee + + + match + (?x)\b( + Array|ArrayBuffer|Blob|Boolean|Date|document|event|Function| + Int(8|16|32|64)Array|Math|Map|Number| + Object|Proxy|RegExp|Set|String|WeakMap| + window|Uint(8|16|32|64)Array|XMLHttpRequest + )\b + name + support.class.coffee + + + match + ((?<=console\.)(debug|warn|info|log|error|time|timeEnd|assert))\b + name + support.function.console.coffee + + + match + (?x)\b( + decodeURI(Component)?|encodeURI(Component)?|eval|parse(Float|Int)|require + )\b + name + support.function.coffee + + + match + (?x)((?<=\.)( + apply|call|concat|every|filter|forEach|from|hasOwnProperty|indexOf| + isPrototypeOf|join|lastIndexOf|map|of|pop|propertyIsEnumerable|push| + reduce(Right)?|reverse|shift|slice|some|sort|splice|to(Locale)?String| + unshift|valueOf + ))\b + name + support.function.method.array.coffee + + + match + (?x)((?<=Array\.)( + isArray + ))\b + name + support.function.static.array.coffee + + + match + (?x)((?<=Object\.)( + create|definePropert(ies|y)|freeze|getOwnProperty(Descriptors?|Names)| + getProperty(Descriptor|Names)|getPrototypeOf|is(Extensible|Frozen|Sealed)?| + isnt|keys|preventExtensions|seal + ))\b + name + support.function.static.object.coffee + + + match + (?x)((?<=Math\.)( + abs|acos|acosh|asin|asinh|atan|atan2|atanh|ceil|cos|cosh|exp|expm1|floor| + hypot|log|log10|log1p|log2|max|min|pow|random|round|sign|sin|sinh|sqrt| + tan|tanh|trunc + ))\b + name + support.function.static.math.coffee + + + match + (?x)((?<=Number\.)( + is(Finite|Integer|NaN)|toInteger + ))\b + name + support.function.static.number.coffee + + + match + \b(Infinity|NaN|undefined)\b + name + constant.language.coffee + + + match + \; + name + punctuation.terminator.statement.coffee + + + match + ,[ |\t]* + name + meta.delimiter.object.comma.coffee + + + match + \. + name + meta.delimiter.method.period.coffee + + + match + \{|\} + name + meta.brace.curly.coffee + + + match + \(|\) + name + meta.brace.round.coffee + + + match + \[|\]\s* + name + meta.brace.square.coffee + + + include + #instance_variable + + + include + #single_quoted_string + + + include + #double_quoted_string + + + include + #numeric + + + repository + + double_quoted_string + + patterns + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.coffee + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.coffee + + + name + string.quoted.double.coffee + patterns + + + match + \\(x\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.) + name + constant.character.escape.coffee + + + include + #interpolated_coffee + + + + + + embedded_comment + + patterns + + + captures + + 1 + + name + punctuation.definition.comment.coffee + + + match + (?<!\\)(#).*$\n? + name + comment.line.number-sign.coffee + + + + instance_variable + + patterns + + + match + (@)([a-zA-Z_\$]\w*)? + name + variable.other.readwrite.instance.coffee + + + + interpolated_coffee + + patterns + + + begin + \#\{ + captures + + 0 + + name + punctuation.section.embedded.coffee + + + end + \} + name + source.coffee.embedded.source + patterns + + + include + $self + + + + + + numeric + + patterns + + + match + (?<!\$)\b((0([box])[0-9a-fA-F]+)|([0-9]+(\.[0-9]+)?(e[+\-]?[0-9]+)?))\b + name + constant.numeric.coffee + + + + single_quoted_string + + patterns + + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.coffee + + + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.coffee + + + name + string.quoted.single.coffee + patterns + + + match + \\(x\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.) + name + constant.character.escape.coffee + + + + + + variable_name + + patterns + + + captures + + 1 + + name + variable.assignment.coffee + + + match + ([a-zA-Z\$_]\w*(\.\w+)*) + name + variable.assignment.coffee + + + + + scopeName + source.coffee + + diff --git a/app/rcc/edbee/syntaxfiles/D.tmLanguage b/app/rcc/edbee/syntaxfiles/D.tmLanguage new file mode 100644 index 00000000..c7233a28 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/D.tmLanguage @@ -0,0 +1,908 @@ + + + + + comment + D language + fileTypes + + d + di + + firstLineMatch + ^#!.*\bg?dmd\b. + foldingStartMarker + (?x)/\*\*(?!\*)|^(?![^{]*?//|[^{]*?/\*(?!.*?\*/.*?\{)).*?\{\s*($|//|/\*(?!.*?\*/.*\S)) + foldingStopMarker + (?<!\*)\*\*/|^\s*\} + keyEquivalent + ^~D + name + D + patterns + + + captures + + 0 + + name + punctuation.definition.comment.d + + + match + /\*\*/ + name + comment.block.empty.d + + + include + text.html.javadoc + + + begin + (?x)^\s* + ((?:\b(public|private|protected|static|final|native|synchronized|abstract|export)\b\s*)*) # modifier + (class|interface)\s+ + (\w+)\s* # identifier + (?:\(\s*([^\)]+)\s*\)|)\s* # Template type + (?: + \s*(:)\s* + (\w+) + (?:\s*,\s*(\w+))? + (?:\s*,\s*(\w+))? + (?:\s*,\s*(\w+))? + (?:\s*,\s*(\w+))? + (?:\s*,\s*(\w+))? + (?:\s*,\s*(\w+))? + )? # super class + + beginCaptures + + 1 + + name + storage.modifier.d + + 10 + + name + entity.other.inherited-class.d + + 11 + + name + entity.other.inherited-class.d + + 12 + + name + entity.other.inherited-class.d + + 13 + + name + entity.other.inherited-class.d + + 3 + + name + storage.type.structure.d + + 4 + + name + entity.name.type.class.d + + 5 + + name + storage.type.template.d + + 6 + + name + punctuation.separator.inheritance.d + + 7 + + name + entity.other.inherited-class.d + + 8 + + name + entity.other.inherited-class.d + + 9 + + name + entity.other.inherited-class.d + + + end + (?={) + name + meta.definition.class.d + patterns + + + begin + \b(_|:)\b + captures + + 1 + + name + storage.modifier.d + + + end + (?={) + name + meta.definition.class.extends.d + patterns + + + include + #all-types + + + + + + + begin + (?x)^\s* + ((?:\b(public|private|protected|static|final|native|synchronized|abstract|export)\b\s*)*) # modifier + (struct)\s+ + (\w+)\s* # identifier + (?:\(\s*([^\)]+)\s*\)|)\s* # Template type + + beginCaptures + + 1 + + name + storage.modifier.d + + 3 + + name + storage.type.structure.d + + 4 + + name + entity.name.type.struct.d + + 5 + + name + storage.type.template.d + + + end + (?={) + name + meta.definition.struct.d + patterns + + + begin + \b(_|:)\b + captures + + 1 + + name + storage.modifier.d + + + end + (?={) + name + meta.definition.class.extends.d + patterns + + + include + #all-types + + + + + + + begin + (?x)^\s* + ((?:\b(public|private|protected|static|final|native|synchronized|abstract|threadsafe|transient|export)\b\s*)*) # modifier + (\b(this))\s* # identifier + (?!.*;) # abort if line has a ; + (?=\() + captures + + 1 + + name + storage.modifier.d + + 3 + + name + entity.name.function.constructor.d + + + end + (?={) + name + meta.definition.constructor.d + patterns + + + include + $base + + + + + begin + (?x) + (?: ^ # begin-of-line + | (?: (?<!else|new|=) ) # or word + space before name + ) + ((?:\b(?:public|private|protected|static|final|native|synchronized|abstract|threadsafe|transient|export)\b\s*)*) # modifier + (~this) # actual name + \s*(\() # start bracket or end-of-line + + captures + + 1 + + name + storage.modifier.d + + 2 + + name + entity.name.function.destructor.d + + + end + \) + endCaptures + + 0 + + name + punctuation.definition.parameters.d + + + name + meta.definition.destructor.d + patterns + + + include + $base + + + + + begin + (?x)^\s* + ((?:\b(?:public|private|protected|static|final|native|lazy|synchronized|abstract|threadsafe|transient|export)\b\s*)*) # modifier + (\b(?:void|boolean|byte|char|short|int|float|long|double|[\w_]+[\w0-9_]*|(?:\w+\.)*[A-Z]\w+)\b(?:<(?:(?:(?:\w+\.)*[A-Z]\w+)(?:\s*,\s*)?)+>|(?:\[\s*\])*)?)\s* # type + (\w+)\s* # identifier + (?!.*;) # abort if line has a ; + (?=\() + beginCaptures + + 1 + + name + storage.modifier.d + + 2 + + name + storage.type.structure.d + + 3 + + name + entity.name.function.d + + + end + (?={) + name + meta.definition.method.d + patterns + + + include + $base + + + + + match + \b([A-Z][A-Z0-9_]+)\b + name + constant.other.d + + + include + #comments + + + include + #all-types + + + match + \b(private|protected|public|export)\b + name + storage.modifier.access-control.d + + + match + \b(auto|static|override|final|const|abstract|volatile|synchronized|lazy)\b + name + storage.modifier.d + + + match + \b(template|interface|class|enum|struct|union)\b + name + storage.type.structure.d + + + match + \b(ushort|int|uint|long|ulong|float|void|byte|ubyte|double|bit|char|wchar|ucent|cent|short|bool|dchar|real|ireal|ifloat|idouble|creal|cfloat|cdouble|lazy)\b + name + storage.type.d + + + match + \b(try|catch|finally|throw)\b + name + keyword.control.exception.d + + + match + \b(return|break|case|continue|default|do|while|for|switch|if|else)\b + name + keyword.control.d + + + match + \b(if|else|switch|iftype)\b + name + keyword.control.conditional.d + + + match + \b(goto|break|continue)\b + name + keyword.control.branch.d + + + match + \b(while|for|do|foreach(_reverse)?)\b + name + keyword.control.repeat.d + + + match + \b(version|return|with|invariant|body|scope|in|out|inout|asm|mixin|function|delegate)\b + name + keyword.control.statement.d + + + match + \b(pragma)\b + name + keyword.control.pragma.d + + + match + \b(alias|typedef)\b + name + keyword.control.alias.d + + + match + \b(import)\b + name + keyword.control.import.d + + + captures + + 1 + + name + keyword.control.module.d + + 2 + + name + entity.name.function.package.d + + + match + ^\s*(module)\s+([^ ;]+?); + name + meta.module.d + + + match + \b(true|false)\b + name + constant.language.boolean.d + + + match + \b(__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|null)\b + name + constant.language.d + + + match + \b(this|super)\b + name + variable.language.d + + + match + \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)([LlFfUuDd]|UL|ul)?\b + name + constant.numeric.d + + + include + #string_escaped_char + + + include + #strings + + + match + (==|!=|<=|>=|<>|<|>) + name + keyword.operator.comparison.d + + + match + (\-\-|\+\+) + name + keyword.operator.increment-decrement.d + + + match + (\-|\+|\*|\/|~|%) + name + keyword.operator.arithmetic.d + + + match + (!|&&|\|\|) + name + keyword.operator.logical.d + + + match + \b(opNeg|opCom|opPostInc|opPostDec|opCast|opAdd|opSub|opSub_r|opMul|opDiv|opDiv_r|opMod|opMod_r|opAnd|opOr|opXor|opShl|opShl_r|opShr|opShr_r|opUShr|opUShr_r|opCat|opCat_r|opEquals|opEquals|opCmp|opCmp|opCmp|opCmp|opAddAssign|opSubAssign|opMulAssign|opDivAssign|opModAssign|opAndAssign|opOrAssign|opXorAssign|opShlAssign|opShrAssign|opUShrAssign|opCatAssign|opIndex|opIndexAssign|opCall|opSlice|opSliceAssign|opPos|opAdd_r|opMul_r|opAnd_r|opOr_r|opXor_r)\b + name + keyword.operator.overload.d + + + match + \b(new|delete|typeof|typeid|cast|align|is)\b + name + keyword.operator.d + + + match + \b(new|throws)\b + name + keyword.other.class-fns.d + + + match + \b(package|extern)\b + name + keyword.other.external.d + + + match + \b(deprecated|unittest|debug)\b + name + keyword.other.debug.d + + + match + \b(u_char|u_short|u_int|u_long|ushort|uint|u_quad_t|quad_t|qaddr_t|caddr_t|daddr_t|dev_t|fixpt_t|blkcnt_t|blksize_t|gid_t|in_addr_t|in_port_t|ino_t|key_t|mode_t|nlink_t|id_t|pid_t|off_t|segsz_t|swblk_t|uid_t|id_t|clock_t|size_t|ssize_t|time_t|useconds_t|suseconds_t)\b + name + support.type.sys-types.c + + + match + \b(pthread_attr_t|pthread_cond_t|pthread_condattr_t|pthread_mutex_t|pthread_mutexattr_t|pthread_once_t|pthread_rwlock_t|pthread_rwlockattr_t|pthread_t|pthread_key_t)\b + name + support.type.pthread.c + + + match + \b(int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t|uintmax_t|uintmax_t)\b + name + support.type.stdint.c + + + repository + + all-types + + patterns + + + include + #support-type-built-ins-d + + + include + #support-type-d + + + include + #storage-type-d + + + + comments + + patterns + + + begin + /\* + captures + + 0 + + name + punctuation.definition.comment.d + + + end + \*/ + name + comment.block.d + + + begin + /\+ + captures + + 0 + + name + punctuation.definition.comment.d + + + end + \+/ + name + comment.block.nested.d + + + captures + + 1 + + name + punctuation.definition.comment.d + + + match + (//).*$\n? + name + comment.line.double-slash.d + + + + constant_placeholder + + match + (?i:%(\([a-z_]+\))?#?0?\-?[ ]?\+?([0-9]*|\*)(\.([0-9]*|\*))?[hL]?[a-z%]) + name + constant.other.placeholder.d + + regular_expressions + + comment + Change disabled to 1 to turn off syntax highlighting in “r” strings. + disabled + 1 + patterns + + + include + source.regexp.python + + + + statement-remainder + + patterns + + + begin + \( + end + (?=\)) + name + meta.definition.param-list.d + patterns + + + include + #all-types + + + + + begin + (throws) + captures + + 1 + + name + keyword.other.class-fns.d + + + end + (?={) + name + meta.definition.throws.d + patterns + + + include + #all-types + + + + + + storage-type-d + + match + \b(void|byte|short|char|int|long|float|double|boolean|([a-z]\w+\.)*[A-Z]\w+)\b + name + storage.type.d + + string_escaped_char + + patterns + + + match + \\(\\|[abefnprtv'"?]|[0-3]\d{,2}|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|&\w+;) + name + constant.character.escape.d + + + match + \\. + name + invalid.illegal.unknown-escape.d + + + + strings + + patterns + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.d + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.d + + + name + string.quoted.double.d + patterns + + + include + #string_escaped_char + + + + + begin + (r)(") + beginCaptures + + 1 + + name + storage.type.string.d + + 2 + + name + punctuation.definition.string.begin.d + + + end + ((?<=")(")|") + endCaptures + + 1 + + name + punctuation.definition.string.end.d + + 2 + + name + meta.empty-string.double.d + + + name + string.quoted.double.raw.d + patterns + + + include + #regular_expressions + + + + + begin + ` + beginCaptures + + 0 + + name + punctuation.definition.string.begin.d + + + end + ((?<=`)(`)|`) + endCaptures + + 1 + + name + punctuation.definition.string.end.d + + 2 + + name + meta.empty-string.double.d + + + name + string.quoted.double.raw.backtick.d + + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.d + + + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.d + + + name + string.quoted.single.d + patterns + + + include + #string_escaped_char + + + + + + support-type-built-ins-classes-d + + match + \b(AbstractServer|ArchiveMember|ArgParser|Barrier|BomSniffer|Buffer|BufferInput|BufferOutput|BufferSlice|BufferedFile|BufferedStream|BzipInput|BzipOutput|CFile|CacheInvalidatee|CacheInvalidator|CacheServer|CacheThread|Certificate|CertificateStore|CertificateStoreCtx|ChunkInput|ChunkOutput|ClassInfo|Cluster|ClusterCache|ClusterQueue|ClusterThread|CmdParser|ComObject|Compress|Condition|Conduit|Cookie|CookieParser|CookieStack|CounterInput|CounterOutput|DataFileInput|DataFileOutput|DataInput|DataOutput|Database|DatagramConduit|DeviceConduit|DigestInput|DigestOutput|DocPrinter|Document|DummyInputStream|DummyOutputStream|EndianInput|EndianOutput|EndianProtocol|EndianStream|EventSeekInputStream|EventSeekOutputStream|FTPConnection|Fiber|Field|File|FileConduit|FileFolder|FileGroup|FileInput|FileOutput|FilePath|FileScan|FilterStream|Foo|FormatOutput|GreedyInput|GreedyOutput|Gregorian|GrowBuffer|HeapCopy|HeapSlice|Hierarchy|HttpClient|HttpCookies|HttpCookiesView|HttpGet|HttpHeaders|HttpHeadersView|HttpParams|HttpPost|HttpStack|HttpTokens|HttpTriplet|IPv4Address|IUnknown|InputFilter|InternetAddress|InternetHost|Layout|LineInput|LineIterator|LinkedFolder|Log|MapInput|MapOutput|MappedBuffer|Md2|Md4|MemoryQueue|MemoryStream|MmFile|MmFileStream|ModuleInfo|MulticastConduit|Mutex|NativeProtocol|NetCall|NetHost|NetworkAlert|NetworkCache|NetworkCall|NetworkClient|NetworkCombo|NetworkMessage|NetworkQueue|NetworkRegistry|NetworkTask|NotImplemented|Object|Observer|OutBuffer|OutputFilter|PersistQueue|Pipe|PipeConduit|Print|PrivateKey|Process|Properties|Protocol|ProtocolReader|ProtocolWriter|PublicKey|PullParser|QueueFile|QueueServer|QueueThread|QueuedCache|QuoteIterator|Random|Range|ReadWriteMutex|Reader|Record|RegExp|RegExpT|RegexIterator|RollCall|SSLCtx|SSLServerSocket|SSLSocketConduit|SaxParser|SelectionKey|Semaphore|ServerSocket|ServerThread|Service|SimpleIterator|SliceInputStream|SliceSeekInputStream|SliceSeekOutputStream|SliceStream|SnoopInput|SnoopOutput|Socket|SocketConduit|SocketListener|SocketSet|SocketStream|Sprint|Stream|StreamIterator|TArrayStream|TaskServer|TaskThread|TcpSocket|Telnet|TempFile|Text|TextFileInput|TextFileOutput|TextView|Thread|ThreadGroup|ThreadLocal|ThreadPool|Token|TypeInfo|TypeInfo_AC|TypeInfo_Aa|TypeInfo_Ab|TypeInfo_Ac|TypeInfo_Ad|TypeInfo_Ae|TypeInfo_Af|TypeInfo_Ag|TypeInfo_Ah|TypeInfo_Ai|TypeInfo_Aj|TypeInfo_Ak|TypeInfo_Al|TypeInfo_Am|TypeInfo_Ao|TypeInfo_Ap|TypeInfo_Aq|TypeInfo_Ar|TypeInfo_Array|TypeInfo_As|TypeInfo_AssociativeArray|TypeInfo_At|TypeInfo_Au|TypeInfo_Av|TypeInfo_Aw|TypeInfo_C|TypeInfo_Class|TypeInfo_D|TypeInfo_Delegate|TypeInfo_Enum|TypeInfo_Function|TypeInfo_Interface|TypeInfo_P|TypeInfo_Pointer|TypeInfo_StaticArray|TypeInfo_Struct|TypeInfo_Tuple|TypeInfo_Typedef|TypeInfo_a|TypeInfo_b|TypeInfo_c|TypeInfo_d|TypeInfo_e|TypeInfo_f|TypeInfo_g|TypeInfo_h|TypeInfo_i|TypeInfo_j|TypeInfo_k|TypeInfo_l|TypeInfo_m|TypeInfo_o|TypeInfo_p|TypeInfo_q|TypeInfo_r|TypeInfo_s|TypeInfo_t|TypeInfo_u|TypeInfo_v|TypeInfo_w|TypedInput|TypedOutput|URIerror|UdpSocket|UnCompress|UniText|UnicodeBom|UnicodeFile|UnknownAddress|Uri|UtfInput|UtfOutput|VirtualFolder|WrapSeekInputStream|WrapSeekOutputStream|Writer|XmlPrinter|ZipArchive|ZipBlockReader|ZipBlockWriter|ZipEntry|ZipEntryVerifier|ZipFile|ZipFileGroup|ZipFolder|ZipSubFolder|ZipSubFolderEntry|ZipSubFolderGroup|ZlibInput|ZlibOutput)\b + name + support.type.built-ins.classes.d + + support-type-built-ins-d + + patterns + + + include + #support-type-built-ins-exceptions-d + + + include + #support-type-built-ins-classes-d + + + include + #support-type-built-ins-interfaces-d + + + include + #support-type-built-ins-structs-d + + + + support-type-built-ins-exceptions-d + + match + \b(AddressException|ArrayBoundsError|ArrayBoundsException|AssertError|AssertException|Base64CharException|Base64Exception|BzipClosedException|BzipException|ClusterEmptyException|ClusterFullException|ConvError|ConvOverflowError|ConversionException|CorruptedIteratorException|DatabaseException|DateParseError|Exception|FTPException|FiberException|FileException|FinalizeException|FormatError|HostException|IOException|IllegalArgumentException|IllegalElementException|InvalidKeyException|InvalidTypeException|LocaleException|ModuleCtorError|NoSuchElementException|OpenException|OpenRJException|OutOfMemoryException|PlatformException|ProcessCreateException|ProcessException|ProcessForkException|ProcessKillException|ProcessWaitException|ReadException|RegExpException|RegexException|RegistryException|SeekException|SharedLibException|SocketAcceptException|SocketException|StdioException|StreamException|StreamFileException|StringException|SwitchError|SwitchException|SyncException|TextException|ThreadError|ThreadException|UnboxException|UnicodeException|UtfException|VariantTypeMismatchException|Win32Exception|WriteException|XmlException|ZipChecksumException|ZipException|ZipExhaustedException|ZipNotSupportedException|ZlibClosedException|ZlibException|OurUnwindException|SysError)\b + name + support.type.built-ins.exceptions.d + + support-type-built-ins-interfaces-d + + match + \b(Buffered|HttpParamsView|ICache|IChannel|IClassFactory|ICluster|IConduit|IConsumer|IEvent|IHierarchy|ILevel|IListener|IMessage|IMessageLoader|IOStream|IReadable|ISelectable|ISelectionSet|ISelector|IServer|IUnknown|IWritable|IXmlPrinter|InputStream|OutputStream|PathView|VfsFile|VfsFiles|VfsFolder|VfsFolderEntry|VfsFolders|VfsHost|VfsSync|ZipReader|ZipWriter)\b + name + support.type.built-ins.interfaces.d + + support-type-built-ins-structs-d + + match + \b(ABC|ABCFLOAT|ACCEL|ACCESSTIMEOUT|ACCESS_ALLOWED_ACE|ACCESS_DENIED_ACE|ACE_HEADER|ACL|ACL_REVISION_INFORMATION|ACL_SIZE_INFORMATION|ACTION_HEADER|ADAPTER_STATUS|ADDJOB_INFO_1|ANIMATIONINFO|APPBARDATA|Argument|Atomic|Attribute|BITMAP|BITMAPCOREHEADER|BITMAPCOREINFO|BITMAPINFO|BITMAPINFOHEADER|BITMAPV4HEADER|BLOB|BROWSEINFO|BY_HANDLE_FILE_INFORMATION|Bar|Baz|BitArray|Box|BracketResult|ByteSwap|CANDIDATEFORM|CANDIDATELIST|CBTACTIVATESTRUCT|CBT_CREATEWND|CHARFORMAT|CHARRANGE|CHARSET|CHARSETINFO|CHAR_INFO|CIDA|CIEXYZ|CIEXYZTRIPLE|CLIENTCREATESTRUCT|CMINVOKECOMMANDINFO|COLORADJUSTMENT|COLORMAP|COMMCONFIG|COMMPROP|COMMTIMEOUTS|COMPAREITEMSTRUCT|COMPCOLOR|COMPOSITIONFORM|COMSTAT|CONNECTDLGSTRUCT|CONSOLE_CURSOR_INFO|CONTEXT|CONVCONTEXT|CONVINFO|COORD|COPYDATASTRUCT|CPINFO|CPLINFO|CREATESTRUCT|CREATE_PROCESS_DEBUG_INFO|CREATE_THREAD_DEBUG_INFO|CRITICAL_SECTION|CRITICAL_SECTION_DEBUG|CURRENCYFMT|CURSORSHAPE|CWPRETSTRUCT|CWPSTRUCT|CharClass|CharRange|Clock|CodePage|Console|DATATYPES_INFO_1|DCB|DDEACK|DDEADVISE|DDEDATA|DDELN|DDEML_MSG_HOOK_DATA|DDEPOKE|DDEUP|DEBUGHOOKINFO|DEBUG_EVENT|DELETEITEMSTRUCT|DEVMODE|DEVNAMES|DEV_BROADCAST_HDR|DEV_BROADCAST_OEM|DEV_BROADCAST_PORT|DEV_BROADCAST_VOLUME|DIBSECTION|DIR|DISCDLGSTRUCT|DISK_GEOMETRY|DISK_PERFORMANCE|DOCINFO|DOC_INFO_1|DOC_INFO_2|DRAGLISTINFO|DRAWITEMSTRUCT|DRAWTEXTPARAMS|DRIVER_INFO_1|DRIVER_INFO_2|DRIVER_INFO_3|DRIVE_LAYOUT_INFORMATION|Date|DateParse|DateTime|DirEntry|DynArg|EDITSTREAM|EMPTYRECORD|EMR|EMRABORTPATH|EMRANGLEARC|EMRARC|EMRBITBLT|EMRCREATEBRUSHINDIRECT|EMRCREATECOLORSPACE|EMRCREATEDIBPATTERNBRUSHPT|EMRCREATEMONOBRUSH|EMRCREATEPALETTE|EMRCREATEPEN|EMRELLIPSE|EMREOF|EMREXCLUDECLIPRECT|EMREXTCREATEFONTINDIRECTW|EMREXTCREATEPEN|EMREXTFLOODFILL|EMREXTSELECTCLIPRGN|EMREXTTEXTOUTA|EMRFILLPATH|EMRFILLRGN|EMRFORMAT|EMRFRAMERGN|EMRGDICOMMENT|EMRINVERTRGN|EMRLINETO|EMRMASKBLT|EMRMODIFYWORLDTRANSFORM|EMROFFSETCLIPRGN|EMRPLGBLT|EMRPOLYDRAW|EMRPOLYDRAW16|EMRPOLYLINE|EMRPOLYLINE16|EMRPOLYPOLYLINE|EMRPOLYPOLYLINE16|EMRPOLYTEXTOUTA|EMRRESIZEPALETTE|EMRRESTOREDC|EMRROUNDRECT|EMRSCALEVIEWPORTEXTEX|EMRSELECTCLIPPATH|EMRSELECTCOLORSPACE|EMRSELECTOBJECT|EMRSELECTPALETTE|EMRSETARCDIRECTION|EMRSETBKCOLOR|EMRSETCOLORADJUSTMENT|EMRSETDIBITSTODEVICE|EMRSETMAPPERFLAGS|EMRSETMITERLIMIT|EMRSETPALETTEENTRIES|EMRSETPIXELV|EMRSETVIEWPORTEXTEX|EMRSETVIEWPORTORGEX|EMRSETWORLDTRANSFORM|EMRSTRETCHBLT|EMRSTRETCHDIBITS|EMRTEXT|ENCORRECTTEXT|ENDROPFILES|ENHMETAHEADER|ENHMETARECORD|ENOLEOPFAILED|ENPROTECTED|ENSAVECLIPBOARD|ENUMLOGFONT|ENUMLOGFONTEX|ENUM_SERVICE_STATUS|EVENTLOGRECORD|EVENTMSG|EXCEPTION_DEBUG_INFO|EXCEPTION_POINTERS|EXCEPTION_RECORD|EXIT_PROCESS_DEBUG_INFO|EXIT_THREAD_DEBUG_INFO|EXTLOGFONT|EXTLOGPEN|EXT_BUTTON|EmptySlot|EndOfCDRecord|Environment|FILETIME|FILTERKEYS|FINDREPLACE|FINDTEXTEX|FIND_NAME_BUFFER|FIND_NAME_HEADER|FIXED|FLOATING_SAVE_AREA|FMS_GETDRIVEINFO|FMS_GETFILESEL|FMS_LOAD|FMS_TOOLBARLOAD|FOCUS_EVENT_RECORD|FONTSIGNATURE|FORMATRANGE|FORMAT_PARAMETERS|FORM_INFO_1|FileConst|FileHeader|FileRoots|FileSystem|FoldingCaseData|Foo|FtpConnectionDetail|FtpFeature|FtpFileInfo|FtpResponse|GC|GCP_RESULTS|GCStats|GENERIC_MAPPING|GLYPHMETRICS|GLYPHMETRICSFLOAT|GROUP_INFO_2|GUID|HANDLETABLE|HD_HITTESTINFO|HD_ITEM|HD_LAYOUT|HD_NOTIFY|HELPINFO|HELPWININFO|HIGHCONTRAST|HSZPAIR|HeaderElement|HttpConst|HttpHeader|HttpHeaderName|HttpResponses|HttpStatus|HttpToken|ICONINFO|ICONMETRICS|IMAGEINFO|IMAGE_DOS_HEADER|INPUT_RECORD|ITEMIDLIST|IeeeFlags|Interface|JOB_INFO_1|JOB_INFO_2|KERNINGPAIR|LANA_ENUM|LAYERPLANEDESCRIPTOR|LDT_ENTRY|LIST_ENTRY|LOAD_DLL_DEBUG_INFO|LOCALESIGNATURE|LOCALGROUP_INFO_0|LOCALGROUP_MEMBERS_INFO_0|LOCALGROUP_MEMBERS_INFO_3|LOGBRUSH|LOGCOLORSPACE|LOGFONT|LOGFONTA|LOGFONTW|LOGPALETTE|LOGPEN|LUID_AND_ATTRIBUTES|LV_COLUMN|LV_DISPINFO|LV_FINDINFO|LV_HITTESTINFO|LV_ITEM|LV_KEYDOWN|LocalFileHeader|MAT2|MD5_CTX|MDICREATESTRUCT|MEASUREITEMSTRUCT|MEMORYSTATUS|MEMORY_BASIC_INFORMATION|MENUEX_TEMPLATE_HEADER|MENUEX_TEMPLATE_ITEM|MENUITEMINFO|MENUITEMTEMPLATE|MENUITEMTEMPLATEHEADER|MENUTEMPLATE|MENU_EVENT_RECORD|METAFILEPICT|METARECORD|MINIMIZEDMETRICS|MINMAXINFO|MODEMDEVCAPS|MODEMSETTINGS|MONCBSTRUCT|MONCONVSTRUCT|MONERRSTRUCT|MONHSZSTRUCT|MONITOR_INFO_1|MONITOR_INFO_2|MONLINKSTRUCT|MONMSGSTRUCT|MOUSEHOOKSTRUCT|MOUSEKEYS|MOUSE_EVENT_RECORD|MSG|MSGBOXPARAMS|MSGFILTER|MULTIKEYHELP|NAME_BUFFER|NCB|NCCALCSIZE_PARAMS|NDDESHAREINFO|NETCONNECTINFOSTRUCT|NETINFOSTRUCT|NETRESOURCE|NEWCPLINFO|NEWTEXTMETRIC|NEWTEXTMETRICEX|NMHDR|NM_LISTVIEW|NM_TREEVIEW|NM_UPDOWNW|NONCLIENTMETRICS|NS_SERVICE_INFO|NUMBERFMT|OFNOTIFY|OFSTRUCT|OPENFILENAME|OPENFILENAMEA|OPENFILENAMEW|OSVERSIONINFO|OUTLINETEXTMETRIC|OUTPUT_DEBUG_STRING_INFO|OVERLAPPED|OffsetTypeInfo|PAINTSTRUCT|PALETTEENTRY|PANOSE|PARAFORMAT|PARTITION_INFORMATION|PERF_COUNTER_BLOCK|PERF_COUNTER_DEFINITION|PERF_DATA_BLOCK|PERF_INSTANCE_DEFINITION|PERF_OBJECT_TYPE|PIXELFORMATDESCRIPTOR|POINT|POINTFLOAT|POINTFX|POINTL|POINTS|POLYTEXT|PORT_INFO_1|PORT_INFO_2|PREVENT_MEDIA_REMOVAL|PRINTER_DEFAULTS|PRINTER_INFO_1|PRINTER_INFO_2|PRINTER_INFO_3|PRINTER_INFO_4|PRINTER_INFO_5|PRINTER_NOTIFY_INFO|PRINTER_NOTIFY_INFO_DATA|PRINTER_NOTIFY_OPTIONS|PRINTER_NOTIFY_OPTIONS_TYPE|PRINTPROCESSOR_INFO_1|PRIVILEGE_SET|PROCESS_HEAPENTRY|PROCESS_INFORMATION|PROPSHEETHEADER|PROPSHEETHEADER_U1|PROPSHEETHEADER_U2|PROPSHEETHEADER_U3|PROPSHEETPAGE|PROPSHEETPAGE_U1|PROPSHEETPAGE_U2|PROTOCOL_INFO|PROVIDOR_INFO_1|PSHNOTIFY|PUNCTUATION|PassByCopy|PassByRef|Phase1Info|PropertyConfigurator|QUERY_SERVICE_CONFIG|QUERY_SERVICE_LOCK_STATUS|RASAMB|RASCONN|RASCONNSTATUS|RASDIALEXTENSIONS|RASDIALPARAMS|RASENTRYNAME|RASPPPIP|RASPPPIPX|RASPPPNBF|RASTERIZER_STATUS|REASSIGN_BLOCKS|RECT|RECTL|REMOTE_NAME_INFO|REPASTESPECIAL|REQRESIZE|RGBQUAD|RGBTRIPLE|RGNDATA|RGNDATAHEADER|RIP_INFO|Runtime|SCROLLINFO|SECURITY_ATTRIBUTES|SECURITY_DESCRIPTOR|SECURITY_QUALITY_OF_SERVICE|SELCHANGE|SERIALKEYS|SERVICE_ADDRESS|SERVICE_ADDRESSES|SERVICE_INFO|SERVICE_STATUS|SERVICE_TABLE_ENTRY|SERVICE_TYPE_INFO_ABS|SERVICE_TYPE_VALUE_ABS|SESSION_BUFFER|SESSION_HEADER|SET_PARTITION_INFORMATION|SHFILEINFO|SHFILEOPSTRUCT|SHITEMID|SHNAMEMAPPING|SID|SID_AND_ATTRIBUTES|SID_IDENTIFIER_AUTHORITY|SINGLE_LIST_ENTRY|SIZE|SMALL_RECT|SOUNDSENTRY|STARTUPINFO|STICKYKEYS|STRRET|STYLEBUF|STYLESTRUCT|SYSTEMTIME|SYSTEM_AUDIT_ACE|SYSTEM_INFO|SYSTEM_INFO_U|SYSTEM_POWER_STATUS|Signal|SjLj_Function_Context|SpecialCaseData|TAPE_ERASE|TAPE_GET_DRIVE_PARAMETERS|TAPE_GET_MEDIA_PARAMETERS|TAPE_GET_POSITION|TAPE_PREPARE|TAPE_SET_DRIVE_PARAMETERS|TAPE_SET_MEDIA_PARAMETERS|TAPE_SET_POSITION|TAPE_WRITE_MARKS|TBADDBITMAP|TBBUTTON|TBNOTIFY|TBSAVEPARAMS|TCHOOSECOLOR|TCHOOSEFONT|TC_HITTESTINFO|TC_ITEM|TC_ITEMHEADER|TC_KEYDOWN|TEXTMETRIC|TEXTMETRICA|TEXTRANGE|TFINDTEXT|TIME_ZONE_INFORMATION|TOGGLEKEYS|TOKEN_CONTROL|TOKEN_DEFAULT_DACL|TOKEN_GROUPS|TOKEN_OWNER|TOKEN_PRIMARY_GROUP|TOKEN_PRIVILEGES|TOKEN_SOURCE|TOKEN_STATISTICS|TOKEN_USER|TOOLINFO|TOOLTIPTEXT|TPAGESETUPDLG|TPMPARAMS|TRANSMIT_FILE_BUFFERS|TREEITEM|TSMALLPOINT|TTHITTESTINFO|TTPOLYCURVE|TTPOLYGONHEADER|TVARIANT|TV_DISPINFO|TV_HITTESTINFO|TV_INSERTSTRUCT|TV_ITEM|TV_KEYDOWN|TV_SORTCB|Time|TimeOfDay|TimeSpan|Tuple|UDACCEL|ULARGE_INTEGER|UNIVERSAL_NAME_INFO|UNLOAD_DLL_DEBUG_INFO|USEROBJECTFLAGS|USER_INFO_0|USER_INFO_2|USER_INFO_3|UnicodeData|VALENT|VA_LIST|VERIFY_INFORMATION|VS_FIXEDFILEINFO|Variant|VfsFilterInfo|WIN32_FILE_ATTRIBUTE_DATA|WIN32_FIND_DATA|WIN32_FIND_DATAW|WIN32_STREAM_ID|WINDOWINFO|WINDOWPLACEMENT|WINDOWPOS|WINDOW_BUFFER_SIZE_RECORD|WNDCLASS|WNDCLASSA|WNDCLASSEX|WNDCLASSEXA|WSADATA|WallClock|XFORM|ZipEntryInfo)\b + name + support.type.built-ins.structs.d + + support-type-d + + match + \b((?:tango|std)\.[\w\.]+)\b + name + support.type.d + + + scopeName + source.d + uuid + D7C3A109-0466-4C28-9ECF-10753300FF46 + + diff --git a/app/rcc/edbee/syntaxfiles/DOT.tmLanguage b/app/rcc/edbee/syntaxfiles/DOT.tmLanguage new file mode 100644 index 00000000..d9a9c663 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/DOT.tmLanguage @@ -0,0 +1,127 @@ + + + + + fileTypes + + dot + DOT + + foldingStartMarker + \{ + foldingStopMarker + \} + keyEquivalent + ^~G + name + Graphviz (DOT) + patterns + + + match + \b(node|edge|graph|digraph|subgraph|strict)\b + name + storage.type.dot + + + match + \b(bottomlabel|color|comment|distortion|fillcolor|fixedsize|fontcolor|fontname|fontsize|group|height|label|layer|orientation|peripheries|regular|shape|shapefile|sides|skew|style|toplabel|URL|width|z)\b + name + support.constant.attribute.node.dot + + + match + \b(arrowhead|arrowsize|arrowtail|color|comment|constraint|decorate|dir|fontcolor|fontname|fontsize|headlabel|headport|headURL|label|labelangle|labeldistance|labelfloat|labelcolor|labelfontname|labelfontsize|layer|lhead|ltail|minlen|samehead|sametail|style|taillabel|tailport|tailURL|weight)\b + name + support.constant.attribute.edge.dot + + + match + \b(bgcolor|center|clusterrank|color|comment|compound|concentrate|fillcolor|fontname|fontpath|fontsize|label|labeljust|labelloc|layers|margin|mclimit|nodesep|nslimit|nslimit1|ordering|orientation|page|pagedir|quantum|rank|rankdir|ranksep|ratio|remincross|rotate|samplepoints|searchsize|size|style|URL)\b + name + support.constant.attribute.graph.dot + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.dot + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.dot + + + name + string.quoted.double.dot + patterns + + + match + \\. + name + constant.character.escape.dot + + + + + captures + + 1 + + name + punctuation.definition.comment.dot + + + match + (//).*$\n? + name + comment.line.double-slash.dot + + + captures + + 1 + + name + punctuation.definition.comment.dot + + + match + (#).*$\n? + name + comment.line.number-sign.dot + + + begin + /\* + captures + + 0 + + name + punctuation.definition.comment.dot + + + end + \*/ + name + comment.block.dot + + + scopeName + source.dot + uuid + 1A53D54E-6B1D-11D9-A006-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/Diff.tmLanguage b/app/rcc/edbee/syntaxfiles/Diff.tmLanguage new file mode 100644 index 00000000..601dde11 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Diff.tmLanguage @@ -0,0 +1,229 @@ + + + + + fileTypes + + diff + patch + + firstLineMatch + (?x)^ + (===\ modified\ file + |==== \s* // .+ \s - \s .+ \s+ ==== + |Index:[ ] + |---\ [^%] + |\*\*\*.*\d{4}\s*$ + |\d+(,\d+)* (a|d|c) \d+(,\d+)* $ + |diff\ --git[ ] + ) + + foldingStartMarker + ^\+\+\+ + foldingStopMarker + ^---|^$ + keyEquivalent + ^~D + name + Diff + patterns + + + captures + + 1 + + name + punctuation.definition.separator.diff + + + match + ^((\*{15})|(={67})|(-{3}))$\n? + name + meta.separator.diff + + + match + ^\d+(,\d+)*(a|d|c)\d+(,\d+)*$\n? + name + meta.diff.range.normal + + + captures + + 1 + + name + punctuation.definition.range.diff + + 2 + + name + meta.toc-list.line-number.diff + + 3 + + name + punctuation.definition.range.diff + + + match + ^(@@)\s*(.+?)\s*(@@)($\n?)? + name + meta.diff.range.unified + + + captures + + 3 + + name + punctuation.definition.range.diff + + 4 + + name + punctuation.definition.range.diff + + 6 + + name + punctuation.definition.range.diff + + 7 + + name + punctuation.definition.range.diff + + + match + ^(((\-{3}) .+ (\-{4}))|((\*{3}) .+ (\*{4})))$\n? + name + meta.diff.range.context + + + captures + + 4 + + name + punctuation.definition.from-file.diff + + 6 + + name + punctuation.definition.from-file.diff + + 7 + + name + punctuation.definition.from-file.diff + + + match + (^(((-{3}) .+)|((\*{3}) .+))$\n?|^(={4}) .+(?= - )) + name + meta.diff.header.from-file + + + captures + + 2 + + name + punctuation.definition.to-file.diff + + 3 + + name + punctuation.definition.to-file.diff + + 4 + + name + punctuation.definition.to-file.diff + + + match + (^(\+{3}) .+$\n?| (-) .* (={4})$\n?) + name + meta.diff.header.to-file + + + captures + + 3 + + name + punctuation.definition.inserted.diff + + 6 + + name + punctuation.definition.inserted.diff + + + match + ^(((>)( .*)?)|((\+).*))$\n? + name + markup.inserted.diff + + + captures + + 1 + + name + punctuation.definition.inserted.diff + + + match + ^(!).*$\n? + name + markup.changed.diff + + + captures + + 3 + + name + punctuation.definition.inserted.diff + + 6 + + name + punctuation.definition.inserted.diff + + + match + ^(((<)( .*)?)|((-).*))$\n? + name + markup.deleted.diff + + + captures + + 1 + + name + punctuation.separator.key-value.diff + + 2 + + name + meta.toc-list.file-name.diff + + + match + ^Index(:) (.+)$\n? + name + meta.diff.index + + + scopeName + source.diff + uuid + 7E848FF4-708E-11D9-97B4-0011242E4184 + + diff --git a/app/rcc/edbee/syntaxfiles/Doxyfile.tmLanguage b/app/rcc/edbee/syntaxfiles/Doxyfile.tmLanguage new file mode 100755 index 00000000..cf0e7779 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Doxyfile.tmLanguage @@ -0,0 +1,70 @@ + + + + + fileTypes + + Doxyfile + + name + Doxygen configuration file + patterns + + + match + \b(ABBREVIATE_BRIEF|ALIASES|ALLEXTERNALS|ALLOW_UNICODE_NAMES|ALPHABETICAL_INDEX|ALWAYS_DETAILED_SEC|AUTOLINK_SUPPORT|BINARY_TOC|BRIEF_MEMBER_DESC|BUILTIN_STL_SUPPORT|CALLER_GRAPH|CALL_GRAPH|CASE_SENSE_NAMES|CHM_FILE|CHM_INDEX_ENCODING|CITE_BIB_FILES|CLANG_ASSISTED_PARSING|CLANG_OPTIONS|CLASS_DIAGRAMS|CLASS_GRAPH|COLLABORATION_GRAPH|COLS_IN_ALPHA_INDEX|COMPACT_LATEX|COMPACT_RTF|CPP_CLI_SUPPORT|CREATE_SUBDIRS|DIAFILE_DIRS|DIA_PATH|DIRECTORY_GRAPH|DISABLE_INDEX|DISTRIBUTE_GROUP_DOC|DOCBOOK_OUTPUT|DOCBOOK_PROGRAMLISTING|DOCSET_BUNDLE_ID|DOCSET_FEEDNAME|DOCSET_PUBLISHER_ID|DOCSET_PUBLISHER_NAME|DOTFILE_DIRS|DOT_CLEANUP|DOT_FONTNAME|DOT_FONTPATH|DOT_FONTSIZE|DOT_GRAPH_MAX_NODES|DOT_IMAGE_FORMAT|DOT_MULTI_TARGETS|DOT_NUM_THREADS|DOT_PATH|DOT_TRANSPARENT|DOXYFILE_ENCODING|ECLIPSE_DOC_ID|ENABLED_SECTIONS|ENABLE_PREPROCESSING|ENUM_VALUES_PER_LINE|EXAMPLE_PATH|EXAMPLE_PATTERNS|EXAMPLE_RECURSIVE|EXCLUDE|EXCLUDE_PATTERNS|EXCLUDE_SYMBOLS|EXCLUDE_SYMLINKS|EXPAND_AS_DEFINED|EXPAND_ONLY_PREDEF|EXTENSION_MAPPING|EXTERNAL_GROUPS|EXTERNAL_PAGES|EXTERNAL_SEARCH|EXTERNAL_SEARCH_ID|EXTRACT_ALL|EXTRACT_ANON_NSPACES|EXTRACT_LOCAL_CLASSES|EXTRACT_LOCAL_METHODS|EXTRACT_PACKAGE|EXTRACT_PRIVATE|EXTRACT_STATIC|EXTRA_PACKAGES|EXTRA_SEARCH_MAPPINGS|EXT_LINKS_IN_WINDOW|FILE_PATTERNS|FILE_VERSION_FILTER|FILTER_PATTERNS|FILTER_SOURCE_FILES|FILTER_SOURCE_PATTERNS|FORCE_LOCAL_INCLUDES|FORMULA_FONTSIZE|FORMULA_TRANSPARENT|FULL_PATH_NAMES|GENERATE_AUTOGEN_DEF|GENERATE_BUGLIST|GENERATE_CHI|GENERATE_DEPRECATEDLIST|GENERATE_DOCBOOK|GENERATE_DOCSET|GENERATE_ECLIPSEHELP|GENERATE_HTML|GENERATE_HTMLHELP|GENERATE_LATEX|GENERATE_LEGEND|GENERATE_MAN|GENERATE_PERLMOD|GENERATE_QHP|GENERATE_RTF|GENERATE_TAGFILE|GENERATE_TESTLIST|GENERATE_TODOLIST|GENERATE_TREEVIEW|GENERATE_XML|GRAPHICAL_HIERARCHY|GROUP_GRAPHS|GROUP_NESTED_COMPOUNDS|HAVE_DOT|HHC_LOCATION|HIDE_COMPOUND_REFERENCE|HIDE_FRIEND_COMPOUNDS|HIDE_IN_BODY_DOCS|HIDE_SCOPE_NAMES|HIDE_UNDOC_CLASSES|HIDE_UNDOC_MEMBERS|HIDE_UNDOC_RELATIONS|HTML_COLORSTYLE_GAMMA|HTML_COLORSTYLE_HUE|HTML_COLORSTYLE_SAT|HTML_DYNAMIC_SECTIONS|HTML_EXTRA_FILES|HTML_EXTRA_STYLESHEET|HTML_FILE_EXTENSION|HTML_FOOTER|HTML_HEADER|HTML_INDEX_NUM_ENTRIES|HTML_OUTPUT|HTML_STYLESHEET|HTML_TIMESTAMP|IDL_PROPERTY_SUPPORT|IGNORE_PREFIX|IMAGE_PATH|INCLUDED_BY_GRAPH|INCLUDE_FILE_PATTERNS|INCLUDE_GRAPH|INCLUDE_PATH|INHERIT_DOCS|INLINE_GROUPED_CLASSES|INLINE_INFO|INLINE_INHERITED_MEMB|INLINE_SIMPLE_STRUCTS|INLINE_SOURCES|INPUT|INPUT_ENCODING|INPUT_FILTER|INTERACTIVE_SVG|INTERNAL_DOCS|JAVADOC_AUTOBRIEF|LATEX_BATCHMODE|LATEX_BIB_STYLE|LATEX_CMD_NAME|LATEX_EXTRA_FILES|LATEX_EXTRA_STYLESHEET|LATEX_FOOTER|LATEX_HEADER|LATEX_HIDE_INDICES|LATEX_OUTPUT|LATEX_SOURCE_CODE|LATEX_TIMESTAMP|LAYOUT_FILE|LOOKUP_CACHE_SIZE|MACRO_EXPANSION|MAKEINDEX_CMD_NAME|MAN_EXTENSION|MAN_LINKS|MAN_OUTPUT|MAN_SUBDIR|MARKDOWN_SUPPORT|MATHJAX_CODEFILE|MATHJAX_EXTENSIONS|MATHJAX_FORMAT|MATHJAX_RELPATH|MAX_DOT_GRAPH_DEPTH|MAX_INITIALIZER_LINES|MSCFILE_DIRS|MSCGEN_PATH|MULTILINE_CPP_IS_BRIEF|OPTIMIZE_FOR_FORTRAN|OPTIMIZE_OUTPUT_FOR_C|OPTIMIZE_OUTPUT_JAVA|OPTIMIZE_OUTPUT_VHDL|OUTPUT_DIRECTORY|OUTPUT_LANGUAGE|PAPER_TYPE|PDF_HYPERLINKS|PERLMOD_LATEX|PERLMOD_MAKEVAR_PREFIX|PERLMOD_PRETTY|PERL_PATH|PLANTUML_INCLUDE_PATH|PLANTUML_JAR_PATH|PREDEFINED|PROJECT_BRIEF|PROJECT_LOGO|PROJECT_NAME|PROJECT_NUMBER|QCH_FILE|QHG_LOCATION|QHP_CUST_FILTER_ATTRS|QHP_CUST_FILTER_NAME|QHP_NAMESPACE|QHP_SECT_FILTER_ATTRS|QHP_VIRTUAL_FOLDER|QT_AUTOBRIEF|QUIET|RECURSIVE|REFERENCED_BY_RELATION|REFERENCES_LINK_SOURCE|REFERENCES_RELATION|REPEAT_BRIEF|RTF_EXTENSIONS_FILE|RTF_HYPERLINKS|RTF_OUTPUT|RTF_SOURCE_CODE|RTF_STYLESHEET_FILE|SEARCHDATA_FILE|SEARCHENGINE|SEARCHENGINE_URL|SEARCH_INCLUDES|SEPARATE_MEMBER_PAGES|SERVER_BASED_SEARCH|SHORT_NAMES|SHOW_FILES|SHOW_GROUPED_MEMB_INC|SHOW_INCLUDE_FILES|SHOW_NAMESPACES|SHOW_USED_FILES|SIP_SUPPORT|SKIP_FUNCTION_MACROS|SORT_BRIEF_DOCS|SORT_BY_SCOPE_NAME|SORT_GROUP_NAMES|SORT_MEMBERS_CTORS_1ST|SORT_MEMBER_DOCS|SOURCE_BROWSER|SOURCE_TOOLTIPS|STRICT_PROTO_MATCHING|STRIP_CODE_COMMENTS|STRIP_FROM_INC_PATH|STRIP_FROM_PATH|SUBGROUPING|TAB_SIZE|TAGFILES|TCL_SUBST|TEMPLATE_RELATIONS|TOC_EXPAND|TREEVIEW_WIDTH|TYPEDEF_HIDES_STRUCT|UML_LIMIT_NUM_FIELDS|UML_LOOK|USE_HTAGS|USE_MATHJAX|USE_MDFILE_AS_MAINPAGE|USE_PDFLATEX|VERBATIM_HEADERS|WARNINGS|WARN_AS_ERROR|WARN_FORMAT|WARN_IF_DOC_ERROR|WARN_IF_UNDOCUMENTED|WARN_LOGFILE|WARN_NO_PARAMDOC|XML_OUTPUT|XML_PROGRAMLISTING)\b + name + keyword.control.dox + + + match + \b(YES|NO)\b + name + storage.type.dox + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.dox + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.dox + + + name + string.quoted.double.dox + + + + captures + + 1 + + name + punctuation.definition.comment.dox + + + match + (#).*$\n? + name + comment.line.sign.dox + + + scopeName + source.dox + uuid + 1A53D54E-6B1D-11D9-A006-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/Erlang.tmLanguage b/app/rcc/edbee/syntaxfiles/Erlang.tmLanguage new file mode 100644 index 00000000..ceb3b639 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Erlang.tmLanguage @@ -0,0 +1,2562 @@ + + + + + comment + The recognition of function definitions and compiler directives (such as module, record and macro definitions) requires that each of the aforementioned constructs must be the first string inside a line (except for whitespace). Also, the function/module/record/macro names must be given unquoted. -- desp + fileTypes + + erl + hrl + Emakefile + emakefile + + keyEquivalent + ^~E + name + Erlang + patterns + + + include + #module-directive + + + include + #import-export-directive + + + include + #record-directive + + + include + #define-directive + + + include + #macro-directive + + + include + #directive + + + include + #function + + + include + #everything-else + + + repository + + atom + + patterns + + + begin + (') + beginCaptures + + 1 + + name + punctuation.definition.symbol.begin.erlang + + + end + (') + endCaptures + + 1 + + name + punctuation.definition.symbol.end.erlang + + + name + constant.other.symbol.quoted.single.erlang + patterns + + + captures + + 1 + + name + punctuation.definition.escape.erlang + + 3 + + name + punctuation.definition.escape.erlang + + + match + (\\)([bdefnrstv\\'"]|(\^)[@-_]|[0-7]{1,3}) + name + constant.other.symbol.escape.erlang + + + match + \\\^?.? + name + invalid.illegal.atom.erlang + + + + + match + [a-z][a-zA-Z\d@_]*+ + name + constant.other.symbol.unquoted.erlang + + + + binary + + begin + (<<) + beginCaptures + + 1 + + name + punctuation.definition.binary.begin.erlang + + + end + (>>) + endCaptures + + 1 + + name + punctuation.definition.binary.end.erlang + + + name + meta.structure.binary.erlang + patterns + + + captures + + 1 + + name + punctuation.separator.binary.erlang + + 2 + + name + punctuation.separator.value-size.erlang + + + match + (,)|(:) + + + include + #internal-type-specifiers + + + include + #everything-else + + + + character + + patterns + + + captures + + 1 + + name + punctuation.definition.character.erlang + + 2 + + name + constant.character.escape.erlang + + 3 + + name + punctuation.definition.escape.erlang + + 5 + + name + punctuation.definition.escape.erlang + + + match + (\$)((\\)([bdefnrstv\\'"]|(\^)[@-_]|[0-7]{1,3})) + name + constant.character.erlang + + + match + \$\\\^?.? + name + invalid.illegal.character.erlang + + + captures + + 1 + + name + punctuation.definition.character.erlang + + + match + (\$)\S + name + constant.character.erlang + + + match + \$.? + name + invalid.illegal.character.erlang + + + + comment + + begin + (%) + beginCaptures + + 1 + + name + punctuation.definition.comment.erlang + + + end + $\n? + name + comment.line.erlang + + define-directive + + patterns + + + begin + ^\s*+(-)\s*+(define)\s*+(\()\s*+([a-zA-Z\d@_]++)\s*+(,) + beginCaptures + + 1 + + name + punctuation.section.directive.begin.erlang + + 2 + + name + keyword.control.directive.define.erlang + + 3 + + name + punctuation.definition.parameters.begin.erlang + + 4 + + name + entity.name.function.macro.definition.erlang + + 5 + + name + punctuation.separator.parameters.erlang + + + end + (\))\s*+(\.) + endCaptures + + 1 + + name + punctuation.definition.parameters.end.erlang + + 2 + + name + punctuation.section.directive.end.erlang + + + name + meta.directive.define.erlang + patterns + + + include + #everything-else + + + + + begin + (?=^\s*+-\s*+define\s*+\(\s*+[a-zA-Z\d@_]++\s*+\() + end + (\))\s*+(\.) + endCaptures + + 1 + + name + punctuation.definition.parameters.end.erlang + + 2 + + name + punctuation.section.directive.end.erlang + + + name + meta.directive.define.erlang + patterns + + + begin + ^\s*+(-)\s*+(define)\s*+(\()\s*+([a-zA-Z\d@_]++)\s*+(\() + beginCaptures + + 1 + + name + punctuation.section.directive.begin.erlang + + 2 + + name + keyword.control.directive.define.erlang + + 3 + + name + punctuation.definition.parameters.begin.erlang + + 4 + + name + entity.name.function.macro.definition.erlang + + 5 + + name + punctuation.definition.parameters.begin.erlang + + + end + (\))\s*(,) + endCaptures + + 1 + + name + punctuation.definition.parameters.end.erlang + + 2 + + name + punctuation.separator.parameters.erlang + + + patterns + + + match + , + name + punctuation.separator.parameters.erlang + + + include + #everything-else + + + + + match + \|\||\||:|;|,|\.|-> + name + punctuation.separator.define.erlang + + + include + #everything-else + + + + + + directive + + patterns + + + begin + ^\s*+(-)\s*+([a-z][a-zA-Z\d@_]*+)\s*+(\() + beginCaptures + + 1 + + name + punctuation.section.directive.begin.erlang + + 2 + + name + keyword.control.directive.erlang + + 3 + + name + punctuation.definition.parameters.begin.erlang + + + end + (\))\s*+(\.) + endCaptures + + 1 + + name + punctuation.definition.parameters.end.erlang + + 2 + + name + punctuation.section.directive.end.erlang + + + name + meta.directive.erlang + patterns + + + include + #everything-else + + + + + captures + + 1 + + name + punctuation.section.directive.begin.erlang + + 2 + + name + keyword.control.directive.erlang + + 3 + + name + punctuation.section.directive.end.erlang + + + match + ^\s*+(-)\s*+([a-z][a-zA-Z\d@_]*+)\s*+(\.) + name + meta.directive.erlang + + + + everything-else + + patterns + + + include + #comment + + + include + #record-usage + + + include + #macro-usage + + + include + #expression + + + include + #keyword + + + include + #textual-operator + + + include + #function-call + + + include + #tuple + + + include + #list + + + include + #binary + + + include + #parenthesized-expression + + + include + #character + + + include + #number + + + include + #atom + + + include + #string + + + include + #symbolic-operator + + + include + #variable + + + + expression + + patterns + + + begin + \b(if)\b + beginCaptures + + 1 + + name + keyword.control.if.erlang + + + end + \b(end)\b + endCaptures + + 1 + + name + keyword.control.end.erlang + + + name + meta.expression.if.erlang + patterns + + + include + #internal-expression-punctuation + + + include + #everything-else + + + + + begin + \b(case)\b + beginCaptures + + 1 + + name + keyword.control.case.erlang + + + end + \b(end)\b + endCaptures + + 1 + + name + keyword.control.end.erlang + + + name + meta.expression.case.erlang + patterns + + + include + #internal-expression-punctuation + + + include + #everything-else + + + + + begin + \b(receive)\b + beginCaptures + + 1 + + name + keyword.control.receive.erlang + + + end + \b(end)\b + endCaptures + + 1 + + name + keyword.control.end.erlang + + + name + meta.expression.receive.erlang + patterns + + + include + #internal-expression-punctuation + + + include + #everything-else + + + + + captures + + 1 + + name + keyword.control.fun.erlang + + 3 + + name + entity.name.type.class.module.erlang + + 4 + + name + punctuation.separator.module-function.erlang + + 5 + + name + entity.name.function.erlang + + 6 + + name + punctuation.separator.function-arity.erlang + + + match + \b(fun)\s*+(([a-z][a-zA-Z\d@_]*+)\s*+(:)\s*+)?([a-z][a-zA-Z\d@_]*+)\s*(/) + + + begin + \b(fun)\b + beginCaptures + + 1 + + name + keyword.control.fun.erlang + + + end + \b(end)\b + endCaptures + + 1 + + name + keyword.control.end.erlang + + + name + meta.expression.fun.erlang + patterns + + + begin + (?=\() + end + (;)|(?=\bend\b) + endCaptures + + 1 + + name + punctuation.separator.clauses.erlang + + + patterns + + + include + #internal-function-parts + + + + + include + #everything-else + + + + + begin + \b(try)\b + beginCaptures + + 1 + + name + keyword.control.try.erlang + + + end + \b(end)\b + endCaptures + + 1 + + name + keyword.control.end.erlang + + + name + meta.expression.try.erlang + patterns + + + include + #internal-expression-punctuation + + + include + #everything-else + + + + + begin + \b(begin)\b + beginCaptures + + 1 + + name + keyword.control.begin.erlang + + + end + \b(end)\b + endCaptures + + 1 + + name + keyword.control.end.erlang + + + name + meta.expression.begin.erlang + patterns + + + include + #internal-expression-punctuation + + + include + #everything-else + + + + + begin + \b(query)\b + beginCaptures + + 1 + + name + keyword.control.query.erlang + + + end + \b(end)\b + endCaptures + + 1 + + name + keyword.control.end.erlang + + + name + meta.expression.query.erlang + patterns + + + include + #everything-else + + + + + + function + + begin + ^\s*+([a-z][a-zA-Z\d@_]*+)\s*+(?=\() + beginCaptures + + 1 + + name + entity.name.function.definition.erlang + + + end + (\.) + endCaptures + + 1 + + name + punctuation.terminator.function.erlang + + + name + meta.function.erlang + patterns + + + captures + + 1 + + name + entity.name.function.erlang + + + match + ^\s*+([a-z][a-zA-Z\d@_]*+)\s*+(?=\() + + + begin + (?=\() + end + (;)|(?=\.) + endCaptures + + 1 + + name + punctuation.separator.clauses.erlang + + + patterns + + + include + #parenthesized-expression + + + include + #internal-function-parts + + + + + include + #everything-else + + + + function-call + + begin + (?=[a-z][a-zA-Z\d@_]*+\s*+(\(|:\s*+[a-z][a-zA-Z\d@_]*+\s*+\()) + end + (\)) + endCaptures + + 1 + + name + punctuation.definition.parameters.end.erlang + + + name + meta.function-call.erlang + patterns + + + begin + ((erlang)\s*+(:)\s*+)?(is_atom|is_binary|is_constant|is_float|is_function|is_integer|is_list|is_number|is_pid|is_port|is_reference|is_tuple|is_record|abs|element|hd|length|node|round|self|size|tl|trunc)\s*+(\() + beginCaptures + + 2 + + name + entity.name.type.class.module.erlang + + 3 + + name + punctuation.separator.module-function.erlang + + 4 + + name + entity.name.function.guard.erlang + + 5 + + name + punctuation.definition.parameters.begin.erlang + + + end + (?=\)) + patterns + + + match + , + name + punctuation.separator.parameters.erlang + + + include + #everything-else + + + + + begin + (([a-z][a-zA-Z\d@_]*+)\s*+(:)\s*+)?([a-z][a-zA-Z\d@_]*+)\s*+(\() + beginCaptures + + 2 + + name + entity.name.type.class.module.erlang + + 3 + + name + punctuation.separator.module-function.erlang + + 4 + + name + entity.name.function.erlang + + 5 + + name + punctuation.definition.parameters.begin.erlang + + + end + (?=\)) + patterns + + + match + , + name + punctuation.separator.parameters.erlang + + + include + #everything-else + + + + + + import-export-directive + + patterns + + + begin + ^\s*+(-)\s*+(import)\s*+(\()\s*+([a-z][a-zA-Z\d@_]*+)\s*+(,) + beginCaptures + + 1 + + name + punctuation.section.directive.begin.erlang + + 2 + + name + keyword.control.directive.import.erlang + + 3 + + name + punctuation.definition.parameters.begin.erlang + + 4 + + name + entity.name.type.class.module.erlang + + 5 + + name + punctuation.separator.parameters.erlang + + + end + (\))\s*+(\.) + endCaptures + + 1 + + name + punctuation.definition.parameters.end.erlang + + 2 + + name + punctuation.section.directive.end.erlang + + + name + meta.directive.import.erlang + patterns + + + include + #internal-function-list + + + + + begin + ^\s*+(-)\s*+(export)\s*+(\() + beginCaptures + + 1 + + name + punctuation.section.directive.begin.erlang + + 2 + + name + keyword.control.directive.export.erlang + + 3 + + name + punctuation.definition.parameters.begin.erlang + + + end + (\))\s*+(\.) + endCaptures + + 1 + + name + punctuation.definition.parameters.end.erlang + + 2 + + name + punctuation.section.directive.end.erlang + + + name + meta.directive.export.erlang + patterns + + + include + #internal-function-list + + + + + + internal-expression-punctuation + + captures + + 1 + + name + punctuation.separator.clause-head-body.erlang + + 2 + + name + punctuation.separator.clauses.erlang + + 3 + + name + punctuation.separator.expressions.erlang + + + match + (->)|(;)|(,) + + internal-function-list + + begin + (\[) + beginCaptures + + 1 + + name + punctuation.definition.list.begin.erlang + + + end + (\]) + endCaptures + + 1 + + name + punctuation.definition.list.end.erlang + + + name + meta.structure.list.function.erlang + patterns + + + begin + ([a-z][a-zA-Z\d@_]*+)\s*+(/) + beginCaptures + + 1 + + name + entity.name.function.erlang + + 2 + + name + punctuation.separator.function-arity.erlang + + + end + (,)|(?=\]) + endCaptures + + 1 + + name + punctuation.separator.list.erlang + + + patterns + + + include + #everything-else + + + + + include + #everything-else + + + + internal-function-parts + + patterns + + + begin + (?=\() + end + (->) + endCaptures + + 1 + + name + punctuation.separator.clause-head-body.erlang + + + patterns + + + begin + (\() + beginCaptures + + 1 + + name + punctuation.definition.parameters.begin.erlang + + + end + (\)) + endCaptures + + 1 + + name + punctuation.definition.parameters.end.erlang + + + patterns + + + match + , + name + punctuation.separator.parameters.erlang + + + include + #everything-else + + + + + match + ,|; + name + punctuation.separator.guards.erlang + + + include + #everything-else + + + + + match + , + name + punctuation.separator.expressions.erlang + + + include + #everything-else + + + + internal-record-body + + begin + (\{) + beginCaptures + + 1 + + name + punctuation.definition.class.record.begin.erlang + + + end + (?=\}) + name + meta.structure.record.erlang + patterns + + + begin + (([a-z][a-zA-Z\d@_]*+)|(_))\s*+(=) + beginCaptures + + 2 + + name + variable.other.field.erlang + + 3 + + name + variable.language.omitted.field.erlang + + 4 + + name + keyword.operator.assignment.erlang + + + end + (,)|(?=\}) + endCaptures + + 1 + + name + punctuation.separator.class.record.erlang + + + patterns + + + include + #everything-else + + + + + captures + + 1 + + name + variable.other.field.erlang + + 2 + + name + punctuation.separator.class.record.erlang + + + match + ([a-z][a-zA-Z\d@_]*+)\s*+(,)? + + + include + #everything-else + + + + internal-type-specifiers + + begin + (/) + beginCaptures + + 1 + + name + punctuation.separator.value-type.erlang + + + end + (?=,|:|>>) + patterns + + + captures + + 1 + + name + storage.type.erlang + + 2 + + name + storage.modifier.signedness.erlang + + 3 + + name + storage.modifier.endianness.erlang + + 4 + + name + storage.modifier.unit.erlang + + 5 + + name + punctuation.separator.type-specifiers.erlang + + + match + (integer|float|binary)|(signed|unsigned)|(big|little|native)|(unit)|(-) + + + + keyword + + match + \b(after|begin|case|catch|cond|end|fun|if|let|of|query|try|receive|when)\b + name + keyword.control.erlang + + list + + begin + (\[) + beginCaptures + + 1 + + name + punctuation.definition.list.begin.erlang + + + end + (\]) + endCaptures + + 1 + + name + punctuation.definition.list.end.erlang + + + name + meta.structure.list.erlang + patterns + + + match + \||\|\||, + name + punctuation.separator.list.erlang + + + include + #everything-else + + + + macro-directive + + patterns + + + captures + + 1 + + name + punctuation.section.directive.begin.erlang + + 2 + + name + keyword.control.directive.ifdef.erlang + + 3 + + name + punctuation.definition.parameters.begin.erlang + + 4 + + name + entity.name.function.macro.erlang + + 5 + + name + punctuation.definition.parameters.end.erlang + + 6 + + name + punctuation.section.directive.end.erlang + + + match + ^\s*+(-)\s*+(ifdef)\s*+(\()\s*+([a-zA-z\d@_]++)\s*+(\))\s*+(\.) + name + meta.directive.ifdef.erlang + + + captures + + 1 + + name + punctuation.section.directive.begin.erlang + + 2 + + name + keyword.control.directive.ifndef.erlang + + 3 + + name + punctuation.definition.parameters.begin.erlang + + 4 + + name + entity.name.function.macro.erlang + + 5 + + name + punctuation.definition.parameters.end.erlang + + 6 + + name + punctuation.section.directive.end.erlang + + + match + ^\s*+(-)\s*+(ifndef)\s*+(\()\s*+([a-zA-z\d@_]++)\s*+(\))\s*+(\.) + name + meta.directive.ifndef.erlang + + + captures + + 1 + + name + punctuation.section.directive.begin.erlang + + 2 + + name + keyword.control.directive.undef.erlang + + 3 + + name + punctuation.definition.parameters.begin.erlang + + 4 + + name + entity.name.function.macro.erlang + + 5 + + name + punctuation.definition.parameters.end.erlang + + 6 + + name + punctuation.section.directive.end.erlang + + + match + ^\s*+(-)\s*+(undef)\s*+(\()\s*+([a-zA-z\d@_]++)\s*+(\))\s*+(\.) + name + meta.directive.undef.erlang + + + + macro-usage + + captures + + 1 + + name + keyword.operator.macro.erlang + + 2 + + name + entity.name.function.macro.erlang + + + match + (\?\??)\s*+([a-zA-Z\d@_]++) + name + meta.macro-usage.erlang + + module-directive + + captures + + 1 + + name + punctuation.section.directive.begin.erlang + + 2 + + name + keyword.control.directive.module.erlang + + 3 + + name + punctuation.definition.parameters.begin.erlang + + 4 + + name + entity.name.type.class.module.definition.erlang + + 5 + + name + punctuation.definition.parameters.end.erlang + + 6 + + name + punctuation.section.directive.end.erlang + + + match + ^\s*+(-)\s*+(module)\s*+(\()\s*+([a-z][a-zA-Z\d@_]*+)\s*+(\))\s*+(\.) + name + meta.directive.module.erlang + + number + + begin + (?=\d) + end + (?!\d) + patterns + + + captures + + 1 + + name + punctuation.separator.integer-float.erlang + + 3 + + name + punctuation.separator.float-exponent.erlang + + + match + \d++(\.)\d++(([eE][\+\-])?\d++)? + name + constant.numeric.float.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 2(#)[0-1]++ + name + constant.numeric.integer.binary.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 3(#)[0-2]++ + name + constant.numeric.integer.base-3.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 4(#)[0-3]++ + name + constant.numeric.integer.base-4.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 5(#)[0-4]++ + name + constant.numeric.integer.base-5.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 6(#)[0-5]++ + name + constant.numeric.integer.base-6.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 7(#)[0-6]++ + name + constant.numeric.integer.base-7.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 8(#)[0-7]++ + name + constant.numeric.integer.octal.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 9(#)[0-8]++ + name + constant.numeric.integer.base-9.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 10(#)\d++ + name + constant.numeric.integer.decimal.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 11(#)[\daA]++ + name + constant.numeric.integer.base-11.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 12(#)[\da-bA-B]++ + name + constant.numeric.integer.base-12.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 13(#)[\da-cA-C]++ + name + constant.numeric.integer.base-13.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 14(#)[\da-dA-D]++ + name + constant.numeric.integer.base-14.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 15(#)[\da-eA-E]++ + name + constant.numeric.integer.base-15.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 16(#)\h++ + name + constant.numeric.integer.hexadecimal.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 17(#)[\da-gA-G]++ + name + constant.numeric.integer.base-17.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 18(#)[\da-hA-H]++ + name + constant.numeric.integer.base-18.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 19(#)[\da-iA-I]++ + name + constant.numeric.integer.base-19.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 20(#)[\da-jA-J]++ + name + constant.numeric.integer.base-20.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 21(#)[\da-kA-K]++ + name + constant.numeric.integer.base-21.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 22(#)[\da-lA-L]++ + name + constant.numeric.integer.base-22.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 23(#)[\da-mA-M]++ + name + constant.numeric.integer.base-23.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 24(#)[\da-nA-N]++ + name + constant.numeric.integer.base-24.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 25(#)[\da-oA-O]++ + name + constant.numeric.integer.base-25.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 26(#)[\da-pA-P]++ + name + constant.numeric.integer.base-26.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 27(#)[\da-qA-Q]++ + name + constant.numeric.integer.base-27.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 28(#)[\da-rA-R]++ + name + constant.numeric.integer.base-28.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 29(#)[\da-sA-S]++ + name + constant.numeric.integer.base-29.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 30(#)[\da-tA-T]++ + name + constant.numeric.integer.base-30.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 31(#)[\da-uA-U]++ + name + constant.numeric.integer.base-31.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 32(#)[\da-vA-V]++ + name + constant.numeric.integer.base-32.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 33(#)[\da-wA-W]++ + name + constant.numeric.integer.base-33.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 34(#)[\da-xA-X]++ + name + constant.numeric.integer.base-34.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 35(#)[\da-yA-Y]++ + name + constant.numeric.integer.base-35.erlang + + + captures + + 1 + + name + punctuation.separator.base-integer.erlang + + + match + 36(#)[\da-zA-Z]++ + name + constant.numeric.integer.base-36.erlang + + + match + \d++#[\da-zA-Z]++ + name + invalid.illegal.integer.erlang + + + match + \d++ + name + constant.numeric.integer.decimal.erlang + + + + parenthesized-expression + + begin + (\() + beginCaptures + + 1 + + name + punctuation.section.expression.begin.erlang + + + end + (\)) + endCaptures + + 1 + + name + punctuation.section.expression.end.erlang + + + name + meta.expression.parenthesized + patterns + + + include + #everything-else + + + + record-directive + + begin + ^\s*+(-)\s*+(record)\s*+(\()\s*+([a-z][a-zA-Z\d@_]*+)\s*+(,) + beginCaptures + + 1 + + name + punctuation.section.directive.begin.erlang + + 2 + + name + keyword.control.directive.import.erlang + + 3 + + name + punctuation.definition.parameters.begin.erlang + + 4 + + name + entity.name.type.class.record.definition.erlang + + 5 + + name + punctuation.separator.parameters.erlang + + + end + ((\}))\s*+(\))\s*+(\.) + endCaptures + + 1 + + name + meta.structure.record.erlang + + 2 + + name + punctuation.definition.class.record.end.erlang + + 3 + + name + punctuation.definition.parameters.end.erlang + + 4 + + name + punctuation.section.directive.end.erlang + + + name + meta.directive.record.erlang + patterns + + + include + #internal-record-body + + + + record-usage + + patterns + + + captures + + 1 + + name + keyword.operator.record.erlang + + 2 + + name + entity.name.type.class.record.erlang + + 3 + + name + punctuation.separator.record-field.erlang + + 4 + + name + variable.other.field.erlang + + + match + (#)\s*+([a-z][a-zA-Z\d@_]*+)\s*+(\.)\s*+([a-z][a-zA-Z\d@_]*+) + name + meta.record-usage.erlang + + + begin + (#)\s*+([a-z][a-zA-Z\d@_]*+) + beginCaptures + + 1 + + name + keyword.operator.record.erlang + + 2 + + name + entity.name.type.class.record.erlang + + + end + ((\})) + endCaptures + + 1 + + name + meta.structure.record.erlang + + 2 + + name + punctuation.definition.class.record.end.erlang + + + name + meta.record-usage.erlang + patterns + + + include + #internal-record-body + + + + + + string + + begin + (") + beginCaptures + + 1 + + name + punctuation.definition.string.begin.erlang + + + end + (") + endCaptures + + 1 + + name + punctuation.definition.string.end.erlang + + + name + string.quoted.double.erlang + patterns + + + captures + + 1 + + name + punctuation.definition.escape.erlang + + 3 + + name + punctuation.definition.escape.erlang + + + match + (\\)([bdefnrstv\\'"]|(\^)[@-_]|[0-7]{1,3}) + name + constant.character.escape.erlang + + + match + \\\^?.? + name + invalid.illegal.string.erlang + + + captures + + 1 + + name + punctuation.definition.placeholder.erlang + + 10 + + name + punctuation.separator.placeholder-parts.erlang + + 12 + + name + punctuation.separator.placeholder-parts.erlang + + 3 + + name + punctuation.separator.placeholder-parts.erlang + + 4 + + name + punctuation.separator.placeholder-parts.erlang + + 6 + + name + punctuation.separator.placeholder-parts.erlang + + 8 + + name + punctuation.separator.placeholder-parts.erlang + + + match + (~)((\-)?\d++|(\*))?((\.)(\d++|(\*)))?((\.)((\*)|.))?[~cfegswpWPBX#bx\+ni] + name + constant.other.placeholder.erlang + + + captures + + 1 + + name + punctuation.definition.placeholder.erlang + + 2 + + name + punctuation.separator.placeholder-parts.erlang + + + match + (~)(\*)?(\d++)?[~du\-#fsacl] + name + constant.other.placeholder.erlang + + + match + ~.? + name + invalid.illegal.string.erlang + + + + symbolic-operator + + match + \+\+|\+|--|-|\*|/=|/|=/=|=:=|==|=<|=|<-|<|>=|>|! + name + keyword.operator.symbolic.erlang + + textual-operator + + match + \b(andalso|band|and|bxor|xor|bor|orelse|or|bnot|not|bsl|bsr|div|rem)\b + name + keyword.operator.textual.erlang + + tuple + + begin + (\{) + beginCaptures + + 1 + + name + punctuation.definition.tuple.begin.erlang + + + end + (\}) + endCaptures + + 1 + + name + punctuation.definition.tuple.end.erlang + + + name + meta.structure.tuple.erlang + patterns + + + match + , + name + punctuation.separator.tuple.erlang + + + include + #everything-else + + + + variable + + captures + + 1 + + name + variable.other.erlang + + 2 + + name + variable.language.omitted.erlang + + + match + (_[a-zA-Z\d@_]++|[A-Z][a-zA-Z\d@_]*+)|(_) + + + scopeName + source.erlang + uuid + 58EA597D-5158-4BF7-9FB2-B05135D1E166 + + diff --git a/app/rcc/edbee/syntaxfiles/Go.tmLanguage b/app/rcc/edbee/syntaxfiles/Go.tmLanguage new file mode 100644 index 00000000..07fec9ad --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Go.tmLanguage @@ -0,0 +1,764 @@ + + + + + comment + Go allows any Unicode character to be used in identifiers, so our identifier regex is: \b([[:alpha:]_]+[[:alnum:]_]*)\b + fileTypes + + go + + firstLineMatch + -[*]-( Mode:)? Go -[*]- + foldingStartMarker + (?x) + /\*\*(?!\*) # opening C-style comment with 2 asterisks but no third later on + | # OR + ^ # start of line... + (?! # ...which does NOT contain... + [^{(]*?// # ...a possible bunch of non-opening-braces, followed by a C++ comment + | # OR + [^{(]*?/\*(?!.*?\*/.*?[{(]) # ...a possible bunch of non-opening-braces, followed by a C comment with no ending + ) + .*? # ...any characters (or none)... + [{(]\s* # ...followed by an open brace and zero or more whitespace... + ( # ...followed by... + $ # ...a dollar... + | # OR + // # ...a C++ comment... + | # OR + /\*(?!.*?\*/.*\S) # ...a C comment, so long as no non-whitespace chars follow it.. + ) + + foldingStopMarker + (?<!\*)\*\*/|^\s*[})] + keyEquivalent + ^~G + name + Go + patterns + + + include + #receiver_function_declaration + + + include + #plain_function_declaration + + + include + #basic_things + + + include + #exported_variables + + + begin + ^[[:blank:]]*(import)\b\s+ + beginCaptures + + 1 + + name + keyword.control.import.go + + + end + (?=(?://|/\*))|$ + name + meta.preprocessor.go.import + patterns + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.go + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.go + + + name + string.quoted.double.import.go + + + + + include + #block + + + include + #root_parens + + + include + #function_calls + + + repository + + access + + match + (?<=\.)[[:alpha:]_][[:alnum:]_]*\b(?!\s*\() + name + variable.other.dot-access.go + + basic_things + + patterns + + + include + #comments + + + include + #initializers + + + include + #access + + + include + #strings + + + include + #keywords + + + + block + + begin + \{ + end + \} + name + meta.block.go + patterns + + + include + #block_innards + + + + block_innards + + patterns + + + include + #function_block_innards + + + include + #exported_variables + + + + comments + + patterns + + + captures + + 1 + + name + meta.toc-list.banner.block.go + + + match + ^/\* =(\s*.*?)\s*= \*/$\n? + name + comment.block.go + + + begin + /\* + captures + + 0 + + name + punctuation.definition.comment.go + + + end + \*/ + name + comment.block.go + + + match + \*/.*\n + name + invalid.illegal.stray-commend-end.go + + + captures + + 1 + + name + meta.toc-list.banner.line.go + + + match + ^// =(\s*.*?)\s*=\s*$\n? + name + comment.line.double-slash.banner.go + + + begin + // + beginCaptures + + 0 + + name + punctuation.definition.comment.go + + + end + $\n? + name + comment.line.double-slash.go + patterns + + + match + (?>\\\s*\n) + name + punctuation.separator.continuation.go + + + + + + exported_variables + + comment + This is kinda hacky, in order to get the 'var' scoped the right way again. + match + (?<=\s|\[\])([[:upper:]][[:alnum:]_]*)(?=\W+) + name + variable.exported.go + + fn_parens + + begin + \( + end + \) + name + meta.parens.go + patterns + + + include + #basic_things + + + include + #function_calls + + + + function_block + + begin + \{ + end + \} + name + meta.block.go + patterns + + + include + #function_block_innards + + + + function_block_innards + + patterns + + + include + #basic_things + + + captures + + 1 + + name + punctuation.whitespace.support.function.leading.go + + 2 + + name + support.function.builtin.go + + + match + (\s*)\b(new|c(lose(d)?|ap)|p(anic(ln)?|rint(ln)?)|len|make)(?:\b|\() + + + include + #function_block + + + include + #function_calls + + + include + #fn_parens + + + + function_calls + + captures + + 1 + + name + punctuation.whitespace.function-call.leading.go + + 2 + + name + support.function.any-method.go + + 3 + + name + punctuation.definition.parameters.go + + + match + (?x) + (?: (?= \s ) (?:(?<=else|new|return) | (?<!\w)) (\s+) )? + (\b + (?!(for|if|else|switch|return)\s*\() + (?:[[:alpha:]_][[:alnum:]_]*+\b) # method name + ) + \s*(\() + + name + meta.function-call.go + + initializers + + patterns + + + captures + + 0 + + name + variable.other.go + + 1 + + name + keyword.control.go + + + comment + This matches the 'var x int = 0' style of variable declaration. + match + ^[[:blank:]]*(var)\s+(?:[[:alpha:]_][[:alnum:]_]*)(?:,\s+[[:alpha:]_][[:alnum:]_]*)* + name + meta.initialization.explicit.go + + + captures + + 0 + + name + variable.other.go + + 1 + + name + keyword.operator.initialize.go + + + comment + This matches the 'x := 0' style of variable declaration. + match + (?:[[:alpha:]_][[:alnum:]_]*)(?:,\s+[[:alpha:]_][[:alnum:]_]*)*\s*(:=) + name + meta.initialization.short.go + + + + keywords + + patterns + + + match + \b(s(truct|elect|witch)|c(ontinue|ase)|type|i(nterface|f|mport)|def(er|ault)|package|else|var|f(or|unc|allthrough)|r(eturn|ange)|go(to)?|map|break)\b + name + keyword.control.go + + + match + (\b|(?<=\]))(int(16|8|32|64)?|uint(16|8|32|ptr|64)?|float(32|64)?|b(yte|ool)|string)\b + name + storage.type.go + + + match + \b(const|chan)\b + name + storage.modifier.go + + + match + \b(nil|true|false|iota)\b + name + constant.language.go + + + match + \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b + name + constant.numeric.go + + + match + (\<\-)|(\-\>) + name + support.channel-operator.go + + + + plain_function_declaration + + begin + (?x) + ^[[:blank:]]*(func)\s* + (?: ([[:alpha:]_][[:alnum:]_]*)? ) # name of function is optional + (?: \( ((?:[\[\]\w\d\s\/,._*&<>-]|(?:interface\{\}))*)? \) ) # required braces for parameters (even if empty) + \s* + (?: \(? ((?:[\[\]\w\d\s,._*&<>-]|(?:interface\{\}))*) \)? )? # optional return types, optionally within braces + + beginCaptures + + 1 + + name + keyword.control.go + + 2 + + name + entity.name.function.go + + 3 + + name + variable.parameters.go + + 4 + + name + variable.return-types.go + + + end + (?<=\}) + name + meta.function.plain.go + patterns + + + include + #comments + + + + include + #function_block + + + + receiver_function_declaration + + begin + (?x) + (func)\s* + (?: \( ((?:[\[\]\w\d\s,._*&<>-]|(?:interface\{\}))*) \)\s+ ) # receiver variable declarations, in brackets + (?: ([[:alpha:]_][[:alnum:]_]*)? ) # name of function is optional + (?: \( ((?:[\[\]\w\d\s,._*&<>-]|(?:interface\{\}))*)? \) ) # required braces for parameters (even if empty) + \s* + (?: \(? ((?:[\[\]\w\d\s,._*&<>-]|(?:interface\{\}))*) \)? )? # optional return types, optionally within braces + + beginCaptures + + 1 + + name + keyword.control.go + + 2 + + name + variable.receiver.go + + 3 + + name + entity.name.function.go + + 4 + + name + variable.parameters.go + + 5 + + name + variable.return-types.go + + + comment + Version of above with support for declaring a receiver variable. + end + (?<=\}) + name + meta.function.receiver.go + patterns + + + include + #comments + + + + + include + #function_block + + + + root_parens + + begin + \( + end + (?<=\()(\))?|(?:\)) + endCaptures + + 1 + + name + meta.parens.empty.go + + + name + meta.parens.go + patterns + + + include + #basic_things + + + include + #exported_variables + + + include + #function_calls + + + + string_escaped_char + + patterns + + + match + \\(\\|[abfnrutv'"]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|[0-7]{3}) + name + constant.character.escape.go + + + match + \\. + name + invalid.illegal.unknown-escape.go + + + + string_placeholder + + patterns + + + match + (?x)% + (\d+\$)? # field (argument #) + [#0\- +']* # flags + [,;:_]? # separator character (AltiVec) + ((-?\d+)|\*(-?\d+\$)?)? # minimum field width + (\.((-?\d+)|\*(-?\d+\$)?)?)? # precision + [diouxXDOUeEfFgGaAcCsSpnvtTbyYhHmMzZ%] # conversion type + + name + constant.other.placeholder.go + + + match + % + name + invalid.illegal.placeholder.go + + + + strings + + patterns + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.go + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.go + + + name + string.quoted.double.go + patterns + + + include + #string_placeholder + + + include + #string_escaped_char + + + + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.go + + + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.go + + + name + string.quoted.single.go + patterns + + + include + #string_escaped_char + + + + + begin + ` + beginCaptures + + 0 + + name + punctuation.definition.string.begin.go + + + end + ` + endCaptures + + 0 + + name + punctuation.definition.string.end.go + + + name + string.quoted.raw.go + + + + + scopeName + source.go + uuid + 33100200-8916-4F78-8522-4362628C6889 + + diff --git a/app/rcc/edbee/syntaxfiles/Groovy.tmLanguage b/app/rcc/edbee/syntaxfiles/Groovy.tmLanguage new file mode 100644 index 00000000..2bb658d9 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Groovy.tmLanguage @@ -0,0 +1,1356 @@ + + + + + fileTypes + + groovy + gvy + + foldingStartMarker + (\{\s*$|^\s*// \{\{\{) + foldingStopMarker + ^\s*(\}|// \}\}\}$) + keyEquivalent + ^~G + name + Groovy + patterns + + + captures + + 1 + + name + punctuation.definition.comment.groovy + + + match + ^(#!).+$\n + name + comment.line.hashbang.groovy + + + captures + + 1 + + name + keyword.other.package.groovy + + 2 + + name + storage.type.package.groovy + + + match + ^\s*(package)\s+([^ ;]+) + name + meta.package.groovy + + + captures + + 1 + + name + keyword.other.import.groovy + + 2 + + name + storage.type.import.groovy + + + match + ^\s*(import)\s+([^ ;$]+);? + name + meta.import.groovy + + + include + #groovy + + + repository + + class-object + + patterns + + + match + (?x) + \b( + (?:[a-z]\w*\.)* # Optional package specification + [A-Z]\w+\b # Class name + (?:<(?:[\w, ]*)>)? # Optional Generics + (?:\[\s*\])* # Optional brackets (array) + )\b + + name + storage.type.class.groovy + + + + classes + + begin + (?x)^\s* + (?:(?:\b(?:(public|private|protected)|(static)|(final)|(native|synchronized|abstract|threadsafe|transient))\b\s*)*) # modifier + (class)\s+ + (\w+)\s* # identifier + captures + + 1 + + name + storage.modifier.access-control.groovy + + 2 + + name + storage.modifier.static.groovy + + 3 + + name + storage.modifier.final.groovy + + 4 + + name + storage.modifier.other.groovy + + 5 + + name + storage.type.class.groovy + + 6 + + name + entity.name.type.class.groovy + + + end + $ + name + meta.definition.class.groovy + patterns + + + captures + + 1 + + name + storage.modifier.extends.groovy + + 2 + + name + entity.other.inherited-class.groovy + + + match + (extends)\s+([a-zA-Z0-9_\.]+(?:<(?:[a-zA-Z0-9_, ])+>)?)\s* + name + meta.definition.class.inherited.classes.groovy + + + begin + (implements)\s + beginCaptures + + 1 + + name + storage.modifier.implements.groovy + + + end + (?=\s*extends|$|\{) + name + meta.definition.class.implemented.interfaces.groovy + patterns + + + captures + + 1 + + name + entity.other.inherited-class.interface.groovy + + 2 + + name + punctuation.definition.implemented.interfaces.separator.groovy + + + match + ((?:[a-z]\w*.)*[A-Z]\w*)\s*(?:(,)|$|\{) + + + + + + comment-block + + begin + /\* + captures + + 0 + + name + punctuation.definition.comment.groovy + + + end + \*/ + name + comment.block.groovy + + comments + + patterns + + + captures + + 0 + + name + punctuation.definition.comment.groovy + + + match + /\*\*/ + name + comment.block.empty.groovy + + + include + text.html.javadoc + + + include + #comment-block + + + captures + + 1 + + name + punctuation.definition.comment.groovy + + + match + (//).*$\n? + name + comment.line.double-slash.groovy + + + + constants + + patterns + + + match + \b([A-Z][A-Z0-9_]+)\b + name + constant.other.groovy + + + match + \b(true|false|null)\b + name + constant.language.groovy + + + + groovy + + patterns + + + include + #classes + + + include + #methods + + + include + #groovy-code + + + + groovy-code + + patterns + + + include + #groovy-code-minus-map-keys + + + include + #map-keys + + + + groovy-code-minus-map-keys + + comment + In some situations, maps can't be declared without enclosing []'s, + therefore we create a collection of everything but that + patterns + + + include + #comments + + + include + #support-functions + + + include + #keyword-language + + + include + #values + + + include + #keyword-operator + + + include + #storage-types + + + include + #storage-modifiers + + + + keyword + + patterns + + + include + #keyword-operator + + + include + #keyword-language + + + + keyword-language + + patterns + + + match + \b(try|catch|finally|throw)\b + name + keyword.control.exception.groovy + + + match + \b(return|break|continue|default|do|while|for|switch|if|else)\b + name + keyword.control.groovy + + + begin + \bcase\b + beginCaptures + + 0 + + name + keyword.control.groovy + + + end + : + endCaptures + + 0 + + name + punctuation.definition.case-terminator.groovy + + + name + meta.case.groovy + patterns + + + include + #groovy-code-minus-map-keys + + + + + match + \b(new)\b + name + keyword.other.new.groovy + + + begin + \b(assert)\s + beginCaptures + + 1 + + name + keyword.control.assert.groovy + + + end + $ + name + meta.declaration.assertion.groovy + patterns + + + match + : + name + keyword.operator.assert.expression-seperator.groovy + + + include + #groovy-code-minus-map-keys + + + + + match + \b(throws)\b + name + keyword.other.throws.groovy + + + + keyword-operator + + patterns + + + match + \b(as)\b + name + keyword.operator.as.groovy + + + match + \b(is)\b + name + keyword.operator.is.groovy + + + match + \?\: + name + keyword.operator.elvis.groovy + + + match + \.\. + name + keyword.operator.range.groovy + + + match + \-> + name + keyword.operator.arrow.groovy + + + match + << + name + keyword.operator.leftshift.groovy + + + match + (?<=\S)\.(?=\S) + name + keyword.operator.navigation.groovy + + + match + (?<=\S)\?\.(?=\S) + name + keyword.operator.safe-navigation.groovy + + + begin + \? + beginCaptures + + 0 + + name + keyword.operator.ternary.groovy + + + end + $ + name + meta.evaluation.ternary.groovy + patterns + + + match + : + name + keyword.operator.ternary.expression-seperator.groovy + + + include + #groovy-code-minus-map-keys + + + + + match + ==~ + name + keyword.operator.match.groovy + + + match + =~ + name + keyword.operator.find.groovy + + + match + \b(instanceof)\b + name + keyword.operator.instanceof.groovy + + + match + (===|==|!=|<=|>=|<=>|<>|<|>|<<) + name + keyword.operator.comparison.groovy + + + match + = + name + keyword.operator.assignment.groovy + + + match + (\-\-|\+\+) + name + keyword.operator.increment-decrement.groovy + + + match + (\-|\+|\*|\/|%) + name + keyword.operator.arithmetic.groovy + + + match + (!|&&|\|\|) + name + keyword.operator.logical.groovy + + + + map-keys + + patterns + + + captures + + 1 + + name + constant.other.key.groovy + + 2 + + name + punctuation.definition.seperator.key-value.groovy + + + match + (\w+)\s*(:) + + + + method-call + + begin + (\w+)(\() + beginCaptures + + 1 + + name + meta.method.groovy + + 2 + + name + punctuation.definition.method-parameters.begin.groovy + + + end + \) + endCaptures + + 0 + + name + punctuation.definition.method-parameters.end.groovy + + + name + meta.method-call.groovy + patterns + + + match + , + name + punctuation.definition.seperator.parameter.groovy + + + include + #groovy-code + + + + method-declaration-remainder + + patterns + + + begin + \( + beginCaptures + + 0 + + name + punctuation.definition.parameters.begin.groovy + + + contentName + meta.definition.method.parameters.groovy + end + \) + endCaptures + + 0 + + name + punctuation.definition.parameters.end.groovy + + + patterns + + + captures + + 1 + + name + storage.type.parameter.groovy + + 2 + + name + variable.parameter.groovy + + + match + (?x)\s* + ( + (?:boolean|byte|char|short|int|float|long|double|(?:\w+\.)*[A-Z]\w*\b(?:<(?:[\w, ]*)>)?(?:\[\s*\])*) + )? + \s* + ([a-z_][A-Za-z0-9_]*) # variable + + name + meta.definition.method.parameter.groovy + + + captures + + 1 + + name + storage.type.parameter.groovy + + + match + (boolean|byte|char|short|int|float|long|double|(?:\w+\.)*[A-Z]\w*\b(?:<(?:[\w, ]*)>)?(?:\[\s*\])*) + name + meta.definition.method.parameter.groovy + + + match + , + name + punctuation.definition.parameters.seperator.groovy + + + include + #comment-block + + + + + begin + (?<=\))\s*(throws)\s + captures + + 1 + + name + storage.modifier.throws.groovy + + + end + (?=$|\{) + name + meta.definition.method.throwables.groovy + patterns + + + captures + + 1 + + name + storage.type.throwable.groovy + + 2 + + name + punctuation.definition.throwables.seperator.groovy + + + match + ((?:[a-z]\w*.)*[A-Z]\w*)\s*(?:(,)|$|\{) + + + + + + methods + + patterns + + + begin + (?x)^\s* + (?: # zero or more modifiers + (?: + (public|private|protected)|(final)|(native|synchronized|abstract|threadsafe|transient) + ) + \s+ + )? + \s* + ([A-Z](?:[a-zA-Z0-9_])+) # constructor/class name + \s* + (?=\() + + beginCaptures + + 1 + + name + storage.modifier.access-control.groovy + + 2 + + name + storage.modifier.final.groovy + + 3 + + name + storage.modifier.other.groovy + + 4 + + name + entity.name.function.constructor.groovy + + 5 + + name + punctuation.definition.parameters.begin.groovy + + + end + {|$\n? + name + meta.definition.constructor.groovy + patterns + + + include + #method-declaration-remainder + + + + + begin + (?x)^\s* + (?: + (?: # or modifier and optional type + (?:(?:\b(public|private|protected)|(static)|(final)|(native|synchronized|abstract|threadsafe|transient))\b\s+)+\s* # modifier + (?:\b + (void) + | + (boolean|byte|char|short|int|float|long|double) # primitive + | + ( # or class type + (?:\w+\.)*[A-Z]\w+\b # Class name + (?:<(?:[\w, ]*)>)? # optional Generic type + (?:\[\s*\])* # zero or more square brackets (array) + ) + )? + ) + | + (?:\b # or type by itself + (def) + | + (void) + | + (boolean|byte|char|short|int|float|long|double) # primitive + | + ( # or class type + (?:\w+\.)*[A-Z]\w+\b # Class name + (?:<(?:[\w, ]*)>)? # optional generics info + (?:\[\s*\])* # zero or more square brackets (array) + ) + ) + ) + \s* + (\w+) # method name + \s* + (?=\() # opening parens + + beginCaptures + + 1 + + name + storage.modifier.access-control.groovy + + 10 + + name + storage.type.return-type.primitive.groovy + + 11 + + name + storage.type.return-type.class.groovy + + 12 + + name + entity.name.function.groovy + + 2 + + name + storage.modifier.static.groovy + + 3 + + name + storage.modifier.final.groovy + + 4 + + name + storage.modifier.other.groovy + + 5 + + name + storage.type.return-type.void.groovy + + 6 + + name + storage.type.return-type.primitive.groovy + + 7 + + name + storage.type.return-type.class.groovy + + 8 + + name + storage.type.return-type.def.groovy + + 9 + + name + storage.type.return-type.void.groovy + + + end + {|$\n? + name + meta.definition.method.groovy + patterns + + + include + #method-declaration-remainder + + + + + + nest_curly + + begin + \{ + captures + + 0 + + name + punctuation.section.scope.groovy + + + end + \} + patterns + + + include + #nest_curly + + + + numbers + + patterns + + + match + ((0(x|X)[0-9a-fA-F]*)|(\+|-)?\b(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)([LlFfUuDd]|UL|ul)?\b + name + constant.numeric.groovy + + + + regexp + + patterns + + + begin + /(?=[^/]+/) + beginCaptures + + 0 + + name + punctuation.definition.string.regexp.begin.groovy + + + end + / + endCaptures + + 0 + + name + punctuation.definition.string.regexp.end.groovy + + + name + string.regexp.groovy + patterns + + + match + \\. + name + constant.character.escape.groovy + + + + + + storage-modifiers + + patterns + + + match + \b(private|protected|public)\b + name + storage.modifier.access-control.groovy + + + match + \b(static)\b + name + storage.modifier.static.groovy + + + match + \b(final)\b + name + storage.modifier.final.groovy + + + match + \b(native|synchronized|abstract|threadsafe|transient)\b + name + storage.modifier.other.groovy + + + + storage-types + + patterns + + + begin + (@[^ (]+)(\() + beginCaptures + + 1 + + name + storage.type.annotation.groovy + + 2 + + name + punctuation.definition.annotation-arguments.begin.groovy + + + end + (\)) + endCaptures + + 1 + + name + punctuation.definition.annotation-arguments.end.groovy + + + name + meta.declaration.annotation.groovy + patterns + + + captures + + 1 + + name + constant.other.key.groovy + + 2 + + name + keyword.operator.assignment.groovy + + + match + (\w*)\s*(=) + + + include + #values + + + match + , + name + punctuation.definition.seperator.groovy + + + + + match + @\S+ + name + storage.type.annotation.groovy + + + match + \b(def)\b + name + storage.type.def.groovy + + + match + \b(boolean|byte|char|short|int|float|long|double)(?:\[\s*\])*\b + name + storage.type.primitive.groovy + + + + string-quoted-double + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.groovy + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.groovy + + + name + string.quoted.double.groovy + patterns + + + match + \\. + name + constant.character.escape.groovy + + + match + \$\w+ + name + variable.other.interpolated.groovy + + + begin + \$\{ + captures + + 0 + + name + punctuation.section.embedded.groovy + + + end + \} + name + source.groovy.embedded.source + patterns + + + include + #nest_curly + + + + + + string-quoted-single + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.groovy + + + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.groovy + + + name + string.quoted.single.groovy + patterns + + + match + \\. + name + constant.character.escape.groovy + + + + strings + + patterns + + + include + #string-quoted-double + + + include + #string-quoted-single + + + include + #regexp + + + + structures + + begin + \[ + beginCaptures + + 0 + + name + punctuation.definition.structure.begin.groovy + + + end + \] + endCaptures + + 0 + + name + punctuation.definition.structure.end.groovy + + + name + meta.structure.groovy + patterns + + + include + #groovy-code + + + match + , + name + punctuation.definition.separator.groovy + + + + support-functions + + patterns + + + match + (?x)\b(?:sprintf|print(?:f|ln)?)\b + name + support.function.print.groovy + + + match + (?x)\b(?:shouldFail|fail(?:NotEquals)?|ass(?:ume|ert(?:S(?:cript|ame)|N(?:ot(?:Same| + Null)|ull)|Contains|T(?:hat|oString|rue)|Inspect|Equals|False|Length| + ArrayEquals)))\b + name + support.function.testing.groovy + + + match + (?x)\b(?:sleep|inspect|dump|use|with)\b + name + support.function.other.groovy + + + + values + + patterns + + + include + #variables + + + include + #strings + + + include + #numbers + + + include + #constants + + + include + #class-object + + + include + #structures + + + include + #method-call + + + + variables + + patterns + + + match + \b(this|super)\b + name + variable.language.groovy + + + + + scopeName + source.groovy + uuid + B3A64888-EBBB-4436-8D9E-F1169C5D7613 + + diff --git a/app/rcc/edbee/syntaxfiles/HTML-ASP.tmLanguage b/app/rcc/edbee/syntaxfiles/HTML-ASP.tmLanguage new file mode 100644 index 00000000..b2b8aa88 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/HTML-ASP.tmLanguage @@ -0,0 +1,74 @@ + + + + + fileTypes + + asp + + foldingStartMarker + (<(?i:(head|table|div|style|script|ul|ol|form|dl))\b.*?>|\{) + foldingStopMarker + (</(?i:(head|table|div|style|script|ul|ol|form|dl))>|\}) + keyEquivalent + ^~A + name + HTML (ASP) + patterns + + + begin + <%=? + beginCaptures + + 0 + + name + punctuation.section.embedded.begin.asp + + + end + %> + endCaptures + + 0 + + name + punctuation.section.embedded.end.asp + + + name + source.asp.embedded.html + patterns + + + captures + + 1 + + name + punctuation.definition.comment.asp + + + match + (').*?(?=%>) + name + comment.line.apostrophe.asp + + + include + source.asp + + + + + include + text.html.basic + + + scopeName + text.html.asp + uuid + 27798CC6-6B1D-11D9-B8FA-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/HTML.tmLanguage b/app/rcc/edbee/syntaxfiles/HTML.tmLanguage new file mode 100644 index 00000000..b1b4b4bc --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/HTML.tmLanguage @@ -0,0 +1,978 @@ + + + + + fileTypes + + html + htm + shtml + xhtml + phtml + inc + tmpl + tpl + ctp + + firstLineMatch + <!(?i:DOCTYPE)|<(?i:html)|<\?(?i:php) + foldingStartMarker + (?x) + (<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|li|form|dl)\b.*?> + |<!--(?!.*--\s*>) + |^<!--\ \#tminclude\ (?>.*?-->)$ + |<\?(?:php)?.*\b(if|for(each)?|while)\b.+: + |\{\{?(if|foreach|capture|literal|foreach|php|section|strip) + |\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/))) + ) + foldingStopMarker + (?x) + (</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|li|form|dl)> + |^(?!.*?<!--).*?--\s*> + |^<!--\ end\ tminclude\ -->$ + |<\?(?:php)?.*\bend(if|for(each)?|while)\b + |\{\{?/(if|foreach|capture|literal|foreach|php|section|strip) + |^[^{]*\} + ) + keyEquivalent + ^~H + name + HTML + patterns + + + begin + (<)([a-zA-Z0-9:]++)(?=[^>]*></\2>) + beginCaptures + + 1 + + name + punctuation.definition.tag.begin.html + + 2 + + name + entity.name.tag.html + + + end + (>)(<)(/)(\2)(>) + endCaptures + + 1 + + name + punctuation.definition.tag.end.html + + 2 + + name + punctuation.definition.tag.begin.html meta.scope.between-tag-pair.html + + 3 + + name + punctuation.definition.tag.begin.html + + 4 + + name + entity.name.tag.html + + 5 + + name + punctuation.definition.tag.end.html + + + name + meta.tag.any.html + patterns + + + include + #tag-stuff + + + + + begin + (<\?)(xml) + captures + + 1 + + name + punctuation.definition.tag.html + + 2 + + name + entity.name.tag.xml.html + + + end + (\?>) + name + meta.tag.preprocessor.xml.html + patterns + + + include + #tag-generic-attribute + + + include + #string-double-quoted + + + include + #string-single-quoted + + + + + begin + <!-- + captures + + 0 + + name + punctuation.definition.comment.html + + + end + --\s*> + name + comment.block.html + patterns + + + match + -- + name + invalid.illegal.bad-comments-or-CDATA.html + + + include + #embedded-code + + + + + begin + <! + captures + + 0 + + name + punctuation.definition.tag.html + + + end + > + name + meta.tag.sgml.html + patterns + + + begin + (?i:DOCTYPE) + captures + + 1 + + name + entity.name.tag.doctype.html + + + end + (?=>) + name + meta.tag.sgml.doctype.html + patterns + + + match + "[^">]*" + name + string.quoted.double.doctype.identifiers-and-DTDs.html + + + + + begin + \[CDATA\[ + end + ]](?=>) + name + constant.other.inline-data.html + + + match + (\s*)(?!--|>)\S(\s*) + name + invalid.illegal.bad-comments-or-CDATA.html + + + + + include + #embedded-code + + + begin + (?:^\s+)?(<)((?i:style))\b(?![^>]*/>) + captures + + 1 + + name + punctuation.definition.tag.html + + 2 + + name + entity.name.tag.style.html + + 3 + + name + punctuation.definition.tag.html + + + end + (</)((?i:style))(>)(?:\s*\n)? + name + source.css.embedded.html + patterns + + + include + #tag-stuff + + + begin + (>) + beginCaptures + + 1 + + name + punctuation.definition.tag.html + + + end + (?=</(?i:style)) + patterns + + + include + #embedded-code + + + include + source.css + + + + + + + begin + (?:^\s+)?(<)((?i:script))\b(?![^>]*/>) + beginCaptures + + 1 + + name + punctuation.definition.tag.html + + 2 + + name + entity.name.tag.script.html + + + end + (?<=</(script|SCRIPT))(>)(?:\s*\n)? + endCaptures + + 2 + + name + punctuation.definition.tag.html + + + name + source.js.embedded.html + patterns + + + include + #tag-stuff + + + begin + (?<!</(?:script|SCRIPT))(>) + captures + + 1 + + name + punctuation.definition.tag.html + + 2 + + name + entity.name.tag.script.html + + + end + (</)((?i:script)) + patterns + + + captures + + 1 + + name + punctuation.definition.comment.js + + + match + (//).*?((?=</script)|$\n?) + name + comment.line.double-slash.js + + + begin + /\* + captures + + 0 + + name + punctuation.definition.comment.js + + + end + \*/|(?=</script) + name + comment.block.js + + + include + #php + + + include + source.js + + + + + + + begin + (</?)((?i:body|head|html)\b) + captures + + 1 + + name + punctuation.definition.tag.begin.html + + 2 + + name + entity.name.tag.structure.any.html + + + end + (>) + endCaptures + + 1 + + name + punctuation.definition.tag.end.html + + + name + meta.tag.structure.any.html + patterns + + + include + #tag-stuff + + + + + begin + (</?)((?i:address|blockquote|dd|div|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|menu|pre)\b) + beginCaptures + + 1 + + name + punctuation.definition.tag.begin.html + + 2 + + name + entity.name.tag.block.any.html + + + end + (>) + endCaptures + + 1 + + name + punctuation.definition.tag.end.html + + + name + meta.tag.block.any.html + patterns + + + include + #tag-stuff + + + + + begin + (</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)\b) + beginCaptures + + 1 + + name + punctuation.definition.tag.begin.html + + 2 + + name + entity.name.tag.inline.any.html + + + end + ((?: ?/)?>) + endCaptures + + 1 + + name + punctuation.definition.tag.end.html + + + name + meta.tag.inline.any.html + patterns + + + include + #tag-stuff + + + + + begin + (</?)([a-zA-Z0-9:]+) + beginCaptures + + 1 + + name + punctuation.definition.tag.begin.html + + 2 + + name + entity.name.tag.other.html + + + end + (>) + endCaptures + + 1 + + name + punctuation.definition.tag.end.html + + + name + meta.tag.other.html + patterns + + + include + #tag-stuff + + + + + include + #entities + + + match + <> + name + invalid.illegal.incomplete.html + + + match + < + name + invalid.illegal.bad-angle-bracket.html + + + repository + + embedded-code + + patterns + + + include + #ruby + + + include + #php + + + + include + #python + + + + entities + + patterns + + + captures + + 1 + + name + punctuation.definition.entity.html + + 3 + + name + punctuation.definition.entity.html + + + match + (&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;) + name + constant.character.entity.html + + + match + & + name + invalid.illegal.bad-ampersand.html + + + + php + + begin + (?=(^\s*)?<\?) + end + (?!(^\s*)?<\?) + patterns + + + include + source.php + + + + python + + begin + (?:^\s*)<\?python(?!.*\?>) + end + \?>(?:\s*$\n)? + name + source.python.embedded.html + patterns + + + include + source.python + + + + ruby + + patterns + + + begin + <%+# + captures + + 0 + + name + punctuation.definition.comment.erb + + + end + %> + name + comment.block.erb + + + begin + <%+(?!>)=? + captures + + 0 + + name + punctuation.section.embedded.ruby + + + end + -?%> + name + source.ruby.embedded.html + patterns + + + captures + + 1 + + name + punctuation.definition.comment.ruby + + + match + (#).*?(?=-?%>) + name + comment.line.number-sign.ruby + + + include + source.ruby + + + + + begin + <\?r(?!>)=? + captures + + 0 + + name + punctuation.section.embedded.ruby.nitro + + + end + -?\?> + name + source.ruby.nitro.embedded.html + patterns + + + captures + + 1 + + name + punctuation.definition.comment.ruby.nitro + + + match + (#).*?(?=-?\?>) + name + comment.line.number-sign.ruby.nitro + + + include + source.ruby + + + + + + + string-double-quoted + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.html + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.html + + + name + string.quoted.double.html + patterns + + + include + #embedded-code + + + include + #entities + + + + string-single-quoted + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.html + + + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.html + + + name + string.quoted.single.html + patterns + + + include + #embedded-code + + + include + #entities + + + + tag-generic-attribute + + match + \b([a-zA-Z\-:]+) + name + entity.other.attribute-name.html + + tag-id-attribute + + begin + \b(id)\b\s*(=) + captures + + 1 + + name + entity.other.attribute-name.id.html + + 2 + + name + punctuation.separator.key-value.html + + + end + (?<='|") + name + meta.attribute-with-value.id.html + patterns + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.html + + + contentName + meta.toc-list.id.html + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.html + + + name + string.quoted.double.html + patterns + + + include + #embedded-code + + + include + #entities + + + + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.html + + + contentName + meta.toc-list.id.html + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.html + + + name + string.quoted.single.html + patterns + + + include + #embedded-code + + + include + #entities + + + + + + tag-stuff + + patterns + + + include + #tag-id-attribute + + + include + #tag-generic-attribute + + + include + #string-double-quoted + + + include + #string-single-quoted + + + include + #embedded-code + + + + + scopeName + text.html.basic + uuid + 17994EC8-6B1D-11D9-AC3A-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/Haskell.tmLanguage b/app/rcc/edbee/syntaxfiles/Haskell.tmLanguage new file mode 100644 index 00000000..b0bf1eac --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Haskell.tmLanguage @@ -0,0 +1,646 @@ + + + + + fileTypes + + hs + + keyEquivalent + ^~H + name + Haskell + patterns + + + captures + + 1 + + name + punctuation.definition.entity.haskell + + 2 + + name + punctuation.definition.entity.haskell + + + comment + In case this regex seems unusual for an infix operator, note that Haskell allows any ordinary function application (elem 4 [1..10]) to be rewritten as an infix expression (4 `elem` [1..10]). + match + (`)[a-zA-Z_']*?(`) + name + keyword.operator.function.infix.haskell + + + match + \(\) + name + constant.language.unit.haskell + + + match + \[\] + name + constant.language.empty-list.haskell + + + begin + (module) + beginCaptures + + 1 + + name + keyword.other.haskell + + + end + (where) + endCaptures + + 1 + + name + keyword.other.haskell + + + name + meta.declaration.module.haskell + patterns + + + include + #module_name + + + include + #module_exports + + + match + [a-z]+ + name + invalid + + + + + begin + \b(class)\b + beginCaptures + + 1 + + name + keyword.other.haskell + + + end + \b(where)\b + endCaptures + + 1 + + name + keyword.other.haskell + + + name + meta.declaration.class.haskell + patterns + + + match + \b(Monad|Functor|Eq|Ord|Read|Show|Num|(Frac|Ra)tional|Enum|Bounded|Real(Frac|Float)?|Integral|Floating)\b + name + support.class.prelude.haskell + + + match + [A-Z][A-Za-z_']* + name + entity.other.inherited-class.haskell + + + match + \b[a-z][a-zA-Z0-9_']*\b + name + variable.other.generic-type.haskell + + + + + begin + \b(instance)\b + beginCaptures + + 1 + + name + keyword.other.haskell + + + end + \b(where)\b|$ + endCaptures + + 1 + + name + keyword.other.haskell + + + name + meta.declaration.instance.haskell + patterns + + + include + #type_signature + + + + + begin + (import) + beginCaptures + + 1 + + name + keyword.other.haskell + + + end + ($|;) + name + meta.import.haskell + patterns + + + match + (qualified|as|hiding) + name + keyword.other.haskell + + + include + #module_name + + + include + #module_exports + + + + + begin + (deriving)\s*\( + beginCaptures + + 1 + + name + keyword.other.haskell + + + end + \) + name + meta.deriving.haskell + patterns + + + match + \b[A-Z][a-zA-Z_']* + name + entity.other.inherited-class.haskell + + + + + match + \b(deriving|where|data|type|case|of|let|in|newtype|default)\b + name + keyword.other.haskell + + + match + \binfix[lr]?\b + name + keyword.operator.haskell + + + match + \b(do|if|then|else)\b + name + keyword.control.haskell + + + comment + Floats are always decimal + match + \b([0-9]+\.[0-9]+([eE][+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+)\b + name + constant.numeric.float.haskell + + + match + \b([0-9]+|0([xX][0-9a-fA-F]+|[oO][0-7]+))\b + name + constant.numeric.haskell + + + captures + + 1 + + name + punctuation.definition.preprocessor.c + + + comment + In addition to Haskell's "native" syntax, GHC permits the C preprocessor to be run on a source file. + match + ^\s*(#)\s*\w+ + name + meta.preprocessor.c + + + include + #pragma + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.haskell + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.haskell + + + name + string.quoted.double.haskell + patterns + + + match + \\(NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\"'\&]) + name + constant.character.escape.haskell + + + match + \\o[0-7]+|\\x[0-9A-Fa-f]+|\\[0-9]+ + name + constant.character.escape.octal.haskell + + + match + \^[A-Z@\[\]\\\^_] + name + constant.character.escape.control.haskell + + + + + captures + + 1 + + name + punctuation.definition.string.begin.haskell + + 2 + + name + constant.character.escape.haskell + + 3 + + name + constant.character.escape.octal.haskell + + 4 + + name + constant.character.escape.hexadecimal.haskell + + 5 + + name + constant.character.escape.control.haskell + + 6 + + name + punctuation.definition.string.end.haskell + + + match + (?x) + (') + (?: + [\ -\[\]-~] # Basic Char + | (\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE + |DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS + |US|SP|DEL|[abfnrtv\\\"'\&])) # Escapes + | (\\o[0-7]+) # Octal Escapes + | (\\x[0-9A-Fa-f]+) # Hexadecimal Escapes + | (\^[A-Z@\[\]\\\^_]) # Control Chars + ) + (') + + name + string.quoted.single.haskell + + + begin + ^\s*([a-z_][a-zA-Z0-9_']*|\([|!%$+\-.,=</>]+\))\s*(::) + beginCaptures + + 1 + + name + entity.name.function.haskell + + 2 + + name + keyword.other.double-colon.haskell + + + end + $\n? + name + meta.function.type-declaration.haskell + patterns + + + include + #type_signature + + + + + match + \b(Just|Nothing|Left|Right|True|False|LT|EQ|GT|\(\)|\[\])\b + name + support.constant.haskell + + + match + \b[A-Z]\w*\b + name + constant.other.haskell + + + include + #comments + + + match + \b(abs|acos|acosh|all|and|any|appendFile|applyM|asTypeOf|asin|asinh|atan|atan2|atanh|break|catch|ceiling|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|div|divMod|drop|dropWhile|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromEnum|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|head|id|init|interact|ioError|isDenormalized|isIEEE|isInfinite|isNaN|isNegativeZero|iterate|last|lcm|length|lex|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|odd|or|otherwise|pi|pred|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|read|readFile|readIO|readList|readLn|readParen|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showList|showParen|showString|shows|showsPrec|significand|signum|sin|sinh|snd|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|toEnum|toInteger|toRational|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\b + name + support.function.prelude.haskell + + + include + #infix_op + + + comment + In case this regex seems overly general, note that Haskell permits the definition of new operators which can be nearly any string of punctuation characters, such as $%^&*. + match + [|!%$?~+:\-.=</>\\]+ + name + keyword.operator.haskell + + + match + , + name + punctuation.separator.comma.haskell + + + repository + + block_comment + + applyEndPatternLast + 1 + begin + \{-(?!#) + captures + + 0 + + name + punctuation.definition.comment.haskell + + + end + -\} + name + comment.block.haskell + patterns + + + include + #block_comment + + + + comments + + patterns + + + captures + + 1 + + name + punctuation.definition.comment.haskell + + + match + (--).*$\n? + name + comment.line.double-dash.haskell + + + include + #block_comment + + + + infix_op + + match + (\([|!%$+:\-.=</>]+\)|\(,+\)) + name + entity.name.function.infix.haskell + + module_exports + + begin + \( + end + \) + name + meta.declaration.exports.haskell + patterns + + + match + \b[a-z][a-zA-Z_'0-9]* + name + entity.name.function.haskell + + + match + \b[A-Z][A-Za-z_'0-9]* + name + storage.type.haskell + + + match + , + name + punctuation.separator.comma.haskell + + + include + #infix_op + + + comment + So named because I don't know what to call this. + match + \(.*?\) + name + meta.other.unknown.haskell + + + + module_name + + match + [A-Z][A-Za-z._']* + name + support.other.module.haskell + + pragma + + begin + \{-# + end + #-\} + name + meta.preprocessor.haskell + patterns + + + match + \b(LANGUAGE|UNPACK|INLINE)\b + name + keyword.other.preprocessor.haskell + + + + type_signature + + patterns + + + captures + + 1 + + name + entity.other.inherited-class.haskell + + 2 + + name + variable.other.generic-type.haskell + + 3 + + name + keyword.other.big-arrow.haskell + + + match + \(\s*([A-Z][A-Za-z]*)\s+([a-z][A-Za-z_']*)\)\s*(=>) + name + meta.class-constraint.haskell + + + include + #pragma + + + match + -> + name + keyword.other.arrow.haskell + + + match + => + name + keyword.other.big-arrow.haskell + + + match + \b(Int(eger)?|Maybe|Either|Bool|Float|Double|Char|String|Ordering|ShowS|ReadS|FilePath|IO(Error)?)\b + name + support.type.prelude.haskell + + + match + \b[a-z][a-zA-Z0-9_']*\b + name + variable.other.generic-type.haskell + + + match + \b[A-Z][a-zA-Z0-9_']*\b + name + storage.type.haskell + + + match + \(\) + name + support.constant.unit.haskell + + + include + #comments + + + + + scopeName + source.haskell + uuid + 5C034675-1F6D-497E-8073-369D37E2FD7D + + diff --git a/app/rcc/edbee/syntaxfiles/Java.tmLanguage b/app/rcc/edbee/syntaxfiles/Java.tmLanguage new file mode 100644 index 00000000..dcdbbae7 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Java.tmLanguage @@ -0,0 +1,1129 @@ + + + + + fileTypes + + java + bsh + + foldingStartMarker + (\{\s*(//.*)?$|^\s*// \{\{\{) + foldingStopMarker + ^\s*(\}|// \}\}\}$) + keyEquivalent + ^~J + name + Java + patterns + + + captures + + 1 + + name + keyword.other.package.java + + 2 + + name + storage.modifier.package.java + + 3 + + name + punctuation.terminator.java + + + match + ^\s*(package)\b(?:\s*([^ ;$]+)\s*(;)?)? + name + meta.package.java + + + captures + + 1 + + name + keyword.other.import.java + + 2 + + name + storage.modifier.import.java + + 3 + + name + punctuation.terminator.java + + + match + ^\s*(import)\b(?:\s*([^ ;$]+)\s*(;)?)? + name + meta.import.java + + + include + #code + + + repository + + all-types + + patterns + + + include + #primitive-arrays + + + include + #primitive-types + + + include + #object-types + + + + annotations + + patterns + + + begin + (@[^ (]+)(\() + beginCaptures + + 1 + + name + storage.type.annotation.java + + 2 + + name + punctuation.definition.annotation-arguments.begin.java + + + end + (\)) + endCaptures + + 1 + + name + punctuation.definition.annotation-arguments.end.java + + + name + meta.declaration.annotation.java + patterns + + + captures + + 1 + + name + constant.other.key.java + + 2 + + name + keyword.operator.assignment.java + + + match + (\w*)\s*(=) + + + include + #code + + + match + , + name + punctuation.seperator.property.java + + + + + match + @\w* + name + storage.type.annotation.java + + + + anonymous-classes-and-new + + begin + \bnew\b + beginCaptures + + 0 + + name + keyword.control.new.java + + + end + (?<=\)|\])(?!\s*{)|(?<=})|(?=;) + patterns + + + begin + (\w+)\s*(?=\[) + beginCaptures + + 1 + + name + storage.type.java + + + end + }|(?=;|\)) + patterns + + + begin + \[ + end + \] + patterns + + + include + #code + + + + + begin + { + end + (?=}) + patterns + + + include + #code + + + + + + + begin + (?=\w.*\() + end + (?<=\)) + patterns + + + include + #object-types + + + begin + \( + beginCaptures + + 1 + + name + storage.type.java + + + end + \) + patterns + + + include + #code + + + + + + + begin + { + end + } + name + meta.inner-class.java + patterns + + + include + #class-body + + + + + + assertions + + patterns + + + begin + \b(assert)\s + beginCaptures + + 1 + + name + keyword.control.assert.java + + + end + $ + name + meta.declaration.assertion.java + patterns + + + match + : + name + keyword.operator.assert.expression-seperator.java + + + include + #code + + + + + + class + + begin + (?=\w?[\w\s]*(?:class|(?:@)?interface|enum)\s+\w+) + end + } + endCaptures + + 0 + + name + punctuation.section.class.end.java + + + name + meta.class.java + patterns + + + include + #storage-modifiers + + + include + #comments + + + captures + + 1 + + name + storage.modifier.java + + 2 + + name + entity.name.type.class.java + + + match + (class|(?:@)?interface|enum)\s+(\w+) + name + meta.class.identifier.java + + + begin + extends + beginCaptures + + 0 + + name + storage.modifier.extends.java + + + end + (?={|implements) + name + meta.definition.class.inherited.classes.java + patterns + + + include + #object-types-inherited + + + include + #comments + + + + + begin + (implements)\s + beginCaptures + + 1 + + name + storage.modifier.implements.java + + + end + (?=\s*extends|\{) + name + meta.definition.class.implemented.interfaces.java + patterns + + + include + #object-types-inherited + + + include + #comments + + + + + begin + { + end + (?=}) + name + meta.class.body.java + patterns + + + include + #class-body + + + + + + class-body + + patterns + + + include + #comments + + + include + #class + + + include + #enums + + + include + #methods + + + include + #annotations + + + include + #storage-modifiers + + + include + #code + + + + code + + patterns + + + include + #comments + + + include + #class + + + begin + { + end + } + patterns + + + include + #code + + + + + include + #assertions + + + include + #parens + + + include + #constants-and-special-vars + + + include + #anonymous-classes-and-new + + + include + #keywords + + + include + #storage-modifiers + + + include + #strings + + + include + #all-types + + + + comments + + patterns + + + captures + + 0 + + name + punctuation.definition.comment.java + + + match + /\*\*/ + name + comment.block.empty.java + + + include + text.html.javadoc + + + include + #comments-inline + + + + comments-inline + + patterns + + + begin + /\* + captures + + 0 + + name + punctuation.definition.comment.java + + + end + \*/ + name + comment.block.java + + + captures + + 1 + + name + comment.line.double-slash.java + + 2 + + name + punctuation.definition.comment.java + + + match + \s*((//).*$\n?) + + + + constants-and-special-vars + + patterns + + + match + \b(true|false|null)\b + name + constant.language.java + + + match + \b(this|super)\b + name + variable.language.java + + + match + \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)([LlFfUuDd]|UL|ul)?\b + name + constant.numeric.java + + + captures + + 1 + + name + keyword.operator.dereference.java + + + match + (\.)?\b([A-Z][A-Z0-9_]+)(?!<|\.class|\s*\w+\s*=)\b + name + constant.other.java + + + + enums + + begin + ^(?=\s*[A-Z0-9_]+\s*({|\(|,)) + end + (?=;|}) + patterns + + + begin + \w+ + beginCaptures + + 0 + + name + constant.other.enum.java + + + end + (?=,|;|}) + name + meta.enum.java + patterns + + + include + #parens + + + begin + { + end + } + patterns + + + include + #class-body + + + + + + + + keywords + + patterns + + + match + \b(try|catch|finally|throw)\b + name + keyword.control.catch-exception.java + + + match + \?|: + name + keyword.control.java + + + match + \b(return|break|case|continue|default|do|while|for|switch|if|else)\b + name + keyword.control.java + + + match + \b(instanceof)\b + name + keyword.operator.java + + + match + (==|!=|<=|>=|<>|<|>) + name + keyword.operator.comparison.java + + + match + (=) + name + keyword.operator.assignment.java + + + match + (\-\-|\+\+) + name + keyword.operator.increment-decrement.java + + + match + (\-|\+|\*|\/|%) + name + keyword.operator.arithmetic.java + + + match + (!|&&|\|\|) + name + keyword.operator.logical.java + + + match + (?<=\S)\.(?=\S) + name + keyword.operator.dereference.java + + + match + ; + name + punctuation.terminator.java + + + + methods + + begin + (?!new)(?=\w.*\s+)(?=[^=]+\() + end + }|(?=;) + name + meta.method.java + patterns + + + include + #storage-modifiers + + + begin + (\w+)\s*\( + beginCaptures + + 1 + + name + entity.name.function.java + + + end + \) + name + meta.method.identifier.java + patterns + + + include + #parameters + + + + + begin + (?=\w.*\s+\w+\s*\() + end + (?=\w+\s*\() + name + meta.method.return-type.java + patterns + + + include + #all-types + + + + + include + #throws + + + begin + { + end + (?=}) + name + meta.method.body.java + patterns + + + include + #code + + + + + + object-types + + patterns + + + begin + \b((?:[a-z]\w*\.)*[A-Z]+\w*)< + end + >|[^\w\s,\?<\[\]] + name + storage.type.generic.java + patterns + + + include + #object-types + + + begin + < + comment + This is just to support <>'s with no actual type prefix + end + >|[^\w\s,\[\]<] + name + storage.type.generic.java + + + + + begin + \b((?:[a-z]\w*\.)*[A-Z]+\w*)(?=\[) + end + (?=[^\]\s]) + name + storage.type.object.array.java + patterns + + + begin + \[ + end + \] + patterns + + + include + #code + + + + + + + captures + + 1 + + name + keyword.operator.dereference.java + + + match + \b(?:[a-z]\w*(\.))*[A-Z]+\w*\b + name + storage.type.java + + + + object-types-inherited + + patterns + + + begin + \b((?:[a-z]\w*\.)*[A-Z]+\w*)< + end + >|[^\w\s,<] + name + entity.other.inherited-class.java + patterns + + + include + #object-types + + + begin + < + comment + This is just to support <>'s with no actual type prefix + end + >|[^\w\s,<] + name + storage.type.generic.java + + + + + captures + + 1 + + name + keyword.operator.dereference.java + + + match + \b(?:[a-z]\w*(\.))*[A-Z]+\w* + name + entity.other.inherited-class.java + + + + parameters + + patterns + + + match + final + name + storage.modifier.java + + + include + #primitive-arrays + + + include + #primitive-types + + + include + #object-types + + + match + \w+ + name + variable.parameter.java + + + + parens + + begin + \( + end + \) + patterns + + + include + #code + + + + primitive-arrays + + patterns + + + match + \b(?:void|boolean|byte|char|short|int|float|long|double)(\[\])*\b + name + storage.type.primitive.array.java + + + + primitive-types + + patterns + + + match + \b(?:void|boolean|byte|char|short|int|float|long|double)\b + name + storage.type.primitive.java + + + + storage-modifiers + + captures + + 1 + + name + storage.modifier.java + + + match + \b(public|private|protected|static|final|native|synchronized|abstract|threadsafe|transient)\b + + strings + + patterns + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.java + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.java + + + name + string.quoted.double.java + patterns + + + match + \\. + name + constant.character.escape.java + + + + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.java + + + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.java + + + name + string.quoted.single.java + patterns + + + match + \\. + name + constant.character.escape.java + + + + + + throws + + begin + throws + beginCaptures + + 0 + + name + storage.modifier.java + + + end + (?={|;) + name + meta.throwables.java + patterns + + + include + #object-types + + + + values + + patterns + + + include + #strings + + + include + #object-types + + + include + #constants-and-special-vars + + + + + scopeName + source.java + uuid + 2B449DF6-6B1D-11D9-94EC-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/JavaDoc.tmLanguage b/app/rcc/edbee/syntaxfiles/JavaDoc.tmLanguage new file mode 100644 index 00000000..dc572e57 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/JavaDoc.tmLanguage @@ -0,0 +1,737 @@ + + + + + fileTypes + + foldingStartMarker + /\*\* + foldingStopMarker + \*\*/ + name + JavaDoc + patterns + + + begin + (/\*\*)\s*$ + beginCaptures + + 1 + + name + punctuation.definition.comment.begin.javadoc + + + end + \*/ + endCaptures + + 0 + + name + punctuation.definition.comment.javadoc + + + name + comment.block.documentation.javadoc + patterns + + + include + #invalid + + + begin + \*\s*(?=\w) + contentName + text.html + end + (?=\s*\*\s*@)|(?=\s*\*\s*/) + name + meta.documentation.comment.javadoc + patterns + + + include + #inline + + + + + begin + \*\s*((\@)param) + beginCaptures + + 1 + + name + keyword.other.documentation.param.javadoc + + 2 + + name + punctuation.definition.keyword.javadoc + + + contentName + text.html + end + (?=\s*\*\s*@)|(?=\s*\*\s*/) + name + meta.documentation.tag.param.javadoc + patterns + + + include + #inline + + + + + begin + \*\s*((\@)return) + beginCaptures + + 1 + + name + keyword.other.documentation.return.javadoc + + 2 + + name + punctuation.definition.keyword.javadoc + + + contentName + text.html + end + (?=\s*\*\s*@)|(?=\s*\*\s*/) + name + meta.documentation.tag.return.javadoc + patterns + + + include + #inline + + + + + begin + \*\s*((\@)throws) + beginCaptures + + 1 + + name + keyword.other.documentation.throws.javadoc + + 2 + + name + punctuation.definition.keyword.javadoc + + + contentName + text.html + end + (?=\s*\*\s*@)|(?=\s*\*\s*/) + name + meta.documentation.tag.throws.javadoc + patterns + + + include + #inline + + + + + begin + \*\s*((\@)exception) + beginCaptures + + 1 + + name + keyword.other.documentation.exception.javadoc + + 2 + + name + punctuation.definition.keyword.javadoc + + + contentName + text.html + end + (?=\s*\*\s*@)|(?=\s*\*\s*/) + name + meta.documentation.tag.exception.javadoc + patterns + + + include + #inline + + + + + begin + \*\s*((\@)author) + beginCaptures + + 1 + + name + keyword.other.documentation.author.javadoc + + 2 + + name + punctuation.definition.keyword.javadoc + + + contentName + text.html + end + (?=\s*\*\s*@)|(?=\s*\*\s*/) + name + meta.documentation.tag.author.javadoc + patterns + + + include + #inline + + + + + begin + \*\s*((\@)version) + beginCaptures + + 1 + + name + keyword.other.documentation.version.javadoc + + 2 + + name + punctuation.definition.keyword.javadoc + + + contentName + text.html + end + (?=\s*\*\s*@)|(?=\s*\*\s*/) + name + meta.documentation.tag.version.javadoc + patterns + + + include + #inline + + + + + begin + \*\s*((\@)see) + beginCaptures + + 1 + + name + keyword.other.documentation.see.javadoc + + 2 + + name + punctuation.definition.keyword.javadoc + + + contentName + text.html + end + (?=\s*\*\s*@)|(?=\s*\*\s*/) + name + meta.documentation.tag.see.javadoc + patterns + + + include + #inline + + + + + begin + \*\s*((\@)since) + beginCaptures + + 1 + + name + keyword.other.documentation.since.javadoc + + 2 + + name + punctuation.definition.keyword.javadoc + + + contentName + text.html + end + (?=\s*\*\s*@)|(?=\s*\*\s*/) + name + meta.documentation.tag.since.javadoc + patterns + + + include + #inline + + + + + begin + \*\s*((\@)serial) + beginCaptures + + 1 + + name + keyword.other.documentation.serial.javadoc + + 2 + + name + punctuation.definition.keyword.javadoc + + + contentName + text.html + end + (?=\s*\*\s*@)|(?=\s*\*\s*/) + name + meta.documentation.tag.serial.javadoc + patterns + + + include + #inline + + + + + begin + \*\s*((\@)serialField) + beginCaptures + + 1 + + name + keyword.other.documentation.serialField.javadoc + + 2 + + name + punctuation.definition.keyword.javadoc + + + contentName + text.html + end + (?=\s*\*\s*@)|(?=\s*\*\s*/) + name + meta.documentation.tag.serialField.javadoc + patterns + + + include + #inline + + + + + begin + \*\s*((\@)serialData) + beginCaptures + + 1 + + name + keyword.other.documentation.serialData.javadoc + + 2 + + name + punctuation.definition.keyword.javadoc + + + contentName + text.html + end + (?=\s*\*\s*@)|(?=\s*\*\s*/) + name + meta.documentation.tag.serialData.javadoc + patterns + + + include + #inline + + + + + begin + \*\s*((\@)deprecated) + beginCaptures + + 1 + + name + keyword.other.documentation.deprecated.javadoc + + 2 + + name + punctuation.definition.keyword.javadoc + + + contentName + text.html + end + (?=\s*\*\s*@)|(?=\s*\*\s*/) + name + meta.documentation.tag.deprecated.javadoc + patterns + + + include + #inline + + + + + captures + + 1 + + name + keyword.other.documentation.custom.javadoc + + 2 + + name + punctuation.definition.keyword.javadoc + + + match + \*\s*((\@)\S+)\s + + + + + repository + + inline + + patterns + + + include + #invalid + + + include + #inline-formatting + + + include + text.html.basic + + + match + ((https?|s?ftp|ftps|file|smb|afp|nfs|(x-)?man|gopher|txmt)://|mailto:)[-:@a-zA-Z0-9_.~%+/?=&#]+(?<![.?:]) + name + markup.underline.link + + + + inline-formatting + + patterns + + + begin + (\{)((\@)code) + beginCaptures + + 1 + + name + punctuation.definition.directive.begin.javadoc + + 2 + + name + keyword.other.documentation.directive.code.javadoc + + 3 + + name + punctuation.definition.keyword.javadoc + + + contentName + markup.raw.code.javadoc + end + \} + endCaptures + + 0 + + name + punctuation.definition.directive.end.javadoc + + + name + meta.directive.code.javadoc + patterns + + + + begin + (\{)((\@)literal) + beginCaptures + + 1 + + name + punctuation.definition.directive.begin.javadoc + + 2 + + name + keyword.other.documentation.directive.literal.javadoc + + 3 + + name + punctuation.definition.keyword.javadoc + + + contentName + markup.raw.literal.javadoc + end + \} + endCaptures + + 0 + + name + punctuation.definition.directive.end.javadoc + + + name + meta.directive.literal.javadoc + patterns + + + + captures + + 1 + + name + punctuation.definition.directive.begin.javadoc + + 2 + + name + keyword.other.documentation.directive.docRoot.javadoc + + 3 + + name + punctuation.definition.keyword.javadoc + + 4 + + name + punctuation.definition.directive.end.javadoc + + + match + (\{)((\@)docRoot)(\}) + name + meta.directive.docRoot.javadoc + + + captures + + 1 + + name + punctuation.definition.directive.begin.javadoc + + 2 + + name + keyword.other.documentation.directive.inheritDoc.javadoc + + 3 + + name + punctuation.definition.keyword.javadoc + + 4 + + name + punctuation.definition.directive.end.javadoc + + + match + (\{)((\@)inheritDoc)(\}) + name + meta.directive.inheritDoc.javadoc + + + captures + + 1 + + name + punctuation.definition.directive.begin.javadoc + + 2 + + name + keyword.other.documentation.directive.link.javadoc + + 3 + + name + punctuation.definition.keyword.javadoc + + 4 + + name + markup.underline.link.javadoc + + 5 + + name + string.other.link.title.javadoc + + 6 + + name + punctuation.definition.directive.end.javadoc + + + match + (\{)((\@)link)(?:\s+(\S+?))?(?:\s+(.+?))?\s*(\}) + name + meta.directive.link.javadoc + + + captures + + 1 + + name + punctuation.definition.directive.begin.javadoc + + 2 + + name + keyword.other.documentation.directive.linkplain.javadoc + + 3 + + name + punctuation.definition.keyword.javadoc + + 4 + + name + markup.underline.linkplain.javadoc + + 5 + + name + string.other.link.title.javadoc + + 6 + + name + punctuation.definition.directive.end.javadoc + + + match + (\{)((\@)linkplain)(?:\s+(\S+?))?(?:\s+(.+?))?\s*(\}) + name + meta.directive.linkplain.javadoc + + + captures + + 1 + + name + punctuation.definition.directive.begin.javadoc + + 2 + + name + keyword.other.documentation.directive.value.javadoc + + 3 + + name + punctuation.definition.keyword.javadoc + + 4 + + name + variable.other.javadoc + + 5 + + name + punctuation.definition.directive.end.javadoc + + + match + (\{)((\@)value)\s*(\S+?)?\s*(\}) + name + meta.directive.value.javadoc + + + + invalid + + patterns + + + match + ^(?!\s*\*).*$\n? + name + invalid.illegal.missing-asterisk.javadoc + + + + + scopeName + text.html.javadoc + uuid + 64BB98A4-59D4-474E-9091-C1E1D04BDD03 + + diff --git a/app/rcc/edbee/syntaxfiles/JavaScript.tmLanguage b/app/rcc/edbee/syntaxfiles/JavaScript.tmLanguage new file mode 100644 index 00000000..e4bb3bc9 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/JavaScript.tmLanguage @@ -0,0 +1,723 @@ + + + + + comment + JavaScript Syntax: version 2.0 + fileTypes + + js + htc + jsx + + firstLineMatch + ^#!/usr/bin/env node + foldingStartMarker + ^.*\bfunction\s*(\w+\s*)?\([^\)]*\)(\s*\{[^\}]*)?\s*$ + foldingStopMarker + ^\s*\} + keyEquivalent + ^~J + name + JavaScript + patterns + + + comment + node.js shebang + match + ^#!/usr/bin/env node + name + comment.line.js + + + captures + + 1 + + name + support.class.js + + 2 + + name + support.constant.js + + 3 + + name + keyword.operator.js + + + comment + match stuff like: Sound.prototype = { … } when extending an object + match + ([a-zA-Z_?.$][\w?.$]*)\.(prototype)\s*(=)\s* + name + meta.class.js + + + captures + + 1 + + name + support.class.js + + 2 + + name + support.constant.js + + 3 + + name + entity.name.function.js + + 4 + + name + keyword.operator.js + + 5 + + name + storage.type.function.js + + 6 + + name + punctuation.definition.parameters.begin.js + + 7 + + name + variable.parameter.function.js + + 8 + + name + punctuation.definition.parameters.end.js + + + comment + match stuff like: Sound.prototype.play = function() { … } + match + ([a-zA-Z_?.$][\w?.$]*)\.(prototype)\.([a-zA-Z_?.$][\w?.$]*)\s*(=)\s*(function)?\s*(\()(.*?)(\)) + name + meta.function.prototype.js + + + captures + + 1 + + name + support.class.js + + 2 + + name + support.constant.js + + 3 + + name + entity.name.function.js + + 4 + + name + keyword.operator.js + + + comment + match stuff like: Sound.prototype.play = myfunc + match + ([a-zA-Z_?.$][\w?.$]*)\.(prototype)\.([a-zA-Z_?.$][\w?.$]*)\s*(=)\s* + name + meta.function.js + + + captures + + 1 + + name + support.class.js + + 2 + + name + entity.name.function.js + + 3 + + name + keyword.operator.js + + 4 + + name + storage.type.function.js + + 5 + + name + punctuation.definition.parameters.begin.js + + 6 + + name + variable.parameter.function.js + + 7 + + name + punctuation.definition.parameters.end.js + + + comment + match stuff like: Sound.play = function() { … } + match + ([a-zA-Z_?.$][\w?.$]*)\.([a-zA-Z_?.$][\w?.$]*)\s*(=)\s*(function)\s*(\()(.*?)(\)) + name + meta.function.js + + + captures + + 1 + + name + entity.name.function.js + + 2 + + name + keyword.operator.js + + 3 + + name + storage.type.function.js + + 4 + + name + punctuation.definition.parameters.begin.js + + 5 + + name + variable.parameter.function.js + + 6 + + name + punctuation.definition.parameters.end.js + + + comment + match stuff like: play = function() { … } + match + ([a-zA-Z_?$][\w?$]*)\s*(=)\s*(function)\s*(\()(.*?)(\)) + name + meta.function.js + + + captures + + 1 + + name + storage.type.function.js + + 2 + + name + entity.name.function.js + + 3 + + name + punctuation.definition.parameters.begin.js + + 4 + + name + variable.parameter.function.js + + 5 + + name + punctuation.definition.parameters.end.js + + + comment + match regular function like: function myFunc(arg) { … } + match + \b(function)\s+([a-zA-Z_$]\w*)?\s*(\()(.*?)(\)) + name + meta.function.js + + + captures + + 1 + + name + entity.name.function.js + + 2 + + name + storage.type.function.js + + 3 + + name + punctuation.definition.parameters.begin.js + + 4 + + name + variable.parameter.function.js + + 5 + + name + punctuation.definition.parameters.end.js + + + comment + match stuff like: foobar: function() { … } + match + \b([a-zA-Z_?.$][\w?.$]*)\s*:\s*\b(function)?\s*(\()(.*?)(\)) + name + meta.function.json.js + + + captures + + 1 + + name + string.quoted.single.js + + 10 + + name + punctuation.definition.parameters.begin.js + + 11 + + name + variable.parameter.function.js + + 12 + + name + punctuation.definition.parameters.end.js + + 2 + + name + punctuation.definition.string.begin.js + + 3 + + name + entity.name.function.js + + 4 + + name + punctuation.definition.string.end.js + + 5 + + name + string.quoted.double.js + + 6 + + name + punctuation.definition.string.begin.js + + 7 + + name + entity.name.function.js + + 8 + + name + punctuation.definition.string.end.js + + 9 + + name + entity.name.function.js + + + comment + Attempt to match "foo": function + match + (?:((')([^']*)('))|((")([^"]*)(")))\s*:\s*\b(function)?\s*(\()([^)]*)(\)) + + name + meta.function.json.js + + + captures + + 1 + + name + keyword.operator.new.js + + 2 + + name + entity.name.type.instance.js + + + match + (new)\s+(\w+(?:\.\w*)?) + name + meta.class.instance.constructor + + + match + \b(console)\b + name + entity.name.type.object.js.firebug + + + match + \.(warn|info|log|error|time|timeEnd|assert)\b + name + support.function.js.firebug + + + match + \b((0(x|X)[0-9a-fA-F]+)|([0-9]+(\.[0-9]+)?))\b + name + constant.numeric.js + + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.js + + + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.js + + + name + string.quoted.single.js + patterns + + + match + \\(x\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.) + name + constant.character.escape.js + + + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.js + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.js + + + name + string.quoted.double.js + patterns + + + match + \\(x\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.) + name + constant.character.escape.js + + + + + begin + /\*\*(?!/) + captures + + 0 + + name + punctuation.definition.comment.js + + + end + \*/ + name + comment.block.documentation.js + + + begin + /\* + captures + + 0 + + name + punctuation.definition.comment.js + + + end + \*/ + name + comment.block.js + + + captures + + 1 + + name + punctuation.definition.comment.js + + + match + (//).*$\n? + name + comment.line.double-slash.js + + + captures + + 0 + + name + punctuation.definition.comment.html.js + + 2 + + name + punctuation.definition.comment.html.js + + + match + (<!--|-->) + name + comment.block.html.js + + + match + \b(boolean|byte|char|class|double|enum|float|function|int|interface|long|short|var|void)\b + name + storage.type.js + + + match + \b(const|export|extends|final|implements|native|private|protected|public|static|synchronized|throws|transient|volatile)\b + name + storage.modifier.js + + + match + \b(break|case|catch|continue|default|do|else|finally|for|goto|if|import|package|return|switch|throw|try|while)\b + name + keyword.control.js + + + match + \b(delete|in|instanceof|new|typeof|with)\b + name + keyword.operator.js + + + match + \btrue\b + name + constant.language.boolean.true.js + + + match + \bfalse\b + name + constant.language.boolean.false.js + + + match + \bnull\b + name + constant.language.null.js + + + match + \b(super|this)\b + name + variable.language.js + + + match + \b(debugger)\b + name + keyword.other.js + + + match + \b(Anchor|Applet|Area|Array|Boolean|Button|Checkbox|Date|document|event|FileUpload|Form|Frame|Function|Hidden|History|Image|JavaArray|JavaClass|JavaObject|JavaPackage|java|Layer|Link|Location|Math|MimeType|Number|navigator|netscape|Object|Option|Packages|Password|Plugin|Radio|RegExp|Reset|Select|String|Style|Submit|screen|sun|Text|Textarea|window|XMLHttpRequest)\b + name + support.class.js + + + match + \b(s(h(ift|ow(Mod(elessDialog|alDialog)|Help))|croll(X|By(Pages|Lines)?|Y|To)?|t(op|rike)|i(n|zeToContent|debar|gnText)|ort|u(p|b(str(ing)?)?)|pli(ce|t)|e(nd|t(Re(sizable|questHeader)|M(i(nutes|lliseconds)|onth)|Seconds|Ho(tKeys|urs)|Year|Cursor|Time(out)?|Interval|ZOptions|Date|UTC(M(i(nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(ome|andleEvent)|navigate|c(har(CodeAt|At)|o(s|n(cat|textual|firm)|mpile)|eil|lear(Timeout|Interval)?|a(ptureEvents|ll)|reate(StyleSheet|Popup|EventObject))|t(o(GMTString|S(tring|ource)|U(TCString|pperCase)|Lo(caleString|werCase))|est|a(n|int(Enabled)?))|i(s(NaN|Finite)|ndexOf|talics)|d(isableExternalCapture|ump|etachEvent)|u(n(shift|taint|escape|watch)|pdateCommands)|j(oin|avaEnabled)|p(o(p|w)|ush|lugins.refresh|a(ddings|rse(Int|Float)?)|r(int|ompt|eference))|e(scape|nableExternalCapture|val|lementFromPoint|x(p|ec(Script|Command)?))|valueOf|UTC|queryCommand(State|Indeterm|Enabled|Value)|f(i(nd|le(ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(nt(size|color)|rward)|loor|romCharCode)|watch|l(ink|o(ad|g)|astIndexOf)|a(sin|nchor|cos|t(tachEvent|ob|an(2)?)|pply|lert|b(s|ort))|r(ou(nd|teEvents)|e(size(By|To)|calc|turnValue|place|verse|l(oad|ease(Capture|Events)))|andom)|g(o|et(ResponseHeader|M(i(nutes|lliseconds)|onth)|Se(conds|lection)|Hours|Year|Time(zoneOffset)?|Da(y|te)|UTC(M(i(nutes|lliseconds)|onth)|Seconds|Hours|Da(y|te)|FullYear)|FullYear|A(ttention|llResponseHeaders)))|m(in|ove(B(y|elow)|To(Absolute)?|Above)|ergeAttributes|a(tch|rgins|x))|b(toa|ig|o(ld|rderWidths)|link|ack))\b(?=\() + name + support.function.js + + + match + \b(s(ub(stringData|mit)|plitText|e(t(NamedItem|Attribute(Node)?)|lect))|has(ChildNodes|Feature)|namedItem|c(l(ick|o(se|neNode))|reate(C(omment|DATASection|aption)|T(Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(ntityReference|lement)|Attribute))|tabIndex|i(nsert(Row|Before|Cell|Data)|tem)|open|delete(Row|C(ell|aption)|T(Head|Foot)|Data)|focus|write(ln)?|a(dd|ppend(Child|Data))|re(set|place(Child|Data)|move(NamedItem|Child|Attribute(Node)?)?)|get(NamedItem|Element(sBy(Name|TagName)|ById)|Attribute(Node)?)|blur)\b(?=\() + name + support.function.dom.js + + + match + (?<=\.)(s(ystemLanguage|cr(ipts|ollbars|een(X|Y|Top|Left))|t(yle(Sheets)?|atus(Text|bar)?)|ibling(Below|Above)|ource|uffixes|e(curity(Policy)?|l(ection|f)))|h(istory|ost(name)?|as(h|Focus))|y|X(MLDocument|SLDocument)|n(ext|ame(space(s|URI)|Prop))|M(IN_VALUE|AX_VALUE)|c(haracterSet|o(n(structor|trollers)|okieEnabled|lorDepth|mp(onents|lete))|urrent|puClass|l(i(p(boardData)?|entInformation)|osed|asses)|alle(e|r)|rypto)|t(o(olbar|p)|ext(Transform|Indent|Decoration|Align)|ags)|SQRT(1_2|2)|i(n(ner(Height|Width)|put)|ds|gnoreCase)|zIndex|o(scpu|n(readystatechange|Line)|uter(Height|Width)|p(sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(i(splay|alog(Height|Top|Width|Left|Arguments)|rectories)|e(scription|fault(Status|Ch(ecked|arset)|View)))|u(ser(Profile|Language|Agent)|n(iqueID|defined)|pdateInterval)|_content|p(ixelDepth|ort|ersonalbar|kcs11|l(ugins|atform)|a(thname|dding(Right|Bottom|Top|Left)|rent(Window|Layer)?|ge(X(Offset)?|Y(Offset)?))|r(o(to(col|type)|duct(Sub)?|mpter)|e(vious|fix)))|e(n(coding|abledPlugin)|x(ternal|pando)|mbeds)|v(isibility|endor(Sub)?|Linkcolor)|URLUnencoded|P(I|OSITIVE_INFINITY)|f(ilename|o(nt(Size|Family|Weight)|rmName)|rame(s|Element)|gColor)|E|whiteSpace|l(i(stStyleType|n(eHeight|kColor))|o(ca(tion(bar)?|lName)|wsrc)|e(ngth|ft(Context)?)|a(st(M(odified|atch)|Index|Paren)|yer(s|X)|nguage))|a(pp(MinorVersion|Name|Co(deName|re)|Version)|vail(Height|Top|Width|Left)|ll|r(ity|guments)|Linkcolor|bove)|r(ight(Context)?|e(sponse(XML|Text)|adyState))|global|x|m(imeTypes|ultiline|enubar|argin(Right|Bottom|Top|Left))|L(N(10|2)|OG(10E|2E))|b(o(ttom|rder(Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(Color|Image)))\b + name + support.constant.js + + + match + (?<=\.)(s(hape|ystemId|c(heme|ope|rolling)|ta(ndby|rt)|ize|ummary|pecified|e(ctionRowIndex|lected(Index)?)|rc)|h(space|t(tpEquiv|mlFor)|e(ight|aders)|ref(lang)?)|n(o(Resize|tation(s|Name)|Shade|Href|de(Name|Type|Value)|Wrap)|extSibling|ame)|c(h(ildNodes|Off|ecked|arset)?|ite|o(ntent|o(kie|rds)|de(Base|Type)?|l(s|Span|or)|mpact)|ell(s|Spacing|Padding)|l(ear|assName)|aption)|t(ype|Bodies|itle|Head|ext|a(rget|gName)|Foot)|i(sMap|ndex|d|m(plementation|ages))|o(ptions|wnerDocument|bject)|d(i(sabled|r)|o(c(type|umentElement)|main)|e(clare|f(er|ault(Selected|Checked|Value)))|at(eTime|a))|useMap|p(ublicId|arentNode|r(o(file|mpt)|eviousSibling))|e(n(ctype|tities)|vent|lements)|v(space|ersion|alue(Type)?|Link|Align)|URL|f(irstChild|orm(s)?|ace|rame(Border)?)|width|l(ink(s)?|o(ngDesc|wSrc)|a(stChild|ng|bel))|a(nchors|c(ce(ssKey|pt(Charset)?)|tion)|ttributes|pplets|l(t|ign)|r(chive|eas)|xis|Link|bbr)|r(ow(s|Span|Index)|ules|e(v|ferrer|l|adOnly))|m(ultiple|e(thod|dia)|a(rgin(Height|Width)|xLength))|b(o(dy|rder)|ackground|gColor))\b + name + support.constant.dom.js + + + match + \b(ELEMENT_NODE|ATTRIBUTE_NODE|TEXT_NODE|CDATA_SECTION_NODE|ENTITY_REFERENCE_NODE|ENTITY_NODE|PROCESSING_INSTRUCTION_NODE|COMMENT_NODE|DOCUMENT_NODE|DOCUMENT_TYPE_NODE|DOCUMENT_FRAGMENT_NODE|NOTATION_NODE|INDEX_SIZE_ERR|DOMSTRING_SIZE_ERR|HIERARCHY_REQUEST_ERR|WRONG_DOCUMENT_ERR|INVALID_CHARACTER_ERR|NO_DATA_ALLOWED_ERR|NO_MODIFICATION_ALLOWED_ERR|NOT_FOUND_ERR|NOT_SUPPORTED_ERR|INUSE_ATTRIBUTE_ERR)\b + name + support.constant.dom.js + + + match + \bon(R(ow(s(inserted|delete)|e(nter|xit))|e(s(ize(start|end)?|et)|adystatechange))|Mouse(o(ut|ver)|down|up|move)|B(efore(cut|deactivate|u(nload|pdate)|p(aste|rint)|editfocus|activate)|lur)|S(croll|top|ubmit|elect(start|ionchange)?)|H(over|elp)|C(hange|ont(extmenu|rolselect)|ut|ellchange|l(ick|ose))|D(eactivate|ata(setc(hanged|omplete)|available)|r(op|ag(start|over|drop|en(ter|d)|leave)?)|blclick)|Unload|P(aste|ropertychange)|Error(update)?|Key(down|up|press)|Focus|Load|A(ctivate|fter(update|print)|bort))\b + name + support.function.event-handler.js + + + match + !|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|(?<!\()/=|%=|\+=|\-=|&=|\^=|\b(in|instanceof|new|delete|typeof|void)\b + name + keyword.operator.js + + + match + \b(Infinity|NaN|undefined)\b + name + constant.language.js + + + begin + (?<=[=(:]|^|return|&&|\|\||!)\s*(/)(?![/*+{}?]) + beginCaptures + + 1 + + name + punctuation.definition.string.begin.js + + + end + (/)[igm]* + endCaptures + + 1 + + name + punctuation.definition.string.end.js + + + name + string.regexp.js + patterns + + + match + \\. + name + constant.character.escape.js + + + + + match + \; + name + punctuation.terminator.statement.js + + + match + ,[ |\t]* + name + meta.delimiter.object.comma.js + + + match + \. + name + meta.delimiter.method.period.js + + + match + \{|\} + name + meta.brace.curly.js + + + match + \(|\) + name + meta.brace.round.js + + + match + \[|\] + name + meta.brace.square.js + + + scopeName + source.js + uuid + 93E017CC-6F27-11D9-90EB-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/LaTeX Beamer.tmLanguage b/app/rcc/edbee/syntaxfiles/LaTeX Beamer.tmLanguage new file mode 100644 index 00000000..33176c98 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/LaTeX Beamer.tmLanguage @@ -0,0 +1,106 @@ + + + + + fileTypes + + firstLineMatch + ^\\documentclass(\[.*\])?\{beamer\} + foldingStartMarker + \\begin\{.*\}|%.*\(fold\)\s*$ + foldingStopMarker + \\end\{.*\}|%.*\(end\)\s*$ + keyEquivalent + ^~B + name + LaTeX Beamer + patterns + + + begin + (?:\s*)((\\)begin)(\{)(frame)(\}) + captures + + 1 + + name + support.function.be.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.arguments.begin.latex + + 4 + + name + variable.parameter.function.latex + + 5 + + name + punctuation.definition.arguments.end.latex + + + end + ((\\)end)(\{)(frame)(\}) + name + meta.function.environment.frame.latex + patterns + + + include + $self + + + + + captures + + 1 + + name + support.function.frametitle.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.arguments.begin.latex + + 4 + + name + entity.name.function.frame.latex + + 5 + + name + punctuation.definition.arguments.end.latex + + + match + ((\\)frametitle)(\{)(.*)(\}) + name + meta.function.frametitle.latex + + + include + text.tex.latex + + + scopeName + text.tex.latex.beamer + uuid + 2ACA20AA-B008-469B-A04A-6DE232973ED8 + + diff --git a/app/rcc/edbee/syntaxfiles/LaTeX.tmLanguage b/app/rcc/edbee/syntaxfiles/LaTeX.tmLanguage new file mode 100644 index 00000000..8055dcb9 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/LaTeX.tmLanguage @@ -0,0 +1,1554 @@ + + + + + fileTypes + + tex + + firstLineMatch + ^\\documentclass(?!.*\{beamer\}) + foldingStartMarker + \\begin\{.*\}|%.*\(fold\)\s*$ + foldingStopMarker + \\end\{.*\}|%.*\(end\)\s*$ + keyEquivalent + ^~L + name + LaTeX + patterns + + + match + (?=\s)(?<=\\[\w@]|\\[\w@]{2}|\\[\w@]{3}|\\[\w@]{4}|\\[\w@]{5}|\\[\w@]{6})\s + name + meta.space-after-command.latex + + + begin + ((\\)(?:usepackage|documentclass))(?:(\[)([^\]]*)(\]))?(\{) + beginCaptures + + 1 + + name + keyword.control.preamble.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.arguments.begin.latex + + 4 + + name + variable.parameter.latex + + 5 + + name + punctuation.definition.arguments.end.latex + + 6 + + name + punctuation.definition.arguments.begin.latex + + + contentName + support.class.latex + end + \} + endCaptures + + 0 + + name + punctuation.definition.arguments.end.latex + + + name + meta.preamble.latex + patterns + + + include + $self + + + + + begin + ((\\)(?:include|input))(\{) + beginCaptures + + 1 + + name + keyword.control.include.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.arguments.begin.latex + + + contentName + support.class.latex + end + \} + endCaptures + + 0 + + name + punctuation.definition.arguments.end.latex + + + name + meta.include.latex + patterns + + + include + $self + + + + + begin + (?x) + ( # Capture 1 + (\\) # Marker + (?: + (?:sub){0,2}section # Functions + | (?:sub)?paragraph + | chapter|part|addpart + | addchap|addsec|minisec + ) + (?:\*)? # Optional Unnumbered + ) + (?: + (\[)([^\[]*?)(\]) # Optional Title + )?? + (\{) # Opening Bracket + + beginCaptures + + 1 + + name + support.function.section.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.arguments.optional.begin.latex + + 4 + + name + entity.name.section.latex + + 5 + + name + punctuation.definition.arguments.optional.end.latex + + 6 + + name + punctuation.definition.arguments.begin.latex + + + comment + this works OK with all kinds of crazy stuff as long as section is one line + contentName + entity.name.section.latex + end + \} + endCaptures + + 0 + + name + punctuation.definition.arguments.end.latex + + + name + meta.function.section.latex + patterns + + + include + $self + + + + + begin + (?:\s*)((\\)begin)(\{)(lstlisting)(\})(?:(\[).*(\]))?(\s*%\s*(?i:Java)\n?) + captures + + 1 + + name + support.function.be.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.arguments.begin.latex + + 4 + + name + variable.parameter.function.latex + + 5 + + name + punctuation.definition.arguments.end.latex + + 6 + + name + punctuation.definition.arguments.optional.begin.latex + + 7 + + name + punctuation.definition.arguments.optional.end.latex + + 8 + + name + comment.line.percentage.latex + + + contentName + source.java.embedded + end + ((\\)end)(\{)(lstlisting)(\}) + name + meta.function.embedded.java.latex + patterns + + + include + source.java + + + + + begin + (?:\s*)((\\)begin)(\{)(lstlisting)(\})(?:(\[).*(\]))?(\s*%\s*(?i:Python)\n?) + captures + + 1 + + name + support.function.be.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.arguments.begin.latex + + 4 + + name + variable.parameter.function.latex + + 5 + + name + punctuation.definition.arguments.end.latex + + 6 + + name + punctuation.definition.arguments.optional.begin.latex + + 7 + + name + punctuation.definition.arguments.optional.end.latex + + 8 + + name + comment.line.percentage.latex + + + comment + Put the lstlisting match before the more general environment listing. Someday it would be nice to make this rule general enough to figure out which language is inside the lstlisting environment rather than my own personal use for python. --Brad + contentName + source.python.embedded + end + ((\\)end)(\{)(lstlisting)(\}) + name + meta.function.embedded.python.latex + patterns + + + include + source.python + + + + + begin + (?:\s*)((\\)begin)(\{)(lstlisting)(\})(?:(\[).*(\]))?(\s*%.*\n?)? + captures + + 1 + + name + support.function.be.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.arguments.begin.latex + + 4 + + name + variable.parameter.function.latex + + 5 + + name + punctuation.definition.arguments.end.latex + + 6 + + name + punctuation.definition.arguments.optional.begin.latex + + 7 + + name + punctuation.definition.arguments.optional.end.latex + + 8 + + name + comment.line.percentage.latex + + + comment + Put the lstlisting match before the more general environment listing. Someday it would be nice to make this rule general enough to figure out which language is inside the lstlisting environment rather than my own personal use for python. --Brad + contentName + source.generic.embedded + end + ((\\)end)(\{)(lstlisting)(\}) + name + meta.function.embedded.generic.latex + + + begin + (?:\s*)((\\)begin)(\{)((?:V|v)erbatim|alltt)(\}) + captures + + 1 + + name + support.function.be.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.arguments.begin.latex + + 4 + + name + variable.parameter.function.latex + + 5 + + name + punctuation.definition.arguments.end.latex + + + contentName + markup.raw.verbatim.latex + end + ((\\)end)(\{)(\4)(\}) + name + meta.function.verbatim.latex + + + captures + + 1 + + name + support.function.url.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.arguments.begin.latex + + 4 + + name + markup.underline.link.latex + + 5 + + name + punctuation.definition.arguments.end.latex + + + match + (?:\s*)((\\)(?:url|href))(\{)([^}]*)(\}) + name + meta.function.link.url.latex + + + captures + + 1 + + name + support.function.be.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.arguments.begin.latex + + 4 + + name + variable.parameter.function.latex + + 5 + + name + punctuation.definition.arguments.end.latex + + + comment + These two patterns match the \begin{document} and \end{document} commands, so that the environment matching pattern following them will ignore those commands. + match + (?:\s*)((\\)begin)(\{)(document)(\}) + name + meta.function.begin-document.latex + + + captures + + 1 + + name + support.function.be.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.arguments.begin.latex + + 4 + + name + variable.parameter.function.latex + + 5 + + name + punctuation.definition.arguments.end.latex + + + match + (?:\s*)((\\)end)(\{)(document)(\}) + name + meta.function.end-document.latex + + + begin + (?x) + (?:\s*) # Optional whitespace + ((\\)begin) # Marker - Function + (\{) # Open Bracket + ( + (?: + align|equation|eqnarray # Argument + | multline|aligned|alignat + | split|gather|gathered + ) + (?:\*)? # Optional Unnumbered + ) + (\}) # Close Bracket + (\s*\n)? # Match to end of line absent of content + + captures + + 1 + + name + support.function.be.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.arguments.begin.latex + + 4 + + name + variable.parameter.function.latex + + 5 + + name + punctuation.definition.arguments.end.latex + + + contentName + string.other.math.block.environment.latex + end + (?x) + (?:\s*) # Optional whitespace + ((\\)end) # Marker - Function + (\{) # Open Bracket + (\4) # Previous capture from begin + (\}) # Close Bracket + (?:\s*\n)? # Match to end of line absent of content + + name + meta.function.environment.math.latex + patterns + + + include + $base + + + + + begin + (?x) + (?:\s*) # Optional whitespace + ((\\)begin) # Marker - Function + (\{) # Open Bracket + (array|tabular[xy*]?) + (\}) # Close Bracket + (\s*\n)? # Match to end of line absent of content + + captures + + 1 + + name + support.function.be.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.arguments.begin.latex + + 4 + + name + variable.parameter.function.latex + + 5 + + name + punctuation.definition.arguments.end.latex + + + contentName + meta.data.environment.tabular.latex + end + (?x) + (?:\s*) # Optional whitespace + ((\\)end) # Marker - Function + (\{) # Open Bracket + (\4) # Previous capture from begin + (\}) # Close Bracket + (?:\s*\n)? # Match to end of line absent of content + + name + meta.function.environment.tabular.latex + patterns + + + match + \\ + name + punctuation.definition.table.row.latex + + + begin + (?:^|(?<=\\\\))(?!\\\\|\s*\\end\{(?:tabular|array)) + end + (?=\\\\|\s*\\end\{(?:tabular|array)) + name + meta.row.environment.tabular.latex + patterns + + + match + & + name + punctuation.definition.table.cell.latex + + + begin + (?:^|(?<=&))((?!&|\\\\|$)) + end + (?=&|\\\\|\s*\\end\{(?:tabular|array)) + name + meta.cell.environment.tabular.latex + patterns + + + include + $base + + + + + include + $base + + + + + include + $base + + + + + begin + (?:\s*)((\\)begin)(\{)(itemize|enumerate|description|list)(\}) + captures + + 1 + + name + support.function.be.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.arguments.latex + + 4 + + name + variable.parameter.function.latex + + 5 + + name + punctuation.definition.arguments.latex + + + end + ((\\)end)(\{)(\4)(\})(?:\s*\n)? + name + meta.function.environment.list.latex + patterns + + + include + $base + + + + + begin + (?:\s*)((\\)begin)(\{)(\w+[*]?)(\}) + captures + + 1 + + name + support.function.be.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.arguments.latex + + 4 + + name + variable.parameter.function.latex + + 5 + + name + punctuation.definition.arguments.latex + + + end + ((\\)end)(\{)(\4)(\})(?:\s*\n)? + name + meta.function.environment.general.latex + patterns + + + include + $base + + + + + captures + + 1 + + name + punctuation.definition.function.latex + + + match + (\\)(newcommand|renewcommand)\b + name + storage.type.function.latex + + + begin + ((\\)marginpar)(\{) + beginCaptures + + 1 + + name + support.function.marginpar.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.marginpar.begin.latex + + + contentName + meta.paragraph.margin.latex + end + \} + endCaptures + + 0 + + name + punctuation.definition.marginpar.end.latex + + + patterns + + + include + $base + + + + + begin + ((\\)footnote)(\{) + beginCaptures + + 1 + + name + support.function.footnote.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.footnote.begin.latex + + + contentName + meta.footnote.latex + end + \} + endCaptures + + 0 + + name + punctuation.definition.footnote.end.latex + + + patterns + + + include + $base + + + + + begin + ((\\)emph)(\{) + beginCaptures + + 1 + + name + support.function.emph.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.emph.begin.latex + + + contentName + markup.italic.emph.latex + end + \} + endCaptures + + 0 + + name + punctuation.definition.emph.end.latex + + + name + meta.function.emph.latex + patterns + + + include + $base + + + + + begin + ((\\)textit)(\{) + captures + + 1 + + name + support.function.textit.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.textit.begin.latex + + + comment + We put the keyword in a capture and name this capture, so that disabling spell checking for “keyword” won't be inherited by the argument to \textit{...}. + +Put specific matches for particular LaTeX keyword.functions before the last two more general functions + contentName + markup.italic.textit.latex + end + \} + endCaptures + + 0 + + name + punctuation.definition.textit.end.latex + + + name + meta.function.textit.latex + patterns + + + include + $base + + + + + begin + ((\\)textbf)(\{) + captures + + 1 + + name + support.function.textbf.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.textbf.begin.latex + + + contentName + markup.bold.textbf.latex + end + \} + endCaptures + + 0 + + name + punctuation.definition.textbf.end.latex + + + name + meta.function.textbf.latex + patterns + + + include + $base + + + + + begin + ((\\)texttt)(\{) + captures + + 1 + + name + support.function.texttt.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.texttt.begin.latex + + + contentName + markup.raw.texttt.latex + end + \} + endCaptures + + 0 + + name + punctuation.definition.texttt.end.latex + + + name + meta.function.texttt.latex + patterns + + + include + $base + + + + + captures + + 0 + + name + keyword.other.item.latex + + 1 + + name + punctuation.definition.keyword.latex + + + match + (\\)item\b + name + meta.scope.item.latex + + + begin + (?x) + ( + (\\) # Marker + (?:foot)?(?:full)?(?:no)?(?:short)? # Function Name + [cC]ite + (?:al)?(?:t|p|author|year(?:par)?|title)?[ANP]* + \*? # Optional Unabreviated + ) + (?:(\[)[^\]]*(\]))? # Optional + (?:(\[)[^\]]*(\]))? # Arguments + (\{) # Opening Bracket + + captures + + 1 + + name + keyword.control.cite.latex + + 2 + + name + punctuation.definition.keyword.latex + + 3 + + name + punctuation.definition.arguments.optional.begin.latex + + 4 + + name + punctuation.definition.arguments.optional.end.latex + + 5 + + name + punctuation.definition.arguments.optional.begin.latex + + 6 + + name + punctuation.definition.arguments.optional.end.latex + + 7 + + name + punctuation.definition.arguments.latex + + + end + \} + endCaptures + + 0 + + name + punctuation.definition.arguments.latex + + + name + meta.citation.latex + patterns + + + match + [\w:.]+ + name + constant.other.reference.citation.latex + + + + + begin + ((\\)(?:\w*[r|R]ef\*?))(\{) + beginCaptures + + 1 + + name + keyword.control.ref.latex + + 2 + + name + punctuation.definition.keyword.latex + + 3 + + name + punctuation.definition.arguments.begin.latex + + + end + \} + endCaptures + + 0 + + name + punctuation.definition.arguments.begin.latex + + + name + meta.reference.label.latex + patterns + + + match + [a-zA-Z0-9\.,:/*!^_-] + name + constant.other.reference.label.latex + + + + + begin + ((\\)label)(\{) + beginCaptures + + 1 + + name + keyword.control.label.latex + + 2 + + name + punctuation.definition.keyword.latex + + 3 + + name + punctuation.definition.arguments.begin.latex + + + end + \} + endCaptures + + 0 + + name + punctuation.definition.arguments.end.latex + + + name + meta.definition.label.latex + patterns + + + match + [a-zA-Z0-9\.,:/*!^_-] + name + variable.parameter.definition.label.latex + + + + + begin + ((\\)verb[\*]?)\s*((\\)scantokens)(\{) + beginCaptures + + 1 + + name + support.function.verb.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + support.function.verb.latex + + 4 + + name + punctuation.definition.verb.latex + + 5 + + name + punctuation.definition.begin.latex + + + contentName + markup.raw.verb.latex + end + (\}) + endCaptures + + 1 + + name + punctuation.definition.end.latex + + + name + meta.function.verb.latex + patterns + + + include + $self + + + + + captures + + 1 + + name + support.function.verb.latex + + 2 + + name + punctuation.definition.function.latex + + 3 + + name + punctuation.definition.verb.latex + + 4 + + name + markup.raw.verb.latex + + 5 + + name + punctuation.definition.verb.latex + + + match + ((\\)verb[\*]?)\s*((?<=\s)\S|[^a-zA-Z])(.*?)(\3|$) + name + meta.function.verb.latex + + + begin + "` + beginCaptures + + 0 + + name + punctuation.definition.string.begin.latex + + + end + "' + endCaptures + + 0 + + name + punctuation.definition.string.end.latex + + + name + string.quoted.double.european.latex + patterns + + + include + $base + + + + + begin + `` + beginCaptures + + 0 + + name + punctuation.definition.string.begin.latex + + + end + ''|" + endCaptures + + 0 + + name + punctuation.definition.string.end.latex + + + name + string.quoted.double.latex + patterns + + + include + $base + + + + + begin + "> + beginCaptures + + 0 + + name + punctuation.definition.string.begin.latex + + + end + "< + endCaptures + + 0 + + name + punctuation.definition.string.end.latex + + + name + string.quoted.double.guillemot.latex + patterns + + + include + $base + + + + + begin + "< + beginCaptures + + 0 + + name + punctuation.definition.string.begin.latex + + + end + "> + endCaptures + + 0 + + name + punctuation.definition.string.end.latex + + + name + string.quoted.double.guillemot.latex + patterns + + + include + $base + + + + + begin + \\\( + beginCaptures + + 0 + + name + punctuation.definition.string.begin.latex + + + end + \\\) + endCaptures + + 0 + + name + punctuation.definition.string.end.latex + + + name + string.other.math.latex + patterns + + + include + $base + + + + + begin + \\\[ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.latex + + + end + \\\] + endCaptures + + 0 + + name + punctuation.definition.string.end.latex + + + name + string.other.math.latex + patterns + + + include + $base + + + + + match + (?<!\S)'.*?' + name + invalid.illegal.string.quoted.single.latex + + + match + (?<!\S)".*?" + name + invalid.illegal.string.quoted.double.latex + + + captures + + 1 + + name + punctuation.definition.constant.latex + + + match + (\\)(text(s(terling|ixoldstyle|urd|e(ction|venoldstyle|rvicemark))|yen|n(ineoldstyle|umero|aira)|c(ircledP|o(py(left|right)|lonmonetary)|urrency|e(nt(oldstyle)?|lsius))|t(hree(superior|oldstyle|quarters(emdash)?)|i(ldelow|mes)|w(o(superior|oldstyle)|elveudash)|rademark)|interrobang(down)?|zerooldstyle|o(hm|ne(superior|half|oldstyle|quarter)|penbullet|rd(feminine|masculine))|d(i(scount|ed|v(orced)?)|o(ng|wnarrow|llar(oldstyle)?)|egree|agger(dbl)?|blhyphen(char)?)|uparrow|p(ilcrow|e(so|r(t(housand|enthousand)|iodcentered))|aragraph|m)|e(stimated|ightoldstyle|uro)|quotes(traight(dblbase|base)|ingle)|f(iveoldstyle|ouroldstyle|lorin|ractionsolidus)|won|l(not|ira|e(ftarrow|af)|quill|angle|brackdbl)|a(s(cii(caron|dieresis|acute|grave|macron|breve)|teriskcentered)|cutedbl)|r(ightarrow|e(cipe|ferencemark|gistered)|quill|angle|brackdbl)|g(uarani|ravedbl)|m(ho|inus|u(sicalnote)?|arried)|b(igcircle|orn|ullet|lank|a(ht|rdbl)|rokenbar)))\b + name + constant.character.latex + + + captures + + 1 + + name + punctuation.definition.column-specials.begin.latex + + 2 + + name + punctuation.definition.column-specials.end.latex + + + match + (?:<|>)(\{)\$(\}) + name + meta.column-specials.latex + + + include + text.tex + + + scopeName + text.tex.latex + uuid + 3BEEA00C-6B1D-11D9-B8AD-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/Lisp.tmLanguage b/app/rcc/edbee/syntaxfiles/Lisp.tmLanguage new file mode 100644 index 00000000..e567402b --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Lisp.tmLanguage @@ -0,0 +1,160 @@ + + + + + comment + + fileTypes + + lisp + cl + l + mud + el + + foldingStartMarker + \( + foldingStopMarker + \) + keyEquivalent + ^~L + name + Lisp + patterns + + + captures + + 1 + + name + punctuation.definition.comment.lisp + + + match + (;).*$\n? + name + comment.line.semicolon.lisp + + + captures + + 2 + + name + storage.type.function-type.lisp + + 4 + + name + entity.name.function.lisp + + + match + (\b(?i:(defun|defmethod|defmacro))\b)(\s+)((\w|\-|\!|\?)*) + name + meta.function.lisp + + + captures + + 1 + + name + punctuation.definition.constant.lisp + + + match + (#)(\w|[\\+-=<>'"&#])+ + name + constant.character.lisp + + + captures + + 1 + + name + punctuation.definition.variable.lisp + + 3 + + name + punctuation.definition.variable.lisp + + + match + (\*)(\S*)(\*) + name + variable.other.global.lisp + + + match + \b(?i:case|do|let|loop|if|else|when)\b + name + keyword.control.lisp + + + match + \b(?i:eq|neq|and|or)\b + name + keyword.operator.lisp + + + match + \b(?i:null|nil)\b + name + constant.language.lisp + + + match + \b(?i:cons|car|cdr|cond|lambda|format|setq|setf|quote|eval|append|list|listp|memberp|t|load|progn)\b + name + support.function.lisp + + + match + \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\b + name + constant.numeric.lisp + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.lisp + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.lisp + + + name + string.quoted.double.lisp + patterns + + + match + \\. + name + constant.character.escape.lisp + + + + + scopeName + source.lisp + uuid + 00D451C9-6B1D-11D9-8DFA-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/Lua.tmLanguage b/app/rcc/edbee/syntaxfiles/Lua.tmLanguage new file mode 100644 index 00000000..09973d31 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Lua.tmLanguage @@ -0,0 +1,234 @@ + + + + + comment + Lua Syntax: version 0.8 + fileTypes + + lua + + foldingStartMarker + ^\s*\b(function|local\s+function|if|for)\b|{[ \t]*$|\[\[ + foldingStopMarker + \bend\b|^\s*}|\]\] + keyEquivalent + ^~L + name + Lua + patterns + + + captures + + 1 + + name + keyword.control.lua + + 2 + + name + entity.name.function.scope.lua + + 3 + + name + entity.name.function.lua + + 4 + + name + punctuation.definition.parameters.begin.lua + + 5 + + name + variable.parameter.function.lua + + 6 + + name + punctuation.definition.parameters.end.lua + + + match + \b(function)\s+([a-zA-Z_.:]+[.:])?([a-zA-Z_]\w*)\s*(\()([^)]*)(\)) + name + meta.function.lua + + + match + (?<![\d.])\s0x[a-fA-F\d]+|\b\d+(\.\d+)?([eE]-?\d+)?|\.\d+([eE]-?\d+)? + name + constant.numeric.lua + + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.lua + + + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.lua + + + name + string.quoted.single.lua + patterns + + + match + \\. + name + constant.character.escape.lua + + + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.lua + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.lua + + + name + string.quoted.double.lua + patterns + + + match + \\. + name + constant.character.escape.lua + + + + + begin + (?<!--)\[(=*)\[ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.lua + + + end + \]\1\] + endCaptures + + 0 + + name + punctuation.definition.string.end.lua + + + name + string.quoted.other.multiline.lua + + + begin + --\[(=*)\[ + captures + + 0 + + name + punctuation.definition.comment.lua + + + end + \]\1\] + name + comment.block.lua + + + captures + + 1 + + name + punctuation.definition.comment.lua + + + match + (--)(?!\[\[).*$\n? + name + comment.line.double-dash.lua + + + match + \b(break|do|else|for|if|elseif|return|then|repeat|while|until|end|function|local|in)\b + name + keyword.control.lua + + + match + (?<![^.]\.|:)\b(false|nil|true|_G|_VERSION|math\.(pi|huge))\b|(?<![.])\.{3}(?!\.) + name + constant.language.lua + + + match + (?<![^.]\.|:)\b(self)\b + name + variable.language.self.lua + + + match + (?<![^.]\.|:)\b(assert|collectgarbage|dofile|error|getfenv|getmetatable|ipairs|loadfile|loadstring|module|next|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)\b(?=[( {]) + name + support.function.lua + + + match + (?<![^.]\.|:)\b(coroutine\.(create|resume|running|status|wrap|yield)|string\.(byte|char|dump|find|format|gmatch|gsub|len|lower|match|rep|reverse|sub|upper)|table\.(concat|insert|maxn|remove|sort)|math\.(abs|acos|asin|atan2?|ceil|cosh?|deg|exp|floor|fmod|frexp|ldexp|log|log10|max|min|modf|pow|rad|random|randomseed|sinh?|sqrt|tanh?)|io\.(close|flush|input|lines|open|output|popen|read|tmpfile|type|write)|os\.(clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\.(cpath|loaded|loadlib|path|preload|seeall)|debug\.(debug|[gs]etfenv|[gs]ethook|getinfo|[gs]etlocal|[gs]etmetatable|getregistry|[gs]etupvalue|traceback))\b(?=[( {]) + name + support.function.library.lua + + + match + \b(and|or|not)\b + name + keyword.operator.lua + + + match + \+|-|%|#|\*|\/|\^|==?|~=|<=?|>=?|(?<!\.)\.{2}(?!\.) + name + keyword.operator.lua + + + scopeName + source.lua + uuid + 93E017CC-6F27-11D9-90EB-000D93589AF7 + + diff --git a/app/rcc/edbee/syntaxfiles/Makefile.tmLanguage b/app/rcc/edbee/syntaxfiles/Makefile.tmLanguage new file mode 100644 index 00000000..41cfff86 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Makefile.tmLanguage @@ -0,0 +1,98 @@ + + + + + fileTypes + + GNUmakefile + makefile + Makefile + OCamlMakefile + make + + name + Makefile + patterns + + + begin + ^(\w|[-_])+\s*\??= + end + $ + name + variable.other.makefile + patterns + + + match + \\\n + + + + + begin + ` + end + ` + name + string.interpolated.backtick.makefile + patterns + + + include + source.shell + + + + + begin + # + beginCaptures + + 0 + + name + punctuation.definition.comment.makefile + + + end + $\n? + name + comment.line.number-sign.makefile + patterns + + + match + (?<!\\)\\$\n + name + punctuation.separator.continuation.makefile + + + + + match + ^(\s*)\b(\-??include|ifeq|ifneq|ifdef|ifndef|else|endif|vpath|export|unexport|define|endef|override)\b + name + keyword.control.makefile + + + captures + + 1 + + name + entity.name.function.makefile + + + match + ^([^\t ]+(\s[^\t ]+)*:(?!\=))\s*.* + name + meta.function.makefile + + + scopeName + source.makefile + uuid + FF1825E8-6B1C-11D9-B883-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/Markdown.tmLanguage b/app/rcc/edbee/syntaxfiles/Markdown.tmLanguage new file mode 100644 index 00000000..d393d06e --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Markdown.tmLanguage @@ -0,0 +1,1178 @@ + + + + + fileTypes + + mdown + markdown + markdn + md + + foldingStartMarker + (?x) + (<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\b.*?> + |<!--(?!.*-->) + |\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/))) + ) + foldingStopMarker + (?x) + (</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)> + |^\s*--> + |(^|\s)\} + ) + keyEquivalent + ^~M + name + Markdown + patterns + + + begin + (?x)^ + (?= [ ]{,3}>. + | ([ ]{4}|\t)(?!$) + | [#]{1,6}\s*+ + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ + ) + comment + + We could also use an empty end match and set + applyEndPatternLast, but then we must be sure that the begin + pattern will only match stuff matched by the sub-patterns. + + end + (?x)^ + (?! [ ]{,3}>. + | ([ ]{4}|\t) + | [#]{1,6}\s*+ + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ + ) + name + meta.block-level.markdown + patterns + + + include + #block_quote + + + include + #block_raw + + + include + #heading + + + include + #separator + + + + + begin + ^[ ]{0,3}([*+-])(?=\s) + captures + + 1 + + name + punctuation.definition.list_item.markdown + + + end + ^(?=\S) + name + markup.list.unnumbered.markdown + patterns + + + include + #list-paragraph + + + + + begin + ^[ ]{0,3}[0-9]+(\.)(?=\s) + captures + + 1 + + name + punctuation.definition.list_item.markdown + + + end + ^(?=\S) + name + markup.list.numbered.markdown + patterns + + + include + #list-paragraph + + + + + begin + ^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)(?!.*?</\1>) + comment + + Markdown formatting is disabled inside block-level tags. + + end + (?<=^</\1>$\n) + name + meta.disable-markdown + patterns + + + include + text.html.basic + + + + + begin + ^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b) + comment + Same rule but for one line disables. + end + $\n? + name + meta.disable-markdown + patterns + + + include + text.html.basic + + + + + captures + + 1 + + name + punctuation.definition.constant.markdown + + 10 + + name + punctuation.definition.string.end.markdown + + 11 + + name + string.other.link.description.title.markdown + + 12 + + name + punctuation.definition.string.begin.markdown + + 13 + + name + punctuation.definition.string.end.markdown + + 2 + + name + constant.other.reference.link.markdown + + 3 + + name + punctuation.definition.constant.markdown + + 4 + + name + punctuation.separator.key-value.markdown + + 5 + + name + punctuation.definition.link.markdown + + 6 + + name + markup.underline.link.markdown + + 7 + + name + punctuation.definition.link.markdown + + 8 + + name + string.other.link.description.title.markdown + + 9 + + name + punctuation.definition.string.begin.markdown + + + match + (?x: + \s* # Leading whitespace + (\[)(.+?)(\])(:) # Reference name + [ \t]* # Optional whitespace + (<?)(\S+?)(>?) # The url + [ \t]* # Optional whitespace + (?: + ((\().+?(\))) # Match title in quotes… + | ((").+?(")) # or in parens. + )? # Title is optional + \s* # Optional whitespace + $ + ) + name + meta.link.reference.def.markdown + + + begin + ^(?=\S)(?![=-]{3,}(?=$)) + end + ^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ \t]*\n|(?=^#) + name + meta.paragraph.markdown + patterns + + + include + #inline + + + include + text.html.basic + + + captures + + 1 + + name + punctuation.definition.heading.markdown + + + match + ^(={3,})(?=[ \t]*$) + name + markup.heading.1.markdown + + + captures + + 1 + + name + punctuation.definition.heading.markdown + + + match + ^(-{3,})(?=[ \t]*$) + name + markup.heading.2.markdown + + + + + repository + + ampersand + + comment + + Markdown will convert this for us. We match it so that the + HTML grammar will not mark it up as invalid. + + match + &(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);) + name + meta.other.valid-ampersand.markdown + + block_quote + + begin + \G[ ]{,3}(>)(?!$)[ ]? + beginCaptures + + 1 + + name + punctuation.definition.blockquote.markdown + + + comment + + We terminate the block quote when seeing an empty line, a + separator or a line with leading > characters. The latter is + to “reset” the quote level for quoted lines. + + end + (?x)^ + (?= \s*$ + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ + | [ ]{,3}>. + ) + name + markup.quote.markdown + patterns + + + begin + (?x)\G + (?= [ ]{,3}>. + ) + end + ^ + patterns + + + include + #block_quote + + + + + applyEndPatternLast + 1 + begin + (?x)\G + (?= ([ ]{4}|\t) + | [#]{1,6}\s*+ + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ + ) + end + ^ + patterns + + + include + #block_raw + + + include + #heading + + + include + #separator + + + + + begin + (?x)\G + (?! $ + | [ ]{,3}>. + | ([ ]{4}|\t) + | [#]{1,6}\s*+ + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ + ) + end + $|(?<=\n) + patterns + + + include + #inline + + + + + + block_raw + + match + \G([ ]{4}|\t).*$\n? + name + markup.raw.block.markdown + + bold + + begin + (?x) + (\*\*|__)(?=\S) # Open + (?= + ( + <[^>]*+> # HTML tags + | (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> + # Raw + | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes + | \[ + ( + (?<square> # Named group + [^\[\]\\] # Match most chars + | \\. # Escaped chars + | \[ \g<square>*+ \] # Nested brackets + )*+ + \] + ( + ( # Reference Link + [ ]? # Optional space + \[[^\]]*+\] # Ref name + ) + | ( # Inline Link + \( # Opening paren + [ \t]*+ # Optional whtiespace + <?(.*?)>? # URL + [ \t]*+ # Optional whtiespace + ( # Optional Title + (?<title>['"]) + (.*?) + \k<title> + )? + \) + ) + ) + ) + | (?!(?<=\S)\1). # Everything besides + # style closer + )++ + (?<=\S)\1 # Close + ) + + captures + + 1 + + name + punctuation.definition.bold.markdown + + + end + (?<=\S)(\1) + name + markup.bold.markdown + patterns + + + applyEndPatternLast + 1 + begin + (?=<[^>]*?>) + end + (?<=>) + patterns + + + include + text.html.basic + + + + + include + #escape + + + include + #ampersand + + + include + #bracket + + + include + #raw + + + include + #italic + + + include + #image-inline + + + include + #link-inline + + + include + #link-inet + + + include + #link-email + + + include + #image-ref + + + include + #link-ref-literal + + + include + #link-ref + + + + bracket + + comment + + Markdown will convert this for us. We match it so that the + HTML grammar will not mark it up as invalid. + + match + <(?![a-z/?\$!]) + name + meta.other.valid-bracket.markdown + + escape + + match + \\[-`*_#+.!(){}\[\]\\>] + name + constant.character.escape.markdown + + heading + + begin + \G(#{1,6})(?!#)\s*(?=\S) + captures + + 1 + + name + punctuation.definition.heading.markdown + + + contentName + entity.name.section.markdown + end + \s*(#*)$\n? + name + markup.heading.markdown + patterns + + + include + #inline + + + + image-inline + + captures + + 1 + + name + punctuation.definition.string.begin.markdown + + 10 + + name + string.other.link.description.title.markdown + + 11 + + name + punctuation.definition.string.markdown + + 12 + + name + punctuation.definition.string.markdown + + 13 + + name + string.other.link.description.title.markdown + + 14 + + name + punctuation.definition.string.markdown + + 15 + + name + punctuation.definition.string.markdown + + 16 + + name + punctuation.definition.metadata.markdown + + 2 + + name + string.other.link.description.markdown + + 3 + + name + punctuation.definition.string.end.markdown + + 5 + + name + invalid.illegal.whitespace.markdown + + 6 + + name + punctuation.definition.metadata.markdown + + 7 + + name + punctuation.definition.link.markdown + + 8 + + name + markup.underline.link.image.markdown + + 9 + + name + punctuation.definition.link.markdown + + + match + (?x: + \! # Images start with ! + (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) + # Match the link text. + ([ ])? # Space not allowed + (\() # Opening paren for url + (<?)(\S+?)(>?) # The url + [ \t]* # Optional whitespace + (?: + ((\().+?(\))) # Match title in parens… + | ((").+?(")) # or in quotes. + )? # Title is optional + \s* # Optional whitespace + (\)) + ) + name + meta.image.inline.markdown + + image-ref + + captures + + 1 + + name + punctuation.definition.string.begin.markdown + + 2 + + name + string.other.link.description.markdown + + 4 + + name + punctuation.definition.string.begin.markdown + + 5 + + name + punctuation.definition.constant.markdown + + 6 + + name + constant.other.reference.link.markdown + + 7 + + name + punctuation.definition.constant.markdown + + + match + \!(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(.*?)(\]) + name + meta.image.reference.markdown + + inline + + patterns + + + include + #escape + + + include + #ampersand + + + include + #bracket + + + include + #raw + + + include + #bold + + + include + #italic + + + include + #line-break + + + include + #image-inline + + + include + #link-inline + + + include + #link-inet + + + include + #link-email + + + include + #image-ref + + + include + #link-ref-literal + + + include + #link-ref + + + + italic + + begin + (?x) + (\*|_)(?=\S) # Open + (?= + ( + <[^>]*+> # HTML tags + | (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> + # Raw + | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes + | \[ + ( + (?<square> # Named group + [^\[\]\\] # Match most chars + | \\. # Escaped chars + | \[ \g<square>*+ \] # Nested brackets + )*+ + \] + ( + ( # Reference Link + [ ]? # Optional space + \[[^\]]*+\] # Ref name + ) + | ( # Inline Link + \( # Opening paren + [ \t]*+ # Optional whtiespace + <?(.*?)>? # URL + [ \t]*+ # Optional whtiespace + ( # Optional Title + (?<title>['"]) + (.*?) + \k<title> + )? + \) + ) + ) + ) + | \1\1 # Must be bold closer + | (?!(?<=\S)\1). # Everything besides + # style closer + )++ + (?<=\S)\1 # Close + ) + + captures + + 1 + + name + punctuation.definition.italic.markdown + + + end + (?<=\S)(\1)((?!\1)|(?=\1\1)) + name + markup.italic.markdown + patterns + + + applyEndPatternLast + 1 + begin + (?=<[^>]*?>) + end + (?<=>) + patterns + + + include + text.html.basic + + + + + include + #escape + + + include + #ampersand + + + include + #bracket + + + include + #raw + + + include + #bold + + + include + #image-inline + + + include + #link-inline + + + include + #link-inet + + + include + #link-email + + + include + #image-ref + + + include + #link-ref-literal + + + include + #link-ref + + + + line-break + + match + {2,}$ + name + meta.dummy.line-break + + link-email + + captures + + 1 + + name + punctuation.definition.link.markdown + + 2 + + name + markup.underline.link.markdown + + 4 + + name + punctuation.definition.link.markdown + + + match + (<)((?:mailto:)?[-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(>) + name + meta.link.email.lt-gt.markdown + + link-inet + + captures + + 1 + + name + punctuation.definition.link.markdown + + 2 + + name + markup.underline.link.markdown + + 3 + + name + punctuation.definition.link.markdown + + + match + (<)((?:https?|ftp)://.*?)(>) + name + meta.link.inet.markdown + + link-inline + + captures + + 1 + + name + punctuation.definition.string.begin.markdown + + 10 + + name + string.other.link.description.title.markdown + + 11 + + name + punctuation.definition.string.begin.markdown + + 12 + + name + punctuation.definition.string.end.markdown + + 13 + + name + string.other.link.description.title.markdown + + 14 + + name + punctuation.definition.string.begin.markdown + + 15 + + name + punctuation.definition.string.end.markdown + + 16 + + name + punctuation.definition.metadata.markdown + + 2 + + name + string.other.link.title.markdown + + 4 + + name + punctuation.definition.string.end.markdown + + 5 + + name + invalid.illegal.whitespace.markdown + + 6 + + name + punctuation.definition.metadata.markdown + + 7 + + name + punctuation.definition.link.markdown + + 8 + + name + markup.underline.link.markdown + + 9 + + name + punctuation.definition.link.markdown + + + match + (?x: + (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) + # Match the link text. + ([ ])? # Space not allowed + (\() # Opening paren for url + (<?)(.*?)(>?) # The url + [ \t]* # Optional whitespace + (?: + ((\().+?(\))) # Match title in parens… + | ((").+?(")) # or in quotes. + )? # Title is optional + \s* # Optional whitespace + (\)) + ) + name + meta.link.inline.markdown + + link-ref + + captures + + 1 + + name + punctuation.definition.string.begin.markdown + + 2 + + name + string.other.link.title.markdown + + 4 + + name + punctuation.definition.string.end.markdown + + 5 + + name + punctuation.definition.constant.begin.markdown + + 6 + + name + constant.other.reference.link.markdown + + 7 + + name + punctuation.definition.constant.end.markdown + + + match + (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)([^\]]*+)(\]) + name + meta.link.reference.markdown + + link-ref-literal + + captures + + 1 + + name + punctuation.definition.string.begin.markdown + + 2 + + name + string.other.link.title.markdown + + 4 + + name + punctuation.definition.string.end.markdown + + 5 + + name + punctuation.definition.constant.begin.markdown + + 6 + + name + punctuation.definition.constant.end.markdown + + + match + (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(\]) + name + meta.link.reference.literal.markdown + + list-paragraph + + patterns + + + begin + \G\s+(?=\S) + end + ^\s*$ + name + meta.paragraph.list.markdown + patterns + + + include + #inline + + + + + + raw + + captures + + 1 + + name + punctuation.definition.raw.markdown + + 3 + + name + punctuation.definition.raw.markdown + + + match + (`+)([^`]|(?!(?<!`)\1(?!`))`)*+(\1) + name + markup.raw.inline.markdown + + separator + + match + \G[ ]{,3}([-*_])([ ]{,2}\1){2,}[ \t]*$\n? + name + meta.separator.markdown + + + scopeName + text.html.markdown + uuid + 0A1D9874-B448-11D9-BD50-000D93B6E43C + + diff --git a/app/rcc/edbee/syntaxfiles/Matlab.tmLanguage b/app/rcc/edbee/syntaxfiles/Matlab.tmLanguage new file mode 100644 index 00000000..a3b265b7 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Matlab.tmLanguage @@ -0,0 +1,1205 @@ + + + + + fileTypes + + + matlab + + foldingStartMarker + ^\s*(function|if|switch|while|for|try)\b(?!.*\bend\b).*$ + foldingStopMarker + ^\s*(end|return)\b.*$ + keyEquivalent + ^~M + name + MATLAB + patterns + + + begin + (?x) +(?=function\b) # borrowed from ruby bundle +(?<=^|\s)(function)\s+ # the function keyword +(?>\[(.*)\])?\t# match various different combination of output arguments +((?>[a-zA-Z_]\w*))? +(?>\s*=\s*)? +((?>[a-zA-Z_]\w*(?>[?!]|=(?!>))? )) # the function name +(?=[ \t]*[^\s%|#]) # make sure arguments and not a comment follow +\s*(\() # the opening parenthesis for arguments + beginCaptures + + 1 + + name + storage.type.matlab + + 2 + + name + variable.parameter.output.function.matlab + + 3 + + name + variable.parameter.output.function.matlab + + 4 + + name + entity.name.function.matlab + + + contentName + variable.parameter.input.function.matlab + end + \) + endCaptures + + 0 + + name + punctuation.definition.parameters.matlab + + + name + meta.function.with-arguments.matlab + + + captures + + 1 + + name + storage.type.matlab + + 2 + + name + variable.parameter.output.function.matlab + + 3 + + name + variable.parameter.output.function.matlab + + 4 + + name + entity.name.function.matlab + + + match + (?x) +(?=function\b) # borrowed from ruby bundle +(?<=^|\s)(function)\s+ # the function keyword +(?>\[(.*)\])? # match various different combination of output arguments +((?>[a-zA-Z_]\w*))? +(?>\s*=\s*)? +((?>[a-zA-Z_]\w*(?>[?!]|=(?!>))? )) # the function name + name + meta.function.without-arguments.matlab + + + include + #constants_override + + + include + #brackets + + + include + #curlybrackets + + + include + #parens + + + include + #string + + + include + #transpose + + + include + #double_quote + + + include + #operators + + + include + #all_matlab_keywords + + + include + #all_matlab_comments + + + include + #number + + + include + #variable + + + include + #variable_invalid + + + include + #not_equal_invalid + + + include + #variable_assignment + + + repository + + all_matlab_comments + + patterns + + + captures + + 1 + + name + punctuation.definition.comment.matlab + + + match + (%%).*$\n? + name + comment.double.percentage.matlab + + + begin + %\{ + captures + + 1 + + name + punctuation.definition.comment.matlab + + + end + %\}\s*\n + name + comment.block.percentage.matlab + + + captures + + 1 + + name + punctuation.definition.comment.matlab + + + match + (%).*$\n? + name + comment.line.percentage.matlab + + + + all_matlab_keywords + + patterns + + + include + #matlab_keyword_control + + + include + #matlab_keyword_operator + + + include + #matlab_keyword_other + + + include + #matlab_storage_type + + + include + #matlab_storage_modifier + + + include + #matlab_constant_language + + + include + #matlab_variable_function + + + include + #matlab_keyword_desktop + + + include + #matlab_keyword_mathematics + + + include + #matlab_keyword_analysis + + + include + #matlab_storage_control + + + include + #matlab_support_graphics + + + include + #matlab_support_function + + + include + #matlab_support_external + + + include + #matlab_support_toolbox_aerospace + + + include + #matlab_support_toolbox_bioinformatics + + + include + #matlab_support_toolbox_communications + + + include + #matlab_support_toolbox_control_systems + + + include + #matlab_support_toolbox_curve_fitting + + + include + #matlab_support_toolbox_data_acquisition + + + include + #matlab_support_toolbox_database + + + include + #matlab_support_toolbox_datafeed + + + include + #matlab_support_toolbox_design + + + include + #matlab_support_toolbox_excel_link + + + include + #matlab_support_toolbox_filder_design_hdl_coder + + + include + #matlab_support_toolbox_financial_derivatives + + + include + #matlab_support_toolbox_financial + + + include + #matlab_support_toolbox_fixed_income + + + include + #matlab_support_toolbox_fixed_point + + + include + #matlab_support_toolbox_fuzzy_logic + + + include + #matlab_support_toolbox_garch + + + include + #matlab_support_toolbox_genetic_algorithms + + + include + #matlab_support_toolbox_image_acquisition + + + include + #matlab_support_toolbox_image_processing + + + include + #matlab_support_toolbox_instrument_control + + + include + #matlab_support_toolbox_mapping + + + include + #matlab_support_toolbox_model_predictive_control + + + include + #matlab_support_toolbox_model_based_calibration + + + include + #matlab_support_toolbox_neural_network + + + include + #matlab_support_toolbox_opc + + + include + #matlab_support_toolbox_optimization + + + include + #matlab_support_toolbox_rf + + + include + #matlab_support_toolbox_robust_control + + + include + #matlab_support_toolbox_signal_processing + + + include + #matlab_support_toolbox_spline + + + include + #matlab_support_toolbox_statistics + + + include + #matlab_support_toolbox_symbolic_math + + + include + #matlab_support_toolbox_system_identification + + + include + #matlab_support_toolbox_virtual_reality + + + include + #matlab_support_toolbox_wavelet + + + + allofem + + patterns + + + include + #parens + + + include + #curlybrackets + + + include + #end_in_parens + + + include + #brackets + + + include + #string + + + include + #transpose + + + include + #double_quote + + + include + #all_matlab_keywords + + + include + #all_matlab_comments + + + include + #variable + + + include + #variable_invalid + + + include + #number + + + include + #operators + + + + brackets + + begin + \[ + beginCaptures + + 0 + + name + meta.brackets.matlab + + + contentName + meta.brackets.matlab + end + \] + endCaptures + + 0 + + name + meta.brackets.matlab + + + patterns + + + include + #allofem + + + + constants_override + + comment + The user is trying to override MATLAB constants and functions. + match + (^|\;)\s*(i|j|inf|Inf|nan|NaN|eps|end)\s*=[^=] + name + meta.inappropriate.matlab + + curlybrackets + + begin + \{ + beginCaptures + + 0 + + name + meta.brackets.curly.matlab + + + contentName + meta.brackets.curly.matlab + end + \} + endCaptures + + 0 + + name + meta.brackets.curly.matlab + + + patterns + + + include + #allofem + + + include + #end_in_parens + + + + double_quote + + patterns + + + match + " + name + invalid.illegal.invalid-quote.matlab + + + + end_in_parens + + comment + end as operator symbol + match + \bend\b + name + keyword.operator.symbols.matlab + + escaped_quote + + patterns + + + match + '' + name + constant.character.escape.matlab + + + + matlab_constant_language + + comment + MATLAB constants + match + (?<!\.)\b(eps|false|Inf|inf|intmax|intmin|namelengthmax|NaN|nan|on|off|realmax|realmin|true)\b + name + constant.language.matlab + + matlab_keyword_analysis + + comment + Data Analysis + match + (?<!\.)\b(abs|addevent|addsample|addsampletocollection|addts|angle|conv|conv2|convn|corrcoef|cov|cplxpair|ctranspose|cumtrapz|deconv|del2|delevent|delsample|delsamplefromcollection|detrend|diff|fft|fft2|fftn|fftshift|fftw|filter|filter2|getabstime|getdatasamplesize|getinterpmethod|getqualitydesc|getsampleusingtime|gettimeseriesnames|gettsafteratevent|gettsafterevent|gettsatevent|gettsbeforeatevent|gettsbeforeevent|gettsbetweenevents|gradient|idealfilter|ifft|ifft2|ifftn|ifftshift|iqr|max|mean|median|min|mldivide|mode|mrdivide|removets|resample|setabstime|setinterpmethod|settimeseriesnames|std|synchronize|timeseries|trapz|tscollection|tsdata.event|tsprops|tstool|var)\b + name + keyword.analysis.matlab + + matlab_keyword_control + + comment + Control keywords + match + (?<!\.)\b(break|case|catch|continue|else|elseif|end|for|if|otherwise|pause|rethrow|return|start|startat|stop|switch|try|wait|while)\b + name + keyword.control.matlab + + matlab_keyword_desktop + + comment + Desktop Tools and Development + match + (?<!\.)\b(addpath|assignin|builddocsearchdb|cd|checkin|checkout|clc|clear|clipboard|cmopts|commandhistory|commandwindow|computer|copyfile|customverctrl|dbclear|dbcont|dbdown|dbquit|dbstack|dbstatus|dbstep|dbstop|dbtype|dbup|debug|demo|diary|dir|doc|docopt|docsearch|dos|echodemo|edit|exit|fileattrib|filebrowser|finish|format|genpath|getenv|grabcode|help|helpbrowser|helpwin|home|hostid|info|keyboard|license|lookfor|ls|matlab|matlabrc|matlabroot|memory|mkdir|mlint|mlintrpt|more|movefile|notebook|openvar|pack|partialpath|path|path2rc|pathdef|pathsep|pathtool|perl|playshow|prefdir|preferences|profile|profsave|publish|pwd|quit|recycle|rehash|restoredefaultpath|rmdir|rmpath|savepath|setenv|startup|support|system|toolboxdir|type|undocheckout|unix|ver|verctrl|verLessThan|version|web|what|whatsnew|which|winqueryreg|workspace)\b|(^\s*!.*$) + name + keyword.desktop.matlab + + matlab_keyword_mathematics + + comment + Mathematics + match + (?<!\.)\b(accumarray|acos|acosd|acosh|acot|acotd|acoth|acsc|acscd|acsch|airy|amd|asec|asecd|asech|asin|asind|asinh|atan|atan2|atand|atanh|balance|besselh|besseli|besselj|besselk|bessely|beta|betainc|betaln|bicg|bicgstab|blkdiag|bsxfun|bvp4c|bvpget|bvpinit|bvpset|bvpxtend|cart2pol|cart2sph|cat|cdf2rdf|ceil|cgs|chol|cholinc|cholupdate|circshift|colamd|colperm|compan|complex|cond|condeig|condest|conj|convhull|convhulln|cos|cosd|cosh|cot|cotd|coth|cross|csc|cscd|csch|cumprod|cumsum|dblquad|dde23|ddeget|ddesd|ddeset|decic|det|deval|diag|disp|display|dmperm|dot|eig|eigs|ellipj|ellipke|erf|erfc|erfcinv|erfcx|erfinv|etree|etreeplot|exp|expint|expm|expm1|eye|factor|factorial|find|fix|flipdim|fliplr|flipud|floor|fminbnd|fminsearch|freqspace|full|funm|fzero|gallery|gamma|gammainc|gammaln|gcd|gmres|gplot|griddata|griddata3|griddatan|gsvd|hadamard|hankel|hess|hilb|horzcat|hypot|i|idivide|ilu|imag|ind2sub|Inf|inline|interp1|interp1q|interp2|interp3|interpft|interpn|inv|invhilb|ipermute|j|kron|lcm|ldl|legendre|length|linsolve|linspace|log|log10|log1p|log2|logm|logspace|lscov|lsqnonneg|lsqr|lu|luinc|magic|meshgrid|minres|mkpp|mod|NaN|nchoosek|ndgrid|ndims|nextpow2|nnz|nonzeros|norm|normest|nthroot|null|numel|nzmax|ode113|ode15i|ode15s|ode23|ode23s|ode23t|ode23tb|ode45|odefile|odeget|odeset|odextend|ones|optimget|optimset|ordeig|ordqz|ordschur|orth|pascal|pcg|pchip|pdepe|pdeval|perms|permute|pi|pinv|planerot|pol2cart|poly|polyder|polyeig|polyfit|polyint|polyval|polyvalm|pow2|ppval|primes|prod|psi|qmr|qr|qrdelete|qrinsert|qrupdate|quad|quadl|quadv|qz|rand|randn|randperm|rank|rat|rats|rcond|real|reallog|realpow|realsqrt|rem|repmat|reshape|residue|roots|rosser|rot90|round|rref|rsf2csf|schur|sec|secd|sech|shiftdim|sign|sin|sind|sinh|size|sort|sortrows|spalloc|sparse|spaugment|spconvert|spdiags|speye|spfun|sph2cart|spline|spones|spparms|sprand|sprandn|sprandsym|sprank|spy|sqrt|sqrtm|squeeze|ss2tf|sub2ind|subspace|sum|svd|svds|symamd|symbfact|symmlq|symrcm|tan|tand|tanh|toeplitz|trace|treelayout|treeplot|tril|triplequad|triu|unmkpp|unwrap|vander|vectorize|vertcat|wilkinson|zeros)\b + name + keyword.mathematics.matlab + + matlab_keyword_operator + + comment + Operator keywords + match + (?<!\.)\b(all|and|any|bitand|bitcmp|bitget|bitmax|bitor|bitset|bitshift|bitxor|eq|ge|gt|isa|isappdata|iscell|iscellstr|ischar|iscom|isdir|isempty|isequal|isequalwithequalnans|isevent|isfield|isfinite|isfloat|isglobal|ishandle|ishold|isinf|isinteger|isinterface|isjava|iskeyword|isletter|islogical|ismac|ismember|ismethod|isnan|isnumeric|isobject|ispc|ispref|isprime|isprop|isreal|isscalar|issorted|isspace|issparse|isstrprop|isstruct|isstudent|isunix|isvarname|isvector|le|lt|mislocked|or|ne|not|setxor|union|unique|xor)\b + name + keyword.operator.matlab + + matlab_keyword_other + + comment + Other keywords + match + (?<!\.)\b(addOptional|addParamValue|addRequired|addtodate|ans|arrayfun|assert|blanks|builtin|calendar|cell|celldisp|cellfun|cellplot|clock|cputime|createCopy|datatipinfo|date|datenum|datestr|datevec|dbmex|deal|deblank|depdir|depfun|echo|eomday|error|etime|eval|evalc|evalin|exist|feval|fieldnames|findstr|func2str|genvarname|getfield|global|inferiorto|inmem|intersect|intwarning|lasterr|lasterror|lastwarn|loadobj|lower|methods|methodsview|mex|mexext|mfilename|mlock|munlock|nargchk|nargoutchk|now|orderfields|parse|pcode|regexp|regexpi|regexprep|regexptranslate|rmfield|run|saveobj|setdiff|setfield|sprintf|sscanf|strcat|strcmp|strcmpi|strfind|strings|strjust|strmatch|strncmp|strncmpi|strread|strrep|strtok|strtrim|structfun|strvcat|subsasgn|subsindex|subsref|substruct|superiorto|swapbytes|symvar|tic|timer|timerfind|timerfindall|toc|typecast|upper|warning|weekday|who|whos)\b + name + keyword.other.matlab + + matlab_storage_control + + comment + File I/O + match + (?<!\.)\b(addframe|ascii|audioplayer|audiorecorder|aufinfo|auread|auwrite|avifile|aviinfo|aviread|beep|binary|cdfepoch|cdfinfo|cdfread|cdfwrite|csvread|csvwrite|daqread|dlmread|dlmwrite|exifread|fclose|feof|ferror|fgetl|fgets|filehandle|filemarker|fileparts|filesep|fitsinfo|fitsread|fopen|fprintf|fread|frewind|fscanf|fseek|ftell|ftp|fullfile|fwrite|gunzip|gzip|hdf|hdf5|hdf5info|hdf5read|hdf5write|hdfinfo|hdfread|hdftool|imfinfo|importdata|imread|imwrite|lin2mu|load|memmapfile|mget|mmfileinfo|movie2avi|mput|mu2lin|multibandread|multibandwrite|open|rename|save|sendmail|sound|soundsc|tar|tempdir|tempname|textread|textscan|todatenum|uiimport|untar|unzip|urlread|urlwrite|wavfinfo|wavplay|wavread|wavrecord|wavwrite|winopen|wk1finfo|wk1read|wk1write|xlsfinfo|xlsread|xlswrite|xmlread|xmlwrite|xslt|zip)\b + name + storage.control.matlab + + matlab_storage_modifier + + comment + Storage modifiers + match + (?<!\.)\b(base2dec|bin2dec|cast|cell2mat|cell2struct|cellstr|char|dec2base|dec2bin|dec2hex|hex2dec|hex2num|int2str|mat2cell|mat2str|num2cell|native2unicode|num2hex|num2str|persistent|str2double|str2func|str2mat|str2num|struct2cell|unicode2native)\b + name + storage.modifier.matlab + + matlab_storage_type + + comment + Storage types + match + (?<!\.)\b(class|double|function|functions|input|inputname|inputParser|int16|int32|int64|int8|logical|single|struct|uint16|uint32|uint64|uint8)\b + name + storage.type.matlab + + matlab_support_external + + comment + External Interfaces + match + (?<!\.)\b(actxcontrol|actxcontrollist|actxcontrolselect|actxGetRunningServer|actxserver|addproperty|calllib|callSoapService|createClassFromWsdl|createSoapMessage|ddeadv|ddeexec|ddeinit|ddepoke|ddereq|ddeterm|ddeunadv|deleteproperty|enableservice|eventlisteners|events|Execute|GetCharArray|GetFullMatrix|GetVariable|GetWorkspaceData|import|instrcallback|instrfind|instrfindall|interfaces|invoke|javaaddpath|javaArray|javachk|javaclasspath|javaMethod|javaObject|javarmpath|libfunctions|libfunctionsview|libisloaded|libpointer|libstruct|loadlibrary|MaximizeCommandWindow|MinimizeCommandWindow|move|parseSoapResponse|PutCharArray|PutFullMatrix|PutWorkspaceData|readasync|record|registerevent|release|send|serial|serialbreak|stopasync|unloadlibrary|unregisterallevents|unregisterevent|usejava)\b + name + support.external.matlab + + matlab_support_function + + comment + Creating Graphical User Interfaces + match + (?<!\.)\b(addpref|align|dialog|errordlg|export2wsdlg|getappdata|getpixelposition|getpref|ginput|guidata|guide|guihandles|helpdlg|inputdlg|inspect|listdlg|listfonts|menu|movegui|msgbox|openfig|printdlg|printpreview|questdlg|rmappdata|rmpref|selectmoveresize|setappdata|setpixelposition|setpref|textwrap|uibuttongroup|uicontextmenu|uicontrol|uigetdir|uigetfile|uigetpref|uimenu|uiopen|uipanel|uipushtool|uiputfile|uiresume|uisave|uisetcolor|uisetfont|uisetpref|uistack|uitoggletool|uitoolbar|uiwait|waitbar|waitfor|waitforbuttonpress|warndlg)\b + name + support.function.matlab + + matlab_support_graphics + + comment + Graphics + match + (?<!\.)\b(alim|allchild|alpha|alphamap|ancestor|annotation|area|axes|axis|bar|bar3|bar3h|barh|box|brighten|camdolly|cameratoolbar|camlight|camlookat|camorbit|campan|campos|camproj|camroll|camtarget|camup|camva|camzoom|caxis|cla|clabel|clf|close|closereq|colorbar|colordef|colormap|colormapeditor|ColorSpec|comet|comet3|compass|coneplot|contour|contour3|contourc|contourf|contourslice|contrast|copyobj|curl|cylinder|daspect|datacursormode|datetick|delaunay|delaunay3|delaunayn|delete|diffuse|divergence|dragrect|drawnow|dsearch|dsearchn|ellipsoid|errorbar|ezcontour|ezcontourf|ezmesh|ezmeshc|ezplot|ezplot3|ezpolar|ezsurf|ezsurfc|feather|figure|figurepalette|fill|fill3|findall|findfigs|findobj|flow|fplot|frame2im|frameedit|gca|gcbf|gcbo|gcf|gco|get|getframe|graymon|grid|gtext|hgexport|hggroup|hgload|hgsave|hgtransform|hidden|hist|histc|hold|hsv2rgb|im2frame|im2java|image|imagesc|imformats|ind2rgb|inpolygon|interpstreamspeed|isocaps|isocolors|isonormals|isosurface|legend|light|lightangle|lighting|line|LineSpec|linkaxes|linkprop|loglog|makehgtform|material|mesh|meshc|meshz|movie|newplot|noanimate|opengl|orient|pan|pareto|patch|pbaspect|pcolor|peaks|pie|pie3|plot|plot3|plotbrowser|plotedit|plotmatrix|plottools|plotyy|polar|polyarea|print|printopt|propedit|propertyeditor|quiver|quiver3|rbbox|rectangle|rectint|reducepatch|reducevolume|refresh|refreshdata|reset|rgb2hsv|rgbplot|ribbon|rose|rotate|rotate3d|saveas|scatter|scatter3|semilogx|semilogy|set|shading|showplottool|shrinkfaces|slice|smooth3|specular|sphere|spinmap|stairs|stem|stem3|stream2|stream3|streamline|streamparticles|streamribbon|streamslice|streamtube|subplot|subvolume|surf|surf2patch|surface|surfc|surfl|surfnorm|tetramesh|texlabel|text|title|trimesh|triplot|trisurf|tsearch|tsearchn|view|viewmtx|volumebounds|voronoi|voronoin|waterfall|whitebg|xlabel|xlim|ylabel|ylim|zlabel|zlim|zoom)\b + name + support.graphics.matlab + + matlab_support_toolbox_aerospace + + comment + Matlab aerospace toolbox + match + (?<!\.)\b(wrldmagm|updateNodes|updateCamera|updateBodies|update|show|saveas|rrtheta|rrsigma|rrdelta|removeViewpoint|removeNode|removeBody|read|quatrotate|quatnormalize|quatnorm|quatmultiply|quatmod|quatinv|quatdivide|quatconj|quat2dcm|quat2angle|play|nodeInfo|moveBody|move|mjuliandate|machnumber|load|lla2ecef|leapyear|juliandate|initialize|initIfNeeded|hide|gravitywgs84|geoidegm96|geod2geoc|geocradius|geoc2geod|generatePatches|findstartstoptimes|fganimation|ecef2lla|dpressure|delete|decyear|dcmecef2ned|dcmbody2wind|dcm2quat|dcm2latlon|dcm2angle|dcm2alphabeta|datcomimport|createBody|correctairspeed|convvel|convtemp|convpres|convmass|convlength|convforce|convdensity|convangvel|convangacc|convang|convacc|atmospalt|atmosnrlmsise00|atmosnonstd|atmoslapse|atmosisa|atmoscoesa|atmoscira|angle2quat|angle2dcm|alphabeta|airspeed|addViewpoint|addRoute|addNode|addBody|VirtualRealityAnimation|Viewpoint|Node|Geometry|GenerateRunScript|Camera|Body|Animation)\b + name + support.toolbox.aerospace.matlab + + matlab_support_toolbox_bioinformatics + + comment + Matlab bioinformatics toolbox + match + (?<!\.)\b(zonebackadj|weights|view|traverse|traceplot|topoorder|swalign|svmtrain|svmsmoset|svmclassify|subtree|sptread|showhmmprof|showalignment|shortestpath|seqwordcount|seqtool|seqshowwords|seqshoworfs|seqreverse|seqrcomplement|seqprofile|seqpdist|seqneighjoin|seqmatch|seqlogo|seqlinkage|seqinsertgaps|seqdotplot|seqdisp|seqconsensus|seqcomplement|seq2regexp|select|scfread|samplealign|rnaplot|rnafold|rnaconvert|rna2dna|rmasummary|rmabackadj|revgeneticcode|restrict|reroot|reorder|redgreencmap|rebasecuts|rankfeatures|randseq|randfeatures|ramachandran|quantilenorm|prune|proteinpropplot|proteinplot|profalign|probesetvalues|probesetplot|probesetlookup|probesetlink|probelibraryinfo|plot|phytreewrite|phytreetool|phytreeread|phytree|pfamhmmread|pdist|pdbwrite|pdbread|pdbdistplot|pam|palindromes|optimalleaforder|oligoprop|nwalign|num2goid|nuc44|ntdensity|nt2int|nt2aa|nmercount|mzxmlread|mzxml2peaks|multialignviewer|multialignread|multialign|msviewer|mssgolay|msresample|msppresample|mspeaks|mspalign|msnorm|mslowess|msheatmap|msdotplot|msbackadj|msalign|molweight|molviewer|minspantree|maxflow|mavolcanoplot|mattest|mapcaplot|manorm|malowess|maloglog|mairplot|mainvarsetnorm|maimage|magetfield|mafdr|maboxplot|knnimpute|knnclassify|joinseq|jcampread|isspantree|isomorphism|isoelectric|isdag|int2nt|int2aa|imageneread|hmmprofstruct|hmmprofmerge|hmmprofgenerate|hmmprofestimate|hmmprofalign|graphtraverse|graphtopoorder|graphshortestpath|graphpred2path|graphminspantree|graphmaxflow|graphisspantree|graphisomorphism|graphisdag|graphconncomp|graphcluster|graphallshortestpaths|gprread|gonnet|goannotread|getrelatives|getpdb|getnodesbyid|getnewickstr|getmatrix|gethmmtree|gethmmprof|gethmmalignment|getgeodata|getgenpept|getgenbank|getembl|getedgesbynodeid|getdescendants|getcanonical|getbyname|getblast|getancestors|get|geosoftread|genpeptread|genevarfilter|geneticcode|generangefilter|geneont|genelowvalfilter|geneentropyfilter|genbankread|gcrmabackadj|gcrma|galread|featuresparse|featuresmap|fastawrite|fastaread|exprprofvar|exprprofrange|evalrasmolscript|emblread|dolayout|dndsml|dnds|dna2rna|dimercount|dayhoff|cytobandread|crossvalind|cpgisland|conncomp|codoncount|codonbias|clustergram|cleave|classperf|chromosomeplot|cghcbs|celintensityread|blosum|blastreadlocal|blastread|blastncbi|blastlocal|blastformat|biograph|baselookup|basecount|atomiccomp|aminolookup|allshortestpaths|agferead|affyread|affyprobeseqread|affyprobeaffinities|affyinvarsetnorm|aacount|aa2nt|aa2int)\b + name + support.toolbox.bioinformatics.matlab + + matlab_support_toolbox_communications + + comment + Matlab communications toolbox + match + (?<!\.)\b(wgn|vitdec|vec2mat|varlms|syndtable|symerr|stdchan|ssbmod|ssbdemod|signlms|shift2mask|seqgen\.pn|seqgen|semianalytic|scatterplot|rsgenpoly|rsencof|rsenc|rsdecof|rsdec|rls|ricianchan|reset|rectpulse|rcosine|rcosiir|rcosflt|rcosfir|rayleighchan|randsrc|randintrlv|randint|randerr|randdeintrlv|quantiz|qfuncinv|qfunc|qammod|qamdemod|pskmod|pskdemod|primpoly|poly2trellis|pmmod|pmdemod|plot|pammod|pamdemod|oqpskmod|oqpskdemod|oct2dec|normlms|noisebw|muxintrlv|muxdeintrlv|mskmod|mskdemod|modnorm|modem\.qammod|modem\.qamdemod|modem\.pskmod|modem\.pskdemod|modem\.pammod|modem\.pamdemod|modem\.oqpskmod|modem\.oqpskdemod|modem\.mskmod|modem\.mskdemod|modem\.genqammod|modem\.genqamdemod|modem\.dpskmod|modem\.dpskdemod|modem|mlseeq|mldivide|minpol|matintrlv|matdeintrlv|mask2shift|marcumq|log|lms|lloyds|lineareq|istrellis|isprimitive|iscatastrophic|intrlv|intdump|ifft|huffmanenco|huffmandict|huffmandeco|hilbiir|helscanintrlv|helscandeintrlv|helintrlv|heldeintrlv|hank2sys|hammgen|gray2bin|gfweight|gftuple|gftrunc|gftable|gfsub|gfroots|gfrepcov|gfrank|gfprimfd|gfprimdf|gfprimck|gfpretty|gfmul|gfminpol|gflineq|gffilter|gfdiv|gfdeconv|gfcosets|gfconv|gfadd|gf|genqammod|genqamdemod|gen2par|fskmod|fskdemod|fmmod|fmdemod|finddelay|filter|fft|fec\.ldpcenc|fec\.ldpcdec|eyediagram|equalize|encode|dvbs2ldpc|dpskmod|dpskdemod|dpcmopt|dpcmenco|dpcmdeco|doppler\.rounded|doppler\.rjakes|doppler\.jakes|doppler\.gaussian|doppler\.flat|doppler\.bigaussian|doppler\.ajakes|doppler|distspec|dftmtx|dfe|deintrlv|decode|de2bi|cyclpoly|cyclgen|cosets|convmtx|convintrlv|convenc|convdeintrlv|compand|commscope\.eyediagram|commscope|cma|bsc|biterr|bin2gray|bi2de|bertool|bersync|berfit|berfading|berconfint|bercoding|berawgn|bchnumerr|bchgenpoly|bchenc|bchdec|awgn|arithenco|arithdeco|ammod|amdemod|alignsignals|algintrlv|algdeintrlv)\b + name + support.toolbox.communications.matlab + + matlab_support_toolbox_control_systems + + comment + Matlab control systems toolbox + match + (?<!\.)\b(zpkdata|zpk|zgrid|zero|totaldelay|tfdata|tf|stepplot|stepinfo|step|stack|stabsep|ssdata|ssbal|ss2ss|ss|sminreal|size|sisotool|sisoinit|sigmaplot|sigma|sgrid|setoptions|setdelaymodel|set|series|rss|rlocusplot|rlocus|reshape|reg|real|pzplot|pzmap|pole|place|parallel|pade|ord2|obsvf|obsv|nyquistplot|nyquist|norm|nicholsplot|nichols|ngrid|ndims|modsep|modred|minreal|margin|lyapchol|lyap|ltiview|ltiprops|ltimodels|lsimplot|lsiminfo|lsim|lqry|lqrd|lqr|lqgreg|lqg|lft|kalmd|kalman|issiso|isproper|isempty|isdt|isct|iopzplot|iopzmap|inv|interp|initialplot|initial|impulseplot|impulse|imag|hsvplot|hsvd|hasdelay|gram|getoptions|getdelaymodel|get|gensig|gdare|gcare|fselect|freqresp|frdata|frd|fnorm|filt|feedback|fcat|evalfr|estim|esort|dssdata|dss|dsort|drss|dlyapchol|dlyap|dlqr|delayss|delay2z|dcgain|dare|damp|d2d|d2c|ctrlpref|ctrbf|ctrb|covar|connect|conj|chgunits|care|canon|c2d|bodeplot|bodemag|bode|bandwidth|balred|balreal|augstate|append|allmargin|acker|abs)\b + name + support.toolbox.control-systems.matlab + + matlab_support_toolbox_curve_fitting + + comment + Matlab curve fitting toolbox + match + (?<!\.)\b(type|smooth|set|probvalues|probnames|predint|plot|numcoeffs|numargs|islinear|integrate|indepnames|get|formula|fittype|fitoptions|fit|feval|excludedata|differentiate|dependnames|datastats|confint|coeffvalues|coeffnames|cftool|cflibhelp|cfit|category|argnames)\b + name + support.toolbox.curve-fitting.matlab + + matlab_support_toolbox_data_acquisition + + comment + Matlab data acquisition toolbox + match + (?<!\.)\b(wait|trigger|stop|start|softscope|size|showdaqevents|setverify|set|save|putvalue|putsample|putdata|propinfo|peekdata|obj2mfile|muxchanidx|makenames|load|length|isvalid|issending|isrunning|islogging|isdioline|ischannel|inspect|getvalue|getsample|getdata|get|flushdata|disp|digitalio|delete|dec2binvec|daqreset|daqregister|daqread|daqmem|daqhwinfo|daqhelp|daqfind|daqcallback|clear|binvec2dec|analogoutput|analoginput|addmuxchannel|addline|addchannel)\b + name + support.toolbox.data-acquisition.matlab + + matlab_support_toolbox_database + + comment + Matlab database toolbox + match + (?<!\.)\b(width|versioncolumns|update|unregister|tables|tableprivileges|supports|sql2native|setdbprefs|set|runstoredprocedure|rsmd|rows|rollback|resultset|register|querytimeout|querybuilder|procedures|procedurecolumns|primarykeys|ping|namecolumn|logintimeout|isurl|isreadonly|isnullcolumn|isjdbc|isdriver|isconnection|insert|indexinfo|importedkeys|getdatasources|get|fetchmulti|fetch|fastinsert|exportedkeys|exec|drivermanager|driver|dmd|database\.fetch|database|cursor\.fetch|crossreference|confds|commit|columns|columnprivileges|columnnames|cols|close|clearwarnings|bestrowid|attr)\b + name + support.toolbox.database.matlab + + matlab_support_toolbox_datafeed + + comment + Matlab datafeed toolbox + match + (?<!\.)\b(yahoo|tables|stop|stockticker|showtrades|reuters|pricevol|nextinfo|kx|isconnection|insert|info|idc|hyperfeed|havertool|haver|get|fred|fetch|factset|exec|datastream|close|bloomberg)\b + name + support.toolbox.datafeed.matlab + + matlab_support_toolbox_design + + comment + Matlab design toolbox + match + (?<!\.)\b(zplane|zpkshiftc|zpkshift|zpkrateup|zpklp2xn|zpklp2xc|zpklp2mbc|zpklp2mb|zpklp2lp|zpklp2hp|zpklp2bsc|zpklp2bs|zpklp2bpc|zpklp2bp|zpkftransf|zpkbpc2bpc|zerophase|window|validstructures|tf2cl|tf2ca|stepz|specifyall|sos|setspecs|set2int|scaleopts|scalecheck|scale|reset|reorder|reffilter|realizemdl|qreport|polyphase|phasez|phasedelay|parallel|order|nstates|normalizefreq|normalize|norm|noisepsdopts|noisepsd|multistage|msesim|msepred|mfilt\.linearinterp|mfilt\.iirwdfinterp|mfilt\.iirwdfdecim|mfilt\.iirinterp|mfilt\.iirdecim|mfilt\.holdinterp|mfilt\.firtdecim|mfilt\.firsrc|mfilt\.firinterp|mfilt\.firfracinterp|mfilt\.firfracdecim|mfilt\.firdecim|mfilt\.fftfirinterp|mfilt\.farrowsrc|mfilt\.cicinterp|mfilt\.cicdecim|mfilt\.cascade|mfilt|measure|maxstep|limitcycle|lagrange|kaiserwin|isstable|issos|isreal|isminphase|ismaxphase|islinphase|isfir|isallpass|int|info|impz|iirshiftc|iirshift|iirrateup|iirpowcomp|iirpeak|iirnotch|iirls|iirlpnormc|iirlpnorm|iirlp2xn|iirlp2xc|iirlp2mbc|iirlp2mb|iirlp2lp|iirlp2hp|iirlp2bsc|iirlp2bs|iirlp2bpc|iirlp2bp|iirlinphase|iirgrpdelay|iirftransf|iircomb|iirbpc2bpc|ifir|help|grpdelay|gain|freqz|freqsamp|freqrespopts|freqrespest|firtype|firpr2chfb|firnyquist|firminphase|firls|firlpnorm|firlp2lp|firlp2hp|firhalfband|firgr|fireqint|firceqrip|fircband|filtstates\.cic|filterbuilder|filter|fftcoeffs|fdesign\.rsrc|fdesign\.peak|fdesign\.parameq|fdesign\.octave|fdesign\.nyquist|fdesign\.notch|fdesign\.lowpass|fdesign\.isinclp|fdesign\.interpolator|fdesign\.hilbert|fdesign\.highpass|fdesign\.halfband|fdesign\.fracdelay|fdesign\.differentiator|fdesign\.decimator|fdesign\.ciccomp|fdesign\.bandstop|fdesign\.bandpass|fdesign\.arbmagnphase|fdesign\.arbmag|fdesign|fdatool|fcfwrite|farrow|euclidfactors|equiripple|ellip|double|disp|dfilt\.wdfallpass|dfilt\.scalar|dfilt\.parallel|dfilt\.latticemamin|dfilt\.latticemamax|dfilt\.latticearma|dfilt\.latticear|dfilt\.latticeallpass|dfilt\.dfsymfir|dfilt\.dffirt|dfilt\.dffir|dfilt\.dfasymfir|dfilt\.df2tsos|dfilt\.df2t|dfilt\.df2sos|dfilt\.df2|dfilt\.df1tsos|dfilt\.df1t|dfilt\.df1sos|dfilt\.df1|dfilt\.cascadewdfallpass|dfilt\.cascadeallpass|dfilt\.cascade|dfilt\.calatticepc|dfilt\.calattice|dfilt\.allpass|dfilt|designopts|designmethods|design|denormalize|cumsec|cost|convert|coewrite|coeread|coeffs|cl2tf|cheby2|cheby1|ca2tf|butter|block|autoscale|allpassshiftc|allpassshift|allpassrateup|allpasslp2xn|allpasslp2xc|allpasslp2mbc|allpasslp2mb|allpasslp2lp|allpasslp2hp|allpasslp2bsc|allpasslp2bs|allpasslp2bpc|allpasslp2bp|allpassbpc2bpc|adaptfilt\.ufdaf|adaptfilt\.tdafdft|adaptfilt\.tdafdct|adaptfilt\.swrls|adaptfilt\.swftf|adaptfilt\.ss|adaptfilt\.se|adaptfilt\.sd|adaptfilt\.rls|adaptfilt\.qrdrls|adaptfilt\.qrdlsl|adaptfilt\.pbufdaf|adaptfilt\.pbfdaf|adaptfilt\.nlms|adaptfilt\.lsl|adaptfilt\.lms|adaptfilt\.hswrls|adaptfilt\.hrls|adaptfilt\.gal|adaptfilt\.ftf|adaptfilt\.filtxlms|adaptfilt\.fdaf|adaptfilt\.dlms|adaptfilt\.blmsfft|adaptfilt\.blms|adaptfilt\.bap|adaptfilt\.apru|adaptfilt\.ap|adaptfilt\.adjlms|adaptfilt)\b + name + support.toolbox.design.matlab + + matlab_support_toolbox_excel_link + + comment + Matlab excel link toolbox + match + (?<!\.)\b(matlabsub|matlabinit|matlabfcn|MLUseFullDesktop|MLUseCellArray|MLStartDir|MLShowMatlabErrors|MLPutVar|MLPutMatrix|MLOpen|MLMissingDataAsNaN|MLGetVar|MLGetMatrix|MLGetFigure|MLEvalString|MLDeleteMatrix|MLClose|MLAutoStart|MLAppendMatrix)\b + name + support.toolbox.excel-link.matlab + + matlab_support_toolbox_filder_design_hdl_coder + + comment + Matlab filder design hdl coder toolbox + match + (?<!\.)\b(generatetbstimulus|generatetb|generatehdl|fdhdltool)\b + name + support.toolbox.filder-design-hdl-coder.matlab + + matlab_support_toolbox_financial + + comment + Matlab financial toolbox + match + (?<!\.)\b(zero2pyld|zero2fwd|zero2disc|zbtyield|zbtprice|yldtbill|yldmat|ylddisc|yearfrac|yeardays|year|xirr|x2mdate|wrkdydif|willpctr|willad|weights2holdings|weekday|wclose|volroc|vertcat|uplus|uminus|uicalendar|ugarchsim|ugarchpred|ugarchllf|ugarch|typprice|tsmovavg|tsmom|tsaccel|tr2bonds|toweekly|totalreturnprice|tosemi|toquoted|toquarterly|tomonthly|todecimal|today|todaily|toannual|times|time2date|tick2ret|thirtytwo2dec|thirdwednesday|tbl2bond|taxedrr|targetreturn|subsref|subsasgn|stochosc|std|spctkd|sortfts|smoothts|size|sharpe|setfield|selectreturn|second|rsindex|rmfield|ret2tick|resamplets|rdivide|pyld2zero|pvvar|pvtrend|pvfix|prtbill|prmat|prdisc|prcroc|prbyzero|power|posvolidx|portvrisk|portstats|portsim|portrand|portopt|portcons|portalpha|portalloc|pointfig|plus|plot|periodicreturns|peravg|pcpval|pcglims|pcgcomp|pcalims|payuni|payper|payodd|payadv|opprofit|onbalvol|nweekdate|now|nomrr|negvolidx|mvnrstd|mvnrobj|mvnrmle|mvnrfish|mtimes|mrdivide|movavg|months|month|mirr|minute|minus|min|merge|medprice|mean|maxdrawdown|max|macd|m2xdate|lweekdate|lpm|log2|log10|log|llow|length|leadts|lbusdate|lagts|issorted|isfield|isequal|iscompatible|isbusday|irr|inforatio|hour|horzcat|holidays|holdings2weights|hist|highlow|hhigh|getnameidx|getfield|geom2arith|fwd2zero|fvvar|fvfix|fvdisc|ftsuniq|ftstool|ftsinfo|ftsgui|ftsbound|fts2mat|fts2ascii|frontier|frontcon|freqstr|freqnum|frac2cur|fpctkd|fints|filter|fillts|fieldnames|fetch|fbusdate|extfield|exp|ewstats|eomday|eomdate|end|emaxdrawdown|elpm|effrr|ecmnstd|ecmnobj|ecmnmle|ecmninit|ecmnhess|ecmnfish|ecmmvnrstd|ecmmvnrobj|ecmmvnrmle|ecmmvnrfish|ecmlsrobj|ecmlsrmle|discrate|disc2zero|diff|depstln|depsoyd|deprdv|depgendb|depfixdb|dec2thirtytwo|daysdif|daysadd|daysact|days365|days360psa|days360isda|days360e|days360|day|datewrkdy|datevec|datestr|datenum|datemnth|datefind|datedisp|dateaxis|date2time|cur2str|cur2frac|cumsum|createholidays|cpnpersz|cpndaysp|cpndaysn|cpndatepq|cpndatep|cpndatenq|cpndaten|cpncount|cov2corr|corr2cov|convertto|convert2sur|chfield|chartfts|chaikvolat|chaikosc|cftimes|cfport|cfdur|cfdates|cfconv|cfamounts|candle|busdays|busdate|boxcox|bollinger|bolling|bndyield|bndspread|bndprice|bnddury|bnddurp|bndconvy|bndconvp|blsvega|blstheta|blsrho|blsprice|blslambda|blsimpv|blsgamma|blsdelta|blkprice|blkimpv|binprice|beytbill|barh|bar3h|bar3|bar|ascii2fts|arith2geom|annuterm|annurate|amortize|adosc|adline|active2abs|acrudisc|acrubond|accrfrac|abs2active)\b + name + support.toolbox.financial.matlab + + matlab_support_toolbox_financial_derivatives + + comment + Matlab financial derivatives toolbox + match + (?<!\.)\b(trintreeshape|trintreepath|treeviewer|treeshape|treepath|time2date|swaptionbyhw|swaptionbyhjm|swaptionbybk|swaptionbybdt|swapbyzero|swapbyhw|swapbyhjm|swapbybk|swapbybdt|stockspec|stockoptspec|ratetimes|rate2disc|optstockbyitt|optstockbyeqp|optstockbycrr|optbndbyhw|optbndbyhjm|optbndbybk|optbndbybdt|mmktbyhjm|mmktbybdt|mktrintree|mktree|mkbush|lookbackbyitt|lookbackbyeqp|lookbackbycrr|itttree|itttimespec|ittsens|ittprice|isafin|intenvset|intenvsens|intenvprice|intenvget|insttypes|instswaption|instswap|instsetfield|instselect|instoptstock|instoptbnd|instlookback|instlength|instgetcell|instget|instfloor|instfloat|instfixed|instfind|instfields|instdisp|instdelete|instcompound|instcf|instcap|instbond|instbarrier|instasian|instaddfield|instadd|hwvolspec|hwtree|hwtimespec|hwsens|hwprice|hjmvolspec|hjmtree|hjmtimespec|hjmsens|hjmprice|hedgeslf|hedgeopt|floorbyhw|floorbyhjm|floorbybk|floorbybdt|floatbyzero|floatbyhw|floatbyhjm|floatbybk|floatbybdt|fixedbyzero|fixedbyhw|fixedbyhjm|fixedbybk|fixedbybdt|eqptree|eqptimespec|eqpsens|eqpprice|disc2rate|derivset|derivget|datedisp|date2time|cvtree|crrtree|crrtimespec|crrsens|crrprice|compoundbyitt|compoundbyeqp|compoundbycrr|classfin|cfbyzero|cfbyhw|cfbyhjm|cfbybk|cfbybdt|capbyhw|capbyhjm|capbybk|capbybdt|bushshape|bushpath|bondbyzero|bondbyhw|bondbyhjm|bondbybk|bondbybdt|bkvolspec|bktree|bktimespec|bksens|bkprice|bdtvolspec|bdttree|bdttimespec|bdtsens|bdtprice|barrierbyitt|barrierbyeqp|barrierbycrr|asianbyitt|asianbyeqp|asianbycrr)\b + name + support.toolbox.financial-derivatives.matlab + + matlab_support_toolbox_fixed_income + + comment + Matlab fixed income toolbox + match + (?<!\.)\b(zeroyield|zeroprice|tfutyieldbyrepo|tfutpricebyrepo|tfutimprepo|tfutbyyield|tfutbyprice|tbillyield2disc|tbillyield|tbillval01|tbillrepo|tbillprice|tbilldisc2yield|stepcpnyield|stepcpnprice|stepcpncfamounts|psaspeed2rate|psaspeed2default|mbsyield2speed|mbsyield2oas|mbsyield|mbswal|mbsprice2speed|mbsprice2oas|mbsprice|mbspassthrough|mbsoas2yield|mbsoas2price|mbsnoprepay|mbsdury|mbsdurp|mbsconvy|mbsconvp|mbscfamounts|liborprice|liborfloat2fixed|liborduration|convfactor|cfamounts|cdyield|cdprice|cdai|cbprice|bkput|bkfloorlet|bkcaplet|bkcall)\b + name + support.toolbox.fixed-income.matlab + + matlab_support_toolbox_fixed_point + + comment + Matlab fixed-point toolbox + match + (?<!\.)\b(zlim|ylim|xlim|wordlength|waterfall|voronoin|voronoi|vertcat|upperbound|uplus|uminus|uint8|uint32|uint16|triu|trisurf|triplot|trimesh|tril|treeplot|transpose|tostring|toeplitz|times|text|surfnorm|surfl|surfc|surf|sum|subsref|subsasgn|sub|stripscaling|streamtube|streamslice|streamribbon|stem3|stem|stairs|squeeze|sqrt|spy|slice|size|single|sign|shiftdim|set|semilogy|semilogx|sdec|scatter3|scatter|savefipref|round|rose|ribbon|rgbplot|reshape|resetlog|reset|rescale|repmat|realmin|realmax|real|range|randquant|quiver3|quiver|quantizer|quantize|pow2|polar|plus|plotyy|plotmatrix|plot3|plot|permute|pcolor|patch|or|oct|nunderflows|numerictype|numberofelements|num2int|num2hex|num2bin|noverflows|not|noperations|ne|ndims|mtimes|mpy|minus|minlog|min|meshz|meshc|mesh|maxlog|max|lt|lsb|lowerbound|loglog|logical|line|length|le|isvector|issigned|isscalar|isrow|isreal|ispropequal|isobject|isnumerictype|isnumeric|isnan|isinf|isfinite|isfimath|isfi|isequal|isempty|iscolumn|ipermute|intmin|intmax|int8|int32|int16|int|innerprodintbits|imag|horzcat|histc|hist|hex2num|hex|hankel|gt|gplot|getmsb|getlsb|get|ge|fractionlength|fplot|flipud|fliplr|flipdim|fipref|fimath|fi|feather|ezsurfc|ezsurf|ezpolar|ezplot3|ezplot|ezmesh|ezcontourf|ezcontour|exponentmin|exponentmax|exponentlength|exponentbias|etreeplot|errorbar|eq|eps|end|double|divide|disp|diag|denormalmin|denormalmax|dec|ctranspose|copyobj|convergent|contourf|contourc|contour3|contour|conj|coneplot|complex|compass|comet3|comet|clabel|buffer|bitxorreduce|bitxor|bitsrl|bitsra|bitsll|bitsliceget|bitshift|bitset|bitror|bitrol|bitorreduce|bitor|bitget|bitconcat|bitcmp|bitandreduce|bitand|bin2num|bin|barh|bar|area|any|and|all|add|abs)\b + name + support.toolbox.fixed-point.matlab + + matlab_support_toolbox_fuzzy_logic + + comment + Matlab fuzzy logic toolbox + match + (?<!\.)\b(zmf|writefis|trimf|trapmf|surfview|subclust|smf|sigmf|showrule|showfis|sffis|setfis|ruleview|ruleedit|rmvar|rmmf|readfis|psigmf|probor|plotmf|plotfis|pimf|parsrule|newfis|mfedit|mf2mf|mam2sug|getfis|gensurf|genfis3|genfis2|genfis1|gbellmf|gaussmf|gauss2mf|fuzzy|fuzblock|fuzarith|findcluster|fcm|evalmf|evalfis|dsigmf|defuzz|convertfis|anfisedit|anfis|addvar|addrule|addmf)\b + name + support.toolbox.fuzzy-logic.matlab + + matlab_support_toolbox_garch + + comment + Matlab GARCH toolbox + match + (?<!\.)\b(ret2price|price2ret|ppTSTest|ppARTest|ppARDTest|parcorr|lratiotest|lbqtest|lagmatrix|hpfilter|garchsim|garchset|garchpred|garchplot|garchma|garchinfer|garchget|garchfit|garchdisp|garchcount|garchar|dfTSTest|dfARTest|dfARDTest|crosscorr|autocorr|archtest|aicbic)\b + name + support.toolbox.garch.matlab + + matlab_support_toolbox_genetic_algorithms + + comment + Matlab genetic algorithms toolbox + match + (?<!\.)\b(threshacceptbnd|simulannealbnd|saoptimset|saoptimget|psoptimset|psoptimget|psearchtool|patternsearch|gatool|gaoptimset|gaoptimget|gamultiobj|ga)\b + name + support.toolbox.genetic-algorithms.matlab + + matlab_support_toolbox_image_acquisition + + comment + Matlab image acquisition toolbox + match + (?<!\.)\b(wait|videoinput|triggerinfo|triggerconfig|trigger|stoppreview|stop|start|set|save|propinfo|preview|peekdata|obj2mfile|load|isvalid|isrunning|islogging|imaqtool|imaqreset|imaqmontage|imaqmem|imaqhwinfo|imaqhelp|imaqfind|getsnapshot|getselectedsource|getdata|get|flushdata|disp|delete|closepreview|clear)\b + name + support.toolbox.image-acquisition.matlab + + matlab_support_toolbox_image_processing + + comment + Matlab image processing toolbox + match + (?<!\.)\b(zoom|ycbcr2rgb|xyz2uint16|xyz2double|wiener2|whitepoint|watershed|warp|uintlut|uint8|uint16|truesize|translate|tonemap|tforminv|tformfwd|tformarray|subimage|stretchlim|strel|stdfilt|std2|roipoly|roifilt2|roifill|roicolor|rgbplot|rgb2ycbcr|rgb2ntsc|rgb2ind|rgb2hsv|rgb2gray|regionprops|reflect|rangefilt|radon|qtsetblk|qtgetblk|qtdecomp|psf2otf|poly2mask|pixval|phantom|para2fan|padarray|otf2psf|ordfilt2|ntsc2rgb|normxcorr2|nlfilter|nitfread|nitfinfo|montage|medfilt2|mean2|mat2gray|maketform|makeresampler|makelut|makecform|makeConstrainToRectFcn|label2rgb|lab2uint8|lab2uint16|lab2double|isrgb|isnitf|isind|isicc|isgray|isflat|isbw|iradon|iptwindowalign|iptsetpref|iptremovecallback|iptnum2ordinal|ipticondir|iptgetpref|iptgetapi|iptdemos|iptcheckstrs|iptchecknargin|iptcheckmap|iptcheckinput|iptcheckhandle|iptcheckconn|iptaddcallback|iptSetPointerBehavior|iptPointerManager|iptGetPointerBehavior|ippl|intlut|interfileread|interfileinfo|ind2rgb|ind2gray|imwrite|imview|imtransform|imtophat|imtool|imsubtract|imshow|imscrollpanel|imsave|imrotate|imresize|imregionalmin|imregionalmax|imrect|imreconstruct|imread|impyramid|imputfile|improfile|impositionrect|impoly|impoint|implay|impixelregionpanel|impixelregion|impixelinfoval|impixelinfo|impixel|imoverviewpanel|imoverview|imopen|imnoise|immultiply|immovie|immagbox|imline|imlincomb|imimposemin|imhmin|imhmax|imhist|imhandles|imgetfile|imgcf|imgca|imfreehand|imfinfo|imfilter|imfill|imextendedmin|imextendedmax|imerode|imellipse|imdivide|imdistline|imdisplayrange|imdilate|imcrop|imcontrast|imcontour|imcomplement|imclose|imclearborder|imbothat|imattributes|imapprox|imagemodel|imageinfo|imadjust|imadd|imabsdiff|im2uint8|im2uint16|im2single|im2java2d|im2java|im2int16|im2double|im2col|im2bw|ifftn|ifft2|ifanbeam|idct2|iccwrite|iccroot|iccread|iccfind|hsv2rgb|houghpeaks|houghlines|hough|histeq|hdrread|graythresh|grayslice|graycoprops|graycomatrix|gray2ind|getsequence|getrect|getrangefromclass|getpts|getnhood|getneighbors|getline|getimagemodel|getimage|getheight|fwind2|fwind1|ftrans2|fspecial|fsamp2|freqz2|freqspace|fliptform|findbounds|filter2|fftshift|fftn|fft2|fanbeam|fan2para|entropyfilt|entropy|edgetaper|edge|double|dither|dicomwrite|dicomuid|dicomread|dicomlookup|dicominfo|dicomdict|dicomanon|demosaic|decorrstretch|deconvwnr|deconvreg|deconvlucy|deconvblind|dctmtx|dct2|cpstruct2pairs|cpselect|cpcorr|cp2tform|corr2|convn|convmtx2|conv2|conndef|colorbar|colfilt|col2im|cmunique|cmpermute|checkerboard|bwunpack|bwulterode|bwtraceboundary|bwselect|bwperim|bwpack|bwmorph|bwlabeln|bwlabel|bwhitmiss|bweuler|bwdist|bwboundaries|bwareaopen|bwarea|brighten|blkproc|bestblk|axes2pix|applylut|applycform|analyze75read|analyze75info|adapthisteq)\b + name + support.toolbox.image-processing.matlab + + matlab_support_toolbox_instrument_control + + comment + Matlab instrument control toolbox + match + (?<!\.)\b(visa|update|udp|trigger|tmtool|tcpip|stopasync|spoll|size|set|serialbreak|serial|selftest|scanstr|save|resolvehost|remove|record|readasync|query|propinfo|obj2mfile|midtest|midedit|methods|memwrite|memunmap|memread|mempoke|mempeek|memmap|makemid|load|length|iviconfigurationstore|isvalid|invoke|instrreset|instrnotify|instrid|instrhwinfo|instrhelp|instrfindall|instrfind|instrcallback|inspect|icdevice|gpib|geterror|get|fwrite|fscanf|fread|fprintf|fopen|flushoutput|flushinput|fgets|fgetl|fclose|echoudp|echotcpip|disp|disconnect|devicereset|delete|connect|commit|clrdevice|clear|binblockwrite|binblockread|add)\b + name + support.toolbox.instrument-control.matlab + + matlab_support_toolbox_mapping + + comment + Matlab mapping toolbox + match + (?<!\.)\b(zerom|zero22pi|zdatam-ui|zdatam|wrapToPi|wrapTo360|wrapTo2Pi|wrapTo180|worldmap|worldfilewrite|worldfileread|westof|vmap0ui|vmap0rhead|vmap0read|vmap0data|vinvtran|viewshed|vfwdtran|vec2mtx|utmzoneui|utmzone|utmgeoid|usgsdems|usgsdem|usgs24kdem|usamap|updategeostruct|unwrapMultipart|unitstr|unitsratio|undotrim|undoclip|uimaptbx|trimdata|trimcart|trackui|trackg|track2|track1|track|toRadians|toDegrees|tissot|timezone|timedim|time2str|tightmap|tigerp|tigermif|tgrline|textm|tbase|tagm-ui|tagm|symbolm|surfm|surflsrm|surflm|surfdist|surfacem|str2angle|stem3m|stdm|stdist|spzerom|spcread|smoothlong|sm2rad|sm2nm|sm2km|sm2deg|sizem|showm-ui|showm|showaxes|shapewrite|shaperead|shapeinfo|shaderel|setpostn|setm|setltln|seedm|sectorg|sec2hr|sec2hms|sec2hm|sdtsinfo|sdtsdemread|scxsc|scirclui|scircleg|scircle2|scircle1|scatterm|scaleruler|satbath|rsphere|roundn|rotatetext|rotatem|rootlayr|rhxrh|restack|resizem|removeExtraNanSeparators|refvec2mat|refmat2vec|reducem|reckon|readmtx|readfk5|readfields|rcurve|rad2sm|rad2nm|rad2km|rad2dms|rad2dm|rad2deg|quiverm|quiver3m|qrydata|putpole|projlist|projinv|projfwd|project|previewmap|polyxpoly|polysplit|polymerge|polyjoin|polycut|polybool|poly2fv|poly2cw|poly2ccw|polcmap|plotm|plot3m|plabel|pixcenters|pix2map|pix2latlon|pcolorm|patchm|patchesm|parallelui|paperscale|panzoom|originui|org2pol|onem|npi2pi|northarrow|nm2sm|nm2rad|nm2km|nm2deg|newpole|neworig|navfix|nanm|nanclip|namem|n2ecc|mobjects|mlayers|mlabelzero22pi|mlabel|minvtran|minaxis|mfwdtran|meshm|meshlsrm|meshgrat|meridianfwd|meridianarc|meanm|mdistort|mat2hms|mat2dms|mapview|maptrims|maptrimp|maptriml|maptrim|maptool|mapshow|maps|mapprofile|mapoutline|maplist|mapbbox|map2pix|makesymbolspec|makerefmat|makemapped|makedbfspec|makeattribspec|majaxis|lv2ecef|ltln2val|los2|linem|linecirc|limitm|lightmui|lightm|legs|lcolorbar|latlon2pix|kmlwrite|km2sm|km2rad|km2nm|km2deg|ispolycw|ismapped|ismap|isShapeMultipart|intrplon|intrplat|interpm|inputm|ind2rgb8|imbedm|hr2sec|hr2hms|hr2hm|hms2sec|hms2mat|hms2hr|hms2hm|histr|hista|hidem-ui|hidem|handlem-ui|handlem|gtopo30s|gtopo30|gtextm|gshhs|grn2eqa|gridm|grid2image|grepfields|gradientm|globedems|globedem|getworldfilename|getseeds|getm|geotiffread|geotiffinfo|geotiff2mstruct|geoshow|geoloc2grid|geodetic2geocentricLat|geodetic2ecef|geocentric2geodeticLat|gcxsc|gcxgc|gcwaypts|gcpmap|gcm|gc2sc|fromRadians|fromDegrees|framem|flatearthpoly|flat2ecc|fipsname|findm|filterm|fillm|fill3m|extractm|extractfield|etopo5|etopo|eqa2grn|epsm|encodem|ellipse1|elevation|egm96geoid|ecef2lv|ecef2geodetic|ecc2n|ecc2flat|eastof|dteds|dted|driftvel|driftcorr|dreckon|dms2rad|dms2mat|dms2dm|dms2degrees|dms2deg|dm2degrees|distortcalc|distdim|distance|dist2str|displaym|departure|demdataui|demcmap|degrees2dms|degrees2dm|deg2sm|deg2rad|deg2nm|deg2km|deg2dms|deg2dm|defaultm|dcwrhead|dcwread|dcwgaz|dcwdata|daspectm|crossfix|convertlat|contourm|contourfm|contourcmap|contour3m|cometm|comet3m|combntns|colorui|colorm|cmapui|clrmenu|closePolygonParts|clmo-ui|clmo|clma|clipdata|clegendm|clabelm|circcirc|changem|cart2grn|camupm|camtargm|camposm|bufferm|azimuth|axesscale|axesmui|axesm|axes2ecc|avhrrlambert|avhrrgoode|areaquad|areamat|areaint|arcgridread|antipode|angledim|angl2str|almanac)\b + name + support.toolbox.mapping.matlab + + matlab_support_toolbox_model_based_calibration + + comment + Matlab model-based calibration toolbox + match + (?<!\.)\b(modelinput|getAlternativeTypes|getAlternativeNames|YData|XDataNames|XData|Widths|Values|Value|UserVariables|UpdateResponseFeatures|UpdateResponse|Units|Type|TestPlans|TestFilters|SummaryStatisticsForTest|SummaryStatistics|StepwiseStatus|StepwiseSelection|StepwiseRegression|Status|StatisticsDialog|SizeOfParameterSet|SingleVIF|SignalUnits|SignalNames|SetupDialog|SetTermStatus|SaveAs|Save|RollbackEdit|RestoreDataForTest|RestoreData|Responses|ResponseSignalName|Response|RemoveVariable|RemoveTestFilter|RemoveOutliersForTest|RemoveOutliers|RemoveFilter|RemoveData|Remove|RecordsPerTest|Properties|PredictedValueForTest|PredictedValue|PartialVIF|Parameters|ParameterStatistics|PEVForTest|PEV|Owner|OutputData|OutlierIndicesForTest|OutlierIndices|NumberOfTests|NumberOfRecords|NumberOfParameters|NumberOfInputs|New|Names|Name|MultipleVIF|ModifyVariable|ModifyTestFilter|ModifyFilter|Modified|ModelSetup|ModelForTest|Model|MakeHierarchicalResponse|LocalResponses|LoadProject|Load|Levels|Level|Jacobian|IsEditable|IsBeingEdited|IsAlternative|InputsPerLevel|Inputs|InputSignalNames|InputSetupDialog|InputData|ImportFromMBCDataStructure|ImportFromFile|GetTermStatus|GetTermLabel|GetIncludedTerms|GetDesignMatrix|GetAllTerms|FitAlgorithm|Fit|Filters|Filename|ExportToMBCDataStructure|Export|Evaluate|DoubleResponseData|DoubleInputData|DiagnosticStatistics|DetachData|DefineTestGroups|DefineNumberOfRecordsPerTest|DefaultModels|DataFileTypes|Data|CreateTestplan|CreateResponseFeature|CreateResponse|CreateProject|CreateModel|CreateData|CreateAlternativeModels|CreateAlgorithm|Covariance|Correlation|CopyData|CommitEdit|ChooseAsBest|Centers|BoxCoxSSE|BeginEdit|AttachData|Append|AlternativeResponses|AlternativeModelStatistics|AliasMatrix|AddVariable|AddTestFilter|AddFilter)\b + name + support.toolbox.model-based-calibration.matlab + + matlab_support_toolbox_model_predictive_control + + comment + Matlab model predictive control toolbox + match + (?<!\.)\b(zpk|trim|tf|ss|size|sim|setoutdist|setname|setmpcsignals|setmpcdata|setindist|setestim|set|qpdantz|plot|pack|mpcverbosity|mpcstate|mpcsimopt|mpcprops|mpcmove|mpchelp|mpc|getoutdist|getname|getmpcdata|getindist|getestim|get|d2d|compare|cloffset)\b + name + support.toolbox.model-predictive-control.matlab + + matlab_support_toolbox_neural_network + + comment + Matlab neural network toolbox + match + (?<!\.)\b(vec2ind|tribas|trainscg|trains|trainrp|trainr|trainoss|trainlm|traingdx|traingdm|traingda|traingd|traincgp|traincgf|traincgb|trainc|trainbr|trainbfgc|trainbfg|trainb|train|tansig|sse|srchhyb|srchgol|srchcha|srchbre|srchbac|sp2narx|softmax|sim|setx|seq2con|scalprod|satlins|satlin|revert|removerows|removeconstantrows|randtop|rands|randnr|randnc|radbas|quant|purelin|processpca|postreg|poslin|pnormc|plotvec|plotv|plotsom|plotpv|plotperf|plotpc|plotes|plotep|plotbr|normr|normprod|normc|nntool|nnt2som|nnt2rb|nnt2p|nnt2lvq|nnt2lin|nnt2hop|nnt2ff|nnt2elm|nnt2c|nftool|newsom|newrbe|newrb|newpnn|newp|newnarxsp|newnarx|newlvq|newlrn|newlind|newlin|newhop|newgrnn|newfftd|newff|newelm|newdtdnn|newcf|newc|network|netsum|netprod|netinv|negdist|mseregec|msereg|mse|minmax|midpoint|maxlinlr|mapstd|mapminmax|mandist|mae|logsig|linkdist|learnwh|learnsom|learnpn|learnp|learnos|learnlv2|learnlv1|learnk|learnis|learnhd|learnh|learngdm|learngd|learncon|initzero|initwb|initnw|initlay|initcon|init|ind2vec|hintonwb|hintonw|hextop|hardlims|hardlim|gridtop|getx|gensim|fixunknowns|errsurf|dotprod|dividerand|divideint|divideind|divideblock|dist|display|disp|convwf|concur|con2seq|compet|combvec|calcperf|calcpd|calcjx|calcjejj|calcgx|boxdist|adapt)\b + name + support.toolbox.neural-network.matlab + + matlab_support_toolbox_opc + + comment + Matlab OPC toolbox + match + (?<!\.)\b(writeasync|write|wait|trend|stop|start|showopcevents|set|serveritems|serveritemprops|save|removepublicgroup|refresh|readasync|read|propinfo|peekdata|openosf|opctool|opcsupport|opcstruct2timeseries|opcstruct2array|opcserverinfo|opcreset|opcregister|opcread|opcqstr|opcqparts|opcqid|opchelp|opcfind|opcda|opccallback|obj2mfile|makepublic|load|isvalid|getnamespace|getdata|get|genslwrite|genslread|flushdata|flatnamespace|disp|disconnect|delete|copyobj|connect|clonegroup|cleareventlog|cancelasync|additem|addgroup)\b + name + support.toolbox.opc.matlab + + matlab_support_toolbox_optimization + + comment + Matlab optimization toolbox + match + (?<!\.)\b(quadprog|optimtool|optimset|optimget|lsqnonneg|lsqnonlin|lsqlin|lsqcurvefit|linprog|gangstr|fzmult|fzero|fsolve|fseminf|fminunc|fminsearch|fminimax|fmincon|fminbnd|fgoalattain|color|bintprog)\b + name + support.toolbox.optimization.matlab + + matlab_support_toolbox_rf + + comment + Matlab RF toolbox + match + (?<!\.)\b(writeva|write|timeresp|smith|setop|semilogy|semilogx|rfmodel\.rational|rfdata\.power|rfdata\.noise|rfdata\.nf|rfdata\.network|rfdata\.mixerspur|rfdata\.ip3|rfdata\.data|rfckt\.txline|rfckt\.twowire|rfckt\.shuntrlc|rfckt\.seriesrlc|rfckt\.series|rfckt\.rlcgline|rfckt\.passive|rfckt\.parallelplate|rfckt\.parallel|rfckt\.mixer|rfckt\.microstrip|rfckt\.lclowpasstee|rfckt\.lclowpasspi|rfckt\.lchighpasstee|rfckt\.lchighpasspi|rfckt\.lcbandstoptee|rfckt\.lcbandstoppi|rfckt\.lcbandpasstee|rfckt\.lcbandpasspi|rfckt\.hybridg|rfckt\.hybrid|rfckt\.delay|rfckt\.datafile|rfckt\.cpw|rfckt\.coaxial|rfckt\.cascade|rfckt\.amplifier|restore|read|polar|plotyy|plot|loglog|listparam|listformat|impulse|getz0|getop|freqresp|extract|circle|calculate|analyze)\b + name + support.toolbox.rf.matlab + + matlab_support_toolbox_robust_control + + comment + Matlab robust control toolbox + match + (?<!\.)\b(wcsens|wcnorm|wcmargin|wcgopt|wcgain|usubs|uss|usimsamp|usiminfo|usimfill|usample|ureal|uplot|umat|ultidyn|ufrd|udyn|ucomplexm|ucomplex|sysic|symdec|stack|stabproj|squeeze|slowfast|skewdec|simplify|showlmi|setmvar|setlmis|sectf|sdlsim|sdhinfsyn|sdhinfnorm|schurmr|robuststab|robustperf|robopt|repmat|reduce|randuss|randumat|randatom|quadstab|quadperf|pvinfo|pvec|psys|psinfo|popov|polydec|pdsimul|pdlstab|normalized2actual|newlmi|ncfsyn|ncfmr|ncfmargin|mussvextract|mussv|msfsyn|modreal|mktito|mkfilter|mixsyn|mincx|matnbr|mat2dec|ltrsyn|ltiarray2uss|loopsyn|loopsens|loopmargin|lmivar|lmiterm|lmireg|lminbr|lmiinfo|lmiedit|lftdata|isuncertain|ispsys|imp2ss|imp2exp|icsignal|iconnect|icomplexify|hinfsyn|hinfgs|hankelsv|hankelmr|h2syn|h2hinfsyn|gridureal|gevp|getlmis|genphase|gapmetric|fitmagfrd|fitfrd|feasp|evallmi|drawmag|dmplot|dksyn|dkitopt|diag|delmvar|dellmi|defcx|decnbr|decinfo|decay|dec2mat|dcgainmr|cpmargin|complexify|cmsclsyn|bstmr|bilin|balancmr|augw|aff2pol|actual2normalized)\b + name + support.toolbox.robust-control.matlab + + matlab_support_toolbox_signal_processing + + comment + Matlab signal processing toolbox + match + (?<!\.)\b(zplane|zp2tf|zp2ss|zp2sos|zerophase|yulewalk|xcov|xcorr2|xcorr|wvtool|wintool|window|vco|upsample|upfirdn|unwrap|uencode|udecode|tukeywin|tripuls|triang|tfestimate|tf2zpk|tf2zp|tf2ss|tf2sos|tf2latc|taylorwin|strips|stmcb|stepz|ss2zp|ss2tf|ss2sos|square|sptool|spectrum\.yulear|spectrum\.welch|spectrum\.periodogram|spectrum\.music|spectrum\.mtm|spectrum\.mcov|spectrum\.eigenvector|spectrum\.cov|spectrum\.burg|spectrum|spectrogram|sosfilt|sos2zp|sos2tf|sos2ss|sos2cell|sinc|sigwin|sgolayfilt|sgolay|seqperiod|schurrc|sawtooth|rootmusic|rooteig|rlevinson|residuez|resample|rectwin|rectpuls|rceps|rc2poly|rc2lar|rc2is|rc2ac|pyulear|pwelch|pulstran|prony|pow2db|polystab|polyscale|poly2rc|poly2lsf|poly2ac|pmusic|pmtm|pmcov|phasez|phasedelay|periodogram|peig|pcov|pburg|parzenwin|nuttallwin|mscohere|modulate|medfilt1|maxflat|lsf2poly|lpc|lp2lp|lp2hp|lp2bs|lp2bp|levinson|latcfilt|latc2tf|lar2rc|kaiserord|kaiser|is2rc|invfreqz|invfreqs|intfilt|interp|impz|impinvar|ifft2|ifft|idct|icceps|hilbert|hann|hamming|grpdelay|goertzel|gmonopuls|gausswin|gaussfir|gauspuls|fvtool|freqz|freqspace|freqs|flattopwin|firrcos|firpmord|firpm|firls|fircls1|fircls|fir2|fir1|findpeaks|filtstates\.dfiir|filtstates|filtic|filtfilt|filternorm|filter2|filter|fftshift|fftfilt|fft2|fft|fdatool|eqtflength|ellipord|ellipap|ellip|dspfwiz|dspdata\.pseudospectrum|dspdata\.psd|dspdata\.msspectrum|dspdata|dpsssave|dpssload|dpssdir|dpssclear|dpss|downsample|diric|digitrevorder|dftmtx|dfilt\.statespace|dfilt\.scalar|dfilt\.parallel|dfilt\.latticemamin|dfilt\.latticemamax|dfilt\.latticearma|dfilt\.latticear|dfilt\.latticeallpass|dfilt\.fftfir|dfilt\.dfsymfir|dfilt\.dffirt|dfilt\.dffir|dfilt\.dfasymfir|dfilt\.df2tsos|dfilt\.df2t|dfilt\.df2sos|dfilt\.df2|dfilt\.df1tsos|dfilt\.df1t|dfilt\.df1sos|dfilt\.df1|dfilt\.delay|dfilt\.cascade|dfilt|demod|deconv|decimate|dct|db2pow|czt|cpsd|cplxpair|cov|corrmtx|corrcoef|convmtx|conv2|conv|chirp|cheby2|cheby1|chebwin|cheb2ord|cheb2ap|cheb1ord|cheb1ap|cfirpm|cell2sos|cconv|cceps|buttord|butter|buttap|buffer|bohmanwin|blackmanharris|blackman|bitrevorder|bilinear|besself|besselap|bartlett|barthannwin|aryule|armcov|arcov|arburg|angle|ac2rc|ac2poly|abs)\b + name + support.toolbox.signal-processing.matlab + + matlab_support_toolbox_spline + + comment + Matlab spline toolbox + match + (?<!\.)\b(tpaps|titanium|subplus|stmak|stcol|spterms|sprpp|spmak|splpp|splinetool|spcrv|spcol|spaps|spapi|spap2|sorted|slvblk|rsmak|rscvn|rpmak|ppmak|optknt|newknt|knt2mlt|knt2brk|getcurve|franke|fnzeros|fnxtr|fnval|fntlr|fnrfn|fnplt|fnmin|fnjmp|fnint|fndir|fnder|fncmb|fnchg|fnbrk|fn2fm|cscvn|csaps|csapi|csape|chbpnt|bspline|bspligui|brk2knt|bkbrk|aveknt|augknt|aptknt)\b + name + support.toolbox.spline.matlab + + matlab_support_toolbox_statistics + + comment + Matlab statistics toolbox + match + (?<!\.)\b(ztest|zscore|x2fx|wishrnd|wblstat|wblrnd|wblplot|wblpdf|wbllike|wblinv|wblfit|wblcdf|view|vartestn|vartest2|vartest|var|upperparams|unifstat|unifrnd|unifpdf|unifit|unifinv|unifcdf|unidstat|unidrnd|unidpdf|unidinv|unidcdf|type|ttest2|ttest|tstat|trnd|trimmean|treeval|treetest|treeprune|treefit|treedisp|tpdf|tinv|tiedrank|test|tdfread|tcdf|tblwrite|tblread|tabulate|surfht|summary|stepwisefit|stepwise|std|statset|statget|squareform|sortrows|sort|slicesample|skewness|silhouette|signtest|signrank|setlabels|set|segment|scatterhist|sampsizepwr|runstest|rstool|rsmdemo|rowexch|rotatefactors|robustfit|robustdemo|risk|ridge|replacedata|reorderlevels|regstats|regress|refline|refcurve|rcoplot|raylstat|raylrnd|raylpdf|raylinv|raylfit|raylcdf|ranksum|range|randtool|randsample|random|randg|quantile|qqplot|prune|procrustes|probplot|princomp|prctile|posterior|polyval|polytool|polyfit|polyconf|poisstat|poissrnd|poisspdf|poissinv|poissfit|poisscdf|perms|pearsrnd|pdist|pdf|pcares|pcacov|partialcorr|paretotails|pareto|parent|parallelcoords|ordinal|numnodes|nsegments|normstat|normspec|normrnd|normplot|normpdf|normlike|norminv|normfit|normcdf|nominal|nodesize|nodeprob|nodeerr|nlpredci|nlparci|nlintool|nlinfit|ncx2stat|ncx2rnd|ncx2pdf|ncx2inv|ncx2cdf|nctstat|nctrnd|nctpdf|nctinv|nctcdf|ncfstat|ncfrnd|ncfpdf|ncfinv|ncfcdf|nbinstat|nbinrnd|nbinpdf|nbininv|nbinfit|nbincdf|nanvar|nansum|nanstd|nanmin|nanmedian|nanmean|nanmax|nancov|mvtrnd|mvtpdf|mvtcdf|mvregresslike|mvregress|mvnrnd|mvnpdf|mvncdf|multivarichart|multcompare|moment|mode|mnrval|mnrnd|mnrfit|mnpdf|mlecov|mle|mhsample|mergelevels|median|mean|mdscale|manovacluster|manova1|maineffectsplot|mahal|mad|lsqnonneg|lsline|lscov|lowerparams|lognstat|lognrnd|lognpdf|lognlike|logninv|lognfit|logncdf|linkage|linhyptest|lillietest|lhsnorm|lhsdesign|leverage|levelcounts|kurtosis|kstest2|kstest|ksdensity|kruskalwallis|kmeans|join|johnsrnd|jbtest|jackknife|iwishrnd|isundefined|ismember|islevel|isbranch|iqr|invpred|interactionplot|inconsistent|icdf|hygestat|hygernd|hygepdf|hygeinv|hygecdf|hougen|hmmviterbi|hmmtrain|hmmgenerate|hmmestimate|hmmdecode|histfit|hist3|hist|harmmean|hadamard|gscatter|grpstats|grp2idx|gpstat|gprnd|gppdf|gplotmatrix|gplike|gpinv|gpfit|gpcdf|gname|gmdistribution|glyphplot|glmval|glmfit|gline|gevstat|gevrnd|gevpdf|gevlike|gevinv|gevfit|gevcdf|getlabels|get|geostat|geornd|geopdf|geomean|geoinv|geocdf|gamstat|gamrnd|gampdf|gamlike|gaminv|gamfit|gamcdf|gagerr|fullfact|fsurfht|fstat|frnd|friedman|fracfactgen|fracfact|fpdf|fit|finv|ff2n|fcdf|factoran|expstat|exprnd|exppdf|explike|expinv|expfit|expcdf|evstat|evrnd|evpdf|evlike|evinv|evfit|evcdf|eval|errorbar|ecdfhist|ecdf|dwtest|dummyvar|droplevels|disttool|dfittool|dendrogram|dcovary|daugment|datasetfun|dataset|cutvar|cuttype|cutpoint|cutcategories|crosstab|coxphfit|cov|corrcov|corrcoef|corr|cordexch|copulastat|copularnd|copulapdf|copulaparam|copulafit|copulacdf|cophenet|controlrules|controlchart|combnk|cmdscale|clusterdata|cluster|classregtree|classprob|classify|classcount|cholcov|children|chi2stat|chi2rnd|chi2pdf|chi2inv|chi2gof|chi2cdf|cdfplot|cdf|ccdesign|casewrite|caseread|capaplot|capability|canoncorr|candgen|candexch|boxplot|boundary|bootstrp|bootci|biplot|binostat|binornd|binopdf|binoinv|binofit|binocdf|betastat|betarnd|betapdf|betalike|betainv|betafit|betacdf|bbdesign|barttest|aoctool|ansaribradley|anovan|anova2|anova1|andrewsplot|addlevels|addedvarplot)\b + name + support.toolbox.statistics.matlab + + matlab_support_toolbox_symbolic_math + + comment + Matlab symbolic math toolbox + match + (?<!\.)\b(ztrans|zeta|vpa|uint8|uint64|uint32|uint16|triu|tril|taylortool|taylor|symsum|syms|sym2poly|sym|svd|subs|subexpr|sort|solve|size|sinint|single|simplify|simple|rsums|rref|round|real|rank|quorem|procread|pretty|poly2sym|poly|numden|null|mod|mhelp|mfunlist|mfun|mapleinit|maple|log2|log10|limit|latex|laplace|lambertw|jordan|jacobian|iztrans|inv|int8|int64|int32|int16|int|imag|ilaplace|ifourier|hypergeom|horner|heaviside|funtool|frac|fourier|fortran|floor|fix|finverse|findsym|factor|ezsurfc|ezsurf|ezpolar|ezplot3|ezplot|ezmeshc|ezmesh|ezcontourf|ezcontour|expm|expand|eq|eig|dsolve|double|dirac|digits|diff|diag|det|cosint|conj|compose|colspace|collect|coeffs|ceil|ccode)\b + name + support.toolbox.symbolic-math.matlab + + matlab_support_toolbox_system_identification + + comment + Matlab system identification toolbox + match + (?<!\.)\b(zpkdata|zpk|wavenet|view|unitgain|treepartition|timestamp|tfdata|tf|struc|step|ssdata|ss|spafdr|spa|size|simsd|sim|sigmoidnet|setstruc|setpname|setpar|setinit|set|selstruc|segment|saturation|rplr|rpem|roe|resid|resample|realdata|rbj|rarx|rarmax|pzmap|pwlinear|present|predict|polyreg|polydata|poly1d|plot|pexcit|pem|pe|oe|nyquist|nuderst|noisecnv|nlhw|nlarx|nkshift|neuralnet|n4sid|misdata|midprefs|merge|lintan|linear|linapp|ivx|ivstruc|ivar|iv4|isreal|init|impulse|ifft|idss|idresamp|idproc|idpoly|idnlmodel|idnlhw|idnlgrey|idnlarx|idmodel|idmdlsim|idinput|idgrey|idfrd|idfilt|ident|iddata|idarx|getreg|getpar|getinit|getexp|get|fselect|freqresp|frd|fpe|fft|ffplot|feedback|fcat|evaluate|etfe|diff|detrend|delayest|deadzone|d2c|customreg|customnet|cra|covf|compare|c2d|bode|bj|balred|arxstruc|arxdata|arx|armax|ar|aic|advice|addreg|EstimationInfo)\b + name + support.toolbox.system-identification.matlab + + matlab_support_toolbox_virtual_reality + + comment + Matlab virtual reality toolbox + match + (?<!\.)\b(vrworld|vrwhos|vrwho|vrview|vrspacemouse|vrsetpref|vrrotvec2mat|vrrotvec|vrrotmat2vec|vrplay|vrori2dir|vrnode|vrlib|vrjoystick|vrinstall|vrgetpref|vrfigure|vrdrawnow|vrdir2ori|vrclose|vrclear)\b + name + support.toolbox.virtual-reality.matlab + + matlab_support_toolbox_wavelet + + comment + Matlab wavelet toolbox + match + (?<!\.)\b(wvarchg|wtreemgr|wthrmngr|wthresh|wthcoef2|wthcoef|wtbxmngr|wtbo|wscalogram|write|wrev|wrcoef2|wrcoef|wpviewcf|wptree|wpthcoef|wpsplt|wprec2|wprec|wprcoef|wpjoin|wpfun|wpdencmp|wpdec2|wpdec|wpcutree|wpcoef|wpbmpen|wp2wtree|wnoisest|wnoise|wmulden|wmspca|wmaxlev|wkeep|wfusmat|wfusimg|wfilters|wfbmesti|wfbm|wextend|wentropy|wenergy2|wenergy|wdencmp|wden|wdcenergy|wdcbm2|wdcbm|wcodemat|wbmpen|waverec2|waverec|wavenames|wavemngr|wavemenu|waveinfo|wavefun2|wavefun|wavedemo|wavedec2|wavedec|wave2lp|upwlev2|upwlev|upcoef2|upcoef|treeord|treedpth|tnodes|thselect|symwavf|symaux|swt2|swt|shanwavf|set|scal2frq|readtree|read|rbiowavf|qmf|plot|pat2cwav|orthfilt|ntree|ntnode|noleaves|nodesplt|nodepar|nodejoin|nodedesc|nodeasc|mswthresh|mswden|mswcmptp|mswcmpscr|mswcmp|morlet|meyeraux|meyer|mexihat|mdwtrec|mdwtdec|mdwtcluster|lwtcoef2|lwtcoef|lwt2|lwt|lsinfo|ls2filt|liftwave|liftfilt|leaves|laurpoly|laurmat|iswt2|iswt|istnode|isnode|intwave|ind2depo|ilwt2|ilwt|idwt2|idwt|get|gauswavf|filt2ls|fbspwavf|entrupd|dyadup|dyaddown|dwtmode|dwt2|dwt|dtree|drawtree|displs|disp|detcoef2|detcoef|depo2ind|ddencmp|dbwavf|dbaux|cwt|coifwavf|cmorwavf|chgwdeccfs|cgauwavf|cfs2wpt|centfrq|bswfun|biorwavf|biorfilt|besttree|bestlevt|appcoef2|appcoef|allnodes|addlift)\b + name + support.toolbox.wavelet.matlab + + matlab_variable_function + + comment + MATLAB variables + match + (?<!\.)\b(nargin|nargout|varargin|varargout)\b + name + variable.other.function.matlab + + not_equal_invalid + + comment + Not equal is written ~= not !=. + match + \s*!=\s* + name + invalid.illegal.invalid-inequality.matlab + + number + + comment + Valid numbers: 1, .1, 1.1, .1e1, 1.1e1, 1e1, 1i, 1j, 1e2j + match + (?<=[\s\-\+\*\/\\=:\[\(\{,]|^)\d*\.?\d+([eE][+-]?\d)?([0-9&&[^\.]])*(i|j)?\b + name + constant.numeric.matlab + + operators + + comment + Operator symbols + match + \s*(==|~=|>|>=|<|<=|&|&&|:|\||\|\||\+|-|\*|\.\*|/|\./|\\|\.\\|\^|\.\^)\s* + name + keyword.operator.symbols.matlab + + parens + + begin + \( + beginCaptures + + 0 + + name + meta.parens.matlab + + + contentName + meta.parens.matlab + end + \) + endCaptures + + 0 + + name + meta.parens.matlab + + + patterns + + + include + #allofem + + + include + #end_in_parens + + + + special_characters + + comment + Operator symbols + match + ((\%([\+\-0]?\d{0,3}(\.\d{1,3})?)(c|d|e|E|f|g|G|s|((b|t)?(o|u|x|X))))|\%\%|\\(b|f|n|r|t|\\)) + name + constant.character.escape.matlab + + string + + begin + ((?<=(\[|\(|\{|=|\s|;|:|,))|^)' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.matlab + + + end + '(?=(\]|\)|\}|=|~|<|>|&|\||-|\+|\*|\.|\^|\||\s|;|:|,)) + endCaptures + + 0 + + name + punctuation.definition.string.end.matlab + + + name + string.quoted.single.matlab + patterns + + + include + #escaped_quote + + + include + #unescaped_quote + + + include + #special_characters + + + + transpose + + match + ((\w+)|(?<=\])|(?<=\)))\.?' + name + keyword.operator.transpose.matlab + + unescaped_quote + + patterns + + + match + '(?=.) + name + invalid.illegal.unescaped-quote.matlab + + + + variable + + comment + Valid variable. Added meta to disable hilightinh + match + \b[a-zA-Z]\w*\b + name + meta.variable.other.valid.matlab + + variable_assignment + + comment + Incomplete variable assignment. + match + =\s*\.{0,2}\s*;?\s*$\n? + name + invalid.illegal.incomplete-variable-assignment.matlab + + variable_invalid + + comment + No variables or function names can start with a number or an underscore. + match + \b(_\w|\d+[_a-df-zA-DF-Z])\w*\b + name + invalid.illegal.invalid-variable-name.matlab + + + scopeName + source.matlab + uuid + 48F8858B-72FF-11D9-BFEE-000D93589AF6 + + \ No newline at end of file diff --git a/app/rcc/edbee/syntaxfiles/MultiMarkdown.tmLanguage b/app/rcc/edbee/syntaxfiles/MultiMarkdown.tmLanguage new file mode 100644 index 00000000..76e9c93b --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/MultiMarkdown.tmLanguage @@ -0,0 +1,80 @@ + + + + + firstLineMatch + ^Format:\s*(?i:complete)\s*$ + foldingStartMarker + (?x) + (<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\b.*?> + |<!--(?!.*-->) + |\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/))) + ) + foldingStopMarker + (?x) + (</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)> + |^\s*--> + |(^|\s)\} + ) + keyEquivalent + ^~M + name + MultiMarkdown + patterns + + + begin + ^([A-Za-z0-9]+)(:)\s* + beginCaptures + + 1 + + name + keyword.other.multimarkdown + + 2 + + name + punctuation.separator.key-value.multimarkdown + + + end + ^$|^(?=[A-Za-z0-9]+:) + name + meta.header.multimarkdown + patterns + + + comment + The reason for not setting scopeName = "string.unquoted" + (for the parent rule) is that we do not want + newlines to be marked as string.unquoted + match + .+ + name + string.unquoted.multimarkdown + + + + + begin + ^(?!=[A-Za-z0-9]+:) + end + ^(?=not)possible$ + name + meta.content.multimarkdown + patterns + + + include + text.html.markdown + + + + + scopeName + text.html.markdown.multimarkdown + uuid + F5E04BF4-69A9-45AE-9205-B3F3C2B00130 + + diff --git a/app/rcc/edbee/syntaxfiles/OCamlyacc.tmLanguage b/app/rcc/edbee/syntaxfiles/OCamlyacc.tmLanguage new file mode 100644 index 00000000..95dc8585 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/OCamlyacc.tmLanguage @@ -0,0 +1,532 @@ + + + + + fileTypes + + mly + + foldingStartMarker + %{|%% + foldingStopMarker + %}|%% + keyEquivalent + ^~O + name + OCamlyacc + patterns + + + begin + (%{)\s*$ + beginCaptures + + 1 + + name + punctuation.section.header.begin.ocamlyacc + + + end + ^\s*(%}) + endCaptures + + 1 + + name + punctuation.section.header.end.ocamlyacc + + + name + meta.header.ocamlyacc + patterns + + + include + source.ocaml + + + + + begin + (?<=%})\s*$ + end + (?:^)(?=%%) + name + meta.declarations.ocamlyacc + patterns + + + include + #comments + + + include + #declaration-matches + + + + + begin + (%%)\s*$ + beginCaptures + + 1 + + name + punctuation.section.rules.begin.ocamlyacc + + + end + ^\s*(%%) + endCaptures + + 1 + + name + punctuation.section.rules.end.ocamlyacc + + + name + meta.rules.ocamlyacc + patterns + + + include + #comments + + + include + #rules + + + + + include + source.ocaml + + + include + #comments + + + match + (’|‘|“|”) + name + invalid.illegal.unrecognized-character.ocaml + + + repository + + comments + + patterns + + + begin + /\* + end + \*/ + name + comment.block.ocamlyacc + patterns + + + include + #comments + + + + + begin + (?=[^\\])(") + end + " + name + comment.block.string.quoted.double.ocamlyacc + patterns + + + match + \\(x[a-fA-F0-9][a-fA-F0-9]|[0-2]\d\d|[bnrt'"\\]) + name + comment.block.string.constant.character.escape.ocamlyacc + + + + + + declaration-matches + + patterns + + + begin + (%)(token) + beginCaptures + + 1 + + name + keyword.other.decorator.token.ocamlyacc + + 2 + + name + keyword.other.token.ocamlyacc + + + end + ^\s*($|(^\s*(?=%))) + name + meta.token.declaration.ocamlyacc + patterns + + + include + #symbol-types + + + match + [A-Z][A-Za-z0-9_]* + name + entity.name.type.token.ocamlyacc + + + include + #comments + + + + + begin + (%)(left|right|nonassoc) + beginCaptures + + 1 + + name + keyword.other.decorator.token.associativity.ocamlyacc + + 2 + + name + keyword.other.token.associativity.ocamlyacc + + + end + (^\s*$)|(^\s*(?=%)) + name + meta.token.associativity.ocamlyacc + patterns + + + match + [A-Z][A-Za-z0-9_]* + name + entity.name.type.token.ocamlyacc + + + match + [a-z][A-Za-z0-9_]* + name + entity.name.function.non-terminal.reference.ocamlyacc + + + include + #comments + + + + + begin + (%)(start) + beginCaptures + + 1 + + name + keyword.other.decorator.start-symbol.ocamlyacc + + 2 + + name + keyword.other.start-symbol.ocamlyacc + + + end + (^\s*$)|(^\s*(?=%)) + name + meta.start-symbol.ocamlyacc + patterns + + + match + [a-z][A-Za-z0-9_]* + name + entity.name.function.non-terminal.reference.ocamlyacc + + + include + #comments + + + + + begin + (%)(type) + beginCaptures + + 1 + + name + keyword.other.decorator.symbol-type.ocamlyacc + + 2 + + name + keyword.other.symbol-type.ocamlyacc + + + end + $\s*(?!%) + name + meta.symbol-type.ocamlyacc + patterns + + + include + #symbol-types + + + match + [A-Z][A-Za-z0-9_]* + name + entity.name.type.token.reference.ocamlyacc + + + match + [a-z][A-Za-z0-9_]* + name + entity.name.function.non-terminal.reference.ocamlyacc + + + include + #comments + + + + + + precs + + patterns + + + captures + + 1 + + name + keyword.other.decorator.precedence.ocamlyacc + + 2 + + name + keyword.other.precedence.ocamlyacc + + 4 + + name + entity.name.function.non-terminal.reference.ocamlyacc + + 5 + + name + entity.name.type.token.reference.ocamlyacc + + + match + (%)(prec)\s+(([a-z][a-zA-Z0-9_]*)|(([A-Z][a-zA-Z0-9_]*))) + name + meta.precidence.declaration + + + + references + + patterns + + + match + [a-z][a-zA-Z0-9_]* + name + entity.name.function.non-terminal.reference.ocamlyacc + + + match + [A-Z][a-zA-Z0-9_]* + name + entity.name.type.token.reference.ocamlyacc + + + + rule-patterns + + patterns + + + begin + ((?<!\||:)(\||:)(?!\||:)) + beginCaptures + + 0 + + name + punctuation.separator.rule.ocamlyacc + + + end + \s*(?=\||;) + name + meta.rule-match.ocaml + patterns + + + include + #precs + + + include + #semantic-actions + + + include + #references + + + include + #comments + + + + + + rules + + patterns + + + begin + [a-z][a-zA-Z_]* + beginCaptures + + 0 + + name + entity.name.function.non-terminal.ocamlyacc + + + end + ; + endCaptures + + 0 + + name + punctuation.separator.rule.ocamlyacc + + + name + meta.non-terminal.ocamlyacc + patterns + + + include + #rule-patterns + + + + + + semantic-actions + + patterns + + + begin + [^\']({) + beginCaptures + + 1 + + name + punctuation.definition.action.semantic.ocamlyacc + + + end + (}) + endCaptures + + 1 + + name + punctuation.definition.action.semantic.ocamlyacc + + + name + meta.action.semantic.ocamlyacc + patterns + + + include + source.ocaml + + + + + + symbol-types + + patterns + + + begin + < + beginCaptures + + 0 + + name + punctuation.definition.type-declaration.begin.ocamlyacc + + + end + > + endCaptures + + 0 + + name + punctuation.definition.type-declaration.end.ocamlyacc + + + name + meta.token.type-declaration.ocamlyacc + patterns + + + include + source.ocaml + + + + + + + scopeName + source.ocamlyacc + uuid + 1B59327E-9B82-4B78-9411-BC02067DBDF9 + + diff --git a/app/rcc/edbee/syntaxfiles/Objective-C++.tmLanguage b/app/rcc/edbee/syntaxfiles/Objective-C++.tmLanguage new file mode 100644 index 00000000..71409303 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Objective-C++.tmLanguage @@ -0,0 +1,39 @@ + + + + + fileTypes + + mm + M + h + + foldingStartMarker + (?x) + /\*\*(?!\*) + |^(?![^{]*?//|[^{]*?/\*(?!.*?\*/.*?\{)).*?\{\s*($|//|/\*(?!.*?\*/.*\S)) + |^@(interface|protocol|implementation)\b + + foldingStopMarker + (?<!\*)\*\*/|^\s*\}|^@end\b + keyEquivalent + ^~O + name + Objective-C++ + patterns + + + include + source.c++ + + + include + source.objc + + + scopeName + source.objc++ + uuid + FDAB1813-6B1C-11D9-BCAC-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/Objective-C.tmLanguage b/app/rcc/edbee/syntaxfiles/Objective-C.tmLanguage new file mode 100644 index 00000000..cb6a86cb --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Objective-C.tmLanguage @@ -0,0 +1,1511 @@ + + + + + fileTypes + + m + h + + foldingStartMarker + (?x) + /\*\*(?!\*) + |^(?![^{]*?//|[^{]*?/\*(?!.*?\*/.*?\{)).*?\{\s*($|//|/\*(?!.*?\*/.*\S)) + |^@(interface|protocol|implementation)\b + + foldingStopMarker + (?<!\*)\*\*/|^\s*\}|^@end\b + keyEquivalent + ^~O + name + Objective-C + patterns + + + begin + ((@)(interface|protocol))(?!.+;)\s+([A-Za-z_][A-Za-z0-9_]*)\s*((:)(?:\s*)([A-Za-z][A-Za-z0-9]*))?(\s|\n)? + captures + + 1 + + name + storage.type.objc + + 2 + + name + punctuation.definition.storage.type.objc + + 4 + + name + entity.name.type.objc + + 6 + + name + punctuation.definition.entity.other.inherited-class.objc + + 7 + + name + entity.other.inherited-class.objc + + 8 + + name + meta.divider.objc + + 9 + + name + meta.inherited-class.objc + + + contentName + meta.scope.interface.objc + end + ((@)end)\b + name + meta.interface-or-protocol.objc + patterns + + + include + #interface_innards + + + + + begin + ((@)(implementation))\s+([A-Za-z_][A-Za-z0-9_]*)\s*(?::\s*([A-Za-z][A-Za-z0-9]*))? + captures + + 1 + + name + storage.type.objc + + 2 + + name + punctuation.definition.storage.type.objc + + 4 + + name + entity.name.type.objc + + 5 + + name + entity.other.inherited-class.objc + + + contentName + meta.scope.implementation.objc + end + ((@)end)\b + name + meta.implementation.objc + patterns + + + include + #implementation_innards + + + + + begin + @" + beginCaptures + + 0 + + name + punctuation.definition.string.begin.objc + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.objc + + + name + string.quoted.double.objc + patterns + + + match + \\(\\|[abefnrtv'"?]|[0-3]\d{,2}|[4-7]\d?|x[a-zA-Z0-9]+) + name + constant.character.escape.objc + + + match + \\. + name + invalid.illegal.unknown-escape.objc + + + + + begin + \b(id)\s*(?=<) + beginCaptures + + 1 + + name + storage.type.objc + + + end + (?<=>) + name + meta.id-with-protocol.objc + patterns + + + include + #protocol_list + + + + + match + \b(NS_DURING|NS_HANDLER|NS_ENDHANDLER)\b + name + keyword.control.macro.objc + + + captures + + 1 + + name + punctuation.definition.keyword.objc + + + match + (@)(try|catch|finally|throw)\b + name + keyword.control.exception.objc + + + captures + + 1 + + name + punctuation.definition.keyword.objc + + + match + (@)(synchronized)\b + name + keyword.control.synchronize.objc + + + captures + + 1 + + name + punctuation.definition.keyword.objc + + + match + (@)(defs|encode)\b + name + keyword.other.objc + + + match + \bid\b(\s|\n)? + name + storage.type.id.objc + + + match + \b(IBOutlet|IBAction|BOOL|SEL|id|unichar|IMP|Class)\b + name + storage.type.objc + + + captures + + 1 + + name + punctuation.definition.storage.type.objc + + + match + (@)(class|protocol)\b + name + storage.type.objc + + + begin + ((@)selector)\s*(\() + beginCaptures + + 1 + + name + storage.type.objc + + 2 + + name + punctuation.definition.storage.type.objc + + 3 + + name + punctuation.definition.storage.type.objc + + + contentName + meta.selector.method-name.objc + end + (\)) + endCaptures + + 1 + + name + punctuation.definition.storage.type.objc + + + name + meta.selector.objc + patterns + + + captures + + 1 + + name + punctuation.separator.arguments.objc + + + match + \b(?:[a-zA-Z_:][\w]*)+ + name + support.function.any-method.name-of-parameter.objc + + + + + captures + + 1 + + name + punctuation.definition.storage.modifier.objc + + + match + (@)(synchronized|public|private|protected)\b + name + storage.modifier.objc + + + match + \b(YES|NO|Nil|nil)\b + name + constant.language.objc + + + match + \bNSApp\b + name + support.variable.foundation + + + captures + + 1 + + name + punctuation.whitespace.support.function.cocoa.leopard + + 2 + + name + support.function.cocoa.leopard + + + match + (\s*)\b(NS(Rect(ToCGRect|FromCGRect)|MakeCollectable|S(tringFromProtocol|ize(ToCGSize|FromCGSize))|Draw(NinePartImage|ThreePartImage)|P(oint(ToCGPoint|FromCGPoint)|rotocolFromString)|EventMaskFromType|Value))\b + + + captures + + 1 + + name + punctuation.whitespace.support.function.leading.cocoa + + 2 + + name + support.function.cocoa + + + match + (\s*)\b(NS(R(ound(DownToMultipleOfPageSize|UpToMultipleOfPageSize)|un(CriticalAlertPanel(RelativeToWindow)?|InformationalAlertPanel(RelativeToWindow)?|AlertPanel(RelativeToWindow)?)|e(set(MapTable|HashTable)|c(ycleZone|t(Clip(List)?|F(ill(UsingOperation|List(UsingOperation|With(Grays|Colors(UsingOperation)?))?)?|romString))|ordAllocationEvent)|turnAddress|leaseAlertPanel|a(dPixel|l(MemoryAvailable|locateCollectable))|gisterServicesProvider)|angeFromString)|Get(SizeAndAlignment|CriticalAlertPanel|InformationalAlertPanel|UncaughtExceptionHandler|FileType(s)?|WindowServerMemory|AlertPanel)|M(i(n(X|Y)|d(X|Y))|ouseInRect|a(p(Remove|Get|Member|Insert(IfAbsent|KnownAbsent)?)|ke(R(ect|ange)|Size|Point)|x(Range|X|Y)))|B(itsPer(SampleFromDepth|PixelFromDepth)|e(stDepth|ep|gin(CriticalAlertSheet|InformationalAlertSheet|AlertSheet)))|S(ho(uldRetainWithZone|w(sServicesMenuItem|AnimationEffect))|tringFrom(R(ect|ange)|MapTable|S(ize|elector)|HashTable|Class|Point)|izeFromString|e(t(ShowsServicesMenuItem|ZoneName|UncaughtExceptionHandler|FocusRingStyle)|lectorFromString|archPathForDirectoriesInDomains)|wap(Big(ShortToHost|IntToHost|DoubleToHost|FloatToHost|Long(ToHost|LongToHost))|Short|Host(ShortTo(Big|Little)|IntTo(Big|Little)|DoubleTo(Big|Little)|FloatTo(Big|Little)|Long(To(Big|Little)|LongTo(Big|Little)))|Int|Double|Float|L(ittle(ShortToHost|IntToHost|DoubleToHost|FloatToHost|Long(ToHost|LongToHost))|ong(Long)?)))|H(ighlightRect|o(stByteOrder|meDirectory(ForUser)?)|eight|ash(Remove|Get|Insert(IfAbsent|KnownAbsent)?)|FSType(CodeFromFileType|OfFile))|N(umberOfColorComponents|ext(MapEnumeratorPair|HashEnumeratorItem))|C(o(n(tainsRect|vert(GlyphsToPackedGlyphs|Swapped(DoubleToHost|FloatToHost)|Host(DoubleToSwapped|FloatToSwapped)))|unt(MapTable|HashTable|Frames|Windows(ForContext)?)|py(M(emoryPages|apTableWithZone)|Bits|HashTableWithZone|Object)|lorSpaceFromDepth|mpare(MapTables|HashTables))|lassFromString|reate(MapTable(WithZone)?|HashTable(WithZone)?|Zone|File(namePboardType|ContentsPboardType)))|TemporaryDirectory|I(s(ControllerMarker|EmptyRect|FreedObject)|n(setRect|crementExtraRefCount|te(r(sect(sRect|ionR(ect|ange))|faceStyleForKey)|gralRect)))|Zone(Realloc|Malloc|Name|Calloc|Fr(omPointer|ee))|O(penStepRootDirectory|ffsetRect)|D(i(sableScreenUpdates|videRect)|ottedFrameRect|e(c(imal(Round|Multiply|S(tring|ubtract)|Normalize|Co(py|mpa(ct|re))|IsNotANumber|Divide|Power|Add)|rementExtraRefCountWasZero)|faultMallocZone|allocate(MemoryPages|Object))|raw(Gr(oove|ayBezel)|B(itmap|utton)|ColorTiledRects|TiledRects|DarkBezel|W(hiteBezel|indowBackground)|LightBezel))|U(serName|n(ionR(ect|ange)|registerServicesProvider)|pdateDynamicServices)|Java(Bundle(Setup|Cleanup)|Setup(VirtualMachine)?|Needs(ToLoadClasses|VirtualMachine)|ClassesF(orBundle|romPath)|ObjectNamedInPath|ProvidesClasses)|P(oint(InRect|FromString)|erformService|lanarFromDepth|ageSize)|E(n(d(MapTableEnumeration|HashTableEnumeration)|umerate(MapTable|HashTable)|ableScreenUpdates)|qual(R(ects|anges)|Sizes|Points)|raseRect|xtraRefCount)|F(ileTypeForHFSTypeCode|ullUserName|r(ee(MapTable|HashTable)|ame(Rect(WithWidth(UsingOperation)?)?|Address)))|Wi(ndowList(ForContext)?|dth)|Lo(cationInRange|g(v|PageSize)?)|A(ccessibility(R(oleDescription(ForUIElement)?|aiseBadArgumentException)|Unignored(Children(ForOnlyChild)?|Descendant|Ancestor)|PostNotification|ActionDescription)|pplication(Main|Load)|vailableWindowDepths|ll(MapTable(Values|Keys)|HashTableObjects|ocate(MemoryPages|Collectable|Object)))))\b + + + match + \bNS(RuleEditor|G(arbageCollector|radient)|MapTable|HashTable|Co(ndition|llectionView(Item)?)|T(oolbarItemGroup|extInputClient|r(eeNode|ackingArea))|InvocationOperation|Operation(Queue)?|D(ictionaryController|ockTile)|P(ointer(Functions|Array)|athC(o(ntrol(Delegate)?|mponentCell)|ell(Delegate)?)|r(intPanelAccessorizing|edicateEditor(RowTemplate)?))|ViewController|FastEnumeration|Animat(ionContext|ablePropertyContainer))\b + name + support.class.cocoa.leopard + + + match + \bNS(R(u(nLoop|ler(Marker|View))|e(sponder|cursiveLock|lativeSpecifier)|an(domSpecifier|geSpecifier))|G(etCommand|lyph(Generator|Storage|Info)|raphicsContext)|XML(Node|D(ocument|TD(Node)?)|Parser|Element)|M(iddleSpecifier|ov(ie(View)?|eCommand)|utable(S(tring|et)|C(haracterSet|opying)|IndexSet|D(ictionary|ata)|URLRequest|ParagraphStyle|A(ttributedString|rray))|e(ssagePort(NameServer)?|nu(Item(Cell)?|View)?|t(hodSignature|adata(Item|Query(ResultGroup|AttributeValueTuple)?)))|a(ch(BootstrapServer|Port)|trix))|B(itmapImageRep|ox|u(ndle|tton(Cell)?)|ezierPath|rowser(Cell)?)|S(hadow|c(anner|r(ipt(SuiteRegistry|C(o(ercionHandler|mmand(Description)?)|lassDescription)|ObjectSpecifier|ExecutionContext|WhoseTest)|oll(er|View)|een))|t(epper(Cell)?|atus(Bar|Item)|r(ing|eam))|imple(HorizontalTypesetter|CString)|o(cketPort(NameServer)?|und|rtDescriptor)|p(e(cifierTest|ech(Recognizer|Synthesizer)|ll(Server|Checker))|litView)|e(cureTextField(Cell)?|t(Command)?|archField(Cell)?|rializer|gmentedC(ontrol|ell))|lider(Cell)?|avePanel)|H(ost|TTP(Cookie(Storage)?|URLResponse)|elpManager)|N(ib(Con(nector|trolConnector)|OutletConnector)?|otification(Center|Queue)?|u(ll|mber(Formatter)?)|etService(Browser)?|ameSpecifier)|C(ha(ngeSpelling|racterSet)|o(n(stantString|nection|trol(ler)?|ditionLock)|d(ing|er)|unt(Command|edSet)|pying|lor(Space|P(ick(ing(Custom|Default)|er)|anel)|Well|List)?|m(p(oundPredicate|arisonPredicate)|boBox(Cell)?))|u(stomImageRep|rsor)|IImageRep|ell|l(ipView|o(seCommand|neCommand)|assDescription)|a(ched(ImageRep|URLResponse)|lendar(Date)?)|reateCommand)|T(hread|ypesetter|ime(Zone|r)|o(olbar(Item(Validations)?)?|kenField(Cell)?)|ext(Block|Storage|Container|Tab(le(Block)?)?|Input|View|Field(Cell)?|List|Attachment(Cell)?)?|a(sk|b(le(Header(Cell|View)|Column|View)|View(Item)?))|reeController)|I(n(dex(S(pecifier|et)|Path)|put(Manager|S(tream|erv(iceProvider|er(MouseTracker)?)))|vocation)|gnoreMisspelledWords|mage(Rep|Cell|View)?)|O(ut(putStream|lineView)|pen(GL(Context|Pixel(Buffer|Format)|View)|Panel)|bj(CTypeSerializationCallBack|ect(Controller)?))|D(i(st(antObject(Request)?|ributed(NotificationCenter|Lock))|ctionary|rectoryEnumerator)|ocument(Controller)?|e(serializer|cimalNumber(Behaviors|Handler)?|leteCommand)|at(e(Components|Picker(Cell)?|Formatter)?|a)|ra(wer|ggingInfo))|U(ser(InterfaceValidations|Defaults(Controller)?)|RL(Re(sponse|quest)|Handle(Client)?|C(onnection|ache|redential(Storage)?)|Download(Delegate)?|Prot(ocol(Client)?|ectionSpace)|AuthenticationChallenge(Sender)?)?|n(iqueIDSpecifier|doManager|archiver))|P(ipe|o(sitionalSpecifier|pUpButton(Cell)?|rt(Message|NameServer|Coder)?)|ICTImageRep|ersistentDocument|DFImageRep|a(steboard|nel|ragraphStyle|geLayout)|r(int(Info|er|Operation|Panel)|o(cessInfo|tocolChecker|perty(Specifier|ListSerialization)|gressIndicator|xy)|edicate))|E(numerator|vent|PSImageRep|rror|x(ception|istsCommand|pression))|V(iew(Animation)?|al(idated(ToobarItem|UserInterfaceItem)|ue(Transformer)?))|Keyed(Unarchiver|Archiver)|Qui(ckDrawView|tCommand)|F(ile(Manager|Handle|Wrapper)|o(nt(Manager|Descriptor|Panel)?|rm(Cell|atter)))|W(hoseSpecifier|indow(Controller)?|orkspace)|L(o(c(k(ing)?|ale)|gicalTest)|evelIndicator(Cell)?|ayoutManager)|A(ssertionHandler|nimation|ctionCell|ttributedString|utoreleasePool|TSTypesetter|ppl(ication|e(Script|Event(Manager|Descriptor)))|ffineTransform|lert|r(chiver|ray(Controller)?)))\b + name + support.class.cocoa + + + match + \bNS(R(oundingMode|ule(Editor(RowType|NestingMode)|rOrientation)|e(questUserAttentionType|lativePosition))|G(lyphInscription|radientDrawingOptions)|XML(NodeKind|D(ocumentContentKind|TDNodeKind)|ParserError)|M(ultibyteGlyphPacking|apTableOptions)|B(itmapFormat|oxType|ezierPathElement|ackgroundStyle|rowserDropOperation)|S(tr(ing(CompareOptions|DrawingOptions|EncodingConversionOptions)|eam(Status|Event))|p(eechBoundary|litViewDividerStyle)|e(archPathD(irectory|omainMask)|gmentS(tyle|witchTracking))|liderType|aveOptions)|H(TTPCookieAcceptPolicy|ashTableOptions)|N(otification(SuspensionBehavior|Coalescing)|umberFormatter(RoundingMode|Behavior|Style|PadPosition)|etService(sError|Options))|C(haracterCollection|o(lor(RenderingIntent|SpaceModel|PanelMode)|mp(oundPredicateType|arisonPredicateModifier))|ellStateValue|al(culationError|endarUnit))|T(ypesetterControlCharacterAction|imeZoneNameStyle|e(stComparisonOperation|xt(Block(Dimension|V(erticalAlignment|alueType)|Layer)|TableLayoutAlgorithm|FieldBezelStyle))|ableView(SelectionHighlightStyle|ColumnAutoresizingStyle)|rackingAreaOptions)|I(n(sertionPosition|te(rfaceStyle|ger))|mage(RepLoadStatus|Scaling|CacheMode|FrameStyle|LoadStatus|Alignment))|Ope(nGLPixelFormatAttribute|rationQueuePriority)|Date(Picker(Mode|Style)|Formatter(Behavior|Style))|U(RL(RequestCachePolicy|HandleStatus|C(acheStoragePolicy|redentialPersistence))|Integer)|P(o(stingStyle|int(ingDeviceType|erFunctionsOptions)|pUpArrowPosition)|athStyle|r(int(ing(Orientation|PaginationMode)|erTableStatus|PanelOptions)|opertyList(MutabilityOptions|Format)|edicateOperatorType))|ExpressionType|KeyValue(SetMutationKind|Change)|QTMovieLoopMode|F(indPanel(SubstringMatchType|Action)|o(nt(RenderingMode|FamilyClass)|cusRingPlacement))|W(hoseSubelementIdentifier|ind(ingRule|ow(B(utton|ackingLocation)|SharingType|CollectionBehavior)))|L(ine(MovementDirection|SweepDirection|CapStyle|JoinStyle)|evelIndicatorStyle)|Animation(BlockingMode|Curve))\b + name + support.type.cocoa.leopard + + + match + \bC(I(Sampler|Co(ntext|lor)|Image(Accumulator)?|PlugIn(Registration)?|Vector|Kernel|Filter(Generator|Shape)?)|A(Renderer|MediaTiming(Function)?|BasicAnimation|ScrollLayer|Constraint(LayoutManager)?|T(iledLayer|extLayer|rans(ition|action))|OpenGLLayer|PropertyAnimation|KeyframeAnimation|Layer|A(nimation(Group)?|ction)))\b + name + support.class.quartz + + + match + \bC(G(Float|Point|Size|Rect)|IFormat|AConstraintAttribute)\b + name + support.type.quartz + + + match + \bNS(R(ect(Edge)?|ange)|G(lyph(Relation|LayoutMode)?|radientType)|M(odalSession|a(trixMode|p(Table|Enumerator)))|B(itmapImageFileType|orderType|uttonType|ezelStyle|ackingStoreType|rowserColumnResizingType)|S(cr(oll(er(Part|Arrow)|ArrowPosition)|eenAuxiliaryOpaque)|tringEncoding|ize|ocketNativeHandle|election(Granularity|Direction|Affinity)|wapped(Double|Float)|aveOperationType)|Ha(sh(Table|Enumerator)|ndler(2)?)|C(o(ntrol(Size|Tint)|mp(ositingOperation|arisonResult))|ell(State|Type|ImagePosition|Attribute))|T(hreadPrivate|ypesetterGlyphInfo|i(ckMarkPosition|tlePosition|meInterval)|o(ol(TipTag|bar(SizeMode|DisplayMode))|kenStyle)|IFFCompression|ext(TabType|Alignment)|ab(State|leViewDropOperation|ViewType)|rackingRectTag)|ImageInterpolation|Zone|OpenGL(ContextAuxiliary|PixelFormatAuxiliary)|D(ocumentChangeType|atePickerElementFlags|ra(werState|gOperation))|UsableScrollerParts|P(oint|r(intingPageOrder|ogressIndicator(Style|Th(ickness|readInfo))))|EventType|KeyValueObservingOptions|Fo(nt(SymbolicTraits|TraitMask|Action)|cusRingType)|W(indow(OrderingMode|Depth)|orkspace(IconCreationOptions|LaunchOptions)|ritingDirection)|L(ineBreakMode|ayout(Status|Direction))|A(nimation(Progress|Effect)|ppl(ication(TerminateReply|DelegateReply|PrintReply)|eEventManagerSuspensionID)|ffineTransformStruct|lertStyle))\b + name + support.type.cocoa + + + match + \bNS(NotFound|Ordered(Ascending|Descending|Same))\b + name + support.constant.cocoa + + + match + \bNS(MenuDidBeginTracking|ViewDidUpdateTrackingAreas)?Notification\b + name + support.constant.notification.cocoa.leopard + + + match + \bNS(Menu(Did(RemoveItem|SendAction|ChangeItem|EndTracking|AddItem)|WillSendAction)|S(ystemColorsDidChange|plitView(DidResizeSubviews|WillResizeSubviews))|C(o(nt(extHelpModeDid(Deactivate|Activate)|rolT(intDidChange|extDid(BeginEditing|Change|EndEditing)))|lor(PanelColorDidChange|ListDidChange)|mboBox(Selection(IsChanging|DidChange)|Will(Dismiss|PopUp)))|lassDescriptionNeededForClass)|T(oolbar(DidRemoveItem|WillAddItem)|ext(Storage(DidProcessEditing|WillProcessEditing)|Did(BeginEditing|Change|EndEditing)|View(DidChange(Selection|TypingAttributes)|WillChangeNotifyingTextView))|ableView(Selection(IsChanging|DidChange)|ColumnDid(Resize|Move)))|ImageRepRegistryDidChange|OutlineView(Selection(IsChanging|DidChange)|ColumnDid(Resize|Move)|Item(Did(Collapse|Expand)|Will(Collapse|Expand)))|Drawer(Did(Close|Open)|Will(Close|Open))|PopUpButton(CellWillPopUp|WillPopUp)|View(GlobalFrameDidChange|BoundsDidChange|F(ocusDidChange|rameDidChange))|FontSetChanged|W(indow(Did(Resi(ze|gn(Main|Key))|M(iniaturize|ove)|Become(Main|Key)|ChangeScreen(|Profile)|Deminiaturize|Update|E(ndSheet|xpose))|Will(M(iniaturize|ove)|BeginSheet|Close))|orkspace(SessionDid(ResignActive|BecomeActive)|Did(Mount|TerminateApplication|Unmount|PerformFileOperation|Wake|LaunchApplication)|Will(Sleep|Unmount|PowerOff|LaunchApplication)))|A(ntialiasThresholdChanged|ppl(ication(Did(ResignActive|BecomeActive|Hide|ChangeScreenParameters|U(nhide|pdate)|FinishLaunching)|Will(ResignActive|BecomeActive|Hide|Terminate|U(nhide|pdate)|FinishLaunching))|eEventManagerWillProcessFirstEvent)))Notification\b + name + support.constant.notification.cocoa + + + match + \bNS(RuleEditor(RowType(Simple|Compound)|NestingMode(Si(ngle|mple)|Compound|List))|GradientDraws(BeforeStartingLocation|AfterEndingLocation)|M(inusSetExpressionType|a(chPortDeallocate(ReceiveRight|SendRight|None)|pTable(StrongMemory|CopyIn|ZeroingWeakMemory|ObjectPointerPersonality)))|B(oxCustom|undleExecutableArchitecture(X86|I386|PPC(64)?)|etweenPredicateOperatorType|ackgroundStyle(Raised|Dark|L(ight|owered)))|S(tring(DrawingTruncatesLastVisibleLine|EncodingConversion(ExternalRepresentation|AllowLossy))|ubqueryExpressionType|p(e(ech(SentenceBoundary|ImmediateBoundary|WordBoundary)|llingState(GrammarFlag|SpellingFlag))|litViewDividerStyleThi(n|ck))|e(rvice(RequestTimedOutError|M(iscellaneousError|alformedServiceDictionaryError)|InvalidPasteboardDataError|ErrorM(inimum|aximum)|Application(NotFoundError|LaunchFailedError))|gmentStyle(Round(Rect|ed)|SmallSquare|Capsule|Textured(Rounded|Square)|Automatic)))|H(UDWindowMask|ashTable(StrongMemory|CopyIn|ZeroingWeakMemory|ObjectPointerPersonality))|N(oModeColorPanel|etServiceNoAutoRename)|C(hangeRedone|o(ntainsPredicateOperatorType|l(orRenderingIntent(RelativeColorimetric|Saturation|Default|Perceptual|AbsoluteColorimetric)|lectorDisabledOption))|ellHit(None|ContentArea|TrackableArea|EditableTextArea))|T(imeZoneNameStyle(S(hort(Standard|DaylightSaving)|tandard)|DaylightSaving)|extFieldDatePickerStyle|ableViewSelectionHighlightStyle(Regular|SourceList)|racking(Mouse(Moved|EnteredAndExited)|CursorUpdate|InVisibleRect|EnabledDuringMouseDrag|A(ssumeInside|ctive(In(KeyWindow|ActiveApp)|WhenFirstResponder|Always))))|I(n(tersectSetExpressionType|dexedColorSpaceModel)|mageScale(None|Proportionally(Down|UpOrDown)|AxesIndependently))|Ope(nGLPFAAllowOfflineRenderers|rationQueue(DefaultMaxConcurrentOperationCount|Priority(High|Normal|Very(High|Low)|Low)))|D(iacriticInsensitiveSearch|ownloadsDirectory)|U(nionSetExpressionType|TF(16(BigEndianStringEncoding|StringEncoding|LittleEndianStringEncoding)|32(BigEndianStringEncoding|StringEncoding|LittleEndianStringEncoding)))|P(ointerFunctions(Ma(chVirtualMemory|llocMemory)|Str(ongMemory|uctPersonality)|C(StringPersonality|opyIn)|IntegerPersonality|ZeroingWeakMemory|O(paque(Memory|Personality)|bjectP(ointerPersonality|ersonality)))|at(hStyle(Standard|NavigationBar|PopUp)|ternColorSpaceModel)|rintPanelShows(Scaling|Copies|Orientation|P(a(perSize|ge(Range|SetupAccessory))|review)))|Executable(RuntimeMismatchError|NotLoadableError|ErrorM(inimum|aximum)|L(inkError|oadError)|ArchitectureMismatchError)|KeyValueObservingOption(Initial|Prior)|F(i(ndPanelSubstringMatchType(StartsWith|Contains|EndsWith|FullWord)|leRead(TooLargeError|UnknownStringEncodingError))|orcedOrderingSearch)|Wi(ndow(BackingLocation(MainMemory|Default|VideoMemory)|Sharing(Read(Only|Write)|None)|CollectionBehavior(MoveToActiveSpace|CanJoinAllSpaces|Default))|dthInsensitiveSearch)|AggregateExpressionType)\b + name + support.constant.cocoa.leopard + + + match + \bNS(R(GB(ModeColorPanel|ColorSpaceModel)|ight(Mouse(D(own(Mask)?|ragged(Mask)?)|Up(Mask)?)|T(ext(Movement|Alignment)|ab(sBezelBorder|StopType))|ArrowFunctionKey)|ound(RectBezelStyle|Bankers|ed(BezelStyle|TokenStyle|DisclosureBezelStyle)|Down|Up|Plain|Line(CapStyle|JoinStyle))|un(StoppedResponse|ContinuesResponse|AbortedResponse)|e(s(izableWindowMask|et(CursorRectsRunLoopOrdering|FunctionKey))|ce(ssedBezelStyle|iver(sCantHandleCommandScriptError|EvaluationScriptError))|turnTextMovement|doFunctionKey|quiredArgumentsMissingScriptError|l(evancyLevelIndicatorStyle|ative(Before|After))|gular(SquareBezelStyle|ControlSize)|moveTraitFontAction)|a(n(domSubelement|geDateMode)|tingLevelIndicatorStyle|dio(ModeMatrix|Button)))|G(IFFileType|lyph(Below|Inscribe(B(elow|ase)|Over(strike|Below)|Above)|Layout(WithPrevious|A(tAPoint|gainstAPoint))|A(ttribute(BidiLevel|Soft|Inscribe|Elastic)|bove))|r(ooveBorder|eaterThan(Comparison|OrEqualTo(Comparison|PredicateOperatorType)|PredicateOperatorType)|a(y(ModeColorPanel|ColorSpaceModel)|dient(None|Con(cave(Strong|Weak)|vex(Strong|Weak)))|phiteControlTint)))|XML(N(o(tationDeclarationKind|de(CompactEmptyElement|IsCDATA|OptionsNone|Use(SingleQuotes|DoubleQuotes)|Pre(serve(NamespaceOrder|C(haracterReferences|DATA)|DTD|Prefixes|E(ntities|mptyElements)|Quotes|Whitespace|A(ttributeOrder|ll))|ttyPrint)|ExpandEmptyElement))|amespaceKind)|CommentKind|TextKind|InvalidKind|D(ocument(X(MLKind|HTMLKind|Include)|HTMLKind|T(idy(XML|HTML)|extKind)|IncludeContentTypeDeclaration|Validate|Kind)|TDKind)|P(arser(GTRequiredError|XMLDeclNot(StartedError|FinishedError)|Mi(splaced(XMLDeclarationError|CDATAEndStringError)|xedContentDeclNot(StartedError|FinishedError))|S(t(andaloneValueError|ringNot(StartedError|ClosedError))|paceRequiredError|eparatorRequiredError)|N(MTOKENRequiredError|o(t(ationNot(StartedError|FinishedError)|WellBalancedError)|DTDError)|amespaceDeclarationError|AMERequiredError)|C(haracterRef(In(DTDError|PrologError|EpilogError)|AtEOFError)|o(nditionalSectionNot(StartedError|FinishedError)|mment(NotFinishedError|ContainsDoubleHyphenError))|DATANotFinishedError)|TagNameMismatchError|In(ternalError|valid(HexCharacterRefError|C(haracter(RefError|InEntityError|Error)|onditionalSectionError)|DecimalCharacterRefError|URIError|Encoding(NameError|Error)))|OutOfMemoryError|D(ocumentStartError|elegateAbortedParseError|OCTYPEDeclNotFinishedError)|U(RI(RequiredError|FragmentError)|n(declaredEntityError|parsedEntityError|knownEncodingError|finishedTagError))|P(CDATARequiredError|ublicIdentifierRequiredError|arsedEntityRef(MissingSemiError|NoNameError|In(Internal(SubsetError|Error)|PrologError|EpilogError)|AtEOFError)|r(ocessingInstructionNot(StartedError|FinishedError)|ematureDocumentEndError))|E(n(codingNotSupportedError|tity(Ref(In(DTDError|PrologError|EpilogError)|erence(MissingSemiError|WithoutNameError)|LoopError|AtEOFError)|BoundaryError|Not(StartedError|FinishedError)|Is(ParameterError|ExternalError)|ValueRequiredError))|qualExpectedError|lementContentDeclNot(StartedError|FinishedError)|xt(ernalS(tandaloneEntityError|ubsetNotFinishedError)|raContentError)|mptyDocumentError)|L(iteralNot(StartedError|FinishedError)|T(RequiredError|SlashRequiredError)|essThanSymbolInAttributeError)|Attribute(RedefinedError|HasNoValueError|Not(StartedError|FinishedError)|ListNot(StartedError|FinishedError)))|rocessingInstructionKind)|E(ntity(GeneralKind|DeclarationKind|UnparsedKind|P(ar(sedKind|ameterKind)|redefined))|lement(Declaration(MixedKind|UndefinedKind|E(lementKind|mptyKind)|Kind|AnyKind)|Kind))|Attribute(N(MToken(sKind|Kind)|otationKind)|CDATAKind|ID(Ref(sKind|Kind)|Kind)|DeclarationKind|En(tit(yKind|iesKind)|umerationKind)|Kind))|M(i(n(XEdge|iaturizableWindowMask|YEdge|uteCalendarUnit)|terLineJoinStyle|ddleSubelement|xedState)|o(nthCalendarUnit|deSwitchFunctionKey|use(Moved(Mask)?|E(ntered(Mask)?|ventSubtype|xited(Mask)?))|veToBezierPathElement|mentary(ChangeButton|Push(Button|InButton)|Light(Button)?))|enuFunctionKey|a(c(intoshInterfaceStyle|OSRomanStringEncoding)|tchesPredicateOperatorType|ppedRead|x(XEdge|YEdge))|ACHOperatingSystem)|B(MPFileType|o(ttomTabsBezelBorder|ldFontMask|rderlessWindowMask|x(Se(condary|parator)|OldStyle|Primary))|uttLineCapStyle|e(zelBorder|velLineJoinStyle|low(Bottom|Top)|gin(sWith(Comparison|PredicateOperatorType)|FunctionKey))|lueControlTint|ack(spaceCharacter|tabTextMovement|ingStore(Retained|Buffered|Nonretained)|TabCharacter|wardsSearch|groundTab)|r(owser(NoColumnResizing|UserColumnResizing|AutoColumnResizing)|eakFunctionKey))|S(h(ift(JISStringEncoding|KeyMask)|ow(ControlGlyphs|InvisibleGlyphs)|adowlessSquareBezelStyle)|y(s(ReqFunctionKey|tem(D(omainMask|efined(Mask)?)|FunctionKey))|mbolStringEncoding)|c(a(nnedOption|le(None|ToFit|Proportionally))|r(oll(er(NoPart|Increment(Page|Line|Arrow)|Decrement(Page|Line|Arrow)|Knob(Slot)?|Arrows(M(inEnd|axEnd)|None|DefaultSetting))|Wheel(Mask)?|LockFunctionKey)|eenChangedEventType))|t(opFunctionKey|r(ingDrawing(OneShot|DisableScreenFontSubstitution|Uses(DeviceMetrics|FontLeading|LineFragmentOrigin))|eam(Status(Reading|NotOpen|Closed|Open(ing)?|Error|Writing|AtEnd)|Event(Has(BytesAvailable|SpaceAvailable)|None|OpenCompleted|E(ndEncountered|rrorOccurred)))))|i(ngle(DateMode|UnderlineStyle)|ze(DownFontAction|UpFontAction))|olarisOperatingSystem|unOSOperatingSystem|pecialPageOrder|e(condCalendarUnit|lect(By(Character|Paragraph|Word)|i(ng(Next|Previous)|onAffinity(Downstream|Upstream))|edTab|FunctionKey)|gmentSwitchTracking(Momentary|Select(One|Any)))|quareLineCapStyle|witchButton|ave(ToOperation|Op(tions(Yes|No|Ask)|eration)|AsOperation)|mall(SquareBezelStyle|C(ontrolSize|apsFontMask)|IconButtonBezelStyle))|H(ighlightModeMatrix|SBModeColorPanel|o(ur(Minute(SecondDatePickerElementFlag|DatePickerElementFlag)|CalendarUnit)|rizontalRuler|meFunctionKey)|TTPCookieAcceptPolicy(Never|OnlyFromMainDocumentDomain|Always)|e(lp(ButtonBezelStyle|KeyMask|FunctionKey)|avierFontAction)|PUXOperatingSystem)|Year(MonthDa(yDatePickerElementFlag|tePickerElementFlag)|CalendarUnit)|N(o(n(StandardCharacterSetFontMask|ZeroWindingRule|activatingPanelMask|LossyASCIIStringEncoding)|Border|t(ification(SuspensionBehavior(Hold|Coalesce|D(eliverImmediately|rop))|NoCoalescing|CoalescingOn(Sender|Name)|DeliverImmediately|PostToAllSessions)|PredicateType|EqualToPredicateOperatorType)|S(cr(iptError|ollerParts)|ubelement|pecifierError)|CellMask|T(itle|opLevelContainersSpecifierError|abs(BezelBorder|NoBorder|LineBorder))|I(nterfaceStyle|mage)|UnderlineStyle|FontChangeAction)|u(ll(Glyph|CellType)|m(eric(Search|PadKeyMask)|berFormatter(Round(Half(Down|Up|Even)|Ceiling|Down|Up|Floor)|Behavior(10|Default)|S(cientificStyle|pellOutStyle)|NoStyle|CurrencyStyle|DecimalStyle|P(ercentStyle|ad(Before(Suffix|Prefix)|After(Suffix|Prefix))))))|e(t(Services(BadArgumentError|NotFoundError|C(ollisionError|ancelledError)|TimeoutError|InvalidError|UnknownError|ActivityInProgress)|workDomainMask)|wlineCharacter|xt(StepInterfaceStyle|FunctionKey))|EXTSTEPStringEncoding|a(t(iveShortGlyphPacking|uralTextAlignment)|rrowFontMask))|C(hange(ReadOtherContents|GrayCell(Mask)?|BackgroundCell(Mask)?|Cleared|Done|Undone|Autosaved)|MYK(ModeColorPanel|ColorSpaceModel)|ircular(BezelStyle|Slider)|o(n(stantValueExpressionType|t(inuousCapacityLevelIndicatorStyle|entsCellMask|ain(sComparison|erSpecifierError)|rol(Glyph|KeyMask))|densedFontMask)|lor(Panel(RGBModeMask|GrayModeMask|HSBModeMask|C(MYKModeMask|olorListModeMask|ustomPaletteModeMask|rayonModeMask)|WheelModeMask|AllModesMask)|ListModeColorPanel)|reServiceDirectory|m(p(osite(XOR|Source(In|O(ut|ver)|Atop)|Highlight|C(opy|lear)|Destination(In|O(ut|ver)|Atop)|Plus(Darker|Lighter))|ressedFontMask)|mandKeyMask))|u(stom(SelectorPredicateOperatorType|PaletteModeColorPanel)|r(sor(Update(Mask)?|PointingDevice)|veToBezierPathElement))|e(nterT(extAlignment|abStopType)|ll(State|H(ighlighted|as(Image(Horizontal|OnLeftOrBottom)|OverlappingImage))|ChangesContents|Is(Bordered|InsetButton)|Disabled|Editable|LightsBy(Gray|Background|Contents)|AllowsMixedState))|l(ipPagination|o(s(ePathBezierPathElement|ableWindowMask)|ckAndCalendarDatePickerStyle)|ear(ControlTint|DisplayFunctionKey|LineFunctionKey))|a(seInsensitive(Search|PredicateOption)|n(notCreateScriptCommandError|cel(Button|TextMovement))|chesDirectory|lculation(NoError|Overflow|DivideByZero|Underflow|LossOfPrecision)|rriageReturnCharacter)|r(itical(Request|AlertStyle)|ayonModeColorPanel))|T(hick(SquareBezelStyle|erSquareBezelStyle)|ypesetter(Behavior|HorizontalTabAction|ContainerBreakAction|ZeroAdvancementAction|OriginalBehavior|ParagraphBreakAction|WhitespaceAction|L(ineBreakAction|atestBehavior))|i(ckMark(Right|Below|Left|Above)|tledWindowMask|meZoneDatePickerElementFlag)|o(olbarItemVisibilityPriority(Standard|High|User|Low)|pTabsBezelBorder|ggleButton)|IFF(Compression(N(one|EXT)|CCITTFAX(3|4)|OldJPEG|JPEG|PackBits|LZW)|FileType)|e(rminate(Now|Cancel|Later)|xt(Read(InapplicableDocumentTypeError|WriteErrorM(inimum|aximum))|Block(M(i(nimum(Height|Width)|ddleAlignment)|a(rgin|ximum(Height|Width)))|B(o(ttomAlignment|rder)|aselineAlignment)|Height|TopAlignment|P(ercentageValueType|adding)|Width|AbsoluteValueType)|StorageEdited(Characters|Attributes)|CellType|ured(RoundedBezelStyle|BackgroundWindowMask|SquareBezelStyle)|Table(FixedLayoutAlgorithm|AutomaticLayoutAlgorithm)|Field(RoundedBezel|SquareBezel|AndStepperDatePickerStyle)|WriteInapplicableDocumentTypeError|ListPrependEnclosingMarker))|woByteGlyphPacking|ab(Character|TextMovement|le(tP(oint(Mask|EventSubtype)?|roximity(Mask|EventSubtype)?)|Column(NoResizing|UserResizingMask|AutoresizingMask)|View(ReverseSequentialColumnAutoresizingStyle|GridNone|S(olid(HorizontalGridLineMask|VerticalGridLineMask)|equentialColumnAutoresizingStyle)|NoColumnAutoresizing|UniformColumnAutoresizingStyle|FirstColumnOnlyAutoresizingStyle|LastColumnOnlyAutoresizingStyle)))|rackModeMatrix)|I(n(sert(CharFunctionKey|FunctionKey|LineFunctionKey)|t(Type|ernalS(criptError|pecifierError))|dexSubelement|validIndexSpecifierError|formational(Request|AlertStyle)|PredicateOperatorType)|talicFontMask|SO(2022JPStringEncoding|Latin(1StringEncoding|2StringEncoding))|dentityMappingCharacterCollection|llegalTextMovement|mage(R(ight|ep(MatchesDevice|LoadStatus(ReadingHeader|Completed|InvalidData|Un(expectedEOF|knownType)|WillNeedAllData)))|Below|C(ellType|ache(BySize|Never|Default|Always))|Interpolation(High|None|Default|Low)|O(nly|verlaps)|Frame(Gr(oove|ayBezel)|Button|None|Photo)|L(oadStatus(ReadError|C(ompleted|ancelled)|InvalidData|UnexpectedEOF)|eft)|A(lign(Right|Bottom(Right|Left)?|Center|Top(Right|Left)?|Left)|bove)))|O(n(State|eByteGlyphPacking|OffButton|lyScrollerArrows)|ther(Mouse(D(own(Mask)?|ragged(Mask)?)|Up(Mask)?)|TextMovement)|SF1OperatingSystem|pe(n(GL(GO(Re(setLibrary|tainRenderers)|ClearFormatCache|FormatCacheSize)|PFA(R(obust|endererID)|M(inimumPolicy|ulti(sample|Screen)|PSafe|aximumPolicy)|BackingStore|S(creenMask|te(ncilSize|reo)|ingleRenderer|upersample|ample(s|Buffers|Alpha))|NoRecovery|C(o(lor(Size|Float)|mpliant)|losestPolicy)|OffScreen|D(oubleBuffer|epthSize)|PixelBuffer|VirtualScreenCount|FullScreen|Window|A(cc(umSize|elerated)|ux(Buffers|DepthStencil)|l(phaSize|lRenderers))))|StepUnicodeReservedBase)|rationNotSupportedForKeyS(criptError|pecifierError))|ffState|KButton|rPredicateType|bjC(B(itfield|oolType)|S(hortType|tr(ingType|uctType)|electorType)|NoType|CharType|ObjectType|DoubleType|UnionType|PointerType|VoidType|FloatType|Long(Type|longType)|ArrayType))|D(i(s(c(losureBezelStyle|reteCapacityLevelIndicatorStyle)|playWindowRunLoopOrdering)|acriticInsensitivePredicateOption|rect(Selection|PredicateModifier))|o(c(ModalWindowMask|ument(Directory|ationDirectory))|ubleType|wn(TextMovement|ArrowFunctionKey))|e(s(cendingPageOrder|ktopDirectory)|cimalTabStopType|v(ice(NColorSpaceModel|IndependentModifierFlagsMask)|eloper(Directory|ApplicationDirectory))|fault(ControlTint|TokenStyle)|lete(Char(acter|FunctionKey)|FunctionKey|LineFunctionKey)|moApplicationDirectory)|a(yCalendarUnit|teFormatter(MediumStyle|Behavior(10|Default)|ShortStyle|NoStyle|FullStyle|LongStyle))|ra(wer(Clos(ingState|edState)|Open(ingState|State))|gOperation(Generic|Move|None|Copy|Delete|Private|Every|Link|All)))|U(ser(CancelledError|D(irectory|omainMask)|FunctionKey)|RL(Handle(NotLoaded|Load(Succeeded|InProgress|Failed))|CredentialPersistence(None|Permanent|ForSession))|n(scaledWindowMask|cachedRead|i(codeStringEncoding|talicFontMask|fiedTitleAndToolbarWindowMask)|d(o(CloseGroupingRunLoopOrdering|FunctionKey)|e(finedDateComponent|rline(Style(Single|None|Thick|Double)|Pattern(Solid|D(ot|ash(Dot(Dot)?)?)))))|known(ColorSpaceModel|P(ointingDevice|ageOrder)|KeyS(criptError|pecifierError))|boldFontMask)|tilityWindowMask|TF8StringEncoding|p(dateWindowsRunLoopOrdering|TextMovement|ArrowFunctionKey))|J(ustifiedTextAlignment|PEG(2000FileType|FileType)|apaneseEUC(GlyphPacking|StringEncoding))|P(o(s(t(Now|erFontMask|WhenIdle|ASAP)|iti(on(Replace|Be(fore|ginning)|End|After)|ve(IntType|DoubleType|FloatType)))|pUp(NoArrow|ArrowAt(Bottom|Center))|werOffEventType|rtraitOrientation)|NGFileType|ush(InCell(Mask)?|OnPushOffButton)|e(n(TipMask|UpperSideMask|PointingDevice|LowerSideMask)|riodic(Mask)?)|P(S(caleField|tatus(Title|Field)|aveButton)|N(ote(Title|Field)|ame(Title|Field))|CopiesField|TitleField|ImageButton|OptionsButton|P(a(perFeedButton|ge(Range(To|From)|ChoiceMatrix))|reviewButton)|LayoutButton)|lainTextTokenStyle|a(useFunctionKey|ragraphSeparatorCharacter|ge(DownFunctionKey|UpFunctionKey))|r(int(ing(ReplyLater|Success|Cancelled|Failure)|ScreenFunctionKey|erTable(NotFound|OK|Error)|FunctionKey)|o(p(ertyList(XMLFormat|MutableContainers(AndLeaves)?|BinaryFormat|Immutable|OpenStepFormat)|rietaryStringEncoding)|gressIndicator(BarStyle|SpinningStyle|Preferred(SmallThickness|Thickness|LargeThickness|AquaThickness)))|e(ssedTab|vFunctionKey))|L(HeightForm|CancelButton|TitleField|ImageButton|O(KButton|rientationMatrix)|UnitsButton|PaperNameButton|WidthForm))|E(n(terCharacter|d(sWith(Comparison|PredicateOperatorType)|FunctionKey))|v(e(nOddWindingRule|rySubelement)|aluatedObjectExpressionType)|qualTo(Comparison|PredicateOperatorType)|ra(serPointingDevice|CalendarUnit|DatePickerElementFlag)|x(clude(10|QuickDrawElementsIconCreationOption)|pandedFontMask|ecuteFunctionKey))|V(i(ew(M(in(XMargin|YMargin)|ax(XMargin|YMargin))|HeightSizable|NotSizable|WidthSizable)|aPanelFontAction)|erticalRuler|a(lidationErrorM(inimum|aximum)|riableExpressionType))|Key(SpecifierEvaluationScriptError|Down(Mask)?|Up(Mask)?|PathExpressionType|Value(MinusSetMutation|SetSetMutation|Change(Re(placement|moval)|Setting|Insertion)|IntersectSetMutation|ObservingOption(New|Old)|UnionSetMutation|ValidationError))|QTMovie(NormalPlayback|Looping(BackAndForthPlayback|Playback))|F(1(1FunctionKey|7FunctionKey|2FunctionKey|8FunctionKey|3FunctionKey|9FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey|6FunctionKey)|7FunctionKey|i(nd(PanelAction(Replace(A(ndFind|ll(InSelection)?))?|S(howFindPanel|e(tFindString|lectAll(InSelection)?))|Next|Previous)|FunctionKey)|tPagination|le(Read(No(SuchFileError|PermissionError)|CorruptFileError|In(validFileNameError|applicableStringEncodingError)|Un(supportedSchemeError|knownError))|HandlingPanel(CancelButton|OKButton)|NoSuchFileError|ErrorM(inimum|aximum)|Write(NoPermissionError|In(validFileNameError|applicableStringEncodingError)|OutOfSpaceError|Un(supportedSchemeError|knownError))|LockingError)|xedPitchFontMask)|2(1FunctionKey|7FunctionKey|2FunctionKey|8FunctionKey|3FunctionKey|9FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey|6FunctionKey)|o(nt(Mo(noSpaceTrait|dernSerifsClass)|BoldTrait|S(ymbolicClass|criptsClass|labSerifsClass|ansSerifClass)|C(o(ndensedTrait|llectionApplicationOnlyMask)|larendonSerifsClass)|TransitionalSerifsClass|I(ntegerAdvancementsRenderingMode|talicTrait)|O(ldStyleSerifsClass|rnamentalsClass)|DefaultRenderingMode|U(nknownClass|IOptimizedTrait)|Panel(S(hadowEffectModeMask|t(andardModesMask|rikethroughEffectModeMask)|izeModeMask)|CollectionModeMask|TextColorEffectModeMask|DocumentColorEffectModeMask|UnderlineEffectModeMask|FaceModeMask|All(ModesMask|EffectsModeMask))|ExpandedTrait|VerticalTrait|F(amilyClassMask|reeformSerifsClass)|Antialiased(RenderingMode|IntegerAdvancementsRenderingMode))|cusRing(Below|Type(None|Default|Exterior)|Only|Above)|urByteGlyphPacking|rm(attingError(M(inimum|aximum))?|FeedCharacter))|8FunctionKey|unction(ExpressionType|KeyMask)|3(1FunctionKey|2FunctionKey|3FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey)|9FunctionKey|4FunctionKey|P(RevertButton|S(ize(Title|Field)|etButton)|CurrentField|Preview(Button|Field))|l(oat(ingPointSamplesBitmapFormat|Type)|agsChanged(Mask)?)|axButton|5FunctionKey|6FunctionKey)|W(heelModeColorPanel|indow(s(NTOperatingSystem|CP125(1StringEncoding|2StringEncoding|3StringEncoding|4StringEncoding|0StringEncoding)|95(InterfaceStyle|OperatingSystem))|M(iniaturizeButton|ovedEventType)|Below|CloseButton|ToolbarButton|ZoomButton|Out|DocumentIconButton|ExposedEventType|Above)|orkspaceLaunch(NewInstance|InhibitingBackgroundOnly|Default|PreferringClassic|WithoutA(ctivation|ddingToRecents)|A(sync|nd(Hide(Others)?|Print)|llowingClassicStartup))|eek(day(CalendarUnit|OrdinalCalendarUnit)|CalendarUnit)|a(ntsBidiLevels|rningAlertStyle)|r(itingDirection(RightToLeft|Natural|LeftToRight)|apCalendarComponents))|L(i(stModeMatrix|ne(Moves(Right|Down|Up|Left)|B(order|reakBy(C(harWrapping|lipping)|Truncating(Middle|Head|Tail)|WordWrapping))|S(eparatorCharacter|weep(Right|Down|Up|Left))|ToBezierPathElement|DoesntMove|arSlider)|teralSearch|kePredicateOperatorType|ghterFontAction|braryDirectory)|ocalDomainMask|e(ssThan(Comparison|OrEqualTo(Comparison|PredicateOperatorType)|PredicateOperatorType)|ft(Mouse(D(own(Mask)?|ragged(Mask)?)|Up(Mask)?)|T(ext(Movement|Alignment)|ab(sBezelBorder|StopType))|ArrowFunctionKey))|a(yout(RightToLeft|NotDone|CantFit|OutOfGlyphs|Done|LeftToRight)|ndscapeOrientation)|ABColorSpaceModel)|A(sc(iiWithDoubleByteEUCGlyphPacking|endingPageOrder)|n(y(Type|PredicateModifier|EventMask)|choredSearch|imation(Blocking|Nonblocking(Threaded)?|E(ffect(DisappearingItemDefault|Poof)|ase(In(Out)?|Out))|Linear)|dPredicateType)|t(Bottom|tachmentCharacter|omicWrite|Top)|SCIIStringEncoding|d(obe(GB1CharacterCollection|CNS1CharacterCollection|Japan(1CharacterCollection|2CharacterCollection)|Korea1CharacterCollection)|dTraitFontAction|minApplicationDirectory)|uto(saveOperation|Pagination)|pp(lication(SupportDirectory|D(irectory|e(fined(Mask)?|legateReply(Success|Cancel|Failure)|activatedEventType))|ActivatedEventType)|KitDefined(Mask)?)|l(ternateKeyMask|pha(ShiftKeyMask|NonpremultipliedBitmapFormat|FirstBitmapFormat)|ert(SecondButtonReturn|ThirdButtonReturn|OtherReturn|DefaultReturn|ErrorReturn|FirstButtonReturn|AlternateReturn)|l(ScrollerParts|DomainsMask|PredicateModifier|LibrariesDirectory|ApplicationsDirectory))|rgument(sWrongScriptError|EvaluationScriptError)|bove(Bottom|Top)|WTEventType))\b + name + support.constant.cocoa + + + include + source.c + + + include + #bracketed_content + + + repository + + bracketed_content + + begin + \[ + beginCaptures + + 0 + + name + punctuation.section.scope.begin.objc + + + end + \] + endCaptures + + 0 + + name + punctuation.section.scope.end.objc + + + name + meta.bracketed.objc + patterns + + + begin + (?=predicateWithFormat:)(?<=NSPredicate )(predicateWithFormat:) + beginCaptures + + 1 + + name + support.function.any-method.objc + + 2 + + name + punctuation.separator.arguments.objc + + + end + (?=\]) + name + meta.function-call.predicate.objc + patterns + + + captures + + 1 + + name + punctuation.separator.arguments.objc + + + match + \bargument(Array|s)(:) + name + support.function.any-method.name-of-parameter.objc + + + captures + + 1 + + name + punctuation.separator.arguments.objc + + + match + \b\w+(:) + name + invalid.illegal.unknown-method.objc + + + begin + @" + beginCaptures + + 0 + + name + punctuation.definition.string.begin.objc + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.objc + + + name + string.quoted.double.objc + patterns + + + match + \b(AND|OR|NOT|IN)\b + name + keyword.operator.logical.predicate.cocoa + + + match + \b(ALL|ANY|SOME|NONE)\b + name + constant.language.predicate.cocoa + + + match + \b(NULL|NIL|SELF|TRUE|YES|FALSE|NO|FIRST|LAST|SIZE)\b + name + constant.language.predicate.cocoa + + + match + \b(MATCHES|CONTAINS|BEGINSWITH|ENDSWITH|BETWEEN)\b + name + keyword.operator.comparison.predicate.cocoa + + + match + \bC(ASEINSENSITIVE|I)\b + name + keyword.other.modifier.predicate.cocoa + + + match + \b(ANYKEY|SUBQUERY|CAST|TRUEPREDICATE|FALSEPREDICATE)\b + name + keyword.other.predicate.cocoa + + + match + \\(\\|[abefnrtv'"?]|[0-3]\d{,2}|[4-7]\d?|x[a-zA-Z0-9]+) + name + constant.character.escape.objc + + + match + \\. + name + invalid.illegal.unknown-escape.objc + + + + + include + #special_variables + + + include + #c_functions + + + include + $base + + + + + begin + (?=\w)(?<=[\w\])"] )(\w+(?:(:)|(?=\]))) + beginCaptures + + 1 + + name + support.function.any-method.objc + + 2 + + name + punctuation.separator.arguments.objc + + + end + (?=\]) + name + meta.function-call.objc + patterns + + + captures + + 1 + + name + punctuation.separator.arguments.objc + + + match + \b\w+(:) + name + support.function.any-method.name-of-parameter.objc + + + include + #special_variables + + + include + #c_functions + + + include + $base + + + + + include + #special_variables + + + include + #c_functions + + + include + $self + + + + c_functions + + patterns + + + captures + + 1 + + name + punctuation.whitespace.support.function.leading.c + + 2 + + name + support.function.C99.c + + + match + (\s*)\b(hypot(f|l)?|s(scanf|ystem|nprintf|ca(nf|lb(n(f|l)?|ln(f|l)?))|i(n(h(f|l)?|f|l)?|gn(al|bit))|tr(s(tr|pn)|nc(py|at|mp)|c(spn|hr|oll|py|at|mp)|to(imax|d|u(l(l)?|max)|k|f|l(d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(jmp|vbuf|locale|buf)|qrt(f|l)?|w(scanf|printf)|rand)|n(e(arbyint(f|l)?|xt(toward(f|l)?|after(f|l)?))|an(f|l)?)|c(s(in(h(f|l)?|f|l)?|qrt(f|l)?)|cos(h(f)?|f|l)?|imag(f|l)?|t(ime|an(h(f|l)?|f|l)?)|o(s(h(f|l)?|f|l)?|nj(f|l)?|pysign(f|l)?)|p(ow(f|l)?|roj(f|l)?)|e(il(f|l)?|xp(f|l)?)|l(o(ck|g(f|l)?)|earerr)|a(sin(h(f|l)?|f|l)?|cos(h(f|l)?|f|l)?|tan(h(f|l)?|f|l)?|lloc|rg(f|l)?|bs(f|l)?)|real(f|l)?|brt(f|l)?)|t(ime|o(upper|lower)|an(h(f|l)?|f|l)?|runc(f|l)?|gamma(f|l)?|mp(nam|file))|i(s(space|n(ormal|an)|cntrl|inf|digit|u(nordered|pper)|p(unct|rint)|finite|w(space|c(ntrl|type)|digit|upper|p(unct|rint)|lower|al(num|pha)|graph|xdigit|blank)|l(ower|ess(equal|greater)?)|al(num|pha)|gr(eater(equal)?|aph)|xdigit|blank)|logb(f|l)?|max(div|abs))|di(v|fftime)|_Exit|unget(c|wc)|p(ow(f|l)?|ut(s|c(har)?|wc(har)?)|error|rintf)|e(rf(c(f|l)?|f|l)?|x(it|p(2(f|l)?|f|l|m1(f|l)?)?))|v(s(scanf|nprintf|canf|printf|w(scanf|printf))|printf|f(scanf|printf|w(scanf|printf))|w(scanf|printf)|a_(start|copy|end|arg))|qsort|f(s(canf|e(tpos|ek))|close|tell|open|dim(f|l)?|p(classify|ut(s|c|w(s|c))|rintf)|e(holdexcept|set(e(nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(aiseexcept|ror)|get(e(nv|xceptflag)|round))|flush|w(scanf|ide|printf|rite)|loor(f|l)?|abs(f|l)?|get(s|c|pos|w(s|c))|re(open|e|ad|xp(f|l)?)|m(in(f|l)?|od(f|l)?|a(f|l|x(f|l)?)?))|l(d(iv|exp(f|l)?)|o(ngjmp|cal(time|econv)|g(1(p(f|l)?|0(f|l)?)|2(f|l)?|f|l|b(f|l)?)?)|abs|l(div|abs|r(int(f|l)?|ound(f|l)?))|r(int(f|l)?|ound(f|l)?)|gamma(f|l)?)|w(scanf|c(s(s(tr|pn)|nc(py|at|mp)|c(spn|hr|oll|py|at|mp)|to(imax|d|u(l(l)?|max)|k|f|l(d|l)?|mbs)|pbrk|ftime|len|r(chr|tombs)|xfrm)|to(b|mb)|rtomb)|printf|mem(set|c(hr|py|mp)|move))|a(s(sert|ctime|in(h(f|l)?|f|l)?)|cos(h(f|l)?|f|l)?|t(o(i|f|l(l)?)|exit|an(h(f|l)?|2(f|l)?|f|l)?)|b(s|ort))|g(et(s|c(har)?|env|wc(har)?)|mtime)|r(int(f|l)?|ound(f|l)?|e(name|alloc|wind|m(ove|quo(f|l)?|ainder(f|l)?))|a(nd|ise))|b(search|towc)|m(odf(f|l)?|em(set|c(hr|py|mp)|move)|ktime|alloc|b(s(init|towcs|rtowcs)|towc|len|r(towc|len))))\b + + + captures + + 1 + + name + punctuation.whitespace.function-call.leading.c + + 2 + + name + support.function.any-method.c + + 3 + + name + punctuation.definition.parameters.c + + + match + (?x) (?: (?= \s ) (?:(?<=else|new|return) | (?<!\w)) (\s+))? + (\b + (?!(while|for|do|if|else|switch|catch|enumerate|return|r?iterate)\s*\()(?:(?!NS)[A-Za-z_][A-Za-z0-9_]*+\b | :: )++ # actual name + ) + \s*(\() + name + meta.function-call.c + + + + comment + + patterns + + + begin + /\* + captures + + 0 + + name + punctuation.definition.comment.objc + + + end + \*/ + name + comment.block.objc + + + begin + // + beginCaptures + + 0 + + name + punctuation.definition.comment.objc + + + end + $\n? + name + comment.line.double-slash.c++ + patterns + + + match + (?>\\\s*\n) + name + punctuation.separator.continuation.c++ + + + + + + disabled + + begin + ^\s*#\s*if(n?def)?\b.*$ + comment + eat nested preprocessor if(def)s + end + ^\s*#\s*endif\b.*$ + patterns + + + include + #disabled + + + include + #pragma-mark + + + + implementation_innards + + patterns + + + include + #preprocessor-rule-enabled-implementation + + + include + #preprocessor-rule-disabled-implementation + + + include + #preprocessor-rule-other-implementation + + + include + #property_directive + + + include + #special_variables + + + include + #method_super + + + include + $base + + + + interface_innards + + patterns + + + include + #preprocessor-rule-enabled-interface + + + include + #preprocessor-rule-disabled-interface + + + include + #preprocessor-rule-other-interface + + + include + #properties + + + include + #protocol_list + + + include + #method + + + include + $base + + + + method + + begin + ^(-|\+)\s* + end + (?=\{|#)|; + name + meta.function.objc + patterns + + + begin + (\() + captures + + 1 + + name + punctuation.definition.type.objc + + 2 + + name + entity.name.function.objc + + + end + (\))\s*(\w+\b) + name + meta.return-type.objc + patterns + + + include + #protocol_list + + + include + #protocol_type_qualifier + + + include + $base + + + + + match + \b\w+(?=:) + name + entity.name.function.name-of-parameter.objc + + + begin + ((:))\s*(\() + beginCaptures + + 1 + + name + entity.name.function.name-of-parameter.objc + + 2 + + name + punctuation.separator.arguments.objc + + 3 + + name + punctuation.definition.type.objc + + + end + (\))\s*(\w+\b)? + endCaptures + + 1 + + name + punctuation.definition.type.objc + + 2 + + name + variable.parameter.function.objc + + + name + meta.argument-type.objc + patterns + + + include + #protocol_list + + + include + #protocol_type_qualifier + + + include + $base + + + + + include + #comment + + + + method_super + + begin + ^(?=-|\+) + end + (?<=\})|(?=#) + name + meta.function-with-body.objc + patterns + + + include + #method + + + include + $base + + + + pragma-mark + + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.pragma.c + + 3 + + name + meta.toc-list.pragma-mark.c + + + match + ^\s*(#\s*(pragma\s+mark)\s+(.*)) + name + meta.section + + preprocessor-rule-disabled-implementation + + begin + ^\s*(#(if)\s+(0)\b).* + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.if.c + + 3 + + name + constant.numeric.preprocessor.c + + + end + ^\s*(#\s*(endif)\b.*?(?:(?=(?://|/\*))|$)) + patterns + + + begin + ^\s*(#\s*(else)\b) + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.else.c + + + end + (?=^\s*#\s*endif\b.*?(?:(?=(?://|/\*))|$)) + patterns + + + include + #interface_innards + + + + + begin + + end + (?=^\s*#\s*(else|endif)\b.*?(?:(?=(?://|/\*))|$)) + name + comment.block.preprocessor.if-branch.c + patterns + + + include + #disabled + + + include + #pragma-mark + + + + + + preprocessor-rule-disabled-interface + + begin + ^\s*(#(if)\s+(0)\b).* + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.if.c + + 3 + + name + constant.numeric.preprocessor.c + + + end + ^\s*(#\s*(endif)\b.*?(?:(?=(?://|/\*))|$)) + patterns + + + begin + ^\s*(#\s*(else)\b) + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.else.c + + + end + (?=^\s*#\s*endif\b.*?(?:(?=(?://|/\*))|$)) + patterns + + + include + #interface_innards + + + + + begin + + end + (?=^\s*#\s*(else|endif)\b.*?(?:(?=(?://|/\*))|$)) + name + comment.block.preprocessor.if-branch.c + patterns + + + include + #disabled + + + include + #pragma-mark + + + + + + preprocessor-rule-enabled-implementation + + begin + ^\s*(#(if)\s+(0*1)\b) + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.if.c + + 3 + + name + constant.numeric.preprocessor.c + + + end + ^\s*(#\s*(endif)\b.*?(?:(?=(?://|/\*))|$)) + patterns + + + begin + ^\s*(#\s*(else)\b).* + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.else.c + + + contentName + comment.block.preprocessor.else-branch.c + end + (?=^\s*#\s*endif\b.*?(?:(?=(?://|/\*))|$)) + patterns + + + include + #disabled + + + include + #pragma-mark + + + + + begin + + end + (?=^\s*#\s*(else|endif)\b.*?(?:(?=(?://|/\*))|$)) + patterns + + + include + #implementation_innards + + + + + + preprocessor-rule-enabled-interface + + begin + ^\s*(#(if)\s+(0*1)\b) + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.if.c + + 3 + + name + constant.numeric.preprocessor.c + + + end + ^\s*(#\s*(endif)\b.*?(?:(?=(?://|/\*))|$)) + patterns + + + begin + ^\s*(#\s*(else)\b).* + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.else.c + + + contentName + comment.block.preprocessor.else-branch.c + end + (?=^\s*#\s*endif\b.*?(?:(?=(?://|/\*))|$)) + patterns + + + include + #disabled + + + include + #pragma-mark + + + + + begin + + end + (?=^\s*#\s*(else|endif)\b.*?(?:(?=(?://|/\*))|$)) + patterns + + + include + #interface_innards + + + + + + preprocessor-rule-other-implementation + + begin + ^\s*(#\s*(if(n?def)?)\b.*?(?:(?=(?://|/\*))|$)) + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.c + + + end + ^\s*(#\s*(endif)\b).*?(?:(?=(?://|/\*))|$) + patterns + + + include + #implementation_innards + + + + preprocessor-rule-other-interface + + begin + ^\s*(#\s*(if(n?def)?)\b.*?(?:(?=(?://|/\*))|$)) + captures + + 1 + + name + meta.preprocessor.c + + 2 + + name + keyword.control.import.c + + + end + ^\s*(#\s*(endif)\b).*?(?:(?=(?://|/\*))|$) + patterns + + + include + #interface_innards + + + + properties + + patterns + + + begin + ((@)property)\s*(\() + beginCaptures + + 1 + + name + keyword.other.property.objc + + 2 + + name + punctuation.definition.keyword.objc + + 3 + + name + punctuation.section.scope.begin.objc + + + end + (\)) + endCaptures + + 1 + + name + punctuation.section.scope.end.objc + + + name + meta.property-with-attributes.objc + patterns + + + match + \b(getter|setter|readonly|readwrite|assign|retain|copy|nonatomic)\b + name + keyword.other.property.attribute + + + + + captures + + 1 + + name + keyword.other.property.objc + + 2 + + name + punctuation.definition.keyword.objc + + + match + ((@)property)\b + name + meta.property.objc + + + + property_directive + + captures + + 1 + + name + punctuation.definition.keyword.objc + + + match + (@)(dynamic|synthesize)\b + name + keyword.other.property.directive.objc + + protocol_list + + begin + (<) + beginCaptures + + 1 + + name + punctuation.section.scope.begin.objc + + + end + (>) + endCaptures + + 1 + + name + punctuation.section.scope.end.objc + + + name + meta.protocol-list.objc + patterns + + + match + \bNS(GlyphStorage|M(utableCopying|enuItem)|C(hangeSpelling|o(ding|pying|lorPicking(Custom|Default)))|T(oolbarItemValidations|ext(Input|AttachmentCell))|I(nputServ(iceProvider|erMouseTracker)|gnoreMisspelledWords)|Obj(CTypeSerializationCallBack|ect)|D(ecimalNumberBehaviors|raggingInfo)|U(serInterfaceValidations|RL(HandleClient|DownloadDelegate|ProtocolClient|AuthenticationChallengeSender))|Validated(ToobarItem|UserInterfaceItem)|Locking)\b + name + support.other.protocol.objc + + + + protocol_type_qualifier + + match + \b(in|out|inout|oneway|bycopy|byref)\b + name + storage.modifier.protocol.objc + + special_variables + + patterns + + + match + \b_cmd\b + name + variable.other.selector.objc + + + match + \b(self|super)\b + name + variable.language.objc + + + + + scopeName + source.objc + uuid + F85CC716-6B1C-11D9-9A20-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/PHP.tmLanguage b/app/rcc/edbee/syntaxfiles/PHP.tmLanguage new file mode 100644 index 00000000..d8f504d8 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/PHP.tmLanguage @@ -0,0 +1,3429 @@ + + + + + comment + TODO: +• Try to improve parameters list syntax – scope numbers, ‘=’, ‘,’ and possibly be intelligent about entity ordering +• Is meta.function-call the correct scope? I've added it to my theme but by default it's not highlighted + fileTypes + + + php + + firstLineMatch + ^#!.*(?<!-)php[0-9]{0,1}\b + foldingStartMarker + (/\*|\{\s*$|<<<HTML) + foldingStopMarker + (\*/|^\s*\}|^HTML;) + name + PHP + patterns + + + captures + + 1 + + name + punctuation.whitespace.embedded.leading.php + + 2 + + name + source.php.embedded.line.empty.html + + 3 + + name + punctuation.section.embedded.begin.php + + 4 + + name + meta.consecutive-tags.php + + 5 + + name + source.php + + 6 + + name + punctuation.section.embedded.end.php + + 7 + + name + source.php + + 8 + + name + punctuation.whitespace.embedded.trailing.php + + + comment + Matches empty tags. + match + (?x) + (^\s*)? # 1 - Leading whitespace + ( # 2 - meta.embedded.line.empty.php + ( # 3 - Open Tag + (?: + ((?<=\?>)<) # 4 - Consecutive tags + | < + ) + \?(?i:php|=)? + ) + (\s*) # 5 - Loneliness + ((\?)>) # 6 - Close Tag + # 7 - Scope ? as scope.php + ) + ( + \1 # Match nothing if there was no + # leading whitespace... + | (\s*$\n)? # or match trailing whitespace. + ) + + + + begin + ^\s*(?=<\?) + beginCaptures + + 0 + + name + punctuation.whitespace.embedded.leading.php + + + comment + Catches tags with preceeding whitespace. + end + (?<=\?>)(\s*$\n)? + endCaptures + + 0 + + name + punctuation.whitespace.embedded.trailing.php + + + patterns + + + begin + <\?(?i:php|=)? + beginCaptures + + 0 + + name + punctuation.section.embedded.begin.php + + + end + (\?)> + endCaptures + + 0 + + name + punctuation.section.embedded.end.php + + 1 + + name + source.php + + + name + source.php.embedded.block.html + patterns + + + include + #language + + + + + + + begin + (((?<=\?>)<)|<)\?(?i:php|=)? + beginCaptures + + 0 + + name + punctuation.section.embedded.begin.php + + 2 + + name + meta.consecutive-tags.php + + + comment + Catches the remainder. + end + (\?)> + endCaptures + + 0 + + name + punctuation.section.embedded.end.php + + 1 + + name + source.php + + + name + source.php.embedded.line.html + patterns + + + include + #language + + + + + repository + + constants + + patterns + + + match + (?i)\b(TRUE|FALSE|NULL|__(FILE|FUNCTION|CLASS|METHOD|LINE)__|ON|OFF|YES|NO|NL|BR|TAB)\b + name + constant.language.php + + + match + \b(DEFAULT_INCLUDE_PATH|E_(ALL|COMPILE_(ERROR|WARNING)|CORE_(ERROR|WARNING)|(RECOVERABLE_)?ERROR|NOTICE|PARSE|STRICT|USER_(ERROR|NOTICE|WARNING)|WARNING)|PEAR_(EXTENSION_DIR|INSTALL_DIR)|PHP_(BINDIR|CONFIG_FILE_PATH|DATADIR|E(OL|XTENSION_DIR)|L(IBDIR|OCALSTATEDIR)|O(S|UTPUT_HANDLER_CONT|UTPUT_HANDLER_END|UTPUT_HANDLER_START)|SYSCONFDIR|VERSION))\b + name + support.constant.core.php + + + match + \b(A(B(DAY_([1-7])|MON_([0-9]{1,2}))|LT_DIGITS|M_STR|SSERT_(ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(ASE_(LOWER|UPPER)|HAR_MAX|O(DESET|NNECTION_(ABORTED|NORMAL|TIMEOUT)|UNT_(NORMAL|RECURSIVE))|REDITS_(ALL|DOCS|FULLPAGE|GENERAL|GROUP|MODULES|QA|SAPI)|RNCYSTR|RYPT_(BLOWFISH|EXT_DES|MD5|SALT_LENGTH|STD_DES)|URRENCY_SYMBOL)|D(AY_([1-7])|ECIMAL_POINT|IRECTORY_SEPARATOR|_(FMT|T_FMT))|E(NT_(COMPAT|NOQUOTES|QUOTES)|RA(|_D_FMT|_D_T_FMT|_T_FMT|_YEAR)|XTR_(IF_EXISTS|OVERWRITE|PREFIX_(ALL|IF_EXISTS|INVALID|SAME)|SKIP))|FRAC_DIGITS|GROUPING|HTML_(ENTITIES|SPECIALCHARS)|IN(FO_(ALL|CONFIGURATION|CREDITS|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|I_(ALL|PERDIR|SYSTEM|USER)|T_(CURR_SYMBOL|FRAC_DIGITS))|L(C_(ALL|COLLATE|CTYPE|MESSAGES|MONETARY|NUMERIC|TIME)|O(CK_(EX|NB|SH|UN)|G_(ALERT|AUTH(|PRIV)|CONS|CRIT|CRON|DAEMON|DEBUG|EMERG|ERR|INFO|KERN|LOCAL([0-7])|LPR|MAIL|NDELAY|NEWS|NOTICE|NOWAIT|ODELAY|PERROR|PID|SYSLOG|USER|UUCP|WARNING)))|M(ON_([0-9]{1,2}|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|YSQL_(ASSOC|BOTH|NUM)|_(1_PI|2_(PI|SQRTPI)|E|L(N10|N2|OG(10E|2E))|PI(|_2|_4)|SQRT1_2|SQRT2))|N(EGATIVE_SIGN|O(EXPR|STR)|_(CS_PRECEDES|SEP_BY_SPACE|SIGN_POSN))|P(ATH(INFO_(BASENAME|DIRNAME|EXTENSION|FILENAME)|_SEPARATOR)|M_STR|OSITIVE_SIGN|_(CS_PRECEDES|SEP_BY_SPACE|SIGN_POSN))|RADIXCHAR|S(EEK_(CUR|END|SET)|ORT_(ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD_(BOTH|LEFT|RIGHT))|T(HOUS(ANDS_SEP|EP)|_(FMT(|_AMPM)))|YES(EXPR|STR))\b + name + support.constant.std.php + + + comment + In PHP, any identifier which is not a variable is taken to be a constant. + However, if there is no constant defined with the given name then a notice + is generated and the constant is assumed to have the value of its name. + match + [a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]* + name + constant.other.php + + + + function-call + + match + [A-Za-z_][A-Za-z_0-9]*(?=\s*\() + name + meta.function-call.php + + instantiation + + captures + + 1 + + name + keyword.other.new.php + + 2 + + name + variable.other.php + + 3 + + name + support.class.php + + 4 + + name + support.class.php + + + match + (?i)\b(new)\s+(?:(\$[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)|(\w+))|(\w+)(?=::) + + interpolation + + comment + http://www.php.net/manual/en/language.types.string.php#language.types.string.parsing + patterns + + + match + \\[0-7]{1,3} + name + constant.numeric.octal.php + + + match + \\x[0-9A-Fa-f]{1,2} + name + constant.numeric.hex.php + + + match + \\[nrt\\\$\"] + name + constant.character.escape.php + + + captures + + 1 + + name + variable.other.php + + 2 + + name + punctuation.definition.variable.php + + 4 + + name + punctuation.definition.variable.php + + + comment + Simple syntax with braces: "foo${bar}baz" + match + (?x) + ((\$\{)(?<name>[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(\})) + + + + captures + + 1 + + name + variable.other.php + + 10 + + name + punctuation.definition.variable.php + + 11 + + name + string.unquoted.index.php + + 12 + + name + invalid.illegal.invalid-simple-array-index.php + + 13 + + name + keyword.operator.index-end.php + + 2 + + name + punctuation.definition.variable.php + + 4 + + name + keyword.operator.class.php + + 5 + + name + variable.other.property.php + + 6 + + name + invalid.illegal.php + + 7 + + name + keyword.operator.index-start.php + + 8 + + name + constant.numeric.index.php + + 9 + + name + variable.other.index.php + + + comment + Simple syntax: $foo, $foo[0], $foo[$bar], $foo->bar + match + (?x) + ((\$)(?<name>[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)) + (?: + (->) + (?: + (\g<name>) + | + (\$\g<name>) + ) + | + (\[) + (?:(\d+)|((\$)\g<name>)|(\w+)|(.*?)) + (\]) + )? + + + + begin + (?=(?<regex>(?#simple syntax)\$(?<name>[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(?:\[(?<index>[a-zA-Z0-9_\x{7f}-\x{ff}]+|\$\g<name>)\]|->\g<name>(\(.*?\))?)?|(?#simple syntax with braces)\$\{(?:\g<name>(?<indices>\[(?:\g<index>|'(?:\\.|[^'\\])*'|"(?:\g<regex>|\\.|[^"\\])*")\])?|\g<complex>|\$\{\g<complex>\})\}|(?#complex syntax)\{(?<complex>\$(?<segment>\g<name>(\g<indices>*|\(.*?\))?)(?:->\g<segment>)*|\$\g<complex>|\$\{\g<complex>\})\}))\{ + beginCaptures + + 0 + + name + punctuation.definition.variable.php + + + comment + Complex syntax. It seems this now supports complex method calls, as of PHP5. + I've put wildcards into the function call parameter lists to handle this, but this may break the pattern. + It also might be better to disable it as I shouldn't imagine it's used often (hopefully) and it may confuse PHP4 users. + end + \} + endCaptures + + 0 + + name + punctuation.definition.variable.php + + + patterns + + + include + #function-call + + + include + #var_basic + + + include + #object + + + include + #numbers + + + match + \[ + name + keyword.operator.index-start.php + + + match + \] + name + keyword.operator.index-end.php + + + + + + language + + patterns + + + begin + (?=<<<\s*(HTML|XML|SQL|JAVASCRIPT)\s*$) + end + (?!<?<<\s*(HTML|XML|SQL|JAVASCRIPT)\s*$) + name + string.unquoted.heredoc.php + patterns + + + begin + (<<<)\s*(HTML)\s*$\n? + beginCaptures + + 0 + + name + punctuation.section.embedded.begin.php + + 1 + + name + punctuation.definition.string.php + + 2 + + name + keyword.operator.heredoc.php + + + contentName + text.html + end + ^(HTML)(;?)$\n? + endCaptures + + 0 + + name + punctuation.section.embedded.end.php + + 1 + + name + keyword.operator.heredoc.php + + 2 + + name + punctuation.definition.string.php + + + name + meta.embedded.html + patterns + + + include + text.html.basic + + + include + #interpolation + + + + + begin + (<<<)\s*(XML)\s*$\n? + beginCaptures + + 0 + + name + punctuation.section.embedded.begin.php + + 1 + + name + punctuation.definition.string.php + + 2 + + name + keyword.operator.heredoc.php + + + contentName + text.xml + end + ^(XML)(;?)$\n? + endCaptures + + 0 + + name + punctuation.section.embedded.end.php + + 1 + + name + keyword.operator.heredoc.php + + 2 + + name + punctuation.definition.string.php + + + name + meta.embedded.xml + patterns + + + include + text.xml + + + include + #interpolation + + + + + begin + (<<<)\s*(SQL)\s*$\n? + beginCaptures + + 0 + + name + punctuation.section.embedded.begin.php + + 1 + + name + punctuation.definition.string.php + + 2 + + name + keyword.operator.heredoc.php + + + contentName + source.sql + end + ^(SQL)(;?)$\n? + endCaptures + + 0 + + name + punctuation.section.embedded.end.php + + 1 + + name + keyword.operator.heredoc.php + + 2 + + name + punctuation.definition.string.php + + + name + meta.embedded.sql + patterns + + + include + source.sql + + + include + #interpolation + + + + + begin + (<<<)\s*(JAVASCRIPT)\s*$\n? + beginCaptures + + 0 + + name + punctuation.section.embedded.begin.php + + 1 + + name + punctuation.definition.string.php + + 2 + + name + keyword.operator.heredoc.php + + + contentName + source.js + end + ^(JAVASCRIPT)(;?)$\n? + endCaptures + + 0 + + name + punctuation.section.embedded.end.php + + 1 + + name + keyword.operator.heredoc.php + + 2 + + name + punctuation.definition.string.php + + + name + meta.embedded.js + patterns + + + include + source.js + + + include + #interpolation + + + + + + + begin + /\*\*(?:#@\+)?\s*$ + captures + + 0 + + name + punctuation.definition.comment.php + + + comment + This now only highlights a docblock if the first line contains only /** + - this is to stop highlighting everything as invalid when people do comment banners with /******** ... + - Now matches /**#@+ too - used for docblock templates: http://manual.phpdoc.org/HTMLframesConverter/default/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#basics.docblocktemplate + end + \*/ + name + comment.block.documentation.phpdoc.php + patterns + + + include + #php_doc + + + + + begin + /\* + captures + + 0 + + name + punctuation.definition.comment.php + + + end + \*/ + name + comment.block.php + + + captures + + 1 + + name + punctuation.definition.comment.php + + + match + (//).*?($\n?|(?=\?>)) + name + comment.line.double-slash.php + + + captures + + 1 + + name + punctuation.definition.comment.php + + + match + (#).*?($\n?|(?=\?>)) + name + comment.line.number-sign.php + + + begin + ^(?i)\s*(interface)\s+([a-z0-9_]+)\s*(extends)?\s* + beginCaptures + + 1 + + name + storage.type.interface.php + + 2 + + name + entity.name.type.interface.php + + 3 + + name + storage.modifier.extends.php + + + end + $ + name + meta.interface.php + patterns + + + match + [a-zA-Z0-9_]+ + name + entity.other.inherited-class.php + + + + + begin + (?i)^\s*(abstract|final)?\s*(class)\s+([a-z0-9_]+)\s* + beginCaptures + + 1 + + name + storage.modifier.abstract.php + + 2 + + name + storage.type.class.php + + 3 + + name + entity.name.type.class.php + + + end + $ + name + meta.class.php + patterns + + + captures + + 1 + + name + storage.modifier.extends.php + + 2 + + name + entity.other.inherited-class.php + + + match + (?i:(extends))\s+([a-zA-Z0-9_]+)\s* + + + begin + (?i:(implements))\s+([a-zA-Z0-9_]+)\s* + beginCaptures + + 1 + + name + storage.modifier.implements.php + + 2 + + name + support.class.implements.php + + + end + (?=\s*\b(?i:(extends)))|$ + patterns + + + captures + + 1 + + name + support.class.implements.php + + + match + ,\s*([a-zA-Z0-9_]+)\s* + + + + + + + match + \b(break|c(ase|ontinue)|d(e(clare|fault)|ie|o)|e(lse(if)?|nd(declare|for(each)?|if|switch|while)|xit)|for(each)?|if|return|switch|use|while)\b + name + keyword.control.php + + + begin + (?i)\b((?:require|include)(?:_once)?)\b\s* + beginCaptures + + 1 + + name + keyword.control.import.include.php + + + end + (?=\s|;|$) + name + meta.include.php + patterns + + + include + #language + + + + + captures + + 1 + + name + keyword.control.exception.php + + 2 + + name + support.class.php + + 3 + + name + variable.other.php + + 4 + + name + punctuation.definition.variable.php + + + match + \b(catch)\b\s*\(\s*([A-Za-z_][A-Za-z_0-9]*)\s*((\$+)[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)\s*\) + name + meta.catch.php + + + match + \b(catch|try|throw|exception)\b + name + keyword.control.exception.php + + + begin + (?:^\s*)((?:(?:final|abstract|public|private|protected|static)\s+)*)(function)(?:\s+|(\s*&\s*))(?:(__(?:call|(?:con|de)struct|get|(?:is|un)?set|tostring|clone|set_state|sleep|wakeup|autoload))|([a-zA-Z0-9_]+))\s*(\() + beginCaptures + + 1 + + name + storage.modifier.php + + 2 + + name + storage.type.function.php + + 3 + + name + storage.modifier.reference.php + + 4 + + name + support.function.magic.php + + 5 + + name + entity.name.function.php + + 6 + + name + punctuation.definition.parameters.begin.php + + + contentName + meta.function.arguments.php + end + \) + endCaptures + + 1 + + name + punctuation.definition.parameters.end.php + + + name + meta.function.php + patterns + + + begin + (?x) + \s*(array) # Typehint + \s*(&)? # Reference + \s*((\$+)[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*) # The variable name + \s*(=) # A default value + \s*(array)\s*(\() + + beginCaptures + + 1 + + name + storage.type.php + + 2 + + name + storage.modifier.php + + 3 + + name + variable.other.php + + 4 + + name + punctuation.definition.variable.php + + 5 + + name + keyword.operator.assignment.php + + 6 + + name + support.function.construct.php + + 7 + + name + punctuation.definition.array.begin.php + + + contentName + meta.array.php + end + \) + endCaptures + + 0 + + name + punctuation.definition.array.end.php + + + name + meta.function.argument.array.php + patterns + + + include + #strings + + + include + #numbers + + + + + captures + + 1 + + name + storage.type.php + + 2 + + name + storage.modifier.php + + 3 + + name + variable.other.php + + 4 + + name + punctuation.definition.variable.php + + 5 + + name + keyword.operator.assignment.php + + 6 + + name + constant.language.php + + 7 + + name + invalid.illegal.non-null-typehinted.php + + + match + (?x) + \s*(array) # Typehint + \s*(&)? # Reference + \s*((\$+)[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*) # The variable name + (?: + \s*(=) # A default value + \s*(?i: + (NULL) + | + (\S.*?) + )? + )? + \s*(?=,|\)) # A closing parentheses (end of argument list) or a comma + + name + meta.function.argument.array.php + + + captures + + 1 + + name + support.class.php + + 2 + + name + storage.modifier.php + + 3 + + name + variable.other.php + + 4 + + name + punctuation.definition.variable.php + + 5 + + name + keyword.operator.assignment.php + + 6 + + name + constant.language.php + + 7 + + name + invalid.illegal.non-null-typehinted.php + + + match + (?x) + \s*([A-Za-z_][A-Za-z_0-9]*) # Typehinted class name + \s*(&)? # Reference + \s*((\$+)[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*) # The variable name + (?: + \s*(=) # A default value + \s*(?i: + (NULL) + | + (\S.*?) + )? + )? + \s*(?=,|\)) # A closing parentheses (end of argument list) or a comma + + name + meta.function.argument.typehinted.php + + + captures + + 1 + + name + storage.modifier.php + + 2 + + name + variable.other.php + + 3 + + name + punctuation.definition.variable.php + + + match + (\s*&)?\s*((\$+)[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)\s*(?=,|\)) + name + meta.function.argument.no-default.php + + + begin + (\s*&)?\s*((\$+)[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(?:\s*(=)\s*)\s* + captures + + 1 + + name + storage.modifier.php + + 2 + + name + variable.other.php + + 3 + + name + punctuation.definition.variable.php + + 4 + + name + keyword.operator.assignment.php + + + end + (?=,|\)) + name + meta.function.argument.default.php + patterns + + + include + #parameter-default-types + + + + + begin + /\* + captures + + 0 + + name + punctuation.definition.comment.php + + + end + \*/ + name + comment.block.php + + + + + match + (?i)\b(real|double|float|int(eger)?|bool(ean)?|string|class|clone|var|function|interface|parent|self|object)\b + name + storage.type.php + + + match + (?i)\b(global|abstract|const|extends|implements|final|p(r(ivate|otected)|ublic)|static)\b + name + storage.modifier.php + + + include + #object + + + captures + + 1 + + name + keyword.operator.class.php + + 2 + + name + meta.function-call.static.php + + 3 + + name + variable.other.class.php + + 4 + + name + punctuation.definition.variable.php + + 5 + + name + constant.other.class.php + + + match + (?x)(::) + (?: + ([A-Za-z_][A-Za-z_0-9]*)\s*\( + | + ((\$+)[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*) + | + ([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*) + )? + + + include + #support + + + begin + (<<<)\s*([a-zA-Z_]+[a-zA-Z0-9_]*) + beginCaptures + + 1 + + name + punctuation.definition.string.php + + 2 + + name + keyword.operator.heredoc.php + + + end + ^(\2)(;?)$ + endCaptures + + 1 + + name + keyword.operator.heredoc.php + + 2 + + name + punctuation.definition.string.php + + + name + string.unquoted.heredoc.php + patterns + + + include + #interpolation + + + + + match + => + name + keyword.operator.key.php + + + match + &(?=\s*(\$|new|[A-Za-z_][A-Za-z_0-9]+(?=\s*\())) + name + storage.modifier.reference.php + + + match + ; + name + punctuation.terminator.expression.php + + + match + (@) + name + keyword.operator.error-control.php + + + match + (\-\-|\+\+) + name + keyword.operator.increment-decrement.php + + + match + (\-|\+|\*|/|%) + name + keyword.operator.arithmetic.php + + + match + (?i)(!|&&|\|\|)|\b(and|or|xor|as)\b + name + keyword.operator.logical.php + + + match + <<|>>|~|\^|&|\| + name + keyword.operator.bitwise.php + + + match + (===|==|!==|!=|<=|>=|<>|<|>) + name + keyword.operator.comparison.php + + + match + (\.=|\.) + name + keyword.operator.string.php + + + match + = + name + keyword.operator.assignment.php + + + captures + + 1 + + name + keyword.operator.type.php + + 2 + + name + support.class.php + + + match + (?i)\b(instanceof)\b(?:\s+(\w+))? + + + include + #numbers + + + include + #strings + + + include + #string-backtick + + + include + #function-call + + + include + #variables + + + captures + + 1 + + name + keyword.operator.php + + 2 + + name + variable.other.property.php + + + match + (?<=[a-zA-Z0-9_\x{7f}-\x{ff}])(->)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*?)\b + + + include + #instantiation + + + include + #constants + + + + numbers + + match + \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b + name + constant.numeric.php + + object + + captures + + 1 + + name + keyword.operator.class.php + + 2 + + name + meta.function-call.object.php + + 3 + + name + variable.other.property.php + + 4 + + name + punctuation.definition.variable.php + + + match + (?x)(->) + (?: + ([A-Za-z_][A-Za-z_0-9]*)\s*\( + | + ((\$+)?[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*) + )? + + parameter-default-types + + patterns + + + include + #strings + + + include + #numbers + + + include + #string-backtick + + + include + #variables + + + match + => + name + keyword.operator.key.php + + + match + = + name + keyword.operator.assignment.php + + + match + &(?=\s*\$) + name + storage.modifier.reference.php + + + begin + (array)\s*(\() + beginCaptures + + 1 + + name + support.function.construct.php + + 2 + + name + punctuation.definition.array.begin.php + + + end + \) + endCaptures + + 0 + + name + punctuation.definition.array.end.php + + + name + meta.array.php + patterns + + + include + #parameter-default-types + + + + + include + #instantiation + + + include + #constants + + + + php_doc + + patterns + + + comment + PHPDocumentor only recognises lines with an asterisk as the first non-whitespaces character + match + ^(?!\s*\*).*$\n? + name + invalid.illegal.missing-asterisk.phpdoc.php + + + captures + + 1 + + name + keyword.other.phpdoc.php + + 3 + + name + storage.modifier.php + + 4 + + name + invalid.illegal.wrong-access-type.phpdoc.php + + + match + ^\s*\*\s*(@access)\s+((public|private|protected)|(.+))\s*$ + + + match + ((https?|s?ftp|ftps|file|smb|afp|nfs|(x-)?man|gopher|txmt)://|mailto:)[-:@a-zA-Z0-9_.~%+/?=&#]+(?<![.?:]) + name + markup.underline.link.php + + + captures + + 1 + + name + keyword.other.phpdoc.php + + 2 + + name + markup.underline.link.php + + + match + (@xlink)\s+(.+)\s*$ + + + match + \@(a(bstract|uthor)|c(ategory|opyright)|example|global|internal|li(cense|nk)|pa(ckage|ram)|return|s(ee|ince|tatic|ubpackage)|t(hrows|odo)|v(ar|ersion)|uses|deprecated|final)\b + name + keyword.other.phpdoc.php + + + captures + + 1 + + name + keyword.other.phpdoc.php + + + match + \{(@(link)).+?\} + name + meta.tag.inline.phpdoc.php + + + + regex-double-quoted + + begin + (?x)"/ (?= (\\.|[^"/])++/[imsxeADSUXu]*" ) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.php + + + end + (/)([imsxeADSUXu]*)(") + endCaptures + + 0 + + name + punctuation.definition.string.end.php + + + name + string.regexp.double-quoted.php + patterns + + + comment + Escaped from the regexp – there can also be 2 backslashes (since 1 will escape the first) + match + (\\){1,2}[.$^\[\]{}] + name + constant.character.escape.regex.php + + + include + #interpolation + + + captures + + 1 + + name + punctuation.definition.arbitrary-repitition.php + + 3 + + name + punctuation.definition.arbitrary-repitition.php + + + match + (\{)\d+(,\d+)?(\}) + name + string.regexp.arbitrary-repitition.php + + + begin + \[(?:\^?\])? + captures + + 0 + + name + punctuation.definition.character-class.php + + + end + \] + name + string.regexp.character-class.php + patterns + + + include + #interpolation + + + + + match + [$^+*] + name + keyword.operator.regexp.php + + + + regex-single-quoted + + begin + (?x)'/ (?= (\\.|[^'/])++/[imsxeADSUXu]*' ) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.php + + + end + (/)([imsxeADSUXu]*)(') + endCaptures + + 0 + + name + punctuation.definition.string.end.php + + + name + string.regexp.single-quoted.php + patterns + + + captures + + 1 + + name + punctuation.definition.arbitrary-repitition.php + + 3 + + name + punctuation.definition.arbitrary-repitition.php + + + match + (\{)\d+(,\d+)?(\}) + name + string.regexp.arbitrary-repitition.php + + + comment + Escaped from the regexp – there can also be 2 backslashes (since 1 will escape the first) + match + (\\){1,2}[.$^\[\]{}] + name + constant.character.escape.regex.php + + + comment + Escaped from the PHP string – there can also be 2 backslashes (since 1 will escape the first) + match + \\{1,2}[\\'] + name + constant.character.escape.php + + + begin + \[(?:\^?\])? + captures + + 0 + + name + punctuation.definition.character-class.php + + + end + \] + name + string.regexp.character-class.php + patterns + + + match + \\[\\'\[\]] + name + constant.character.escape.php + + + + + match + [$^+*] + name + keyword.operator.regexp.php + + + + sql-string-double-quoted + + begin + "\s*(?=(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER)\b) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.php + + + contentName + source.sql.embedded.php + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.php + + + name + string.quoted.double.sql.php + patterns + + + match + #(\\"|[^"])*(?="|$\n?) + name + comment.line.number-sign.sql + + + match + --(\\"|[^"])*(?="|$\n?) + name + comment.line.double-dash.sql + + + begin + '(?=[^']*?") + comment + Unclosed strings must be captured to avoid them eating the remainder of the PHP script + Sample case: $sql = "SELECT * FROM bar WHERE foo = '" . $variable . "'" + end + (?=") + name + string.quoted.single.unclosed.sql + patterns + + + match + \\[\\'] + name + constant.character.escape.php + + + + + begin + `(?=[^`]*?") + comment + Unclosed strings must be captured to avoid them eating the remainder of the PHP script + Sample case: $sql = "SELECT * FROM bar WHERE foo = '" . $variable . "'" + end + (?=") + name + string.quoted.other.backtick.unclosed.sql + patterns + + + match + \\[\\'] + name + constant.character.escape.php + + + + + begin + \\"(?!([^\\"]|\\[^"])*\\")(?=(\\[^"]|.)*?") + comment + Unclosed strings must be captured to avoid them eating the remainder of the PHP script + Sample case: $sql = "SELECT * FROM bar WHERE foo = '" . $variable . "'" + end + (?=") + name + string.quoted.double.unclosed.sql + patterns + + + match + \\[\\'] + name + constant.character.escape.php + + + + + begin + \\" + captures + + 0 + + name + constant.character.escape.php + + + end + \\" + name + string.quoted.double.sql + patterns + + + include + #interpolation + + + + + begin + ` + end + ` + name + string.quoted.other.backtick.sql + patterns + + + include + #interpolation + + + + + begin + ' + end + ' + name + string.quoted.single.sql + patterns + + + include + #interpolation + + + + + match + \\. + name + constant.character.escape.php + + + include + #interpolation + + + include + source.sql + + + + sql-string-single-quoted + + begin + '\s*(?=(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER)\b) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.php + + + contentName + source.sql.embedded.php + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.php + + + name + string.quoted.single.sql.php + patterns + + + match + #(\\'|[^'])*(?='|$\n?) + name + comment.line.number-sign.sql + + + match + --(\\'|[^'])*(?='|$\n?) + name + comment.line.double-dash.sql + + + begin + \\'(?!([^\\']|\\[^'])*\\')(?=(\\[^']|.)*?') + comment + Unclosed strings must be captured to avoid them eating the remainder of the PHP script + Sample case: $sql = "SELECT * FROM bar WHERE foo = '" . $variable . "'" + end + (?=') + name + string.quoted.single.unclosed.sql + patterns + + + match + \\[\\'] + name + constant.character.escape.php + + + + + begin + `(?=[^`]*?') + comment + Unclosed strings must be captured to avoid them eating the remainder of the PHP script + Sample case: $sql = "SELECT * FROM bar WHERE foo = '" . $variable . "'" + end + (?=') + name + string.quoted.other.backtick.unclosed.sql + patterns + + + match + \\[\\'] + name + constant.character.escape.php + + + + + begin + "(?=[^"]*?') + comment + Unclosed strings must be captured to avoid them eating the remainder of the PHP script + Sample case: $sql = "SELECT * FROM bar WHERE foo = '" . $variable . "'" + end + (?=') + name + string.quoted.double.unclosed.sql + patterns + + + match + \\[\\'] + name + constant.character.escape.php + + + + + begin + \\' + captures + + 0 + + name + constant.character.escape.php + + + end + \\' + name + string.quoted.single.sql + + + match + \\[\\'] + name + constant.character.escape.php + + + include + source.sql + + + + string-backtick + + begin + ` + beginCaptures + + 0 + + name + punctuation.definition.string.begin.php + + + end + ` + endCaptures + + 0 + + name + punctuation.definition.string.end.php + + + name + string.interpolated.php + patterns + + + match + \\. + name + constant.character.escape.php + + + include + #interpolation + + + + string-double-quoted + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.php + + + comment + This contentName is just to allow the usage of “select scope” to select the string contents first, then the string with quotes + contentName + meta.string-contents.quoted.double.php + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.php + + + name + string.quoted.double.php + patterns + + + include + #interpolation + + + + string-single-quoted + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.php + + + contentName + meta.string-contents.quoted.single.php + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.php + + + name + string.quoted.single.php + patterns + + + match + \\[\\'] + name + constant.character.escape.php + + + + strings + + patterns + + + include + #regex-double-quoted + + + include + #sql-string-double-quoted + + + include + #string-double-quoted + + + include + #regex-single-quoted + + + include + #sql-string-single-quoted + + + include + #string-single-quoted + + + + support + + patterns + + + begin + (array)(\() + beginCaptures + + 1 + + name + support.function.construct.php + + 2 + + name + punctuation.definition.array.begin.php + + + end + \) + endCaptures + + 0 + + name + punctuation.definition.array.end.php + + + name + meta.array.php + patterns + + + include + #language + + + + + match + (?i)\b(s(huffle|ort)|n(ext|at(sort|casesort))|c(o(unt|mpact)|urrent)|in_array|u(sort|ksort|asort)|prev|e(nd|xtract)|k(sort|ey|rsort)|a(sort|r(sort|ray_(s(hift|um|plice|earch|lice)|c(h(unk|ange_key_case)|o(unt_values|mbine))|intersect(_(u(key|assoc)|key|assoc))?|diff(_(u(key|assoc)|key|assoc))?|u(n(shift|ique)|intersect(_(uassoc|assoc))?|diff(_(uassoc|assoc))?)|p(op|ush|ad|roduct)|values|key(s|_exists)|f(il(ter|l(_keys)?)|lip)|walk(_recursive)?|r(e(duce|verse)|and)|m(ultisort|erge(_recursive)?|ap))))|r(sort|eset|ange)|m(in|ax))(?=\s*\() + name + support.function.array.php + + + match + (?i)\bassert(_options)?(?=\s*\() + name + support.function.assert.php + + + match + (?i)\bdom_attr_is_id(?=\s*\() + name + support.function.attr.php + + + match + (?i)\bbase64_(decode|encode)(?=\s*\() + name + support.function.base64.php + + + match + (?i)\b(highlight_(string|file)|s(ys_getloadavg|et_(include_path|magic_quotes_runtime)|leep)|c(on(stant|nection_(status|aborted))|all_user_(func(_array)?|method(_array)?))|time_(sleep_until|nanosleep)|i(s_uploaded_file|n(i_(set|restore|get(_all)?)|et_(ntop|pton))|p2long|gnore_user_abort|mport_request_variables)|u(sleep|nregister_tick_function)|error_(log|get_last)|p(hp_strip_whitespace|utenv|arse_ini_file|rint_r)|flush|long2ip|re(store_include_path|gister_(shutdown_function|tick_function))|get(servby(name|port)|opt|_(c(urrent_user|fg_var)|include_path|magic_quotes_(gpc|runtime))|protobyn(umber|ame)|env)|move_uploaded_file)(?=\s*\() + name + support.function.basic_functions.php + + + match + (?i)\bbc(s(cale|ub|qrt)|comp|div|pow(mod)?|add|m(od|ul))(?=\s*\() + name + support.function.bcmath.php + + + match + (?i)\bbirdstep_(c(o(nnect|mmit)|lose)|off_autocommit|exec|f(ieldn(um|ame)|etch|reeresult)|autocommit|r(ollback|esult))(?=\s*\() + name + support.function.birdstep.php + + + match + (?i)\bget_browser(?=\s*\() + name + support.function.browscap.php + + + match + (?i)\b(s(tr(nc(asecmp|mp)|c(asecmp|mp)|len)|et_e(rror_handler|xception_handler))|c(lass_exists|reate_function)|trigger_error|i(s_(subclass_of|a)|nterface_exists)|de(fine(d)?|bug_(print_backtrace|backtrace))|zend_version|property_exists|e(ach|rror_reporting|xtension_loaded)|func(tion_exists|_(num_args|get_arg(s)?))|leak|restore_e(rror_handler|xception_handler)|get_(class(_(vars|methods))?|included_files|de(clared_(classes|interfaces)|fined_(constants|vars|functions))|object_vars|extension_funcs|parent_class|loaded_extensions|resource_type)|method_exists)(?=\s*\() + name + support.function.builtin_functions.php + + + match + (?i)\bbz(compress|decompress|open|err(str|no|or)|read)(?=\s*\() + name + support.function.bz2.php + + + match + (?i)\b(jdtounix|unixtojd)(?=\s*\() + name + support.function.cal_unix.php + + + match + (?i)\b(cal_(to_jd|info|days_in_month|from_jd)|j(d(to(j(ulian|ewish)|french|gregorian)|dayofweek|monthname)|uliantojd|ewishtojd)|frenchtojd|gregoriantojd)(?=\s*\() + name + support.function.calendar.php + + + match + (?i)\bdom_characterdata_(substring_data|insert_data|delete_data|append_data|replace_data)(?=\s*\() + name + support.function.characterdata.php + + + match + (?i)\bcom_(create_guid|print_typeinfo|event_sink|load_typelib|get_active_object|message_pump)(?=\s*\() + name + support.function.com_com.php + + + match + (?i)\bvariant_(s(ub|et(_type)?)|n(ot|eg)|c(a(st|t)|mp)|i(nt|div|mp)|or|d(iv|ate_(to_timestamp|from_timestamp))|pow|eqv|fix|a(nd|dd|bs)|get_type|round|xor|m(od|ul))(?=\s*\() + name + support.function.com_variant.php + + + match + (?i)\bcrc32(?=\s*\() + name + support.function.crc32.php + + + match + (?i)\bcrypt(?=\s*\() + name + support.function.crypt.php + + + match + (?i)\bctype_(space|cntrl|digit|upper|p(unct|rint)|lower|al(num|pha)|graph|xdigit)(?=\s*\() + name + support.function.ctype.php + + + match + (?i)\bconvert_cyr_string(?=\s*\() + name + support.function.cyr_convert.php + + + match + (?i)\bstrptime(?=\s*\() + name + support.function.datetime.php + + + match + (?i)\bdba_(handlers|sync|nextkey|close|insert|delete|op(timize|en)|exists|popen|key_split|f(irstkey|etch)|list|replace)(?=\s*\() + name + support.function.dba.php + + + match + (?i)\bdbase_(num(fields|records)|c(lose|reate)|delete_record|open|pack|add_record|get_(header_info|record(_with_names)?)|replace_record)(?=\s*\() + name + support.function.dbase.php + + + match + (?i)\b(scandir|c(h(dir|root)|losedir)|dir|opendir|re(addir|winddir)|g(etcwd|lob))(?=\s*\() + name + support.function.dir.php + + + match + (?i)\bdl(?=\s*\() + name + support.function.dl.php + + + match + (?i)\b(dns_(check_record|get_(record|mx))|gethostby(name(l)?|addr))(?=\s*\() + name + support.function.dns.php + + + match + (?i)\bdom_document_(s(chema_validate(_file)?|ave(_html(_file)?|xml)?)|normalize_document|create_(c(datasection|omment)|text_node|document_fragment|processing_instruction|e(ntity_reference|lement(_ns)?)|attribute(_ns)?)|import_node|validate|load(_html(_file)?|xml)?|adopt_node|re(name_node|laxNG_validate_(file|xml))|get_element(s_by_tag_name(_ns)?|_by_id)|xinclude)(?=\s*\() + name + support.function.document.php + + + match + (?i)\bdom_domconfiguration_(set_parameter|can_set_parameter|get_parameter)(?=\s*\() + name + support.function.domconfiguration.php + + + match + (?i)\bdom_domerrorhandler_handle_error(?=\s*\() + name + support.function.domerrorhandler.php + + + match + (?i)\bdom_domimplementation_(has_feature|create_document(_type)?|get_feature)(?=\s*\() + name + support.function.domimplementation.php + + + match + (?i)\bdom_domimplementationlist_item(?=\s*\() + name + support.function.domimplementationlist.php + + + match + (?i)\bdom_domimplementationsource_get_domimplementation(s)?(?=\s*\() + name + support.function.domimplementationsource.php + + + match + (?i)\bdom_domstringlist_item(?=\s*\() + name + support.function.domstringlist.php + + + match + (?i)\beaster_da(ys|te)(?=\s*\() + name + support.function.easter.php + + + match + (?i)\bdom_element_(has_attribute(_ns)?|set_(id_attribute(_n(s|ode))?|attribute(_n(s|ode(_ns)?))?)|remove_attribute(_n(s|ode))?|get_(elements_by_tag_name(_ns)?|attribute(_n(s|ode(_ns)?))?))(?=\s*\() + name + support.function.element.php + + + match + (?i)\b(s(hell_exec|ystem)|p(assthru|roc_nice)|e(scapeshell(cmd|arg)|xec))(?=\s*\() + name + support.function.exec.php + + + match + (?i)\bexif_(imagetype|t(humbnail|agname)|read_data)(?=\s*\() + name + support.function.exif.php + + + match + (?i)\bfdf_(header|s(et_(s(tatus|ubmit_form_action)|target_frame|o(n_import_javascript|pt)|javascript_action|encoding|v(ersion|alue)|f(ile|lags)|ap)|ave(_string)?)|next_field_name|c(lose|reate)|open(_string)?|e(num_values|rr(no|or))|add_(template|doc_javascript)|remove_item|get_(status|opt|encoding|v(ersion|alue)|f(ile|lags)|a(ttachment|p)))(?=\s*\() + name + support.function.fdf.php + + + match + (?i)\b(sys_get_temp_dir|copy|t(empnam|mpfile)|u(nlink|mask)|p(close|open)|f(s(canf|tat|eek)|nmatch|close|t(ell|runcate)|ile(_(put_contents|get_contents))?|open|p(utcsv|assthru)|eof|flush|write|lock|read|get(s(s)?|c(sv)?))|r(e(name|a(dfile|lpath)|wind)|mdir)|get_meta_tags|mkdir)(?=\s*\() + name + support.function.file.php + + + match + (?i)\b(stat|c(h(own|grp|mod)|learstatcache)|is_(dir|executable|file|link|writable|readable)|touch|disk_(total_space|free_space)|file(size|ctime|type|inode|owner|_exists|perms|atime|group|mtime)|l(stat|chgrp))(?=\s*\() + name + support.function.filestat.php + + + match + (?i)\bfilter_(has_var|input(_array)?|var(_array)?)(?=\s*\() + name + support.function.filter.php + + + match + (?i)\b(sprintf|printf|v(sprintf|printf|fprintf)|fprintf)(?=\s*\() + name + support.function.formatted_print.php + + + match + (?i)\b(pfsockopen|fsockopen)(?=\s*\() + name + support.function.fsock.php + + + match + (?i)\bftok(?=\s*\() + name + support.function.ftok.php + + + match + (?i)\b(image(s(y|tring(up)?|et(style|t(hickness|ile)|pixel|brush)|avealpha|x)|c(har(up)?|o(nvolution|py(res(ized|ampled)|merge(gray)?)?|lor(s(total|et|forindex)|closest(hwb|alpha)?|transparent|deallocate|exact(alpha)?|a(t|llocate(alpha)?)|resolve(alpha)?|match))|reate(truecolor|from(string|jpeg|png|wbmp|g(if|d(2(part)?)?)|x(pm|bm)))?)|2wbmp|t(ypes|tf(text|bbox)|ruecolortopalette)|i(struecolor|nterlace)|d(estroy|ashedline)|jpeg|ellipse|p(s(slantfont|copyfont|text|e(ncodefont|xtendfont)|freefont|loadfont|bbox)|ng|olygon|alettecopy)|f(t(text|bbox)|il(ter|l(toborder|ed(polygon|ellipse|arc|rectangle))?)|ont(height|width))|wbmp|a(ntialias|lphablending|rc)|l(ine|oadfont|ayereffect)|r(otate|ectangle)|g(if|d(2)?|ammacorrect|rab(screen|window))|xbm)|jpeg2wbmp|png2wbmp|gd_info)(?=\s*\() + name + support.function.gd.php + + + match + (?i)\b(ngettext|textdomain|d(ngettext|c(ngettext|gettext)|gettext)|gettext|bind(textdomain|_textdomain_codeset))(?=\s*\() + name + support.function.gettext.php + + + match + (?i)\bgmp_(hamdist|s(can(1|0)|ign|trval|ub|etbit|qrt(rem)?)|c(om|lrbit|mp)|ne(g|xtprime)|in(tval|it|vert)|or|div(_(q(r)?|r)|exact)|jacobi|p(o(pcount|w(m)?)|erfect_square|rob_prime)|fact|legendre|a(nd|dd|bs)|random|gcd(ext)?|xor|m(od|ul))(?=\s*\() + name + support.function.gmp.php + + + match + (?i)\bhash(_(hmac(_file)?|init|update(_(stream|file))?|fi(nal|le)|algos))?(?=\s*\() + name + support.function.hash.php + + + match + (?i)\bmd5(_file)?(?=\s*\() + name + support.function.hash_md.php + + + match + (?i)\bsha1(_file)?(?=\s*\() + name + support.function.hash_sha.php + + + match + (?i)\b(set(cookie|rawcookie)|header(s_(sent|list))?)(?=\s*\() + name + support.function.head.php + + + match + (?i)\b(html(specialchars(_decode)?|_entity_decode|entities)|get_html_translation_table)(?=\s*\() + name + support.function.html.php + + + match + (?i)\bhttp_build_query(?=\s*\() + name + support.function.http.php + + + match + (?i)\bibase_blob_(c(ancel|lose|reate)|i(nfo|mport)|open|echo|add|get)(?=\s*\() + name + support.function.ibase_blobs.php + + + match + (?i)\bibase_(set_event_handler|free_event_handler|wait_event)(?=\s*\() + name + support.function.ibase_events.php + + + match + (?i)\bibase_(n(um_(params|fields|rows)|ame_result)|execute|p(aram_info|repare)|f(ield_info|etch_(object|assoc|row)|ree_(query|result))|query|affected_rows)(?=\s*\() + name + support.function.ibase_query.php + + + match + (?i)\bibase_(serv(ice_(detach|attach)|er_info)|d(elete_user|b_info)|add_user|restore|backup|m(odify_user|aintain_db))(?=\s*\() + name + support.function.ibase_service.php + + + match + (?i)\b(iconv(_(s(tr(pos|len|rpos)|ubstr|et_encoding)|get_encoding|mime_(decode(_headers)?|encode)))?|ob_iconv_handler)(?=\s*\() + name + support.function.iconv.php + + + match + (?i)\b(image_type_to_(extension|mime_type)|getimagesize)(?=\s*\() + name + support.function.image.php + + + match + (?i)\b(zend_logo_guid|php(credits|info|_(sapi_name|ini_scanned_files|uname|egg_logo_guid|logo_guid|real_logo_guid)|version))(?=\s*\() + name + support.function.info.php + + + match + (?i)\bibase_(c(o(nnect|mmit(_ret)?)|lose)|trans|drop_db|pconnect|err(code|msg)|gen_id|rollback(_ret)?)(?=\s*\() + name + support.function.interbase.php + + + match + (?i)\bcurl_(setopt(_array)?|c(opy_handle|lose)|init|e(rr(no|or)|xec)|version|getinfo)(?=\s*\() + name + support.function.interface.php + + + match + (?i)\biptc(parse|embed)(?=\s*\() + name + support.function.iptc.php + + + match + (?i)\bjson_(decode|encode)(?=\s*\() + name + support.function.json.php + + + match + (?i)\blcg_value(?=\s*\() + name + support.function.lcg.php + + + match + (?i)\bldap_(s(tart_tls|ort|e(t_(option|rebind_proc)|arch)|asl_bind)|next_(entry|attribute|reference)|co(nnect|unt_entries|mpare)|t61_to_8859|8859_to_t61|d(n2ufn|elete)|unbind|parse_re(sult|ference)|e(rr(no|2str|or)|xplode_dn)|f(irst_(entry|attribute|reference)|ree_result)|add|list|get_(option|dn|entries|values_len|attributes)|re(name|ad)|mod_(del|add|replace)|bind)(?=\s*\() + name + support.function.ldap.php + + + match + (?i)\blevenshtein(?=\s*\() + name + support.function.levenshtein.php + + + match + (?i)\blibxml_(set_streams_context|clear_errors|use_internal_errors|get_(errors|last_error))(?=\s*\() + name + support.function.libxml.php + + + match + (?i)\b(symlink|link(info)?|readlink)(?=\s*\() + name + support.function.link.php + + + match + (?i)\b(ezmlm_hash|mail)(?=\s*\() + name + support.function.mail.php + + + match + (?i)\bset_time_limit(?=\s*\() + name + support.function.main.php + + + match + (?i)\b(h(ypot|exdec)|s(in(h)?|qrt)|number_format|c(os(h)?|eil)|is_(nan|infinite|finite)|tan(h)?|octdec|de(c(hex|oct|bin)|g2rad)|exp(m1)?|p(i|ow)|f(loor|mod)|log(1(p|0))?|a(sin(h)?|cos(h)?|tan(h|2)?|bs)|r(ound|ad2deg)|b(indec|ase_convert))(?=\s*\() + name + support.function.math.php + + + match + (?i)\bmb_(s(tr(str|cut|to(upper|lower)|i(str|pos|mwidth)|pos|width|len|r(chr|i(chr|pos)|pos))|ubst(itute_character|r(_count)?)|end_mail)|http_(input|output)|c(heck_encoding|onvert_(case|encoding|variables|kana))|internal_encoding|output_handler|de(code_(numericentity|mimeheader)|tect_(order|encoding))|encode_(numericentity|mimeheader)|p(arse_str|referred_mime_name)|l(ist_(encodings(_alias_names)?|mime_names)|anguage)|get_info)(?=\s*\() + name + support.function.mbstring.php + + + match + (?i)\bm(crypt_(c(fb|reate_iv|bc)|ofb|decrypt|e(cb|nc(_(self_test|is_block_(algorithm(_mode)?|mode)|get_(supported_key_sizes|iv_size|key_size|algorithms_name|modes_name|block_size))|rypt))|list_(algorithms|modes)|ge(neric(_(init|deinit))?|t_(cipher_name|iv_size|key_size|block_size))|module_(self_test|close|is_block_(algorithm(_mode)?|mode)|open|get_(supported_key_sizes|algo_(key_size|block_size))))|decrypt_generic)(?=\s*\() + name + support.function.mcrypt.php + + + match + (?i)\bmd5(_file)?(?=\s*\() + name + support.function.md5.php + + + match + (?i)\bmetaphone(?=\s*\() + name + support.function.metaphone.php + + + match + (?i)\bmhash(_(count|keygen_s2k|get_(hash_name|block_size)))?(?=\s*\() + name + support.function.mhash.php + + + match + (?i)\b(get(timeofday|rusage)|microtime)(?=\s*\() + name + support.function.microtime.php + + + match + (?i)\bmime_content_type(?=\s*\() + name + support.function.mime_magic.php + + + match + (?i)\b(swf(prebuiltclip_init|videostream_init)|ming_(set(scale|cubicthreshold)|use(swfversion|constants)|keypress))(?=\s*\() + name + support.function.ming.php + + + match + (?i)\bcurl_multi_(select|close|in(it|fo_read)|exec|add_handle|getcontent|remove_handle)(?=\s*\() + name + support.function.multi.php + + + match + (?i)\bmysqli_(s(sl_set|t(ore_result|at|mt_(s(tore_result|end_long_data|qlstate)|num_rows|close|in(sert_id|it)|data_seek|p(aram_count|repare)|e(rr(no|or)|xecute)|f(ield_count|etch|ree_result)|a(ttr_(set|get)|ffected_rows)|res(ult_metadata|et)|bind_(param|result)))|e(t_local_infile_(handler|default)|lect_db)|qlstate)|n(um_(fields|rows)|ext_result)|c(ha(nge_user|racter_set_name)|ommit|lose)|thread_(safe|id)|in(sert_id|it|fo)|options|d(ump_debug_info|ebug|ata_seek)|use_result|p(ing|repare)|err(no|or)|kill|f(ield_(seek|count|tell)|etch_(field(s|_direct)?|lengths|row)|ree_result)|warning_count|a(utocommit|ffected_rows)|r(ollback|eal_(connect|escape_string|query))|get_(server_(info|version)|host_info|client_(info|version)|proto_info)|more_results)(?=\s*\() + name + support.function.mysqli_api.php + + + match + (?i)\bmysqli_embedded_server_(start|end)(?=\s*\() + name + support.function.mysqli_embedded.php + + + match + (?i)\bmysqli_(s(tmt_get_warnings|et_charset)|connect(_err(no|or))?|query|fetch_(object|a(ssoc|rray))|get_(charset|warnings)|multi_query)(?=\s*\() + name + support.function.mysqli_nonapi.php + + + match + (?i)\bmysqli_(s(end_query|lave_query)|disable_r(pl_parse|eads_from_master)|enable_r(pl_parse|eads_from_master)|rpl_(p(arse_enabled|robe)|query_type)|master_query)(?=\s*\() + name + support.function.mysqli_repl.php + + + match + (?i)\bmysqli_report(?=\s*\() + name + support.function.mysqli_report.php + + + match + (?i)\bdom_namednodemap_(set_named_item(_ns)?|item|remove_named_item(_ns)?|get_named_item(_ns)?)(?=\s*\() + name + support.function.namednodemap.php + + + match + (?i)\bdom_namelist_get_name(space_uri)?(?=\s*\() + name + support.function.namelist.php + + + match + (?i)\bncurses_(s(how_panel|cr(_(set|init|dump|restore)|l)|ta(nd(out|end)|rt_color)|lk_(set|noutrefresh|c(olor|lear)|init|touch|attr(set|o(n|ff))?|re(store|fresh))|avetty)|h(ide_panel|line|a(s_(colors|i(c|l)|key)|lfdelay))|n(o(nl|cbreak|echo|qiflush|raw)|ew(_panel|pad|win)|apms|l)|c(olor_(set|content)|urs_set|l(ear|rto(eol|bot))|an_change_color|break)|t(ypeahead|imeout|op_panel|erm(name|attrs))|i(sendwin|n(s(str|ch|tr|delln|ertln)|ch|it(_(color|pair))?))|d(oupdate|e(f(ine_key|_(shell_mode|prog_mode))|l(ch|_panel|eteln|ay_output|win)))|u(se_(default_colors|e(nv|xtended_names))|nget(ch|mouse)|pdate_panels)|p(noutrefresh|utp|a(nel_(window|above|below)|ir_content)|refresh)|e(cho(char)?|nd|rase(char)?)|v(idattr|line)|k(illchar|ey(ok|pad))|qiflush|f(ilter|l(ushinp|ash))|longname|w(stand(out|end)|hline|noutrefresh|c(olor_set|lear)|erase|vline|a(ttr(set|o(n|ff))|dd(str|ch))|getch|refresh|mo(use_trafo|ve)|border)|a(ssume_default_colors|ttr(set|o(n|ff))|dd(str|nstr|ch(str|nstr)?))|r(e(set(ty|_(shell_mode|prog_mode))|place_panel|fresh)|aw)|get(yx|ch|m(ouse|axyx))|b(o(ttom_panel|rder)|eep|kgd(set)?|audrate)|m(o(use(interval|_trafo|mask)|ve(_panel)?)|eta|v(hline|cur|inch|delch|vline|waddstr|add(str|nstr|ch(str|nstr)?)|getch)))(?=\s*\() + name + support.function.ncurses_functions.php + + + match + (?i)\bdom_node_(set_user_data|has_(child_nodes|attributes)|normalize|c(ompare_document_position|lone_node)|i(s_(s(upported|ame_node)|default_namespace|equal_node)|nsert_before)|lookup_(namespace_uri|prefix)|append_child|get_(user_data|feature)|re(place_child|move_child))(?=\s*\() + name + support.function.node.php + + + match + (?i)\bdom_nodelist_item(?=\s*\() + name + support.function.nodelist.php + + + match + (?i)\bnsapi_(virtual|re(sponse_headers|quest_headers))(?=\s*\() + name + support.function.nsapi.php + + + match + (?i)\boci(setbufferinglob|_(s(tatement_type|e(t_prefetch|rver_version))|c(o(nnect|llection_(size|trim|element_(assign|get)|a(ssign|ppend)|max)|mmit)|lose|ancel)|n(um_(fields|rows)|ew_(c(o(nnect|llection)|ursor)|descriptor))|internal_debug|define_by_name|p(connect|a(ssword_change|rse))|e(rror|xecute)|f(ield_(s(cale|ize)|name|is_null|type(_raw)?|precision)|etch(_(object|a(ssoc|ll|rray)|row))?|ree_(statement|collection|descriptor))|lob_(s(ize|eek|ave)|c(opy|lose)|t(ell|runcate)|i(s_equal|mport)|e(of|rase|xport)|flush|append|write(_temporary)?|load|re(wind|ad))|r(ollback|esult)|bind_(array_by_name|by_name))|fetchinto|getbufferinglob)(?=\s*\() + name + support.function.oci8_interface.php + + + match + (?i)\bopenssl_(s(ign|eal)|csr_(sign|new|export(_to_file)?|get_(subject|public_key))|open|error_string|p(ublic_(decrypt|encrypt)|k(cs(12_(export(_to_file)?|read)|7_(sign|decrypt|encrypt|verify))|ey_(new|export(_to_file)?|free|get_(details|p(ublic|rivate))))|rivate_(decrypt|encrypt))|verify|x509_(check(_private_key|purpose)|parse|export(_to_file)?|free|read))(?=\s*\() + name + support.function.openssl.php + + + match + (?i)\bo(utput_(add_rewrite_var|reset_rewrite_vars)|b_(start|clean|implicit_flush|end_(clean|flush)|flush|list_handlers|get_(status|c(ontents|lean)|flush|le(ngth|vel))))(?=\s*\() + name + support.function.output.php + + + match + (?i)\b(unpack|pack)(?=\s*\() + name + support.function.pack.php + + + match + (?i)\bget(lastmod|my(inode|uid|pid|gid))(?=\s*\() + name + support.function.pageinfo.php + + + match + (?i)\bpcntl_(s(ignal|etpriority)|exec|fork|w(stopsig|termsig|if(s(ignaled|topped)|exited)|exitstatus|ait(pid)?)|alarm|getpriority)(?=\s*\() + name + support.function.pcntl.php + + + match + (?i)\bpdo_drivers(?=\s*\() + name + support.function.pdo.php + + + match + (?i)\bpdo_drivers(?=\s*\() + name + support.function.pdo_dbh.php + + + match + (?i)\bpg_(se(nd_(execute|prepare|query(_params)?)|t_(client_encoding|error_verbosity)|lect)|host|num_(fields|rows)|c(o(n(nect(ion_(status|reset|busy))?|vert)|py_(to|from))|ancel_query|l(ient_encoding|ose))|insert|t(ty|ra(nsaction_status|ce))|options|d(elete|bname)|u(n(trace|escape_bytea)|pdate)|e(scape_(string|bytea)|nd_copy|xecute)|p(connect|ing|ort|ut_line|arameter_status|repare)|version|f(ield_(size|n(um|ame)|is_null|t(ype(_oid)?|able)|prtlen)|etch_(object|a(ssoc|ll(_columns)?|rray)|r(ow|esult))|ree_result)|query(_params)?|affected_rows|l(o_(seek|c(lose|reate)|tell|import|open|unlink|export|write|read(_all)?)|ast_(notice|oid|error))|get_(notify|pid|result)|result_(s(tatus|eek)|error(_field)?)|meta_data)(?=\s*\() + name + support.function.pgsql.php + + + match + (?i)\b(virtual|apache_(setenv|note|child_terminate|lookup_uri|get_(version|modules)|re(s(et_timeout|ponse_headers)|quest_(s(ome_auth_required|ub_req_(lookup_(uri|file)|method_uri)|e(t_(etag|last_modified)|rver_port)|atisfies)|headers(_(in|out))?|is_initial_req|discard_request_body|update_mtime|err_headers_out|log_error|auth_(name|type)|r(un|emote_host)|meets_conditions)))|getallheaders)(?=\s*\() + name + support.function.php_apache.php + + + match + (?i)\b(str(totime|ftime)|checkdate|time(zone_(name_(from_abbr|get)|identifiers_list|transitions_get|o(pen|ffset_get)|abbreviations_list))?|idate|date(_(sun(set|_info|rise)|create|isodate_set|time(zone_(set|get)|_set)|d(efault_timezone_(set|get)|ate_set)|offset_get|parse|format|modify))?|localtime|g(etdate|m(strftime|date|mktime))|mktime)(?=\s*\() + name + support.function.php_date.php + + + match + (?i)\bdom_import_simplexml(?=\s*\() + name + support.function.php_dom.php + + + match + (?i)\bfbsql_(hostname|s(t(op_db|art_db)|e(t_(characterset|transaction|password|lob_mode)|lect_db))|n(um_(fields|rows)|ext_result)|c(hange_user|o(nnect|mmit)|lo(se|b_size)|reate_(clob|db|blob))|table_name|insert_id|d(ata(_seek|base(_password)?)|rop_db|b_(status|query))|username|err(no|or)|p(connect|assword)|f(ield_(seek|name|t(ype|able)|flags|len)|etch_(object|field|lengths|a(ssoc|rray)|row)|ree_result)|query|warnings|list_(tables|dbs|fields)|a(utocommit|ffected_rows)|get_autostart_info|r(o(ws_fetched|llback)|e(sult|ad_(clob|blob)))|blob_size)(?=\s*\() + name + support.function.php_fbsql.php + + + match + (?i)\bftp_(s(sl_connect|ystype|i(te|ze)|et_option)|n(list|b_(continue|put|f(put|get)|get))|c(h(dir|mod)|dup|onnect|lose)|delete|exec|p(ut|asv|wd)|f(put|get)|alloc|login|get(_option)?|r(ename|aw(list)?|mdir)|m(dtm|kdir))(?=\s*\() + name + support.function.php_ftp.php + + + match + (?i)\b(virtual|apache_(setenv|note|get(_(version|modules)|env)|response_headers)|getallheaders)(?=\s*\() + name + support.function.php_functions.php + + + match + (?i)\bimap_(header(s|info)|s(can|tatus|ort|ubscribe|e(t(_quota|flag_full|acl)|arch)|avebody)|c(heck|l(ose|earflag_full)|reatemailbox)|num_(recent|msg)|t(hread|imeout)|8bit|delete(mailbox)?|open|u(n(subscribe|delete)|id|tf(7_(decode|encode)|8))|e(rrors|xpunge)|ping|qprint|fetch(header|structure|_overview|body)|l(sub|ist|ast_error)|a(ppend|lerts)|get(subscribed|_quota(root)?|acl|mailboxes)|r(e(namemailbox|open)|fc822_(parse_(headers|adrlist)|write_address))|m(sgno|ime_header_decode|ail(_(co(py|mpose)|move)|boxmsginfo)?)|b(inary|ody(struct)?|ase64))(?=\s*\() + name + support.function.php_imap.php + + + match + (?i)\bmb_(split|ereg(i(_replace)?|_(search(_(setpos|init|pos|get(pos|regs)|regs))?|replace|match))?|regex_(set_options|encoding))(?=\s*\() + name + support.function.php_mbregex.php + + + match + (?i)\bsmfi_(set(timeout|flags|reply)|chgheader|delrcpt|add(header|rcpt)|replacebody|getsymval)(?=\s*\() + name + support.function.php_milter.php + + + match + (?i)\bmsql_(select_db|num_(fields|rows)|c(onnect|lose|reate_db)|d(ata_seek|rop_db|b_query)|error|pconnect|f(ield_(seek|name|t(ype|able)|flags|len)|etch_(object|field|array|row)|ree_result)|query|affected_rows|list_(tables|dbs|fields)|result)(?=\s*\() + name + support.function.php_msql.php + + + match + (?i)\bmssql_(select_db|n(um_(fields|rows)|ext_result)|c(onnect|lose)|init|data_seek|execute|pconnect|query|f(ield_(seek|name|type|length)|etch_(object|field|a(ssoc|rray)|row|batch)|ree_(statement|result))|g(uid_string|et_last_message)|r(ows_affected|esult)|bind|min_(error_severity|message_severity))(?=\s*\() + name + support.function.php_mssql.php + + + match + (?i)\bmysql_(s(tat|e(t_charset|lect_db))|num_(fields|rows)|c(onnect|l(ient_encoding|ose)|reate_db)|thread_id|in(sert_id|fo)|d(ata_seek|rop_db|b_query)|unbuffered_query|e(scape_string|rr(no|or))|p(connect|ing)|f(ield_(seek|name|t(ype|able)|flags|len)|etch_(object|field|lengths|a(ssoc|rray)|row)|ree_result)|query|affected_rows|list_(tables|dbs|processes|fields)|re(sult|al_escape_string)|get_(server_info|host_info|client_info|proto_info))(?=\s*\() + name + support.function.php_mysql.php + + + match + (?i)\b(solid_fetch_prev|odbc_(s(tatistics|pecialcolumns|etoption)|n(um_(fields|rows)|ext_result)|c(o(nnect|lumn(s|privileges)|mmit)|ursor|lose(_all)?)|table(s|privileges)|data_source|e(rror(msg)?|xec(ute)?)|p(connect|r(imarykeys|ocedure(s|columns)|epare))|f(ield_(scale|n(um|ame)|type|len)|oreignkeys|etch_(into|object|array|row)|ree_result)|autocommit|longreadlen|gettypeinfo|r(ollback|esult(_all)?)|binmode))(?=\s*\() + name + support.function.php_odbc.php + + + match + (?i)\bpreg_(split|quote|last_error|grep|replace(_callback)?|match(_all)?)(?=\s*\() + name + support.function.php_pcre.php + + + match + (?i)\b(spl_(classes|object_hash|autoload(_(call|unregister|extensions|functions|register))?)|class_(implements|parents))(?=\s*\() + name + support.function.php_spl.php + + + match + (?i)\bsybase_(se(t_message_handler|lect_db)|num_(fields|rows)|c(onnect|lose)|d(eadlock_retry_count|ata_seek)|unbuffered_query|pconnect|f(ield_seek|etch_(object|field|a(ssoc|rray)|row)|ree_result)|query|affected_rows|result|get_last_message|min_(server_severity|client_severity))(?=\s*\() + name + support.function.php_sybase_ct.php + + + match + (?i)\bsybase_(select_db|num_(fields|rows)|c(onnect|lose)|data_seek|pconnect|f(ield_seek|etch_(object|field|array|row)|ree_result)|query|affected_rows|result|get_last_message|min_(error_severity|message_severity))(?=\s*\() + name + support.function.php_sybase_db.php + + + match + (?i)\bxmlwriter_(s(tart_(c(omment|data)|d(td(_(e(ntity|lement)|attlist))?|ocument)|pi|element(_ns)?|attribute(_ns)?)|et_indent(_string)?)|text|o(utput_memory|pen_(uri|memory))|end_(c(omment|data)|d(td(_(e(ntity|lement)|attlist))?|ocument)|pi|element|attribute)|f(ull_end_element|lush)|write_(c(omment|data)|dtd(_(e(ntity|lement)|attlist))?|pi|element(_ns)?|attribute(_ns)?|raw))(?=\s*\() + name + support.function.php_xmlwriter.php + + + match + (?i)\b(s(tat(Name|Index)|et(Comment(Name|Index)|ArchiveComment))|c(lose|reateEmptyDir)|delete(Name|Index)|open|zip_(close|open|entry_(name|c(ompress(ionmethod|edsize)|lose)|open|filesize|read)|read)|unchange(Name|Index|All)|locateName|addF(ile|romString)|rename(Name|Index)|get(Stream|Comment(Name|Index)|NameIndex|From(Name|Index)|ArchiveComment))(?=\s*\() + name + support.function.php_zip.php + + + match + (?i)\bposix_(s(trerror|et(sid|uid|pgid|e(uid|gid)|gid))|ctermid|i(satty|nitgroups)|t(tyname|imes)|uname|kill|access|get(sid|cwd|_last_error|uid|e(uid|gid)|p(id|pid|w(nam|uid)|g(id|rp))|login|rlimit|g(id|r(nam|oups|gid)))|mk(nod|fifo))(?=\s*\() + name + support.function.posix.php + + + match + (?i)\bproc_(close|terminate|open|get_status)(?=\s*\() + name + support.function.proc_open.php + + + match + (?i)\bpspell_(s(tore_replacement|uggest|ave_wordlist)|c(heck|onfig_(save_repl|create|ignore|d(ict_dir|ata_dir)|personal|r(untogether|epl)|mode)|lear_session)|new(_(config|personal))?|add_to_(session|personal))(?=\s*\() + name + support.function.pspell.php + + + match + (?i)\bquoted_printable_decode(?=\s*\() + name + support.function.quot_print.php + + + match + (?i)\b(srand|getrandmax|rand|mt_(srand|getrandmax|rand))(?=\s*\() + name + support.function.rand.php + + + match + (?i)\breadline(_(c(ompletion_function|allback_(handler_(install|remove)|read_char)|lear_history)|info|on_new_line|write_history|list_history|add_history|re(display|ad_history)))?(?=\s*\() + name + support.function.readline.php + + + match + (?i)\brecode_(string|file)(?=\s*\() + name + support.function.recode.php + + + match + (?i)\b(s(plit(i)?|ql_regcase)|ereg(i(_replace)?|_replace)?)(?=\s*\() + name + support.function.reg.php + + + match + (?i)\bsession_(s(tart|et_(save_handler|cookie_params)|ave_path)|cache_(expire|limiter)|name|i(s_registered|d)|de(stroy|code)|un(set|register)|encode|write_close|reg(ister|enerate_id)|get_cookie_params|module_name)(?=\s*\() + name + support.function.session.php + + + match + (?i)\bsha1(_file)?(?=\s*\() + name + support.function.sha1.php + + + match + (?i)\bshmop_(size|close|delete|open|write|read)(?=\s*\() + name + support.function.shmop.php + + + match + (?i)\bsimplexml_(import_dom|load_(string|file))(?=\s*\() + name + support.function.simplexml.php + + + match + (?i)\bconfirm_extname_compiled(?=\s*\() + name + support.function.skeleton.php + + + match + (?i)\b(snmp(set|2_(set|walk|real_walk|get(next)?)|3_(set|walk|real_walk|get(next)?)|_(set_(oid_output_format|enum_print|valueretrieval|quick_print)|read_mib|get_(valueretrieval|quick_print))|walk|realwalk|get(next)?)|php_snmpv3)(?=\s*\() + name + support.function.snmp.php + + + match + (?i)\bsocket_(s(hutdown|trerror|e(nd(to)?|t_(nonblock|option|block)|lect))|c(onnect|l(ose|ear_error)|reate(_(pair|listen))?)|write|l(isten|ast_error)|accept|get(sockname|_option|peername)|re(cv(from)?|ad)|bind)(?=\s*\() + name + support.function.sockets.php + + + match + (?i)\bsoundex(?=\s*\() + name + support.function.soundex.php + + + match + (?i)\biterator_(count|to_array|apply)(?=\s*\() + name + support.function.spl_iterators.php + + + match + (?i)\bsqlite_(has_prev|s(ingle_query|eek)|n(um_(fields|rows)|ext)|c(hanges|olumn|urrent|lose|reate_(function|aggregate))|open|u(nbuffered_query|df_(decode_binary|encode_binary))|e(scape_string|rror_string|xec)|p(open|rev)|key|valid|query|f(ield_name|etch_(single|column_types|object|a(ll|rray))|actory)|l(ib(encoding|version)|ast_(insert_rowid|error))|array_query|rewind|busy_timeout)(?=\s*\() + name + support.function.sqlite.php + + + match + (?i)\bstream_(s(ocket_(s(hutdown|e(ndto|rver))|client|enable_crypto|pair|accept|recvfrom|get_name)|e(t_(timeout|write_buffer|blocking)|lect))|co(ntext_(set_(option|params)|create|get_(default|options))|py_to_stream)|filter_(prepend|append|remove)|get_(contents|transports|line|wrappers|meta_data))(?=\s*\() + name + support.function.streamsfuncs.php + + + match + (?i)\b(hebrev(c)?|s(scanf|imilar_text|tr(s(tr|pn)|natc(asecmp|mp)|c(hr|spn|oll)|i(str|p(slashes|cslashes|os|_tags))|t(o(upper|k|lower)|r)|_(s(huffle|plit)|ireplace|pad|word_count|r(ot13|ep(eat|lace)))|p(os|brk)|r(chr|ipos|ev|pos))|ubstr(_(co(unt|mpare)|replace))?|etlocale)|c(h(unk_split|r)|ount_chars)|nl(2br|_langinfo)|implode|trim|ord|dirname|uc(first|words)|join|pa(thinfo|rse_str)|explode|quotemeta|add(slashes|cslashes)|wordwrap|l(trim|ocaleconv)|rtrim|money_format|b(in2hex|asename))(?=\s*\() + name + support.function.string.php + + + match + (?i)\bdom_string_extend_find_offset(16|32)(?=\s*\() + name + support.function.string_extend.php + + + match + (?i)\b(syslog|closelog|openlog|define_syslog_variables)(?=\s*\() + name + support.function.syslog.php + + + match + (?i)\bmsg_(s(tat_queue|e(nd|t_queue))|re(ceive|move_queue)|get_queue)(?=\s*\() + name + support.function.sysvmsg.php + + + match + (?i)\bsem_(acquire|re(lease|move)|get)(?=\s*\() + name + support.function.sysvsem.php + + + match + (?i)\bshm_(detach|put_var|attach|get_var|remove(_var)?)(?=\s*\() + name + support.function.sysvshm.php + + + match + (?i)\bdom_text_(split_text|is_whitespace_in_element_content|replace_whole_text)(?=\s*\() + name + support.function.text.php + + + match + (?i)\btidy_(c(onfig_count|lean_repair)|is_x(html|ml)|diagnose|error_count|parse_(string|file)|access_count|warning_count|repair_(string|file)|get(opt|_(h(tml(_ver)?|ead)|status|config|o(utput|pt_doc)|error_buffer|r(oot|elease)|body)))(?=\s*\() + name + support.function.tidy.php + + + match + (?i)\btoken_(name|get_all)(?=\s*\() + name + support.function.tokenizer.php + + + match + (?i)\b(s(trval|ettype)|i(s_(s(calar|tring)|callable|nu(ll|meric)|object|float|array|long|resource|bool)|ntval)|floatval|gettype)(?=\s*\() + name + support.function.type.php + + + match + (?i)\buniqid(?=\s*\() + name + support.function.uniqid.php + + + match + (?i)\b(url(decode|encode)|parse_url|get_headers|rawurl(decode|encode))(?=\s*\() + name + support.function.url.php + + + match + (?i)\bstream_(filter_register|get_filters|bucket_(new|prepend|append|make_writeable))(?=\s*\() + name + support.function.user_filters.php + + + match + (?i)\bdom_userdatahandler_handle(?=\s*\() + name + support.function.userdatahandler.php + + + match + (?i)\bstream_wrapper_(unregister|re(store|gister))(?=\s*\() + name + support.function.userspace.php + + + match + (?i)\bconvert_uu(decode|encode)(?=\s*\() + name + support.function.uuencode.php + + + match + (?i)\b(serialize|debug_zval_dump|unserialize|var_(dump|export)|memory_get_(usage|peak_usage))(?=\s*\() + name + support.function.var.php + + + match + (?i)\bversion_compare(?=\s*\() + name + support.function.versioning.php + + + match + (?i)\bwddx_(serialize_va(lue|rs)|deserialize|packet_(start|end)|add_vars)(?=\s*\() + name + support.function.wddx.php + + + match + (?i)\b(utf8_(decode|encode)|xml_(set_(start_namespace_decl_handler|notation_decl_handler|character_data_handler|default_handler|object|unparsed_entity_decl_handler|processing_instruction_handler|e(nd_namespace_decl_handler|lement_handler|xternal_entity_ref_handler))|error_string|parse(_into_struct|r_(set_option|create(_ns)?|free|get_option))?|get_(current_(column_number|line_number|byte_index)|error_code)))(?=\s*\() + name + support.function.xml.php + + + match + (?i)\bxmlrpc_(se(t_type|rver_(c(all_method|reate)|destroy|add_introspection_data|register_(introspection_callback|method)))|is_fault|decode(_request)?|parse_method_descriptions|encode(_request)?|get_type)(?=\s*\() + name + support.function.xmlrpc-epi-php.php + + + match + (?i)\bdom_xpath_(evaluate|query|register_ns)(?=\s*\() + name + support.function.xpath.php + + + match + (?i)\bxsl_xsltprocessor_(has_exslt_support|set_parameter|transform_to_(doc|uri|xml)|import_stylesheet|re(gister_php_functions|move_parameter)|get_parameter)(?=\s*\() + name + support.function.xsltprocessor.php + + + match + (?i)\b(ob_gzhandler|zlib_get_coding_type|readgzfile|gz(compress|inflate|deflate|open|uncompress|encode|file))(?=\s*\() + name + support.function.zlib.php + + + match + (?i)\bis_int(eger)?(?=\s*\() + name + support.function.alias.php + + + match + (?i)\b(Re(cursive(RegexIterator|CachingIterator|IteratorIterator|DirectoryIterator|FilterIterator|ArrayIterator)|flection(Method|Class|Object|Extension|P(arameter|roperty)|Function)?|gexIterator)|s(tdClass|wf(s(hape|ound|prite)|text(field)?|displayitem|f(ill|ont(cha(r)?)?)|action|gradient|mo(vie|rph)|b(itmap|utton)))|XMLReader|tidyNode|S(impleXML(Iterator|Element)|oap(Server|Header|Client|Param|Var|Fault)|pl(TempFileObject|ObjectStorage|File(Info|Object)))|NoRewindIterator|C(OMPersistHelper|achingIterator)|I(nfiniteIterator|teratorIterator)|D(irectoryIterator|OM(XPath|Node|C(omment|dataSection)|Text|Document(Fragment)?|ProcessingInstruction|E(ntityReference|lement)|Attr))|P(DO(Statement)?|arentIterator)|E(rrorException|mptyIterator|xception)|FilterIterator|LimitIterator|A(p(pendIterator|acheRequest)|rray(Iterator|Object)))(?=\s*\() + name + support.class.builtin.php + + + match + (?i)\b((print|echo)\b|(isset|unset|e(val|mpty)|list)(?=\s*\()) + name + support.function.construct.php + + + + var_basic + + captures + + 1 + + name + punctuation.definition.variable.php + + + match + (?x) + (\$+)[a-zA-Z_\x{7f}-\x{ff}] + [a-zA-Z0-9_\x{7f}-\x{ff}]*?\b + name + variable.other.php + + var_global + + captures + + 1 + + name + punctuation.definition.variable.php + + + match + (\$)(_(COOKIE|FILES|GET|POST|REQUEST))\b + name + variable.other.global.php + + var_global_safer + + captures + + 2 + + name + punctuation.definition.variable.php + + + match + ((\$)(GLOBALS|_(ENV|SERVER|SESSION)))|\b(global)\b + name + variable.other.global.safer.php + + variables + + patterns + + + include + #var_global + + + include + #var_global_safer + + + include + #var_basic + + + + + scopeName + source.php + uuid + 22986475-8CA5-11D9-AEDD-000D93C8BE28 + + diff --git a/app/rcc/edbee/syntaxfiles/Perl.tmLanguage b/app/rcc/edbee/syntaxfiles/Perl.tmLanguage new file mode 100644 index 00000000..0acd3625 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Perl.tmLanguage @@ -0,0 +1,3209 @@ + + + + + comment + + TODO: Include RegExp syntax + + fileTypes + + pl + pm + pod + t + PL + + firstLineMatch + ^#!.*\bperl\b + foldingStartMarker + (/\*|(\{|\[|\()\s*$) + foldingStopMarker + (\*/|^\s*(\}|\]|\))) + keyEquivalent + ^~P + name + Perl + patterns + + + include + #line_comment + + + begin + ^= + captures + + 0 + + name + punctuation.definition.comment.perl + + + end + ^=cut + name + comment.block.documentation.perl + + + include + #variable + + + applyEndPatternLast + 1 + begin + \b(?=qr\s*[^\s\w]) + comment + string.regexp.compile.perl + end + ((([egimosx]*)))(?=(\s+\S|\s*[;\,\#\{\}\)]|$)) + endCaptures + + 1 + + name + string.regexp.compile.perl + + 2 + + name + punctuation.definition.string.perl + + 3 + + name + keyword.control.regexp-option.perl + + + patterns + + + begin + (qr)\s*\{ + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + support.function.perl + + + end + \} + name + string.regexp.compile.nested_braces.perl + patterns + + + include + #escaped_char + + + include + #variable + + + include + #nested_braces_interpolated + + + + + begin + (qr)\s*\[ + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + support.function.perl + + + end + \] + name + string.regexp.compile.nested_brackets.perl + patterns + + + include + #escaped_char + + + include + #variable + + + include + #nested_brackets_interpolated + + + + + begin + (qr)\s*< + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + support.function.perl + + + end + > + name + string.regexp.compile.nested_ltgt.perl + patterns + + + include + #escaped_char + + + include + #variable + + + include + #nested_ltgt_interpolated + + + + + begin + (qr)\s*\( + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + support.function.perl + + + end + \) + name + string.regexp.compile.nested_parens.perl + patterns + + + include + #escaped_char + + + include + #variable + + + include + #nested_parens_interpolated + + + + + begin + (qr)\s*\' + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + support.function.perl + + + end + \' + name + string.regexp.compile.single-quote.perl + patterns + + + include + #escaped_char + + + + + begin + (qr)\s*([^\s\w\'\{\[\(\<]) + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + support.function.perl + + + end + \2 + name + string.regexp.compile.simple-delimiter.perl + patterns + + + comment + This is to prevent thinks like qr/foo$/ to treat $/ as a variable + match + \$(?=[^\s\w\'\{\[\(\<]) + name + keyword.control.anchor.perl + + + include + #escaped_char + + + include + #variable + + + include + #nested_parens_interpolated + + + + + + + applyEndPatternLast + 1 + begin + \b(?=(?<!\&)(s)(\s+\S|\s*[;\,\#\{\}\(\)\[<]|$)) + comment + string.regexp.replace.perl + end + ((([egimosx]*)))(?=(\s+\S|\s*[;\,\#\{\}\)\]>]|$)) + endCaptures + + 1 + + name + string.regexp.replace.perl + + 2 + + name + punctuation.definition.string.perl + + 3 + + name + keyword.control.regexp-option.perl + + + patterns + + + begin + (s)\s*\{ + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + support.function.perl + + + end + \} + name + string.regexp.nested_braces.perl + patterns + + + include + #escaped_char + + + include + #nested_braces + + + + + begin + (s)\s*\[ + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + support.function.perl + + + end + \] + name + string.regexp.nested_brackets.perl + patterns + + + include + #escaped_char + + + include + #nested_brackets + + + + + begin + (s)\s*< + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + support.function.perl + + + end + > + name + string.regexp.nested_ltgt.perl + patterns + + + include + #escaped_char + + + include + #nested_ltgt + + + + + begin + (s)\s*\( + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + support.function.perl + + + end + \) + name + string.regexp.nested_parens.perl + patterns + + + include + #escaped_char + + + include + #nested_parens + + + + + begin + \{ + captures + + 0 + + name + punctuation.definition.string.perl + + + end + \} + name + string.regexp.format.nested_braces.perl + patterns + + + include + #escaped_char + + + include + #variable + + + include + #nested_braces_interpolated + + + + + begin + \[ + captures + + 0 + + name + punctuation.definition.string.perl + + + end + \] + name + string.regexp.format.nested_brackets.perl + patterns + + + include + #escaped_char + + + include + #variable + + + include + #nested_brackets_interpolated + + + + + begin + < + captures + + 0 + + name + punctuation.definition.string.perl + + + end + > + name + string.regexp.format.nested_ltgt.perl + patterns + + + include + #escaped_char + + + include + #variable + + + include + #nested_ltgt_interpolated + + + + + begin + \( + captures + + 0 + + name + punctuation.definition.string.perl + + + end + \) + name + string.regexp.format.nested_parens.perl + patterns + + + include + #escaped_char + + + include + #variable + + + include + #nested_parens_interpolated + + + + + begin + ' + captures + + 0 + + name + punctuation.definition.string.perl + + + end + ' + name + string.regexp.format.single_quote.perl + patterns + + + match + \\['\\] + name + constant.character.escape.perl + + + + + begin + ([^\s\w\[({<;]) + captures + + 0 + + name + punctuation.definition.string.perl + + + end + \1 + name + string.regexp.format.simple_delimiter.perl + patterns + + + include + #escaped_char + + + include + #variable + + + + + match + \s+ + + + + + begin + \b(?=s([^\s\w\[({<]).*\1([egimos]*)([\}\)\;\,]|\s+)) + comment + string.regexp.replaceXXX + end + ((([egimos]*)))(?=([\}\)\;\,]|\s+|$)) + endCaptures + + 1 + + name + string.regexp.replace.perl + + 2 + + name + punctuation.definition.string.perl + + 3 + + name + keyword.control.regexp-option.perl + + + patterns + + + begin + (s\s*)([^\s\w\[({<]) + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + support.function.perl + + + end + (?=\2) + name + string.regexp.replaceXXX.simple_delimiter.perl + patterns + + + include + #escaped_char + + + + + begin + ' + captures + + 0 + + name + punctuation.definition.string.perl + + + end + ' + name + string.regexp.replaceXXX.format.single_quote.perl + patterns + + + match + \\['\\] + name + constant.character.escape.perl.perl + + + + + begin + ([^\s\w\[({<]) + captures + + 0 + + name + punctuation.definition.string.perl + + + end + \1 + name + string.regexp.replaceXXX.format.simple_delimiter.perl + patterns + + + include + #escaped_char + + + include + #variable + + + + + + + begin + \b(?=(?<!\\)s\s*([^\s\w\[({<])) + comment + string.regexp.replace.extended + end + \2((([egimos]*x[egimos]*)))\b + endCaptures + + 1 + + name + string.regexp.replace.perl + + 2 + + name + punctuation.definition.string.perl + + 3 + + name + keyword.control.regexp-option.perl + + + patterns + + + begin + (s)\s*(.) + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + support.function.perl + + + end + (?=\2) + name + string.regexp.replace.extended.simple_delimiter.perl + patterns + + + include + #escaped_char + + + + + begin + ' + captures + + 0 + + name + punctuation.definition.string.perl + + + end + '(?=[egimos]*x[egimos]*)\b + name + string.regexp.replace.extended.simple_delimiter.perl + patterns + + + include + #escaped_char + + + + + begin + (.) + captures + + 0 + + name + punctuation.definition.string.perl + + + end + \1(?=[egimos]*x[egimos]*)\b + name + string.regexp.replace.extended.simple_delimiter.perl + patterns + + + include + #escaped_char + + + include + #variable + + + + + + + match + \b\w+\s*(?==>) + name + constant.other.key.perl + + + match + (?<={)\s*\w+\s*(?=}) + name + constant.other.bareword.perl + + + captures + + 1 + + name + punctuation.definition.string.perl + + 5 + + name + punctuation.definition.string.perl + + + match + (?<!\\)((~\s*)?\/)(\S.*?)(?<!\\)(\\{2})*(\/) + name + string.regexp.find.perl + + + begin + (?<!\\)(\~\s*\/) + captures + + 0 + + name + punctuation.definition.string.perl + + + end + \/([cgimos]*x[cgimos]*)\b + endCaptures + + 1 + + name + keyword.control.regexp-option.perl + + + name + string.regexp.find.extended.perl + patterns + + + include + #escaped_char + + + include + #variable + + + + + captures + + 1 + + name + keyword.control.perl + + 2 + + name + entity.name.type.class.perl + + 3 + + name + comment.line.number-sign.perl + + 4 + + name + punctuation.definition.comment.perl + + + match + ^\s*(package)\s+(\S+)\s*((#).*)?$\n? + name + meta.class.perl + + + captures + + 1 + + name + storage.type.sub.perl + + 2 + + name + entity.name.function.perl + + 3 + + name + storage.type.method.perl + + + match + ^\s*(sub)\s+([-a-zA-Z0-9_]+)\s*(\([\$\@\*;]*\))? + name + meta.function.perl + + + captures + + 1 + + name + entity.name.function.perl + + 2 + + name + punctuation.definition.parameters.perl + + 3 + + name + variable.parameter.function.perl + + + match + ^\s*(BEGIN|END|DESTROY)\b + name + meta.function.perl + + + begin + ^(?=(\t| {4})) + end + (?=[^\t\s]) + name + meta.leading-tabs + patterns + + + captures + + 1 + + name + meta.odd-tab + + 2 + + name + meta.even-tab + + + match + (\t| {4})(\t| {4})? + + + + + captures + + 1 + + name + support.function.perl + + 2 + + name + punctuation.definition.string.perl + + 5 + + name + punctuation.definition.string.perl + + + match + \b(m)\s*(?<!\\)([^\[\{\(A-Za-z0-9\s])(.*?)(?<!\\)(\\{2})*(\2) + name + string.regexp.find-m.perl + + + begin + \b(m)\s*(?<!\\)\( + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + \) + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.regexp.find-m-paren.perl + patterns + + + include + #escaped_char + + + include + #nested_parens_interpolated + + + include + #variable + + + + + begin + \b(m)\s*(?<!\\)\{ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + \} + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.regexp.find-m-brace.perl + patterns + + + include + #escaped_char + + + include + #nested_braces_interpolated + + + include + #variable + + + + + begin + \b(m)\s*(?<!\\)\[ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + \] + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.regexp.find-m-bracket.perl + patterns + + + include + #escaped_char + + + include + #nested_brackets_interpolated + + + include + #variable + + + + + begin + \b(m)\s*(?<!\\)\< + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + \> + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.regexp.find-m-ltgt.perl + patterns + + + include + #escaped_char + + + include + #nested_ltgt_interpolated + + + include + #variable + + + + + captures + + 1 + + name + support.function.perl + + 2 + + name + punctuation.definition.string.perl + + 5 + + name + punctuation.definition.string.perl + + 8 + + name + punctuation.definition.string.perl + + + match + \b(s|tr|y)\s*([^A-Za-z0-9\s])(.*?)(?<!\\)(\\{2})*(\2)(.*?)(?<!\\)(\\{2})*(\2) + name + string.regexp.replace.perl + + + match + \b(__FILE__|__LINE__|__PACKAGE__)\b + name + constant.language.perl + + + match + (?<!->)\b(continue|die|do|else|elsif|exit|for|foreach|goto|if|last|next|redo|return|select|unless|until|wait|while|switch|case|package|require|use|eval)\b + name + keyword.control.perl + + + match + \b(my|our|local)\b + name + storage.modifier.perl + + + match + (?<!\w)\-[rwx0RWXOezsfdlpSbctugkTBMAC]\b + name + keyword.operator.filetest.perl + + + match + \b(and|or|xor|as)\b + name + keyword.operator.logical.perl + + + match + (<=>| =>|->) + name + keyword.operator.comparison.perl + + + begin + ((<<) *"HTML").*\n? + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + string.unquoted.heredoc.doublequote.perl + + 2 + + name + punctuation.definition.heredoc.perl + + + contentName + text.html.embedded.perl + end + (^HTML$) + patterns + + + include + #escaped_char + + + include + #variable + + + include + text.html.basic + + + + + begin + ((<<) *"XML").*\n? + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + string.unquoted.heredoc.doublequote.perl + + 2 + + name + punctuation.definition.heredoc.perl + + + contentName + text.xml.embedded.perl + end + (^XML$) + patterns + + + include + #escaped_char + + + include + #variable + + + include + text.xml + + + + + begin + ((<<) *"CSS").*\n? + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + string.unquoted.heredoc.doublequote.perl + + 2 + + name + punctuation.definition.heredoc.perl + + + contentName + text.css.embedded.perl + end + (^CSS$) + patterns + + + include + #escaped_char + + + include + #variable + + + include + source.css + + + + + begin + ((<<) *"JAVASCRIPT").*\n? + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + string.unquoted.heredoc.doublequote.perl + + 2 + + name + punctuation.definition.heredoc.perl + + + contentName + text.js.embedded.perl + end + (^JAVASCRIPT$) + patterns + + + include + #escaped_char + + + include + #variable + + + include + source.js + + + + + begin + ((<<) *"SQL").*\n? + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + string.unquoted.heredoc.doublequote.perl + + 2 + + name + punctuation.definition.heredoc.perl + + + contentName + source.sql.embedded.perl + end + (^SQL$) + patterns + + + include + #escaped_char + + + include + #variable + + + include + source.sql + + + + + begin + ((<<) *"POSTSCRIPT").*\n? + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + string.unquoted.heredoc.doublequote.perl + + 2 + + name + punctuation.definition.heredoc.perl + + + contentName + text.postscript.embedded.perl + end + (^POSTSCRIPT$) + patterns + + + include + #escaped_char + + + include + #variable + + + include + source.postscript + + + + + begin + ((<<) *"([^"]*)").*\n? + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + string.unquoted.heredoc.doublequote.perl + + 2 + + name + punctuation.definition.heredoc.perl + + + contentName + string.unquoted.heredoc.doublequote.perl + end + (^\3$) + patterns + + + include + #escaped_char + + + include + #variable + + + + + begin + ((<<) *'HTML').*\n? + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + string.unquoted.heredoc.quote.perl + + 2 + + name + punctuation.definition.heredoc.perl + + + contentName + text.html.embedded.perl + end + (^HTML$) + patterns + + + include + text.html.basic + + + + + begin + ((<<) *'XML').*\n? + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + string.unquoted.heredoc.quote.perl + + 2 + + name + punctuation.definition.heredoc.perl + + + contentName + text.xml.embedded.perl + end + (^XML$) + patterns + + + include + text.xml + + + + + begin + ((<<) *'CSS').*\n? + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + string.unquoted.heredoc.quote.perl + + 2 + + name + punctuation.definition.heredoc.perl + + + contentName + text.css.embedded.perl + end + (^CSS$) + patterns + + + include + source.css + + + + + begin + ((<<) *'JAVASCRIPT').*\n? + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + string.unquoted.heredoc.quote.perl + + 2 + + name + punctuation.definition.heredoc.perl + + + contentName + text.js.embedded.perl + end + (^JAVASCRIPT$) + patterns + + + include + source.js + + + + + begin + ((<<) *'SQL').*\n? + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + string.unquoted.heredoc.quote.perl + + 2 + + name + punctuation.definition.heredoc.perl + + + contentName + source.sql.embedded.perl + end + (^SQL$) + patterns + + + include + source.sql + + + + + begin + ((<<) *'POSTSCRIPT').*\n? + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + string.unquoted.heredoc.quote.perl + + 2 + + name + punctuation.definition.heredoc.perl + + + contentName + source.postscript.embedded.perl + end + (^POSTSCRIPT) + patterns + + + include + source.postscript + + + + + begin + ((<<) *'([^']*)').*\n? + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + string.unquoted.heredoc.quote.perl + + 2 + + name + punctuation.definition.heredoc.perl + + + contentName + string.unquoted.heredoc.quote.perl + end + (^\3$) + + + begin + ((<<) *`([^`]*)`).*\n? + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + string.unquoted.heredoc.backtick.perl + + 2 + + name + punctuation.definition.heredoc.perl + + + contentName + string.unquoted.heredoc.backtick.perl + end + (^\3$) + patterns + + + include + #escaped_char + + + include + #variable + + + + + begin + ((<<) *HTML\b).*\n? + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + string.unquoted.heredoc.perl + + 2 + + name + punctuation.definition.heredoc.perl + + + contentName + text.html.embedded.perl + end + (^HTML$) + patterns + + + include + #escaped_char + + + include + #variable + + + include + text.html.basic + + + + + begin + ((<<) *XML\b).*\n? + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + string.unquoted.heredoc.perl + + 2 + + name + punctuation.definition.heredoc.perl + + + contentName + text.xml.embedded.perl + end + (^XML$) + patterns + + + include + #escaped_char + + + include + #variable + + + include + text.xml + + + + + begin + ((<<) *SQL\b).*\n? + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + string.unquoted.heredoc.perl + + 2 + + name + punctuation.definition.heredoc.perl + + + contentName + source.sql.embedded.perl + end + (^SQL$) + patterns + + + include + #escaped_char + + + include + #variable + + + include + source.sql + + + + + begin + ((<<) *POSTSCRIPT\b).*\n? + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + string.unquoted.heredoc.perl + + 2 + + name + punctuation.definition.heredoc.perl + + + contentName + source.postscript.embedded.perl + end + (^POSTSCRIPT) + patterns + + + include + #escaped_char + + + include + #variable + + + include + source.postscript + + + + + begin + ((<<) *((?![=\d\$ ])[^;,'"`\s)]*)).*\n? + captures + + 0 + + name + punctuation.definition.string.perl + + 1 + + name + string.unquoted.heredoc.perl + + 2 + + name + punctuation.definition.heredoc.perl + + + contentName + string.unquoted.heredoc.perl + end + (^\3$) + patterns + + + include + #escaped_char + + + include + #variable + + + + + begin + \bqq\s*([^\(\{\[\<\w\s]) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + \1 + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.quoted.other.qq.perl + patterns + + + include + #escaped_char + + + include + #variable + + + + + begin + \bqx\s*([^'\(\{\[\<\w\s]) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + \1 + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.interpolated.qx.perl + patterns + + + include + #escaped_char + + + include + #variable + + + + + begin + \bqx\s*' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.interpolated.qx.single-quote.perl + patterns + + + include + #escaped_char + + + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.quoted.double.perl + patterns + + + include + #escaped_char + + + include + #variable + + + + + begin + \bqw?\s*([^\(\{\[\<\w\s]) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + \1 + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.quoted.other.q.perl + patterns + + + include + #escaped_char + + + + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.quoted.single.perl + patterns + + + match + \\['\\] + name + constant.character.escape.perl + + + + + begin + ` + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + ` + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.interpolated.perl + patterns + + + include + #escaped_char + + + include + #variable + + + + + begin + \bqq\s*\( + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + \) + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.quoted.other.qq-paren.perl + patterns + + + include + #escaped_char + + + include + #nested_parens_interpolated + + + include + #variable + + + + + begin + \bqq\s*\{ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + \} + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.quoted.other.qq-brace.perl + patterns + + + include + #escaped_char + + + include + #nested_braces_interpolated + + + include + #variable + + + + + begin + \bqq\s*\[ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + \] + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.quoted.other.qq-bracket.perl + patterns + + + include + #escaped_char + + + include + #nested_brackets_interpolated + + + include + #variable + + + + + begin + \bqq\s*\< + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + \> + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.quoted.other.qq-ltgt.perl + patterns + + + include + #escaped_char + + + include + #nested_ltgt_interpolated + + + include + #variable + + + + + begin + \bqx\s*\( + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + \) + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.interpolated.qx-paren.perl + patterns + + + include + #escaped_char + + + include + #nested_parens_interpolated + + + include + #variable + + + + + begin + \bqx\s*\{ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + \} + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.interpolated.qx-brace.perl + patterns + + + include + #escaped_char + + + include + #nested_braces_interpolated + + + include + #variable + + + + + begin + \bqx\s*\[ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + \] + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.interpolated.qx-bracket.perl + patterns + + + include + #escaped_char + + + include + #nested_brackets_interpolated + + + include + #variable + + + + + begin + \bqx\s*\< + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + \> + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.interpolated.qx-ltgt.perl + patterns + + + include + #escaped_char + + + include + #nested_ltgt_interpolated + + + include + #variable + + + + + begin + \bqw?\s*\( + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + \) + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.quoted.other.q-paren.perl + patterns + + + include + #escaped_char + + + include + #nested_parens + + + + + begin + \bqw?\s*\{ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + \} + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.quoted.other.q-brace.perl + patterns + + + include + #escaped_char + + + include + #nested_braces + + + + + begin + \bqw?\s*\[ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + \] + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.quoted.other.q-bracket.perl + patterns + + + include + #escaped_char + + + include + #nested_brackets + + + + + begin + \bqw?\s*\< + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + \> + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.quoted.other.q-ltgt.perl + patterns + + + include + #escaped_char + + + include + #nested_ltgt + + + + + begin + ^__\w+__ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.perl + + + end + $ + endCaptures + + 0 + + name + punctuation.definition.string.end.perl + + + name + string.unquoted.program-block.perl + + + begin + \b(format)\s+([A-Za-z]+)\s*= + beginCaptures + + 1 + + name + support.function.perl + + 2 + + name + entity.name.function.format.perl + + + end + ^\.\s*$ + name + meta.format.perl + patterns + + + include + #line_comment + + + include + #variable + + + + + match + \b(ARGV|DATA|ENV|SIG|STDERR|STDIN|STDOUT|atan2|bind|binmode|bless|caller|chdir|chmod|chomp|chop|chown|chr|chroot|close|closedir|cmp|connect|cos|crypt|dbmclose|dbmopen|defined|delete|dump|each|endgrent|endhostent|endnetent|endprotoent|endpwent|endservent|eof|eq|eval|exec|exists|exp|fcntl|fileno|flock|fork|format|formline|ge|getc|getgrent|getgrgid|getgrnam|gethostbyaddr|gethostbyname|gethostent|getlogin|getnetbyaddr|getnetbyname|getnetent|getpeername|getpgrp|getppid|getpriority|getprotobyname|getprotobynumber|getprotoent|getpwent|getpwnam|getpwuid|getservbyname|getservbyport|getservent|getsockname|getsockopt|glob|gmtime|grep|gt|hex|import|index|int|ioctl|join|keys|kill|lc|lcfirst|le|length|link|listen|local|localtime|log|lstat|lt|m|map|mkdir|msgctl|msgget|msgrcv|msgsnd|ne|no|oct|open|opendir|ord|pack|pipe|pop|pos|print|printf|push|q|qq|quotemeta|qw|qx|rand|read|readdir|readlink|recv|ref|rename|reset|reverse|rewinddir|rindex|rmdir|s|scalar|seek|seekdir|semctl|semget|semop|send|setgrent|sethostent|setnetent|setpgrp|setpriority|setprotoent|setpwent|setservent|setsockopt|shift|shmctl|shmget|shmread|shmwrite|shutdown|sin|sleep|socket|socketpair|sort|splice|split|sprintf|sqrt|srand|stat|study|substr|symlink|syscall|sysopen|sysread|system|syswrite|tell|telldir|tie|tied|time|times|tr|truncate|uc|ucfirst|umask|undef|unlink|unpack|unshift|untie|utime|values|vec|waitpid|wantarray|warn|write|y|q|qw|qq|qx)\b + name + support.function.perl + + + repository + + escaped_char + + match + \\. + name + constant.character.escape.perl + + line_comment + + patterns + + + captures + + 1 + + name + comment.line.number-sign.perl + + 2 + + name + punctuation.definition.comment.perl + + + match + ^((#).*$\n?) + name + meta.comment.full-line.perl + + + captures + + 1 + + name + punctuation.definition.comment.perl + + + match + (#).*$\n? + name + comment.line.number-sign.perl + + + + nested_braces + + begin + \{ + captures + + 1 + + name + punctuation.section.scope.perl + + + end + \} + patterns + + + include + #escaped_char + + + include + #nested_braces + + + + nested_braces_interpolated + + begin + \{ + captures + + 1 + + name + punctuation.section.scope.perl + + + end + \} + patterns + + + include + #escaped_char + + + include + #variable + + + include + #nested_braces_interpolated + + + + nested_brackets + + begin + \[ + captures + + 1 + + name + punctuation.section.scope.perl + + + end + \] + patterns + + + include + #escaped_char + + + include + #nested_brackets + + + + nested_brackets_interpolated + + begin + \[ + captures + + 1 + + name + punctuation.section.scope.perl + + + end + \] + patterns + + + include + #escaped_char + + + include + #variable + + + include + #nested_brackets_interpolated + + + + nested_ltgt + + begin + < + captures + + 1 + + name + punctuation.section.scope.perl + + + end + > + patterns + + + include + #nested_ltgt + + + + nested_ltgt_interpolated + + begin + < + captures + + 1 + + name + punctuation.section.scope.perl + + + end + > + patterns + + + include + #variable + + + include + #nested_ltgt_interpolated + + + + nested_parens + + begin + \( + captures + + 1 + + name + punctuation.section.scope.perl + + + end + \) + patterns + + + include + #escaped_char + + + include + #nested_parens + + + + nested_parens_interpolated + + begin + \( + captures + + 1 + + name + punctuation.section.scope.perl + + + end + \) + patterns + + + comment + This is to prevent thinks like qr/foo$/ to treat $/ as a variable + match + \$(?=[^\s\w\'\{\[\(\<]) + name + keyword.control.anchor.perl + + + include + #escaped_char + + + include + #variable + + + include + #nested_parens_interpolated + + + + variable + + patterns + + + captures + + 1 + + name + punctuation.definition.variable.perl + + + match + (\$)&(?![A-Za-z0-9_]) + name + variable.other.regexp.match.perl + + + captures + + 1 + + name + punctuation.definition.variable.perl + + + match + (\$)`(?![A-Za-z0-9_]) + name + variable.other.regexp.pre-match.perl + + + captures + + 1 + + name + punctuation.definition.variable.perl + + + match + (\$)'(?![A-Za-z0-9_]) + name + variable.other.regexp.post-match.perl + + + captures + + 1 + + name + punctuation.definition.variable.perl + + + match + (\$)\+(?![A-Za-z0-9_]) + name + variable.other.regexp.last-paren-match.perl + + + captures + + 1 + + name + punctuation.definition.variable.perl + + + match + (\$)"(?![A-Za-z0-9_]) + name + variable.other.readwrite.list-separator.perl + + + captures + + 1 + + name + punctuation.definition.variable.perl + + + match + (\$)0(?![A-Za-z0-9_]) + name + variable.other.predefined.program-name.perl + + + captures + + 1 + + name + punctuation.definition.variable.perl + + + match + (\$)[_ab\*\.\/\|,\\;#%=\-~^:?!\$<>\(\)\[\]@](?![A-Za-z0-9_]) + name + variable.other.predefined.perl + + + captures + + 1 + + name + punctuation.definition.variable.perl + + + match + (\$)[0-9]+(?![A-Za-z0-9_]) + name + variable.other.subpattern.perl + + + captures + + 1 + + name + punctuation.definition.variable.perl + + + match + ([\$\@\%](#)?)([a-zA-Zx7f-xff\$]|::)([a-zA-Z0-9_x7f-xff\$]|::)*\b + name + variable.other.readwrite.global.perl + + + captures + + 1 + + name + punctuation.definition.variable.perl + + 2 + + name + punctuation.definition.variable.perl + + + match + (\$\{)(?:[a-zA-Zx7f-xff\$]|::)(?:[a-zA-Z0-9_x7f-xff\$]|::)*(\}) + name + variable.other.readwrite.global.perl + + + captures + + 1 + + name + punctuation.definition.variable.perl + + + match + ([\$\@\%](#)?)[0-9_]\b + name + variable.other.readwrite.global.special.perl + + + + + scopeName + source.perl + uuid + EDBFE125-6B1C-11D9-9189-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/Plain text.tmLanguage b/app/rcc/edbee/syntaxfiles/Plain text.tmLanguage new file mode 100644 index 00000000..58f61d33 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Plain text.tmLanguage @@ -0,0 +1,83 @@ + + + + + fileTypes + + txt + + keyEquivalent + ^~P + name + Plain Text + patterns + + + captures + + 1 + + name + punctuation.definition.item.text + + + match + ^\s*(•).*$\n? + name + meta.bullet-point.strong.text + + + captures + + 1 + + name + punctuation.definition.item.text + + + match + ^\s*(·).*$\n? + name + meta.bullet-point.light.text + + + captures + + 1 + + name + punctuation.definition.item.text + + + match + ^\s*(\*).*$\n? + name + meta.bullet-point.star.text + + + begin + ^([ \t]*)(?=\S) + contentName + meta.paragraph.text + end + ^(?!\1(?=\S)) + patterns + + + match + (?x) + ( (https?|s?ftp|ftps|file|smb|afp|nfs|(x-)?man|gopher|txmt)://|mailto:) + [-:@a-zA-Z0-9_.,~%+/?=&#]+(?<![.,?:]) + + name + markup.underline.link.text + + + + + scopeName + text.plain + uuid + 3130E4FA-B10E-11D9-9F75-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/Python.tmLanguage b/app/rcc/edbee/syntaxfiles/Python.tmLanguage new file mode 100644 index 00000000..88e1a635 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Python.tmLanguage @@ -0,0 +1,3025 @@ + + + + + bundleUUID + E3BADC20-6B0E-11D9-9DC9-000D93589AF6 + comment + + todo: + list comprehension / generator comprehension scope. + + + fileTypes + + py + rpy + pyw + cpy + SConstruct + Sconstruct + sconstruct + SConscript + + firstLineMatch + ^#!/.*\bpython[0-9.-]*\b + foldingStartMarker + ^\s*(def|class)\s+([.a-zA-Z0-9_ <]+)\s*(\((.*)\))?\s*:|\{\s*$|\(\s*$|\[\s*$|^\s*"""(?=.)(?!.*""") + foldingStopMarker + ^\s*$|^\s*\}|^\s*\]|^\s*\)|^\s*"""\s*$ + keyEquivalent + ^~P + name + Python + patterns + + + captures + + 1 + + name + punctuation.definition.comment.python + + + match + (#).*$\n? + name + comment.line.number-sign.python + + + match + \b(?i:(0x\h*)L) + name + constant.numeric.integer.long.hexadecimal.python + + + match + \b(?i:(0x\h*)) + name + constant.numeric.integer.hexadecimal.python + + + match + \b(?i:(0[0-7]+)L) + name + constant.numeric.integer.long.octal.python + + + match + \b(0[0-7]+) + name + constant.numeric.integer.octal.python + + + match + \b(?i:(((\d+(\.(?=[^a-zA-Z_])\d*)?|(?<=[^0-9a-zA-Z_])\.\d+)(e[\-\+]?\d+)?))J) + name + constant.numeric.complex.python + + + match + \b(?i:(\d+\.\d*(e[\-\+]?\d+)?))(?=[^a-zA-Z_]) + name + constant.numeric.float.python + + + match + (?<=[^0-9a-zA-Z_])(?i:(\.\d+(e[\-\+]?\d+)?)) + name + constant.numeric.float.python + + + match + \b(?i:(\d+e[\-\+]?\d+)) + name + constant.numeric.float.python + + + match + \b(?i:([1-9]+[0-9]*|0)L) + name + constant.numeric.integer.long.decimal.python + + + match + \b([1-9]+[0-9]*|0) + name + constant.numeric.integer.decimal.python + + + captures + + 1 + + name + storage.modifier.global.python + + + match + \b(global)\b + + + captures + + 1 + + name + keyword.control.import.python + + 2 + + name + keyword.control.import.from.python + + + match + \b(?:(import)|(from))\b + + + comment + keywords that delimit flow blocks or alter flow from within a block + match + \b(elif|else|except|finally|for|if|try|while|with|break|continue|pass|raise|return|yield)\b + name + keyword.control.flow.python + + + comment + keyword operators that evaluate to True or False + match + \b(and|in|is|not|or)\b + name + keyword.operator.logical.python + + + captures + + 1 + + name + keyword.other.python + + + comment + keywords that haven't fit into other groups (yet). + match + \b(as|assert|del|exec|print)\b + + + match + <> + name + invalid.deprecated.operator.python + + + match + <\=|>\=|\=\=|<|>|\!\= + name + keyword.operator.comparison.python + + + match + \+\=|-\=|\*\=|/\=|//\=|%\=|&\=|\|\=|\^\=|>>\=|<<\=|\*\*\= + name + keyword.operator.assignment.augmented.python + + + match + \+|\-|\*|\*\*|/|//|%|<<|>>|&|\||\^|~ + name + keyword.operator.arithmetic.python + + + match + \= + name + keyword.operator.assignment.python + + + begin + ^\s*(class)\s+(?=[a-zA-Z_][a-zA-Z_0-9]*\s*\:) + beginCaptures + + 1 + + name + storage.type.class.python + + + contentName + entity.name.type.class.python + end + \s*(:) + endCaptures + + 1 + + name + punctuation.section.class.begin.python + + + name + meta.class.old-style.python + patterns + + + include + #entity_name_class + + + + + begin + ^\s*(class)\s+(?=[a-zA-Z_][a-zA-Z_0-9]*\s*\() + beginCaptures + + 1 + + name + storage.type.class.python + + + end + (\))\s*(?:(\:)|(.*$\n?)) + endCaptures + + 1 + + name + punctuation.definition.inheritance.end.python + + 2 + + name + punctuation.section.class.begin.python + + 3 + + name + invalid.illegal.missing-section-begin.python + + + name + meta.class.python + patterns + + + begin + (?=[A-Za-z_][A-Za-z0-9_]*) + contentName + entity.name.type.class.python + end + (?![A-Za-z0-9_]) + patterns + + + include + #entity_name_class + + + + + begin + (\() + beginCaptures + + 1 + + name + punctuation.definition.inheritance.begin.python + + + contentName + meta.class.inheritance.python + end + (?=\)|:) + patterns + + + begin + (?<=\(|,)\s* + contentName + entity.other.inherited-class.python + end + \s*(?:(,)|(?=\))) + endCaptures + + 1 + + name + punctuation.separator.inheritance.python + + + patterns + + + include + $self + + + + + + + + + begin + ^\s*(class)\s+(?=[a-zA-Z_][a-zA-Z_0-9]) + beginCaptures + + 1 + + name + storage.type.class.python + + + end + (\()|\s*($\n?|#.*$\n?) + endCaptures + + 1 + + name + punctuation.definition.inheritance.begin.python + + 2 + + name + invalid.illegal.missing-inheritance.python + + + name + meta.class.python + patterns + + + begin + (?=[A-Za-z_][A-Za-z0-9_]*) + contentName + entity.name.type.class.python + end + (?![A-Za-z0-9_]) + patterns + + + include + #entity_name_function + + + + + + + begin + ^\s*(def)\s+(?=[A-Za-z_][A-Za-z0-9_]*\s*\() + beginCaptures + + 1 + + name + storage.type.function.python + + + end + (\))\s*(?:(\:)|(.*$\n?)) + endCaptures + + 1 + + name + punctuation.definition.parameters.end.python + + 2 + + name + punctuation.section.function.begin.python + + 3 + + name + invalid.illegal.missing-section-begin.python + + + name + meta.function.python + patterns + + + begin + (?=[A-Za-z_][A-Za-z0-9_]*) + contentName + entity.name.function.python + end + (?![A-Za-z0-9_]) + patterns + + + include + #entity_name_function + + + + + begin + (\() + beginCaptures + + 1 + + name + punctuation.definition.parameters.begin.python + + + contentName + meta.function.parameters.python + end + (?=\)\s*\:) + patterns + + + include + #keyword_arguments + + + captures + + 1 + + name + variable.parameter.function.python + + 2 + + name + punctuation.separator.parameters.python + + + match + \b([a-zA-Z_][a-zA-Z_0-9]*)\s*(?:(,)|(?=[\n\)])) + + + + + + + begin + ^\s*(def)\s+(?=[A-Za-z_][A-Za-z0-9_]*) + beginCaptures + + 1 + + name + storage.type.function.python + + + end + (\()|\s*($\n?|#.*$\n?) + endCaptures + + 1 + + name + punctuation.definition.parameters.begin.python + + 2 + + name + invalid.illegal.missing-parameters.python + + + name + meta.function.python + patterns + + + begin + (?=[A-Za-z_][A-Za-z0-9_]*) + contentName + entity.name.function.python + end + (?![A-Za-z0-9_]) + patterns + + + include + #entity_name_function + + + + + + + begin + (lambda)(?=\s+) + beginCaptures + + 1 + + name + storage.type.function.inline.python + + + end + (\:) + endCaptures + + 1 + + name + punctuation.definition.parameters.end.python + + 2 + + name + punctuation.section.function.begin.python + + 3 + + name + invalid.illegal.missing-section-begin.python + + + name + meta.function.inline.python + patterns + + + begin + \s+ + contentName + meta.function.inline.parameters.python + end + (?=\:) + patterns + + + include + #keyword_arguments + + + captures + + 1 + + name + variable.parameter.function.python + + 2 + + name + punctuation.separator.parameters.python + + + match + \b([a-zA-Z_][a-zA-Z_0-9]*)\s*(?:(,)|(?=[\n\)\:])) + + + + + + + begin + ^\s*(?=@\s*[A-Za-z_][A-Za-z0-9_]*(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*\s*\() + comment + a decorator may be a function call which returns a decorator. + end + (\)) + endCaptures + + 1 + + name + punctuation.definition.arguments.end.python + + + name + meta.function.decorator.python + patterns + + + begin + (?=(@)\s*[A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_][A-Za-z0-9_]*)*\s*\() + beginCaptures + + 1 + + name + punctuation.definition.decorator.python + + + contentName + entity.name.function.decorator.python + end + (?=\s*\() + patterns + + + include + #dotted_name + + + + + begin + (\() + beginCaptures + + 1 + + name + punctuation.definition.arguments.begin.python + + + contentName + meta.function.decorator.arguments.python + end + (?=\)) + patterns + + + include + #keyword_arguments + + + include + $self + + + + + + + begin + ^\s*(?=@\s*[A-Za-z_][A-Za-z0-9_]*(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*) + contentName + entity.name.function.decorator.python + end + (?=\s|$\n?|#) + name + meta.function.decorator.python + patterns + + + begin + (?=(@)\s*[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*) + beginCaptures + + 1 + + name + punctuation.definition.decorator.python + + + end + (?=\s|$\n?|#) + patterns + + + include + #dotted_name + + + + + + + begin + (?<=\)|\])\s*(\() + beginCaptures + + 1 + + name + punctuation.definition.arguments.begin.python + + + contentName + meta.function-call.arguments.python + end + (\)) + endCaptures + + 1 + + name + punctuation.definition.arguments.end.python + + + name + meta.function-call.python + patterns + + + include + #keyword_arguments + + + include + $self + + + + + begin + (?=[A-Za-z_][A-Za-z0-9_]*(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*\s*\() + end + (\)) + endCaptures + + 1 + + name + punctuation.definition.arguments.end.python + + + name + meta.function-call.python + patterns + + + begin + (?=[A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_][A-Za-z0-9_]*)*\s*\() + end + (?=\s*\() + patterns + + + include + #dotted_name + + + + + begin + (\() + beginCaptures + + 1 + + name + punctuation.definition.arguments.begin.python + + + contentName + meta.function-call.arguments.python + end + (?=\)) + patterns + + + include + #keyword_arguments + + + include + $self + + + + + + + begin + (?=[A-Za-z_][A-Za-z0-9_]*(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*\s*\[) + end + (\]) + endCaptures + + 1 + + name + punctuation.definition.arguments.end.python + + + name + meta.item-access.python + patterns + + + begin + (?=[A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_][A-Za-z0-9_]*)*\s*\[) + end + (?=\s*\[) + patterns + + + include + #dotted_name + + + + + begin + (\[) + beginCaptures + + 1 + + name + punctuation.definition.arguments.begin.python + + + contentName + meta.item-access.arguments.python + end + (?=\]) + patterns + + + include + $self + + + + + + + begin + (?<=\)|\])\s*(\[) + beginCaptures + + 1 + + name + punctuation.definition.arguments.begin.python + + + contentName + meta.item-access.arguments.python + end + (\]) + endCaptures + + 1 + + name + punctuation.definition.arguments.end.python + + + name + meta.item-access.python + patterns + + + include + $self + + + + + captures + + 1 + + name + storage.type.function.python + + + match + \b(def|lambda)\b + + + captures + + 1 + + name + storage.type.class.python + + + match + \b(class)\b + + + include + #line_continuation + + + include + #language_variables + + + match + \b(None|True|False|Ellipsis|NotImplemented)\b + name + constant.language.python + + + include + #string_quoted_single + + + include + #string_quoted_double + + + include + #dotted_name + + + begin + (\() + end + (\)) + patterns + + + include + $self + + + + + captures + + 1 + + name + punctuation.definition.list.begin.python + + 2 + + name + meta.empty-list.python + + 3 + + name + punctuation.definition.list.end.python + + + match + (\[)(\s*(\]))\b + + + begin + (\[) + beginCaptures + + 1 + + name + punctuation.definition.list.begin.python + + + end + (\]) + endCaptures + + 1 + + name + punctuation.definition.list.end.python + + + name + meta.structure.list.python + patterns + + + begin + (?<=\[|\,)\s*(?![\],]) + contentName + meta.structure.list.item.python + end + \s*(?:(,)|(?=\])) + endCaptures + + 1 + + name + punctuation.separator.list.python + + + patterns + + + include + $self + + + + + + + captures + + 1 + + name + punctuation.definition.tuple.begin.python + + 2 + + name + meta.empty-tuple.python + + 3 + + name + punctuation.definition.tuple.end.python + + + match + (\()(\s*(\))) + name + meta.structure.tuple.python + + + captures + + 1 + + name + punctuation.definition.dictionary.begin.python + + 2 + + name + meta.empty-dictionary.python + + 3 + + name + punctuation.definition.dictionary.end.python + + + match + (\{)(\s*(\})) + name + meta.structure.dictionary.python + + + begin + (\{) + beginCaptures + + 1 + + name + punctuation.definition.dictionary.begin.python + + + end + (\}) + endCaptures + + 1 + + name + punctuation.definition.dictionary.end.python + + + name + meta.structure.dictionary.python + patterns + + + begin + (?<=\{|\,|^)\s*(?![\},]) + contentName + meta.structure.dictionary.key.python + end + \s*(?:(?=\})|(\:)) + endCaptures + + 1 + + name + punctuation.separator.valuepair.dictionary.python + + + patterns + + + include + $self + + + + + begin + (?<=\:|^)\s* + contentName + meta.structure.dictionary.value.python + end + \s*(?:(?=\})|(,)) + endCaptures + + 1 + + name + punctuation.separator.dictionary.python + + + patterns + + + include + $self + + + + + + + repository + + builtin_exceptions + + match + (?x)\b( + ( + Arithmetic|Assertion|Attribute|Buffer|EOF|Environment|FloatingPoint|IO| + Import|Indentation|Index|Key|Lookup|Memory|Name|NotImplemented|OS|Overflow| + Reference|Runtime|Standard|Syntax|System|Tab|Type|UnboundLocal| + Unicode(Encode|Decode|Translate)?| + Value|VMS|Windows|ZeroDivision + )Error| + ((Pending)?Deprecation|Runtime|Syntax|User|Future|Import|Unicode|Bytes)?Warning| + (Base)?Exception| + SystemExit|StopIteration|NotImplemented|KeyboardInterrupt|GeneratorExit + )\b + name + support.type.exception.python + + builtin_functions + + match + (?x)\b( + __import__|all|abs|any|apply|callable|chr|cmp|coerce|compile|delattr|dir| + divmod|eval|execfile|filter|getattr|globals|hasattr|hash|hex|id| + input|intern|isinstance|issubclass|iter|len|locals|map|max|min|oct| + ord|pow|range|raw_input|reduce|reload|repr|round|setattr|sorted| + sum|unichr|vars|zip + )\b + name + support.function.builtin.python + + builtin_types + + match + (?x)\b( + basestring|bool|buffer|classmethod|complex|dict|enumerate|file| + float|frozenset|int|list|long|object|open|property|reversed|set| + slice|staticmethod|str|super|tuple|type|unicode|xrange + )\b + name + support.type.python + + constant_placeholder + + match + (?i:%(\([a-z_]+\))?#?0?\-?[ ]?\+?([0-9]*|\*)(\.([0-9]*|\*))?[hL]?[a-z%]) + name + constant.other.placeholder.python + + docstrings + + patterns + + + begin + ^\s*(?=[uU]?[rR]?""") + end + (?<=""") + name + comment.block.python + patterns + + + include + #string_quoted_double + + + + + begin + ^\s*(?=[uU]?[rR]?''') + end + (?<=''') + name + comment.block.python + patterns + + + include + #string_quoted_single + + + + + + dotted_name + + begin + (?=[A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_][A-Za-z0-9_]*)*) + end + (?![A-Za-z0-9_\.]) + patterns + + + begin + (\.)(?=[A-Za-z_][A-Za-z0-9_]*) + end + (?![A-Za-z0-9_]) + patterns + + + include + #magic_function_names + + + include + #magic_variable_names + + + include + #illegal_names + + + include + #generic_names + + + + + begin + (?<!\.)(?=[A-Za-z_][A-Za-z0-9_]*) + end + (?![A-Za-z0-9_]) + patterns + + + include + #builtin_functions + + + include + #builtin_types + + + include + #builtin_exceptions + + + include + #illegal_names + + + include + #magic_function_names + + + include + #magic_variable_names + + + include + #language_variables + + + include + #generic_names + + + + + + entity_name_class + + patterns + + + include + #illegal_names + + + include + #generic_names + + + + entity_name_function + + patterns + + + include + #magic_function_names + + + include + #illegal_names + + + include + #generic_names + + + + escaped_char + + captures + + 1 + + name + constant.character.escape.hex.python + + 10 + + name + constant.character.escape.linefeed.python + + 11 + + name + constant.character.escape.return.python + + 12 + + name + constant.character.escape.tab.python + + 13 + + name + constant.character.escape.vertical-tab.python + + 2 + + name + constant.character.escape.octal.python + + 3 + + name + constant.character.escape.newline.python + + 4 + + name + constant.character.escape.backlash.python + + 5 + + name + constant.character.escape.double-quote.python + + 6 + + name + constant.character.escape.single-quote.python + + 7 + + name + constant.character.escape.bell.python + + 8 + + name + constant.character.escape.backspace.python + + 9 + + name + constant.character.escape.formfeed.python + + + match + (\\x[0-9A-F]{2})|(\\[0-7]{3})|(\\\n)|(\\\\)|(\\\")|(\\')|(\\a)|(\\b)|(\\f)|(\\n)|(\\r)|(\\t)|(\\v) + + escaped_unicode_char + + captures + + 1 + + name + constant.character.escape.unicode.16-bit-hex.python + + 2 + + name + constant.character.escape.unicode.32-bit-hex.python + + 3 + + name + constant.character.escape.unicode.name.python + + + match + (\\U[0-9A-Fa-f]{8})|(\\u[0-9A-Fa-f]{4})|(\\N\{[a-zA-Z ]+\}) + + function_name + + patterns + + + include + #magic_function_names + + + include + #magic_variable_names + + + include + #builtin_exceptions + + + include + #builtin_functions + + + include + #builtin_types + + + include + #generic_names + + + + generic_names + + match + [A-Za-z_][A-Za-z0-9_]* + + illegal_names + + match + \b(and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield)\b + name + invalid.illegal.name.python + + keyword_arguments + + begin + \b([a-zA-Z_][a-zA-Z_0-9]*)\s*(=)(?!=) + beginCaptures + + 1 + + name + variable.parameter.function.python + + 2 + + name + keyword.operator.assignment.python + + + end + \s*(?:(,)|(?=$\n?|[\)\:])) + endCaptures + + 1 + + name + punctuation.separator.parameters.python + + + patterns + + + include + $self + + + + language_variables + + match + \b(self|cls)\b + name + variable.language.python + + line_continuation + + captures + + 1 + + name + punctuation.separator.continuation.line.python + + 2 + + name + invalid.illegal.unexpected-text.python + + + match + (\\)(.*)$\n? + + magic_function_names + + comment + these methods have magic interpretation by python and are generally called indirectly through syntactic constructs + match + (?x)\b(__(?: + abs|add|and|call|cmp|coerce|complex|contains|del|delattr| + delete|delitem|delslice|div|divmod|enter|eq|exit|float| + floordiv|ge|get|getattr|getattribute|getitem|getslice|gt| + hash|hex|iadd|iand|idiv|ifloordiv|ilshift|imod|imul|init| + int|invert|ior|ipow|irshift|isub|iter|itruediv|ixor|le|len| + long|lshift|lt|mod|mul|ne|neg|new|nonzero|oct|or|pos|pow| + radd|rand|rdiv|rdivmod|repr|rfloordiv|rlshift|rmod|rmul|ror| + rpow|rrshift|rshift|rsub|rtruediv|rxor|set|setattr|setitem| + setslice|str|sub|truediv|unicode|xor + )__)\b + name + support.function.magic.python + + magic_variable_names + + comment + magic variables which a class/module may have. + match + \b__(all|bases|class|debug|dict|doc|file|members|metaclass|methods|name|slots|weakref)__\b + name + support.variable.magic.python + + regular_expressions + + comment + Changed disabled to 1 to turn off syntax highlighting in “r” strings. + disabled + 0 + patterns + + + include + source.regexp.python + + + + string_quoted_double + + patterns + + + begin + ([uU]r)(""") + beginCaptures + + 1 + + name + storage.type.string.python + + 2 + + name + punctuation.definition.string.begin.python + + + comment + single quoted unicode-raw string + end + ((?<=""")(")""|""") + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.double.python + + + name + string.quoted.double.block.unicode-raw-regex.python + patterns + + + include + #constant_placeholder + + + include + #escaped_unicode_char + + + include + #escaped_char + + + include + #regular_expressions + + + + + begin + ([uU]R)(""") + beginCaptures + + 1 + + name + storage.type.string.python + + 2 + + name + punctuation.definition.string.begin.python + + + comment + single quoted unicode-raw string without regular expression highlighting + end + ((?<=""")(")""|""") + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.double.python + + + name + string.quoted.double.block.unicode-raw.python + patterns + + + include + #constant_placeholder + + + include + #escaped_unicode_char + + + include + #escaped_char + + + + + begin + (r)(""") + beginCaptures + + 1 + + name + storage.type.string.python + + 2 + + name + punctuation.definition.string.begin.python + + + comment + double quoted raw string + end + ((?<=""")(")""|""") + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.double.python + + + name + string.quoted.double.block.raw-regex.python + patterns + + + include + #constant_placeholder + + + include + #escaped_char + + + include + #regular_expressions + + + + + begin + (R)(""") + beginCaptures + + 1 + + name + storage.type.string.python + + 2 + + name + punctuation.definition.string.begin.python + + + comment + double quoted raw string + end + ((?<=""")(")""|""") + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.double.python + + + name + string.quoted.double.block.raw.python + patterns + + + include + #constant_placeholder + + + include + #escaped_char + + + + + begin + ([uU])(""") + beginCaptures + + 1 + + name + storage.type.string.python + + 2 + + name + punctuation.definition.string.begin.python + + + comment + double quoted unicode string + end + ((?<=""")(")""|""") + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.double.python + + + name + string.quoted.double.block.unicode.python + patterns + + + include + #constant_placeholder + + + include + #escaped_unicode_char + + + include + #escaped_char + + + + + begin + ([uU]r)(") + beginCaptures + + 1 + + name + storage.type.string.python + + 2 + + name + punctuation.definition.string.begin.python + + + comment + double-quoted raw string + end + ((?<=")(")|")|(\n) + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.double.python + + 3 + + name + invalid.illegal.unclosed-string.python + + + name + string.quoted.double.single-line.unicode-raw-regex.python + patterns + + + include + #constant_placeholder + + + include + #escaped_unicode_char + + + include + #escaped_char + + + include + #regular_expressions + + + + + begin + ([uU]R)(") + beginCaptures + + 1 + + name + storage.type.string.python + + 2 + + name + punctuation.definition.string.begin.python + + + comment + double-quoted raw string + end + ((?<=")(")|")|(\n) + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.double.python + + 3 + + name + invalid.illegal.unclosed-string.python + + + name + string.quoted.double.single-line.unicode-raw.python + patterns + + + include + #constant_placeholder + + + include + #escaped_unicode_char + + + include + #escaped_char + + + + + begin + (r)(") + beginCaptures + + 1 + + name + storage.type.string.python + + 2 + + name + punctuation.definition.string.begin.python + + + comment + double-quoted raw string + end + ((?<=")(")|")|(\n) + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.double.python + + 3 + + name + invalid.illegal.unclosed-string.python + + + name + string.quoted.double.single-line.raw-regex.python + patterns + + + include + #constant_placeholder + + + include + #escaped_char + + + include + #regular_expressions + + + + + begin + (R)(") + beginCaptures + + 1 + + name + storage.type.string.python + + 2 + + name + punctuation.definition.string.begin.python + + + comment + double-quoted raw string + end + ((?<=")(")|")|(\n) + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.double.python + + 3 + + name + invalid.illegal.unclosed-string.python + + + name + string.quoted.double.single-line.raw.python + patterns + + + include + #constant_placeholder + + + include + #escaped_char + + + + + begin + ([uU])(") + beginCaptures + + 1 + + name + storage.type.string.python + + 2 + + name + punctuation.definition.string.begin.python + + + comment + double quoted unicode string + end + ((?<=")(")|")|(\n) + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.double.python + + 3 + + name + invalid.illegal.unclosed-string.python + + + name + string.quoted.double.single-line.unicode.python + patterns + + + include + #constant_placeholder + + + include + #escaped_unicode_char + + + include + #escaped_char + + + + + begin + (""")(?=\s*(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER)) + beginCaptures + + 1 + + name + punctuation.definition.string.begin.python + + + comment + double quoted string + end + ((?<=""")(")""|""") + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.double.python + + + name + string.quoted.double.block.sql.python + patterns + + + include + #constant_placeholder + + + include + #escaped_char + + + include + source.sql + + + + + begin + (")(?=\s*(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER)) + beginCaptures + + 1 + + name + punctuation.definition.string.begin.python + + + comment + double quoted string + end + ((?<=")(")|")|(\n) + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.double.python + + 3 + + name + invalid.illegal.unclosed-string.python + + + name + string.quoted.double.single-line.sql.python + patterns + + + include + #constant_placeholder + + + include + #escaped_char + + + include + source.sql + + + + + begin + (""") + beginCaptures + + 1 + + name + punctuation.definition.string.begin.python + + + comment + double quoted string + end + ((?<=""")(")""|""") + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.double.python + + + name + string.quoted.double.block.python + patterns + + + include + #constant_placeholder + + + include + #escaped_char + + + + + begin + (") + beginCaptures + + 1 + + name + punctuation.definition.string.begin.python + + + comment + double quoted string + end + ((?<=")(")|")|(\n) + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.double.python + + 3 + + name + invalid.illegal.unclosed-string.python + + + name + string.quoted.double.single-line.python + patterns + + + include + #constant_placeholder + + + include + #escaped_char + + + + + + string_quoted_single + + patterns + + + captures + + 1 + + name + punctuation.definition.string.begin.python + + 2 + + name + punctuation.definition.string.end.python + + 3 + + name + meta.empty-string.single.python + + + match + (?<!')(')(('))(?!') + name + string.quoted.single.single-line.python + + + begin + ([uU]r)(''') + beginCaptures + + 1 + + name + storage.type.string.python + + 2 + + name + punctuation.definition.string.begin.python + + + comment + single quoted unicode-raw string + end + ((?<=''')(')''|''') + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.single.python + + + name + string.quoted.single.block.unicode-raw-regex.python + patterns + + + include + #constant_placeholder + + + include + #escaped_unicode_char + + + include + #escaped_char + + + include + #regular_expressions + + + + + begin + ([uU]R)(''') + beginCaptures + + 1 + + name + storage.type.string.python + + 2 + + name + punctuation.definition.string.begin.python + + + comment + single quoted unicode-raw string + end + ((?<=''')(')''|''') + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.single.python + + + name + string.quoted.single.block.unicode-raw.python + patterns + + + include + #constant_placeholder + + + include + #escaped_unicode_char + + + include + #escaped_char + + + + + begin + (r)(''') + beginCaptures + + 1 + + name + storage.type.string.python + + 2 + + name + punctuation.definition.string.begin.python + + + comment + single quoted raw string + end + ((?<=''')(')''|''') + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.single.python + + + name + string.quoted.single.block.raw-regex.python + patterns + + + include + #constant_placeholder + + + include + #escaped_char + + + include + #regular_expressions + + + + + begin + (R)(''') + beginCaptures + + 1 + + name + storage.type.string.python + + 2 + + name + punctuation.definition.string.begin.python + + + comment + single quoted raw string + end + ((?<=''')(')''|''') + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.single.python + + + name + string.quoted.single.block.raw.python + patterns + + + include + #constant_placeholder + + + include + #escaped_char + + + + + begin + ([uU])(''') + beginCaptures + + 1 + + name + storage.type.string.python + + 2 + + name + punctuation.definition.string.begin.python + + + comment + single quoted unicode string + end + ((?<=''')(')''|''') + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.single.python + + + name + string.quoted.single.block.unicode.python + patterns + + + include + #constant_placeholder + + + include + #escaped_unicode_char + + + include + #escaped_char + + + + + begin + ([uU]r)(') + beginCaptures + + 1 + + name + storage.type.string.python + + 2 + + name + punctuation.definition.string.begin.python + + + comment + single quoted raw string + end + (')|(\n) + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + invalid.illegal.unclosed-string.python + + + name + string.quoted.single.single-line.unicode-raw-regex.python + patterns + + + include + #constant_placeholder + + + include + #escaped_unicode_char + + + include + #escaped_char + + + include + #regular_expressions + + + + + begin + ([uU]R)(') + beginCaptures + + 1 + + name + storage.type.string.python + + 2 + + name + punctuation.definition.string.begin.python + + + comment + single quoted raw string + end + (')|(\n) + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + invalid.illegal.unclosed-string.python + + + name + string.quoted.single.single-line.unicode-raw.python + patterns + + + include + #constant_placeholder + + + include + #escaped_unicode_char + + + include + #escaped_char + + + + + begin + (r)(') + beginCaptures + + 1 + + name + storage.type.string.python + + 2 + + name + punctuation.definition.string.begin.python + + + comment + single quoted raw string + end + (')|(\n) + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + invalid.illegal.unclosed-string.python + + + name + string.quoted.single.single-line.raw-regex.python + patterns + + + include + #constant_placeholder + + + include + #escaped_char + + + include + #regular_expressions + + + + + begin + (R)(') + beginCaptures + + 1 + + name + storage.type.string.python + + 2 + + name + punctuation.definition.string.begin.python + + + comment + single quoted raw string + end + (')|(\n) + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + invalid.illegal.unclosed-string.python + + + name + string.quoted.single.single-line.raw.python + patterns + + + include + #constant_placeholder + + + include + #escaped_char + + + + + begin + ([uU])(') + beginCaptures + + 1 + + name + storage.type.string.python + + 2 + + name + punctuation.definition.string.begin.python + + + comment + single quoted unicode string + end + (')|(\n) + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + invalid.illegal.unclosed-string.python + + + name + string.quoted.single.single-line.unicode.python + patterns + + + include + #constant_placeholder + + + include + #escaped_unicode_char + + + include + #escaped_char + + + + + begin + (''')(?=\s*(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER)) + beginCaptures + + 1 + + name + punctuation.definition.string.begin.python + + + comment + single quoted string + end + ((?<=''')(')''|''') + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.single.python + + + name + string.quoted.single.block.python + patterns + + + include + #constant_placeholder + + + include + #escaped_char + + + include + source.sql + + + + + begin + (')(?=\s*(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER)) + beginCaptures + + 1 + + name + punctuation.definition.string.begin.python + + + comment + single quoted string + end + (')|(\n) + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + invalid.illegal.unclosed-string.python + + + name + string.quoted.single.single-line.python + patterns + + + include + #constant_placeholder + + + include + #escaped_char + + + include + source.sql + + + + + begin + (''') + beginCaptures + + 1 + + name + punctuation.definition.string.begin.python + + + comment + single quoted string + end + ((?<=''')(')''|''') + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + meta.empty-string.single.python + + + name + string.quoted.single.block.python + patterns + + + include + #constant_placeholder + + + include + #escaped_char + + + + + begin + (') + beginCaptures + + 1 + + name + punctuation.definition.string.begin.python + + + comment + single quoted string + end + (')|(\n) + endCaptures + + 1 + + name + punctuation.definition.string.end.python + + 2 + + name + invalid.illegal.unclosed-string.python + + + name + string.quoted.single.single-line.python + patterns + + + include + #constant_placeholder + + + include + #escaped_char + + + + + + strings + + patterns + + + include + #string_quoted_double + + + include + #string_quoted_single + + + + + scopeName + source.python + uuid + F23DB5B2-7D08-11D9-A709-000D93B6E43C + + diff --git a/app/rcc/edbee/syntaxfiles/R Console.tmLanguage b/app/rcc/edbee/syntaxfiles/R Console.tmLanguage new file mode 100644 index 00000000..d47004ca --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/R Console.tmLanguage @@ -0,0 +1,42 @@ + + + + + fileTypes + + keyEquivalent + ^~R + name + R Console + patterns + + + begin + ^> + beginCaptures + + 0 + + name + punctuation.section.embedded.r-console + + + end + \n|\z + name + source.r.embedded.r-console + patterns + + + include + source.r + + + + + scopeName + source.r-console + uuid + F629C7F3-823B-4A4C-8EEE-9971490C5710 + + diff --git a/app/rcc/edbee/syntaxfiles/Rd (R Documentation).tmLanguage b/app/rcc/edbee/syntaxfiles/Rd (R Documentation).tmLanguage new file mode 100644 index 00000000..80247106 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Rd (R Documentation).tmLanguage @@ -0,0 +1,243 @@ + + + + + fileTypes + + rd + + foldingStartMarker + /\w*\{\s*$ + foldingStopMarker + ^\s*\} + keyEquivalent + ^~R + name + Rd (R Documentation) + patterns + + + begin + ((\\)(?:alias|docType|keyword|name|title))(\{) + beginCaptures + + 1 + + name + keyword.other.section.rd + + 2 + + name + punctuation.definition.function.rd + + 3 + + name + punctuation.definition.arguments.begin.rd + + + contentName + entity.name.tag.rd + end + (\}) + endCaptures + + 1 + + name + punctuation.definition.arguments.end.rd + + + name + meta.section.rd + patterns + + + include + $self + + + + + begin + ((\\)(?:details|format|references|source))(\{) + beginCaptures + + 1 + + name + keyword.other.section.rd + + 2 + + name + punctuation.definition.function.rd + + 3 + + name + punctuation.definition.arguments.begin.rd + + + end + (\}) + endCaptures + + 1 + + name + punctuation.definition.arguments.end.rd + + + name + meta.section.rd + patterns + + + include + $self + + + + + begin + ((\\)(?:usage))(\{)(?:\n)? + beginCaptures + + 1 + + name + keyword.other.usage.rd + + 2 + + name + punctuation.definition.function.rd + + 3 + + name + punctuation.definition.arguments.begin.rd + + + contentName + source.r.embedded + end + (\}) + endCaptures + + 1 + + name + punctuation.definition.arguments.end.rd + + + name + meta.usage.rd + patterns + + + include + source.r + + + + + begin + ((\\)(?:examples))(\{)(?:\n)? + beginCaptures + + 1 + + name + keyword.other.examples.rd + + 2 + + name + punctuation.definition.function.rd + + 3 + + name + punctuation.definition.arguments.begin.rd + + + contentName + source.r.embedded + end + (\}) + endCaptures + + 1 + + name + punctuation.definition.arguments.end.rd + + + name + meta.examples.rd + patterns + + + include + source.r + + + + + captures + + 1 + + name + keyword.other.author.rd + + 2 + + name + punctuation.definition.function.rd + + 3 + + name + punctuation.definition.arguments.begin.rd + + 4 + + name + entity.name.tag.author.rd + + 5 + + name + punctuation.definition.link.rd + + 6 + + name + markup.underline.link.rd + + 7 + + name + punctuation.definition.link.rd + + + match + ((\\)(?:author))(\{)([\w\s]+?)\s+(<)([^>]*)(>) + name + meta.author.rd + + + include + text.tex.latex + + + scopeName + text.tex.latex.rd + uuid + 80A00288-FE7E-4E66-B5BF-4948A2828203 + + diff --git a/app/rcc/edbee/syntaxfiles/RegExp.tmLanguage b/app/rcc/edbee/syntaxfiles/RegExp.tmLanguage new file mode 100644 index 00000000..e0b6971d --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/RegExp.tmLanguage @@ -0,0 +1,142 @@ + + + + + comment + Matches Oniguruma's Ruby regexp syntax (TextMate uses Oniguruma in Ruby mode). + fileTypes + + re + + foldingStartMarker + (/\*|\{|\() + foldingStopMarker + (\*/|\}|\)) + keyEquivalent + ^~R + name + Regular Expression + patterns + + + match + \| + name + keyword.operator.regexp + + + match + \\[bBAZzG^$] + name + keyword.control.anchors.regexp + + + include + #character_class + + + include + #escaped_char + + + begin + \[(?:\^?\])? + end + \] + name + keyword.control.set.regexp + patterns + + + include + #character_class + + + include + #escaped_char + + + match + .-. + name + constant.other.range.regexp + + + match + .&&. + name + keyword.operator.intersection.regexp + + + + + begin + \( + end + \) + name + string.regexp.group + patterns + + + include + source.regexp + + + match + (?<=\()\?(<[=!]|>|=|:|!) + name + constant.other.assertion.regexp + + + match + (?<=\()\?# + name + comment.line.number-sign.regexp + + + + + match + \\(\n\d+|\k\w+|(?<!\|)\g\w+) + name + keyword.other.backref-and-recursion.regexp + + + match + \\([tvnrbfae]|[0-8]{3}|x\H\H\{7\H{7}\}|x\H\H|c\d+|C-\d+|M-\d+|M-\\C-\d+) + name + constant.character.escape.regexp + + + match + ((?<!\()[?*+][?+]?)|\{\d*,\d*\} + name + keyword.operator.quantifier.regexp + + + repository + + character_class + + match + \\[wWsSdDhH] + name + keyword.control.character-class.regexp + + escaped_char + + comment + escaped character + match + \\. + name + constant.character.escape.regexp + + + scopeName + source.regexp + uuid + BAFE4C4F-8D59-48CD-A3BC-52A2084531C9 + + diff --git a/app/rcc/edbee/syntaxfiles/Ruby Haml.tmLanguage b/app/rcc/edbee/syntaxfiles/Ruby Haml.tmLanguage new file mode 100644 index 00000000..88d43f26 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Ruby Haml.tmLanguage @@ -0,0 +1,248 @@ + + + + + fileTypes + + haml + sass + + foldingStartMarker + ^\s*([-%#\:\.\w\=].*)\s$ + foldingStopMarker + ^\s*$ + keyEquivalent + ^~H + name + Ruby Haml + patterns + + + captures + + 1 + + name + punctuation.definition.prolog.haml + + + match + ^(!!!)($|\s.*) + name + meta.prolog.haml + + + captures + + 1 + + name + punctuation.section.comment.haml + + + match + ^ *(/)\s*\S.*$\n? + name + comment.line.slash.haml + + + begin + ^( *)(/)\s*$ + beginCaptures + + 2 + + name + punctuation.section.comment.haml + + + end + ^(?!\1 ) + name + comment.block.haml + patterns + + + include + text.haml + + + + + begin + ^\s*(?:((%)([\w:]+))|(?=\.|#)) + captures + + 1 + + name + meta.tag.haml + + 2 + + name + punctuation.definition.tag.haml + + 3 + + name + entity.name.tag.haml + + + end + $|(?!\.|#|\{|\[|=|-|~|/) + patterns + + + match + \.[\w-]+ + name + entity.name.tag.class.haml + + + match + #[\w-]+ + name + entity.name.tag.id.haml + + + begin + \{(?=.*\}|.*\|\s*$) + end + \}|$|^(?!.*\|\s*$) + name + meta.section.attributes.haml + patterns + + + include + source.ruby.rails + + + include + #continuation + + + + + begin + \[(?=.*\]|.*\|\s*$) + end + \]|$|^(?!.*\|\s*$) + name + meta.section.object.haml + patterns + + + include + source.ruby.rails + + + include + #continuation + + + + + include + #rubyline + + + match + / + name + punctuation.terminator.tag.haml + + + + + captures + + 1 + + name + meta.escape.haml + + + match + ^\s*(\\.) + + + begin + ^\s*(?==|-|~) + end + $ + patterns + + + include + #rubyline + + + + + repository + + continuation + + captures + + 1 + + name + punctuation.separator.continuation.haml + + + match + (\|)\s*\n + + rubyline + + begin + =|-|~ + contentName + source.ruby.embedded.haml + end + ((do|\{)( \|[^|]+\|)?)$|$|^(?!.*\|\s*$) + endCaptures + + 1 + + name + source.ruby.embedded.html + + 2 + + name + keyword.control.ruby.start-block + + + name + meta.line.ruby.haml + patterns + + + comment + Hack to let ruby comments work in this context properly + match + #.*$ + name + comment.line.number-sign.ruby + + + include + source.ruby.rails + + + include + #continuation + + + + + scopeName + text.haml + uuid + 3D727049-DD05-45DF-92A5-D50EA36FD035 + + diff --git a/app/rcc/edbee/syntaxfiles/Ruby on Rails.tmLanguage b/app/rcc/edbee/syntaxfiles/Ruby on Rails.tmLanguage new file mode 100644 index 00000000..f9901de8 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Ruby on Rails.tmLanguage @@ -0,0 +1,287 @@ + + + + + fileTypes + + rxml + builder + + foldingStartMarker + (?x)^ + (\s*+ + (module|class|def + |unless|if + |case + |begin + |for|while|until + |( "(\\.|[^"])*+" # eat a double quoted string + | '(\\.|[^'])*+' # eat a single quoted string + | [^#"'] # eat all but comments and strings + )* + ( \s (do|begin|case) + | [-+=&|*/~%^<>~] \s*+ (if|unless) + ) + )\b + (?! [^;]*+ ; .*? \bend\b ) + |( "(\\.|[^"])*+" # eat a double quoted string + | '(\\.|[^'])*+' # eat a single quoted string + | [^#"'] # eat all but comments and strings + )* + ( \{ (?! [^}]*+ \} ) + | \[ (?! [^\]]*+ \] ) + ) + ).*$ + | [#] .*? \(fold\) \s*+ $ # Sune’s special marker + + foldingStopMarker + (?x) + ( (^|;) \s*+ end \s*+ ([#].*)? $ + | ^ \s*+ [}\]] \s*+ ([#].*)? $ + | [#] .*? \(end\) \s*+ $ # Sune’s special marker + ) + keyEquivalent + ^~R + name + Ruby on Rails + patterns + + + begin + (^\s*)(?=class\s+(([.a-zA-Z0-9_:]+ControllerTest(\s*<\s*[.a-zA-Z0-9_:]+)?))) + comment + Uses lookahead to match classes with the ControllerTest suffix; includes 'source.ruby' to avoid infinite recursion + end + ^\1(?=end)\b + name + meta.rails.functional_test + patterns + + + include + source.ruby + + + include + $self + + + + + begin + (^\s*)(?=class\s+(([.a-zA-Z0-9_:]+Controller\b(\s*<\s*[.a-zA-Z0-9_:]+)?)|(<<\s*[.a-zA-Z0-9_:]+)))(?!.+\bend\b) + comment + Uses lookahead to match classes with the Controller suffix; includes 'source.ruby' to avoid infinite recursion + end + ^\1(?=end)\b + name + meta.rails.controller + patterns + + + include + source.ruby + + + include + $self + + + + + begin + (^\s*)(?=module\s+((([A-Z]\w*::)*)[A-Z]\w*)Helper) + comment + Uses lookahead to match modules with the Helper suffix; includes 'source.ruby' to avoid infinite recursion + end + ^\1(?=end)\b + name + meta.rails.helper + patterns + + + include + source.ruby + + + include + $self + + + + + begin + (^\s*)(?=class\s+(([.a-zA-Z0-9_:]+(\s*<\s*ActionMailer::Base)))) + comment + Uses lookahead to match classes that inherit from ActionMailer::Base; includes 'source.ruby' to avoid infinite recursion + end + ^\1(?=end)\b + name + meta.rails.mailer + patterns + + + include + source.ruby + + + include + $self + + + + + begin + (^\s*)(?=class\s+.+ActiveRecord::Base) + comment + Uses lookahead to match classes that (may) inherit from ActiveRecord::Base; includes 'source.ruby' to avoid infinite recursion + end + ^\1(?=end)\b + name + meta.rails.model + patterns + + + include + source.ruby + + + include + $self + + + + + begin + (^\s*)(?=class\s+.+ActiveRecord::Migration) + comment + Uses lookahead to match classes that (may) inherit from ActiveRecord::Migration; includes 'source.ruby' to avoid infinite recursion + end + ^\1(?=end)\b + name + meta.rails.migration + patterns + + + begin + (^\s*)(?=change_table)\b + comment + Uses lookahead to match methods change_table; includes 'source.ruby' to avoid infinite recursion + contentName + meta.rails.migration.change_table + end + ^\1(?=end)\b + patterns + + + include + source.ruby + + + include + $self + + + + + begin + (^\s*)(?=create_table)\b + comment + Uses lookahead to match methods create_table; includes 'source.ruby' to avoid infinite recursion + contentName + meta.rails.migration.create_table + end + ^\1(?=end)\b + patterns + + + include + source.ruby + + + include + $self + + + + + include + source.ruby + + + include + $self + + + + + begin + (^\s*)(?=class\s+(?![.a-zA-Z0-9_:]+ControllerTest)(([.a-zA-Z0-9_:]+Test(\s*<\s*[.a-zA-Z0-9_:]+)?)|(<<\s*[.a-zA-Z0-9_:]+))) + comment + Uses lookahead to match classes with the Test suffix; includes 'source.ruby' to avoid infinite recursion + end + ^\1(?=end)\b + name + meta.rails.unit_test + patterns + + + include + source.ruby + + + include + $self + + + + + begin + (^\s*)ActionController::Routing::Routes + comment + Uses ActionController::Routing::Routes to determine it is a routes file; includes 'source.ruby' to avoid infinite recursion + end + ^\1(?=end)\b + name + meta.rails.routes + patterns + + + include + source.ruby + + + include + $self + + + + + match + \b(before_filter|skip_before_filter|skip_after_filter|after_filter|around_filter|filter|filter_parameter_logging|layout|require_dependency|render|render_action|render_text|render_file|render_template|render_nothing|render_component|render_without_layout|rescue_from|url_for|redirect_to|redirect_to_path|redirect_to_url|respond_to|helper|helper_method|model|service|observer|serialize|scaffold|verify|hide_action)\b + name + support.function.actionpack.rails + + + match + \b(named_scope|after_create|after_destroy|after_save|after_update|after_validation|after_validation_on_create|after_validation_on_update|before_create|before_destroy|before_save|before_update|before_validation|before_validation_on_create|before_validation_on_update|composed_of|belongs_to|has_one|has_many|has_and_belongs_to_many|validate|validate_on_create|validates_numericality_of|validate_on_update|validates_acceptance_of|validates_associated|validates_confirmation_of|validates_each|validates_format_of|validates_inclusion_of|validates_exclusion_of|validates_length_of|validates_presence_of|validates_size_of|validates_uniqueness_of|attr_protected|attr_accessible|attr_readonly)\b + name + support.function.activerecord.rails + + + match + \b(alias_method_chain|alias_attribute|delegate|cattr_accessor|mattr_accessor|returning)\b + name + support.function.activesupport.rails + + + include + source.ruby + + + scopeName + source.ruby.rails + uuid + 54D6E91E-8F31-11D9-90C5-0011242E4184 + + diff --git a/app/rcc/edbee/syntaxfiles/Ruby.tmLanguage b/app/rcc/edbee/syntaxfiles/Ruby.tmLanguage new file mode 100644 index 00000000..a1ea6df8 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Ruby.tmLanguage @@ -0,0 +1,2854 @@ + + + + + comment + + TODO: unresolved issues + + text: + "p << end + print me! + end" + symptoms: + not recognized as a heredoc + solution: + there is no way to distinguish perfectly between the << operator and the start + of a heredoc. Currently, we require assignment to recognize a heredoc. More + refinement is possible. + • Heredocs with indented terminators (<<-) are always distinguishable, however. + • Nested heredocs are not really supportable at present + + text: + print <<-'THERE' + This is single quoted. + The above used #{Time.now} + THERE + symtoms: + From Programming Ruby p306; should be a non-interpolated heredoc. + + text: + "a\332a" + symptoms: + '\332' is not recognized as slash3.. which should be octal 332. + solution: + plain regexp.. should be easy. + + text: + val?(a):p(b) + val?'a':'b' + symptoms: + ':p' is recognized as a symbol.. its 2 things ':' and 'p'. + :'b' has same problem. + solution: + ternary operator rule, precedence stuff, symbol rule. + but also consider 'a.b?(:c)' ?? + + fileTypes + + rb + rbx + rjs + Rakefile + rake + cgi + fcgi + gemspec + irbrc + capfile + Gemfile + + firstLineMatch + ^#!/.*\bruby + foldingStartMarker + (?x)^ + (\s*+ + (module|class|def(?!.*\bend\s*$) + |unless|if + |case + |begin + |for|while|until + |^=begin + |( "(\\.|[^"])*+" # eat a double quoted string + | '(\\.|[^'])*+' # eat a single quoted string + | [^#"'] # eat all but comments and strings + )* + ( \s (do|begin|case) + | (?<!\$)[-+=&|*/~%^<>~] \s*+ (if|unless) + ) + )\b + (?! [^;]*+ ; .*? \bend\b ) + |( "(\\.|[^"])*+" # eat a double quoted string + | '(\\.|[^'])*+' # eat a single quoted string + | [^#"'] # eat all but comments and strings + )* + ( \{ (?! [^}]*+ \} ) + | \[ (?! [^\]]*+ \] ) + ) + ).*$ + | [#] .*? \(fold\) \s*+ $ # Sune’s special marker + + foldingStopMarker + (?x) + ( (^|;) \s*+ end \s*+ ([#].*)? $ + | (^|;) \s*+ end \. .* $ + | ^ \s*+ [}\]] ,? \s*+ ([#].*)? $ + | [#] .*? \(end\) \s*+ $ # Sune’s special marker + | ^=end + ) + keyEquivalent + ^~R + name + Ruby + patterns + + + captures + + 1 + + name + keyword.control.class.ruby + + 2 + + name + entity.name.type.class.ruby + + 4 + + name + entity.other.inherited-class.ruby + + 5 + + name + punctuation.separator.inheritance.ruby + + 6 + + name + variable.other.object.ruby + + 7 + + name + punctuation.definition.variable.ruby + + + match + ^\s*(class)\s+(([.a-zA-Z0-9_:]+(\s*(<)\s*[.a-zA-Z0-9_:]+)?)|((<<)\s*[.a-zA-Z0-9_:]+)) + name + meta.class.ruby + + + captures + + 1 + + name + keyword.control.module.ruby + + 2 + + name + entity.name.type.module.ruby + + 3 + + name + entity.other.inherited-class.module.first.ruby + + 4 + + name + punctuation.separator.inheritance.ruby + + 5 + + name + entity.other.inherited-class.module.second.ruby + + 6 + + name + punctuation.separator.inheritance.ruby + + 7 + + name + entity.other.inherited-class.module.third.ruby + + 8 + + name + punctuation.separator.inheritance.ruby + + + match + ^\s*(module)\s+(([A-Z]\w*(::))?([A-Z]\w*(::))?([A-Z]\w*(::))*[A-Z]\w*) + name + meta.module.ruby + + + comment + else if is a common mistake carried over from other languages. it works if you put in a second end, but it’s never what you want. + match + (?<!\.)\belse(\s)+if\b + name + invalid.deprecated.ruby + + + comment + everything being a reserved word, not a value and needing a 'end' is a.. + match + (?<!\.)\b(BEGIN|begin|case|class|else|elsif|END|end|ensure|for|if|in|module|rescue|then|unless|until|when|while)\b(?![?!]) + name + keyword.control.ruby + + + comment + contextual smart pair support for block parameters + match + (?<!\.)\bdo\b\s* + name + keyword.control.start-block.ruby + + + comment + contextual smart pair support + match + (?<=\{)(\s+) + name + meta.syntax.ruby.start-block + + + comment + as above, just doesn't need a 'end' and does a logic operation + match + (?<!\.)\b(and|not|or)\b + name + keyword.operator.logical.ruby + + + comment + just as above but being not a logical operation + match + (?<!\.)\b(alias|alias_method|break|next|redo|retry|return|super|undef|yield)\b(?![?!])|\bdefined\?|\bblock_given\? + name + keyword.control.pseudo-method.ruby + + + match + \b(nil|true|false)\b(?![?!]) + name + constant.language.ruby + + + match + \b(__(FILE|LINE)__|self)\b(?![?!]) + name + variable.language.ruby + + + comment + everything being a method but having a special function is a.. + match + \b(initialize|new|loop|include|extend|raise|attr_reader|attr_writer|attr_accessor|attr|catch|throw|private|module_function|public|protected)\b(?![?!]) + name + keyword.other.special-method.ruby + + + begin + \b(require|gem)\b + captures + + 1 + + name + keyword.other.special-method.ruby + + + end + $|(?=#) + name + meta.require.ruby + patterns + + + include + $self + + + + + captures + + 1 + + name + punctuation.definition.variable.ruby + + + match + (@)[a-zA-Z_]\w* + name + variable.other.readwrite.instance.ruby + + + captures + + 1 + + name + punctuation.definition.variable.ruby + + + match + (@@)[a-zA-Z_]\w* + name + variable.other.readwrite.class.ruby + + + captures + + 1 + + name + punctuation.definition.variable.ruby + + + match + (\$)[a-zA-Z_]\w* + name + variable.other.readwrite.global.ruby + + + captures + + 1 + + name + punctuation.definition.variable.ruby + + + match + (\$)(!|@|&|`|'|\+|\d+|~|=|/|\\|,|;|\.|<|>|_|\*|\$|\?|:|"|-[0adFiIlpv]) + name + variable.other.readwrite.global.pre-defined.ruby + + + begin + \b(ENV)\[ + beginCaptures + + 1 + + name + variable.other.constant.ruby + + + end + \] + name + meta.environment-variable.ruby + patterns + + + include + $self + + + + + match + \b[A-Z]\w*(?=((\.|::)[A-Za-z]|\[)) + name + support.class.ruby + + + match + \b[A-Z]\w*\b + name + variable.other.constant.ruby + + + begin + (?x) + (?=def\b) # an optimization to help Oniguruma fail fast + (?<=^|\s)(def)\s+ # the def keyword + ( (?>[a-zA-Z_]\w*(?>\.|::))? # a method name prefix + (?>[a-zA-Z_]\w*(?>[?!]|=(?!>))? # the method name + |===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?) ) # …or an operator method + \s*(\() # the openning parenthesis for arguments + + beginCaptures + + 1 + + name + keyword.control.def.ruby + + 2 + + name + entity.name.function.ruby + + 3 + + name + punctuation.definition.parameters.ruby + + + comment + the method pattern comes from the symbol pattern, see there for a explaination + contentName + variable.parameter.function.ruby + end + \) + endCaptures + + 0 + + name + punctuation.definition.parameters.ruby + + + name + meta.function.method.with-arguments.ruby + patterns + + + include + $self + + + + + begin + (?x) + (?=def\b) # an optimization to help Oniguruma fail fast + (?<=^|\s)(def)\s+ # the def keyword + ( (?>[a-zA-Z_]\w*(?>\.|::))? # a method name prefix + (?>[a-zA-Z_]\w*(?>[?!]|=(?!>))? # the method name + |===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?) ) # …or an operator method + [ \t] # the space separating the arguments + (?=[ \t]*[^\s#;]) # make sure arguments and not a comment follow + + beginCaptures + + 1 + + name + keyword.control.def.ruby + + 2 + + name + entity.name.function.ruby + + + comment + same as the previous rule, but without parentheses around the arguments + contentName + variable.parameter.function.ruby + end + $ + name + meta.function.method.with-arguments.ruby + patterns + + + include + $self + + + + + captures + + 1 + + name + keyword.control.def.ruby + + 3 + + name + entity.name.function.ruby + + + comment + the optional name is just to catch the def also without a method-name + match + (?x) + (?=def\b) # an optimization to help Oniguruma fail fast + (?<=^|\s)(def)\b # the def keyword + ( \s+ # an optional group of whitespace followed by… + ( (?>[a-zA-Z_]\w*(?>\.|::))? # a method name prefix + (?>[a-zA-Z_]\w*(?>[?!]|=(?!>))? # the method name + |===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?) ) )? # …or an operator method + + name + meta.function.method.without-arguments.ruby + + + match + \b(0[xX]\h(?>_?\h)*|\d(?>_?\d)*(\.(?![^[:space:][:digit:]])(?>_?\d)*)?([eE][-+]?\d(?>_?\d)*)?|0[bB][01]+)\b + name + constant.numeric.ruby + + + begin + :' + captures + + 0 + + name + punctuation.definition.constant.ruby + + + end + ' + name + constant.other.symbol.single-quoted.ruby + patterns + + + match + \\['\\] + name + constant.character.escape.ruby + + + + + begin + :" + captures + + 0 + + name + punctuation.definition.constant.ruby + + + end + " + name + constant.other.symbol.double-quoted.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + comment + Needs higher precidence than regular expressions. + match + /= + name + keyword.operator.assignment.augmented.ruby + + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + single quoted string (does not allow interpolation) + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.single.ruby + patterns + + + match + \\'|\\\\ + name + constant.character.escape.ruby + + + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + double quoted string (allows for interpolation) + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.double.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + ` + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + execute string (allows for interpolation) + end + ` + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.interpolated.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + %x\{ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + execute string (allow for interpolation) + end + \} + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.interpolated.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_curly_i + + + + + begin + %x\[ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + execute string (allow for interpolation) + end + \] + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.interpolated.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_brackets_i + + + + + begin + %x\< + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + execute string (allow for interpolation) + end + \> + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.interpolated.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_ltgt_i + + + + + begin + %x\( + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + execute string (allow for interpolation) + end + \) + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.interpolated.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_parens_i + + + + + begin + %x([^\w]) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + execute string (allow for interpolation) + end + \1 + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.interpolated.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?x) + (?: + ^ # beginning of line + | (?<= # or look-behind on: + [=>~(?:\[,|&;] + | [\s;]if\s # keywords + | [\s;]elsif\s + | [\s;]while\s + | [\s;]unless\s + | [\s;]when\s + | [\s;]assert_match\s + | [\s;]or\s # boolean opperators + | [\s;]and\s + | [\s;]not\s + | [\s.]index\s # methods + | [\s.]scan\s + | [\s.]sub\s + | [\s.]sub!\s + | [\s.]gsub\s + | [\s.]gsub!\s + | [\s.]match\s + ) + | (?<= # or a look-behind with line anchor: + ^when\s # duplication necessary due to limits of regex + | ^if\s + | ^elsif\s + | ^while\s + | ^unless\s + ) + ) + \s*((/))(?![*+{}?]) + + captures + + 1 + + name + string.regexp.classic.ruby + + 2 + + name + punctuation.definition.string.ruby + + + comment + regular expressions (normal) + we only start a regexp if the character before it (excluding whitespace) + is what we think is before a regexp + + contentName + string.regexp.classic.ruby + end + ((/[eimnosux]*)) + patterns + + + include + #regex_sub + + + + + begin + %r\{ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + regular expressions (literal) + end + \}[eimnosux]* + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.regexp.mod-r.ruby + patterns + + + include + #regex_sub + + + include + #nest_curly_r + + + + + begin + %r\[ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + regular expressions (literal) + end + \][eimnosux]* + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.regexp.mod-r.ruby + patterns + + + include + #regex_sub + + + include + #nest_brackets_r + + + + + begin + %r\( + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + regular expressions (literal) + end + \)[eimnosux]* + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.regexp.mod-r.ruby + patterns + + + include + #regex_sub + + + include + #nest_parens_r + + + + + begin + %r\< + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + regular expressions (literal) + end + \>[eimnosux]* + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.regexp.mod-r.ruby + patterns + + + include + #regex_sub + + + include + #nest_ltgt_r + + + + + begin + %r([^\w]) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + regular expressions (literal) + end + \1[eimnosux]* + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.regexp.mod-r.ruby + patterns + + + include + #regex_sub + + + + + begin + %[QWSR]?\( + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal capable of interpolation () + end + \) + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.other.literal.upper.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_parens_i + + + + + begin + %[QWSR]?\[ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal capable of interpolation [] + end + \] + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.other.literal.upper.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_brackets_i + + + + + begin + %[QWSR]?\< + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal capable of interpolation <> + end + \> + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.other.literal.upper.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_ltgt_i + + + + + begin + %[QWSR]?\{ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal capable of interpolation -- {} + end + \} + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.double.ruby.mod + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_curly_i + + + + + begin + %[QWSR]([^\w]) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal capable of interpolation -- wildcard + end + \1 + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.other.literal.upper.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + %([^\w\s=]) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal capable of interpolation -- wildcard + end + \1 + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.other.literal.other.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + %[qws]\( + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal incapable of interpolation -- () + end + \) + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.other.literal.lower.ruby + patterns + + + match + \\\)|\\\\ + name + constant.character.escape.ruby + + + include + #nest_parens + + + + + begin + %[qws]\< + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal incapable of interpolation -- <> + end + \> + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.other.literal.lower.ruby + patterns + + + match + \\\>|\\\\ + name + constant.character.escape.ruby + + + include + #nest_ltgt + + + + + begin + %[qws]\[ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal incapable of interpolation -- [] + end + \] + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.other.literal.lower.ruby + patterns + + + match + \\\]|\\\\ + name + constant.character.escape.ruby + + + include + #nest_brackets + + + + + begin + %[qws]\{ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal incapable of interpolation -- {} + end + \} + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.other.literal.lower.ruby + patterns + + + match + \\\}|\\\\ + name + constant.character.escape.ruby + + + include + #nest_curly + + + + + begin + %[qws]([^\w]) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal incapable of interpolation -- wildcard + end + \1 + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.other.literal.lower.ruby + patterns + + + comment + Cant be named because its not neccesarily an escape. + match + \\. + + + + + captures + + 1 + + name + punctuation.definition.constant.ruby + + + comment + symbols + match + (?<!:)(:)(?>[a-zA-Z_]\w*(?>[?!]|=(?![>=]))?|===?|>[>=]?|<[<=]?|<=>|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?|@@?[a-zA-Z_]\w*) + name + constant.other.symbol.ruby + + + captures + + 1 + + name + punctuation.definition.constant.ruby + + + comment + symbols + match + (?>[a-zA-Z_]\w*(?>[?!])?)(:)(?!:) + name + constant.other.symbol.ruby.19syntax + + + begin + ^=begin + captures + + 0 + + name + punctuation.definition.comment.ruby + + + comment + multiline comments + end + ^=end + name + comment.block.documentation.ruby + + + captures + + 1 + + name + punctuation.definition.comment.ruby + + + match + (?:^[ \t]+)?(#).*$\n? + name + comment.line.number-sign.ruby + + + comment + + matches questionmark-letters. + + examples (1st alternation = hex): + ?\x1 ?\x61 + + examples (2nd alternation = octal): + ?\0 ?\07 ?\017 + + examples (3rd alternation = escaped): + ?\n ?\b + + examples (4th alternation = meta-ctrl): + ?\C-a ?\M-a ?\C-\M-\C-\M-a + + examples (4th alternation = normal): + ?a ?A ?0 + ?* ?" ?( + ?. ?# + + + the negative lookbehind prevents against matching + p(42.tainted?) + + match + (?<!\w)\?(\\(x\h{1,2}(?!\h)\b|0[0-7]{0,2}(?![0-7])\b|[^x0MC])|(\\[MC]-)+\w|[^\s\\]) + name + constant.numeric.ruby + + + begin + ^__END__\n + captures + + 0 + + name + string.unquoted.program-block.ruby + + + comment + __END__ marker + contentName + text.plain + end + (?=not)impossible + patterns + + + begin + (?=<?xml|<(?i:html\b)|!DOCTYPE (?i:html\b)) + end + (?=not)impossible + name + text.html.embedded.ruby + patterns + + + include + text.html.basic + + + + + + + begin + (?><<-("?)((?:[_\w]+_|)HTML)\b\1) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + heredoc with embedded HTML and indented terminator + contentName + text.html.embedded.ruby + end + \s*\2$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.embedded.html.ruby + patterns + + + include + #heredoc + + + include + text.html.basic + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?><<-("?)((?:[_\w]+_|)SQL)\b\1) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + heredoc with embedded SQL and indented terminator + contentName + text.sql.embedded.ruby + end + \s*\2$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.embedded.sql.ruby + patterns + + + include + #heredoc + + + include + source.sql + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?><<-("?)((?:[_\w]+_|)CSS)\b\1) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + heredoc with embedded css and intented terminator + contentName + text.css.embedded.ruby + end + \s*\2$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.embedded.css.ruby + patterns + + + include + #heredoc + + + include + source.css + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?><<-("?)((?:[_\w]+_|)CPP)\b\1) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + heredoc with embedded c++ and intented terminator + contentName + text.c++.embedded.ruby + end + \s*\2$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.embedded.cplusplus.ruby + patterns + + + include + #heredoc + + + include + source.c++ + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?><<-("?)((?:[_\w]+_|)C)\b\1) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + heredoc with embedded c++ and intented terminator + contentName + text.c.embedded.ruby + end + \s*\2$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.embedded.c.ruby + patterns + + + include + #heredoc + + + include + source.c + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?><<-("?)((?:[_\w]+_|)(?:JS|JAVASCRIPT))\b\1) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + heredoc with embedded javascript and intented terminator + contentName + text.js.embedded.ruby + end + \s*\2$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.embedded.js.ruby + patterns + + + include + #heredoc + + + include + source.js + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?><<-("?)((?:[_\w]+_|)JQUERY)\b\1) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + heredoc with embedded javascript and intented terminator + contentName + text.js.jquery.embedded.ruby + end + \s*\2$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.embedded.js.jquery.ruby + patterns + + + include + #heredoc + + + include + source.js.jquery + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?><<-("?)((?:[_\w]+_|)(?:SH|SHELL))\b\1) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + heredoc with embedded shell and intented terminator + contentName + text.shell.embedded.ruby + end + \s*\2$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.embedded.shell.ruby + patterns + + + include + #heredoc + + + include + source.shell + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?><<-("?)((?:[_\w]+_|)RUBY)\b\1) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + heredoc with embedded ruby and intented terminator + contentName + text.ruby.embedded.ruby + end + \s*\2$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.embedded.ruby.ruby + patterns + + + include + #heredoc + + + include + source.ruby + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?>\=\s*<<(\w+)) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + end + ^\1$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.heredoc.ruby + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?><<-(\w+)) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + heredoc with indented terminator + end + \s*\1$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.heredoc.ruby + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?<=\{|do|\{\s|do\s)(\|) + captures + + 1 + + name + punctuation.separator.variable.ruby + + + end + (\|) + patterns + + + match + [_a-zA-Z][_a-zA-Z0-9]* + name + variable.other.block.ruby + + + match + , + name + punctuation.separator.variable.ruby + + + + + match + => + name + punctuation.separator.key-value + + + match + <<=|%=|&=|\*=|\*\*=|\+=|\-=|\^=|\|{1,2}=|<< + name + keyword.operator.assignment.augmented.ruby + + + match + <=>|<(?!<|=)|>(?!<|=|>)|<=|>=|===|==|=~|!=|!~|(?<=[ \t])\? + name + keyword.operator.comparison.ruby + + + match + (?<=[ \t])!+|\bnot\b|&&|\band\b|\|\||\bor\b|\^ + name + keyword.operator.logical.ruby + + + match + (%|&|\*\*|\*|\+|\-|/) + name + keyword.operator.arithmetic.ruby + + + match + = + name + keyword.operator.assignment.ruby + + + match + \||~|>> + name + keyword.operator.other.ruby + + + match + : + name + punctuation.separator.other.ruby + + + match + \; + name + punctuation.separator.statement.ruby + + + match + , + name + punctuation.separator.object.ruby + + + match + \.|:: + name + punctuation.separator.method.ruby + + + match + \{|\} + name + punctuation.section.scope.ruby + + + match + \[|\] + name + punctuation.section.array.ruby + + + match + \(|\) + name + punctuation.section.function.ruby + + + repository + + escaped_char + + match + \\(?:[0-7]{1,3}|x[\da-fA-F]{1,2}|.) + name + constant.character.escape.ruby + + heredoc + + begin + ^<<-?\w+ + end + $ + patterns + + + include + $self + + + + interpolated_ruby + + patterns + + + captures + + 0 + + name + punctuation.section.embedded.ruby + + 1 + + name + source.ruby.embedded.source.empty + + + match + #\{(\}) + name + source.ruby.embedded.source + + + begin + #\{ + captures + + 0 + + name + punctuation.section.embedded.ruby + + + end + \} + name + source.ruby.embedded.source + patterns + + + include + #nest_curly_and_self + + + include + $self + + + + + captures + + 1 + + name + punctuation.definition.variable.ruby + + + match + (#@)[a-zA-Z_]\w* + name + variable.other.readwrite.instance.ruby + + + captures + + 1 + + name + punctuation.definition.variable.ruby + + + match + (#@@)[a-zA-Z_]\w* + name + variable.other.readwrite.class.ruby + + + captures + + 1 + + name + punctuation.definition.variable.ruby + + + match + (#\$)[a-zA-Z_]\w* + name + variable.other.readwrite.global.ruby + + + + nest_brackets + + begin + \[ + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \] + patterns + + + include + #nest_brackets + + + + nest_brackets_i + + begin + \[ + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \] + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_brackets_i + + + + nest_brackets_r + + begin + \[ + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \] + patterns + + + include + #regex_sub + + + include + #nest_brackets_r + + + + nest_curly + + begin + \{ + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \} + patterns + + + include + #nest_curly + + + + nest_curly_and_self + + patterns + + + begin + \{ + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \} + patterns + + + include + #nest_curly_and_self + + + + + include + $self + + + + nest_curly_i + + begin + \{ + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \} + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_curly_i + + + + nest_curly_r + + begin + \{ + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \} + patterns + + + include + #regex_sub + + + include + #nest_curly_r + + + + nest_ltgt + + begin + \< + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \> + patterns + + + include + #nest_ltgt + + + + nest_ltgt_i + + begin + \< + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \> + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_ltgt_i + + + + nest_ltgt_r + + begin + \< + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \> + patterns + + + include + #regex_sub + + + include + #nest_ltgt_r + + + + nest_parens + + begin + \( + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \) + patterns + + + include + #nest_parens + + + + nest_parens_i + + begin + \( + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \) + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_parens_i + + + + nest_parens_r + + begin + \( + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \) + patterns + + + include + #regex_sub + + + include + #nest_parens_r + + + + regex_sub + + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + captures + + 1 + + name + punctuation.definition.arbitrary-repitition.ruby + + 3 + + name + punctuation.definition.arbitrary-repitition.ruby + + + match + (\{)\d+(,\d+)?(\}) + name + string.regexp.arbitrary-repitition.ruby + + + begin + \[(?:\^?\])? + captures + + 0 + + name + punctuation.definition.character-class.ruby + + + end + \] + name + string.regexp.character-class.ruby + patterns + + + include + #escaped_char + + + + + begin + \( + captures + + 0 + + name + punctuation.definition.group.ruby + + + end + \) + name + string.regexp.group.ruby + patterns + + + include + #regex_sub + + + + + captures + + 1 + + name + punctuation.definition.comment.ruby + + + comment + We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags. + match + (?<=^|\s)(#)\s[[a-zA-Z0-9,. \t?!-][^\x{00}-\x{7F}]]*$ + name + comment.line.number-sign.ruby + + + + + scopeName + source.ruby + uuid + E00B62AC-6B1C-11D9-9B1F-000D93589AF6 + + diff --git a/app/rcc/edbee/syntaxfiles/Rust.tmLanguage.json b/app/rcc/edbee/syntaxfiles/Rust.tmLanguage.json new file mode 100644 index 00000000..e979469b --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Rust.tmLanguage.json @@ -0,0 +1,981 @@ +{ + "repository": { + "comment": { + "patterns": [ + { + "name": "comment.block.documentation.rust", + "begin": "/\\*[\\*!](?![\\*/])", + "end": "\\*/", + "patterns": [ + { + "begin": "(?x) (\\*\\b|\\b_)(?=\\S) # Open\n (?=\n (\n <[^>]*+> # HTML tags\n | (?`+)([^`]|(?!(?(?!`))`)*+\\k\n # Raw\n | \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+ # Escapes\n | \\[\n (\n (? # Named group\n [^\\[\\]\\\\] # Match most chars\n | \\\\. # Escaped chars\n | \\[ \\g*+ \\] # Nested brackets\n )*+\n \\]\n (\n ( # Reference Link\n [ ]? # Optional space\n \\[[^\\]]*+\\] # Ref name\n )\n | ( # Inline Link\n \\( # Opening paren\n [ \\t]*+ # Optional whtiespace\n ? # URL\n [ \\t]*+ # Optional whtiespace\n ( # Optional Title\n (?['\"])\n (.*?)\n \\k<title>\n )?\n \\)\n )\n )\n )\n | \\1\\1 # Must be bold closer\n | (?!(?<=\\S)\\1). # Everything besides\n # style closer\n )++\n (?<=\\S)(?=_\\b|\\*)\\1 # Close\n )\n", + "captures": { + "1": { + "name": "punctuation.definition.italic.markdown" + } + }, + "end": "(?<=\\S)(\\1)((?!\\1)|(?=\\1\\1))", + "name": "markup.italic.markdown" + }, + { + "begin": "(?x)\n ((?<!\\w)\\*\\*\\b|\\b__)(?=\\S) # Open\n (?=\n (\n <[^>]*+> # HTML tags\n | (?<raw>`+)([^`]|(?!(?<!`)\\k<raw>(?!`))`)*+\\k<raw>\n # Raw\n | \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+ # Escapes\n | \\[\n (\n (?<square> # Named group\n [^\\[\\]\\\\] # Match most chars\n | \\\\. # Escaped chars\n | \\[ \\g<square>*+ \\] # Nested brackets\n )*+\n \\]\n (\n ( # Reference Link\n [ ]? # Optional space\n \\[[^\\]]*+\\] # Ref name\n )\n | ( # Inline Link\n \\( # Opening paren\n [ \\t]*+ # Optional whitespace\n <?(.*?)>? # URL\n [ \\t]*+ # Optional whitespace\n ( # Optional Title\n (?<title>['\"])\n (.*?)\n \\k<title>\n )?\n \\)\n )\n )\n )\n | (?!(?<=\\S)\\1). # Everything besides\n # style closer\n )++\n (?<=\\S)(?=__\\b|\\*\\*)\\1 # Close\n )\n", + "captures": { + "1": { + "name": "punctuation.definition.bold.markdown" + } + }, + "end": "(?<=\\S)(\\1)", + "name": "markup.bold.markdown" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.raw.markdown" + }, + "3": { + "name": "punctuation.definition.raw.markdown" + } + }, + "match": "(`+)([^`]|(?!(?<!`)\\1(?!`))`)*+(\\1)", + "name": "markup.inline.raw.string.markdown" + }, + { + "match": "(#{1})\\s*(?=[\\S[^#]])(.*?)\\s*(\\s+#+)?$\\n?", + "name": "heading.markdown", + "captures": { + "1": { + "name": "punctuation.definition.heading.markdown" + }, + "2": { + "name": "entity.name.section.markdown" + }, + "3": { + "name": "punctuation.definition.heading.markdown" + } + } + }, + { + "captures": { + "1": { + "name": "punctuation.definition.string.begin.markdown" + }, + "2": { + "name": "string.other.link.title.markdown" + }, + "4": { + "name": "punctuation.definition.string.end.markdown" + }, + "5": { + "name": "punctuation.definition.metadata.markdown" + }, + "6": { + "name": "punctuation.definition.link.markdown" + }, + "7": { + "name": "markup.underline.link.markdown" + }, + "8": { + "name": "punctuation.definition.link.markdown" + }, + "9": { + "name": "string.other.link.description.title.markdown" + }, + "10": { + "name": "punctuation.definition.string.begin.markdown" + }, + "11": { + "name": "punctuation.definition.string.end.markdown" + }, + "12": { + "name": "string.other.link.description.title.markdown" + }, + "13": { + "name": "punctuation.definition.string.begin.markdown" + }, + "14": { + "name": "punctuation.definition.string.end.markdown" + }, + "15": { + "name": "punctuation.definition.metadata.markdown" + } + }, + "match": "(?x)\n (\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])\n # Match the link text.\n (\\() # Opening paren for url\n (<?)(.*?)(>?) # The url\n [ \\t]* # Optional whitespace\n (?:\n ((\\().+?(\\))) # Match title in parens…\n | ((\").+?(\")) # or in quotes.\n )? # Title is optional\n \\s* # Optional whitespace\n (\\))\n", + "name": "meta.link.inline.markdown" + } + ] + }, + { + "name": "comment.block.rust", + "begin": "/\\*", + "end": "\\*/" + }, + { + "name": "comment.line.documentation.rust", + "begin": "//[!/](?=[^/])", + "end": "$", + "patterns": [ + { + "begin": "(?x) (\\*\\b|\\b_)(?=\\S) # Open\n (?=\n (\n <[^>]*+> # HTML tags\n | (?<raw>`+)([^`]|(?!(?<!`)\\k<raw>(?!`))`)*+\\k<raw>\n # Raw\n | \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+ # Escapes\n | \\[\n (\n (?<square> # Named group\n [^\\[\\]\\\\] # Match most chars\n | \\\\. # Escaped chars\n | \\[ \\g<square>*+ \\] # Nested brackets\n )*+\n \\]\n (\n ( # Reference Link\n [ ]? # Optional space\n \\[[^\\]]*+\\] # Ref name\n )\n | ( # Inline Link\n \\( # Opening paren\n [ \\t]*+ # Optional whtiespace\n <?(.*?)>? # URL\n [ \\t]*+ # Optional whtiespace\n ( # Optional Title\n (?<title>['\"])\n (.*?)\n \\k<title>\n )?\n \\)\n )\n )\n )\n | \\1\\1 # Must be bold closer\n | (?!(?<=\\S)\\1). # Everything besides\n # style closer\n )++\n (?<=\\S)(?=_\\b|\\*)\\1 # Close\n )\n", + "captures": { + "1": { + "name": "punctuation.definition.italic.markdown" + } + }, + "end": "(?<=\\S)(\\1)((?!\\1)|(?=\\1\\1))", + "name": "markup.italic.markdown" + }, + { + "begin": "(?x)\n ((?<!\\w)\\*\\*\\b|\\b__)(?=\\S) # Open\n (?=\n (\n <[^>]*+> # HTML tags\n | (?<raw>`+)([^`]|(?!(?<!`)\\k<raw>(?!`))`)*+\\k<raw>\n # Raw\n | \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+ # Escapes\n | \\[\n (\n (?<square> # Named group\n [^\\[\\]\\\\] # Match most chars\n | \\\\. # Escaped chars\n | \\[ \\g<square>*+ \\] # Nested brackets\n )*+\n \\]\n (\n ( # Reference Link\n [ ]? # Optional space\n \\[[^\\]]*+\\] # Ref name\n )\n | ( # Inline Link\n \\( # Opening paren\n [ \\t]*+ # Optional whitespace\n <?(.*?)>? # URL\n [ \\t]*+ # Optional whitespace\n ( # Optional Title\n (?<title>['\"])\n (.*?)\n \\k<title>\n )?\n \\)\n )\n )\n )\n | (?!(?<=\\S)\\1). # Everything besides\n # style closer\n )++\n (?<=\\S)(?=__\\b|\\*\\*)\\1 # Close\n )\n", + "captures": { + "1": { + "name": "punctuation.definition.bold.markdown" + } + }, + "end": "(?<=\\S)(\\1)", + "name": "markup.bold.markdown" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.raw.markdown" + }, + "3": { + "name": "punctuation.definition.raw.markdown" + } + }, + "match": "(`+)([^`]|(?!(?<!`)\\1(?!`))`)*+(\\1)", + "name": "markup.inline.raw.string.markdown" + }, + { + "match": "(#{1})\\s*(?=[\\S[^#]])(.*?)\\s*(\\s+#+)?$\\n?", + "name": "heading.markdown", + "captures": { + "1": { + "name": "punctuation.definition.heading.markdown" + }, + "2": { + "name": "entity.name.section.markdown" + }, + "3": { + "name": "punctuation.definition.heading.markdown" + } + } + }, + { + "captures": { + "1": { + "name": "punctuation.definition.string.begin.markdown" + }, + "2": { + "name": "string.other.link.title.markdown" + }, + "4": { + "name": "punctuation.definition.string.end.markdown" + }, + "5": { + "name": "punctuation.definition.metadata.markdown" + }, + "6": { + "name": "punctuation.definition.link.markdown" + }, + "7": { + "name": "markup.underline.link.markdown" + }, + "8": { + "name": "punctuation.definition.link.markdown" + }, + "9": { + "name": "string.other.link.description.title.markdown" + }, + "10": { + "name": "punctuation.definition.string.begin.markdown" + }, + "11": { + "name": "punctuation.definition.string.end.markdown" + }, + "12": { + "name": "string.other.link.description.title.markdown" + }, + "13": { + "name": "punctuation.definition.string.begin.markdown" + }, + "14": { + "name": "punctuation.definition.string.end.markdown" + }, + "15": { + "name": "punctuation.definition.metadata.markdown" + } + }, + "match": "(?x)\n (\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])\n # Match the link text.\n (\\() # Opening paren for url\n (<?)(.*?)(>?) # The url\n [ \\t]* # Optional whitespace\n (?:\n ((\\().+?(\\))) # Match title in parens…\n | ((\").+?(\")) # or in quotes.\n )? # Title is optional\n \\s* # Optional whitespace\n (\\))\n", + "name": "meta.link.inline.markdown" + } + ] + }, + { + "name": "comment.line.double-slash.rust", + "begin": "//", + "end": "$" + } + ] + }, + "entity": { + "patterns": [ + { + "match": "(?<=fn )([a-zA-Z][a-zA-Z0-9_]+)", + "name": "entity.name.function.rust" + }, + { + "match": "(?!Err|Ok|Some)([a-zA-Z][a-zA-Z0-9_]+)(?=[(])", + "name": "entity.name.function.rust" + }, + { + "match": "(?!Err|Ok|Some)([a-zA-Z]+)(?=[(])", + "name": "entity.name.function.rust" + }, + { + "match": "([a-zA-Z][a-zA-Z0-9_]+)(\\<)(T)(\\>)(?=[(])", + "name": "entity.name.function.rust", + "captures": { + "1": { + "name": "entity.name.function.rust" + }, + "2": { + "name": "punctuation.definition.type.rust" + }, + "3": { + "name": "entity.name.type.generic.rust" + }, + "4": { + "name": "punctuation.definition.type.rust" + } + } + }, + { + "match": "(impl) ([a-zA-Z_][a-zA-Z0-9:_<>]+) (for) ([a-zA-Z_][a-zA-Z0-9_]+) \\{", + "captures": { + "1": { + "name": "storage.type.rust" + }, + "2": { + "name": "entity.name.type.implementation.rust" + }, + "3": { + "name": "storage.modifier.rust" + }, + "4": { + "name": "entity.name.type.rust" + } + } + }, + { + "match": "(impl) ([a-zA-Z_][a-zA-Z0-9:]+)(?!for) \\{", + "captures": { + "1": { + "name": "storage.type.rust" + }, + "2": { + "name": "entity.name.type.rust" + } + } + }, + { + "match": "(?<=\\=) (?!loop)([a-zA-Z][_a-zA-Z0-9:]+)\\s(?=\\{)", + "captures": { + "1": { + "name": "entity.name.type.rust" + } + } + }, + { + "match": "(^\\s+|(Ok)\\()(?!loop)([a-zA-Z][_a-zA-Z0-9:]+)\\s(?=\\{)", + "captures": { + "2": { + "name": "support.constant.core.rust" + }, + "3": { + "name": "entity.name.type.rust" + } + } + }, + { + "match": "(Err|Ok|Some)(?=[(])", + "name": "support.constant.core.rust" + }, + { + "name": "storage.type.rust", + "match": "impl(?=<)" + }, + { + "match": "(mod)\\s([a-zA-Z_]+)", + "captures": { + "1": { + "name": "storage.type.module.rust" + }, + "2": { + "name": "entity.name.type.module.rust" + } + } + }, + { + "match": "\\b(enum|struct|trait|union)\\s+([a-zA-Z_][a-zA-Z0-9_]+)", + "captures": { + "1": { + "name": "storage.type.rust" + }, + "2": { + "name": "entity.name.type.rust" + } + } + }, + { + "begin": "\\b(type)\\s+([a-zA-Z_][a-zA-Z0-9_]*)", + "end": ";", + "beginCaptures": { + "1": { + "name": "storage.type.rust" + }, + "2": { + "name": "entity.name.type.rust" + } + } + } + ] + }, + "operator": { + "patterns": [ + { + "name": "keyword.operator.member-access.rust", + "match": "(\\.)(?=parse)" + }, + { + "name": "keyword.operator.member-access.rust", + "match": "\\s(\\.)\\b" + }, + { + "name": "keyword.operator.member-access.rust", + "match": "\\b(\\.)\\b" + }, + { + "name": "keyword.operator.member-access.rust", + "match": "\\B(\\.)\\b" + }, + { + "name": "keyword.operator.member-access.rust", + "match": "(\\.)(?=to_string)" + }, + { + "name": "keyword.operator.range.rust", + "match": "(\\.\\.)" + }, + { + "name": "keyword.operator.path.rust", + "match": "(\\:\\:)" + }, + { + "name": "keyword.operator.return-type.rust", + "match": "(->)" + }, + { + "name": "keyword.operator.match.rust", + "match": "(=>)" + }, + { + "name": "variable.language.ignored.rust", + "match": "\\b(_)\\b" + }, + { + "name": "keyword.operator.error-propagation.rust", + "match": "(?<=\\))(\\?)" + }, + { + "name": "keyword.operator.glob.rust", + "match": "(?<=::)(\\*)(?=;)" + }, + { + "name": "keyword.operator.sigil.rust", + "match": "[&*](?=[a-zA-Z0-9_\\(\\[\\|\\\"']+)" + }, + { + "name": "keyword.operator.assignment.rust", + "match": "(\\=)" + }, + { + "name": "keyword.operator.assignment.rust", + "match": "\\b(\\+=|-=|/=|\\*=|%=|\\^=|&=|\\|=|<<=|>>=|=)\\b" + }, + { + "name": "keyword.operator.arithmetic.rust", + "match": "(!|\\+|-|/|\\*|%|\\^|\\||<<|>>)" + }, + { + "name": "keyword.operator.comparison.rust", + "match": "(&&|\\|\\||==|!=)" + }, + { + "name": "keyword.operator.comparison.rust", + "match": "\\s(<|>)" + }, + { + "name": "keyword.operator.comparison.rust", + "match": "\\B(<=|>=)\\B" + } + ] + }, + "storage": { + "patterns": [ + { + "name": "storage.modifier.external.rust", + "match": "\\b(extern)\\b" + }, + { + "name": "storage.modifier.mutable.rust", + "match": "\\b(mut)\\b" + }, + { + "name": "storage.modifier.box.rust", + "match": "\\b(box)\\b" + }, + { + "name": "storage.modifier.const.rust", + "match": "\\b(const)\\b" + }, + { + "name": "storage.modifier.visibility.rust", + "match": "\\b(pub)\\b" + }, + { + "name": "storage.modifier.static.rust", + "match": "\\b(static)\\b" + }, + { + "name": "storage.type.module.rust", + "match": "\\b(mod)\\b" + }, + { + "name": "storage.type.function.rust", + "match": "\\b(fn)\\b" + }, + { + "name": "storage.type.rust", + "match": "\\b(let)\\b" + }, + { + "name": "storage.type.rust", + "match": "(impl)(?=<)" + }, + { + "name": "storage.type.rust", + "match": "\\b(enum|impl|struct|trait|union)\\b" + }, + { + "name": "entity.name.lifetime.rust", + "match": "(?<=&)('[a-zA-Z_]+)(?!')" + } + ] + }, + "support": { + "patterns": [ + { + "name": "support.function.builtin.rust", + "match": "\\b(macro_rules|compile_error|format_args|env|option_env|concat_idents|concat|line|column|file|stringify|include|include_str|include_bytes|module_path|cfg)!" + }, + { + "name": "support.function.core.rust", + "match": "\\b(panic|assert|assert_eq|assert_ne|debug_assert|debug_assert_eq|debug_assert_ne|try|write|writeln|unreachable|unimplemented)!" + }, + { + "name": "support.function.std.rust", + "match": "\\b(format|print|println|eprint|eprintln|select|vec)!" + }, + { + "name": "support.function.log.rust", + "match": "\\b(log|error|warn|info|debug|trace|log_enabled)!" + }, + { + "name": "support.constant.core.rust", + "match": "\\b(None|Ok|Err)\\b" + }, + { + "name": "support.constant.core.rust", + "match": "\\b(Some)" + } + ] + }, + "constant": { + "patterns": [ + { + "comment": "Floating point literal (fraction)", + "name": "constant.numeric.float.rust", + "match": "\\b[0-9][0-9_]*\\.[0-9][0-9_]*([eE][+-]?[0-9_]+)?(f32|f64)?\\b" + }, + { + "comment": "Floating point literal (exponent)", + "name": "constant.numeric.float.rust", + "match": "\\b[0-9][0-9_]*(\\.[0-9][0-9_]*)?[eE][+-]?[0-9_]+(f32|f64)?\\b" + }, + { + "comment": "Floating point literal (typed)", + "name": "constant.numeric.float.rust", + "match": "\\b[0-9][0-9_]*(\\.[0-9][0-9_]*)?([eE][+-]?[0-9_]+)?(f32|f64)\\b" + }, + { + "comment": "Integer literal (decimal)", + "name": "constant.numeric.integer.decimal.rust", + "match": "\\b[0-9][0-9_]*([ui](8|16|32|64|128|s|size))?\\b" + }, + { + "comment": "Integer literal (hexadecimal)", + "name": "constant.numeric.integer.hexadecimal.rust", + "match": "\\b0x[a-fA-F0-9_]+([ui](8|16|32|64|128|s|size))?\\b" + }, + { + "comment": "Integer literal (octal)", + "name": "constant.numeric.integer.octal.rust", + "match": "\\b0o[0-7_]+([ui](8|16|32|64|128|s|size))?\\b" + }, + { + "comment": "Integer literal (binary)", + "name": "constant.numeric.integer.binary.rust", + "match": "\\b0b[01_]+([ui](8|16|32|64|128|s|size))?\\b" + }, + { + "name": "constant.language.boolean.rust", + "match": "\\b(true|false)\\b" + } + ] + }, + "keyword": { + "patterns": [ + { + "name": "variable.language.self.rust", + "match": "\\b(self)\\b" + }, + { + "name": "keyword.other.unsafe.rust", + "match": "\\b(unsafe)\\b" + }, + { + "name": "keyword.control.rust", + "match": "\\b(break|continue|else|if|in|for|loop|match|return|while)\\b" + }, + { + "name": "keyword.other.rust", + "match": "\\b(ref|use|super|move)\\b" + }, + { + "name": "keyword.other.where.rust", + "match": "\\b(where)\\b" + }, + { + "name": "keyword.other.as.rust", + "match": "(\\b(as)\\b)" + }, + { + "comment": "Reserved keyword", + "name": "invalid.deprecated.rust", + "match": "\\b(abstract|alignof|become|do|final|macro|offsetof|override|priv|proc|pure|sizeof|typeof|virtual|yield)\\b" + } + ] + }, + "meta": { + "patterns": [ + { + "name": "meta.attribute.rust", + "begin": "#\\!?\\[", + "end": "\\]" + }, + { + "name": "meta.statement.if-let.rust", + "match": "(if) (let)", + "captures": { + "1": { + "name": "keyword.control.rust" + }, + "2": { + "name": "storage.type.rust" + } + } + } + ] + }, + "punctuation": { + "patterns": [ + { + "name": "punctuation.separator.type.rust", + "match": ":\\s+?(?=(&|bool|char|usize|isize|u8|u16|u32|u64|u128|i8|i16|i32|i64|i128|f32|f64|str|Self|Option|Result|String|Box|Vec|Path|PathBuf|HashMap))" + }, + { + "name": "punctuation.terminator.rust", + "match": ";" + }, + { + "name": "punctuation.other.comma.rust", + "match": "," + }, + { + "name": "punctuation.other.paren.rust", + "match": "[)(]" + } + ] + }, + "string": { + "patterns": [ + { + "name": "constant.character.escape.rust", + "match": "\\\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)" + }, + { + "name": "constant.character.rust", + "match": "b?'([^'\\\\]|\\\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.))'" + }, + { + "name": "string.quoted.double.rust", + "begin": "b?\"", + "end": "\"", + "patterns": [ + { + "name": "constant.character.escape.rust", + "match": "\\\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)" + }, + { + "name": "constant.other.placeholder.rust", + "match": "(\\{)([a-zA-Z0-9_?:$.*<>]+)?(\\})" + } + ] + }, + { + "name": "string.quoted.double.raw.rust", + "begin": "b?r(#*)\"", + "end": "\"\\1" + } + ] + }, + "type": { + "patterns": [ + { + "begin": "(\\:\\:{)", + "beginCaptures": { + "1": { + "name": "keyword.operator.path.rust" + } + }, + "end": "}(;)", + "endCaptures": { + "1": { + "name": "keyword.operator.path.rust" + }, + "2": { + "name": "punctuation.terminator.rust" + } + }, + "patterns": [ + { + "name": "punctuation.other.comma.rust", + "match": "," + }, + { + "name": "entity.name.type.rust", + "match": "\\w+" + } + ] + }, + { + "match": "^(extern) (crate) ([_A-Za-z0-9]+)", + "captures": { + "1": { + "name": "storage.modifier.external.rust" + }, + "2": { + "name": "keyword.other.rust" + }, + "3": { + "name": "entity.name.type.rust" + } + } + }, + { + "match": "\\b([A-Za-z][_A-Za-z0-9]+)\\b(?=<[_a-zA-Z']+>)", + "name": "entity.name.type.rust" + }, + { + "match": "([A-Za-z][_A-Za-z0-9]+)(?=::)", + "name": "entity.name.type.mod.rust", + "captures": { + "2": { + "name": "keyword.operator.path.rust" + } + } + }, + { + "match": "((?<=::))([a-zA-Z_]+)", + "captures": { + "1": { + "name": "keyword.operator.path.rust" + }, + "2": { + "name": "entity.name.type.rust" + } + } + }, + { + "name": "storage.type.core.rust", + "match": "\\b(bool|char|usize|isize|u8|u16|u32|u64|u128|i8|i16|i32|i64|i128|f32|f64|str|Self|Option|Result)\\b" + }, + { + "name": "entity.name.type.hashmap.rust", + "match": "HashMap" + }, + { + "match": "(?<=->\\s)(\\w+)", + "captures": { + "1": { + "name": "entity.name.type.rust" + } + } + }, + { + "match": "\\b(T|U)\\b", + "captures": { + "1": { + "name": "entity.name.type.generic.rust" + } + } + }, + { + "name": "support.type.marker.rust", + "match": "\\b(Copy|Send|Sized|Sync)\\b" + }, + { + "name": "support.type.core.rust", + "match": "\\b(Drop|Fn|FnMut|FnOnce|Clone|PartialEq|PartialOrd|Eq|Ord|AsRef|AsMut|Into|From|Default|Iterator|Extend|IntoIterator|DoubleEndedIterator|ExactSizeIterator)\\b" + }, + { + "name": "storage.class.std.rust", + "match": "\\b(Box|String|Vec|Path|PathBuf)\\b" + }, + { + "name": "support.type.std.rust", + "match": "\\b(ToOwned|ToString|FromStr)\\b" + }, + { + "name": "entity.name.type.param.rust", + "begin": "<(?![=<])", + "end": "(?<![-])>", + "beginCaptures": { + "0": { + "name": "punctuation.definition.type.rust" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.type.rust" + } + }, + "patterns": [ + { + "name": "entity.name.type.param.rust", + "begin": "<(?![=<])", + "end": "(?<![-])>", + "beginCaptures": { + "0": { + "name": "punctuation.definition.type.rust" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.type.rust" + } + } + }, + { + "name": "storage.modifier.lifetime.rust", + "match": "'([a-zA-Z_][a-zA-Z0-9_]*)\\b", + "captures": { + "1": { + "name": "entity.name.lifetime.rust" + } + } + }, + { + "match": "&(')([a-zA-Z_][a-zA-Z0-9_]*)\\b", + "captures": { + "1": { + "name": "storage.modifier.lifetime.rust" + }, + "2": { + "name": "entity.name.lifetime.rust" + } + } + }, + { + "name": "storage.type.rust", + "match": "impl" + }, + { + "name": "punctuation.other.comma.rust", + "match": "," + }, + { + "name": "variable.language.ignored.rust", + "match": "\\b(_)\\b" + } + ] + } + ] + }, + "variable": { + "patterns": [ + { + "match": "(let) (mut) ([a-zA-Z_][a-zA-Z0-9_]+)", + "captures": { + "1": { + "name": "storage.type.rust" + }, + "2": { + "name": "storage.modifier.mutable.rust" + }, + "3": { + "name": "variable.other.mutable.rust" + } + } + }, + { + "name": "variable.other.rust", + "match": "(?<!\\:\\s)([a-zA-Z_][a-zA-Z0-9_]*)\\s(?==)" + }, + { + "match": "([a-zA-Z_][a-zA-Z0-9_]+)(?=[:] )", + "captures": { + "1": { + "name": "variable.other.rust" + } + } + }, + { + "match": "(let) (mut) ([a-zA-Z_]+)", + "captures": { + "1": { + "name": "storage.type.rust" + }, + "2": { + "name": "storage.modifier.mutable.rust" + }, + "3": { + "name": "variable.other.mutable.rust" + } + } + }, + { + "match": "(?<!\\:\\s)([a-zA-Z_]\\s)(?==)", + "captures": { + "1": { + "name": "variable.other.rust" + } + } + }, + { + "match": "([a-zA-Z_]+)(?=[:] )", + "captures": { + "1": { + "name": "variable.other.rust" + } + } + }, + { + "match": "(let|pub)\\s([a-zA-Z0-9_]+)(\\:\\s)([a-zA-Z0-9_]+)", + "captures": { + "1": { + "name": "storage.type.rust" + }, + "2": { + "name": "variable.other.rust" + }, + "3": { + "name": "punctuation.separator.type.rust" + }, + "4": { + "name": "entity.name.type.rust" + } + } + }, + { + "match": "^\\s+(return\\s)?(?!self)([a-zA-Z0-9_]+)\\s+$", + "captures": { + "1": { + "name": "keyword.control.rust" + }, + "2": { + "name": "variable.other.return-value.rust" + } + } + }, + { + "match": "([|])(\\w+)([|])", + "captures": { + "1": { + "name": "keyword.operator.rust" + }, + "2": { + "name": "variable.other.map.rust" + }, + "3": { + "name": "keyword.operator.rust" + } + } + }, + { + "match": "(?<=&|\\*)(?!mut|self)([a-zA-Z_]+)", + "captures": { + "1": { + "name": "variable.other.ref.rust" + } + } + } + ] + } + }, + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "rust", + "scopeName": "source.rust", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#constant" + }, + { + "include": "#entity" + }, + { + "include": "#meta" + }, + { + "include": "#punctuation" + }, + { + "include": "#string" + }, + { + "include": "#support" + }, + { + "include": "#type" + }, + { + "include": "#unsorted" + }, + { + "include": "#variable" + }, + { + "include": "#operator" + }, + { + "include": "#keyword" + }, + { + "include": "#storage" + } + ] +} \ No newline at end of file diff --git a/app/rcc/edbee/syntaxfiles/SCSS.tmLanguage b/app/rcc/edbee/syntaxfiles/SCSS.tmLanguage new file mode 100644 index 00000000..030e3212 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/SCSS.tmLanguage @@ -0,0 +1,1986 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>comment</key> + <string>SCSS Version 2 Grammar by Mario "Kuroir" Ricalde (http://kuroir.com)</string> + <key>fileTypes</key> + <array> + <string>scss</string> + <string>css.scss</string> + </array> + <key>foldingStartMarker</key> + <string>\{\s*$</string> + <key>foldingStopMarker</key> + <string>^\s*\}</string> + <key>keyEquivalent</key> + <string>^~S</string> + <key>name</key> + <string>SCSS</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#variable_setting</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_include</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_import</string> + </dict> + <dict> + <key>include</key> + <string>#general</string> + </dict> + <dict> + <key>include</key> + <string>#flow_control</string> + </dict> + <dict> + <key>include</key> + <string>#rules</string> + </dict> + <dict> + <key>include</key> + <string>#property_list</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_mixin</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_media</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_function</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_charset</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_option</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_namespace</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_fontface</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_page</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_keyframes</string> + </dict> + </array> + <key>repository</key> + <dict> + <key>at_rule__</key> + <dict> + <key>comment</key> + <string>Note how all @rules are prefixed.</string> + </dict> + <key>at_rule_charset</key> + <dict> + <key>begin</key> + <string>\s*((@)charset\b)\s*</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.at-rule.charset.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + </dict> + <key>comment</key> + <string>Charset</string> + <key>end</key> + <string>\s*((?=;|$))</string> + <key>name</key> + <string>meta.at-rule.charset.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>include</key> + <string>#string_single</string> + </dict> + <dict> + <key>include</key> + <string>#string_double</string> + </dict> + </array> + </dict> + <key>at_rule_content</key> + <dict> + <key>begin</key> + <string>\s*((@)content\b)\s*</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.content.scss</string> + </dict> + </dict> + <key>end</key> + <string>\s*((?=;))</string> + <key>name</key> + <string>meta.content.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>include</key> + <string>#selectors</string> + </dict> + <dict> + <key>include</key> + <string>#property_values</string> + </dict> + </array> + </dict> + <key>at_rule_each</key> + <dict> + <key>begin</key> + <string>\s*((@)each\b)\s*</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.each.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + </dict> + <key>end</key> + <string>\s*((?=\}))</string> + <key>name</key> + <string>meta.at-rule.each.scss</string> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>\b(in|\,)\b</string> + <key>name</key> + <string>keyword.control.operator</string> + </dict> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>include</key> + <string>#property_values</string> + </dict> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + <key>at_rule_else</key> + <dict> + <key>begin</key> + <string>\s*((@)else(\s*(if)?))\s*</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.else.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + </dict> + <key>end</key> + <string>\s*(?=\{)</string> + <key>name</key> + <string>meta.at-rule.else.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#logical_operators</string> + </dict> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>include</key> + <string>#property_values</string> + </dict> + </array> + </dict> + <key>at_rule_extend</key> + <dict> + <key>begin</key> + <string>\s*((@)extend\b)\s*</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.at-rule.import.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + </dict> + <key>end</key> + <string>\s*(?=\;)</string> + <key>name</key> + <string>meta.at-rule.import.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>include</key> + <string>#selectors</string> + </dict> + <dict> + <key>include</key> + <string>#property_values</string> + </dict> + </array> + </dict> + <key>at_rule_fontface</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>^\s*((@)font-face)\s*(?=\{)</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.at-rule.fontface.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + </dict> + <key>end</key> + <string>\s*(?=\{)</string> + <key>name</key> + <string>meta.at-rule.fontface.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#function_attributes</string> + </dict> + </array> + </dict> + </array> + </dict> + <key>at_rule_for</key> + <dict> + <key>begin</key> + <string>\s*((@)for\b)\s*</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.for.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + </dict> + <key>end</key> + <string>\s*(?=\{)</string> + <key>name</key> + <string>meta.at-rule.for.scss</string> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>(\=\=|\!\=|\<\=|\>\=|\<|\>|from|through)</string> + <key>name</key> + <string>keyword.control.operator</string> + </dict> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>include</key> + <string>#property_values</string> + </dict> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + <key>at_rule_function</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>\s*((@)function\b)\s*</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.at-rule.function.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.function.scss</string> + </dict> + </dict> + <key>comment</key> + <string>Function with Attributes</string> + <key>end</key> + <string>\s*(?=\{)</string> + <key>name</key> + <string>meta.at-rule.function.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#function_attributes</string> + </dict> + </array> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.at-rule.function.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.function.scss</string> + </dict> + </dict> + <key>comment</key> + <string>Simple Function</string> + <key>match</key> + <string>\s*((@)function\b)\s*</string> + <key>name</key> + <string>meta.at-rule.function.scss</string> + </dict> + </array> + </dict> + <key>at_rule_if</key> + <dict> + <key>begin</key> + <string>\s*((@)if\b)\s*</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.if.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + </dict> + <key>end</key> + <string>\s*(?=\{)</string> + <key>name</key> + <string>meta.at-rule.if.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#logical_operators</string> + </dict> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>include</key> + <string>#property_values</string> + </dict> + </array> + </dict> + <key>at_rule_import</key> + <dict> + <key>begin</key> + <string>\s*((@)import\b)\s*</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.at-rule.import.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + </dict> + <key>end</key> + <string>\s*((?=;)|(?=\}))</string> + <key>name</key> + <string>meta.at-rule.import.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>include</key> + <string>#string_single</string> + </dict> + <dict> + <key>include</key> + <string>#string_double</string> + </dict> + <dict> + <key>include</key> + <string>#functions</string> + </dict> + </array> + </dict> + <key>at_rule_include</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>\s*((@)include\b)\s*</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.at-rule.include.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.function.scss</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>entity.name.text.scss</string> + </dict> + </dict> + <key>end</key> + <string>\s*[\)|\s\;]</string> + <key>name</key> + <string>meta.at-rule.include.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#function_attributes</string> + </dict> + <dict> + <key>include</key> + <string>#functions</string> + </dict> + </array> + </dict> + </array> + </dict> + <key>at_rule_keyframes</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>^\s*((@)(\-[\w\-]*\-)?keyframes\b)\s*([\w-]*)</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.at-rule.keyframes.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>entity.name.function.scss</string> + </dict> + </dict> + <key>comment</key> + <string>Keyframes with Attributes</string> + <key>end</key> + <string>\s*(?=\{)</string> + <key>name</key> + <string>meta.at-rule.keyframes.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#function_attributes</string> + </dict> + </array> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.at-rule.keyframes.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>entity.name.function.scss</string> + </dict> + </dict> + <key>comment</key> + <string>Simple Keyframe</string> + <key>match</key> + <string>^\s*((@)(\-[\w\-]*\-)?keyframes\b)\s*([\w-]*)</string> + <key>name</key> + <string>meta.at-rule.keyframes.scss</string> + </dict> + </array> + </dict> + <key>at_rule_media</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>^\s*((@)media)(?=.*?\{)</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.at-rule.media.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>support.constant.media.scss</string> + </dict> + </dict> + <key>end</key> + <string>\s*(?=\{)</string> + <key>name</key> + <string>meta.at-rule.media.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#function_attributes</string> + </dict> + <dict> + <key>include</key> + <string>#functions</string> + </dict> + <dict> + <key>include</key> + <string>#logical_operators</string> + </dict> + </array> + </dict> + </array> + </dict> + <key>at_rule_mixin</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>\s*((@)mixin) ([\w-]*)\s*\(</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.at-rule.mixin.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.function.scss</string> + </dict> + </dict> + <key>comment</key> + <string>Mixin with Attributes</string> + <key>end</key> + <string>\)</string> + <key>name</key> + <string>meta.at-rule.mixin.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#function_attributes</string> + </dict> + </array> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.at-rule.mixin.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.function.scss</string> + </dict> + </dict> + <key>comment</key> + <string>Simple Mixin</string> + <key>match</key> + <string>^\s*((@)mixin) ([\w-]{1,})</string> + <key>name</key> + <string>meta.at-rule.mixin.scss</string> + </dict> + </array> + </dict> + <key>at_rule_namespace</key> + <dict> + <key>begin</key> + <string>\s*((@)namespace) ([\w-]*)\s*</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.at-rule.import.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.function.scss</string> + </dict> + </dict> + <key>comment</key> + <string>Namespace</string> + <key>end</key> + <string>\s*((;)|(?=\}))$</string> + <key>name</key> + <string>meta.at-rule.namespace.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>include</key> + <string>#string_single</string> + </dict> + <dict> + <key>include</key> + <string>#string_double</string> + </dict> + </array> + </dict> + <key>at_rule_option</key> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.at-rule.charset.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + </dict> + <key>comment</key> + <string>Option</string> + <key>match</key> + <string>^\s*((@)option\b)\s*</string> + <key>name</key> + <string>meta.at-rule.option.scss</string> + </dict> + <key>at_rule_page</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>^\s*((@)page) ([\w-]*)</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.at-rule.fontface.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.function.scss</string> + </dict> + </dict> + <key>comment</key> + <string>Page with Attributes</string> + <key>end</key> + <string></string> + <key>name</key> + <string>meta.at-rule.fontface.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#function_attributes</string> + </dict> + </array> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.at-rule.mixin.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.function.scss</string> + </dict> + </dict> + <key>comment</key> + <string>Simple Page</string> + <key>match</key> + <string>^\s*((@)page) ([\w-]{1,})</string> + <key>name</key> + <string>meta.at-rule.mixin.scss</string> + </dict> + </array> + </dict> + <key>at_rule_return</key> + <dict> + <key>begin</key> + <string>\s*((@)(return)\b)</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.return.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + </dict> + <key>end</key> + <string>\s*((?=;))</string> + <key>name</key> + <string>meta.at-rule.return.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>include</key> + <string>#property_values</string> + </dict> + </array> + </dict> + <key>at_rule_warn</key> + <dict> + <key>begin</key> + <string>\s*((@)(warn|debug)\b)\s*</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.warn.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + </dict> + <key>end</key> + <string>\s*(?=\;)</string> + <key>name</key> + <string>meta.at-rule.warn.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>include</key> + <string>#string_double</string> + </dict> + <dict> + <key>include</key> + <string>#string_single</string> + </dict> + </array> + </dict> + <key>at_rule_while</key> + <dict> + <key>begin</key> + <string>\s*((@)while\b)\s*</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.while.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.scss</string> + </dict> + </dict> + <key>end</key> + <string>\s*(?=\})</string> + <key>name</key> + <string>meta.at-rule.while.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#logical_operators</string> + </dict> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>include</key> + <string>#property_values</string> + </dict> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + <key>comment_block</key> + <dict> + <key>begin</key> + <string>\s*/\*\s*</string> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.whitespace.comment.trailing.scss</string> + </dict> + </dict> + <key>comment</key> + <string>Revamped Comment block.</string> + <key>end</key> + <string>(\*/)\s*</string> + <key>name</key> + <string>comment.block.scss</string> + </dict> + <key>comment_line</key> + <dict> + <key>begin</key> + <string>(\s*)//</string> + <key>comment</key> + <string>Revamped</string> + <key>end</key> + <string>$(\s*)</string> + <key>name</key> + <string>comment.line.scss</string> + </dict> + <key>constant_color</key> + <dict> + <key>comment</key> + <string>http://www.w3.org/TR/CSS21/syndata.html#value-def-color</string> + <key>match</key> + <string>\b(aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow)\b</string> + <key>name</key> + <string>support.constant.color.w3c-standard-color-name.scss</string> + </dict> + <key>constant_default</key> + <dict> + <key>match</key> + <string>\!default</string> + <key>name</key> + <string>keyword.other.default.scss</string> + </dict> + <key>constant_deprecated_color</key> + <dict> + <key>comment</key> + <string>These colours are mostly recognised but will not validate. ref: http://www.w3schools.com/css/css_colornames.asp</string> + <key>match</key> + <string>\b(aliceblue|antiquewhite|aquamarine|azure|beige|bisque|blanchedalmond|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|gainsboro|ghostwhite|gold|goldenrod|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|limegreen|linen|magenta|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|oldlace|olivedrab|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|thistle|tomato|turquoise|violet|wheat|whitesmoke|yellowgreen)\b</string> + <key>name</key> + <string>invalid.deprecated.color.w3c-non-standard-color-name.scss</string> + </dict> + <key>constant_font</key> + <dict> + <key>match</key> + <string>(\b(?i:arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace)\b)</string> + <key>name</key> + <string>support.constant.font-name.scss</string> + </dict> + <key>constant_functions</key> + <dict> + <key>begin</key> + <string>([\w-]+)\s*(\()</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>support.function.misc.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.section.function.scss</string> + </dict> + </dict> + <key>end</key> + <string>(\))</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.section.function.scss</string> + </dict> + </dict> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#parameters</string> + </dict> + </array> + </dict> + <key>constant_hex</key> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.scss</string> + </dict> + </dict> + <key>match</key> + <string>#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b</string> + <key>name</key> + <string>constant.other.color.rgb-value.scss</string> + </dict> + <key>constant_important</key> + <dict> + <key>match</key> + <string>\!important</string> + <key>name</key> + <string>keyword.other.important.scss</string> + </dict> + <key>constant_mathematical_symbols</key> + <dict> + <key>match</key> + <string>(\b(\+|\-|\*|/)\b)</string> + <key>name</key> + <string>support.constant.mathematical-symbols.scss</string> + </dict> + <key>constant_number</key> + <dict> + <key>match</key> + <string>[\+|\-]?(\s*)?([0-9]+(\.[0-9]+)?|\.[0-9]+)</string> + <key>name</key> + <string>constant.numeric.scss</string> + </dict> + <key>constant_optional</key> + <dict> + <key>match</key> + <string>\!optional</string> + <key>name</key> + <string>keyword.other.optional.scss</string> + </dict> + <key>constant_property_value</key> + <dict> + <key>match</key> + <string>\b(absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|block|bold|bolder|both|bottom|break-all|break-word|capitalize|center|char|circle|cjk-ideographic|col-resize|collapse|crosshair|dashed|decimal-leading-zero|decimal|default|disabled|disc|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|inactive|inherit|inline-block|inline|inset|inside|inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|keep-all|left|lighter|line-edge|line-through|line|list-item|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|solid|square|static|strict|super|sw-resize|table-footer-group|table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|zero|true|false|vertical|horizontal)\b</string> + <key>name</key> + <string>support.constant.property-value.scss</string> + </dict> + <key>constant_rgb</key> + <dict> + <key>match</key> + <string>(\b0*((1?[0-9]{1,2})|(2([0-4][0-9]|5[0-5])))\s*,\s*)(0*((1?[0-9]{1,2})|(2([0-4][0-9]|5[0-5])))\s*,\s*)(0*((1?[0-9]{1,2})|(2([0-4][0-9]|5[0-5])))\b)</string> + <key>name</key> + <string>constant.other.color.rgb-value.scss</string> + </dict> + <key>constant_rgb_percentage</key> + <dict> + <key>match</key> + <string>\b([0-9]{1,2}|100)\s*%,\s*([0-9]{1,2}|100)\s*%,\s*([0-9]{1,2}|100)\s*%</string> + <key>name</key> + <string>constant.other.color.rgb-percentage.scss</string> + </dict> + <key>constant_sass_functions</key> + <dict> + <key>begin</key> + <string>(headings|stylesheet-url|rgba?|hsla?|ie-hex-str|red|green|blue|alpha|opacity|hue|saturation|lightness|prefixed|prefix|-moz|-svg|-css2|-pie|-webkit|-ms|-o|-khtml|font-(?:files|url)|grid-image|image-(?:width|height|url|color)|sprites?|sprite-(?:map|map-name|file|url|position)|inline-(?:font-files|image)|opposite-position|grad-point|grad-end-position|color-stops|color-stops-in-percentages|grad-color-stops|(?:radial|linear)-(?:gradient|svg-gradient)|opacify|fade-?in|transparentize|fade-?out|lighten|darken|saturate|desaturate|grayscale|adjust-(?:hue|lightness|saturation|color)|scale-(?:lightness|saturation|color)|change-color|spin|complement|invert|mix|-compass-(?:list|space-list|slice|nth|list-size)|blank|compact|nth|first-value-of|join|length|append|nest|append-selector|headers|enumerate|range|percentage|unitless|unit|if|type-of|comparable|elements-of-type|quote|unquote|escape|e|sin|cos|tan|abs|round|ceil|floor|pi|translate(?:X|Y))\s*(\()</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>support.function.misc.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.section.function.scss</string> + </dict> + </dict> + <key>end</key> + <string>(\))</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.section.function.scss</string> + </dict> + </dict> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#parameters</string> + </dict> + </array> + </dict> + <key>constant_unit</key> + <dict> + <key>match</key> + <string>(?<=[\d])(ch|cm|deg|dpi|dpcm|dppx|em|ex|grad|in|mm|ms|pc|pt|px|rad|rem|turn|s|vh|vmin|vw)\b|%</string> + <key>name</key> + <string>keyword.other.unit.scss</string> + </dict> + <key>flow_control</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#at_rule_if</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_else</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_warn</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_for</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_while</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_each</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_return</string> + </dict> + </array> + </dict> + <key>function_attributes</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>:</string> + <key>name</key> + <string>punctuation.definition</string> + </dict> + <dict> + <key>include</key> + <string>#general</string> + </dict> + <dict> + <key>include</key> + <string>#property_values</string> + </dict> + <dict> + <key>comment</key> + <string>We even have error highlighting <3</string> + <key>match</key> + <string>[=\{\}\?\;\@]</string> + <key>name</key> + <string>invalid.illegal</string> + </dict> + </array> + </dict> + <key>functions</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>([\w-]{1,})(\()\s*</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>support.function.misc.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.section.function.scss</string> + </dict> + </dict> + <key>end</key> + <string>(\))</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.section.function.scss</string> + </dict> + </dict> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#parameters</string> + </dict> + </array> + </dict> + <dict> + <key>match</key> + <string>([\w-]{1,})</string> + <key>name</key> + <string>support.function.misc.scss</string> + </dict> + </array> + </dict> + <key>general</key> + <dict> + <key>comment</key> + <string>Stuff that should be everywhere</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>include</key> + <string>#comment_block</string> + </dict> + <dict> + <key>include</key> + <string>#comment_line</string> + </dict> + </array> + </dict> + <key>interpolation</key> + <dict> + <key>begin</key> + <string>#\{</string> + <key>end</key> + <string>\}([A-Za-z/-]*)?</string> + <key>name</key> + <string>variable.interpolation.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#property_values</string> + </dict> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + </array> + </dict> + <key>logical_operators</key> + <dict> + <key>match</key> + <string>\s(\=\=|\!\=|\<\=|\>\=|\<|\>|not|or|and)\s</string> + <key>name</key> + <string>keyword.control.operator</string> + </dict> + <key>media_attributes</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>:</string> + <key>name</key> + <string>punctuation.definition</string> + </dict> + <dict> + <key>include</key> + <string>#general</string> + </dict> + <dict> + <key>include</key> + <string>#property_name</string> + </dict> + <dict> + <key>include</key> + <string>#property_values</string> + </dict> + <dict> + <key>comment</key> + <string>We even have error highlighting <3</string> + <key>match</key> + <string>[=\{\}\?\@]</string> + <key>name</key> + <string>invalid.illegal</string> + </dict> + </array> + </dict> + <key>parameters</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>include</key> + <string>#property_values</string> + </dict> + <dict> + <key>include</key> + <string>#comment_line</string> + </dict> + <dict> + <key>include</key> + <string>#comment_block</string> + </dict> + <dict> + <key>match</key> + <string>[^'",) \t]+</string> + <key>name</key> + <string>variable.parameter.url.scss</string> + </dict> + <dict> + <key>match</key> + <string>,</string> + <key>name</key> + <string>punctuation.scss</string> + </dict> + </array> + </dict> + <key>properties</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>(?<![-a-z])(?=[-a-z])</string> + <key>end</key> + <string>$|(?![-a-z])</string> + <key>name</key> + <string>meta.property-name.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#property_names</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_include</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(:)\s*(?!(\s*{))</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.separator.key-value.scss</string> + </dict> + </dict> + <key>comment</key> + <string>Kuroir: fixed nested elements for sass.</string> + <key>end</key> + <string>\s*(;|(?=\}))</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.terminator.rule.scss</string> + </dict> + </dict> + <key>name</key> + <string>meta.property-value.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#general</string> + </dict> + <dict> + <key>include</key> + <string>#property_values</string> + </dict> + </array> + </dict> + </array> + </dict> + <key>property_list</key> + <dict> + <key>begin</key> + <string>\{</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.section.property-list.begin.scss</string> + </dict> + </dict> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.section.property-list.scss</string> + </dict> + </dict> + <key>end</key> + <string>\}</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.section.property-list.end.scss</string> + </dict> + </dict> + <key>name</key> + <string>meta.property-list.scss</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#flow_control</string> + </dict> + <dict> + <key>include</key> + <string>#rules</string> + </dict> + <dict> + <key>include</key> + <string>#properties</string> + </dict> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + <key>property_name</key> + <dict> + <key>comment</key> + <string>Reversal order is important; KEEP IT. Also when adding new properties add them to the error checker below!</string> + <key>match</key> + <string>\b(-webkit-[A-Za-z]+|-moz-[A-Za-z]+|-o-[A-Za-z]+|-ms-[A-Za-z]+|-khtml-[A-Za-z]+|[0-9]{1,3}\%|zoom|z-index|y|x|wrap|word-wrap|word-spacing|word-break|word|width|widows|white-space-collapse|white-space|white|weight|volume|voice-volume|voice-stress|voice-rate|voice-pitch-range|voice-pitch|voice-family|voice-duration|voice-balance|voice|visibility|vertical-align|variant|user-select|up|unicode-bidi|unicode|trim|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform|top-width|top-style|top-right-radius|top-left-radius|top-color|top|timing-function|text-wrap|text-transform|text-shadow|text-replace|text-outline|text-justify|text-indent|text-height|text-emphasis|text-decoration|text-align-last|text-align|text|target-position|target-new|target-name|target|table-layout|tab-size|style-type|style-position|style-image|style|string-set|stretch|stress|stacking-strategy|stacking-shift|stacking-ruby|stacking|src|speed|speech-rate|speech|speak-punctuation|speak-numeral|speak-header|speak|span|spacing|space-collapse|space|sizing|size-adjust|size|shadow|respond-to|rule-width|rule-style|rule-color|rule|ruby-span|ruby-position|ruby-overhang|ruby-align|ruby|rows|rotation-point|rotation|role|right-width|right-style|right-color|right|richness|rest-before|rest-after|rest|resource|resolution|resize|reset|replace|repeat|rendering-intent|rate|radius|quotes|punctuation-trim|punctuation|property|profile|presentation-level|presentation|position|pointer-events|point|play-state|play-during|play-count|pitch-range|pitch|phonemes|pause-before|pause-after|pause|page-policy|page-break-inside|page-break-before|page-break-after|page|padding-top|padding-right|padding-left|padding-bottom|padding|pack|overhang|overflow-y|overflow-x|overflow-style|overflow|outline-width|outline-style|outline-offset|outline-color|outline|orphans|origin|orientation|orient|ordinal-group|opacity|offset|numeral|new|nav-up|nav-right|nav-left|nav-index|nav-down|nav|name|move-to|model|min-width|min-height|min|max-width|max-height|max|marquee-style|marquee-speed|marquee-play-count|marquee-direction|marquee|marks|mark-before|mark-after|mark|margin-top|margin-right|margin-left|margin-bottom|margin|mask-image|list-style-type|list-style-position|list-style-image|list-style|list|lines|line-stacking-strategy|line-stacking-shift|line-stacking-ruby|line-stacking|line-height|line|level|letter-spacing|length|left-width|left-style|left-color|left|label|justify|iteration-count|inline-box-align|initial-value|initial-size|initial-before-align|initial-before-adjust|initial-after-align|initial-after-adjust|index|indent|increment|image-resolution|image-orientation|image|icon|hyphens|hyphenate-resource|hyphenate-lines|hyphenate-character|hyphenate-before|hyphenate-after|hyphenate|height|header|hanging-punctuation|grid-rows|grid-columns|grid|gap|font-weight|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-family|font|float-offset|float|flex-group|flex|fit-position|fit|fill|filter|family|empty-cells|emphasis|elevation|duration|drop-initial-value|drop-initial-size|drop-initial-before-align|drop-initial-before-adjust|drop-initial-after-align|drop-initial-after-adjust|drop|down|dominant-baseline|display-role|display-model|display|direction|delay|decoration-break|decoration|cursor|cue-before|cue-after|cue|crop|counter-reset|counter-increment|counter|count|content|columns|column-width|column-span|column-rule-width|column-rule-style|column-rule-color|column-rule|column-gap|column-fill|column-count|column-break-before|column-break-after|column|color-profile|color|collapse|clip|clear|character|caption-side|break-inside|break-before|break-after|break|box-sizing|box-shadow|box-pack|box-orient|box-ordinal-group|box-lines|box-flex-group|box-flex|box-direction|box-decoration-break|box-align|box|bottom-width|bottom-style|bottom-right-radius|bottom-left-radius|bottom-color|bottom|border-width|border-top-width|border-top-style|border-top-right-radius|border-top-left-radius|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-radius|border-length|border-left-width|border-left-style|border-left-color|border-left|border-image|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-right-radius|border-bottom-left-radius|border-bottom-color|border-bottom|border|bookmark-target|bookmark-level|bookmark-label|bookmark|binding|bidi|before|baseline-shift|baseline|balance|background-size|background-repeat|background-position|background-origin|background-image|background-color|background-clip|background-break|background-attachment|background|azimuth|attachment|appearance|animation-timing-function|animation-play-state|animation-name|animation-iteration-count|animation-duration|animation-direction|animation-delay|animation|alignment-baseline|alignment-adjust|alignment|align-last|align|after|adjust)\b</string> + <key>name</key> + <string>support.type.property-name.scss</string> + </dict> + <key>property_name_error</key> + <dict> + <key>match</key> + <string>(?<![a-z-])(?!-(top|right|left|bottom|color|radius|last|inside|width|before|after|value|size|type|position|style|image|strategy|shift|align|adjust)\b|-webkit-[A-Za-z]+\b|-moz-[A-Za-z]+\b|-o-[A-Za-z]+\b|-ms-[A-Za-z]+\b|-khtml-[A-Za-z]+\b|z-index\b|[0-9]{1,3}\%\b|zoom\b|y\b|x\b|wrap\b|word-wrap\b|word-spacing\b|word-break\b|word\b|width\b|widows\b|white-space-collapse\b|white-space\b|white\b|weight\b|volume\b|voice-volume\b|voice-stress\b|voice-rate\b|voice-pitch-range\b|voice-pitch\b|voice-family\b|voice-duration\b|voice-balance\b|voice\b|visibility\b|vertical-align\b|variant\b|user-select\b|up\b|unicode-bidi\b|unicode\b|u\b|tt\b|trim\b|transition-timing-function\b|transition-property\b|transition-duration\b|transition-delay\b|transition\b|transform\b|top-width\b|top-style\b|top-right-radius\b|top-left-radius\b|top-color\b|top\b|timing-function\b|text-wrap\b|text-transform\b|text-shadow\b|text-replace\b|text-outline\b|text-justify\b|text-indent\b|text-height\b|text-emphasis\b|text-decoration\b|text-align-last\b|text-align\b|text\b|target-position\b|target-new\b|target-name\b|target\b|table-layout\b|tab-size\b|style-type\b|style-position\b|style-image\b|style\b|string-set\b|strike\b|stretch\b|stress\b|stacking-strategy\b|stacking-shift\b|stacking-ruby\b|stacking\b|src\b|speed\b|speech-rate\b|speech\b|speak-punctuation\b|speak-numeral\b|speak-header\b|speak\b|span\b|spacing\b|space-collapse\b|space\b|sizing\b|size-adjust\b|size\b|shadow\b|s\b|respond-to\b|rule-width\b|rule-style\b|rule-color\b|rule\b|ruby-span\b|ruby-position\b|ruby-overhang\b|ruby-align\b|ruby\b|rows\b|rotation-point\b|rotation\b|role\b|right-width\b|right-style\b|right-color\b|right\b|richness\b|rest-before\b|rest-after\b|rest\b|resource\b|resolution\b|resize\b|reset\b|replace\b|repeat\b|rendering-intent\b|rate\b|radius\b|quotes\b|punctuation-trim\b|punctuation\b|property\b|profile\b|presentation-level\b|presentation\b|position\b|pointer-events\b|point\b|play-state\b|play-during\b|play-count\b|pitch-range\b|pitch\b|phonemes\b|pause-before\b|pause-after\b|pause\b|page-policy\b|page-break-inside\b|page-break-before\b|page-break-after\b|page\b|padding-top\b|padding-right\b|padding-left\b|padding-bottom\b|padding\b|pack\b|overhang\b|overflow-y\b|overflow-x\b|overflow-style\b|overflow\b|outline-width\b|outline-style\b|outline-offset\b|outline-color\b|outline\b|orphans\b|origin\b|orientation\b|orient\b|ordinal-group\b|opacity\b|offset\b|numeral\b|new\b|nav-up\b|nav-right\b|nav-left\b|nav-index\b|nav-down\b|nav\b|name\b|move-to\b|model\b|min-width\b|min-height\b|min\b|max-width\b|max-height\b|max\b|marquee-style\b|marquee-speed\b|marquee-play-count\b|marquee-direction\b|marquee\b|marks\b|mark-before\b|mark-after\b|mark\b|margin-top\b|margin-right\b|margin-left\b|margin-bottom\b|margin\b|mask-image\b|list-style-type\b|list-style-position\b|list-style-image\b|list-style\b|list\b|lines\b|line-stacking-strategy\b|line-stacking-shift\b|line-stacking-ruby\b|line-stacking\b|line-height\b|line\b|level\b|letter-spacing\b|length\b|left-width\b|left-style\b|left-color\b|left\b|label\b|justify\b|iteration-count\b|inline-box-align\b|initial-value\b|initial-size\b|initial-before-align\b|initial-before-adjust\b|initial-after-align\b|initial-after-adjust\b|index\b|indent\b|increment\b|image-resolution\b|image-orientation\b|image\b|icon\b|hyphens\b|hyphenate-resource\b|hyphenate-lines\b|hyphenate-character\b|hyphenate-before\b|hyphenate-after\b|hyphenate\b|height\b|header\b|hanging-punctuation\b|grid-rows\b|grid-columns\b|grid\b|gap\b|font-weight\b|font-variant\b|font-style\b|font-stretch\b|font-size-adjust\b|font-size\b|font-family\b|font\b|float-offset\b|float\b|flex-group\b|flex\b|fit-position\b|fit\b|fill\b|filter\b|family\b|empty-cells\b|emphasis\b|elevation\b|duration\b|drop-initial-value\b|drop-initial-size\b|drop-initial-before-align\b|drop-initial-before-adjust\b|drop-initial-after-align\b|drop-initial-after-adjust\b|drop\b|down\b|dominant-baseline\b|display-role\b|display-model\b|display\b|direction\b|delay\b|decoration-break\b|decoration\b|cursor\b|cue-before\b|cue-after\b|cue\b|crop\b|counter-reset\b|counter-increment\b|counter\b|count\b|content\b|columns\b|column-width\b|column-span\b|column-rule-width\b|column-rule-style\b|column-rule-color\b|column-rule\b|column-gap\b|column-fill\b|column-count\b|column-break-before\b|column-break-after\b|column\b|color-profile\b|color\b|collapse\b|clip\b|clear\b|character\b|center\b|caption-side\b|break-inside\b|break-before\b|break-after\b|break\b|box-sizing\b|box-shadow\b|box-pack\b|box-orient\b|box-ordinal-group\b|box-lines\b|box-flex-group\b|box-flex\b|box-direction\b|box-decoration-break\b|box-align\b|box\b|bottom-width\b|bottom-style\b|bottom-right-radius\b|bottom-left-radius\b|bottom-color\b|bottom\b|border-width\b|border-top-width\b|border-top-style\b|border-top-right-radius\b|border-top-left-radius\b|border-top-color\b|border-top\b|border-style\b|border-spacing\b|border-right-width\b|border-right-style\b|border-right-color\b|border-right\b|border-radius\b|border-length\b|border-left-width\b|border-left-style\b|border-left-color\b|border-left\b|border-image\b|border-color\b|border-collapse\b|border-bottom-width\b|border-bottom-style\b|border-bottom-right-radius\b|border-bottom-left-radius\b|border-bottom-color\b|border-bottom\b|border\b|bookmark-target\b|bookmark-level\b|bookmark-label\b|bookmark\b|binding\b|bidi\b|big\b|before\b|baseline-shift\b|baseline\b|balance\b|background-size\b|background-repeat\b|background-position\b|background-origin\b|background-image\b|background-color\b|background-clip\b|background-break\b|background-attachment\b|background\b|azimuth\b|attachment\b|applet\b|appearance\b|animation-timing-function\b|animation-play-state\b|animation-name\b|animation-iteration-count\b|animation-duration\b|animation-direction\b|animation-delay\b|animation\b|alignment-baseline\b|alignment-adjust\b|alignment\b|align-last\b|align\b|after\b|adjust\b|acronym\b)[a-z\-\_]+</string> + <key>name</key> + <string>invalid.illegal</string> + </dict> + <key>property_names</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#property_name</string> + </dict> + <dict> + <key>include</key> + <string>#property_name_error</string> + </dict> + </array> + </dict> + <key>property_values</key> + <dict> + <key>comment</key> + <string>Stuff that should only be available on values.</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#string_single</string> + </dict> + <dict> + <key>include</key> + <string>#string_double</string> + </dict> + <dict> + <key>include</key> + <string>#constant_functions</string> + </dict> + <dict> + <key>include</key> + <string>#constant_sass_functions</string> + </dict> + <dict> + <key>include</key> + <string>#constant_hex</string> + </dict> + <dict> + <key>include</key> + <string>#constant_rgb</string> + </dict> + <dict> + <key>include</key> + <string>#constant_rgb_percentage</string> + </dict> + <dict> + <key>include</key> + <string>#constant_important</string> + </dict> + <dict> + <key>include</key> + <string>#constant_default</string> + </dict> + <dict> + <key>include</key> + <string>#constant_optional</string> + </dict> + <dict> + <key>include</key> + <string>#constant_unit</string> + </dict> + <dict> + <key>include</key> + <string>#constant_property_value</string> + </dict> + <dict> + <key>include</key> + <string>#constant_number</string> + </dict> + <dict> + <key>include</key> + <string>#constant_font</string> + </dict> + <dict> + <key>include</key> + <string>#constant_color</string> + </dict> + <dict> + <key>include</key> + <string>#constant_deprecated_color</string> + </dict> + <dict> + <key>include</key> + <string>#constant_mathematical_symbols</string> + </dict> + </array> + </dict> + <key>rules</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#general</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_extend</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_content</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_include</string> + </dict> + <dict> + <key>include</key> + <string>#at_rule_media</string> + </dict> + <dict> + <key>include</key> + <string>#selectors</string> + </dict> + </array> + </dict> + <key>selector_attribute</key> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.entity.scss</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.other.attribute-name.attribute.scss</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.separator.operator.scss</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>string.unquoted.attribute-value.scss</string> + </dict> + <key>5</key> + <dict> + <key>name</key> + <string>string.quoted.double.attribute-value.scss</string> + </dict> + <key>6</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.scss</string> + </dict> + <key>7</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.scss</string> + </dict> + </dict> + <key>match</key> + <string>(?i)(\[)\s*(-?[_a-z\\[[:^ascii:]]][_a-z0-9\-\\[[:^ascii:]]]*)(?:\s*([~|^$*]?=)\s*(?:(-?[_a-z\\[[:^ascii:]]][_a-z0-9\-\\[[:^ascii:]]]*)|((?>(['"])(?:[^\\]|\\.)*?(\6)))))?\s*(\])</string> + <key>name</key> + <string>meta.attribute-selector.scss</string> + </dict> + <key>selector_class</key> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.entity.css</string> + </dict> + </dict> + <key>match</key> + <string>(\.)[a-zA-Z0-9_-]+</string> + <key>name</key> + <string>entity.other.attribute-name.class.css</string> + </dict> + <key>selector_entities</key> + <dict> + <key>match</key> + <string>\b(a|abbr|acronym|address|area|article|aside|applet|audio|b|base|bdo|big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|li|link|main|map|mark|menu|meta|meter|nav|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|small|source|span|strike|strong|style|sub|summary|sup|svg|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|u|ul|var|video)\b</string> + <key>name</key> + <string>entity.name.tag.scss</string> + </dict> + <key>selector_id</key> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuationctuation.definition.entity.css</string> + </dict> + </dict> + <key>match</key> + <string>(#)[a-zA-Z][a-zA-Z0-9_-]*</string> + <key>name</key> + <string>entity.other.attribute-name.id.css</string> + </dict> + <key>selector_placeholder</key> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.entity.scss</string> + </dict> + </dict> + <key>match</key> + <string>(\%)[a-zA-Z0-9_-]+</string> + <key>name</key> + <string>entity.other.attribute-name.placeholder.scss</string> + </dict> + <key>selector_pseudo_class</key> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.entity.css</string> + </dict> + </dict> + <key>match</key> + <string>(:)\b(link|visited|hover|active|focus|target|lang|disabled|enabled|checked|indeterminate|root|nth-child()|nth-last-child()|nth-of-type()|nth-last-of-type()|first-child|last-child|first-of-type|last-of-type|only-child|only-of-type|empty|not|valid|invalid)(\([0-9A-Za-z]*\))?</string> + <key>name</key> + <string>entity.other.attribute-name.pseudo-class.css</string> + </dict> + <key>selector_pseudo_element</key> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.entity.css</string> + </dict> + </dict> + <key>match</key> + <string>(:+)\b(after|before|first-letter|first-line|selection)\b</string> + <key>name</key> + <string>entity.other.attribute-name.pseudo-element.css</string> + </dict> + <key>selectors</key> + <dict> + <key>comment</key> + <string>Stuff for Selectors.</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#selector_entities</string> + </dict> + <dict> + <key>include</key> + <string>#selector_class</string> + </dict> + <dict> + <key>include</key> + <string>#selector_id</string> + </dict> + <dict> + <key>include</key> + <string>#selector_pseudo_class</string> + </dict> + <dict> + <key>include</key> + <string>#tag_wildcard</string> + </dict> + <dict> + <key>include</key> + <string>#tag_parent_reference</string> + </dict> + <dict> + <key>include</key> + <string>#selector_pseudo_element</string> + </dict> + <dict> + <key>include</key> + <string>#selector_attribute</string> + </dict> + <dict> + <key>include</key> + <string>#selector_placeholder</string> + </dict> + </array> + </dict> + <key>string_double</key> + <dict> + <key>begin</key> + <string>"</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.scss</string> + </dict> + </dict> + <key>end</key> + <string>"</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.scss</string> + </dict> + </dict> + <key>name</key> + <string>string.quoted.double.scss</string> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>\\.</string> + <key>name</key> + <string>constant.character.escape.scss</string> + </dict> + <dict> + <key>include</key> + <string>#interpolation</string> + </dict> + </array> + </dict> + <key>string_single</key> + <dict> + <key>begin</key> + <string>'</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.scss</string> + </dict> + </dict> + <key>end</key> + <string>'</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.scss</string> + </dict> + </dict> + <key>name</key> + <string>string.quoted.single.scss</string> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>\\.</string> + <key>name</key> + <string>constant.character.escape.scss</string> + </dict> + </array> + </dict> + <key>tag_parent_reference</key> + <dict> + <key>match</key> + <string>\&</string> + <key>name</key> + <string>entity.name.tag.reference.scss</string> + </dict> + <key>tag_wildcard</key> + <dict> + <key>match</key> + <string>\*</string> + <key>name</key> + <string>entity.name.tag.wildcard.scss</string> + </dict> + <key>variable</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#variables</string> + </dict> + <dict> + <key>include</key> + <string>#interpolation</string> + </dict> + </array> + </dict> + <key>variable_setting</key> + <dict> + <key>begin</key> + <string>\s*(\$[A-Za-z0-9_-]+\b)\s*(\:)\s*</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>variable</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation</string> + </dict> + </dict> + <key>end</key> + <string>\s*(?=\;)</string> + <key>name</key> + <string>meta.set.variable</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#property_values</string> + </dict> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + </array> + </dict> + <key>variables</key> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>variable.scss</string> + </dict> + </dict> + <key>match</key> + <string>\s*(\$[A-Za-z0-9_-]+\b)\s*</string> + <key>name</key> + <string>variable.scss</string> + </dict> + </dict> + <key>scopeName</key> + <string>source.css, source.scss</string> + <key>uuid</key> + <string>3D9ADE5E-ADC5-460F-97B3-B61EF5A18273</string> +</dict> +</plist> diff --git a/app/rcc/edbee/syntaxfiles/SQL.tmLanguage b/app/rcc/edbee/syntaxfiles/SQL.tmLanguage new file mode 100644 index 00000000..3c3af426 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/SQL.tmLanguage @@ -0,0 +1,706 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>fileTypes</key> + <array> + <string>sql</string> + <string>ddl</string> + <string>dml</string> + </array> + <key>foldingStartMarker</key> + <string>\s*\(\s*$</string> + <key>foldingStopMarker</key> + <string>^\s*\)</string> + <key>keyEquivalent</key> + <string>^~S</string> + <key>name</key> + <string>SQL</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#comments</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.other.create.sql</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>keyword.other.sql</string> + </dict> + <key>5</key> + <dict> + <key>name</key> + <string>entity.name.function.sql</string> + </dict> + </dict> + <key>match</key> + <string>(?i:^\s*(create)\s+(aggregate|conversion|database|domain|function|group|(unique\s+)?index|language|operator class|operator|rule|schema|sequence|table|tablespace|trigger|type|user|view)\s+)(['"`]?)(\w+)\4</string> + <key>name</key> + <string>meta.create.sql</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.other.create.sql</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>keyword.other.sql</string> + </dict> + </dict> + <key>match</key> + <string>(?i:^\s*(drop)\s+(aggregate|conversion|database|domain|function|group|index|language|operator class|operator|rule|schema|sequence|table|tablespace|trigger|type|user|view))</string> + <key>name</key> + <string>meta.drop.sql</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.other.create.sql</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>keyword.other.table.sql</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.function.sql</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>keyword.other.cascade.sql</string> + </dict> + </dict> + <key>match</key> + <string>(?i:\s*(drop)\s+(table)\s+(\w+)(\s+cascade)?\b)</string> + <key>name</key> + <string>meta.drop.sql</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.other.create.sql</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>keyword.other.table.sql</string> + </dict> + </dict> + <key>match</key> + <string>(?i:^\s*(alter)\s+(aggregate|conversion|database|domain|function|group|index|language|operator class|operator|rule|schema|sequence|table|tablespace|trigger|type|user|view)\s+)</string> + <key>name</key> + <string>meta.alter.sql</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>storage.type.sql</string> + </dict> + <key>10</key> + <dict> + <key>name</key> + <string>constant.numeric.sql</string> + </dict> + <key>11</key> + <dict> + <key>name</key> + <string>storage.type.sql</string> + </dict> + <key>12</key> + <dict> + <key>name</key> + <string>storage.type.sql</string> + </dict> + <key>13</key> + <dict> + <key>name</key> + <string>storage.type.sql</string> + </dict> + <key>14</key> + <dict> + <key>name</key> + <string>constant.numeric.sql</string> + </dict> + <key>15</key> + <dict> + <key>name</key> + <string>storage.type.sql</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>storage.type.sql</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>constant.numeric.sql</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>storage.type.sql</string> + </dict> + <key>5</key> + <dict> + <key>name</key> + <string>constant.numeric.sql</string> + </dict> + <key>6</key> + <dict> + <key>name</key> + <string>storage.type.sql</string> + </dict> + <key>7</key> + <dict> + <key>name</key> + <string>constant.numeric.sql</string> + </dict> + <key>8</key> + <dict> + <key>name</key> + <string>constant.numeric.sql</string> + </dict> + <key>9</key> + <dict> + <key>name</key> + <string>storage.type.sql</string> + </dict> + </dict> + <key>match</key> + <string>(?xi) + + # normal stuff, capture 1 + \b(bigint|bigserial|bit|boolean|box|bytea|cidr|circle|date|double\sprecision|inet|int|integer|line|lseg|macaddr|money|oid|path|point|polygon|real|serial|smallint|sysdate|text)\b + + # numeric suffix, capture 2 + 3i + |\b(bit\svarying|character\s(?:varying)?|tinyint|var\schar|float|interval)\((\d+)\) + + # optional numeric suffix, capture 4 + 5i + |\b(char|number|varchar\d?)\b(?:\((\d+)\))? + + # special case, capture 6 + 7i + 8i + |\b(numeric)\b(?:\((\d+),(\d+)\))? + + # special case, captures 9, 10i, 11 + |\b(times)(?:\((\d+)\))(\swithoutstimeszone\b)? + + # special case, captures 12, 13, 14i, 15 + |\b(timestamp)(?:(s)\((\d+)\)(\swithoutstimeszone\b)?)? + + </string> + </dict> + <dict> + <key>match</key> + <string>(?i:\b((?:primary|foreign)\s+key|references|on\sdelete(\s+cascade)?|check|constraint)\b)</string> + <key>name</key> + <string>storage.modifier.sql</string> + </dict> + <dict> + <key>match</key> + <string>\b\d+\b</string> + <key>name</key> + <string>constant.numeric.sql</string> + </dict> + <dict> + <key>match</key> + <string>(?i:\b(select(\s+distinct)?|insert\s+(ignore\s+)?into|update|delete|from|set|where|group\sby|or|like|and|union(\s+all)?|having|order\sby|limit|(inner|cross)\s+join|straight_join|(left|right)(\s+outer)?\s+join|natural(\s+(left|right)(\s+outer)?)?\s+join)\b)</string> + <key>name</key> + <string>keyword.other.DML.sql</string> + </dict> + <dict> + <key>match</key> + <string>(?i:\b(on|((is\s+)?not\s+)?null)\b)</string> + <key>name</key> + <string>keyword.other.DDL.create.II.sql</string> + </dict> + <dict> + <key>match</key> + <string>(?i:\bvalues\b)</string> + <key>name</key> + <string>keyword.other.DML.II.sql</string> + </dict> + <dict> + <key>match</key> + <string>(?i:\b(begin(\s+work)?|start\s+transaction|commit(\s+work)?|rollback(\s+work)?)\b)</string> + <key>name</key> + <string>keyword.other.LUW.sql</string> + </dict> + <dict> + <key>match</key> + <string>(?i:\b(grant(\swith\sgrant\soption)?|revoke)\b)</string> + <key>name</key> + <string>keyword.other.authorization.sql</string> + </dict> + <dict> + <key>match</key> + <string>(?i:\bin\b)</string> + <key>name</key> + <string>keyword.other.data-integrity.sql</string> + </dict> + <dict> + <key>match</key> + <string>(?i:^\s*(comment\s+on\s+(table|column|aggregate|constraint|database|domain|function|index|operator|rule|schema|sequence|trigger|type|view))\s+.*?\s+(is)\s+)</string> + <key>name</key> + <string>keyword.other.object-comments.sql</string> + </dict> + <dict> + <key>match</key> + <string>(?i)\bAS\b</string> + <key>name</key> + <string>keyword.other.alias.sql</string> + </dict> + <dict> + <key>match</key> + <string>(?i)\b(DESC|ASC)\b</string> + <key>name</key> + <string>keyword.other.order.sql</string> + </dict> + <dict> + <key>match</key> + <string>\*</string> + <key>name</key> + <string>keyword.operator.star.sql</string> + </dict> + <dict> + <key>match</key> + <string>[!<>]?=|<>|<|></string> + <key>name</key> + <string>keyword.operator.comparison.sql</string> + </dict> + <dict> + <key>match</key> + <string>-|\+|/</string> + <key>name</key> + <string>keyword.operator.math.sql</string> + </dict> + <dict> + <key>match</key> + <string>\|\|</string> + <key>name</key> + <string>keyword.operator.concatenator.sql</string> + </dict> + <dict> + <key>comment</key> + <string>List of SQL99 built-in functions from http://www.oreilly.com/catalog/sqlnut/chapter/ch04.html</string> + <key>match</key> + <string>(?i)\b(CURRENT_(DATE|TIME(STAMP)?|USER)|(SESSION|SYSTEM)_USER)\b</string> + <key>name</key> + <string>support.function.scalar.sql</string> + </dict> + <dict> + <key>comment</key> + <string>List of SQL99 built-in functions from http://www.oreilly.com/catalog/sqlnut/chapter/ch04.html</string> + <key>match</key> + <string>(?i)\b(AVG|COUNT|MIN|MAX|SUM)(?=\s*\()</string> + <key>name</key> + <string>support.function.aggregate.sql</string> + </dict> + <dict> + <key>match</key> + <string>(?i)\b(CONCATENATE|CONVERT|LOWER|SUBSTRING|TRANSLATE|TRIM|UPPER)\b</string> + <key>name</key> + <string>support.function.string.sql</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>constant.other.database-name.sql</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>constant.other.table-name.sql</string> + </dict> + </dict> + <key>match</key> + <string>\b(\w+?)\.(\w+)\b</string> + <!-- <string>(\w+?)\.(\w+)</string> --> + </dict> + <dict> + <key>include</key> + <string>#strings</string> + </dict> + <dict> + <key>include</key> + <string>#regexps</string> + </dict> + </array> + <key>repository</key> + <dict> + <key>comments</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.comment.sql</string> + </dict> + </dict> + <key>match</key> + <string>(--).*$\n?</string> + <key>name</key> + <string>comment.line.double-dash.sql</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.comment.sql</string> + </dict> + </dict> + <key>match</key> + <string>(#).*$\n?</string> + <key>name</key> + <string>comment.line.number-sign.sql</string> + </dict> + <dict> + <key>begin</key> + <string>/\*</string> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.comment.sql</string> + </dict> + </dict> + <key>end</key> + <string>\*/</string> + <key>name</key> + <string>comment.block.c</string> + </dict> + </array> + </dict> + <key>regexps</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>/(?=\S.*/)</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.sql</string> + </dict> + </dict> + <key>end</key> + <string>/</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.sql</string> + </dict> + </dict> + <key>name</key> + <string>string.regexp.sql</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#string_interpolation</string> + </dict> + <dict> + <key>match</key> + <string>\\/</string> + <key>name</key> + <string>constant.character.escape.slash.sql</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>%r\{</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.sql</string> + </dict> + </dict> + <key>comment</key> + <string>We should probably handle nested bracket pairs!?! -- Allan</string> + <key>end</key> + <string>\}</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.sql</string> + </dict> + </dict> + <key>name</key> + <string>string.regexp.modr.sql</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#string_interpolation</string> + </dict> + </array> + </dict> + </array> + </dict> + <key>string_escape</key> + <dict> + <key>match</key> + <string>\\.</string> + <key>name</key> + <string>constant.character.escape.sql</string> + </dict> + <key>string_interpolation</key> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.sql</string> + </dict> + </dict> + <key>match</key> + <string>(#\{)([^\}]*)(\})</string> + <key>name</key> + <string>string.interpolated.sql</string> + </dict> + <key>strings</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.sql</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.sql</string> + </dict> + </dict> + <key>comment</key> + <string>this is faster than the next begin/end rule since sub-pattern will match till end-of-line and SQL files tend to have very long lines.</string> + <key>match</key> + <string>(')[^'\\]*(')</string> + <key>name</key> + <string>string.quoted.single.sql</string> + </dict> + <dict> + <key>begin</key> + <string>'</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.sql</string> + </dict> + </dict> + <key>end</key> + <string>'</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.sql</string> + </dict> + </dict> + <key>name</key> + <string>string.quoted.single.sql</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#string_escape</string> + </dict> + </array> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.sql</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.sql</string> + </dict> + </dict> + <key>comment</key> + <string>this is faster than the next begin/end rule since sub-pattern will match till end-of-line and SQL files tend to have very long lines.</string> + <key>match</key> + <string>(`)[^`\\]*(`)</string> + <key>name</key> + <string>string.quoted.other.backtick.sql</string> + </dict> + <dict> + <key>begin</key> + <string>`</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.sql</string> + </dict> + </dict> + <key>end</key> + <string>`</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.sql</string> + </dict> + </dict> + <key>name</key> + <string>string.quoted.other.backtick.sql</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#string_escape</string> + </dict> + </array> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.sql</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.sql</string> + </dict> + </dict> + <key>comment</key> + <string>this is faster than the next begin/end rule since sub-pattern will match till end-of-line and SQL files tend to have very long lines.</string> + <key>match</key> + <string>(")[^"#]*(")</string> + <key>name</key> + <string>string.quoted.double.sql</string> + </dict> + <dict> + <key>begin</key> + <string>"</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.sql</string> + </dict> + </dict> + <key>end</key> + <string>"</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.sql</string> + </dict> + </dict> + <key>name</key> + <string>string.quoted.double.sql</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#string_interpolation</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>%\{</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.sql</string> + </dict> + </dict> + <key>end</key> + <string>\}</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.sql</string> + </dict> + </dict> + <key>name</key> + <string>string.other.quoted.brackets.sql</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#string_interpolation</string> + </dict> + </array> + </dict> + </array> + </dict> + </dict> + <key>scopeName</key> + <string>source.sql</string> + <key>uuid</key> + <string>C49120AC-6ECC-11D9-ACC8-000D93589AF6</string> +</dict> +</plist> diff --git a/app/rcc/edbee/syntaxfiles/Scala.tmLanguage b/app/rcc/edbee/syntaxfiles/Scala.tmLanguage new file mode 100644 index 00000000..396c653e --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Scala.tmLanguage @@ -0,0 +1,652 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>bundleUUID</key> + <string>452017E8-0065-49EF-AB9D-7849B27D9367</string> + <key>fileTypes</key> + <array> + <string>scala</string> + </array> + <key>foldingStartMarker</key> + <string>/\*\*|\{\s*$</string> + <key>foldingStopMarker</key> + <string>\*\*/|^\s*\}</string> + <key>keyEquivalent</key> + <string>^~S</string> + <key>name</key> + <string>Scala</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#storage-modifiers</string> + </dict> + <dict> + <key>include</key> + <string>#keywords</string> + </dict> + <dict> + <key>include</key> + <string>#declarations</string> + </dict> + <dict> + <key>include</key> + <string>#inheritance</string> + </dict> + <dict> + <key>include</key> + <string>#imports</string> + </dict> + <dict> + <key>include</key> + <string>#comments</string> + </dict> + <dict> + <key>include</key> + <string>#block-comments</string> + </dict> + <dict> + <key>include</key> + <string>#strings</string> + </dict> + <dict> + <key>include</key> + <string>#initialization</string> + </dict> + <dict> + <key>include</key> + <string>#constants</string> + </dict> + <dict> + <key>include</key> + <string>#char-literal</string> + </dict> + <dict> + <key>include</key> + <string>#scala-symbol</string> + </dict> + <dict> + <key>include</key> + <string>#empty-parentheses</string> + </dict> + <dict> + <key>include</key> + <string>#parameter-list</string> + </dict> + <dict> + <key>include</key> + <string>#qualifiedClassName</string> + </dict> + <dict> + <key>include</key> + <string>#xml-literal</string> + </dict> + </array> + <key>repository</key> + <dict> + <key>block-comments</key> + <dict> + <key>begin</key> + <string>/\*</string> + <key>end</key> + <string>\*/</string> + <key>name</key> + <string>comment.block.scala</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#block-comments</string> + </dict> + <dict> + <key>match</key> + <string>(?x) + (?! /\*) + (?! \*/) + </string> + </dict> + </array> + </dict> + <key>char-literal</key> + <dict> + <key>match</key> + <string>'\\?.'</string> + <key>name</key> + <string>constant.character.literal.scala</string> + </dict> + <key>comments</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.comment.scala</string> + </dict> + </dict> + <key>match</key> + <string>(//).*$\n?</string> + <key>name</key> + <string>comment.line.double-slash.scala</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.comment.scala</string> + </dict> + </dict> + <key>match</key> + <string>/\*\*/</string> + <key>name</key> + <string>comment.block.empty.scala</string> + </dict> + <dict> + <key>begin</key> + <string>(^\s*)?/\*\*</string> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.comment.scala</string> + </dict> + </dict> + <key>end</key> + <string>\*/(\s*\n)?</string> + <key>name</key> + <string>comment.block.documentation.scala</string> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>(@\w+\s)</string> + <key>name</key> + <string>keyword.other.documentation.scaladoc.scala</string> + </dict> + <dict> + <key>match</key> + <string>\{@link\s+[^\}]*\}</string> + <key>name</key> + <string>keyword.other.documentation.scaladoc.link.scala</string> + </dict> + </array> + </dict> + </array> + </dict> + <key>constants</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>\b(false|null|true|Nil|None)\b</string> + <key>name</key> + <string>constant.language.scala</string> + </dict> + <dict> + <key>match</key> + <string>\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)([LlFfUuDd]|UL|ul)?\b</string> + <key>name</key> + <string>constant.numeric.scala</string> + </dict> + <dict> + <key>match</key> + <string>\b(this|super|self)\b</string> + <key>name</key> + <string>variable.language.scala</string> + </dict> + <dict> + <key>match</key> + <string>\b(Unit|Boolean|Byte|Char|Short|Int|Float|Long|Double)\b</string> + <key>name</key> + <string>storage.type.primitive.scala</string> + </dict> + </array> + </dict> + <key>declarations</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.declaration.scala</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.name.function.declaration</string> + </dict> + </dict> + <key>match</key> + <string>(?x) + \b(def)\s+ + (([a-zA-Z$_][a-zA-Z0-9$_]*(_[^a-zA-Z0-9\s]+)?)|`.*`|[^\w\[\(\:\_\s]+)</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.declaration.scala</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>keyword.declaration.scala</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.class.declaration</string> + </dict> + </dict> + <key>match</key> + <string>(case)?\b(class|trait|object)\s+([^\s\{\(\[]+)</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.declaration.scala</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.name.type.declaration</string> + </dict> + </dict> + <key>match</key> + <string>\b(type)\s+(([a-zA-Z$_][a-zA-Z0-9$_]*(_[^a-zA-Z0-9\s]+)?)|`.*`)</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.declaration.stable.scala</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>keyword.declaration.volatile.scala</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.val.declaration</string> + </dict> + </dict> + <key>match</key> + <string>\b(?:(val)|(var))\s+(([a-zA-Z$_][a-zA-Z0-9$_]*(_[^a-zA-Z0-9\s]+)?)|`.*`)?</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.declaration.scala</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.name.class.declaration</string> + </dict> + </dict> + <key>match</key> + <string>\b(package object)\s+([^\s\{\(\[]+)</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.other.scoping.scala</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.name.package.scala</string> + </dict> + </dict> + <key>match</key> + <string>\b(package)\s+([\w\.]+)</string> + <key>name</key> + <string>meta.package.scala</string> + </dict> + </array> + </dict> + <key>empty-parentheses</key> + <dict> + <key>match</key> + <string>\(\)</string> + <key>name</key> + <string>meta.parentheses.scala</string> + </dict> + <key>imports</key> + <dict> + <key>begin</key> + <string>\b(import)\s+</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.other.import.scala</string> + </dict> + </dict> + <key>end</key> + <string>(?<=[\n;])</string> + <key>name</key> + <string>meta.import.scala</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#comments</string> + </dict> + <dict> + <key>match</key> + <string>([^\s{;.]+)\s*\.\s*</string> + <key>name</key> + <string>variable.package.scala</string> + </dict> + <dict> + <key>match</key> + <string>([^\s{;.]+)\s*</string> + <key>name</key> + <string>variable.import.scala</string> + </dict> + <dict> + <key>begin</key> + <string>{</string> + <key>end</key> + <string>}</string> + <key>name</key> + <string>meta.import.selector.scala</string> + <key>patterns</key> + <array> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>variable.import.renamed-from.scala</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>keyword.other.arrow.scala</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>variable.import.renamed-to.scala</string> + </dict> + </dict> + <key>match</key> + <string>(?x) \s* + ([^\s.,}]+) \s* + (=>) \s* + ([^\s.,}]+) \s* + </string> + </dict> + <dict> + <key>match</key> + <string>([^\s.,}]+)</string> + <key>name</key> + <string>variable.import.scala</string> + </dict> + </array> + </dict> + </array> + </dict> + <key>inheritance</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.declaration.scala</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.other.inherited-class.scala</string> + </dict> + </dict> + <key>match</key> + <string>(extends|with)\s+([^\s\{\(\[\]]+)</string> + </dict> + </array> + </dict> + <key>initialization</key> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.name.class</string> + </dict> + </dict> + <key>match</key> + <string>\b(new)\s+([^\s\{\(\[]+)</string> + </dict> + <key>keywords</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>\b(return|throw)\b</string> + <key>name</key> + <string>keyword.control.flow.jump.scala</string> + </dict> + <dict> + <key>match</key> + <string>\b(else|if|do|while|for|yield|match|case)\b</string> + <key>name</key> + <string>keyword.control.flow.scala</string> + </dict> + <dict> + <key>match</key> + <string>\b(catch|finally|try)\b</string> + <key>name</key> + <string>keyword.control.exception.scala</string> + </dict> + </array> + </dict> + <key>parameter-list</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>variable.parameter</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.name.class</string> + </dict> + </dict> + <key>match</key> + <string>([a-zA-Z$_][a-zA-Z0-9$_]*)\s*:\s*([A-Za-z0-9][\w|_|?|\.]*)?,?</string> + </dict> + </array> + </dict> + <key>qualifiedClassName</key> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>entity.name.class</string> + </dict> + </dict> + <key>match</key> + <string>(\b([A-Z][\w]*))</string> + </dict> + <key>scala-symbol</key> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>entity.name.symbol</string> + </dict> + </dict> + <key>match</key> + <string>('\w+)</string> + </dict> + <key>storage-modifiers</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>\b(private\[\S+\]|protected\[\S+\]|private|protected)\b</string> + <key>name</key> + <string>storage.modifier.access</string> + </dict> + <dict> + <key>match</key> + <string>\b(synchronized|@volatile|abstract|final|lazy|sealed|implicit|override|@transient|@native)\b</string> + <key>name</key> + <string>storage.modifier.other</string> + </dict> + </array> + </dict> + <key>strings</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>"""</string> + <key>end</key> + <string>"""</string> + <key>name</key> + <string>string.quoted.triple.scala</string> + </dict> + <dict> + <key>begin</key> + <string>(?<!\\)"</string> + <key>end</key> + <string>"</string> + <key>name</key> + <string>string.quoted.double.scala</string> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>\n</string> + <key>name</key> + <string>invalid.string.newline</string> + </dict> + <dict> + <key>match</key> + <string>\\.</string> + <key>name</key> + <string>constant.character.escape.scala</string> + </dict> + </array> + </dict> + </array> + </dict> + <key>xml-attribute</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>entity.other.attribute-name</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>string.quoted.double</string> + </dict> + </dict> + <key>match</key> + <string>(\w+)=("[^"]*")</string> + </dict> + </array> + </dict> + <key>xml-literal</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string></?([a-zA-Z0-9]+)</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>entity.name.tag</string> + </dict> + </dict> + <key>end</key> + <string>/?></string> + <key>name</key> + <string>text.xml</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#xml-literal</string> + </dict> + <dict> + <key>include</key> + <string>#xml-attribute</string> + </dict> + </array> + </dict> + </array> + </dict> + </dict> + <key>scopeName</key> + <string>source.scala</string> + <key>uuid</key> + <string>158C0929-299A-40C8-8D89-316BE0C446E8</string> +</dict> +</plist> diff --git a/app/rcc/edbee/syntaxfiles/Shell-Unix-Generic.tmLanguage b/app/rcc/edbee/syntaxfiles/Shell-Unix-Generic.tmLanguage new file mode 100644 index 00000000..db039cdc --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Shell-Unix-Generic.tmLanguage @@ -0,0 +1,1856 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>fileTypes</key> + <array> + <string>sh</string> + <string>bash</string> + <string>zsh</string> + <string>.bashrc</string> + <string>.bash_profile</string> + <string>.bash_login</string> + <string>.profile</string> + <string>.bash_logout</string> + <string>.textmate_init</string> + </array> + <key>firstLineMatch</key> + <string>^#!.*\b(bash|zsh|sh|tcsh)|^#\s*-\*-[^*]*mode:\s*shell-script[^*]*-\*-</string> + <key>foldingStartMarker</key> + <string>\b(if|case)\b|(\{|\b(do)\b)$</string> + <key>foldingStopMarker</key> + <string>^\s*(\}|(done|fi|esac)\b)</string> + <key>keyEquivalent</key> + <string>^~S</string> + <key>name</key> + <string>Shell Script (Bash)</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#comment</string> + </dict> + <dict> + <key>include</key> + <string>#pipeline</string> + </dict> + <dict> + <key>include</key> + <string>#list</string> + </dict> + <dict> + <key>include</key> + <string>#compound-command</string> + </dict> + <dict> + <key>include</key> + <string>#loop</string> + </dict> + <dict> + <key>include</key> + <string>#function-definition</string> + </dict> + <dict> + <key>include</key> + <string>#string</string> + </dict> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>include</key> + <string>#interpolation</string> + </dict> + <dict> + <key>include</key> + <string>#heredoc</string> + </dict> + <dict> + <key>include</key> + <string>#herestring</string> + </dict> + <dict> + <key>include</key> + <string>#redirection</string> + </dict> + <dict> + <key>include</key> + <string>#pathname</string> + </dict> + <dict> + <key>include</key> + <string>#keyword</string> + </dict> + <dict> + <key>include</key> + <string>#support</string> + </dict> + </array> + <key>repository</key> + <dict> + <key>case-clause</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>(?=\S)</string> + <key>end</key> + <string>;;</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.terminator.case-clause.shell</string> + </dict> + </dict> + <key>name</key> + <string>meta.scope.case-clause.shell</string> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>(\(|(?=\S))</string> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.case-pattern.shell</string> + </dict> + </dict> + <key>end</key> + <string>\)</string> + <key>name</key> + <string>meta.scope.case-pattern.shell</string> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>\|</string> + <key>name</key> + <string>punctuation.separator.pipe-sign.shell</string> + </dict> + <dict> + <key>include</key> + <string>#string</string> + </dict> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>include</key> + <string>#interpolation</string> + </dict> + <dict> + <key>include</key> + <string>#pathname</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(?<=\))</string> + <key>end</key> + <string>(?=;;)</string> + <key>name</key> + <string>meta.scope.case-clause-body.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + </array> + </dict> + </array> + </dict> + <key>comment</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.comment.shell</string> + </dict> + </dict> + <key>match</key> + <string>(?<!\S)(#)(?!\{).*$\n?</string> + <key>name</key> + <string>comment.line.number-sign.shell</string> + </dict> + </array> + </dict> + <key>compound-command</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>(\[{2})</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.logical-expression.shell</string> + </dict> + </dict> + <key>end</key> + <string>(\]{2})</string> + <key>name</key> + <string>meta.scope.logical-expression.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#logical-expression</string> + </dict> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(\({2})</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.shell</string> + </dict> + </dict> + <key>end</key> + <string>(\){2})</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.other.math.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#math</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(\()</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.subshell.shell</string> + </dict> + </dict> + <key>end</key> + <string>(\))</string> + <key>name</key> + <string>meta.scope.subshell.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(?<=\s|^)(\{)(?=\s|$)</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.group.shell</string> + </dict> + </dict> + <key>end</key> + <string>(?<=^|;)\s*(\})</string> + <key>name</key> + <string>meta.scope.group.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + </array> + </dict> + <key>function-definition</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>\b(function)\s+([^\s\\]+)(?:\s*(\(\)))?</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>storage.type.function.shell</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.name.function.shell</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.arguments.shell</string> + </dict> + </dict> + <key>end</key> + <string>;|&|$</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.function.shell</string> + </dict> + </dict> + <key>name</key> + <string>meta.function.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>\b([^\s\\=]+)\s*(\(\))</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>entity.name.function.shell</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.arguments.shell</string> + </dict> + </dict> + <key>end</key> + <string>;|&|$</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.function.shell</string> + </dict> + </dict> + <key>name</key> + <string>meta.function.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + </array> + </dict> + <key>heredoc</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>(<<)-("|'|)(RUBY)\2</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.operator.heredoc.shell</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.shell</string> + </dict> + </dict> + <key>contentName</key> + <string>source.ruby.embedded.shell</string> + <key>end</key> + <string>^\t*(RUBY)\b</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.unquoted.heredoc.no-indent.ruby.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>source.ruby</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(<<)("|'|)(RUBY)\2</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.operator.heredoc.shell</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.shell</string> + </dict> + </dict> + <key>contentName</key> + <string>source.ruby.embedded.shell</string> + <key>end</key> + <string>^(RUBY)\b</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.unquoted.heredoc.ruby.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>source.ruby</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(<<)-("|'|)(PYTHON)\2</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.operator.heredoc.shell</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.shell</string> + </dict> + </dict> + <key>contentName</key> + <string>source.python.embedded.shell</string> + <key>end</key> + <string>^\t*(PYTHON)\b</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.unquoted.heredoc.no-indent.python.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>source.python</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(<<)("|'|)(PYTHON)\2</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.operator.heredoc.shell</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.shell</string> + </dict> + </dict> + <key>contentName</key> + <string>source.python.embedded.shell</string> + <key>end</key> + <string>^(PYTHON)\b</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.unquoted.heredoc.python.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>source.python</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(<<)-("|'|)(APPLESCRIPT)\2</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.operator.heredoc.shell</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.shell</string> + </dict> + </dict> + <key>contentName</key> + <string>source.applescript.embedded.shell</string> + <key>end</key> + <string>^\t*(APPLESCRIPT)\b</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.unquoted.heredoc.no-indent.applescript.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>source.applescript</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(<<)("|'|)(APPLESCRIPT)\2</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.operator.heredoc.shell</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.shell</string> + </dict> + </dict> + <key>contentName</key> + <string>source.applescript.embedded.shell</string> + <key>end</key> + <string>^(APPLESCRIPT)\b</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.unquoted.heredoc.applescript.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>source.applescript</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(<<)-("|'|)(HTML)\2</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.operator.heredoc.shell</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.shell</string> + </dict> + </dict> + <key>contentName</key> + <string>text.html.embedded.shell</string> + <key>end</key> + <string>^\t*(HTML)\b</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.unquoted.heredoc.no-indent.html.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>text.html.basic</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(<<)("|'|)(HTML)\2</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.operator.heredoc.shell</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.shell</string> + </dict> + </dict> + <key>contentName</key> + <string>text.html.embedded.shell</string> + <key>end</key> + <string>^(HTML)\b</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.unquoted.heredoc.html.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>text.html.basic</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(<<)-("|'|)(MARKDOWN)\2</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.operator.heredoc.shell</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.shell</string> + </dict> + </dict> + <key>contentName</key> + <string>text.html.markdown.embedded.shell</string> + <key>end</key> + <string>^\t*(MARKDOWN)\b</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.unquoted.heredoc.no-indent.markdown.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>text.html.markdown</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(<<)("|'|)(MARKDOWN)\2</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.operator.heredoc.shell</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.shell</string> + </dict> + </dict> + <key>contentName</key> + <string>text.html.markdown.embedded.shell</string> + <key>end</key> + <string>^(MARKDOWN)\b</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.unquoted.heredoc.markdown.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>text.html.markdown</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(<<)-("|'|)(TEXTILE)\2</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.operator.heredoc.shell</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.shell</string> + </dict> + </dict> + <key>contentName</key> + <string>text.html.textile.embedded.shell</string> + <key>end</key> + <string>^\t*(TEXTILE)\b</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.unquoted.heredoc.no-indent.textile.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>text.html.textile</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(<<)("|'|)(TEXTILE)\2</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.operator.heredoc.shell</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.shell</string> + </dict> + </dict> + <key>contentName</key> + <string>text.html.textile.embedded.shell</string> + <key>end</key> + <string>^(TEXTILE)\b</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.unquoted.heredoc.textile.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>text.html.textile</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(<<)-("|'|)\\?(\w+)\2</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.operator.heredoc.shell</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.shell</string> + </dict> + </dict> + <key>end</key> + <string>^\t*(\3)\b</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.unquoted.heredoc.no-indent.shell</string> + </dict> + <dict> + <key>begin</key> + <string>(<<)("|'|)\\?(\w+)\2</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.operator.heredoc.shell</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.shell</string> + </dict> + </dict> + <key>end</key> + <string>^(\3)\b</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.heredoc-token.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.unquoted.heredoc.shell</string> + </dict> + </array> + </dict> + <key>herestring</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.operator.herestring.shell</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>string.quoted.single.herestring.shell</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.shell</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.shell</string> + </dict> + </dict> + <key>match</key> + <string>(<<<)((')[^']*('))</string> + <key>name</key> + <string>meta.herestring.shell</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.operator.herestring.shell</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>string.quoted.double.herestring.shell</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.shell</string> + </dict> + <key>6</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.shell</string> + </dict> + </dict> + <key>match</key> + <string>(<<<)((")(\\("|\\)|[^"])*("))</string> + <key>name</key> + <string>meta.herestring.shell</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.operator.herestring.shell</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>string.unquoted.herestring.shell</string> + </dict> + </dict> + <key>match</key> + <string>(<<<)(([^\s\\]|\\.)+)</string> + <key>name</key> + <string>meta.herestring.shell</string> + </dict> + </array> + </dict> + <key>interpolation</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>\$\({2}</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.shell</string> + </dict> + </dict> + <key>end</key> + <string>\){2}</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.other.math.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#math</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>`</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.shell</string> + </dict> + </dict> + <key>end</key> + <string>`</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.interpolated.backtick.shell</string> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>\\[`\\$]</string> + <key>name</key> + <string>constant.character.escape.shell</string> + </dict> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>\$\(</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.shell</string> + </dict> + </dict> + <key>end</key> + <string>\)</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.interpolated.dollar.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + </array> + </dict> + <key>keyword</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>\b(?:if|then|else|elif|fi|for|in|do|done|select|case|continue|esac|while|until|return)\b</string> + <key>name</key> + <string>keyword.control.shell</string> + </dict> + <dict> + <key>match</key> + <string>(?<![-/])\b(?:export|declare|typeset|local|readonly)\b</string> + <key>name</key> + <string>storage.modifier.shell</string> + </dict> + </array> + </dict> + <key>list</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>;|&&|&|\|\|</string> + <key>name</key> + <string>keyword.operator.list.shell</string> + </dict> + </array> + </dict> + <key>logical-expression</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>comment</key> + <string>do we want a special rule for ( expr )?</string> + <key>match</key> + <string>=[=~]?|!=?|<|>|&&|\|\|</string> + <key>name</key> + <string>keyword.operator.logical.shell</string> + </dict> + <dict> + <key>match</key> + <string>(?<!\S)-(nt|ot|ef|eq|ne|l[te]|g[te]|[a-hknoprstuwxzOGLSN])</string> + <key>name</key> + <string>keyword.operator.logical.shell</string> + </dict> + </array> + </dict> + <key>loop</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>\b(for)\s+(?=\({2})</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.shell</string> + </dict> + </dict> + <key>end</key> + <string>\b(done)\b</string> + <key>name</key> + <string>meta.scope.for-loop.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>\b(for)\s+((?:[^\s\\]|\\.)+)\b</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.shell</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>variable.other.loop.shell</string> + </dict> + </dict> + <key>end</key> + <string>\b(done)\b</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.shell</string> + </dict> + </dict> + <key>name</key> + <string>meta.scope.for-in-loop.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>\b(while|until)\b</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.shell</string> + </dict> + </dict> + <key>end</key> + <string>\b(done)\b</string> + <key>name</key> + <string>meta.scope.while-loop.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>\b(select)\s+((?:[^\s\\]|\\.)+)\b</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.shell</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>variable.other.loop.shell</string> + </dict> + </dict> + <key>end</key> + <string>\b(done)\b</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.shell</string> + </dict> + </dict> + <key>name</key> + <string>meta.scope.select-block.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>\b(case)\b</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.shell</string> + </dict> + </dict> + <key>end</key> + <string>\b(esac)\b</string> + <key>name</key> + <string>meta.scope.case-block.shell</string> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>\b(?:in)\b</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.shell</string> + </dict> + </dict> + <key>end</key> + <string>(?=\b(?:esac)\b)</string> + <key>name</key> + <string>meta.scope.case-body.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#comment</string> + </dict> + <dict> + <key>include</key> + <string>#case-clause</string> + </dict> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>\b(if)\b</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.shell</string> + </dict> + </dict> + <key>end</key> + <string>\b(fi)\b</string> + <key>name</key> + <string>meta.scope.if-block.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + </array> + </dict> + <key>math</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>match</key> + <string>\+{1,2}|-{1,2}|!|~|\*{1,2}|/|%|<[<=]?|>[>=]?|==|!=|^|\|{1,2}|&{1,2}|\?|\:|,|=|[*/%+\-&^|]=|<<=|>>=</string> + <key>name</key> + <string>keyword.operator.arithmetic.shell</string> + </dict> + <dict> + <key>match</key> + <string>0[xX]\h+</string> + <key>name</key> + <string>constant.numeric.hex.shell</string> + </dict> + <dict> + <key>match</key> + <string>0\d+</string> + <key>name</key> + <string>constant.numeric.octal.shell</string> + </dict> + <dict> + <key>match</key> + <string>\d{1,2}#[0-9a-zA-Z@_]+</string> + <key>name</key> + <string>constant.numeric.other.shell</string> + </dict> + <dict> + <key>match</key> + <string>\d+</string> + <key>name</key> + <string>constant.numeric.integer.shell</string> + </dict> + </array> + </dict> + <key>pathname</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>(?<=\s|:|=|^)~</string> + <key>name</key> + <string>keyword.operator.tilde.shell</string> + </dict> + <dict> + <key>match</key> + <string>\*|\?</string> + <key>name</key> + <string>keyword.operator.glob.shell</string> + </dict> + <dict> + <key>begin</key> + <string>([?*+@!])(\()</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.operator.extglob.shell</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.extglob.shell</string> + </dict> + </dict> + <key>end</key> + <string>(\))</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.extglob.shell</string> + </dict> + </dict> + <key>name</key> + <string>meta.structure.extglob.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + </array> + </dict> + <key>pipeline</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>\b(time)\b</string> + <key>name</key> + <string>keyword.other.shell</string> + </dict> + <dict> + <key>match</key> + <string>[|!]</string> + <key>name</key> + <string>keyword.operator.pipe.shell</string> + </dict> + </array> + </dict> + <key>redirection</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>[><]\(</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.shell</string> + </dict> + </dict> + <key>end</key> + <string>\)</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.interpolated.process-substitution.shell</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + <dict> + <key>comment</key> + <string>valid: &>word >&word >word [n]>&[n] [n]<word [n]>word [n]>>word [n]<&word (last one is duplicate)</string> + <key>match</key> + <string>&>|\d*>&\d*|\d*(>>|>|<)|\d*<&|\d*<></string> + <key>name</key> + <string>keyword.operator.redirect.shell</string> + </dict> + </array> + </dict> + <key>string</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>\\.</string> + <key>name</key> + <string>constant.character.escape.shell</string> + </dict> + <dict> + <key>begin</key> + <string>'</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.shell</string> + </dict> + </dict> + <key>end</key> + <string>'</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.quoted.single.shell</string> + </dict> + <dict> + <key>begin</key> + <string>\$?"</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.shell</string> + </dict> + </dict> + <key>end</key> + <string>"</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.quoted.double.shell</string> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>\\[\$`"\\\n]</string> + <key>name</key> + <string>constant.character.escape.shell</string> + </dict> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>include</key> + <string>#interpolation</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>\$'</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.shell</string> + </dict> + </dict> + <key>end</key> + <string>'</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.shell</string> + </dict> + </dict> + <key>name</key> + <string>string.quoted.single.dollar.shell</string> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>\\(a|b|e|f|n|r|t|v|\\|')</string> + <key>name</key> + <string>constant.character.escape.ansi-c.shell</string> + </dict> + <dict> + <key>match</key> + <string>\\[0-9]{3}</string> + <key>name</key> + <string>constant.character.escape.octal.shell</string> + </dict> + <dict> + <key>match</key> + <string>\\x[0-9a-fA-F]{2}</string> + <key>name</key> + <string>constant.character.escape.hex.shell</string> + </dict> + <dict> + <key>match</key> + <string>\\c.</string> + <key>name</key> + <string>constant.character.escape.control-char.shell</string> + </dict> + </array> + </dict> + </array> + </dict> + <key>support</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>(?<=^|\s)(?::|\.)(?=\s|;|&|$)</string> + <key>name</key> + <string>support.function.builtin.shell</string> + </dict> + <dict> + <key>match</key> + <string>(?<![-/])\b(?:alias|bg|bind|break|builtin|caller|cd|command|compgen|complete|dirs|disown|echo|enable|eval|exec|exit|false|fc|fg|getopts|hash|help|history|jobs|kill|let|logout|popd|printf|pushd|pwd|read|readonly|set|shift|shopt|source|suspend|test|times|trap|true|type|ulimit|umask|unalias|unset|wait)\b</string> + <key>name</key> + <string>support.function.builtin.shell</string> + </dict> + </array> + </dict> + <key>variable</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.variable.shell</string> + </dict> + </dict> + <key>match</key> + <string>(\$)[-*@#?$!0_]</string> + <key>name</key> + <string>variable.other.special.shell</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.variable.shell</string> + </dict> + </dict> + <key>match</key> + <string>(\$)[1-9]</string> + <key>name</key> + <string>variable.other.positional.shell</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.variable.shell</string> + </dict> + </dict> + <key>match</key> + <string>(\$)[a-zA-Z_][a-zA-Z0-9_]*</string> + <key>name</key> + <string>variable.other.normal.shell</string> + </dict> + <dict> + <key>begin</key> + <string>\$\{</string> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.variable.shell</string> + </dict> + </dict> + <key>end</key> + <string>\}</string> + <key>name</key> + <string>variable.other.bracket.shell</string> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>!|:[-=?]?|\*|@|#{1,2}|%{1,2}|/</string> + <key>name</key> + <string>keyword.operator.expansion.shell</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.section.array.shell</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.section.array.shell</string> + </dict> + </dict> + <key>match</key> + <string>(\[)([^\]]+)(\])</string> + </dict> + </array> + </dict> + </array> + </dict> + </dict> + <key>scopeName</key> + <string>source.shell</string> + <key>uuid</key> + <string>DDEEA3ED-6B1C-11D9-8B10-000D93589AF6</string> +</dict> +</plist> diff --git a/app/rcc/edbee/syntaxfiles/Tcl.tmLanguage b/app/rcc/edbee/syntaxfiles/Tcl.tmLanguage new file mode 100644 index 00000000..e999ef83 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Tcl.tmLanguage @@ -0,0 +1,432 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>fileTypes</key> + <array> + <string>tcl</string> + </array> + <key>foldingStartMarker</key> + <string>\{\s*$</string> + <key>foldingStopMarker</key> + <string>^\s*\}</string> + <key>keyEquivalent</key> + <string>^~T</string> + <key>name</key> + <string>Tcl</string> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>(?<=^|;)\s*((#))</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>comment.line.number-sign.tcl</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.comment.tcl</string> + </dict> + </dict> + <key>contentName</key> + <string>comment.line.number-sign.tcl</string> + <key>end</key> + <string>\n</string> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>(\\\\|\\\n)</string> + </dict> + </array> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.tcl</string> + </dict> + </dict> + <key>match</key> + <string>(?<=^|[\[{;])\s*(if|while|for|catch|return|break|continue|switch|exit|foreach)\b</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.tcl</string> + </dict> + </dict> + <key>match</key> + <string>(?<=^|})\s*(then|elseif|else)\b</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.other.tcl</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.name.function.tcl</string> + </dict> + </dict> + <key>match</key> + <string>^\s*(proc)\s+([^\s]+)</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.other.tcl</string> + </dict> + </dict> + <key>match</key> + <string>(?<=^|[\[{;])\s*(after|append|array|auto_execok|auto_import|auto_load|auto_mkindex|auto_mkindex_old|auto_qualify|auto_reset|bgerror|binary|cd|clock|close|concat|dde|encoding|eof|error|eval|exec|expr|fblocked|fconfigure|fcopy|file|fileevent|filename|flush|format|gets|glob|global|history|http|incr|info|interp|join|lappend|library|lindex|linsert|list|llength|load|lrange|lreplace|lsearch|lset|lsort|memory|msgcat|namespace|open|package|parray|pid|pkg::create|pkg_mkIndex|proc|puts|pwd|re_syntax|read|registry|rename|resource|scan|seek|set|socket|SafeBase|source|split|string|subst|Tcl|tcl_endOfWord|tcl_findLibrary|tcl_startOfNextWord|tcl_startOfPreviousWord|tcl_wordBreakAfter|tcl_wordBreakBefore|tcltest|tclvars|tell|time|trace|unknown|unset|update|uplevel|upvar|variable|vwait)\b</string> + </dict> + <dict> + <key>begin</key> + <string>(?<=^|[\[{;])\s*(regexp|regsub)\b\s*</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.other.tcl</string> + </dict> + </dict> + <key>comment</key> + <string>special-case regexp/regsub keyword in order to handle the expression</string> + <key>end</key> + <string>[\n;\]]</string> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>\\(?:.|\n)</string> + <key>name</key> + <string>constant.character.escape.tcl</string> + </dict> + <dict> + <key>comment</key> + <string>switch for regexp</string> + <key>match</key> + <string>-\w+\s*</string> + </dict> + <dict> + <key>applyEndPatternLast</key> + <integer>1</integer> + <key>begin</key> + <string>--\s*</string> + <key>comment</key> + <string>end of switches</string> + <key>end</key> + <string></string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#regexp</string> + </dict> + </array> + </dict> + <dict> + <key>include</key> + <string>#regexp</string> + </dict> + </array> + </dict> + <dict> + <key>include</key> + <string>#escape</string> + </dict> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>begin</key> + <string>"</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.tcl</string> + </dict> + </dict> + <key>end</key> + <string>"</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.tcl</string> + </dict> + </dict> + <key>name</key> + <string>string.quoted.double.tcl</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#escape</string> + </dict> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>include</key> + <string>#embedded</string> + </dict> + </array> + </dict> + </array> + <key>repository</key> + <dict> + <key>bare-string</key> + <dict> + <key>begin</key> + <string>(?:^|(?<=\s))"</string> + <key>comment</key> + <string>matches a single quote-enclosed word without scoping</string> + <key>end</key> + <string>"([^\s\]]*)</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>invalid.illegal.tcl</string> + </dict> + </dict> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#escape</string> + </dict> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + </array> + </dict> + <key>braces</key> + <dict> + <key>begin</key> + <string>(?:^|(?<=\s))\{</string> + <key>comment</key> + <string>matches a single brace-enclosed word</string> + <key>end</key> + <string>\}([^\s\]]*)</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>invalid.illegal.tcl</string> + </dict> + </dict> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>\\[{}\n]</string> + <key>name</key> + <string>constant.character.escape.tcl</string> + </dict> + <dict> + <key>include</key> + <string>#inner-braces</string> + </dict> + </array> + </dict> + <key>embedded</key> + <dict> + <key>begin</key> + <string>\[</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.section.embedded.begin.tcl</string> + </dict> + </dict> + <key>end</key> + <string>\]</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.section.embedded.end.tcl</string> + </dict> + </dict> + <key>name</key> + <string>source.tcl.embedded</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>source.tcl</string> + </dict> + </array> + </dict> + <key>escape</key> + <dict> + <key>match</key> + <string>\\(\d{1,3}|x[a-fA-F0-9]+|u[a-fA-F0-9]{1,4}|.|\n)</string> + <key>name</key> + <string>constant.character.escape.tcl</string> + </dict> + <key>inner-braces</key> + <dict> + <key>begin</key> + <string>\{</string> + <key>comment</key> + <string>matches a nested brace in a brace-enclosed word</string> + <key>end</key> + <string>\}</string> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>\\[{}\n]</string> + <key>name</key> + <string>constant.character.escape.tcl</string> + </dict> + <dict> + <key>include</key> + <string>#inner-braces</string> + </dict> + </array> + </dict> + <key>regexp</key> + <dict> + <key>begin</key> + <string>(?=\S)(?![\n;\]])</string> + <key>comment</key> + <string>matches a single word, named as a regexp, then swallows the rest of the command</string> + <key>end</key> + <string>(?=[\n;\]])</string> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>(?=[^ \t\n;])</string> + <key>end</key> + <string>(?=[ \t\n;])</string> + <key>name</key> + <string>string.regexp.tcl</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#braces</string> + </dict> + <dict> + <key>include</key> + <string>#bare-string</string> + </dict> + <dict> + <key>include</key> + <string>#escape</string> + </dict> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>[ \t]</string> + <key>comment</key> + <string>swallow the rest of the command</string> + <key>end</key> + <string>(?=[\n;\]])</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#variable</string> + </dict> + <dict> + <key>include</key> + <string>#embedded</string> + </dict> + <dict> + <key>include</key> + <string>#escape</string> + </dict> + <dict> + <key>include</key> + <string>#braces</string> + </dict> + <dict> + <key>include</key> + <string>#string</string> + </dict> + </array> + </dict> + </array> + </dict> + <key>string</key> + <dict> + <key>applyEndPatternLast</key> + <integer>1</integer> + <key>begin</key> + <string>(?:^|(?<=\s))(?=")</string> + <key>comment</key> + <string>matches a single quote-enclosed word with scoping</string> + <key>end</key> + <string></string> + <key>name</key> + <string>string.quoted.double.tcl</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#bare-string</string> + </dict> + </array> + </dict> + <key>variable</key> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.variable.tcl</string> + </dict> + </dict> + <key>match</key> + <string>(\$)((?:[a-zA-Z0-9_]|::)+(\([^\)]+\))?|\{[^\}]*\})</string> + <key>name</key> + <string>variable.other.tcl</string> + </dict> + </dict> + <key>scopeName</key> + <string>source.tcl</string> + <key>uuid</key> + <string>F01F22AC-7CBB-11D9-9B10-000A95E13C98</string> +</dict> +</plist> diff --git a/app/rcc/edbee/syntaxfiles/TeX Math.tmLanguage b/app/rcc/edbee/syntaxfiles/TeX Math.tmLanguage new file mode 100644 index 00000000..811ad49e --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/TeX Math.tmLanguage @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>fileTypes</key> + <array/> + <key>foldingStartMarker</key> + <string>/\*\*|\{\s*$</string> + <key>foldingStopMarker</key> + <string>\*\*/|^\s*\}</string> + <key>name</key> + <string>TeX Math</string> + <key>patterns</key> + <array> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.math.tex</string> + </dict> + </dict> + <key>match</key> + <string>(\\)(s(s(earrow|warrow|lash)|h(ort(downarrow|uparrow|parallel|leftarrow|rightarrow|mid)|arp)|tar|i(gma|m(eq)?)|u(cc(sim|n(sim|approx)|curlyeq|eq|approx)?|pset(neq(q)?|plus(eq)?|eq(q)?)?|rd|m|bset(neq(q)?|plus(eq)?|eq(q)?)?)|p(hericalangle|adesuit)|e(tminus|arrow)|q(su(pset(eq)?|bset(eq)?)|c(up|ap)|uare)|warrow|m(ile|all(s(etminus|mile)|frown)))|h(slash|ook(leftarrow|rightarrow)|eartsuit|bar)|R(sh|ightarrow|e|bag)|Gam(e|ma)|n(s(hort(parallel|mid)|im|u(cc(eq)?|pseteq(q)?|bseteq))|Rightarrow|n(earrow|warrow)|cong|triangle(left(eq(slant)?)?|right(eq(slant)?)?)|i(plus)?|u|p(lus|arallel|rec(eq)?)|e(q|arrow|g|xists)|v(dash|Dash)|warrow|le(ss|q(slant|q)?|ft(arrow|rightarrow))|a(tural|bla)|VDash|rightarrow|g(tr|eq(slant|q)?)|mid|Left(arrow|rightarrow))|c(hi|irc(eq|le(d(circ|S|dash|ast)|arrow(left|right)))?|o(ng|prod|lon|mplement)|dot(s|p)?|u(p|r(vearrow(left|right)|ly(eq(succ|prec)|vee(downarrow|uparrow)?|wedge(downarrow|uparrow)?)))|enterdot|lubsuit|ap)|Xi|Maps(to(char)?|from(char)?)|B(ox|umpeq|bbk)|t(h(ick(sim|approx)|e(ta|refore))|imes|op|wohead(leftarrow|rightarrow)|a(u|lloblong)|riangle(down|q|left(eq(slant)?)?|right(eq(slant)?)?)?)|i(n(t(er(cal|leave))?|plus|fty)?|ota|math)|S(igma|u(pset|bset))|zeta|o(slash|times|int|dot|plus|vee|wedge|lessthan|greaterthan|m(inus|ega)|b(slash|long|ar))|d(i(v(ideontimes)?|a(g(down|up)|mond(suit)?)|gamma)|o(t(plus|eq(dot)?)|ublebarwedge|wn(harpoon(left|right)|downarrows|arrow))|d(ots|agger)|elta|a(sh(v|leftarrow|rightarrow)|leth|gger))|Y(down|up|left|right)|C(up|ap)|u(n(lhd|rhd)|p(silon|harpoon(left|right)|downarrow|uparrows|lus|arrow)|lcorner|rcorner)|jmath|Theta|Im|p(si|hi|i(tchfork)?|erp|ar(tial|allel)|r(ime|o(d|pto)|ec(sim|n(sim|approx)|curlyeq|eq|approx)?)|m)|e(t(h|a)|psilon|q(slant(less|gtr)|circ|uiv)|ll|xists|mptyset)|Omega|D(iamond|ownarrow|elta)|v(d(ots|ash)|ee(bar)?|Dash|ar(s(igma|u(psetneq(q)?|bsetneq(q)?))|nothing|curly(vee|wedge)|t(heta|imes|riangle(left|right)?)|o(slash|circle|times|dot|plus|vee|wedge|lessthan|ast|greaterthan|minus|b(slash|ar))|p(hi|i|ropto)|epsilon|kappa|rho|bigcirc))|kappa|Up(silon|downarrow|arrow)|Join|f(orall|lat|a(t(s(emi|lash)|bslash)|llingdotseq)|rown)|P(si|hi|i)|w(p|edge|r)|l(hd|n(sim|eq(q)?|approx)|ceil|times|ightning|o(ng(left(arrow|rightarrow)|rightarrow|maps(to|from))|zenge|oparrow(left|right))|dot(s|p)|e(ss(sim|dot|eq(qgtr|gtr)|approx|gtr)|q(slant|q)?|ft(slice|harpoon(down|up)|threetimes|leftarrows|arrow(t(ail|riangle))?|right(squigarrow|harpoons|arrow(s|triangle|eq)?))|adsto)|vertneqq|floor|l(c(orner|eil)|floor|l|bracket)?|a(ngle|mbda)|rcorner|bag)|a(s(ymp|t)|ngle|pprox(eq)?|l(pha|eph)|rrownot|malg)|V(dash|vdash)|r(h(o|d)|ceil|times|i(singdotseq|ght(s(quigarrow|lice)|harpoon(down|up)|threetimes|left(harpoons|arrows)|arrow(t(ail|riangle))?|rightarrows))|floor|angle|r(ceil|parenthesis|floor|bracket)|bag)|g(n(sim|eq(q)?|approx)|tr(sim|dot|eq(qless|less)|less|approx)|imel|eq(slant|q)?|vertneqq|amma|g(g)?)|Finv|xi|m(ho|i(nuso|d)|o(o|dels)|u(ltimap)?|p|e(asuredangle|rge)|aps(to|from(char)?))|b(i(n(dnasrepma|ampersand)|g(s(tar|qc(up|ap))|nplus|c(irc|u(p|rly(vee|wedge))|ap)|triangle(down|up)|interleave|o(times|dot|plus)|uplus|parallel|vee|wedge|box))|o(t|wtie|x(slash|circle|times|dot|plus|empty|ast|minus|b(slash|ox|ar)))|u(llet|mpeq)|e(cause|t(h|ween|a))|lack(square|triangle(down|left|right)?|lozenge)|a(ck(s(im(eq)?|lash)|prime|epsilon)|r(o|wedge))|bslash)|L(sh|ong(left(arrow|rightarrow)|rightarrow|maps(to|from))|eft(arrow|rightarrow)|leftarrow|ambda|bag)|Arrownot)\b</string> + <key>name</key> + <string>constant.character.math.tex</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.math.tex</string> + </dict> + </dict> + <key>match</key> + <string>(\\)(sum|prod|coprod|int|oint|bigcap|bigcup|bigsqcup|bigvee|bigwedge|bigodot|bigotimes|bogoplus|biguplus)\b</string> + <key>name</key> + <string>constant.character.math.tex</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.math.tex</string> + </dict> + </dict> + <key>match</key> + <string>(\\)(arccos|arcsin|arctan|arg|cos|cosh|cot|coth|csc|deg|det|dim|exp|gcd|hom|inf|ker|lg|lim|liminf|limsup|ln|log|max|min|pr|sec|sin|sinh|sup|tan|tanh)\b</string> + <key>name</key> + <string>constant.other.math.tex</string> + </dict> + <dict> + <key>begin</key> + <string>((\\)Sexpr)(\{)</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>support.function.sexpr.math.tex</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.function.math.tex</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.section.embedded.begin.math.tex</string> + </dict> + </dict> + <key>contentName</key> + <string>source.r.embedded.math.tex</string> + <key>end</key> + <string>(\})</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.section.embedded.end.math.tex</string> + </dict> + </dict> + <key>name</key> + <string>meta.function.sexpr.math.tex</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>source.r</string> + </dict> + </array> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.math.tex</string> + </dict> + </dict> + <key>match</key> + <string>(\\)([^a-zA-Z]|[A-Za-z]+)(?=\b|\}|\]|\^|\_)</string> + <key>name</key> + <string>constant.other.general.math.tex</string> + </dict> + <dict> + <key>match</key> + <string>(([0-9]*[\.][0-9]+)|[0-9]+)</string> + <key>name</key> + <string>constant.numeric.math.tex</string> + </dict> + <dict> + <key>match</key> + <string>«press a-z and space for greek letter»[a-zA-Z]*</string> + <key>name</key> + <string>meta.placeholder.greek.math.tex</string> + </dict> + </array> + <key>scopeName</key> + <string>text.tex.math</string> + <key>uuid</key> + <string>027D6AF4-E9D3-4250-82A1-8A42EEFE4F76</string> +</dict> +</plist> diff --git a/app/rcc/edbee/syntaxfiles/TeX.tmLanguage b/app/rcc/edbee/syntaxfiles/TeX.tmLanguage new file mode 100644 index 00000000..d0b2c09f --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/TeX.tmLanguage @@ -0,0 +1,246 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>fileTypes</key> + <array> + <string>sty</string> + <string>cls</string> + </array> + <key>foldingStartMarker</key> + <string>/\*\*|\{\s*$</string> + <key>foldingStopMarker</key> + <string>\*\*/|^\s*\}</string> + <key>name</key> + <string>TeX</string> + <key>patterns</key> + <array> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.tex</string> + </dict> + </dict> + <key>match</key> + <string>(\\)(backmatter|else|fi|frontmatter|ftrue|mainmatter|if(case|cat|dim|eof|false|hbox|hmode|inner|mmode|num|odd|undefined|vbox|vmode|void|x)?)\b</string> + <key>name</key> + <string>keyword.control.tex</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>keyword.control.catcode.tex</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.tex</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.separator.key-value.tex</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>constant.numeric.category.tex</string> + </dict> + </dict> + <key>match</key> + <string>((\\)catcode)`(?:\\)?.(=)(\d+)</string> + <key>name</key> + <string>meta.catcode.tex</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.comment.tex</string> + </dict> + </dict> + <key>match</key> + <string>(%:).*$\n?</string> + <key>name</key> + <string>comment.line.percentage.semicolon.texshop.tex</string> + </dict> + <dict> + <key>match</key> + <string>^%!TEX (\S*) =\s*(.*)\s*$</string> + <key>name</key> + <string>comment.line.percentage.directive.texshop.tex</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.comment.tex</string> + </dict> + </dict> + <key>match</key> + <string>(%).*$\n?</string> + <key>name</key> + <string>comment.line.percentage.tex</string> + </dict> + <dict> + <key>begin</key> + <string>\{</string> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.section.group.tex</string> + </dict> + </dict> + <key>end</key> + <string>\}</string> + <key>name</key> + <string>meta.group.braces.tex</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>$base</string> + </dict> + </array> + </dict> + <dict> + <key>match</key> + <string>[\[\]]</string> + <key>name</key> + <string>punctuation.definition.brackets.tex</string> + </dict> + <dict> + <key>begin</key> + <string>\$\$</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.tex</string> + </dict> + </dict> + <key>end</key> + <string>\$\$</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.tex</string> + </dict> + </dict> + <key>name</key> + <string>string.other.math.block.tex</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>text.tex.math</string> + </dict> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + <dict> + <key>match</key> + <string>\\\\</string> + <key>name</key> + <string>constant.character.newline.tex</string> + </dict> + <dict> + <key>begin</key> + <string>\$</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.tex</string> + </dict> + </dict> + <key>end</key> + <string>\$</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.tex</string> + </dict> + </dict> + <key>name</key> + <string>string.other.math.tex</string> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>\\\$</string> + <key>name</key> + <string>constant.character.escape.tex</string> + </dict> + <dict> + <key>include</key> + <string>text.tex.math</string> + </dict> + <dict> + <key>include</key> + <string>$self</string> + </dict> + </array> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.function.tex</string> + </dict> + </dict> + <key>match</key> + <string>(\\)[A-Za-z@]+</string> + <key>name</key> + <string>support.function.general.tex</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.tex</string> + </dict> + </dict> + <key>match</key> + <string>(\\)[^a-zA-Z@]</string> + <key>name</key> + <string>constant.character.escape.tex</string> + </dict> + <dict> + <key>match</key> + <string>«press a-z and space for greek letter»[a-zA-Z]*</string> + <key>name</key> + <string>meta.placeholder.greek.tex</string> + </dict> + </array> + <key>scopeName</key> + <string>text.tex</string> + <key>uuid</key> + <string>6BC8DE6F-9360-4C7E-AC3C-971385945346</string> +</dict> +</plist> diff --git a/app/rcc/edbee/syntaxfiles/Textile.tmLanguage b/app/rcc/edbee/syntaxfiles/Textile.tmLanguage new file mode 100644 index 00000000..d751a10e --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/Textile.tmLanguage @@ -0,0 +1,490 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>fileTypes</key> + <array> + <string>textile</string> + </array> + <key>firstLineMatch</key> + <string>textile</string> + <key>keyEquivalent</key> + <string>^~T</string> + <key>name</key> + <string>Textile</string> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>(^h[1-6]([<>=()]+)?)(\([^)]*\)|{[^}]*})*(\.)</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>entity.name.tag.heading.textile</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.type.textile</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>entity.name.tag.heading.textile</string> + </dict> + </dict> + <key>end</key> + <string>^$</string> + <key>name</key> + <string>markup.heading.textile</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#inline</string> + </dict> + <dict> + <key>include</key> + <string>text.html.basic</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(^bq([<>=()]+)?)(\([^)]*\)|{[^}]*})*(\.)</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>entity.name.tag.blockquote.textile</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.type.textile</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>entity.name.tag.blockquote.textile</string> + </dict> + </dict> + <key>end</key> + <string>^$</string> + <key>name</key> + <string>markup.quote.textile</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#inline</string> + </dict> + <dict> + <key>include</key> + <string>text.html.basic</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(^fn[0-9]+([<>=()]+)?)(\([^)]*\)|{[^}]*})*(\.)</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>entity.name.tag.footnote.textile</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.type.textile</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>entity.name.tag.footnote.textile</string> + </dict> + </dict> + <key>end</key> + <string>^$</string> + <key>name</key> + <string>markup.other.footnote.textile</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#inline</string> + </dict> + <dict> + <key>include</key> + <string>text.html.basic</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(^table([<>=()]+)?)(\([^)]*\)|{[^}]*})*(\.)</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>entity.name.tag.footnote.textile</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.type.textile</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>entity.name.tag.footnote.textile</string> + </dict> + </dict> + <key>end</key> + <string>^$</string> + <key>name</key> + <string>markup.other.table.textile</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#inline</string> + </dict> + <dict> + <key>include</key> + <string>text.html.basic</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>^(?=\S)</string> + <key>end</key> + <string>^$</string> + <key>name</key> + <string>meta.paragraph.textile</string> + <key>patterns</key> + <array> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>entity.name.tag.paragraph.textile</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.type.textile</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>entity.name.tag.paragraph.textile</string> + </dict> + </dict> + <key>match</key> + <string>(^p([<>=()]+)?)(\([^)]*\)|{[^}]*})*(\.)</string> + <key>name</key> + <string>entity.name.section.paragraph.textile</string> + </dict> + <dict> + <key>include</key> + <string>#inline</string> + </dict> + <dict> + <key>include</key> + <string>text.html.basic</string> + </dict> + </array> + </dict> + <dict> + <key>comment</key> + <string>Since html is valid in Textile include the html patterns</string> + <key>include</key> + <string>text.html.basic</string> + </dict> + </array> + <key>repository</key> + <dict> + <key>inline</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>comment</key> + <string>& is handled automagically by textile, so we match it to avoid text.html.basic from flagging it</string> + <key>match</key> + <string>&(?![A-Za-z0-9]+;)</string> + <key>name</key> + <string>text.html.textile</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>entity.name.type.textile</string> + </dict> + </dict> + <key>match</key> + <string>^\*+(\([^)]*\)|{[^}]*})*(\s+|$)</string> + <key>name</key> + <string>markup.list.unnumbered.textile</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>entity.name.type.textile</string> + </dict> + </dict> + <key>match</key> + <string>^#+(\([^)]*\)|{[^}]*})*\s+</string> + <key>name</key> + <string>markup.list.numbered.textile</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>string.other.link.title.textile</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>string.other.link.description.title.textile</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>constant.other.reference.link.textile</string> + </dict> + </dict> + <key>match</key> + <string>(?x) + " # Start name, etc + (?: # Attributes + # I swear, this is how the language is defined, + # couldnt make it up if I tried. + (?:\([^)]+\))?(?:\{[^}]+\})?(?:\[[^\]]+\])? + # Class, Style, Lang + | (?:\{[^}]+\})?(?:\[[^\]]+\])?(?:\([^)]+\))? + # Style, Lang, Class + | (?:\[[^\]]+\])?(?:\{[^}]+\})?(?:\([^)]+\))? + # Lang, Style, Class + )? + ([^"]+?) # Link name + \s? # Optional whitespace + (?:\(([^)]+?)\))? + ": # End name + (\w[-\w_]*) # Linkref + (?=[^\w\/;]*?(<|\s|$)) # Catch closing punctuation + # and end of meta.link + </string> + <key>name</key> + <string>meta.link.reference.textile</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>string.other.link.title.textile</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>string.other.link.description.title.textile</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>markup.underline.link.textile</string> + </dict> + </dict> + <key>match</key> + <string>(?x) + " # Start name, etc + (?: # Attributes + # I swear, this is how the language is defined, + # couldnt make it up if I tried. + (?:\([^)]+\))?(?:\{[^}]+\})?(?:\[[^\]]+\])? + # Class, Style, Lang + | (?:\{[^}]+\})?(?:\[[^\]]+\])?(?:\([^)]+\))? + # Style, Lang, Class + | (?:\[[^\]]+\])?(?:\{[^}]+\})?(?:\([^)]+\))? + # Lang, Style, Class + )? + ([^"]+?) # Link name + \s? # Optional whitespace + (?:\(([^)]+?)\))? + ": # End Name + (\S*?(?:\w|\/|;)) # URL + (?=[^\w\/;]*?(<|\s|$)) # Catch closing punctuation + # and end of meta.link + </string> + <key>name</key> + <string>meta.link.inline.textile</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>2</key> + <dict> + <key>name</key> + <string>markup.underline.link.image.textile</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>string.other.link.description.textile</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>markup.underline.link.textile</string> + </dict> + </dict> + <key>match</key> + <string>(?x) + \! # Open image + (\<|\=|\>)? # Optional alignment + (?: # Attributes + # I swear, this is how the language is defined, + # couldnt make it up if I tried. + (?:\([^)]+\))?(?:\{[^}]+\})?(?:\[[^\]]+\])? + # Class, Style, Lang + | (?:\{[^}]+\})?(?:\[[^\]]+\])?(?:\([^)]+\))? + # Style, Lang, Class + | (?:\[[^\]]+\])?(?:\{[^}]+\})?(?:\([^)]+\))? + # Lang, Style, Class + )? + (?:\.[ ])? # Optional + ([^\s(!]+?) # Image URL + \s? # Optional space + (?:\(((?:[^\(\)]|\([^\)]+\))+?)\))? # Optional title + \! # Close image + (?: + : + (\S*?(?:\w|\/|;)) # URL + (?=[^\w\/;]*?(<|\s|$)) # Catch closing punctuation + )? + </string> + <key>name</key> + <string>meta.image.inline.textile</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>entity.name.type.textile</string> + </dict> + </dict> + <key>match</key> + <string>\|(\([^)]*\)|{[^}]*})*(\\\||.)+\|</string> + <key>name</key> + <string>markup.other.table.cell.textile</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.type.textile</string> + </dict> + </dict> + <key>match</key> + <string>\B(\*\*?)((\([^)]*\)|{[^}]*}|\[[^]]+\]){0,3})(\S.*?\S|\S)\1\B</string> + <key>name</key> + <string>markup.bold.textile</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.name.type.textile</string> + </dict> + </dict> + <key>match</key> + <string>\B-((\([^)]*\)|{[^}]*}|\[[^]]+\]){0,3})(\S.*?\S|\S)-\B</string> + <key>name</key> + <string>markup.deleted.textile</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.name.type.textile</string> + </dict> + </dict> + <key>match</key> + <string>\B\+((\([^)]*\)|{[^}]*}|\[[^]]+\]){0,3})(\S.*?\S|\S)\+\B</string> + <key>name</key> + <string>markup.inserted.textile</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.name.type.textile</string> + </dict> + </dict> + <key>match</key> + <string>(?:\b|\s)_((\([^)]*\)|{[^}]*}|\[[^]]+\]){0,3})(\S.*?\S|\S)_(?:\b|\s)</string> + <key>name</key> + <string>markup.italic.textile</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.type.textile</string> + </dict> + </dict> + <key>match</key> + <string>\B([@\^~%]|\?\?)((\([^)]*\)|{[^}]*}|\[[^]]+\]){0,3})(\S.*?\S|\S)\1</string> + <key>name</key> + <string>markup.italic.phrasemodifiers.textile</string> + </dict> + <dict> + <key>comment</key> + <string>Footnotes</string> + <key>match</key> + <string>(?<!w)\[[0-9+]\]</string> + <key>name</key> + <string>entity.name.tag.textile</string> + </dict> + </array> + </dict> + </dict> + <key>scopeName</key> + <string>text.html.textile</string> + <key>uuid</key> + <string>68F0B1A5-3274-4E85-8B3A-A481C5F5B194</string> +</dict> +</plist> diff --git a/app/rcc/edbee/syntaxfiles/XML.tmLanguage b/app/rcc/edbee/syntaxfiles/XML.tmLanguage new file mode 100644 index 00000000..9438f600 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/XML.tmLanguage @@ -0,0 +1,589 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>fileTypes</key> + <array> + <string>xml</string> + <string>tld</string> + <string>jsp</string> + <string>pt</string> + <string>cpt</string> + <string>dtml</string> + <string>rss</string> + <string>opml</string> + </array> + <key>foldingStartMarker</key> + <string>^\s*(<[^!?%/](?!.+?(/>|</.+?>))|<[!%]--(?!.+?--%?>)|<%[!]?(?!.+?%>))</string> + <key>foldingStopMarker</key> + <string>^\s*(</[^>]+>|[/%]>|-->)\s*$</string> + <key>keyEquivalent</key> + <string>^~X</string> + <key>name</key> + <string>XML</string> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>(<\?)\s*([-_a-zA-Z0-9]+)</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.tag.begin.xml</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.name.tag.xml</string> + </dict> + </dict> + <key>end</key> + <string>(\?>)</string> + <key>name</key> + <string>meta.tag.preprocessor.xml</string> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string> ([a-zA-Z-]+)</string> + <key>name</key> + <string>entity.other.attribute-name.xml</string> + </dict> + <dict> + <key>include</key> + <string>#doublequotedString</string> + </dict> + <dict> + <key>include</key> + <string>#singlequotedString</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(<!)(DOCTYPE)\s+([:a-zA-Z_][:a-zA-Z0-9_.-]*)</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.tag.begin.xml</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>keyword.doctype.xml</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>variable.documentroot.xml</string> + </dict> + </dict> + <key>end</key> + <string>\s*(>)</string> + <key>name</key> + <string>meta.tag.sgml.doctype.xml</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#internalSubset</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string><[!%]--</string> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.comment.xml</string> + </dict> + </dict> + <key>end</key> + <string>--%?></string> + <key>name</key> + <string>comment.block.xml</string> + </dict> + <dict> + <key>begin</key> + <string>(<)((?:([-_a-zA-Z0-9]+)((:)))?([-_a-zA-Z0-9:]+))(?=(\s[^>]*)?></\2>)</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.tag.begin.xml</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.tag.namespace.xml</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>entity.name.tag.xml</string> + </dict> + <key>5</key> + <dict> + <key>name</key> + <string>punctuation.separator.namespace.xml</string> + </dict> + <key>6</key> + <dict> + <key>name</key> + <string>entity.name.tag.localname.xml</string> + </dict> + </dict> + <key>end</key> + <string>(>)(<)(/)(?:([-_a-zA-Z0-9]+)((:)))?([-_a-zA-Z0-9:]+)(>)</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.tag.end.xml</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.tag.begin.xml meta.scope.between-tag-pair.xml</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.tag.begin.xml</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>entity.name.tag.namespace.xml</string> + </dict> + <key>5</key> + <dict> + <key>name</key> + <string>entity.name.tag.xml</string> + </dict> + <key>6</key> + <dict> + <key>name</key> + <string>punctuation.separator.namespace.xml</string> + </dict> + <key>7</key> + <dict> + <key>name</key> + <string>entity.name.tag.localname.xml</string> + </dict> + <key>8</key> + <dict> + <key>name</key> + <string>punctuation.definition.tag.end.xml</string> + </dict> + </dict> + <key>name</key> + <string>meta.tag.no-content.xml</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#tagStuff</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>(</?)(?:([-_a-zA-Z0-9]+)((:)))?([-_a-zA-Z0-9:]+)</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.tag.begin.xml</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.name.tag.namespace.xml</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.tag.xml</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>punctuation.separator.namespace.xml</string> + </dict> + <key>5</key> + <dict> + <key>name</key> + <string>entity.name.tag.localname.xml</string> + </dict> + </dict> + <key>end</key> + <string>(/?>)</string> + <key>endCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.tag.end.xml</string> + </dict> + </dict> + <key>name</key> + <string>meta.tag.xml</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#tagStuff</string> + </dict> + </array> + </dict> + <dict> + <key>include</key> + <string>#entity</string> + </dict> + <dict> + <key>include</key> + <string>#bare-ampersand</string> + </dict> + <dict> + <key>begin</key> + <string><%@</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.section.embedded.begin.xml</string> + </dict> + </dict> + <key>end</key> + <string>%></string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.section.embedded.end.xml</string> + </dict> + </dict> + <key>name</key> + <string>source.java-props.embedded.xml</string> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>page|include|taglib</string> + <key>name</key> + <string>keyword.other.page-props.xml</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string><%[!=]?(?!--)</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.section.embedded.begin.xml</string> + </dict> + </dict> + <key>end</key> + <string>(?!--)%></string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.section.embedded.end.xml</string> + </dict> + </dict> + <key>name</key> + <string>source.java.embedded.xml</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>source.java</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string><!\[CDATA\[</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.xml</string> + </dict> + </dict> + <key>end</key> + <string>]]></string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.xml</string> + </dict> + </dict> + <key>name</key> + <string>string.unquoted.cdata.xml</string> + </dict> + </array> + <key>repository</key> + <dict> + <key>EntityDecl</key> + <dict> + <key>begin</key> + <string>(<!)(ENTITY)\s+(%\s+)?([:a-zA-Z_][:a-zA-Z0-9_.-]*)(\s+(?:SYSTEM|PUBLIC)\s+)?</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.tag.begin.xml</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>keyword.entity.xml</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.entity.xml</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>variable.entity.xml</string> + </dict> + <key>5</key> + <dict> + <key>name</key> + <string>keyword.entitytype.xml</string> + </dict> + </dict> + <key>end</key> + <string>(>)</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#doublequotedString</string> + </dict> + <dict> + <key>include</key> + <string>#singlequotedString</string> + </dict> + </array> + </dict> + <key>bare-ampersand</key> + <dict> + <key>match</key> + <string>&</string> + <key>name</key> + <string>invalid.illegal.bad-ampersand.xml</string> + </dict> + <key>doublequotedString</key> + <dict> + <key>begin</key> + <string>"</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.xml</string> + </dict> + </dict> + <key>end</key> + <string>"</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.xml</string> + </dict> + </dict> + <key>name</key> + <string>string.quoted.double.xml</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#entity</string> + </dict> + <dict> + <key>include</key> + <string>#bare-ampersand</string> + </dict> + </array> + </dict> + <key>entity</key> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.xml</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.xml</string> + </dict> + </dict> + <key>match</key> + <string>(&)([:a-zA-Z_][:a-zA-Z0-9_.-]*|#[0-9]+|#x[0-9a-fA-F]+)(;)</string> + <key>name</key> + <string>constant.character.entity.xml</string> + </dict> + <key>internalSubset</key> + <dict> + <key>begin</key> + <string>(\[)</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.xml</string> + </dict> + </dict> + <key>end</key> + <string>(\])</string> + <key>name</key> + <string>meta.internalsubset.xml</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#EntityDecl</string> + </dict> + <dict> + <key>include</key> + <string>#parameterEntity</string> + </dict> + </array> + </dict> + <key>parameterEntity</key> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.xml</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.xml</string> + </dict> + </dict> + <key>match</key> + <string>(%)([:a-zA-Z_][:a-zA-Z0-9_.-]*)(;)</string> + <key>name</key> + <string>constant.character.parameter-entity.xml</string> + </dict> + <key>singlequotedString</key> + <dict> + <key>begin</key> + <string>'</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.xml</string> + </dict> + </dict> + <key>end</key> + <string>'</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.xml</string> + </dict> + </dict> + <key>name</key> + <string>string.quoted.single.xml</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#entity</string> + </dict> + <dict> + <key>include</key> + <string>#bare-ampersand</string> + </dict> + </array> + </dict> + <key>tagStuff</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>entity.other.attribute-name.namespace.xml</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.other.attribute-name.xml</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.separator.namespace.xml</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>entity.other.attribute-name.localname.xml</string> + </dict> + </dict> + <key>match</key> + <string> (?:([-_a-zA-Z0-9]+)((:)))?([-_a-zA-Z0-9]+)=</string> + </dict> + <dict> + <key>include</key> + <string>#doublequotedString</string> + </dict> + <dict> + <key>include</key> + <string>#singlequotedString</string> + </dict> + </array> + </dict> + </dict> + <key>scopeName</key> + <string>text.xml</string> + <key>uuid</key> + <string>D3C4E6DA-6B1C-11D9-8CC2-000D93589AF6</string> +</dict> +</plist> diff --git a/app/rcc/edbee/syntaxfiles/XSL.tmLanguage b/app/rcc/edbee/syntaxfiles/XSL.tmLanguage new file mode 100644 index 00000000..7dc86c59 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/XSL.tmLanguage @@ -0,0 +1,157 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>fileTypes</key> + <array> + <string>xsl</string> + <string>xslt</string> + </array> + <key>foldingStartMarker</key> + <string>^\s*(<[^!?%/](?!.+?(/>|</.+?>))|<[!%]--(?!.+?--%?>)|<%[!]?(?!.+?%>))</string> + <key>foldingStopMarker</key> + <string>^\s*(</[^>]+>|[/%]>|-->)\s*$</string> + <key>keyEquivalent</key> + <string>^~X</string> + <key>name</key> + <string>XSL</string> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>(<)(xsl)((:))(template)</string> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.tag.xml</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.name.tag.namespace.xml</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>entity.name.tag.xml</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>punctuation.separator.namespace.xml</string> + </dict> + <key>5</key> + <dict> + <key>name</key> + <string>entity.name.tag.localname.xml</string> + </dict> + </dict> + <key>end</key> + <string>(>)</string> + <key>name</key> + <string>meta.tag.xml.template</string> + <key>patterns</key> + <array> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>entity.other.attribute-name.namespace.xml</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.other.attribute-name.xml</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.separator.namespace.xml</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>entity.other.attribute-name.localname.xml</string> + </dict> + </dict> + <key>match</key> + <string> (?:([-_a-zA-Z0-9]+)((:)))?([a-zA-Z-]+)</string> + </dict> + <dict> + <key>include</key> + <string>#doublequotedString</string> + </dict> + <dict> + <key>include</key> + <string>#singlequotedString</string> + </dict> + </array> + </dict> + <dict> + <key>include</key> + <string>text.xml</string> + </dict> + </array> + <key>repository</key> + <dict> + <key>doublequotedString</key> + <dict> + <key>begin</key> + <string>"</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.xml</string> + </dict> + </dict> + <key>end</key> + <string>"</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.xml</string> + </dict> + </dict> + <key>name</key> + <string>string.quoted.double.xml</string> + </dict> + <key>singlequotedString</key> + <dict> + <key>begin</key> + <string>'</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.xml</string> + </dict> + </dict> + <key>end</key> + <string>'</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.xml</string> + </dict> + </dict> + <key>name</key> + <string>string.quoted.single.xml</string> + </dict> + </dict> + <key>scopeName</key> + <string>text.xml.xsl</string> + <key>uuid</key> + <string>DB8033A1-6D8E-4D80-B8A2-8768AAC6125D</string> +</dict> +</plist> diff --git a/app/rcc/edbee/syntaxfiles/YAML.tmLanguage b/app/rcc/edbee/syntaxfiles/YAML.tmLanguage new file mode 100644 index 00000000..1fb3041c --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/YAML.tmLanguage @@ -0,0 +1,466 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>fileTypes</key> + <array> + <string>yaml</string> + <string>yml</string> + </array> + <key>foldingStartMarker</key> + <string>^[^#]\s*.*:(\s*\[?| &.+)?$</string> + <key>foldingStopMarker</key> + <string>^\s*$|^\s*\}|^\s*\]|^\s*\)</string> + <key>keyEquivalent</key> + <string>^~Y</string> + <key>name</key> + <string>YAML</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#erb</string> + </dict> + <dict> + <key>begin</key> + <string>^(\s*)(?:(-)|(?:(-\s*)?(\w+\s*(:))))\s*(\||>)</string> + <key>beginCaptures</key> + <dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.entry.yaml</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.entry.yaml</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>entity.name.tag.yaml</string> + </dict> + <key>5</key> + <dict> + <key>name</key> + <string>punctuation.separator.key-value.yaml</string> + </dict> + </dict> + <key>end</key> + <string>^(?!^\1)|^(?=\1(-|\w+\s*:)|#)</string> + <key>name</key> + <string>string.unquoted.block.yaml</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#erb</string> + </dict> + </array> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.entry.yaml</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.name.tag.yaml</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.separator.key-value.yaml</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>punctuation.definition.entry.yaml</string> + </dict> + </dict> + <key>match</key> + <string>(?:(?:(-\s*)?(\w+\s*(:)))|(-))\s*((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\s*$</string> + <key>name</key> + <string>constant.numeric.yaml</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.entry.yaml</string> + </dict> + <key>10</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.yaml</string> + </dict> + <key>11</key> + <dict> + <key>name</key> + <string>string.unquoted.yaml</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.name.tag.yaml</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.separator.key-value.yaml</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>punctuation.definition.entry.yaml</string> + </dict> + <key>5</key> + <dict> + <key>name</key> + <string>string.quoted.double.yaml</string> + </dict> + <key>6</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.yaml</string> + </dict> + <key>7</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.yaml</string> + </dict> + <key>8</key> + <dict> + <key>name</key> + <string>string.quoted.single.yaml</string> + </dict> + <key>9</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.yaml</string> + </dict> + </dict> + <key>match</key> + <string>(?:(?:(-\s*)?(\w+\s*(:)))|(-))\s*(?:((")[^"]*("))|((')[^']*('))|([^,{}&#\[\]]+))\s*</string> + <key>name</key> + <string>string.unquoted.yaml</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.entry.yaml</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>entity.name.tag.yaml</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.separator.key-value.yaml</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>punctuation.definition.entry.yaml</string> + </dict> + </dict> + <key>match</key> + <string>(?:(?:(-\s*)?(\w+\s*(:)))|(-))\s*([0-9]{4}-[0-9]{2}-[0-9]{2})\s*$</string> + <key>name</key> + <string>constant.other.date.yaml</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>entity.name.tag.yaml</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.separator.key-value.yaml</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>keyword.other.omap.yaml</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.yaml</string> + </dict> + </dict> + <key>match</key> + <string>(\w.*?)(:)\s*((\!\!)omap)?</string> + <key>name</key> + <string>meta.tag.yaml</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.variable.yaml</string> + </dict> + </dict> + <key>match</key> + <string>(\&|\*)\w.*?$</string> + <key>name</key> + <string>variable.other.yaml</string> + </dict> + <dict> + <key>begin</key> + <string>"</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.yaml</string> + </dict> + </dict> + <key>end</key> + <string>"</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.yaml</string> + </dict> + </dict> + <key>name</key> + <string>string.quoted.double.yaml</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#escaped_char</string> + </dict> + <dict> + <key>include</key> + <string>#erb</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>'</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.yaml</string> + </dict> + </dict> + <key>end</key> + <string>'</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.yaml</string> + </dict> + </dict> + <key>name</key> + <string>string.quoted.single.yaml</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#escaped_char</string> + </dict> + <dict> + <key>include</key> + <string>#erb</string> + </dict> + </array> + </dict> + <dict> + <key>begin</key> + <string>`</string> + <key>beginCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.begin.yaml</string> + </dict> + </dict> + <key>end</key> + <string>`</string> + <key>endCaptures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.end.yaml</string> + </dict> + </dict> + <key>name</key> + <string>string.interpolated.yaml</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#escaped_char</string> + </dict> + <dict> + <key>include</key> + <string>#erb</string> + </dict> + </array> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>entity.name.tag.yaml</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>keyword.operator.merge-key.yaml</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.keyword.yaml</string> + </dict> + </dict> + <key>match</key> + <string>(\<\<): ((\*).*)$</string> + <key>name</key> + <string>keyword.operator.merge-key.yaml</string> + </dict> + <dict> + <key>disabled</key> + <string>1</string> + <key>match</key> + <string>( | )+$</string> + <key>name</key> + <string>invalid.deprecated.trailing-whitespace.yaml</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.comment.yaml</string> + </dict> + </dict> + <key>match</key> + <string>(?<!\$)(#)(?!\{).*$\n?</string> + <key>name</key> + <string>comment.line.number-sign.yaml</string> + </dict> + <dict> + <key>match</key> + <string>-</string> + <key>name</key> + <string>keyword.operator.symbol</string> + </dict> + <dict> + <key>begin</key> + <string>^(?=\t)</string> + <key>end</key> + <string>(?=[^\t])</string> + <key>name</key> + <string>meta.leading-tabs.yaml</string> + <key>patterns</key> + <array> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>meta.odd-tab</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>meta.even-tab</string> + </dict> + </dict> + <key>match</key> + <string>(\t)(\t)?</string> + </dict> + </array> + </dict> + </array> + <key>repository</key> + <dict> + <key>erb</key> + <dict> + <key>begin</key> + <string><%+(?!>)=?</string> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.section.embedded.ruby</string> + </dict> + </dict> + <key>end</key> + <string>%></string> + <key>name</key> + <string>source.ruby.rails.embedded.html</string> + <key>patterns</key> + <array> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.comment.ruby</string> + </dict> + </dict> + <key>match</key> + <string>(#).*?(?=%>)</string> + <key>name</key> + <string>comment.line.number-sign.ruby</string> + </dict> + <dict> + <key>include</key> + <string>source.ruby.rails</string> + </dict> + </array> + </dict> + <key>escaped_char</key> + <dict> + <key>match</key> + <string>\\.</string> + <key>name</key> + <string>constant.character.escape.yaml</string> + </dict> + </dict> + <key>scopeName</key> + <string>source.yaml</string> + <key>uuid</key> + <string>B0C44228-4F1F-11DA-AFF2-000A95AF0064</string> +</dict> +</plist> diff --git a/app/rcc/edbee/syntaxfiles/reStructuredText.tmLanguage b/app/rcc/edbee/syntaxfiles/reStructuredText.tmLanguage new file mode 100644 index 00000000..a0c8b8b1 --- /dev/null +++ b/app/rcc/edbee/syntaxfiles/reStructuredText.tmLanguage @@ -0,0 +1,654 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>comment</key> + <string>syntax highlighting for reStructuredText http://docutils.sourceforge.net, based on rst mode from jEdit</string> + <key>fileTypes</key> + <array> + <string>rst</string> + <string>rest</string> + </array> + <key>keyEquivalent</key> + <string>^~R</string> + <key>name</key> + <string>reStructuredText</string> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>^([ \t]*)(?=\S)</string> + <key>contentName</key> + <string>meta.paragraph.restructuredtext</string> + <key>end</key> + <string>^(?!\1(?=\S))</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>#inline</string> + </dict> + </array> + </dict> + </array> + <key>repository</key> + <dict> + <key>inline</key> + <dict> + <key>patterns</key> + <array> + <dict> + <key>begin</key> + <string>^([ \t]*)((\.\.)\sraw(::)) html</string> + <key>captures</key> + <dict> + <key>2</key> + <dict> + <key>name</key> + <string>meta.directive.restructuredtext</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.directive.restructuredtext</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>punctuation.separator.key-value.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>directives.html</string> + <key>end</key> + <string>^(?!\1[ \t])</string> + <key>patterns</key> + <array> + <dict> + <key>include</key> + <string>text.html.basic</string> + </dict> + </array> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.directive.restructuredtext</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.separator.key-value.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>directives</string> + <key>match</key> + <string>(\.\.)\s[A-z][A-z0-9-_]+(::)\s*$</string> + <key>name</key> + <string>meta.other.directive.restructuredtext</string> + </dict> + <dict> + <key>begin</key> + <string>^([ \t]*).*?((::))</string> + <key>captures</key> + <dict> + <key>2</key> + <dict> + <key>name</key> + <string>markup.raw.restructuredtext</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.raw.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>verbatim blocks</string> + <key>end</key> + <string>^(?=\1[^\s]+)</string> + <key>name</key> + <string>meta.raw.block.restructuredtext</string> + <key>patterns</key> + <array> + <dict> + <key>match</key> + <string>.+</string> + <key>name</key> + <string>markup.raw.restructuredtext</string> + </dict> + </array> + </dict> + <dict> + <key>comment</key> + <string>directives</string> + <key>match</key> + <string>::</string> + <key>name</key> + <string>meta.startraw.restructuredtext</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.italic.restructuredtext</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.italic.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>strong emphasis</string> + <key>match</key> + <string>(\*\*)[^*]+(\*\*)</string> + <key>name</key> + <string>markup.bold.restructuredtext</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.italic.restructuredtext</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.italic.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>emphasis</string> + <key>match</key> + <string>(\*)\w[^*]+\w(\*)</string> + <key>name</key> + <string>markup.italic.restructuredtext</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.link.restructuredtext</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.string.restructuredtext</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>string.other.link.title.restructuredtext</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>punctuation.separator.key-value.restructuredtext</string> + </dict> + <key>5</key> + <dict> + <key>name</key> + <string>markup.underline.link.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>replacement</string> + <key>match</key> + <string>(\.\.)\s+(_)([\w\s]+)(:)\s+(.*)</string> + <key>name</key> + <string>meta.link.reference.def.restructuredtext</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.substitution.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>substitution</string> + <key>match</key> + <string>(\|)[^|]+(\|_{0,2})</string> + <key>name</key> + <string>markup.underline.substitution.restructuredtext</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>string.other.link.title.restructuredtext</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.link.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>links `...`_ or `...`__</string> + <key>match</key> + <string>\b(\w+)(_)\b</string> + <key>name</key> + <string>meta.link.reference</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.link.restructuredtext</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>string.other.link.title.restructuredtext</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.link.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>links `...`_ or `...`__</string> + <key>match</key> + <string>(`)([\w\s]+)(`_)</string> + <key>name</key> + <string>meta.link.reference</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.link.restructuredtext</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>string.other.link.title.restructuredtext</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.location.restructuredtext</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>markup.underline.link.restructuredtext</string> + </dict> + <key>5</key> + <dict> + <key>name</key> + <string>punctuation.definition.location.restructuredtext</string> + </dict> + <key>6</key> + <dict> + <key>name</key> + <string>punctuation.definition.link.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>links `...`_ </string> + <key>match</key> + <string>(`)([\w\s]+)\s+(<)(.*?)(>)(`_)</string> + <key>name</key> + <string>meta.link.inline.restructuredtext</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.link.restructuredtext</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>constant.other.footnote.link.restructuredtext</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.restructuredtext</string> + </dict> + <key>6</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.restructuredtext</string> + </dict> + <key>7</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.restructuredtext</string> + </dict> + <key>8</key> + <dict> + <key>name</key> + <string>string.other.footnote.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>replacement</string> + <key>match</key> + <string>^(\.\.)\s+((\[)(((#?)[^]]*?)|\*)(\]))\s+(.*)</string> + <key>name</key> + <string>meta.link.footnote.def.restructuredtext</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>constant.other.footnote.link</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.restructuredtext</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.restructuredtext</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>footnote reference: [0]_</string> + <key>match</key> + <string>((\[)[0-9]+(\]))(_)</string> + <key>name</key> + <string>meta.link.footnote.numeric.restructuredtext</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>constant.other.footnote.link</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.restructuredtext</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.restructuredtext</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>footnote reference [#]_ or [#foo]_</string> + <key>match</key> + <string>((\[#)[A-z0-9_]*(\]))(_)</string> + <key>name</key> + <string>meta.link.footnote.auto.restructuredtext</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>constant.other.footnote.link.restructuredtext</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.restructuredtext</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.restructuredtext</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>footnote reference [*]_</string> + <key>match</key> + <string>((\[)\*(\]))(_)</string> + <key>name</key> + <string>meta.link.footnote.symbol.auto.restructuredtext</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.link.restructuredtext</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>constant.other.citation.link.restructuredtext</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.restructuredtext</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.restructuredtext</string> + </dict> + <key>5</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.restructuredtext</string> + </dict> + <key>6</key> + <dict> + <key>name</key> + <string>string.other.citation.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>replacement</string> + <key>match</key> + <string>^(\.\.)\s+((\[)[A-z][A-z0-9]*(\]))(_)\s+(.*)</string> + <key>name</key> + <string>meta.link.citation.def.restructuredtext</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>constant.other.citation.link.restructuredtext</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.restructuredtext</string> + </dict> + <key>3</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.restructuredtext</string> + </dict> + <key>4</key> + <dict> + <key>name</key> + <string>punctuation.definition.constant.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>citation reference</string> + <key>match</key> + <string>((\[)[A-z][A-z0-9_-]*(\]))(_)</string> + <key>name</key> + <string>meta.link.citation.restructuredtext</string> + </dict> + <dict> + <key>begin</key> + <string>``</string> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.raw.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>inline literal</string> + <key>end</key> + <string>``</string> + <key>name</key> + <string>markup.raw.restructuredtext</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.intepreted.restructuredtext</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.intepreted.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>intepreted text</string> + <key>match</key> + <string>(`)[^`]+(`)(?!_)</string> + <key>name</key> + <string>markup.other.command.restructuredtext</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.field.restructuredtext</string> + </dict> + <key>2</key> + <dict> + <key>name</key> + <string>punctuation.definition.field.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>field list</string> + <key>match</key> + <string>(:)[A-z][A-z0-9 =\s\t_]*(:)</string> + <key>name</key> + <string>entity.name.tag.restructuredtext</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.table.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>table</string> + <key>match</key> + <string>\+-[+-]+</string> + <key>name</key> + <string>markup.other.table.restructuredtext</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>0</key> + <dict> + <key>name</key> + <string>punctuation.definition.table.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>table</string> + <key>match</key> + <string>\+=[+=]+</string> + <key>name</key> + <string>markup.other.table.restructuredtext</string> + </dict> + <dict> + <key>captures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.heading.restructuredtext</string> + </dict> + </dict> + <key>match</key> + <string>(^(=|-|~|`|#|"|\^|\+|\*){3,}$){1,1}?</string> + <key>name</key> + <string>markup.heading.restructuredtext</string> + </dict> + <dict> + <key>begin</key> + <string>^(\.\.)</string> + <key>beginCaptures</key> + <dict> + <key>1</key> + <dict> + <key>name</key> + <string>punctuation.definition.comment.restructuredtext</string> + </dict> + </dict> + <key>comment</key> + <string>comment</string> + <key>end</key> + <string>$\n?</string> + <key>name</key> + <string>comment.line.double-dot.restructuredtext</string> + </dict> + </array> + </dict> + </dict> + <key>scopeName</key> + <string>text.restructuredtext</string> + <key>uuid</key> + <string>62DA9AD6-36E1-4AB7-BB87-E933AD9FD1A4</string> +</dict> +</plist> \ No newline at end of file diff --git a/app/rcc/edbee/themes/All Hallow's Eve.tmTheme b/app/rcc/edbee/themes/All Hallow's Eve.tmTheme new file mode 100644 index 00000000..47a67978 --- /dev/null +++ b/app/rcc/edbee/themes/All Hallow's Eve.tmTheme @@ -0,0 +1,277 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>author</key> + <string>David Heinemeier Hansson</string> + <key>name</key> + <string>All Hallow's Eve</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#000000</string> + <key>caret</key> + <string>#FFFFFF</string> + <key>foreground</key> + <string>#FFFFFF</string> + <key>invisibles</key> + <string>#404040</string> + <key>lineHighlight</key> + <string>#333300</string> + <key>selection</key> + <string>#73597EE0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Text base</string> + <key>scope</key> + <string>text</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#434242</string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Source base</string> + <key>scope</key> + <string>source</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#000000</string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#9933CC</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Constant</string> + <key>scope</key> + <string>constant</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#3387CC</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#CC7833</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Pre-processor Line</string> + <key>scope</key> + <string>meta.preprocessor.c</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#D0D0FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Pre-processor Directive</string> + <key>scope</key> + <string>keyword.control.import</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function name</string> + <key>scope</key> + <string>entity.name.function</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function argument</string> + <key>scope</key> + <string>variable.parameter</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Block comment</string> + <key>scope</key> + <string>source comment.block</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#9B9B9B</string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String</string> + <key>scope</key> + <string>string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#66CC33</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String escapes</string> + <key>scope</key> + <string>string constant.character.escape</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#AAAAAA</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String (executed)</string> + <key>scope</key> + <string>string.interpolated</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#CCCC33</string> + <key>foreground</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Regular expression</string> + <key>scope</key> + <string>string.regexp</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CCCC33</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String (literal)</string> + <key>scope</key> + <string>string.literal</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CCCC33</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String escapes (executed)</string> + <key>scope</key> + <string>string.interpolated constant.character.escape</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#555555</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Type name</string> + <key>scope</key> + <string>entity.name.type</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Class inheritance</string> + <key>scope</key> + <string>entity.other.inherited-class</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tag name</string> + <key>scope</key> + <string>entity.name.tag</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tag attribute</string> + <key>scope</key> + <string>entity.other.attribute-name</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Support function</string> + <key>scope</key> + <string>support.function</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#C83730</string> + </dict> + </dict> + </array> + <key>uuid</key> + <string>37F22BDC-B2F4-11D9-850C-000A95A89C98</string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/Amy.tmTheme b/app/rcc/edbee/themes/Amy.tmTheme new file mode 100644 index 00000000..b3258c46 --- /dev/null +++ b/app/rcc/edbee/themes/Amy.tmTheme @@ -0,0 +1,557 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>name</key> + <string>Amy</string> + <key>author</key> + <string>William D. Neumann</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#200020</string> + <key>caret</key> + <string>#7070FF</string> + <key>foreground</key> + <string>#D0D0FF</string> + <key>invisibles</key> + <string>#BFBFBF</string> + <key>lineHighlight</key> + <string>#80000040</string> + <key>selection</key> + <string>#80000080</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>comment.block</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#200020</string> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#404080</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String</string> + <key>scope</key> + <string>string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#999999</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Built-in constant</string> + <key>scope</key> + <string>constant.language</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#707090</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Integer</string> + <key>scope</key> + <string>constant.numeric</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#7090B0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Int32 constant</string> + <key>scope</key> + <string>constant.numeric.integer.int32</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Int64 constant</string> + <key>scope</key> + <string>constant.numeric.integer.int64</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Nativeint constant</string> + <key>scope</key> + <string>constant.numeric.integer.nativeint</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Floating-point constant</string> + <key>scope</key> + <string>constant.numeric.floating-point.ocaml</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Character constant</string> + <key>scope</key> + <string>constant.character</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#666666</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Boolean constant</string> + <key>scope</key> + <string>constant.language.boolean</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#8080A0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Built-in constant</string> + <key>scope</key> + <string>constant.language</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>User-defined constant</string> + <key>scope</key> + <string>constant.other</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Variable</string> + <key>scope</key> + <string>variable.language, variable.other</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#008080</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A080FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword operator</string> + <key>scope</key> + <string>keyword.operator</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A0A0FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword decorator</string> + <key>scope</key> + <string>keyword.other.decorator</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D0D0FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Floating-point infix operator</string> + <key>scope</key> + <string>keyword.operator.infix.floating-point.ocaml</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Floating-point prefix operator</string> + <key>scope</key> + <string>keyword.operator.prefix.floating-point.ocaml</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Compiler directives</string> + <key>scope</key> + <string>keyword.other.directive</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#C080C0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Line-number directives</string> + <key>scope</key> + <string>keyword.other.directive.line-number</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + <key>foreground</key> + <string>#C080C0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Control keyword</string> + <key>scope</key> + <string>keyword.control</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#80A0FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Storage</string> + <key>scope</key> + <string>storage</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#B0FFF0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Variants</string> + <key>scope</key> + <string>entity.name.type.variant</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#60B0FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Polymorphic variants</string> + <key>scope</key> + <string>storage.type.variant.polymorphic, entity.name.type.variant.polymorphic</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#60B0FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Module definitions</string> + <key>scope</key> + <string>entity.name.type.module</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#B000B0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Module type definitions</string> + <key>scope</key> + <string>entity.name.type.module-type.ocaml</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + <key>foreground</key> + <string>#B000B0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Support modules</string> + <key>scope</key> + <string>support.other</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A00050</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Class name</string> + <key>scope</key> + <string>entity.name.type.class</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#70E080</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Class type</string> + <key>scope</key> + <string>entity.name.type.class-type</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#70E0A0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Inherited class</string> + <key>scope</key> + <string>entity.other.inherited-class</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Function name</string> + <key>scope</key> + <string>entity.name.function</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#50A0A0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function argument</string> + <key>scope</key> + <string>variable.parameter</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#80B0B0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Token definition (ocamlyacc)</string> + <key>scope</key> + <string>entity.name.type.token</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#3080A0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Token reference (ocamlyacc)</string> + <key>scope</key> + <string>entity.name.type.token.reference</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#3CB0D0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Non-terminal definition (ocamlyacc)</string> + <key>scope</key> + <string>entity.name.function.non-terminal</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#90E0E0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Non-terminal reference (ocamlyacc)</string> + <key>scope</key> + <string>entity.name.function.non-terminal.reference</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#C0F0F0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tag name</string> + <key>scope</key> + <string>entity.name.tag</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#009090</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tag attribute</string> + <key>scope</key> + <string>entity.other.attribute-name</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Library function</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#200020</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library constant</string> + <key>scope</key> + <string>support.constant</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#200020</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library class/type</string> + <key>scope</key> + <string>support.type, support.class</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Library variable</string> + <key>scope</key> + <string>support.other.variable</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Invalid - illegal</string> + <key>scope</key> + <string>invalid.illegal</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFF00</string> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#400080</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid - depricated</string> + <key>scope</key> + <string>invalid.deprecated</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#CC66FF</string> + <key>foreground</key> + <string>#200020</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Camlp4 code</string> + <key>scope</key> + <string>source.camlp4.embedded</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#40008054</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Camlp4 temp (parser)</string> + <key>scope</key> + <string>source.camlp4.embedded.parser.ocaml</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Punctuation</string> + <key>scope</key> + <string>punctuation</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#805080</string> + </dict> + </dict> + </array> + <key>uuid</key> + <string>3C01FADD-7592-49DD-B7A5-1B82CA4E57B5</string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/Blackboard.tmTheme b/app/rcc/edbee/themes/Blackboard.tmTheme new file mode 100644 index 00000000..18bb72e3 --- /dev/null +++ b/app/rcc/edbee/themes/Blackboard.tmTheme @@ -0,0 +1,350 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>name</key> + <string>Blackboard</string> + <key>author</key> + <string>Domenico Carbotta</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#0C1021</string> + <key>caret</key> + <string>#FFFFFFA6</string> + <key>foreground</key> + <string>#F8F8F8</string> + <key>invisibles</key> + <string>#FFFFFF40</string> + <key>lineHighlight</key> + <string>#FFFFFF0F</string> + <key>selection</key> + <string>#253B76</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#AEAEAE</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Constant</string> + <key>scope</key> + <string>constant</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#D8FA3C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Entity</string> + <key>scope</key> + <string>entity</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FF6400</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FBDE2D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Storage</string> + <key>scope</key> + <string>storage</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FBDE2D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String</string> + <key>scope</key> + <string>string, meta.verbatim</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#61CE3C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Support</string> + <key>scope</key> + <string>support</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#8DA6CE</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Variable</string> + <key>scope</key> + <string>variable</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid – Deprecated</string> + <key>scope</key> + <string>invalid.deprecated</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#AB2A1D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid – Illegal</string> + <key>scope</key> + <string>invalid.illegal</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#9D1E15</string> + <key>foreground</key> + <string>#F8F8F8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Superclass</string> + <key>scope</key> + <string>entity.other.inherited-class</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#FF6400</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String interpolation</string> + <key>scope</key> + <string>string constant.other.placeholder</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FF6400</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>meta.function-call.py</string> + <key>scope</key> + <string>meta.function-call.py</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#BECDE6</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>meta.tag</string> + <key>scope</key> + <string>meta.tag, meta.tag entity</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#7F90AA</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>entity.name.section</string> + <key>scope</key> + <string>entity.name.section</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>OCaml variant</string> + <key>scope</key> + <string>keyword.type.variant</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D5E0F3</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>OCaml operator</string> + <key>scope</key> + <string>source.ocaml keyword.operator.symbol</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#F8F8F8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>OCaml infix operator</string> + <key>scope</key> + <string>source.ocaml keyword.operator.symbol.infix</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#8DA6CE</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>OCaml prefix operator</string> + <key>scope</key> + <string>source.ocaml keyword.operator.symbol.prefix</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#8DA6CE</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>OCaml f-p infix operator</string> + <key>scope</key> + <string>source.ocaml keyword.operator.symbol.infix.floating-point</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>OCaml f-p prefix operator</string> + <key>scope</key> + <string>source.ocaml keyword.operator.symbol.prefix.floating-point</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>OCaml f-p constant</string> + <key>scope</key> + <string>source.ocaml constant.numeric.floating-point</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>LaTeX environment</string> + <key>scope</key> + <string>text.tex.latex meta.function.environment</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF08</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>LaTeX environment (nested)</string> + <key>scope</key> + <string>text.tex.latex meta.function.environment meta.function.environment</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#7A96FA08</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Latex support</string> + <key>scope</key> + <string>text.tex.latex support.function</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FBDE2D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PList unquoted string</string> + <key>scope</key> + <string>source.plist string.unquoted, source.plist keyword.operator</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + </array> + <key>uuid</key> + <string>A2C6BAA7-90D0-4147-BBF5-96B0CD92D109</string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/Brilliance_Black.tmTheme b/app/rcc/edbee/themes/Brilliance_Black.tmTheme new file mode 100644 index 00000000..de35ff97 --- /dev/null +++ b/app/rcc/edbee/themes/Brilliance_Black.tmTheme @@ -0,0 +1,2619 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>author</key> + <string>Thomas Aylott</string> + <key>comment</key> + <string>Thomas Aylott ㊷ subtleGradient.com</string> + <key>name</key> + <string>Brilliance Black</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#0D0D0DFA</string> + <key>caret</key> + <string>#3333FF</string> + <key>foreground</key> + <string>#EEEEEE</string> + <key>invisibles</key> + <string>#CCCCCC1A</string> + <key>lineHighlight</key> + <string>#000080</string> + <key>selection</key> + <string>#0010B499</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Thomas Aylott ㊷</string> + <key>scope</key> + <string>meta.thomas_aylott</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF</string> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>subtleGradient.com</string> + <key>scope</key> + <string>meta.subtlegradient</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF</string> + <key>fontStyle</key> + <string>underline</string> + <key>foreground</key> + <string>#555555</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String</string> + <key>scope</key> + <string>string -meta.tag -meta.doctype -string.regexp -string.literal -string.interpolated -string.quoted.literal -string.unquoted, variable.parameter.misc.css, text string source string, string.unquoted string, string.regexp string, string.interpolated string, meta.tag source string</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#803D0033</string> + <key>foreground</key> + <string>#FFFC80</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String Punctuation</string> + <key>scope</key> + <string>punctuation.definition.string -meta.tag</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#803D00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String Punctuation II</string> + <key>scope</key> + <string>string.regexp punctuation.definition.string, string.quoted.literal punctuation.definition.string, string.quoted.double.ruby.mod punctuation.definition.string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFF80033</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String Literal</string> + <key>scope</key> + <string>string.quoted.literal, string.quoted.double.ruby.mod</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#43800033</string> + <key>foreground</key> + <string>#FFF800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String Unquoted</string> + <key>scope</key> + <string>string.unquoted -string.unquoted.embedded, string.quoted.double.multiline, meta.scope.heredoc</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFBC80</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String Interpolated</string> + <key>scope</key> + <string>string.interpolated</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#1A1A1A</string> + <key>foreground</key> + <string>#FFFC80</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String RegEx</string> + <key>scope</key> + <string>string.regexp</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#43800033</string> + <key>foreground</key> + <string>#FFF800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String RegEx Group 1</string> + <key>scope</key> + <string>string.regexp.group</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#43800033</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String RegEx Group 2</string> + <key>scope</key> + <string>string.regexp.group string.regexp.group </string> + <key>settings</key> + <dict> + <key>background</key> + <string>#43800033</string> + <key>foreground</key> + <string>#FFFFFF66</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String RegEx Group 3</string> + <key>scope</key> + <string>string.regexp.group string.regexp.group string.regexp.group </string> + <key>settings</key> + <dict> + <key>background</key> + <string>#43800033</string> + <key>foreground</key> + <string>#FFFFFF66</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String RegEx Group 4</string> + <key>scope</key> + <string>string.regexp.group string.regexp.group string.regexp.group string.regexp.group </string> + <key>settings</key> + <dict> + <key>background</key> + <string>#43800033</string> + <key>foreground</key> + <string>#FFFFFF66</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String RegEx Character-Class</string> + <key>scope</key> + <string>string.regexp.character-class</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#43800033</string> + <key>foreground</key> + <string>#86FF00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String RegEx Arbitrary-Repitition</string> + <key>scope</key> + <string>string.regexp.arbitrary-repitition</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#43800033</string> + <key>foreground</key> + <string>#00FFF8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String RegEx Definition Keyword</string> + <key>scope</key> + <string>string.regexp punctuation.definition.string keyword.other</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#803D00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ Meta Group Assertion Regexp </string> + <key>scope</key> + <string>meta.group.assertion.regexp </string> + <key>settings</key> + <dict> + <key>background</key> + <string>#0086FF33</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ Meta Assertion</string> + <key>scope</key> + <string>meta.assertion, meta.group.assertion keyword.control.group.regexp, meta.group.assertion punctuation.definition.group</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#0086FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ Number</string> + <key>scope</key> + <string>constant.numeric</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#C6FF00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ Character constant</string> + <key>scope</key> + <string>constant.character</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#86FF00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ Built-in constant</string> + <key>scope</key> + <string>constant.language, keyword.other.unit, constant.other.java, constant.other.unit</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#07FF00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ Built-in constant+</string> + <key>scope</key> + <string>constant.language.pseudo-variable</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#04800033</string> + <key>foreground</key> + <string>#07FF00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ User-defined constant</string> + <key>scope</key> + <string>constant.other, constant.block</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#00FF79</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ Library constant</string> + <key>scope</key> + <string>support.constant, constant.name</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#00FFF8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>√ pre-defined variable</string> + <key>scope</key> + <string>variable.other.readwrite.global.pre-defined, variable.language</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00807C33</string> + <key>foreground</key> + <string>#00FF79</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>√ Constant Variable</string> + <key>scope</key> + <string>variable.other.constant</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#00FFF8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>√ Library variable</string> + <key>scope</key> + <string>support.variable</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00807C33</string> + <key>foreground</key> + <string>#00FFF8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>√ global Variable</string> + <key>scope</key> + <string>variable.other.readwrite.global</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00438033</string> + <key>foreground</key> + <string>#00807C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>√ Variable</string> + <key>scope</key> + <string>variable.other, variable.js, punctuation.separator.variable</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#31A6FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>√ class Variable</string> + <key>scope</key> + <string>variable.other.readwrite.class</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#0008FF33</string> + <key>foreground</key> + <string>#0086FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>√ instance Variable</string> + <key>scope</key> + <string>variable.other.readwrite.instance</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#406180</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>√ Normal Variables</string> + <key>scope</key> + <string>variable.other.php, variable.other.normal</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#406180</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>√ Variable Punctuation</string> + <key>scope</key> + <string>punctuation.definition, punctuation.separator.variable</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#00000080</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>¢ Storage</string> + <key>scope</key> + <string>storage -storage.modifier</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#7E0080</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Entity Name Preprocessor</string> + <key>scope</key> + <string>other.preprocessor, entity.name.preprocessor</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#803D0033</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ variable.language.this.js.prototype</string> + <key>scope</key> + <string>variable.language.this.js</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#666666</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Storage Modifier</string> + <key>scope</key> + <string>storage.modifier</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#803D00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Class name</string> + <key>scope</key> + <string>entity.name.class, entity.name.type.class, entity.name.type.module</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FF0000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Class</string> + <key>scope</key> + <string>meta.class -meta.class.instance, declaration.class, meta.definition.class, declaration.module</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FF000033</string> + <key>foreground</key> + <string>#870000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Library class/type</string> + <key>scope</key> + <string>support.type, support.class</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#87000033</string> + <key>foreground</key> + <string>#FF0000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Instance</string> + <key>scope</key> + <string>entity.name.instance, entity.name.type.instance</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FF3D44</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Instance.constructor</string> + <key>scope</key> + <string>meta.class.instance.constructor</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#831E5133</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Inherited class</string> + <key>scope</key> + <string>entity.other.inherited-class, entity.name.module</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#80000433</string> + <key>foreground</key> + <string>#FF0086</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Class Method</string> + <key>scope</key> + <string>meta.definition.method</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FF0086</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Function Declaration</string> + <key>scope</key> + <string>meta.function, meta.property.function, declaration.function</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>¢ Function Declaration Name</string> + <key>scope</key> + <string>entity.name.function, entity.name.preprocessor</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FF0086</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Function Declaration Parameters</string> + <key>scope</key> + <string>variable.parameter.function</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#9799FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Function Declaration Parameters</string> + <key>scope</key> + <string>variable.parameter -variable.parameter.misc.css, meta.definition.method meta.definition.param-list, meta.function.method.with-arguments variable.parameter.function</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#9799FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Function Declaration Parameters Punctuation</string> + <key>scope</key> + <string>punctuation.definition.parameters, variable.parameter.function punctuation.separator.object</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#800004</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function Call</string> + <key>scope</key> + <string>keyword.other.special-method, meta.function-call entity.name.function -(meta.function-call meta.function), support.function - variable</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#782EC1</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library Function Call</string> + <key>scope</key> + <string>meta.function-call support.function - variable</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#9D3EFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library Function Name</string> + <key>scope</key> + <string>support.function</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#603F8033</string> + <key>foreground</key> + <string>#603F80</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function Call Arguments Punctuation</string> + <key>scope</key> + <string>punctuation.section.function, meta.brace.curly.function, meta.function-call punctuation.section.scope.ruby, meta.function-call punctuation.separator.object</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#BC80FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function Punctuation</string> + <key>scope</key> + <string>meta.group.braces.round punctuation.section.scope, +meta.group.braces.round meta.delimiter.object.comma, +meta.group.braces.curly.function meta.delimiter.object.comma, +meta.brace.round</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#BC80FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function Call Without Arguments</string> + <key>scope</key> + <string>meta.function-call.method.without-arguments, meta.function-call.method.without-arguments entity.name.function</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A88FC0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Keyword Control</string> + <key>scope</key> + <string>keyword.control</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#F800FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Keyword other</string> + <key>scope</key> + <string>keyword.other</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#7900FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Regex Keyword</string> + <key>scope</key> + <string>source.regexp keyword.operator</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Keyword Operator</string> + <key>scope</key> + <string>keyword.operator, declaration.function.operator, meta.preprocessor.c.include, punctuation.separator.operator</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#0000CE</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword Operator Assignment</string> + <key>scope</key> + <string>keyword.operator.assignment</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00009A33</string> + <key>foreground</key> + <string>#0000CE</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword Operator Arithmetic</string> + <key>scope</key> + <string>keyword.operator.arithmetic</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#2136CE</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword Operator Logical</string> + <key>scope</key> + <string>keyword.operator.logical</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00009A33</string> + <key>foreground</key> + <string>#3759FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword Operator Comparison</string> + <key>scope</key> + <string>keyword.operator.comparison</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#7C88FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>meta.class.instance.constructor keyword.operator.new</string> + <key>scope</key> + <string>meta.class.instance.constructor keyword.operator.new</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#800043</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>✘ HTML</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>✘ Tag Doctype</string> + <key>scope</key> + <string>meta.doctype, meta.tag.sgml-declaration.doctype, meta.tag.sgml.doctype</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#333333</string> + <key>foreground</key> + <string>#CCCCCC</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag</string> + <key>scope</key> + <string>meta.tag</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag Structure</string> + <key>scope</key> + <string>meta.tag.structure, meta.tag.segment</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#333333BF</string> + <key>foreground</key> + <string>#666666</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag Block</string> + <key>scope</key> + <string>meta.tag.block, meta.tag.xml, meta.tag.key</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#4C4C4C33</string> + <key>foreground</key> + <string>#4C4C4C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag Inline</string> + <key>scope</key> + <string>meta.tag.inline</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#803D0033</string> + <key>foreground</key> + <string>#FF7900</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>meta.tag.inline source</string> + <key>scope</key> + <string>meta.tag.inline source</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#803D0033</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag Other</string> + <key>scope</key> + <string>meta.tag.other, entity.name.tag.style, entity.name.tag.script, meta.tag.block.script, source.js.embedded punctuation.definition.tag.html, source.css.embedded punctuation.definition.tag.html</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#80000433</string> + <key>foreground</key> + <string>#FF0007</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag Form</string> + <key>scope</key> + <string>meta.tag.form, meta.tag.block.form</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00438033</string> + <key>foreground</key> + <string>#0086FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag Meta</string> + <key>scope</key> + <string>meta.tag.meta</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#3C008033</string> + <key>foreground</key> + <string>#F800FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag Block Head</string> + <key>scope</key> + <string>meta.section.html.head</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#121212</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag Block Form</string> + <key>scope</key> + <string>meta.section.html.form</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#0043801A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ XML Tag</string> + <key>scope</key> + <string>meta.tag.xml</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#666666</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag name</string> + <key>scope</key> + <string>entity.name.tag</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFFFFF4D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag attribute</string> + <key>scope</key> + <string>entity.other.attribute-name, meta.tag punctuation.definition.string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFFFFF33</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag value</string> + <key>scope</key> + <string>meta.tag string -source -punctuation, text source text meta.tag string -punctuation</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFFFFF66</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>text meta.paragraph</string> + <key>scope</key> + <string>text meta.paragraph</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#999999</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M markup</string> + <key>scope</key> + <string>markup markup -(markup meta.paragraph.list)</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#33333333</string> + <key>foreground</key> + <string>#FFF800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M HR</string> + <key>scope</key> + <string>markup.hr</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF</string> + <key>foreground</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M heading</string> + <key>scope</key> + <string>markup.heading</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M bold</string> + <key>scope</key> + <string>markup.bold</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#95D4FF80</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M italic</string> + <key>scope</key> + <string>markup.italic</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M strike</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>M add</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>M del</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>M underline</string> + <key>scope</key> + <string>markup.underline</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M reference</string> + <key>scope</key> + <string>meta.reference, markup.underline.link</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#0086FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M reference name</string> + <key>scope</key> + <string>entity.name.reference</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00438033</string> + <key>foreground</key> + <string>#00FFF8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M underline link</string> + <key>scope</key> + <string>meta.reference.list markup.underline.link, text.html.textile markup.underline.link</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + <key>foreground</key> + <string>#00FFF8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M raw block</string> + <key>scope</key> + <string>markup.raw.block</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#80808040</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M quote block</string> + <key>scope</key> + <string>markup.quote</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF1A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M list</string> + <key>scope</key> + <string>markup.list meta.paragraph</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Markdown</string> + <key>scope</key> + <string>text.html.markdown</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF</string> + <key>foreground</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>text.html.markdown meta.paragraph</string> + <key>scope</key> + <string>text.html.markdown meta.paragraph</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>text.html.markdown markup.list meta.paragraph</string> + <key>scope</key> + <string>text.html.markdown markup.list meta.paragraph</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#555555</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>text.html.markdown markup.heading</string> + <key>scope</key> + <string>text.html.markdown markup.heading</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>text.html.markdown string</string> + <key>scope</key> + <string>text.html.markdown string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#8A5420</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>§ CSS</string> + <key>scope</key> + <string>source.css</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>§ Selector</string> + <key>scope</key> + <string>meta.selector</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#666666</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Property Value Parens</string> + <key>scope</key> + <string>source.css meta.scope.property-list meta.property-value punctuation.definition.arguments, +source.css meta.scope.property-list meta.property-value punctuation.separator.arguments</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#006680</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ Pseudo-Element</string> + <key>scope</key> + <string>entity.other.attribute-name.pseudo-element</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#4F00FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ Pseudo-Class</string> + <key>scope</key> + <string>entity.other.attribute-name.pseudo-class, entity.other.attribute-name.tag.pseudo-class</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#7900FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ Class</string> + <key>scope</key> + <string>meta.selector entity.other.attribute-name.class</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#F800FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ ID</string> + <key>scope</key> + <string>meta.selector entity.other.attribute-name.id</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FF0086</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ Tag</string> + <key>scope</key> + <string>meta.selector entity.name.tag</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FF0007</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ Tag Wildcard</string> + <key>scope</key> + <string>entity.name.tag.wildcard, entity.other.attribute-name.universal</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#FF7900</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ Attribute</string> + <key>scope</key> + <string>source.css entity.other.attribute-name.attribute</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#C25A00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ Attribute-Match</string> + <key>scope</key> + <string>source.css meta.attribute-selector keyword.operator.comparison</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#673000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ meta.scope.property-list</string> + <key>scope</key> + <string>meta.scope.property-list</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ meta.property-name</string> + <key>scope</key> + <string>meta.property-name</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#999999</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ support.type.property-name</string> + <key>scope</key> + <string>support.type.property-name</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#0D0D0D</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ meta.property-value</string> + <key>scope</key> + <string>meta.property-value</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#19191980</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#999999</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>LaTeX</string> + <key>scope</key> + <string>text.latex</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>L Markup Raw</string> + <key>scope</key> + <string>text.latex markup.raw</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L support.function</string> + <key>scope</key> + <string>text.latex support.function -support.function.textit -support.function.emph</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#BC80FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L support.function.section</string> + <key>scope</key> + <string>text.latex support.function.section</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFFFFFBF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L entity.name.section</string> + <key>scope</key> + <string>text.latex entity.name.section -meta.group -keyword.operator.braces</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L constant.language.general</string> + <key>scope</key> + <string>text.latex constant.language.general</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>L keyword.operator.delimiter</string> + <key>scope</key> + <string>text.latex keyword.operator.delimiter</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00000080</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L keyword.operator.brackets</string> + <key>scope</key> + <string>text.latex keyword.operator.brackets</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#999999</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L keyword.operator.braces</string> + <key>scope</key> + <string>text.latex keyword.operator.braces</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#666666</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L meta.footnote</string> + <key>scope</key> + <string>meta.footnote</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00008033</string> + <key>foreground</key> + <string>#0008FF4D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L meta.label.reference</string> + <key>scope</key> + <string>text.latex meta.label.reference</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF0D</string> + <key>fontStyle</key> + <string></string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L keyword.control.ref</string> + <key>scope</key> + <string>text.latex keyword.control.ref</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#260001</string> + <key>foreground</key> + <string>#FF0007</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L variable.parameter.label.reference</string> + <key>scope</key> + <string>text.latex variable.parameter.label.reference</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#400002</string> + <key>foreground</key> + <string>#FFBC80</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L keyword.control.cite</string> + <key>scope</key> + <string>text.latex keyword.control.cite</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#260014</string> + <key>foreground</key> + <string>#FF0086</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L variable.parameter.cite</string> + <key>scope</key> + <string>variable.parameter.cite</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#400022</string> + <key>foreground</key> + <string>#FFBFE1</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L variable.parameter.label</string> + <key>scope</key> + <string>text.latex variable.parameter.label</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFFFFF80</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L markup</string> + <key>scope</key> + <string>meta.function markup</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CDCDCD</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L meta.group.braces</string> + <key>scope</key> + <string>text.latex meta.group.braces</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#33333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L meta.environment.list</string> + <key>scope</key> + <string>text.latex meta.environment.list</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00000080</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#33333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L meta.environment.list 2</string> + <key>scope</key> + <string>text.latex meta.environment.list meta.environment.list </string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00000080</string> + <key>foreground</key> + <string>#33333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L meta.environment.list 3</string> + <key>scope</key> + <string>text.latex meta.environment.list meta.environment.list meta.environment.list </string> + <key>settings</key> + <dict> + <key>background</key> + <string>#000000</string> + <key>foreground</key> + <string>#33333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L meta.environment.list 4</string> + <key>scope</key> + <string>text.latex meta.environment.list meta.environment.list meta.environment.list meta.environment.list </string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#33333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L meta.environment.list 5</string> + <key>scope</key> + <string>text.latex meta.environment.list meta.environment.list meta.environment.list meta.environment.list meta.environment.list </string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#33333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L meta.environment.list 6</string> + <key>scope</key> + <string>text.latex meta.environment.list meta.environment.list meta.environment.list meta.environment.list meta.environment.list meta.environment.list </string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#33333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L meta.end-document</string> + <key>scope</key> + <string>text.latex meta.end-document, text.latex meta.begin-document, meta.end-document.latex support.function, meta.end-document.latex variable.parameter, meta.begin-document.latex support.function, meta.begin-document.latex variable.parameter</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#CCCCCC</string> + <key>foreground</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>meta.brace.erb.return-value</string> + <key>scope</key> + <string>meta.brace.erb.return-value</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00805533</string> + <key>foreground</key> + <string>#00FFAA</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>source.ruby.rails.embedded.return-value.one-line</string> + <key>scope</key> + <string>source.ruby.rails.embedded.return-value.one-line</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#8080801A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>meta.brace.erb</string> + <key>scope</key> + <string>punctuation.section.embedded -(source string source punctuation.section.embedded), meta.brace.erb.html</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00FFF81A</string> + <key>foreground</key> + <string>#00FFF8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>source.ruby.rails.embedded.one-line</string> + <key>scope</key> + <string>source.ruby.rails.embedded.one-line</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00FFF81A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String Embedded Source</string> + <key>scope</key> + <string>source string source punctuation.section.embedded</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#406180</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>source.js.embedded</string> + <key>scope</key> + <string>source.js.embedded</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#0D0D0D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>◊ Source</string> + <key>scope</key> + <string>source</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + </dict> + </dict> + <dict> + <key>name</key> + <string>◊ meta.brace.erb</string> + <key>scope</key> + <string>meta.brace.erb</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>◊ Source String Source</string> + <key>scope</key> + <string>source string source</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#33333380</string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>◊ Source String Interpolated Source</string> + <key>scope</key> + <string>source string.interpolated source</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00000099</string> + <key>foreground</key> + <string>#999999</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>◊ Source Embeded Source</string> + <key>scope</key> + <string>source source, source.java.embedded</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#3333331A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>◊ Text</string> + <key>scope</key> + <string>text -text.xml.strict</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>◊ Text Source</string> + <key>scope</key> + <string>text source, meta.scope.django.template</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#000000</string> + <key>foreground</key> + <string>#CCCCCC</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>◊ Text Source Text String</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>◊ Text String Source</string> + <key>scope</key> + <string>text string source</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#999999</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>◊ Text Source String Source</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>◊ Text String Source String Source</string> + <key>scope</key> + <string>text string source string source</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Invalid</string> + <key>scope</key> + <string>invalid -invalid.SOMETHING</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FF0007</string> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#330004</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid Value</string> + <key>scope</key> + <string>invalid.SOMETHING</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + <key>foreground</key> + <string>#FF3600</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Syntax</string> + <key>scope</key> + <string>meta.syntax</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>comment</string> + <key>scope</key> + <string>comment -comment.line</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#33333333</string> + <key>foreground</key> + <string>#4C4C4C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>comment.line</string> + <key>scope</key> + <string>comment.line</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#4C4C4C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment Punctuation</string> + <key>scope</key> + <string>comment punctuation</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>✘ HTML Comment</string> + <key>scope</key> + <string>text comment.block -source</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>D Diff Add</string> + <key>scope</key> + <string>markup.inserted</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00401E</string> + <key>foreground</key> + <string>#40FF9A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>D Diff Delete</string> + <key>scope</key> + <string>markup.deleted</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#400022</string> + <key>foreground</key> + <string>#FF40A3</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>D Diff Changed</string> + <key>scope</key> + <string>markup.changed</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#803D00</string> + <key>foreground</key> + <string>#FFFF55</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>text.subversion-commit meta.scope.changed-files</string> + <key>scope</key> + <string>text.subversion-commit meta.scope.changed-files, text.subversion-commit meta.scope.changed-files.svn meta.diff.separator</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#000000</string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>text.subversion-commit</string> + <key>scope</key> + <string>text.subversion-commit</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF</string> + <key>foreground</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>meta.delimiter</string> + <key>scope</key> + <string>punctuation.terminator, meta.delimiter, punctuation.separator.method</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF03</string> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#7F7F7F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>meta.delimiter.statement.js</string> + <key>scope</key> + <string>punctuation.terminator.statement, meta.delimiter.statement.js</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00000080</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>meta.delimiter.object.js</string> + <key>scope</key> + <string>meta.delimiter.object.js</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00000040</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Bold String Quotes</string> + <key>scope</key> + <string>string.quoted.single.brace, string.quoted.double.brace</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#803D00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>ß Blog Post / Email Message</string> + <key>scope</key> + <string>text.blog, text.mail</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#DCDCDC</string> + <key>foreground</key> + <string>#333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>ß Post Content</string> + <key>scope</key> + <string>text.blog text, text.mail text</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#000000</string> + <key>foreground</key> + <string>#CCCCCC</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>ß Post Header Keys</string> + <key>scope</key> + <string>meta.header.blog keyword.other, meta.header.mail keyword.other</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00FFF81A</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#06403E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>ß Post Header Values</string> + <key>scope</key> + <string>meta.header.blog string.unquoted.blog, meta.header.mail string.unquoted</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFF551A</string> + <key>foreground</key> + <string>#803D00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>OCAML</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>entity.name.type.module</string> + <key>scope</key> + <string>source.ocaml entity.name.type.module</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FF0000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>support.other.module</string> + <key>scope</key> + <string>source.ocaml support.other.module</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#83000033</string> + <key>foreground</key> + <string>#FF0000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>entity.name.type.variant</string> + <key>scope</key> + <string>entity.name.type.variant</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#00FFF8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>entity.name.tag, meta.record.definition</string> + <key>scope</key> + <string>source.ocaml entity.name.tag, source.ocaml meta.record.definition</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#00FF79</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>———————— PUNCTUATION ————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>punctuation.separator.parameters</string> + <key>scope</key> + <string>punctuation.separator.parameters</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>meta.brace.pipe</string> + <key>scope</key> + <string>meta.brace.pipe</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#33333333</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#4C4C4C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Misc Punctuation</string> + <key>scope</key> + <string>meta.brace.erb, source.ruby.embedded.source.brace, punctuation.section.dictionary, punctuation.terminator.dictionary, punctuation.separator.object, punctuation.separator.statement, punctuation.separator.key-value.css</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#666666</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Curly Punctuation</string> + <key>scope</key> + <string>punctuation.section.scope.curly, punctuation.section.scope</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#999999</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Object Punctuation</string> + <key>scope</key> + <string>punctuation.separator.objects, +meta.group.braces.curly meta.delimiter.object.comma, +punctuation.separator.key-value -meta.tag, +source.ocaml punctuation.separator.match-definition +</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#0C823B</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function Punctuation</string> + <key>scope</key> + <string>punctuation.separator.parameters.function.js,punctuation.definition.function, punctuation.separator.function-return, punctuation.separator.function-definition, punctuation.definition.arguments, punctuation.separator.arguments</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#800043</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Array Punctuation</string> + <key>scope</key> + <string>meta.group.braces.square punctuation.section.scope, meta.group.braces.square meta.delimiter.object.comma, meta.brace.square, punctuation.separator.array, punctuation.section.array, punctuation.definition.array, punctuation.definition.constant.range</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#803D001A</string> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#7F5E40</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Array, Range</string> + <key>scope</key> + <string>meta.structure.array -punctuation.definition.array, meta.definition.range -punctuation.definition.constant.range</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#803D001A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>meta.brace.curly meta.group</string> + <key>scope</key> + <string>meta.brace.curly meta.group.css</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00000080</string> + <key>fontStyle</key> + <string></string> + </dict> + </dict> + <dict> + <key>name</key> + <string>º meta.source.embedded</string> + <key>scope</key> + <string>meta.source.embedded, entity.other.django.tagbraces</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00000080</string> + <key>foreground</key> + <string>#666666</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>º meta.group.braces.round JS</string> + <key>scope</key> + <string>source.js meta.group.braces.round, meta.scope.heredoc</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>º Even</string> + <key>scope</key> + <string>source.ruby meta.even-tab, source.ruby meta.even-tab.group2, source.ruby meta.even-tab.group4, source.ruby meta.even-tab.group6, source.ruby meta.even-tab.group8, source.ruby meta.even-tab.group10, source.ruby meta.even-tab.group12 +</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00000080</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>º meta.block.slate </string> + <key>scope</key> + <string>meta.block.slate</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#666666</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>º meta.block.content.slate </string> + <key>scope</key> + <string>meta.block.content.slate </string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CCCCCC</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function Group1</string> + <key>scope</key> + <string>meta.function meta.group.braces.curly.function -(meta.group meta.group), meta.function meta.odd-tab.group1</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Group1</string> + <key>scope</key> + <string>meta.odd-tab.group1, meta.group.braces, meta.block.slate, text.xml.strict meta.tag, meta.paren-group, meta.section</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#0A0A0A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Group2</string> + <key>scope</key> + <string>meta.even-tab.group2, meta.group.braces meta.group.braces, meta.block.slate meta.block.slate, text.xml.strict meta.tag meta.tag, meta.group.braces meta.group.braces, meta.paren-group meta.paren-group, meta.section meta.section</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#0E0E0E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Group3</string> + <key>scope</key> + <string>meta.odd-tab.group3, meta.group.braces meta.group.braces meta.group.braces , meta.block.slate meta.block.slate meta.block.slate , text.xml.strict meta.tag meta.tag meta.tag, meta.group.braces meta.group.braces meta.group.braces, meta.paren-group meta.paren-group meta.paren-group, meta.section meta.section meta.section</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#111111</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Group4</string> + <key>scope</key> + <string>meta.even-tab.group4, meta.group.braces meta.group.braces meta.group.braces meta.group.braces , meta.block.slate meta.block.slate meta.block.slate meta.block.slate , text.xml.strict meta.tag meta.tag meta.tag meta.tag, meta.group.braces meta.group.braces meta.group.braces meta.group.braces, meta.paren-group meta.paren-group meta.paren-group meta.paren-group, meta.section meta.section meta.section meta.section</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#151515</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Group5</string> + <key>scope</key> + <string>meta.odd-tab.group5, meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces , meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate , text.xml.strict meta.tag meta.tag meta.tag meta.tag meta.tag, meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces, meta.paren-group meta.paren-group meta.paren-group meta.paren-group meta.paren-group, meta.section meta.section meta.section meta.section meta.section</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#191919</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Group6</string> + <key>scope</key> + <string>meta.even-tab.group6, meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces , meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate , text.xml.strict meta.tag meta.tag meta.tag meta.tag meta.tag meta.tag, meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces, meta.paren-group meta.paren-group meta.paren-group meta.paren-group meta.paren-group meta.paren-group, meta.section meta.section meta.section meta.section meta.section meta.section</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#1C1C1C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Group7</string> + <key>scope</key> + <string>meta.odd-tab.group7, meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces , meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate , text.xml.strict meta.tag meta.tag meta.tag meta.tag meta.tag meta.tag meta.tag, meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces, meta.paren-group meta.paren-group meta.paren-group meta.paren-group meta.paren-group meta.paren-group meta.paren-group, meta.section meta.section meta.section meta.section meta.section meta.section meta.section</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#1F1F1F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Group8</string> + <key>scope</key> + <string>meta.even-tab.group8, meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces , meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate , text.xml.strict meta.tag meta.tag meta.tag meta.tag meta.tag meta.tag meta.tag meta.tag, meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces, meta.paren-group meta.paren-group meta.paren-group meta.paren-group meta.paren-group meta.paren-group meta.paren-group meta.paren-group, meta.section meta.section meta.section meta.section meta.section meta.section meta.section meta.section</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#212121</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Group9</string> + <key>scope</key> + <string>meta.odd-tab.group9, meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces , meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate , text.xml.strict meta.tag meta.tag meta.tag meta.tag meta.tag meta.tag meta.tag meta.tag meta.tag, meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces, meta.paren-group meta.paren-group meta.paren-group meta.paren-group meta.paren-group meta.paren-group meta.paren-group meta.paren-group meta.paren-group, meta.section meta.section meta.section meta.section meta.section meta.section meta.section meta.section meta.section</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#242424</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Group10</string> + <key>scope</key> + <string>meta.even-tab.group10</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#1F1F1F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Group11</string> + <key>scope</key> + <string>meta.odd-tab.group11</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#151515</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>———————— END ————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>IE6</string> + <key>scope</key> + <string>meta.property.vendor.microsoft.trident.4, +meta.property.vendor.microsoft.trident.4 support.type.property-name, +meta.property.vendor.microsoft.trident.4 punctuation.terminator.rule</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#1B95E2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>IE7</string> + <key>scope</key> + <string>meta.property.vendor.microsoft.trident.5, +meta.property.vendor.microsoft.trident.5 support.type.property-name, +meta.property.vendor.microsoft.trident.5 punctuation.separator.key-value, +meta.property.vendor.microsoft.trident.5 punctuation.terminator.rule</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#F5C034</string> + </dict> + </dict> + </array> + <key>uuid</key> + <string>24847CB3-23BC-4BF9-861B-E39661A6DA71</string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/Brilliance_Dull.tmTheme b/app/rcc/edbee/themes/Brilliance_Dull.tmTheme new file mode 100644 index 00000000..ae7e43ad --- /dev/null +++ b/app/rcc/edbee/themes/Brilliance_Dull.tmTheme @@ -0,0 +1,2243 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>author</key> + <string>Thomas Aylott</string> + <key>comment</key> + <string>by Thomas Aylott subtleGradient.com</string> + <key>name</key> + <string>Brilliance Dull</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#050505FA</string> + <key>caret</key> + <string>#7979B7</string> + <key>foreground</key> + <string>#CDCDCD</string> + <key>invisibles</key> + <string>#CDCDCD1A</string> + <key>lineHighlight</key> + <string>#0000801A</string> + <key>selection</key> + <string>#2E2EE64D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Thomas Aylott ㊷</string> + <key>scope</key> + <string>meta.thomas_aylott</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF</string> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>subtleGradient.com</string> + <key>scope</key> + <string>meta.subtlegradient</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF</string> + <key>fontStyle</key> + <string>underline</string> + <key>foreground</key> + <string>#555555</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>——————————————————</string> + <key>scope</key> + <string>meta.subtlegradient</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF</string> + <key>foreground</key> + <string>#E6E6E6</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String</string> + <key>scope</key> + <string>string -meta.tag -meta.doctype -string.regexp -string.literal -string.interpolated -string.quoted.literal -string.unquoted, variable.parameter.misc.css, text string source string, string.unquoted string, string.regexp string</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#803D0033</string> + <key>foreground</key> + <string>#D2D1AB</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String Punctuation</string> + <key>scope</key> + <string>punctuation.definition.string -meta.tag</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#533F2C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String Punctuation II</string> + <key>scope</key> + <string>string.regexp punctuation.definition.string, string.quoted.literal punctuation.definition.string, string.quoted.double.ruby.mod punctuation.definition.string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFF80033</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String Literal</string> + <key>scope</key> + <string>string.quoted.literal, string.quoted.double.ruby.mod</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#43800033</string> + <key>foreground</key> + <string>#A6A458</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String Unquoted</string> + <key>scope</key> + <string>string.unquoted -string.unquoted.embedded, string.quoted.double.multiline, meta.scope.heredoc</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D2BEAB</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String Interpolated</string> + <key>scope</key> + <string>string.interpolated</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#1A1A1A</string> + <key>foreground</key> + <string>#D2D1AB</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String RegEx</string> + <key>scope</key> + <string>string.regexp</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#43800033</string> + <key>foreground</key> + <string>#A6A458</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String RegEx Group 1</string> + <key>scope</key> + <string>string.regexp.group</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#43800033</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String RegEx Group 2</string> + <key>scope</key> + <string>string.regexp.group string.regexp.group </string> + <key>settings</key> + <dict> + <key>background</key> + <string>#43800033</string> + <key>foreground</key> + <string>#FFFFFF66</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String RegEx Group 3</string> + <key>scope</key> + <string>string.regexp.group string.regexp.group string.regexp.group </string> + <key>settings</key> + <dict> + <key>background</key> + <string>#43800033</string> + <key>foreground</key> + <string>#FFFFFF66</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String RegEx Group 4</string> + <key>scope</key> + <string>string.regexp.group string.regexp.group string.regexp.group string.regexp.group </string> + <key>settings</key> + <dict> + <key>background</key> + <string>#43800033</string> + <key>foreground</key> + <string>#FFFFFF66</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String RegEx Character-Class</string> + <key>scope</key> + <string>string.regexp.character-class</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#43800033</string> + <key>foreground</key> + <string>#80A659</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String RegEx Arbitrary-Repitition</string> + <key>scope</key> + <string>string.regexp.arbitrary-repitition</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#43800033</string> + <key>foreground</key> + <string>#56A5A4</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>source.regexp keyword</string> + <key>scope</key> + <string>source.regexp keyword.operator</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A75980</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ String RegEx Comment</string> + <key>scope</key> + <string>string.regexp comment</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ Meta Group Assertion Regexp </string> + <key>scope</key> + <string>meta.group.assertion.regexp </string> + <key>settings</key> + <dict> + <key>background</key> + <string>#0086FF33</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ Meta Assertion</string> + <key>scope</key> + <string>meta.assertion, meta.group.assertion keyword.control.group.regexp</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#5780A6</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ Number</string> + <key>scope</key> + <string>constant.numeric</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#95A658</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ Character constant</string> + <key>scope</key> + <string>constant.character</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#80A659</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ Built-in constant</string> + <key>scope</key> + <string>constant.language, keyword.other.unit, constant.other.java, constant.other.unit</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#59A559</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ Built-in constant+</string> + <key>scope</key> + <string>constant.language.pseudo-variable</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#04800033</string> + <key>foreground</key> + <string>#59A559</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ User-defined constant</string> + <key>scope</key> + <string>constant.other, constant.block</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#57A57D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ Library constant</string> + <key>scope</key> + <string>support.constant, constant.name</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#56A5A4</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>√ pre-defined variable</string> + <key>scope</key> + <string>variable.language, variable.other.readwrite.global.pre-defined</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#5E6B6B</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>√ Constant Variable</string> + <key>scope</key> + <string>variable.other.constant</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#56A5A4</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>√ Library variable</string> + <key>scope</key> + <string>support.variable</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00807C33</string> + <key>foreground</key> + <string>#56A5A4</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>√ global Variable</string> + <key>scope</key> + <string>variable.other.readwrite.global</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00438033</string> + <key>foreground</key> + <string>#2B5252</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>√ Variable</string> + <key>scope</key> + <string>variable.other, variable.js</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#5780A6</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>√ class Variable</string> + <key>scope</key> + <string>variable.other.readwrite.class</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#0007FF33</string> + <key>foreground</key> + <string>#5780A6</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>√ instance Variable</string> + <key>scope</key> + <string>variable.other.readwrite.instance</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#555F69</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>√ Normal Variables</string> + <key>scope</key> + <string>variable.other.php, variable.other.normal</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#555F69</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>√ Variable Punctuation</string> + <key>scope</key> + <string>punctuation.definition -punctuation.definition.comment, punctuation.separator.variable</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#00000080</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>¢ Storage</string> + <key>scope</key> + <string>storage -storage.modifier</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A77D58</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Entity Name Preprocessor</string> + <key>scope</key> + <string>other.preprocessor, entity.name.preprocessor</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#803D0033</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>~ variable.language.this.js.prototype</string> + <key>scope</key> + <string>variable.language.this.js</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#666666</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Storage Modifier</string> + <key>scope</key> + <string>storage.modifier</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#533F2C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Class name</string> + <key>scope</key> + <string>entity.name.class, entity.name.type.class, entity.name.type.module</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A7595A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Class</string> + <key>scope</key> + <string>meta.class -meta.class.instance, declaration.class, meta.definition.class, declaration.module</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#29161780</string> + <key>foreground</key> + <string>#532D2D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Library class/type</string> + <key>scope</key> + <string>support.type, support.class</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#80000433</string> + <key>foreground</key> + <string>#A7595A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Instance</string> + <key>scope</key> + <string>entity.name.instance</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A7595A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Instance.constructor</string> + <key>scope</key> + <string>meta.class.instance.constructor</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#80004333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Inherited class</string> + <key>scope</key> + <string>entity.other.inherited-class, entity.name.module</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#80000433</string> + <key>foreground</key> + <string>#A75980</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Class Method</string> + <key>scope</key> + <string>object.property.function, meta.definition.method</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A75980</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Function</string> + <key>scope</key> + <string>meta.function -(meta.tell-block), meta.property.function, declaration.function</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#80004333</string> + <key>foreground</key> + <string>#532D40</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>¢ Function name</string> + <key>scope</key> + <string>entity.name.function, entity.name.preprocessor</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A75980</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A459A5</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword.control</string> + <key>scope</key> + <string>keyword.control</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#3C008033</string> + <key>foreground</key> + <string>#A459A5</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Special Function</string> + <key>scope</key> + <string>keyword.other.special-method, meta.function-call entity.name.function -(meta.function-call meta.function), support.function - variable</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#8D809D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library function</string> + <key>scope</key> + <string>support.function - variable</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#634683</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword.operator</string> + <key>scope</key> + <string>keyword.operator, declaration.function.operator, meta.preprocessor.c.include</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#7979B7</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>keyword.operator.comparison</string> + <key>scope</key> + <string>keyword.operator.comparison</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#9899C8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function argument</string> + <key>scope</key> + <string>variable.parameter -variable.parameter.misc.css, meta.definition.method meta.definition.param-list, meta.function.method.with-arguments variable.parameter.function</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#3C008033</string> + <key>foreground</key> + <string>#ABACD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>✘ HTML</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>✘ Tag Doctype</string> + <key>scope</key> + <string>meta.doctype, meta.tag.sgml-declaration.doctype, meta.tag.sgml.doctype</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#333333</string> + <key>foreground</key> + <string>#CDCDCD</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag</string> + <key>scope</key> + <string>meta.tag</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag Structure</string> + <key>scope</key> + <string>meta.tag.structure, meta.tag.segment</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#333333BF</string> + <key>foreground</key> + <string>#666666</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag Block</string> + <key>scope</key> + <string>meta.tag.block, meta.tag.xml, meta.tag.key</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#4C4C4C33</string> + <key>foreground</key> + <string>#4C4C4C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag Inline</string> + <key>scope</key> + <string>meta.tag.inline</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#803D0033</string> + <key>foreground</key> + <string>#A77D58</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>meta.tag.inline source</string> + <key>scope</key> + <string>meta.tag.inline source</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#803D0033</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag Other</string> + <key>scope</key> + <string>meta.tag.other, entity.name.tag.style, source entity.other.attribute-name -text.html.basic.embedded , entity.name.tag.script, meta.tag.block.script</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#80000433</string> + <key>foreground</key> + <string>#A7595A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag Form</string> + <key>scope</key> + <string>meta.tag.form, meta.tag.block.form</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00438033</string> + <key>foreground</key> + <string>#5780A6</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag Meta</string> + <key>scope</key> + <string>meta.tag.meta</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#3C008033</string> + <key>foreground</key> + <string>#A459A5</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag Block Head</string> + <key>scope</key> + <string>meta.section.html.head</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#121212</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag Block Form</string> + <key>scope</key> + <string>meta.section.html.form</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#0043801A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ XML Tag</string> + <key>scope</key> + <string>meta.tag.xml</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#666666</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag name</string> + <key>scope</key> + <string>entity.name.tag</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFFFFF4D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag attribute</string> + <key>scope</key> + <string>entity.other.attribute-name, meta.tag punctuation.definition.string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFFFFF33</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Tag value</string> + <key>scope</key> + <string>meta.tag string -source -punctuation, text source text meta.tag string -punctuation</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFFFFF66</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>M markdown</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>M markup</string> + <key>scope</key> + <string>markup markup -(markup meta.paragraph.list)</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#33333333</string> + <key>foreground</key> + <string>#A6A458</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M HR</string> + <key>scope</key> + <string>markup.hr</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF</string> + <key>foreground</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M heading</string> + <key>scope</key> + <string>markup.heading</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#33333380</string> + <key>foreground</key> + <string>#666666</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M bold</string> + <key>scope</key> + <string>markup.bold</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M italic</string> + <key>scope</key> + <string>markup.italic</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M strike</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>M add</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>M del</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>M underline</string> + <key>scope</key> + <string>markup.underline</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M reference</string> + <key>scope</key> + <string>meta.reference, markup.underline.link</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#5780A6</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M reference name</string> + <key>scope</key> + <string>entity.name.reference</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00438033</string> + <key>foreground</key> + <string>#56A5A4</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M underline link</string> + <key>scope</key> + <string>meta.reference.list markup.underline.link, text.html.textile markup.underline.link</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + <key>foreground</key> + <string>#56A5A4</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M raw block</string> + <key>scope</key> + <string>markup.raw.block</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#000000</string> + <key>foreground</key> + <string>#999999</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>M quote block</string> + <key>scope</key> + <string>markup.quote</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF1A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>§ CSS</string> + <key>scope</key> + <string>source.css</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>§ Selector</string> + <key>scope</key> + <string>meta.selector</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00000080</string> + <key>foreground</key> + <string>#666666</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ Attribute-Match</string> + <key>scope</key> + <string>meta.attribute-match.css</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00048033</string> + <key>foreground</key> + <string>#575AA6</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ Pseudo-Class</string> + <key>scope</key> + <string>entity.other.attribute-name.pseudo-class, entity.other.attribute-name.tag.pseudo-class</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#7C58A5</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ Class</string> + <key>scope</key> + <string>meta.selector entity.other.attribute-name.class</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A459A5</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ ID</string> + <key>scope</key> + <string>meta.selector entity.other.attribute-name.id</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A75980</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ Tag</string> + <key>scope</key> + <string>meta.selector entity.name.tag</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A7595A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ Tag Wildcard</string> + <key>scope</key> + <string>entity.name.tag.wildcard, entity.other.attribute-name.universal</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#A77D58</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ meta.scope.property-list</string> + <key>scope</key> + <string>meta.scope.property-list</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ meta.property-name</string> + <key>scope</key> + <string>meta.property-name</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#999999</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ support.type.property-name</string> + <key>scope</key> + <string>support.type.property-name</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#000000</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ meta.property-value</string> + <key>scope</key> + <string>meta.property-value</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#0D0D0D</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#999999</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>LaTeX</string> + <key>scope</key> + <string>text.latex</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>L Markup Raw</string> + <key>scope</key> + <string>text.latex markup.raw</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L support.function</string> + <key>scope</key> + <string>text.latex support.function -support.function.textit -support.function.emph</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#BDABD1</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L support.function.section</string> + <key>scope</key> + <string>text.latex support.function.section</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFFFFFBF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L entity.name.section</string> + <key>scope</key> + <string>text.latex entity.name.section -meta.group -keyword.operator.braces</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L constant.language.general</string> + <key>scope</key> + <string>text.latex constant.language.general</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>L keyword.operator.delimiter</string> + <key>scope</key> + <string>text.latex keyword.operator.delimiter</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00000080</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L keyword.operator.brackets</string> + <key>scope</key> + <string>text.latex keyword.operator.brackets</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#999999</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L keyword.operator.braces</string> + <key>scope</key> + <string>text.latex keyword.operator.braces</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#666666</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L meta.footnote</string> + <key>scope</key> + <string>meta.footnote</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00048033</string> + <key>foreground</key> + <string>#0008FF4D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L meta.label.reference</string> + <key>scope</key> + <string>text.latex meta.label.reference</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF0D</string> + <key>fontStyle</key> + <string></string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L keyword.control.ref</string> + <key>scope</key> + <string>text.latex keyword.control.ref</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#180D0C</string> + <key>foreground</key> + <string>#A7595A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L variable.parameter.label.reference</string> + <key>scope</key> + <string>text.latex variable.parameter.label.reference</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#291616</string> + <key>foreground</key> + <string>#D2BEAB</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L keyword.control.cite</string> + <key>scope</key> + <string>text.latex keyword.control.cite</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#180D12</string> + <key>foreground</key> + <string>#A75980</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L variable.parameter.cite</string> + <key>scope</key> + <string>variable.parameter.cite</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#29161F</string> + <key>foreground</key> + <string>#E8D5DE</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L variable.parameter.label</string> + <key>scope</key> + <string>text.latex variable.parameter.label</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFFFFF80</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L meta.group.braces</string> + <key>scope</key> + <string>text.latex meta.group.braces</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#33333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L meta.environment.list</string> + <key>scope</key> + <string>text.latex meta.environment.list</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00000080</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#33333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L meta.environment.list 2</string> + <key>scope</key> + <string>text.latex meta.environment.list meta.environment.list </string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00000080</string> + <key>foreground</key> + <string>#33333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L meta.environment.list 3</string> + <key>scope</key> + <string>text.latex meta.environment.list meta.environment.list meta.environment.list </string> + <key>settings</key> + <dict> + <key>background</key> + <string>#000000</string> + <key>foreground</key> + <string>#33333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L meta.environment.list 4</string> + <key>scope</key> + <string>text.latex meta.environment.list meta.environment.list meta.environment.list meta.environment.list </string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#33333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L meta.environment.list 5</string> + <key>scope</key> + <string>text.latex meta.environment.list meta.environment.list meta.environment.list meta.environment.list meta.environment.list </string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#33333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L meta.environment.list 6</string> + <key>scope</key> + <string>text.latex meta.environment.list meta.environment.list meta.environment.list meta.environment.list meta.environment.list meta.environment.list </string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#33333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>L meta.end-document</string> + <key>scope</key> + <string>text.latex meta.end-document, text.latex meta.begin-document, meta.end-document.latex support.function, meta.end-document.latex variable.parameter, meta.begin-document.latex support.function, meta.begin-document.latex variable.parameter</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#CDCDCD</string> + <key>foreground</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>meta.brace.erb.return-value</string> + <key>scope</key> + <string>meta.brace.erb.return-value</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#45815D33</string> + <key>foreground</key> + <string>#596B61</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>source.ruby.rails.embedded.return-value.one-line</string> + <key>scope</key> + <string>source.ruby.rails.embedded.return-value.one-line</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#66666633</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>meta.brace.erb</string> + <key>scope</key> + <string>punctuation.section.embedded -(source string source punctuation.section.embedded), meta.brace.erb.html</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00FFF81A</string> + <key>foreground</key> + <string>#56A5A4</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>source.ruby.rails.embedded.one-line</string> + <key>scope</key> + <string>source.ruby.rails.embedded.one-line</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00FFF81A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String Embedded Source</string> + <key>scope</key> + <string>source string source punctuation.section.embedded</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#555F69</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>◊ Source</string> + <key>scope</key> + <string>source</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#000000</string> + <key>fontStyle</key> + <string></string> + </dict> + </dict> + <dict> + <key>name</key> + <string>◊ meta.brace.erb</string> + <key>scope</key> + <string>meta.brace.erb</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>◊ Source String Source</string> + <key>scope</key> + <string>source string source</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#33333380</string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>◊ Source String Interpolated Source</string> + <key>scope</key> + <string>source string.interpolated source</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00000099</string> + <key>foreground</key> + <string>#999999</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>◊ Source Embeded Source</string> + <key>scope</key> + <string>source.java.embedded</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#3333331A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>◊ Text</string> + <key>scope</key> + <string>text -text.xml.strict</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>◊ Text Source</string> + <key>scope</key> + <string>text source, meta.scope.django.template</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#000000</string> + <key>foreground</key> + <string>#CCCCCC</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>◊ Text Source Text String</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>◊ Text String Source</string> + <key>scope</key> + <string>text string source</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#999999</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>◊ Text Source String Source</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>◊ Text String Source String Source</string> + <key>scope</key> + <string>text string source string source</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Syntax</string> + <key>scope</key> + <string>meta.syntax</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid</string> + <key>scope</key> + <string>invalid</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#A7595A</string> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#211211</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>0comment</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#0000FF1A</string> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#8F8FC3</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment Punctuation</string> + <key>scope</key> + <string>comment punctuation</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#0000FF1A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>comment</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment Punctuation</string> + <key>scope</key> + <string>comment punctuation</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#8080800D</string> + <key>fontStyle</key> + <string>bold italic</string> + <key>foreground</key> + <string>#262626</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ HTML Comment</string> + <key>scope</key> + <string>text comment.block -source</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>D Diff Add</string> + <key>scope</key> + <string>markup.inserted</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#15281F</string> + <key>foreground</key> + <string>#81BB9E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>D Diff Delete</string> + <key>scope</key> + <string>markup.deleted</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#400021</string> + <key>foreground</key> + <string>#BC839F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>D Diff Changed</string> + <key>scope</key> + <string>markup.changed</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#533F2C</string> + <key>foreground</key> + <string>#C3C38F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>text.subversion-commit meta.scope.changed-files</string> + <key>scope</key> + <string>text.subversion-commit meta.scope.changed-files, text.subversion-commit meta.scope.changed-files.svn meta.diff.separator</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#000000</string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>text.subversion-commit</string> + <key>scope</key> + <string>text.subversion-commit</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF</string> + <key>foreground</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>meta.delimiter</string> + <key>scope</key> + <string>punctuation.terminator, meta.delimiter, punctuation.separator.method</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF03</string> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>meta.delimiter.statement.js</string> + <key>scope</key> + <string>punctuation.terminator.statement, meta.delimiter.statement.js</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#000000BF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>meta.delimiter.object.js</string> + <key>scope</key> + <string>meta.delimiter.object.js</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00000040</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Bold String Quotes</string> + <key>scope</key> + <string>string.quoted.single.brace, string.quoted.double.brace</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#533F2C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>meta.headers.blog</string> + <key>scope</key> + <string>text.blog -(text.blog text)</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>meta.headers.blog</string> + <key>scope</key> + <string>meta.headers.blog</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF</string> + <key>foreground</key> + <string>#666666</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>meta.headers.blog keyword.other.blog</string> + <key>scope</key> + <string>meta.headers.blog keyword.other.blog</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00FFF81A</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#192B2A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>meta.headers.blog string.unquoted.blog</string> + <key>scope</key> + <string>meta.headers.blog string.unquoted.blog</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFF551A</string> + <key>foreground</key> + <string>#533F2C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>meta.brace.pipe</string> + <key>scope</key> + <string>meta.brace.pipe</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#33333333</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#4C4C4C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Misc Punctuation</string> + <key>scope</key> + <string>meta.brace.erb, source.ruby.embedded.source.brace, punctuation.section.dictionary, punctuation.terminator.dictionary, punctuation.separator.object</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#4C4C4C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Curly Punctuation</string> + <key>scope</key> + <string>meta.group.braces.curly punctuation.section.scope, meta.brace.curly</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Object Punctuation</string> + <key>scope</key> + <string>punctuation.separator.objects, meta.group.braces.curly meta.delimiter.object.comma, punctuation.separator.key-value -meta.tag</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#345743</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Array Punctuation</string> + <key>scope</key> + <string>meta.group.braces.square punctuation.section.scope, meta.group.braces.square meta.delimiter.object.comma, meta.brace.square, punctuation.separator.array, punctuation.section.array</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#803D001A</string> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#695F55</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>meta.brace.curly meta.group</string> + <key>scope</key> + <string>meta.brace.curly meta.group</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00000080</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#CDCDCD</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function Punctuation</string> + <key>scope</key> + <string>meta.group.braces.round punctuation.section.scope, meta.group.braces.round meta.delimiter.object.comma, meta.brace.round</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#532D40</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>meta.brace.curly.function</string> + <key>scope</key> + <string>punctuation.section.function, meta.brace.curly.function, meta.function-call punctuation.section.scope.ruby</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#3C008033</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#ABACD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>º meta.source.embedded</string> + <key>scope</key> + <string>meta.source.embedded, entity.other.django.tagbraces</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#00000080</string> + <key>foreground</key> + <string>#666666</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>º meta.group.braces.round JS</string> + <key>scope</key> + <string>source.js meta.group.braces.round, meta.scope.heredoc</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>º meta.group.braces 1</string> + <key>scope</key> + <string>meta.odd-tab.group1, meta.group.braces, meta.block.slate, text.xml.strict meta.tag, meta.tell-block meta.tell-block</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#0A0A0A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>º meta.group.braces 2</string> + <key>scope</key> + <string>meta.even-tab.group2, meta.group.braces meta.group.braces, meta.block.slate meta.block.slate, text.xml.strict meta.tag meta.tag, meta.group.braces meta.group.braces, meta.tell-block meta.tell-block</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#0E0E0E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>º meta.group.braces 3</string> + <key>scope</key> + <string>meta.odd-tab.group3, meta.group.braces meta.group.braces meta.group.braces , meta.block.slate meta.block.slate meta.block.slate , text.xml.strict meta.tag meta.tag meta.tag, meta.group.braces meta.group.braces meta.group.braces, meta.tell-block meta.tell-block meta.tell-block</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#111111</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>º meta.group.braces 4</string> + <key>scope</key> + <string>meta.even-tab.group4, meta.group.braces meta.group.braces meta.group.braces meta.group.braces , meta.block.slate meta.block.slate meta.block.slate meta.block.slate , text.xml.strict meta.tag meta.tag meta.tag meta.tag, meta.group.braces meta.group.braces meta.group.braces meta.group.braces, meta.tell-block meta.tell-block meta.tell-block meta.tell-block</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#151515</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>º meta.group.braces 5</string> + <key>scope</key> + <string>meta.odd-tab.group5, meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces , meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate , text.xml.strict meta.tag meta.tag meta.tag meta.tag meta.tag, meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces, meta.tell-block meta.tell-block meta.tell-block meta.tell-block meta.tell-block</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#191919</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>º meta.group.braces 6</string> + <key>scope</key> + <string>meta.even-tab.group6, meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces , meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate , text.xml.strict meta.tag meta.tag meta.tag meta.tag meta.tag meta.tag, meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces, meta.tell-block meta.tell-block meta.tell-block meta.tell-block meta.tell-block meta.tell-block</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#1C1C1C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>º meta.group.braces 7</string> + <key>scope</key> + <string>meta.odd-tab.group7, meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces , meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate , text.xml.strict meta.tag meta.tag meta.tag meta.tag meta.tag meta.tag meta.tag, meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces, meta.tell-block meta.tell-block meta.tell-block meta.tell-block meta.tell-block meta.tell-block meta.tell-block</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#1F1F1F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>º meta.group.braces 8</string> + <key>scope</key> + <string>meta.even-tab.group8, meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces , meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate , text.xml.strict meta.tag meta.tag meta.tag meta.tag meta.tag meta.tag meta.tag meta.tag, meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces, meta.tell-block meta.tell-block meta.tell-block meta.tell-block meta.tell-block meta.tell-block meta.tell-block meta.tell-block</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#212121</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>º meta.group.braces 9</string> + <key>scope</key> + <string>meta.odd-tab.group11, meta.odd-tab.group10, meta.odd-tab.group9, meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces , meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate meta.block.slate , text.xml.strict meta.tag meta.tag meta.tag meta.tag meta.tag meta.tag meta.tag meta.tag meta.tag, meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces meta.group.braces, meta.tell-block meta.tell-block meta.tell-block meta.tell-block meta.tell-block meta.tell-block meta.tell-block meta.tell-block meta.tell-block</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#242424</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>º meta.block.slate </string> + <key>scope</key> + <string>meta.block.slate</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#666666</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>º meta.block.content.slate </string> + <key>scope</key> + <string>meta.block.content.slate </string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CDCDCD</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>—————————————————</string> + <key>settings</key> + <dict/> + </dict> + </array> + <key>uuid</key> + <string>4535004C-927A-401A-A6D5-1C9AC89E24C6</string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/Cobalt.tmTheme b/app/rcc/edbee/themes/Cobalt.tmTheme new file mode 100644 index 00000000..97903587 --- /dev/null +++ b/app/rcc/edbee/themes/Cobalt.tmTheme @@ -0,0 +1,559 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>comment</key> + <string>Created by Jacob Rus. Based on ‘Slate’ by Wilson Miner</string> + <key>author</key> + <string>Jacob Rus</string> + <key>name</key> + <string>Cobalt</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#002240</string> + <key>caret</key> + <string>#FFFFFF</string> + <key>foreground</key> + <string>#FFFFFF</string> + <key>invisibles</key> + <string>#FFFFFF26</string> + <key>lineHighlight</key> + <string>#00000059</string> + <key>selection</key> + <string>#B36539BF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Punctuation</string> + <key>scope</key> + <string>punctuation - (punctuation.definition.string || punctuation.definition.comment)</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#E1EFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Constant</string> + <key>scope</key> + <string>constant</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FF628C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Entity</string> + <key>scope</key> + <string>entity</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FFDD00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FF9D00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Storage</string> + <key>scope</key> + <string>storage</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FFEE80</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String</string> + <key>scope</key> + <string>string -string.unquoted.old-plist -string.unquoted.heredoc, string.unquoted.heredoc string</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#3AD900</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#0088FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Support</string> + <key>scope</key> + <string>support</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#80FFBB</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Variable</string> + <key>scope</key> + <string>variable</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#CCCCCC</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Lang Variable</string> + <key>scope</key> + <string>variable.language</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FF80E1</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function Call</string> + <key>scope</key> + <string>meta.function-call</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFEE80</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid</string> + <key>scope</key> + <string>invalid</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#800F00</string> + <key>foreground</key> + <string>#F8F8F8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Embedded Source</string> + <key>scope</key> + <string>text source, string.unquoted.heredoc, source source</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#223545</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Entity inherited-class</string> + <key>scope</key> + <string>entity.other.inherited-class</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#80FCFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String embedded-source</string> + <key>scope</key> + <string>string.quoted source</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#9EFF80</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String constant</string> + <key>scope</key> + <string>string constant</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#80FF82</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String.regexp</string> + <key>scope</key> + <string>string.regexp</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#80FFC2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String variable</string> + <key>scope</key> + <string>string variable</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#EDEF7D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Support.function</string> + <key>scope</key> + <string>support.function</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FFB054</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Support.constant</string> + <key>scope</key> + <string>support.constant</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#EB939A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Exception</string> + <key>scope</key> + <string>support.type.exception</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FF1E00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>C/C++ Preprocessor Line</string> + <key>scope</key> + <string>meta.preprocessor.c</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#8996A8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>C/C++ Preprocessor Directive</string> + <key>scope</key> + <string>meta.preprocessor.c keyword</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#AFC4DB</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Doctype/XML Processing</string> + <key>scope</key> + <string>meta.sgml.html meta.doctype, meta.sgml.html meta.doctype entity, meta.sgml.html meta.doctype string, meta.xml-processing, meta.xml-processing entity, meta.xml-processing string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#73817D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Meta.tag.A</string> + <key>scope</key> + <string>meta.tag, meta.tag entity</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#9EFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>css tag-name</string> + <key>scope</key> + <string>meta.selector.css entity.name.tag</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#9EFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>css#id</string> + <key>scope</key> + <string>meta.selector.css entity.other.attribute-name.id</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFB454</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>css.class</string> + <key>scope</key> + <string>meta.selector.css entity.other.attribute-name.class</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#5FE461</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>css property-name:</string> + <key>scope</key> + <string>support.type.property-name.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#9DF39F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>css property-value;</string> + <key>scope</key> + <string>meta.property-group support.constant.property-value.css, meta.property-value support.constant.property-value.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#F6F080</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>css @at-rule</string> + <key>scope</key> + <string>meta.preprocessor.at-rule keyword.control.at-rule</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#F6AA11</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>css additional-constants</string> + <key>scope</key> + <string>meta.property-value support.constant.named-color.css, meta.property-value constant</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#EDF080</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>css constructor.argument</string> + <key>scope</key> + <string>meta.constructor.argument.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#EB939A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>diff.header</string> + <key>scope</key> + <string>meta.diff, meta.diff.header</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#000E1A</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#F8F8F8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>diff.deleted</string> + <key>scope</key> + <string>markup.deleted</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#4C0900</string> + <key>foreground</key> + <string>#F8F8F8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>diff.changed</string> + <key>scope</key> + <string>markup.changed</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#806F00</string> + <key>foreground</key> + <string>#F8F8F8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>diff.inserted</string> + <key>scope</key> + <string>markup.inserted</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#154F00</string> + <key>foreground</key> + <string>#F8F8F8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Raw Markup</string> + <key>scope</key> + <string>markup.raw</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#8FDDF630</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Block Quote</string> + <key>scope</key> + <string>markup.quote</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#004480</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>List</string> + <key>scope</key> + <string>markup.list</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#130D26</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Bold Markup</string> + <key>scope</key> + <string>markup.bold</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#C1AFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Italic Markup</string> + <key>scope</key> + <string>markup.italic</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#B8FFD9</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Heading Markup</string> + <key>scope</key> + <string>markup.heading</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#001221</string> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#C8E4FD</string> + </dict> + </dict> + </array> + <key>uuid</key> + <string>06CD1FB2-A00A-4F8C-97B2-60E131980454</string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/Dawn.tmTheme b/app/rcc/edbee/themes/Dawn.tmTheme new file mode 100644 index 00000000..a09a3bf2 --- /dev/null +++ b/app/rcc/edbee/themes/Dawn.tmTheme @@ -0,0 +1,441 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>author</key> + <string>David Powers</string> + <key>comment</key> + <string>Dawn</string> + <key>name</key> + <string>Dawn</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#F9F9F9</string> + <key>caret</key> + <string>#000000</string> + <key>foreground</key> + <string>#080808</string> + <key>invisibles</key> + <string>#4B4B7E80</string> + <key>lineHighlight</key> + <string>#2463B41F</string> + <key>selection</key> + <string>#275FFF4D</string> + <key>shadow</key> + <string>#808080</string> + <key>shadowWidth</key> + <string>6</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#5A525F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Constant</string> + <key>scope</key> + <string>constant</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#811F24</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Entity</string> + <key>scope</key> + <string>entity</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#BF4F24</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#794938</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Storage</string> + <key>scope</key> + <string>storage</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#A71D5D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String</string> + <key>scope</key> + <string>string | punctuation.definition.string</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#0B6125</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Support</string> + <key>scope</key> + <string>support</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#691C97</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Variable</string> + <key>scope</key> + <string>variable</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#234A97</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Punctuation.separator</string> + <key>scope</key> + <string>punctuation.separator</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#794938</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid – Deprecated</string> + <key>scope</key> + <string>invalid.deprecated</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold italic underline</string> + <key>foreground</key> + <string>#B52A1D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid – Illegal</string> + <key>scope</key> + <string>invalid.illegal</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#B52A1D</string> + <key>fontStyle</key> + <string>italic underline</string> + <key>foreground</key> + <string>#F8F8F8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String embedded-source</string> + <key>scope</key> + <string>string source</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#6F8BBA26</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#080808</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String constant</string> + <key>scope</key> + <string>string constant</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#696969</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String variable</string> + <key>scope</key> + <string>string variable</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#234A97</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String.regexp</string> + <key>scope</key> + <string>string.regexp</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#CF5628</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String.regexp.«special»</string> + <key>scope</key> + <string>string.regexp.character-class, string.regexp constant.character.escaped, string.regexp source.ruby.embedded, string.regexp string.regexp.arbitrary-repitition</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold italic</string> + <key>foreground</key> + <string>#CF5628</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String.regexp constant.character.escape</string> + <key>scope</key> + <string>string.regexp constant.character.escape</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#811F24</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Embedded Source</string> + <key>scope</key> + <string>text source</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#6F8BBA26</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Support.function</string> + <key>scope</key> + <string>support.function</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#693A17</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Support.constant</string> + <key>scope</key> + <string>support.constant</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#B4371F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Support.variable</string> + <key>scope</key> + <string>support.variable</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#234A97</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup.list</string> + <key>scope</key> + <string>markup.list</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#693A17</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup.heading</string> + <key>scope</key> + <string>markup.heading | markup.heading entity.name</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#19356D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup.quote</string> + <key>scope</key> + <string>markup.quote</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#BBBBBB30</string> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#0B6125</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup.italic</string> + <key>scope</key> + <string>markup.italic</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#080808</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup.bold</string> + <key>scope</key> + <string>markup.bold</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#080808</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup.underline</string> + <key>scope</key> + <string>markup.underline</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + <key>foreground</key> + <string>#080808</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup.link</string> + <key>scope</key> + <string>markup.link</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic underline</string> + <key>foreground</key> + <string>#234A97</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup.raw</string> + <key>scope</key> + <string>markup.raw</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#BBBBBB30</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#234A97</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup.deleted</string> + <key>scope</key> + <string>markup.deleted</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#B52A1D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Meta.separator</string> + <key>scope</key> + <string>meta.separator</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#DCDCDC</string> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#19356D</string> + </dict> + </dict> + </array> + <key>uuid</key> + <string>E7E82498-F9EA-49A6-A0D8-12327EA46B01</string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/Eiffel.tmTheme b/app/rcc/edbee/themes/Eiffel.tmTheme new file mode 100644 index 00000000..1e8160c6 --- /dev/null +++ b/app/rcc/edbee/themes/Eiffel.tmTheme @@ -0,0 +1,439 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>name</key> + <string>Eiffel</string> + <key>author</key> + <string>Ian Joyner</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF</string> + <key>caret</key> + <string>#000000</string> + <key>foreground</key> + <string>#000000</string> + <key>invisibles</key> + <string>#BFBFBF</string> + <key>lineHighlight</key> + <string>#00000012</string> + <key>selection</key> + <string>#C3DCFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#00B418</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Variable</string> + <key>scope</key> + <string>variable</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#0206FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#0100B6</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Number</string> + <key>scope</key> + <string>constant.numeric</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#CD0000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>User-defined constant</string> + <key>scope</key> + <string>constant</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#C5060B</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Built-in constant</string> + <key>scope</key> + <string>constant.language</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#585CF6</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String</string> + <key>scope</key> + <string>string</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#D80800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String interpolation</string> + <key>scope</key> + <string>constant.character.escape, string source</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#26B31A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Preprocessor line</string> + <key>scope</key> + <string>meta.preprocessor</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#1A921C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Preprocessor directive</string> + <key>scope</key> + <string>keyword.control.import</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#0C450D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function name</string> + <key>scope</key> + <string>entity.name.function, keyword.other.name-of-parameter.objc</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#0000A2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Type name</string> + <key>scope</key> + <string>entity.name.type</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Inherited class name</string> + <key>scope</key> + <string>entity.other.inherited-class</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function parameter</string> + <key>scope</key> + <string>variable.parameter</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function argument and result types</string> + <key>scope</key> + <string>storage.type.method</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#70727E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Section</string> + <key>scope</key> + <string>meta.section entity.name.section, declaration.section entity.name.section</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library function</string> + <key>scope</key> + <string>support.function</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#3C4C72</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library object</string> + <key>scope</key> + <string>support.class, support.type</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#6D79DE</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library constant</string> + <key>scope</key> + <string>support.constant</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#06960E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library variable</string> + <key>scope</key> + <string>support.variable</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#21439C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>JS: Operator</string> + <key>scope</key> + <string>keyword.operator.js</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#687687</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid</string> + <key>scope</key> + <string>invalid</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#990000</string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid trailing whitespace</string> + <key>scope</key> + <string>invalid.deprecated.trailing-whitespace</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFD0D0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Embedded source</string> + <key>scope</key> + <string>text source, string.unquoted</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#427FF530</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup XML declaration</string> + <key>scope</key> + <string>meta.xml-processing, declaration.xml-processing</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#68685B</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup DOCTYPE</string> + <key>scope</key> + <string>meta.doctype, declaration.doctype</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#888888</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup DTD</string> + <key>scope</key> + <string>meta.doctype.DTD, declaration.doctype.DTD</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup tag</string> + <key>scope</key> + <string>meta.tag, declaration.tag</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#1C02FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup name of tag</string> + <key>scope</key> + <string>entity.name.tag</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup tag attribute</string> + <key>scope</key> + <string>entity.other.attribute-name</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup: Heading</string> + <key>scope</key> + <string>markup.heading</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#0C07FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup: Quote</string> + <key>scope</key> + <string>markup.quote</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup: List</string> + <key>scope</key> + <string>markup.list</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#B90690</string> + </dict> + </dict> + </array> + <key>uuid</key> + <string>ADD7FDE7-C6BE-454B-A71A-7951ED54FB04</string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/Espresso Libre.tmTheme b/app/rcc/edbee/themes/Espresso Libre.tmTheme new file mode 100644 index 00000000..2ccae644 --- /dev/null +++ b/app/rcc/edbee/themes/Espresso Libre.tmTheme @@ -0,0 +1,402 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>author</key> + <string>Chris Thomas</string> + <key>name</key> + <string>Espresso Libre</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#2A211C</string> + <key>caret</key> + <string>#889AFF</string> + <key>foreground</key> + <string>#BDAE9D</string> + <key>invisibles</key> + <string>#BFBFBF</string> + <key>lineHighlight</key> + <string>#3A312C</string> + <key>selection</key> + <string>#C3DCFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#0066FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword, storage</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#43A8ED</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Number</string> + <key>scope</key> + <string>constant.numeric</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#44AA43</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>User-defined constant</string> + <key>scope</key> + <string>constant</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#C5656B</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Built-in constant</string> + <key>scope</key> + <string>constant.language</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#585CF6</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Variable</string> + <key>scope</key> + <string>variable.language, variable.other</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#318495</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String</string> + <key>scope</key> + <string>string</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#049B0A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String interpolation</string> + <key>scope</key> + <string>constant.character.escape, string source</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#2FE420</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Preprocessor line</string> + <key>scope</key> + <string>meta.preprocessor</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#1A921C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Preprocessor directive</string> + <key>scope</key> + <string>keyword.control.import</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#9AFF87</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function name</string> + <key>scope</key> + <string>entity.name.function, keyword.other.name-of-parameter.objc</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#FF9358</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Type name</string> + <key>scope</key> + <string>entity.name.type</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Inherited class name</string> + <key>scope</key> + <string>entity.other.inherited-class</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function parameter</string> + <key>scope</key> + <string>variable.parameter</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function argument and result types</string> + <key>scope</key> + <string>storage.type.method</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#8B8E9C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Section</string> + <key>scope</key> + <string>meta.section entity.name.section, declaration.section entity.name.section</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library function</string> + <key>scope</key> + <string>support.function</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#7290D9</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library object</string> + <key>scope</key> + <string>support.class, support.type</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#6D79DE</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library constant</string> + <key>scope</key> + <string>support.constant</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#00AF0E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library variable</string> + <key>scope</key> + <string>support.variable</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#2F5FE0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>JS: Operator</string> + <key>scope</key> + <string>keyword.operator.js</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#687687</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid</string> + <key>scope</key> + <string>invalid</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#990000</string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid trailing whitespace</string> + <key>scope</key> + <string>invalid.deprecated.trailing-whitespace</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFD0D0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Embedded source</string> + <key>scope</key> + <string>text source, string.unquoted</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#F5AA7730</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup XML declaration</string> + <key>scope</key> + <string>meta.tag.preprocessor.xml</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#8F7E65</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup DOCTYPE</string> + <key>scope</key> + <string>meta.tag.sgml.doctype</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#888888</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup DTD</string> + <key>scope</key> + <string>string.quoted.docinfo.doctype.DTD</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup tag</string> + <key>scope</key> + <string>meta.tag, declaration.tag</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#43A8ED</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup name of tag</string> + <key>scope</key> + <string>entity.name.tag</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup tag attribute</string> + <key>scope</key> + <string>entity.other.attribute-name</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + </array> + <key>uuid</key> + <string>6B90703E-4E4B-43C8-9D32-921BEDF6D725</string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/IDLE.tmTheme b/app/rcc/edbee/themes/IDLE.tmTheme new file mode 100644 index 00000000..704296f5 --- /dev/null +++ b/app/rcc/edbee/themes/IDLE.tmTheme @@ -0,0 +1,235 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>author</key> + <string>Domenico Carbotta</string> + <key>name</key> + <string>IDLE</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF</string> + <key>caret</key> + <string>#000000</string> + <key>foreground</key> + <string>#000000</string> + <key>invisibles</key> + <string>#BFBFBF</string> + <key>lineHighlight</key> + <string>#00000012</string> + <key>selection</key> + <string>#BAD6FD</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#919191</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String</string> + <key>scope</key> + <string>string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#00A33F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Number</string> + <key>scope</key> + <string>constant.numeric</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Built-in constant</string> + <key>scope</key> + <string>constant.language</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A535AE</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>User-defined constant</string> + <key>scope</key> + <string>constant.character, constant.other</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Variable</string> + <key>scope</key> + <string>variable.language, variable.other</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FF5600</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Storage</string> + <key>scope</key> + <string>storage</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FF5600</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Type name</string> + <key>scope</key> + <string>entity.name.type</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#21439C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Inherited class</string> + <key>scope</key> + <string>entity.other.inherited-class</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Function name</string> + <key>scope</key> + <string>entity.name.function</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#21439C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function argument</string> + <key>scope</key> + <string>variable.parameter</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Tag name</string> + <key>scope</key> + <string>entity.name.tag</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Tag attribute</string> + <key>scope</key> + <string>entity.other.attribute-name</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Library function</string> + <key>scope</key> + <string>support.function</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A535AE</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library constant</string> + <key>scope</key> + <string>support.constant</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A535AE</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library class/type</string> + <key>scope</key> + <string>support.type, support.class</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A535AE</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library variable</string> + <key>scope</key> + <string>support.variable</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A535AE</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid</string> + <key>scope</key> + <string>invalid</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#990000</string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String interpolation</string> + <key>scope</key> + <string>constant.other.placeholder.py</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#990000</string> + </dict> + </dict> + </array> + <key>uuid</key> + <string>DDC0CBE1-442B-4CB5-80E4-26E4CFB3A277</string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/LAZY.tmTheme b/app/rcc/edbee/themes/LAZY.tmTheme new file mode 100644 index 00000000..09ff5111 --- /dev/null +++ b/app/rcc/edbee/themes/LAZY.tmTheme @@ -0,0 +1,291 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>author</key> + <string>Domenico Carbotta</string> + <key>name</key> + <string>LAZY</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF</string> + <key>caret</key> + <string>#7C7C7C</string> + <key>foreground</key> + <string>#000000</string> + <key>invisibles</key> + <string>#B6B6B6</string> + <key>lineHighlight</key> + <string>#EFFCA68F</string> + <key>selection</key> + <string>#E3FC8D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#8C868F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Constant</string> + <key>scope</key> + <string>constant</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#3B5BB5</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Entity</string> + <key>scope</key> + <string>entity</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#3B5BB5</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Latex Entity</string> + <key>scope</key> + <string>text.tex.latex entity</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#D62A28</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword, storage</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FF7800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String</string> + <key>scope</key> + <string>string, meta.verbatim</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#409B1C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Support</string> + <key>scope</key> + <string>support</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#3B5BB5</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Variable</string> + <key>scope</key> + <string>variable</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid – Deprecated</string> + <key>scope</key> + <string>invalid.deprecated</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#990000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid – Illegal</string> + <key>scope</key> + <string>invalid.illegal</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#9D1E15</string> + <key>foreground</key> + <string>#F8F8F8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Superclass</string> + <key>scope</key> + <string>entity.other.inherited-class</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#3B5BB5</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String interpolation</string> + <key>scope</key> + <string>string constant.other.placeholder</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#671EBB</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>meta.function-call.py</string> + <key>scope</key> + <string>meta.function-call.py</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#3E4558</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>meta.tag</string> + <key>scope</key> + <string>meta.tag, meta.tag entity</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#3A4A64</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>OCaml variant</string> + <key>scope</key> + <string>keyword.type.variant</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#7F90AA</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>OCaml operator</string> + <key>scope</key> + <string>source.ocaml keyword.operator</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>OCaml infix operator</string> + <key>scope</key> + <string>source.ocaml keyword.operator.symbol.infix</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#3B5BB5</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>OCaml prefix operator</string> + <key>scope</key> + <string>source.ocaml keyword.operator.symbol.prefix</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#3B5BB5</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>OCaml infix f-p operator</string> + <key>scope</key> + <string>source.ocaml keyword.operator.symbol.infix.floating-point</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>OCaml prefix f-p operator</string> + <key>scope</key> + <string>source.ocaml keyword.operator.symbol.prefix.floating-point</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>OCaml f-p constant</string> + <key>scope</key> + <string>source.ocaml constant.numeric.floating-point</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + </array> + <key>uuid</key> + <string>A1E55FCB-3CD2-4811-9E73-D9B87419443A</string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/Mac Classic.tmTheme b/app/rcc/edbee/themes/Mac Classic.tmTheme new file mode 100644 index 00000000..4b789dfe --- /dev/null +++ b/app/rcc/edbee/themes/Mac Classic.tmTheme @@ -0,0 +1,450 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>author</key> + <string>Chris Thomas</string> + <key>name</key> + <string>Mac Classic</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFFFFF</string> + <key>caret</key> + <string>#000000</string> + <key>foreground</key> + <string>#000000</string> + <key>invisibles</key> + <string>#BFBFBF</string> + <key>lineHighlight</key> + <string>#00000012</string> + <key>selection</key> + <string>#4D97FF54</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#0066FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword, storage</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#0000FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Number</string> + <key>scope</key> + <string>constant.numeric</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#0000CD</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>User-defined constant</string> + <key>scope</key> + <string>constant</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#C5060B</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Built-in constant</string> + <key>scope</key> + <string>constant.language</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#585CF6</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Variable</string> + <key>scope</key> + <string>variable.language, variable.other</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#318495</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String</string> + <key>scope</key> + <string>string</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#036A07</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String interpolation</string> + <key>scope</key> + <string>constant.character.escape, string source</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#26B31A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Preprocessor line</string> + <key>scope</key> + <string>meta.preprocessor</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#1A921C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Preprocessor directive</string> + <key>scope</key> + <string>keyword.control.import</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#0C450D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function name</string> + <key>scope</key> + <string>entity.name.function, support.function.any-method</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#0000A2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Type name</string> + <key>scope</key> + <string>entity.name.type</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Inherited class name</string> + <key>scope</key> + <string>entity.other.inherited-class</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function parameter</string> + <key>scope</key> + <string>variable.parameter</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function argument and result types</string> + <key>scope</key> + <string>storage.type.method</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#70727E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Section</string> + <key>scope</key> + <string>meta.section entity.name.section, declaration.section entity.name.section</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library function</string> + <key>scope</key> + <string>support.function</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#3C4C72</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library object</string> + <key>scope</key> + <string>support.class, support.type</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#6D79DE</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library constant</string> + <key>scope</key> + <string>support.constant</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#06960E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library variable</string> + <key>scope</key> + <string>support.variable</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#21439C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>JS: Operator</string> + <key>scope</key> + <string>keyword.operator.js</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#687687</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid</string> + <key>scope</key> + <string>invalid</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#990000</string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid trailing whitespace</string> + <key>scope</key> + <string>invalid.deprecated.trailing-whitespace</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFD0D0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Embedded source</string> + <key>scope</key> + <string>text source, string.unquoted</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#0000000D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Embedded embedded source</string> + <key>scope</key> + <string>text source string.unquoted, text source text source</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#0000000F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup XML declaration</string> + <key>scope</key> + <string>meta.tag.preprocessor.xml</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#68685B</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup DOCTYPE</string> + <key>scope</key> + <string>meta.tag.sgml.doctype, meta.tag.sgml.doctype entity, meta.tag.sgml.doctype string, meta.tag.preprocessor.xml, meta.tag.preprocessor.xml entity, meta.tag.preprocessor.xml string</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#888888</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup DTD</string> + <key>scope</key> + <string>string.quoted.docinfo.doctype.DTD</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup tag</string> + <key>scope</key> + <string>meta.tag, declaration.tag</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#1C02FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup name of tag</string> + <key>scope</key> + <string>entity.name.tag</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup tag attribute</string> + <key>scope</key> + <string>entity.other.attribute-name</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup: Heading</string> + <key>scope</key> + <string>markup.heading</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#0C07FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup: Quote</string> + <key>scope</key> + <string>markup.quote</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup: List</string> + <key>scope</key> + <string>markup.list</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#B90690</string> + </dict> + </dict> + </array> + <key>uuid</key> + <string>71D40D9D-AE48-11D9-920A-000D93589AF6</string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/MagicWB (Amiga).tmTheme b/app/rcc/edbee/themes/MagicWB (Amiga).tmTheme new file mode 100644 index 00000000..7897886b --- /dev/null +++ b/app/rcc/edbee/themes/MagicWB (Amiga).tmTheme @@ -0,0 +1,376 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>author</key> + <string>Allan Odgaard</string> + <key>comment</key> + <string>Inspired by the original 8 MagicWB colors from Martin Huttenloher</string> + <key>name</key> + <string>MagicWB (Amiga)</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#969696</string> + <key>caret</key> + <string>#FFFFFF</string> + <key>foreground</key> + <string>#000000</string> + <key>invisibles</key> + <string>#FF38FF</string> + <key>lineHighlight</key> + <string>#00000012</string> + <key>selection</key> + <string>#B1B1B1</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#8D2E75</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String</string> + <key>scope</key> + <string>string</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FF000033</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Number</string> + <key>scope</key> + <string>constant.numeric</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Constant: Built-in</string> + <key>scope</key> + <string>constant.language</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#FFA995</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Constant: User-defined</string> + <key>scope</key> + <string>constant.character, constant.other</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#0000FF33</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FFA995</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Variable</string> + <key>scope</key> + <string>variable.language, variable.other</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFA995</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Storage</string> + <key>scope</key> + <string>storage</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#3A68A3</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Type Name</string> + <key>scope</key> + <string>entity.name.type</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Inherited Class</string> + <key>scope</key> + <string>entity.other.inherited-class</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function Name</string> + <key>scope</key> + <string>entity.name.function</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FFA995</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function Argument</string> + <key>scope</key> + <string>variable.parameter</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Entity Name</string> + <key>scope</key> + <string>entity.name</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#0000FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tag Attribute</string> + <key>scope</key> + <string>entity.other.attribute-name</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#3A68A3</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library Function</string> + <key>scope</key> + <string>support.function</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#E5B3FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Objective-C Method Call</string> + <key>scope</key> + <string>support.function.any-method</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Objective-C Method Call - :</string> + <key>scope</key> + <string>support.function.any-method - punctuation</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library Constant</string> + <key>scope</key> + <string>support.constant</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library Class/Type</string> + <key>scope</key> + <string>support.type, support.class</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFA995</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library Variable</string> + <key>scope</key> + <string>support.variable</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#3A68A3</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid</string> + <key>scope</key> + <string>invalid</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#797979</string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Include <system></string> + <key>scope</key> + <string>string.quoted.other.lt-gt.include</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#969696</string> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#FFA995</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Include "user"</string> + <key>scope</key> + <string>string.quoted.double.include</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#969696</string> + <key>foreground</key> + <string>#FFA995</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup: List Item</string> + <key>scope</key> + <string>markup.list</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#4D4E60</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup: Raw</string> + <key>scope</key> + <string>markup.raw</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#0000FF</string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup: Quote (Email)</string> + <key>scope</key> + <string>markup.quote</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#00F0C9</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup: Quote Double (Email)</string> + <key>scope</key> + <string>markup.quote markup.quote</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#4C457E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Embedded Source</string> + <key>scope</key> + <string>text.html source</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#8A9ECB</string> + </dict> + </dict> + </array> + <key>uuid</key> + <string>B0A18BAA-6220-481C-9914-F6D3E51B5410</string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/Monokai Bright.tmTheme b/app/rcc/edbee/themes/Monokai Bright.tmTheme new file mode 100644 index 00000000..3b53e4ed --- /dev/null +++ b/app/rcc/edbee/themes/Monokai Bright.tmTheme @@ -0,0 +1,390 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>name</key> + <string>Monokai Bright</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#272822</string> + <key>caret</key> + <string>#F8F8F0</string> + <key>foreground</key> + <string>#F8F8F2</string> + <key>invisibles</key> + <string>#3B3A32</string> + <key>lineHighlight</key> + <string>#3E3D32</string> + <key>selection</key> + <string>#9D550F</string> + <key>selectionForeground</key> + <string>#fffff8</string> + <key>inactiveSelection</key> + <string>#bbbbbb</string> + <key>inactiveSelectionForeground</key> + <string>#222222</string> + <key>findHighlight</key> + <string>#FFE792</string> + <key>findHighlightForeground</key> + <string>#000000</string> + <key>activeGuide</key> + <string>#9D550FB0</string> + + <key>bracketsForeground</key> + <string>#F8F8F2A5</string> + <key>bracketsOptions</key> + <string>underline</string> + + <key>bracketContentsForeground</key> + <string>#F8F8F2A5</string> + <key>bracketContentsOptions</key> + <string>underline</string> + + <key>tagsOptions</key> + <string>stippled_underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#75715E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String</string> + <key>scope</key> + <string>string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#E6DB74</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Number</string> + <key>scope</key> + <string>constant.numeric</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#AE81FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Built-in constant</string> + <key>scope</key> + <string>constant.language</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#AE81FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>User-defined constant</string> + <key>scope</key> + <string>constant.character, constant.other</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#AE81FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Variable</string> + <key>scope</key> + <string>variable</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#F92672</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Storage</string> + <key>scope</key> + <string>storage</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#F92672</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Storage type</string> + <key>scope</key> + <string>storage.type</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#66D9EF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Class name</string> + <key>scope</key> + <string>entity.name.class</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + <key>foreground</key> + <string>#A6E22E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Inherited class</string> + <key>scope</key> + <string>entity.other.inherited-class</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic underline</string> + <key>foreground</key> + <string>#A6E22E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function name</string> + <key>scope</key> + <string>entity.name.function</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A6E22E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function argument</string> + <key>scope</key> + <string>variable.parameter</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#FD971F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tag name</string> + <key>scope</key> + <string>entity.name.tag</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#F92672</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tag attribute</string> + <key>scope</key> + <string>entity.other.attribute-name</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A6E22E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library function</string> + <key>scope</key> + <string>support.function</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#66D9EF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library constant</string> + <key>scope</key> + <string>support.constant</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#66D9EF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library class/type</string> + <key>scope</key> + <string>support.type, support.class</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#66D9EF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library variable</string> + <key>scope</key> + <string>support.other.variable</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid</string> + <key>scope</key> + <string>invalid</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#F92672</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#F8F8F0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid deprecated</string> + <key>scope</key> + <string>invalid.deprecated</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#AE81FF</string> + <key>foreground</key> + <string>#F8F8F0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>JSON String</string> + <key>scope</key> + <string>meta.structure.dictionary.json string.quoted.double.json</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CFCFC2</string> + </dict> + </dict> + + <dict> + <key>name</key> + <string>diff.header</string> + <key>scope</key> + <string>meta.diff, meta.diff.header</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#75715E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>diff.deleted</string> + <key>scope</key> + <string>markup.deleted</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#F92672</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>diff.inserted</string> + <key>scope</key> + <string>markup.inserted</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A6E22E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>diff.changed</string> + <key>scope</key> + <string>markup.changed</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#E6DB74</string> + </dict> + </dict> + + <dict> + <key>scope</key> + <string>constant.numeric.line-number.find-in-files - match</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#AE81FFA0</string> + </dict> + </dict> + <dict> + <key>scope</key> + <string>entity.name.filename.find-in-files</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#E6DB74</string> + </dict> + </dict> + + </array> + <key>uuid</key> + <string>D8D5E82E-3D5B-46B5-B38E-8C841C21347E</string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/Monokai.tmTheme b/app/rcc/edbee/themes/Monokai.tmTheme new file mode 100644 index 00000000..c179cbe2 --- /dev/null +++ b/app/rcc/edbee/themes/Monokai.tmTheme @@ -0,0 +1,387 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>name</key> + <string>Monokai</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#272822</string> + <key>caret</key> + <string>#F8F8F0</string> + <key>foreground</key> + <string>#F8F8F2</string> + <key>invisibles</key> + <string>#3B3A32</string> + <key>lineHighlight</key> + <string>#3E3D32</string> + <key>selection</key> + <string>#49483E</string> + <key>findHighlight</key> + <string>#FFE792</string> + <key>findHighlightForeground</key> + <string>#000000</string> + <key>selectionBorder</key> + <string>#222218</string> + <key>activeGuide</key> + <string>#9D550FB0</string> + + <key>bracketsForeground</key> + <string>#F8F8F2A5</string> + <key>bracketsOptions</key> + <string>underline</string> + + <key>bracketContentsForeground</key> + <string>#F8F8F2A5</string> + <key>bracketContentsOptions</key> + <string>underline</string> + + <key>tagsOptions</key> + <string>stippled_underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#75715E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String</string> + <key>scope</key> + <string>string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#E6DB74</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Number</string> + <key>scope</key> + <string>constant.numeric</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#AE81FF</string> + </dict> + </dict> + + <dict> + <key>name</key> + <string>Built-in constant</string> + <key>scope</key> + <string>constant.language</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#AE81FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>User-defined constant</string> + <key>scope</key> + <string>constant.character, constant.other</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#AE81FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Variable</string> + <key>scope</key> + <string>variable</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#F92672</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Storage</string> + <key>scope</key> + <string>storage</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#F92672</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Storage type</string> + <key>scope</key> + <string>storage.type</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#66D9EF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Class name</string> + <key>scope</key> + <string>entity.name.class</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + <key>foreground</key> + <string>#A6E22E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Inherited class</string> + <key>scope</key> + <string>entity.other.inherited-class</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic underline</string> + <key>foreground</key> + <string>#A6E22E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function name</string> + <key>scope</key> + <string>entity.name.function</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A6E22E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function argument</string> + <key>scope</key> + <string>variable.parameter</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#FD971F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tag name</string> + <key>scope</key> + <string>entity.name.tag</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#F92672</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tag attribute</string> + <key>scope</key> + <string>entity.other.attribute-name</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A6E22E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library function</string> + <key>scope</key> + <string>support.function</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#66D9EF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library constant</string> + <key>scope</key> + <string>support.constant</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#66D9EF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library class/type</string> + <key>scope</key> + <string>support.type, support.class</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#66D9EF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library variable</string> + <key>scope</key> + <string>support.other.variable</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid</string> + <key>scope</key> + <string>invalid</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#F92672</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#F8F8F0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid deprecated</string> + <key>scope</key> + <string>invalid.deprecated</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#AE81FF</string> + <key>foreground</key> + <string>#F8F8F0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>JSON String</string> + <key>scope</key> + <string>meta.structure.dictionary.json string.quoted.double.json</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CFCFC2</string> + </dict> + </dict> + + <dict> + <key>name</key> + <string>diff.header</string> + <key>scope</key> + <string>meta.diff, meta.diff.header</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#75715E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>diff.deleted</string> + <key>scope</key> + <string>markup.deleted</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#F92672</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>diff.inserted</string> + <key>scope</key> + <string>markup.inserted</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A6E22E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>diff.changed</string> + <key>scope</key> + <string>markup.changed</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#E6DB74</string> + </dict> + </dict> + + <dict> + <key>scope</key> + <string>constant.numeric.line-number.find-in-files - match</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#AE81FFA0</string> + </dict> + </dict> + <dict> + <key>scope</key> + <string>entity.name.filename.find-in-files</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#E6DB74</string> + </dict> + </dict> + + </array> + <key>uuid</key> + <string>D8D5E82E-3D5B-46B5-B38E-8C841C21347D</string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/Pastels on Dark.tmTheme b/app/rcc/edbee/themes/Pastels on Dark.tmTheme new file mode 100644 index 00000000..e3928606 --- /dev/null +++ b/app/rcc/edbee/themes/Pastels on Dark.tmTheme @@ -0,0 +1,701 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>author</key> + <string>Mats Persson</string> + <key>name</key> + <string>Pastels on Dark</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#211E1E</string> + <key>caret</key> + <string>#FFFFFF</string> + <key>foreground</key> + <string>#DADADA</string> + <key>invisibles</key> + <string>#4F4D4D</string> + <key>lineHighlight</key> + <string>#353030</string> + <key>selection</key> + <string>#73597E80</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comments</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#555555</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comments Block</string> + <key>scope</key> + <string>comment.block</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#555555</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Strings</string> + <key>scope</key> + <string>string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#AD9361</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Numbers</string> + <key>scope</key> + <string>constant.numeric</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#CCCCCC</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keywords</string> + <key>scope</key> + <string>keyword</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A1A1FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Preprocessor Line</string> + <key>scope</key> + <string>meta.preprocessor</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#2F006E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Preprocessor Directive</string> + <key>scope</key> + <string>keyword.control.import</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Functions</string> + <key>scope</key> + <string>support.function</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A1A1FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function result</string> + <key>scope</key> + <string>declaration.function function-result</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#0000FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function name</string> + <key>scope</key> + <string>declaration.function function-name</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function argument name</string> + <key>scope</key> + <string>declaration.function argument-name</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function argument type</string> + <key>scope</key> + <string>declaration.function function-arg-type</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#0000FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function argument variable</string> + <key>scope</key> + <string>declaration.function function-argument</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Class name</string> + <key>scope</key> + <string>declaration.class class-name</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Class inheritance</string> + <key>scope</key> + <string>declaration.class class-inheritance</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid</string> + <key>scope</key> + <string>invalid</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FF0000</string> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#FFF9F9</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid Trailing Whitespace</string> + <key>scope</key> + <string>invalid.deprecated.trailing-whitespace</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FFD0D0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Section</string> + <key>scope</key> + <string>declaration.section section-name</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Interpolation</string> + <key>scope</key> + <string>string.interpolation</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#C10006</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Regular Expressions</string> + <key>scope</key> + <string>string.regexp</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#666666</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Variables</string> + <key>scope</key> + <string>variable</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#C1C144</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Constants</string> + <key>scope</key> + <string>constant</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#6782D3</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Character Constants</string> + <key>scope</key> + <string>constant.character</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#AFA472</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Language Constants</string> + <key>scope</key> + <string>constant.language</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#DE8E30</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Embedded Code</string> + <key>scope</key> + <string>embedded</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tag name</string> + <key>scope</key> + <string>keyword.markup.element-name</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#858EF4</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Attribute name</string> + <key>scope</key> + <string>keyword.markup.attribute-name</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#9B456F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Attribute with Value</string> + <key>scope</key> + <string>meta.attribute-with-value</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#9B456F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Exceptions</string> + <key>scope</key> + <string>keyword.exception</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#C82255</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Operators</string> + <key>scope</key> + <string>keyword.operator</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#47B8D6</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Control Structures</string> + <key>scope</key> + <string>keyword.control</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#6969FA</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: DocInfo XML</string> + <key>scope</key> + <string>meta.tag.preprocessor.xml</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#68685B</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: DocType</string> + <key>scope</key> + <string>meta.tag.sgml.doctype</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#888888</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: DocInfo DTD</string> + <key>scope</key> + <string>string.quoted.docinfo.doctype.DTD</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: ServerSide Includes</string> + <key>scope</key> + <string>comment.other.server-side-include.xhtml, comment.other.server-side-include.html</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#909090</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: Tag</string> + <key>scope</key> + <string>text.html declaration.tag, text.html meta.tag, text.html entity.name.tag.xhtml</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#858EF4</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: attribute=""</string> + <key>scope</key> + <string>keyword.markup.attribute-name</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#9B456F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: PHPdocs</string> + <key>scope</key> + <string>keyword.other.phpdoc.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#777777</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Include() & Require()</string> + <key>scope</key> + <string>keyword.other.include.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#C82255</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Constants Core Predefined</string> + <key>scope</key> + <string>support.constant.core.php</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#DE8E20</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Constants Standard Predefined</string> + <key>scope</key> + <string>support.constant.std.php</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#DE8E10</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Variables Globals</string> + <key>scope</key> + <string>variable.other.global.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#B72E1D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Variables Safer Globals</string> + <key>scope</key> + <string>variable.other.global.safer.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#00FF00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Strings Single-Quoted</string> + <key>scope</key> + <string>string.quoted.single.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#BFA36D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Keywords Storage</string> + <key>scope</key> + <string>keyword.storage.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#6969FA</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Strings Double-Quoted</string> + <key>scope</key> + <string>string.quoted.double.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#AD9361</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Selectors #ID</string> + <key>scope</key> + <string>entity.other.attribute-name.id.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#EC9E00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Selectors <Elements></string> + <key>scope</key> + <string>entity.name.tag.css</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#B8CD06</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Selectors .ClassName</string> + <key>scope</key> + <string>entity.other.attribute-name.class.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#EDCA06</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Selectors :PseudoClass</string> + <key>scope</key> + <string>entity.other.attribute-name.pseudo-class.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#2E759C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Invalid Comma</string> + <key>scope</key> + <string>invalid.bad-comma.css</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FF0000</string> + <key>foreground</key> + <string>#FFFFFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Property Value</string> + <key>scope</key> + <string>support.constant.property-value.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#9B2E4D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Property Keyword</string> + <key>scope</key> + <string>support.type.property-name.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#E1C96B</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Property Colours</string> + <key>scope</key> + <string>constant.other.rgb-value.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#666633</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Font Names</string> + <key>scope</key> + <string>support.constant.font-name.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#666633</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>TMLangDef: Keys</string> + <key>scope</key> + <string>support.constant.tm-language-def, support.constant.name.tm-language-def</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#7171F3</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Units</string> + <key>scope</key> + <string>keyword.other.unit.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#6969FA</string> + </dict> + </dict> + </array> + <key>uuid</key> + <string>343011CC-B7DF-11D9-B5C6-000D93C8BE28</string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/Solarized (Dark).tmTheme b/app/rcc/edbee/themes/Solarized (Dark).tmTheme new file mode 100644 index 00000000..51aa4849 --- /dev/null +++ b/app/rcc/edbee/themes/Solarized (Dark).tmTheme @@ -0,0 +1,1897 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>name</key> + <string>Solarized (dark)</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#042029</string> + <key>caret</key> + <string>#819090</string> + <key>foreground</key> + <string>#839496</string> + <key>invisibles</key> + <string>#0A2933</string> + <key>lineHighlight</key> + <string>#0A2933</string> + <key>selection</key> + <string>#0A2933</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#586E75</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String</string> + <key>scope</key> + <string>string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#2AA198</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>StringNumber</string> + <key>scope</key> + <string>string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#586E75</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Regexp</string> + <key>scope</key> + <string>string.regexp</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D30102</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Number</string> + <key>scope</key> + <string>constant.numeric</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D33682</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Variable</string> + <key>scope</key> + <string>variable.language, variable.other</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#859900</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Storage</string> + <key>scope</key> + <string>storage</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#738A05</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Class name</string> + <key>scope</key> + <string>entity.name.class, entity.name.type.class</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function name</string> + <key>scope</key> + <string>entity.name.function</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Variable start</string> + <key>scope</key> + <string>punctuation.definition.variable</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#859900</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Embedded code markers</string> + <key>scope</key> + <string>punctuation.section.embedded.begin, punctuation.section.embedded.end</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D30102</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Built-in constant</string> + <key>scope</key> + <string>constant.language, meta.preprocessor</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#B58900</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Support.construct</string> + <key>scope</key> + <string>support.function.construct, keyword.other.new</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D30102</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>User-defined constant</string> + <key>scope</key> + <string>constant.character, constant.other</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CB4B16</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Inherited class</string> + <key>scope</key> + <string>entity.other.inherited-class</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Function argument</string> + <key>scope</key> + <string>variable.parameter</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Tag name</string> + <key>scope</key> + <string>entity.name.tag</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tag start/end</string> + <key>scope</key> + <string>punctuation.definition.tag.html, punctuation.definition.tag.begin, punctuation.definition.tag.end</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#586E75</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tag attribute</string> + <key>scope</key> + <string>entity.other.attribute-name</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#93A1A1</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library function</string> + <key>scope</key> + <string>support.function</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Continuation</string> + <key>scope</key> + <string>punctuation.separator.continuation</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D30102</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library constant</string> + <key>scope</key> + <string>support.constant</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Library class/type</string> + <key>scope</key> + <string>support.type, support.class</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#859900</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library Exception</string> + <key>scope</key> + <string>support.type.exception</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CB4B16</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Special</string> + <key>scope</key> + <string>keyword.other.special-method</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CB4B16</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library variable</string> + <key>scope</key> + <string>support.other.variable</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Invalid</string> + <key>scope</key> + <string>invalid</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Quoted String</string> + <key>scope</key> + <string>string.quoted.double, string.quoted.single</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Quotes</string> + <key>scope</key> + <string>punctuation.definition.string.begin, punctuation.definition.string.end</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#C60000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Property</string> + <key>scope</key> + <string>entity.name.tag.css, support.type.property-name.css, meta.property-name.css</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: @font-face</string> + <key>scope</key> + <string>source.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D01F1E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Selector</string> + <key>scope</key> + <string>meta.selector.css</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#536871</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: {}</string> + <key>scope</key> + <string>punctuation.section.property-list.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#5A74CF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Numeric Value</string> + <key>scope</key> + <string>meta.property-value.css constant.numeric.css, keyword.other.unit.css,constant.other.color.rgb-value.css</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Value</string> + <key>scope</key> + <string>meta.property-value.css</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: !Important</string> + <key>scope</key> + <string>keyword.other.important.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D01F1E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Standard Value</string> + <key>scope</key> + <string>support.constant.color</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Tag</string> + <key>scope</key> + <string>entity.name.tag.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#738A13</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: : ,</string> + <key>scope</key> + <string>punctuation.separator.key-value.css, punctuation.terminator.rule.css</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#536871</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS .class</string> + <key>scope</key> + <string>entity.other.attribute-name.class.css</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS :pseudo</string> + <key>scope</key> + <string>entity.other.attribute-name.pseudo-element.css, entity.other.attribute-name.pseudo-class.css</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#BD3800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: #id</string> + <key>scope</key> + <string>entity.other.attribute-name.id.css</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>JS: Function Name</string> + <key>scope</key> + <string>meta.function.js, entity.name.function.js, support.function.dom.js</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>JS: Source</string> + <key>scope</key> + <string>text.html.basic source.js.embedded.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>JS: Function</string> + <key>scope</key> + <string>storage.type.function.js</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>JS: Numeric Constant</string> + <key>scope</key> + <string>constant.numeric.js</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>JS: []</string> + <key>scope</key> + <string>meta.brace.square.js</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>JS: Storage Type</string> + <key>scope</key> + <string>storage.type.js</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>()</string> + <key>scope</key> + <string>meta.brace.round, punctuation.definition.parameters.begin.js, punctuation.definition.parameters.end.js</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#93A1A1</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>{}</string> + <key>scope</key> + <string>meta.brace.curly.js</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: Doctype</string> + <key>scope</key> + <string>entity.name.tag.doctype.html, meta.tag.sgml.html, string.quoted.double.doctype.identifiers-and-DTDs.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#899090</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: Comment Block</string> + <key>scope</key> + <string>comment.block.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#839496</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: Script</string> + <key>scope</key> + <string>entity.name.tag.script.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: Style</string> + <key>scope</key> + <string>source.css.embedded.html string.quoted.double.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: Text</string> + <key>scope</key> + <string>text.html.ruby</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#BD3800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: =</string> + <key>scope</key> + <string>text.html.basic meta.tag.other.html, text.html.basic meta.tag.any.html, text.html.basic meta.tag.block.any, text.html.basic meta.tag.inline.any, text.html.basic meta.tag.structure.any.html, text.html.basic source.js.embedded.html, punctuation.separator.key-value.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#708284</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: something=</string> + <key>scope</key> + <string>text.html.basic entity.other.attribute-name.html</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#708284</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: "</string> + <key>scope</key> + <string>text.html.basic meta.tag.structure.any.html punctuation.definition.string.begin.html, punctuation.definition.string.begin.html, punctuation.definition.string.end.html </string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: <tag></string> + <key>scope</key> + <string>entity.name.tag.block.any.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: style</string> + <key>scope</key> + <string>source.css.embedded.html entity.name.tag.style.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: <style></string> + <key>scope</key> + <string>entity.name.tag.style.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: {}</string> + <key>scope</key> + <string>text.html.basic punctuation.section.property-list.css</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: Embeddable</string> + <key>scope</key> + <string>source.css.embedded.html, comment.block.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#819090</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Variable definition</string> + <key>scope</key> + <string>punctuation.definition.variable.ruby</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Function Name</string> + <key>scope</key> + <string>meta.function.method.with-arguments.ruby</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#708284</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Variable</string> + <key>scope</key> + <string>variable.language.ruby</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#469186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Function</string> + <key>scope</key> + <string>entity.name.function.ruby</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Keyword Control</string> + <key>scope</key> + <string>keyword.control.ruby, keyword.control.def.ruby</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#738A05</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Class</string> + <key>scope</key> + <string>keyword.control.class.ruby, meta.class.ruby</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#748B00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Class Name</string> + <key>scope</key> + <string>entity.name.type.class.ruby</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Keyword</string> + <key>scope</key> + <string>keyword.control.ruby</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#748B00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Support Class</string> + <key>scope</key> + <string>support.class.ruby</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Special Method</string> + <key>scope</key> + <string>keyword.other.special-method.ruby</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#748B00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Constant</string> + <key>scope</key> + <string>constant.language.ruby, constant.numeric.ruby</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Constant Other</string> + <key>scope</key> + <string>variable.other.constant.ruby</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: :symbol</string> + <key>scope</key> + <string>constant.other.symbol.ruby</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Punctuation Section ''</string> + <key>scope</key> + <string>punctuation.section.embedded.ruby, punctuation.definition.string.begin.ruby, punctuation.definition.string.end.ruby</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D01F1E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Special Method</string> + <key>scope</key> + <string>keyword.other.special-method.ruby</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#BD3800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Include</string> + <key>scope</key> + <string>keyword.control.import.include.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#BD3800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: erb =</string> + <key>scope</key> + <string>text.html.ruby meta.tag.inline.any.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#819090</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: erb ""</string> + <key>scope</key> + <string>text.html.ruby punctuation.definition.string.begin, text.html.ruby punctuation.definition.string.end</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Quoted Single</string> + <key>scope</key> + <string>punctuation.definition.string.begin, punctuation.definition.string.end</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#839496</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Class Names</string> + <key>scope</key> + <string>support.class.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#839496</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: []</string> + <key>scope</key> + <string>keyword.operator.index-start.php, keyword.operator.index-end.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D31E1E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Array</string> + <key>scope</key> + <string>meta.array.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#536871</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Array()</string> + <key>scope</key> + <string>meta.array.php support.function.construct.php, meta.array.empty.php support.function.construct.php</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Array Construct</string> + <key>scope</key> + <string>support.function.construct.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Array Begin</string> + <key>scope</key> + <string>punctuation.definition.array.begin, punctuation.definition.array.end</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D31E1E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Numeric Constant</string> + <key>scope</key> + <string>constant.numeric.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: New</string> + <key>scope</key> + <string>keyword.other.new.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CB4B16</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: ::</string> + <key>scope</key> + <string>keyword.operator.class</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#839496</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Other Property</string> + <key>scope</key> + <string>variable.other.property.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#899090</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Class</string> + <key>scope</key> + <string>storage.modifier.extends.php, storage.type.class.php, keyword.operator.class.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Class Function</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>PHP: Semicolon</string> + <key>scope</key> + <string>punctuation.terminator.expression.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#839496</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Inherited Class</string> + <key>scope</key> + <string>meta.other.inherited-class.php</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#536871</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Storage Type</string> + <key>scope</key> + <string>storage.type.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#748B00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Function</string> + <key>scope</key> + <string>entity.name.function.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#899090</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Function Construct</string> + <key>scope</key> + <string>support.function.construct.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#748B00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Function Call</string> + <key>scope</key> + <string>entity.name.type.class.php, meta.function-call.php, meta.function-call.static.php, meta.function-call.object.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#839496</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Comment</string> + <key>scope</key> + <string>keyword.other.phpdoc</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#899090</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Source Emebedded</string> + <key>scope</key> + <string>source.php.embedded.block.html</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#BD3613</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Storage Type Function</string> + <key>scope</key> + <string>storage.type.function.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#BD3800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>C: constant</string> + <key>scope</key> + <string>constant.numeric.c</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>C: Meta Preprocessor</string> + <key>scope</key> + <string>meta.preprocessor.c.include, meta.preprocessor.macro.c</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#BB3700</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>C: Keyword</string> + <key>scope</key> + <string>keyword.control.import.define.c, keyword.control.import.include.c</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#BB3700</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>C: Function Preprocessor</string> + <key>scope</key> + <string>entity.name.function.preprocessor.c</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#BB3700</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>C: include <something.c></string> + <key>scope</key> + <string>meta.preprocessor.c.include string.quoted.other.lt-gt.include.c, meta.preprocessor.c.include punctuation.definition.string.begin.c, meta.preprocessor.c.include punctuation.definition.string.end.c</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>C: Function</string> + <key>scope</key> + <string>support.function.C99.c, support.function.any-method.c, entity.name.function.c</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#536871</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>C: "</string> + <key>scope</key> + <string>punctuation.definition.string.begin.c, punctuation.definition.string.end.c</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>C: Storage Type</string> + <key>scope</key> + <string>storage.type.c</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>diff: header</string> + <key>scope</key> + <string>meta.diff, meta.diff.header</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#A57706</string> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#E0EDDD</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>diff: deleted</string> + <key>scope</key> + <string>markup.deleted</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#EAE3CA</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#D3201F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>diff: changed</string> + <key>scope</key> + <string>markup.changed</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#EAE3CA</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#BF3904</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>diff: inserted</string> + <key>scope</key> + <string>markup.inserted</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#EAE3CA</string> + <key>foreground</key> + <string>#219186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markdown: Linebreak</string> + <key>scope</key> + <string>text.html.markdown meta.dummy.line-break</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#A57706</string> + <key>foreground</key> + <string>#E0EDDD</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markdown: Raw</string> + <key>scope</key> + <string>text.html.markdown markup.raw.inline</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>reST raw</string> + <key>scope</key> + <string>text.restructuredtext markup.raw</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Other: Removal</string> + <key>scope</key> + <string>other.package.exclude, other.remove</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#D3201F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Other: Add</string> + <key>scope</key> + <string>other.add</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: {}</string> + <key>scope</key> + <string>punctuation.section.group.tex , punctuation.definition.arguments.begin.latex, punctuation.definition.arguments.end.latex, punctuation.definition.arguments.latex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#B81D1C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: {text}</string> + <key>scope</key> + <string>meta.group.braces.tex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57705</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: Other Math</string> + <key>scope</key> + <string>string.other.math.tex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57705</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: {var}</string> + <key>scope</key> + <string>variable.parameter.function.latex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#BD3800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: Math \\</string> + <key>scope</key> + <string>punctuation.definition.constant.math.tex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#D01F1E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: Constant Math</string> + <key>scope</key> + <string>text.tex.latex constant.other.math.tex, constant.other.general.math.tex, constant.other.general.math.tex, constant.character.math.tex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: Other Math String</string> + <key>scope</key> + <string>string.other.math.tex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: $</string> + <key>scope</key> + <string>punctuation.definition.string.begin.tex, punctuation.definition.string.end.tex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#D3201F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: \label</string> + <key>scope</key> + <string>keyword.control.label.latex, text.tex.latex constant.other.general.math.tex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: \label { }</string> + <key>scope</key> + <string>variable.parameter.definition.label.latex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#D01F1E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: Function </string> + <key>scope</key> + <string>support.function.be.latex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#748B00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: Support Function Section</string> + <key>scope</key> + <string>support.function.section.latex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#BD3800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: Support Function</string> + <key>scope</key> + <string>support.function.general.tex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: Comment</string> + <key>scope</key> + <string>punctuation.definition.comment.tex, comment.line.percentage.tex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: Reference Label</string> + <key>scope</key> + <string>keyword.control.ref.latex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Python: storage</string> + <key>scope</key> + <string>storage.type.class.python, storage.type.function.python, storage.modifier.global.python</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#748B00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Python: import</string> + <key>scope</key> + <string>keyword.control.import.python, keyword.control.import.from.python</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#BD3800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Python: Support.exception</string> + <key>scope</key> + <string>support.type.exception.python</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Shell: builtin</string> + <key>scope</key> + <string>support.function.builtin.shell</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#748B00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Shell: variable</string> + <key>scope</key> + <string>variable.other.normal.shell</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#BD3800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Shell: DOT_FILES</string> + <key>scope</key> + <string>source.shell</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Shell: meta scope in loop</string> + <key>scope</key> + <string>meta.scope.for-in-loop.shell, variable.other.loop.shell</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#536871</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Shell: ""</string> + <key>scope</key> + <string>punctuation.definition.string.end.shell, punctuation.definition.string.begin.shell</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#748B00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Shell: Meta Block</string> + <key>scope</key> + <string>meta.scope.case-block.shell, meta.scope.case-body.shell</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#536871</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Shell: []</string> + <key>scope</key> + <string>punctuation.definition.logical-expression.shell</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#CD1E1D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Shell: Comment</string> + <key>scope</key> + <string>comment.line.number-sign.shell</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Java: import</string> + <key>scope</key> + <string>keyword.other.import.java</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#BD3800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Java: meta-import</string> + <key>scope</key> + <string>storage.modifier.import.java</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#586E75</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Java: Class</string> + <key>scope</key> + <string>meta.class.java storage.modifier.java</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Java: /* comment */</string> + <key>scope</key> + <string>source.java comment.block</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#536871</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Java: /* @param */</string> + <key>scope</key> + <string>comment.block meta.documentation.tag.param.javadoc keyword.other.documentation.param.javadoc</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#536871</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Perl: variables</string> + <key>scope</key> + <string>punctuation.definition.variable.perl, variable.other.readwrite.global.perl, variable.other.predefined.perl, keyword.operator.comparison.perl</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#B58900</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Perl: functions</string> + <key>scope</key> + <string>support.function.perl</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#859900</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Perl: comments</string> + <key>scope</key> + <string>comment.line.number-sign.perl</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#586E75</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Perl: quotes</string> + <key>scope</key> + <string>punctuation.definition.string.begin.perl, punctuation.definition.string.end.perl</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#2AA198</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Perl: \char</string> + <key>scope</key> + <string>constant.character.escape.perl</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#DC322F</string> + </dict> + </dict> + </array> + <key>uuid</key> + <string>A4299D9B-1DE5-4BC4-87F6-A757E71B1597</string> + <key>license</key> + <string> + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + </string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/Solarized (Light).tmTheme b/app/rcc/edbee/themes/Solarized (Light).tmTheme new file mode 100644 index 00000000..a34bef01 --- /dev/null +++ b/app/rcc/edbee/themes/Solarized (Light).tmTheme @@ -0,0 +1,1875 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>name</key> + <string>Solarized (light)</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#FDF6E3</string> + <key>caret</key> + <string>#000000</string> + <key>foreground</key> + <string>#586E75</string> + <key>invisibles</key> + <string>#EAE3C9</string> + <key>lineHighlight</key> + <string>#EEE8D5</string> + <key>selection</key> + <string>#073642</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#93A1A1</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String</string> + <key>scope</key> + <string>string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#2AA198</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>StringNumber</string> + <key>scope</key> + <string>string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#586E75</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Regexp</string> + <key>scope</key> + <string>string.regexp</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D30102</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Number</string> + <key>scope</key> + <string>constant.numeric</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D33682</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Variable</string> + <key>scope</key> + <string>variable.language, variable.other</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#859900</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Storage</string> + <key>scope</key> + <string>storage</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#073642</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Class name</string> + <key>scope</key> + <string>entity.name.class, entity.name.type.class</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function name</string> + <key>scope</key> + <string>entity.name.function</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Variable start</string> + <key>scope</key> + <string>punctuation.definition.variable</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#859900</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Embedded code markers</string> + <key>scope</key> + <string>punctuation.section.embedded.begin, punctuation.section.embedded.end</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D30102</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Built-in constant</string> + <key>scope</key> + <string>constant.language, meta.preprocessor</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#B58900</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Support.construct</string> + <key>scope</key> + <string>support.function.construct, keyword.other.new</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D30102</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>User-defined constant</string> + <key>scope</key> + <string>constant.character, constant.other</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CB4B16</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Inherited class</string> + <key>scope</key> + <string>entity.other.inherited-class</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Function argument</string> + <key>scope</key> + <string>variable.parameter</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Tag name</string> + <key>scope</key> + <string>entity.name.tag</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tag start/end</string> + <key>scope</key> + <string>punctuation.definition.tag.html, punctuation.definition.tag.begin, punctuation.definition.tag.end</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#93A1A1</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tag attribute</string> + <key>scope</key> + <string>entity.other.attribute-name</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#93A1A1</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library function</string> + <key>scope</key> + <string>support.function</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Continuation</string> + <key>scope</key> + <string>punctuation.separator.continuation</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D30102</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library constant</string> + <key>scope</key> + <string>support.constant</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Library class/type</string> + <key>scope</key> + <string>support.type, support.class</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#859900</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library Exception</string> + <key>scope</key> + <string>support.type.exception</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CB4B16</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Special</string> + <key>scope</key> + <string>keyword.other.special-method</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CB4B16</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Library variable</string> + <key>scope</key> + <string>support.other.variable</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Invalid</string> + <key>scope</key> + <string>invalid</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Quoted String</string> + <key>scope</key> + <string>string.quoted.double, string.quoted.single</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Quotes</string> + <key>scope</key> + <string>punctuation.definition.string.begin, punctuation.definition.string.end</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#C60000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Property</string> + <key>scope</key> + <string>entity.name.tag.css, support.type.property-name.css, meta.property-name.css</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: @font-face</string> + <key>scope</key> + <string>source.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D01F1E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Selector</string> + <key>scope</key> + <string>meta.selector.css</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#536871</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: {}</string> + <key>scope</key> + <string>punctuation.section.property-list.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#5A74CF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Numeric Value</string> + <key>scope</key> + <string>meta.property-value.css constant.numeric.css, keyword.other.unit.css,constant.other.color.rgb-value.css</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Value</string> + <key>scope</key> + <string>meta.property-value.css</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: !Important</string> + <key>scope</key> + <string>keyword.other.important.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D01F1E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Standard Value</string> + <key>scope</key> + <string>support.constant.color</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: Tag</string> + <key>scope</key> + <string>entity.name.tag.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#738A13</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: : ,</string> + <key>scope</key> + <string>punctuation.separator.key-value.css, punctuation.terminator.rule.css</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#536871</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS .class</string> + <key>scope</key> + <string>entity.other.attribute-name.class.css</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS :pseudo</string> + <key>scope</key> + <string>entity.other.attribute-name.pseudo-element.css, entity.other.attribute-name.pseudo-class.css</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#BD3800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>CSS: #id</string> + <key>scope</key> + <string>entity.other.attribute-name.id.css</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>JS: Function Name</string> + <key>scope</key> + <string>meta.function.js, entity.name.function.js, support.function.dom.js</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>JS: Source</string> + <key>scope</key> + <string>text.html.basic source.js.embedded.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>JS: Function</string> + <key>scope</key> + <string>storage.type.function.js</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>JS: Numeric Constant</string> + <key>scope</key> + <string>constant.numeric.js</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>JS: []</string> + <key>scope</key> + <string>meta.brace.square.js</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>JS: Storage Type</string> + <key>scope</key> + <string>storage.type.js</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>()</string> + <key>scope</key> + <string>meta.brace.round, punctuation.definition.parameters.begin.js, punctuation.definition.parameters.end.js</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#93A1A1</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>{}</string> + <key>scope</key> + <string>meta.brace.curly.js</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: Doctype</string> + <key>scope</key> + <string>entity.name.tag.doctype.html, meta.tag.sgml.html, string.quoted.double.doctype.identifiers-and-DTDs.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#899090</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: Comment Block</string> + <key>scope</key> + <string>comment.block.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#839496</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: Script</string> + <key>scope</key> + <string>entity.name.tag.script.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: Style</string> + <key>scope</key> + <string>source.css.embedded.html string.quoted.double.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: Text</string> + <key>scope</key> + <string>text.html.ruby</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#BD3800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: =</string> + <key>scope</key> + <string>text.html.basic meta.tag.other.html, text.html.basic meta.tag.any.html, text.html.basic meta.tag.block.any, text.html.basic meta.tag.inline.any, text.html.basic meta.tag.structure.any.html, text.html.basic source.js.embedded.html, punctuation.separator.key-value.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#708284</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: something=</string> + <key>scope</key> + <string>text.html.basic entity.other.attribute-name.html</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#708284</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: "</string> + <key>scope</key> + <string>text.html.basic meta.tag.structure.any.html punctuation.definition.string.begin.html, punctuation.definition.string.begin.html, punctuation.definition.string.end.html </string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: <tag></string> + <key>scope</key> + <string>entity.name.tag.block.any.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: style</string> + <key>scope</key> + <string>source.css.embedded.html entity.name.tag.style.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: <style></string> + <key>scope</key> + <string>entity.name.tag.style.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: {}</string> + <key>scope</key> + <string>text.html.basic punctuation.section.property-list.css</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + </dict> + </dict> + <dict> + <key>name</key> + <string>HTML: Embeddable</string> + <key>scope</key> + <string>source.css.embedded.html, comment.block.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#819090</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Variable definition</string> + <key>scope</key> + <string>punctuation.definition.variable.ruby</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Function Name</string> + <key>scope</key> + <string>meta.function.method.with-arguments.ruby</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#708284</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Variable</string> + <key>scope</key> + <string>variable.language.ruby</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#469186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Function</string> + <key>scope</key> + <string>entity.name.function.ruby</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Keyword Control</string> + <key>scope</key> + <string>keyword.control.ruby, keyword.control.def.ruby</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#738A05</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Class</string> + <key>scope</key> + <string>keyword.control.class.ruby, meta.class.ruby</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#748B00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Class Name</string> + <key>scope</key> + <string>entity.name.type.class.ruby</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Keyword</string> + <key>scope</key> + <string>keyword.control.ruby</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#748B00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Support Class</string> + <key>scope</key> + <string>support.class.ruby</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Special Method</string> + <key>scope</key> + <string>keyword.other.special-method.ruby</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#748B00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Constant</string> + <key>scope</key> + <string>constant.language.ruby, constant.numeric.ruby</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Constant Other</string> + <key>scope</key> + <string>variable.other.constant.ruby</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: :symbol</string> + <key>scope</key> + <string>constant.other.symbol.ruby</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Punctuation Section ''</string> + <key>scope</key> + <string>punctuation.section.embedded.ruby, punctuation.definition.string.begin.ruby, punctuation.definition.string.end.ruby</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D01F1E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: Special Method</string> + <key>scope</key> + <string>keyword.other.special-method.ruby</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#BD3800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Include</string> + <key>scope</key> + <string>keyword.control.import.include.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#BD3800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: erb =</string> + <key>scope</key> + <string>text.html.ruby meta.tag.inline.any.html</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#819090</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Ruby: erb ""</string> + <key>scope</key> + <string>text.html.ruby punctuation.definition.string.begin, text.html.ruby punctuation.definition.string.end</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Quoted Single</string> + <key>scope</key> + <string>punctuation.definition.string.begin, punctuation.definition.string.end</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#839496</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: []</string> + <key>scope</key> + <string>keyword.operator.index-start.php, keyword.operator.index-end.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D31E1E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Array</string> + <key>scope</key> + <string>meta.array.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#536871</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Array()</string> + <key>scope</key> + <string>meta.array.php support.function.construct.php, meta.array.empty.php support.function.construct.php</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Array Construct</string> + <key>scope</key> + <string>support.function.construct.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Array Begin</string> + <key>scope</key> + <string>punctuation.definition.array.begin, punctuation.definition.array.end</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D31E1E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Numeric Constant</string> + <key>scope</key> + <string>constant.numeric.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: New</string> + <key>scope</key> + <string>keyword.other.new.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CB4B16</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: ::</string> + <key>scope</key> + <string>support.class.php, keyword.operator.class</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#536871</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Other Property</string> + <key>scope</key> + <string>variable.other.property.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#899090</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Class</string> + <key>scope</key> + <string>storage.modifier.extends.php, storage.type.class.php, keyword.operator.class.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Class Function</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>PHP: Inherited Class</string> + <key>scope</key> + <string>meta.other.inherited-class.php</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#536871</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Storage Type</string> + <key>scope</key> + <string>storage.type.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#748B00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Function</string> + <key>scope</key> + <string>entity.name.function.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#899090</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Function Construct</string> + <key>scope</key> + <string>support.function.construct.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#748B00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Function Call</string> + <key>scope</key> + <string>entity.name.type.class.php, meta.function-call.php, meta.function-call.static.php, meta.function-call.object.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#839496</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Comment</string> + <key>scope</key> + <string>keyword.other.phpdoc</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#899090</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Source Emebedded</string> + <key>scope</key> + <string>source.php.embedded.block.html</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#BD3613</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>PHP: Storage Type Function</string> + <key>scope</key> + <string>storage.type.function.php</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#BD3800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>C: constant</string> + <key>scope</key> + <string>constant.numeric.c</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>C: Meta Preprocessor</string> + <key>scope</key> + <string>meta.preprocessor.c.include, meta.preprocessor.macro.c</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#BB3700</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>C: Keyword</string> + <key>scope</key> + <string>keyword.control.import.define.c, keyword.control.import.include.c</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#BB3700</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>C: Function Preprocessor</string> + <key>scope</key> + <string>entity.name.function.preprocessor.c</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#BB3700</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>C: include <something.c></string> + <key>scope</key> + <string>meta.preprocessor.c.include string.quoted.other.lt-gt.include.c, meta.preprocessor.c.include punctuation.definition.string.begin.c, meta.preprocessor.c.include punctuation.definition.string.end.c</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>C: Function</string> + <key>scope</key> + <string>support.function.C99.c, support.function.any-method.c, entity.name.function.c</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#536871</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>C: "</string> + <key>scope</key> + <string>punctuation.definition.string.begin.c, punctuation.definition.string.end.c</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>C: Storage Type</string> + <key>scope</key> + <string>storage.type.c</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>diff: header</string> + <key>scope</key> + <string>meta.diff, meta.diff.header</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#A57706</string> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#E0EDDD</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>diff: deleted</string> + <key>scope</key> + <string>markup.deleted</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#EAE3CA</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#D3201F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>diff: changed</string> + <key>scope</key> + <string>markup.changed</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#EAE3CA</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#BF3904</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>diff: inserted</string> + <key>scope</key> + <string>markup.inserted</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#EAE3CA</string> + <key>foreground</key> + <string>#219186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markdown: Linebreak</string> + <key>scope</key> + <string>text.html.markdown meta.dummy.line-break</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#A57706</string> + <key>foreground</key> + <string>#E0EDDD</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markdown: Raw</string> + <key>scope</key> + <string>text.html.markdown markup.raw.inline</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>reST raw</string> + <key>scope</key> + <string>text.restructuredtext markup.raw</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Other: Removal</string> + <key>scope</key> + <string>other.package.exclude, other.remove</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#D3201F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Other: Add</string> + <key>scope</key> + <string>other.add</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: {}</string> + <key>scope</key> + <string>punctuation.section.group.tex , punctuation.definition.arguments.begin.latex, punctuation.definition.arguments.end.latex, punctuation.definition.arguments.latex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#B81D1C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: {text}</string> + <key>scope</key> + <string>meta.group.braces.tex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57705</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: Other Math</string> + <key>scope</key> + <string>string.other.math.tex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57705</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: {var}</string> + <key>scope</key> + <string>variable.parameter.function.latex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#BD3800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: Math \\</string> + <key>scope</key> + <string>punctuation.definition.constant.math.tex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#D01F1E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: Constant Math</string> + <key>scope</key> + <string>text.tex.latex constant.other.math.tex, constant.other.general.math.tex, constant.other.general.math.tex, constant.character.math.tex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: Other Math String</string> + <key>scope</key> + <string>string.other.math.tex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: $</string> + <key>scope</key> + <string>punctuation.definition.string.begin.tex, punctuation.definition.string.end.tex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#D3201F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: \label</string> + <key>scope</key> + <string>keyword.control.label.latex, text.tex.latex constant.other.general.math.tex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: \label { }</string> + <key>scope</key> + <string>variable.parameter.definition.label.latex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#D01F1E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: Function </string> + <key>scope</key> + <string>support.function.be.latex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#748B00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: Support Function Section</string> + <key>scope</key> + <string>support.function.section.latex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#BD3800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: Support Function</string> + <key>scope</key> + <string>support.function.general.tex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: Comment</string> + <key>scope</key> + <string>punctuation.definition.comment.tex, comment.line.percentage.tex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tex: Reference Label</string> + <key>scope</key> + <string>keyword.control.ref.latex</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#269186</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Python: storage</string> + <key>scope</key> + <string>storage.type.class.python, storage.type.function.python, storage.modifier.global.python</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#748B00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Python: import</string> + <key>scope</key> + <string>keyword.control.import.python, keyword.control.import.from.python</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#BD3800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Python: Support.exception</string> + <key>scope</key> + <string>support.type.exception.python</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Shell: builtin</string> + <key>scope</key> + <string>support.function.builtin.shell</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#748B00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Shell: variable</string> + <key>scope</key> + <string>variable.other.normal.shell</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#BD3800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Shell: DOT_FILES</string> + <key>scope</key> + <string>source.shell</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#268BD2</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Shell: meta scope in loop</string> + <key>scope</key> + <string>meta.scope.for-in-loop.shell, variable.other.loop.shell</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#536871</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Shell: ""</string> + <key>scope</key> + <string>punctuation.definition.string.end.shell, punctuation.definition.string.begin.shell</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#748B00</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Shell: Meta Block</string> + <key>scope</key> + <string>meta.scope.case-block.shell, meta.scope.case-body.shell</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#536871</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Shell: []</string> + <key>scope</key> + <string>punctuation.definition.logical-expression.shell</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#CD1E1D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Shell: Comment</string> + <key>scope</key> + <string>comment.line.number-sign.shell</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Java: import</string> + <key>scope</key> + <string>keyword.other.import.java</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#BD3800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Java: meta-import</string> + <key>scope</key> + <string>storage.modifier.import.java</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#586E75</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Java: Class</string> + <key>scope</key> + <string>meta.class.java storage.modifier.java</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#A57800</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Java: /* comment */</string> + <key>scope</key> + <string>source.java comment.block</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#536871</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Java: /* @param */</string> + <key>scope</key> + <string>comment.block meta.documentation.tag.param.javadoc keyword.other.documentation.param.javadoc</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#536871</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Perl: variables</string> + <key>scope</key> + <string>punctuation.definition.variable.perl, variable.other.readwrite.global.perl, variable.other.predefined.perl, keyword.operator.comparison.perl</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#B58900</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Perl: functions</string> + <key>scope</key> + <string>support.function.perl</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#859900</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Perl: comments</string> + <key>scope</key> + <string>comment.line.number-sign.perl</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#586E75</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Perl: quotes</string> + <key>scope</key> + <string>punctuation.definition.string.begin.perl, punctuation.definition.string.end.perl</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#2AA198</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Perl: \char</string> + <key>scope</key> + <string>constant.character.escape.perl</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#DC322F</string> + </dict> + </dict> + </array> + <key>uuid</key> + <string>38E819D9-AE02-452F-9231-ECC3B204AFD7</string> + <key>license</key> + <string> + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + </string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/SpaceCadet.tmTheme b/app/rcc/edbee/themes/SpaceCadet.tmTheme new file mode 100644 index 00000000..156f43de --- /dev/null +++ b/app/rcc/edbee/themes/SpaceCadet.tmTheme @@ -0,0 +1,212 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>author</key> + <string>Alex Ross</string> + <key>comment</key> + <string>Created by Alex Ross</string> + <key>name</key> + <string>SpaceCadet</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#0D0D0D</string> + <key>caret</key> + <string>#7F005D</string> + <key>foreground</key> + <string>#DDE6CF</string> + <key>invisibles</key> + <string>#BFBFBF</string> + <key>lineHighlight</key> + <string>#00000012</string> + <key>selection</key> + <string>#40002F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#473C45</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String</string> + <key>scope</key> + <string>string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#805978</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Constant</string> + <key>scope</key> + <string>constant</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#A8885A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Variable</string> + <key>scope</key> + <string>variable.parameter, variable.other</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#596380</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword - keyword.operator, keyword.operator.logical</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#728059</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Storage</string> + <key>scope</key> + <string>storage</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#9EBF60</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Entity</string> + <key>scope</key> + <string>entity</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#6078BF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Inherited class</string> + <key>scope</key> + <string>entity.other.inherited-class</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Support</string> + <key>scope</key> + <string>support</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#8A4B66</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Exception</string> + <key>scope</key> + <string>support.type.exception</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#893062</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tag name</string> + <key>scope</key> + <string>entity.name.tag</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Tag attribute</string> + <key>scope</key> + <string>entity.other.attribute-name</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Library constant</string> + <key>scope</key> + <string>support.constant</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Library class/type</string> + <key>scope</key> + <string>support.type, support.class</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Library variable</string> + <key>scope</key> + <string>support.other.variable</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Invalid</string> + <key>scope</key> + <string>invalid</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#5F0047</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>- Meta</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string> function.section</string> + <key>scope</key> + <string>meta.function.section</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#371D28</string> + </dict> + </dict> + </array> + <key>uuid</key> + <string>2C24E84F-F9FE-4C2E-92D2-F52198BA7E41</string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/Sunburst.tmTheme b/app/rcc/edbee/themes/Sunburst.tmTheme new file mode 100644 index 00000000..c48337b9 --- /dev/null +++ b/app/rcc/edbee/themes/Sunburst.tmTheme @@ -0,0 +1,665 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>author</key> + <string>Stanley Rost</string> + <key>comment</key> + <string>(π) Soryu, 2005</string> + <key>name</key> + <string>Sunburst</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#000000</string> + <key>caret</key> + <string>#A7A7A7</string> + <key>foreground</key> + <string>#F8F8F8</string> + <key>invisibles</key> + <string>#CAE2FB3D</string> + <key>lineHighlight</key> + <string>#FFFFFF0D</string> + <key>selection</key> + <string>#DDF0FF33</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#AEAEAE</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Constant</string> + <key>scope</key> + <string>constant</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#3387CC</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Entity</string> + <key>scope</key> + <string>entity</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#89BDFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#E28964</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Storage</string> + <key>scope</key> + <string>storage</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#99CF50</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String</string> + <key>scope</key> + <string>string</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#65B042</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Support</string> + <key>scope</key> + <string>support</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#9B859D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Variable</string> + <key>scope</key> + <string>variable</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#3E87E3</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid – Deprecated</string> + <key>scope</key> + <string>invalid.deprecated</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic underline</string> + <key>foreground</key> + <string>#FD5FF1</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid – Illegal</string> + <key>scope</key> + <string>invalid.illegal</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#562D56BF</string> + <key>foreground</key> + <string>#FD5FF1</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>-----------------------------------</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>♦ Embedded Source (Bright)</string> + <key>scope</key> + <string>text source</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#B1B3BA08</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>♦ Entity inherited-class</string> + <key>scope</key> + <string>entity.other.inherited-class</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#9B5C2E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>♦ String embedded-source</string> + <key>scope</key> + <string>string.quoted source</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#DAEFA3</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>♦ String constant</string> + <key>scope</key> + <string>string constant</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#DDF2A4</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>♦ String.regexp</string> + <key>scope</key> + <string>string.regexp</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#E9C062</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>♦ String.regexp.«special»</string> + <key>scope</key> + <string>string.regexp constant.character.escape, string.regexp source.ruby.embedded, string.regexp string.regexp.arbitrary-repitition</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CF7D34</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>♦ String variable</string> + <key>scope</key> + <string>string variable</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#8A9A95</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>♦ Support.function</string> + <key>scope</key> + <string>support.function</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#DAD085</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>♦ Support.constant</string> + <key>scope</key> + <string>support.constant</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#CF6A4C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>c C/C++ Preprocessor Line</string> + <key>scope</key> + <string>meta.preprocessor.c</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#8996A8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>c C/C++ Preprocessor Directive</string> + <key>scope</key> + <string>meta.preprocessor.c keyword</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#AFC4DB</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>j Entity Name Type</string> + <key>scope</key> + <string>entity.name.type</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>j Cast</string> + <key>scope</key> + <string>meta.cast</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#676767</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Doctype/XML Processing</string> + <key>scope</key> + <string>meta.sgml.html meta.doctype, meta.sgml.html meta.doctype entity, meta.sgml.html meta.doctype string, meta.xml-processing, meta.xml-processing entity, meta.xml-processing string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#494949</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Meta.tag.«all»</string> + <key>scope</key> + <string>meta.tag, meta.tag entity</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#89BDFF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Meta.tag.inline</string> + <key>scope</key> + <string>source entity.name.tag, source entity.other.attribute-name, meta.tag.inline, meta.tag.inline entity</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#E0C589</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Namespaces</string> + <key>scope</key> + <string>entity.name.tag.namespace, entity.other.attribute-name.namespace</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#E18964</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ css tag-name</string> + <key>scope</key> + <string>meta.selector.css entity.name.tag</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CDA869</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ css:pseudo-class</string> + <key>scope</key> + <string>meta.selector.css entity.other.attribute-name.tag.pseudo-class</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#8F9D6A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ css#id</string> + <key>scope</key> + <string>meta.selector.css entity.other.attribute-name.id</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#8B98AB</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ css.class</string> + <key>scope</key> + <string>meta.selector.css entity.other.attribute-name.class</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#9B703F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ css property-name:</string> + <key>scope</key> + <string>support.type.property-name.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#C5AF75</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ css property-value;</string> + <key>scope</key> + <string>meta.property-group support.constant.property-value.css, meta.property-value support.constant.property-value.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#F9EE98</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ css @at-rule</string> + <key>scope</key> + <string>meta.preprocessor.at-rule keyword.control.at-rule</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#8693A5</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ css additional-constants</string> + <key>scope</key> + <string>meta.property-value support.constant.named-color.css, meta.property-value constant</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#DD7B3B</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ css constructor.argument</string> + <key>scope</key> + <string>meta.constructor.argument.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#8F9D6A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>⎇ diff.header</string> + <key>scope</key> + <string>meta.diff, meta.diff.header</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#0E2231</string> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#F8F8F8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>⎇ diff.deleted</string> + <key>scope</key> + <string>markup.deleted</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#420E09</string> + <key>foreground</key> + <string>#F8F8F8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>⎇ diff.changed</string> + <key>scope</key> + <string>markup.changed</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#4A410D</string> + <key>foreground</key> + <string>#F8F8F8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>⎇ diff.inserted</string> + <key>scope</key> + <string>markup.inserted</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#253B22</string> + <key>foreground</key> + <string>#F8F8F8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>--------------------------------</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Markup: Italic</string> + <key>scope</key> + <string>markup.italic</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#E9C062</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup: Bold</string> + <key>scope</key> + <string>markup.bold</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#E9C062</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup: Underline</string> + <key>scope</key> + <string>markup.underline</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + <key>foreground</key> + <string>#E18964</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup: Quote</string> + <key>scope</key> + <string>markup.quote</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FEE09C12</string> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#E1D4B9</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup: Heading</string> + <key>scope</key> + <string>markup.heading, markup.heading entity</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#632D04</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#FEDCC5</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup: List</string> + <key>scope</key> + <string>markup.list</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#E1D4B9</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup: Raw</string> + <key>scope</key> + <string>markup.raw</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#B1B3BA08</string> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#578BB3</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup: Comment</string> + <key>scope</key> + <string>markup comment</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#F67B37</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup: Separator</string> + <key>scope</key> + <string>meta.separator</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#242424</string> + <key>foreground</key> + <string>#60A633</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Log Entry</string> + <key>scope</key> + <string>meta.line.entry.logfile, meta.line.exit.logfile</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#EEEEEE29</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Log Entry Error</string> + <key>scope</key> + <string>meta.line.error.logfile</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#751012</string> + </dict> + </dict> + </array> + <key>uuid</key> + <string>C8C58F9A-35FE-44A4-9BC2-2F3C343DC81D</string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/Twilight.tmTheme b/app/rcc/edbee/themes/Twilight.tmTheme new file mode 100644 index 00000000..a83f7ecb --- /dev/null +++ b/app/rcc/edbee/themes/Twilight.tmTheme @@ -0,0 +1,514 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>author</key> + <string>Michael Sheets</string> + <key>name</key> + <string>Twilight</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#141414</string> + <key>caret</key> + <string>#A7A7A7</string> + <key>foreground</key> + <string>#F8F8F8</string> + <key>invisibles</key> + <string>#FFFFFF40</string> + <key>lineHighlight</key> + <string>#FFFFFF08</string> + <key>selection</key> + <string>#DDF0FF33</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#5F5A60</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Constant</string> + <key>scope</key> + <string>constant</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CF6A4C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Entity</string> + <key>scope</key> + <string>entity</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#9B703F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#CDA869</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Storage</string> + <key>scope</key> + <string>storage</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#F9EE98</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String</string> + <key>scope</key> + <string>string</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#8F9D6A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Support</string> + <key>scope</key> + <string>support</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#9B859D</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Variable</string> + <key>scope</key> + <string>variable</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#7587A6</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid – Deprecated</string> + <key>scope</key> + <string>invalid.deprecated</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic underline</string> + <key>foreground</key> + <string>#D2A8A1</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid – Illegal</string> + <key>scope</key> + <string>invalid.illegal</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#562D56BF</string> + <key>foreground</key> + <string>#F8F8F8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>-----------------------------------</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>♦ Embedded Source</string> + <key>scope</key> + <string>text source</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#B0B3BA14</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>♦ Embedded Source (Bright)</string> + <key>scope</key> + <string>text.html.ruby source</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#B1B3BA21</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>♦ Entity inherited-class</string> + <key>scope</key> + <string>entity.other.inherited-class</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#9B5C2E</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>♦ String embedded-source</string> + <key>scope</key> + <string>string source</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#DAEFA3</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>♦ String constant</string> + <key>scope</key> + <string>string constant</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#DDF2A4</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>♦ String.regexp</string> + <key>scope</key> + <string>string.regexp</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#E9C062</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>♦ String.regexp.«special»</string> + <key>scope</key> + <string>string.regexp constant.character.escape, string.regexp source.ruby.embedded, string.regexp string.regexp.arbitrary-repitition</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CF7D34</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>♦ String variable</string> + <key>scope</key> + <string>string variable</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#8A9A95</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>♦ Support.function</string> + <key>scope</key> + <string>support.function</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#DAD085</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>♦ Support.constant</string> + <key>scope</key> + <string>support.constant</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + <key>foreground</key> + <string>#CF6A4C</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>c C/C++ Preprocessor Line</string> + <key>scope</key> + <string>meta.preprocessor.c</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#8996A8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>c C/C++ Preprocessor Directive</string> + <key>scope</key> + <string>meta.preprocessor.c keyword</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#AFC4DB</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Doctype/XML Processing</string> + <key>scope</key> + <string>meta.tag.sgml.doctype, meta.tag.sgml.doctype entity, meta.tag.sgml.doctype string, meta.tag.preprocessor.xml, meta.tag.preprocessor.xml entity, meta.tag.preprocessor.xml string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#494949</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Meta.tag.«all»</string> + <key>scope</key> + <string>declaration.tag, declaration.tag entity, meta.tag, meta.tag entity</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#AC885B</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>✘ Meta.tag.inline</string> + <key>scope</key> + <string>declaration.tag.inline, declaration.tag.inline entity, source entity.name.tag, source entity.other.attribute-name, meta.tag.inline, meta.tag.inline entity</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#E0C589</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ css tag-name</string> + <key>scope</key> + <string>meta.selector.css entity.name.tag</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CDA869</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ css:pseudo-class</string> + <key>scope</key> + <string>meta.selector.css entity.other.attribute-name.tag.pseudo-class</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#8F9D6A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ css#id</string> + <key>scope</key> + <string>meta.selector.css entity.other.attribute-name.id</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#8B98AB</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ css.class</string> + <key>scope</key> + <string>meta.selector.css entity.other.attribute-name.class</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#9B703F</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ css property-name:</string> + <key>scope</key> + <string>support.type.property-name.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#C5AF75</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ css property-value;</string> + <key>scope</key> + <string>meta.property-group support.constant.property-value.css, meta.property-value support.constant.property-value.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#F9EE98</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ css @at-rule</string> + <key>scope</key> + <string>meta.preprocessor.at-rule keyword.control.at-rule</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#8693A5</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ css additional-constants</string> + <key>scope</key> + <string>meta.property-value support.constant.named-color.css, meta.property-value constant</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CA7840</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>§ css constructor.argument</string> + <key>scope</key> + <string>meta.constructor.argument.css</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#8F9D6A</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>⎇ diff.header</string> + <key>scope</key> + <string>meta.diff, meta.diff.header, meta.separator</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#0E2231</string> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#F8F8F8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>⎇ diff.deleted</string> + <key>scope</key> + <string>markup.deleted</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#420E09</string> + <key>foreground</key> + <string>#F8F8F8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>⎇ diff.changed</string> + <key>scope</key> + <string>markup.changed</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#4A410D</string> + <key>foreground</key> + <string>#F8F8F8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>⎇ diff.inserted</string> + <key>scope</key> + <string>markup.inserted</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#253B22</string> + <key>foreground</key> + <string>#F8F8F8</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup: List</string> + <key>scope</key> + <string>markup.list</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#F9EE98</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Markup: Heading</string> + <key>scope</key> + <string>markup.heading</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#CF6A4C</string> + </dict> + </dict> + </array> + <key>uuid</key> + <string>766026CB-703D-4610-B070-8DE07D967C5F</string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/Zenburnesque.tmTheme b/app/rcc/edbee/themes/Zenburnesque.tmTheme new file mode 100644 index 00000000..8631f986 --- /dev/null +++ b/app/rcc/edbee/themes/Zenburnesque.tmTheme @@ -0,0 +1,343 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>author</key> + <string>William D. Neumann</string> + <key>name</key> + <string>Zenburnesque</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#404040</string> + <key>caret</key> + <string>#FFFF66</string> + <key>foreground</key> + <string>#DEDEDE</string> + <key>invisibles</key> + <string>#A8A8A8</string> + <key>lineHighlight</key> + <string>#A0804026</string> + <key>selection</key> + <string>#A0A0C0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#709070</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Directive</string> + <key>scope</key> + <string>keyword.other.directive</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Line-number directives</string> + <key>scope</key> + <string>keyword.other.directive.line-number</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Characters</string> + <key>scope</key> + <string>constant.character</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FF8080</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String</string> + <key>scope</key> + <string>string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FF2020</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Number</string> + <key>scope</key> + <string>constant.numeric</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#22C0FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Floating-point numbers</string> + <key>scope</key> + <string>constant.numeric.floating-point</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Built-in constant</string> + <key>scope</key> + <string>constant.language</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>User-defined constant</string> + <key>scope</key> + <string>constant.character, constant.other</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Variable</string> + <key>scope</key> + <string>variable.parameter, variable.other</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Language Keyword</string> + <key>scope</key> + <string>keyword</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFFFA0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Module Keyword</string> + <key>scope</key> + <string>entity.name.module, support.other.module</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#FF8000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Operators</string> + <key>scope</key> + <string>keyword.operator</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFFFA0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Floating-point infix operators</string> + <key>scope</key> + <string>source.ocaml keyword.operator.symbol.infix.floating-point</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Floating-point prefix operators</string> + <key>scope</key> + <string>source.ocaml keyword.operator.symbol.prefix.floating-point</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Storage Types</string> + <key>scope</key> + <string>storage.type</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#6080FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Variant Types</string> + <key>scope</key> + <string>entity.name.class.variant</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#4080A0</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Storage</string> + <key>scope</key> + <string>storage</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Type name</string> + <key>scope</key> + <string>entity.name.type</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#F09040</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Inherited class</string> + <key>scope</key> + <string>entity.other.inherited-class</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Function name</string> + <key>scope</key> + <string>entity.name.function</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#FFCC66</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Type name</string> + <key>scope</key> + <string>storage.type.user-defined</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFE000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Class type name</string> + <key>scope</key> + <string>entity.name.type.class.type</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#F4A020</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function argument</string> + <key>scope</key> + <string>variable.parameter</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string></string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tag name</string> + <key>scope</key> + <string>entity.name.tag</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Tag attribute</string> + <key>scope</key> + <string>entity.other.attribute-name</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Library function</string> + <key>scope</key> + <string>support.function</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Library constant</string> + <key>scope</key> + <string>support.constant</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Library class/type</string> + <key>scope</key> + <string>support.type, support.class</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Library variable</string> + <key>scope</key> + <string>support.variable</string> + <key>settings</key> + <dict/> + </dict> + <dict> + <key>name</key> + <string>Invalid</string> + <key>scope</key> + <string>invalid</string> + <key>settings</key> + <dict/> + </dict> + </array> + <key>uuid</key> + <string>8D4988B9-ADD8-436F-B388-BC1360F8504B</string> +</dict> +</plist> diff --git a/app/rcc/edbee/themes/iPlastic.tmTheme b/app/rcc/edbee/themes/iPlastic.tmTheme new file mode 100644 index 00000000..7253df6a --- /dev/null +++ b/app/rcc/edbee/themes/iPlastic.tmTheme @@ -0,0 +1,286 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>author</key> + <string>Jeroen van der Ham</string> + <key>name</key> + <string>iPlastic</string> + <key>settings</key> + <array> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#EEEEEEEB</string> + <key>caret</key> + <string>#000000</string> + <key>foreground</key> + <string>#000000</string> + <key>invisibles</key> + <string>#B3B3B3F4</string> + <key>lineHighlight</key> + <string>#0000001A</string> + <key>selection</key> + <string>#BAD6FD</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>String</string> + <key>scope</key> + <string>string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#009933</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Number</string> + <key>scope</key> + <string>constant.numeric</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#0066FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Regular expression</string> + <key>scope</key> + <string>string.regexp</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FF0080</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Keyword</string> + <key>scope</key> + <string>keyword</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#0000FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Identifier</string> + <key>scope</key> + <string>constant.language</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#9700CC</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Exception</string> + <key>scope</key> + <string>support.class.exception</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#990000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Function name</string> + <key>scope</key> + <string>entity.name.function</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FF8000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Type name</string> + <key>scope</key> + <string>entity.name.type</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Arguments</string> + <key>scope</key> + <string>variable.parameter</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Comment</string> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#0066FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Invalid</string> + <key>scope</key> + <string>invalid</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#E71A114D</string> + <key>foreground</key> + <string>#FF0000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Trailing whitespace</string> + <key>scope</key> + <string>invalid.deprecated.trailing-whitespace</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#E71A1100</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Embedded source</string> + <key>scope</key> + <string>text source</string> + <key>settings</key> + <dict> + <key>background</key> + <string>#FAFAFAFC</string> + <key>foreground</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tag</string> + <key>scope</key> + <string>meta.tag, declaration.tag</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#0033CC</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Constant</string> + <key>scope</key> + <string>constant, support.constant</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#6782D3</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Support</string> + <key>scope</key> + <string>support</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#3333FF</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Storage</string> + <key>scope</key> + <string>storage</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Section name</string> + <key>scope</key> + <string>entity.name.section</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold underline</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Frame title</string> + <key>scope</key> + <string>entity.name.function.frame</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + <key>foreground</key> + <string>#000000</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>XML Declaration</string> + <key>scope</key> + <string>meta.tag.preprocessor.xml</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#333333</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tag Attribute</string> + <key>scope</key> + <string>entity.other.attribute-name</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>italic</string> + <key>foreground</key> + <string>#3366CC</string> + </dict> + </dict> + <dict> + <key>name</key> + <string>Tag Name</string> + <key>scope</key> + <string>entity.name.tag</string> + <key>settings</key> + <dict> + <key>fontStyle</key> + <string>bold</string> + </dict> + </dict> + </array> + <key>uuid</key> + <string>4FCFA210-B247-11D9-9D00-000D93347A42</string> +</dict> +</plist> diff --git a/app/rcc/messages/Acknowledgements.txt b/app/rcc/messages/Acknowledgements.txt index 3fda39bd..78f4abac 100644 --- a/app/rcc/messages/Acknowledgements.txt +++ b/app/rcc/messages/Acknowledgements.txt @@ -49,27 +49,26 @@ and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more details. -## QSourceHighlite +## edbee -Copyright (c) 2019-2020 Waqar Ahmed -- <waqar.17a@gmail.com> +Copyright (c) 2012-2014 by Reliable Bits Software by Blommers IT -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## QMQTT @@ -102,7 +101,7 @@ POSSIBILITY OF SUCH DAMAGE. ## QSimpleUpdater -Copyright (c) 2014-2021 [Alex Spataru](https://github.com/alex-spataru). +Copyright (c) 2014-2021 Alex Spataru <https://aspatru.com>. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/app/rcc/rcc.qrc b/app/rcc/rcc.qrc index 61cd50c0..69cecc1d 100644 --- a/app/rcc/rcc.qrc +++ b/app/rcc/rcc.qrc @@ -108,6 +108,95 @@ <file>actions/Xbox Y.svg</file> <file>actions/Zoom In.svg</file> <file>actions/Zoom Out.svg</file> + <file>edbee/config/default.json</file> + <file>edbee/config/default.osx.json</file> + <file>edbee/config/default.win.json</file> + <file>edbee/config/default.x11.json</file> + <file>edbee/keymaps/default.json</file> + <file>edbee/keymaps/default.osx.json</file> + <file>edbee/keymaps/default.win32.json</file> + <file>edbee/syntaxfiles/ActionScript.tmLanguage</file> + <file>edbee/syntaxfiles/AppleScript.tmLanguage</file> + <file>edbee/syntaxfiles/ASP.tmLanguage</file> + <file>edbee/syntaxfiles/Batch File.tmLanguage</file> + <file>edbee/syntaxfiles/Bibtex.tmLanguage</file> + <file>edbee/syntaxfiles/Build.tmLanguage</file> + <file>edbee/syntaxfiles/C#.tmLanguage</file> + <file>edbee/syntaxfiles/C++.tmLanguage</file> + <file>edbee/syntaxfiles/C.tmLanguage</file> + <file>edbee/syntaxfiles/Clojure.tmLanguage</file> + <file>edbee/syntaxfiles/CoffeeScript.tmLanguage</file> + <file>edbee/syntaxfiles/CSS.tmLanguage</file> + <file>edbee/syntaxfiles/D.tmLanguage</file> + <file>edbee/syntaxfiles/Diff.tmLanguage</file> + <file>edbee/syntaxfiles/DOT.tmLanguage</file> + <file>edbee/syntaxfiles/Doxyfile.tmLanguage</file> + <file>edbee/syntaxfiles/Erlang.tmLanguage</file> + <file>edbee/syntaxfiles/Go.tmLanguage</file> + <file>edbee/syntaxfiles/Groovy.tmLanguage</file> + <file>edbee/syntaxfiles/Haskell.tmLanguage</file> + <file>edbee/syntaxfiles/HTML-ASP.tmLanguage</file> + <file>edbee/syntaxfiles/HTML.tmLanguage</file> + <file>edbee/syntaxfiles/Java.tmLanguage</file> + <file>edbee/syntaxfiles/JavaDoc.tmLanguage</file> + <file>edbee/syntaxfiles/JavaScript.tmLanguage</file> + <file>edbee/syntaxfiles/LaTeX Beamer.tmLanguage</file> + <file>edbee/syntaxfiles/LaTeX.tmLanguage</file> + <file>edbee/syntaxfiles/Lisp.tmLanguage</file> + <file>edbee/syntaxfiles/Lua.tmLanguage</file> + <file>edbee/syntaxfiles/Markdown.tmLanguage</file> + <file>edbee/syntaxfiles/Matlab.tmLanguage</file> + <file>edbee/syntaxfiles/MultiMarkdown.tmLanguage</file> + <file>edbee/syntaxfiles/Objective-C++.tmLanguage</file> + <file>edbee/syntaxfiles/Objective-C.tmLanguage</file> + <file>edbee/syntaxfiles/OCamlyacc.tmLanguage</file> + <file>edbee/syntaxfiles/Perl.tmLanguage</file> + <file>edbee/syntaxfiles/PHP.tmLanguage</file> + <file>edbee/syntaxfiles/Plain text.tmLanguage</file> + <file>edbee/syntaxfiles/Python.tmLanguage</file> + <file>edbee/syntaxfiles/R Console.tmLanguage</file> + <file>edbee/syntaxfiles/Rd (R Documentation).tmLanguage</file> + <file>edbee/syntaxfiles/RegExp.tmLanguage</file> + <file>edbee/syntaxfiles/reStructuredText.tmLanguage</file> + <file>edbee/syntaxfiles/Ruby Haml.tmLanguage</file> + <file>edbee/syntaxfiles/Ruby on Rails.tmLanguage</file> + <file>edbee/syntaxfiles/Ruby.tmLanguage</file> + <file>edbee/syntaxfiles/Rust.tmLanguage.json</file> + <file>edbee/syntaxfiles/Scala.tmLanguage</file> + <file>edbee/syntaxfiles/SCSS.tmLanguage</file> + <file>edbee/syntaxfiles/Shell-Unix-Generic.tmLanguage</file> + <file>edbee/syntaxfiles/SQL.tmLanguage</file> + <file>edbee/syntaxfiles/Tcl.tmLanguage</file> + <file>edbee/syntaxfiles/TeX Math.tmLanguage</file> + <file>edbee/syntaxfiles/TeX.tmLanguage</file> + <file>edbee/syntaxfiles/Textile.tmLanguage</file> + <file>edbee/syntaxfiles/XML.tmLanguage</file> + <file>edbee/syntaxfiles/XSL.tmLanguage</file> + <file>edbee/syntaxfiles/YAML.tmLanguage</file> + <file>edbee/themes/All Hallow's Eve.tmTheme</file> + <file>edbee/themes/Amy.tmTheme</file> + <file>edbee/themes/Blackboard.tmTheme</file> + <file>edbee/themes/Brilliance_Black.tmTheme</file> + <file>edbee/themes/Brilliance_Dull.tmTheme</file> + <file>edbee/themes/Cobalt.tmTheme</file> + <file>edbee/themes/Dawn.tmTheme</file> + <file>edbee/themes/Eiffel.tmTheme</file> + <file>edbee/themes/Espresso Libre.tmTheme</file> + <file>edbee/themes/IDLE.tmTheme</file> + <file>edbee/themes/iPlastic.tmTheme</file> + <file>edbee/themes/LAZY.tmTheme</file> + <file>edbee/themes/Mac Classic.tmTheme</file> + <file>edbee/themes/MagicWB (Amiga).tmTheme</file> + <file>edbee/themes/Monokai Bright.tmTheme</file> + <file>edbee/themes/Monokai.tmTheme</file> + <file>edbee/themes/Pastels on Dark.tmTheme</file> + <file>edbee/themes/Solarized (Dark).tmTheme</file> + <file>edbee/themes/Solarized (Light).tmTheme</file> + <file>edbee/themes/SpaceCadet.tmTheme</file> + <file>edbee/themes/Sunburst.tmTheme</file> + <file>edbee/themes/Twilight.tmTheme</file> + <file>edbee/themes/Zenburnesque.tmTheme</file> + <file>edbee/README.md</file> <file>icons/buttons/apply.svg</file> <file>icons/buttons/attach.svg</file> <file>icons/buttons/center.svg</file> diff --git a/app/rcc/themes/Breeze Dark.json b/app/rcc/themes/Breeze Dark.json index b8a01099..1f244cc8 100644 --- a/app/rcc/themes/Breeze Dark.json +++ b/app/rcc/themes/Breeze Dark.json @@ -1,5 +1,6 @@ { "title": "Breeze Dark", + "code-editor-theme": "Sunburst.tmTheme", "colors": { "groupbox_border": "#43494F", "groupbox_background": "#31363b", diff --git a/app/rcc/themes/Breeze Light.json b/app/rcc/themes/Breeze Light.json index 28d5b89b..be9b339f 100644 --- a/app/rcc/themes/Breeze Light.json +++ b/app/rcc/themes/Breeze Light.json @@ -1,5 +1,6 @@ { "title": "Breeze Light", + "code-editor-theme": "Dawn.tmTheme", "colors": { "groupbox_border": "#c2c2c2", "groupbox_background": "#eff0f1", diff --git a/app/rcc/themes/Deep Blue.json b/app/rcc/themes/Deep Blue.json index 3602f953..5ee368de 100644 --- a/app/rcc/themes/Deep Blue.json +++ b/app/rcc/themes/Deep Blue.json @@ -1,5 +1,6 @@ { "title": "Deep Blue", + "code-editor-theme": "Blackboard.tmTheme", "colors": { "groupbox_border": "#354a5f", "groupbox_background": "#1b2a3d", diff --git a/app/rcc/themes/Deep Green.json b/app/rcc/themes/Deep Green.json index 2dcd03b8..e5ed11c3 100644 --- a/app/rcc/themes/Deep Green.json +++ b/app/rcc/themes/Deep Green.json @@ -1,5 +1,6 @@ { "title": "Deep Green", + "code-editor-theme": "Sunburst.tmTheme", "colors": { "groupbox_border": "#3e5a4e", "groupbox_background": "#1b2b23", diff --git a/app/rcc/themes/Deep Purple.json b/app/rcc/themes/Deep Purple.json index fc77431e..b0a24f91 100644 --- a/app/rcc/themes/Deep Purple.json +++ b/app/rcc/themes/Deep Purple.json @@ -1,5 +1,6 @@ { "title": "Deep Purple", + "code-editor-theme": "Amy.tmTheme", "colors": { "groupbox_border": "#4c2f5d", "groupbox_background": "#2c1e3e", diff --git a/app/rcc/themes/Deep Red.json b/app/rcc/themes/Deep Red.json index bc82fcb4..1cb223a4 100644 --- a/app/rcc/themes/Deep Red.json +++ b/app/rcc/themes/Deep Red.json @@ -1,5 +1,6 @@ { "title": "Deep Red", + "code-editor-theme": "Sunburst.tmTheme", "colors": { "groupbox_border": "#8b2e2e", "groupbox_background": "#3d1b1b", diff --git a/app/rcc/themes/Default.json b/app/rcc/themes/Default.json index 82540452..d70758f1 100644 --- a/app/rcc/themes/Default.json +++ b/app/rcc/themes/Default.json @@ -1,5 +1,6 @@ { "title": "Default", + "code-editor-theme": "LAZY.tmTheme", "colors": { "groupbox_border": "#c2c2c2", "groupbox_background": "#eff0f1", diff --git a/app/rcc/themes/Dominion.json b/app/rcc/themes/Dominion.json index 30dffc3f..100ea6a2 100644 --- a/app/rcc/themes/Dominion.json +++ b/app/rcc/themes/Dominion.json @@ -1,5 +1,6 @@ { "title": "Dominion", + "code-editor-theme": "Sunburst.tmTheme", "colors": { "groupbox_border": "#2d2f33", "groupbox_background": "#1a1c1e", diff --git a/app/rcc/themes/Outdoor Day.json b/app/rcc/themes/Outdoor Day.json index 79d806bf..0a81f7c9 100644 --- a/app/rcc/themes/Outdoor Day.json +++ b/app/rcc/themes/Outdoor Day.json @@ -1,5 +1,6 @@ { "title": "Outdoor Day", + "code-editor-theme": "IDLE.tmTheme", "colors": { "groupbox_border": "#e5e5e5", "groupbox_background": "#ffffff", diff --git a/app/rcc/themes/Outdoor Night.json b/app/rcc/themes/Outdoor Night.json index efabd9e6..322929fd 100644 --- a/app/rcc/themes/Outdoor Night.json +++ b/app/rcc/themes/Outdoor Night.json @@ -1,5 +1,6 @@ { "title": "Outdoor Night", + "code-editor-theme": "Sunburst.tmTheme", "colors": { "groupbox_border": "#3a3d42", "groupbox_background": "#202326", diff --git a/app/rcc/themes/Pulse.json b/app/rcc/themes/Pulse.json index 58968675..b3ca1256 100644 --- a/app/rcc/themes/Pulse.json +++ b/app/rcc/themes/Pulse.json @@ -1,5 +1,6 @@ { "title": "Pulse", + "code-editor-theme": "Twilight.tmTheme", "colors": { "groupbox_border": "#4a4a4a", "groupbox_background": "#202020", diff --git a/app/rcc/themes/Resistance.json b/app/rcc/themes/Resistance.json index 4252064e..72332073 100644 --- a/app/rcc/themes/Resistance.json +++ b/app/rcc/themes/Resistance.json @@ -1,5 +1,6 @@ { "title": "Resistance", + "code-editor-theme": "Twilight.tmTheme", "colors": { "groupbox_border": "#575554", "groupbox_background": "#2d2a29", diff --git a/app/rcc/themes/Yaru Dark.json b/app/rcc/themes/Yaru Dark.json index ef2eb4dd..c8077a26 100644 --- a/app/rcc/themes/Yaru Dark.json +++ b/app/rcc/themes/Yaru Dark.json @@ -1,5 +1,6 @@ { "title": "Yaru Dark", + "code-editor-theme": "Twilight.tmTheme", "colors": { "groupbox_border": "#4a4a4a", "groupbox_background": "#2c2c2c", diff --git a/app/rcc/themes/Yaru Light.json b/app/rcc/themes/Yaru Light.json index c471ceb6..7e87d916 100644 --- a/app/rcc/themes/Yaru Light.json +++ b/app/rcc/themes/Yaru Light.json @@ -1,5 +1,6 @@ { "title": "Yaru Light", + "code-editor-theme": "IDLE.tmTheme", "colors": { "groupbox_border": "#cccccc", "groupbox_background": "#f8f8f8", diff --git a/app/rcc/themes/macOS Dark.json b/app/rcc/themes/macOS Dark.json index 26b6dbdd..84c695c0 100644 --- a/app/rcc/themes/macOS Dark.json +++ b/app/rcc/themes/macOS Dark.json @@ -1,5 +1,6 @@ { "title": "macOS Dark", + "code-editor-theme": "Twilight.tmTheme", "colors": { "groupbox_border": "#4a4a4a", "groupbox_background": "#2b2b2b", diff --git a/app/rcc/themes/macOS Light.json b/app/rcc/themes/macOS Light.json index d92e93e0..e879952d 100644 --- a/app/rcc/themes/macOS Light.json +++ b/app/rcc/themes/macOS Light.json @@ -1,5 +1,6 @@ { "title": "macOS Light", + "code-editor-theme": "Eiffel.tmTheme", "colors": { "groupbox_border": "#d1d1d1", "groupbox_background": "#f1f1f1", diff --git a/app/src/JSON/FrameParser.cpp b/app/src/JSON/FrameParser.cpp index 0c4dae27..e2064e43 100644 --- a/app/src/JSON/FrameParser.cpp +++ b/app/src/JSON/FrameParser.cpp @@ -34,16 +34,21 @@ #include "Misc/TimerEvents.h" #include "Misc/ThemeManager.h" -/** - * Creates a subclass of @c QPlainTextEdit that allows us to call the given - * protected/private @a function and pass the given @a event as a parameter to - * the @a function. - */ -#define DW_EXEC_EVENT(pointer, function, event) \ - class PwnedWidget : public QPlainTextEdit \ +#include "edbee/models/textdocument.h" +#include "edbee/models/texteditorconfig.h" +#include "edbee/models/textgrammar.h" +#include "edbee/models/textundostack.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/views/components/texteditorcomponent.h" +#include "edbee/views/texteditorscrollarea.h" +#include "edbee/views/textrenderer.h" +#include "edbee/views/texttheme.h" + +#define DW_EXEC_EVENT(pointer, object, function, event) \ + class PwnedWidget : public object \ { \ public: \ - using QPlainTextEdit::function; \ + using object::function; \ }; \ static_cast<PwnedWidget *>(pointer)->function(event); @@ -62,7 +67,7 @@ JSON::FrameParser::FrameParser(QQuickItem *parent) setFillColor(Misc::ThemeManager::instance().getColor(QStringLiteral("base"))); // Widgets don't process touch events, disable it - setAcceptTouchEvents(false); + setAcceptTouchEvents(true); // Set item flags, we need these to forward Quick events to the widget setFlag(ItemHasContents, true); @@ -70,12 +75,23 @@ JSON::FrameParser::FrameParser(QQuickItem *parent) setFlag(ItemAcceptsInputMethod, true); setAcceptedMouseButtons(Qt::AllButtons); - // Setup syntax highlighter - m_highlighter = new QSourceHighlite::QSourceHighliter(m_textEdit.document()); - m_highlighter->setCurrentLanguage(QSourceHighlite::QSourceHighliter::CodeJs); + // Configure EDBEE + auto *edbee = edbee::Edbee::instance(); + edbee->autoInit(); + edbee->autoShutDownOnAppExit(); - // Setup text editor - m_textEdit.setFont(Misc::CommonFonts::instance().monoFont()); + // Create a text editor widget + m_widget = new edbee::TextEditorWidget(); + + // Configure the widget options + m_widget->config()->setUseTabChar(false); + m_widget->config()->setAutocompleteAutoShow(false); + m_widget->config()->setFont(Misc::CommonFonts::instance().monoFont()); + + // Read grammar file for Javascript + m_widget->textDocument()->setLanguageGrammar( + edbee->grammarManager()->readGrammarFile( + ":/rcc/edbee/syntaxfiles/JavaScript.tmLanguage")); // Configure JavaScript engine m_engine.installExtensions(QJSEngine::ConsoleExtension @@ -90,7 +106,7 @@ JSON::FrameParser::FrameParser(QQuickItem *parent) this, &JSON::FrameParser::onThemeChanged); // Connect modification check signals - connect(m_textEdit.document(), &QTextDocument::modificationChanged, this, + connect(m_widget->textDocument(), &edbee::TextDocument::textChanged, this, [=] { Q_EMIT modifiedChanged(); }); connect(this, &JSON::FrameParser::modifiedChanged, this, [=] { if (isModified() && !JSON::ProjectModel::instance().modified()) @@ -103,8 +119,8 @@ JSON::FrameParser::FrameParser(QQuickItem *parent) &JSON::FrameParser::readCode); // Bridge signals - connect(&m_textEdit, &QPlainTextEdit::textChanged, this, - &JSON::FrameParser::textChanged); + connect(m_widget->textDocument(), &edbee::TextDocument::textChanged, this, + [=] { Q_EMIT textChanged(); }); // Resize widget to fit QtQuick item connect(this, &QQuickPaintedItem::widthChanged, this, @@ -142,7 +158,7 @@ const QString &JSON::FrameParser::defaultCode() */ QString JSON::FrameParser::text() const { - return m_textEdit.document()->toPlainText(); + return m_widget->textDocument()->text(); } /** @@ -151,7 +167,7 @@ QString JSON::FrameParser::text() const */ bool JSON::FrameParser::isModified() const { - return m_textEdit.document()->isModified(); + return m_widget->textDocument()->textUndoStack()->size() > 0; } /** @@ -179,6 +195,21 @@ QStringList JSON::FrameParser::parse(const QString &frame) return list; } +/** + * @brief Returns @c true whenever if there are any actions that can be undone. + */ +bool JSON::FrameParser::undoAvailable() const +{ + return isModified() && m_widget->textDocument()->textUndoStack()->canUndo(); +} +/** + * @brief Returns @c true whenever if there are any actions that can be redone. + */ +bool JSON::FrameParser::redoAvailable() const +{ + return isModified() && m_widget->textDocument()->textUndoStack()->canRedo(); +} + /** * @brief Validates the script and stores it into the project model. * @param silent if set to @c false, the user shall be notified that the script @@ -189,10 +220,10 @@ QStringList JSON::FrameParser::parse(const QString &frame) bool JSON::FrameParser::save(const bool silent) { // Update text edit - if (loadScript(m_textEdit.toPlainText())) + if (loadScript(text())) { - m_textEdit.document()->setModified(false); - ProjectModel::instance().setFrameParserCode(m_textEdit.toPlainText()); + ProjectModel::instance().setFrameParserCode(text()); + m_widget->textDocument()->textUndoStack()->clear(); // Show save messagebox if (!silent) @@ -201,6 +232,7 @@ bool JSON::FrameParser::save(const bool silent) tr("No errors have been detected in the code.")); // Everything good + Q_EMIT modifiedChanged(); return true; } @@ -344,7 +376,7 @@ bool JSON::FrameParser::loadScript(const QString &script) */ void JSON::FrameParser::cut() { - m_textEdit.cut(); + m_widget->controller()->executeCommand("cut"); } /** @@ -352,7 +384,7 @@ void JSON::FrameParser::cut() */ void JSON::FrameParser::undo() { - m_textEdit.undo(); + m_widget->controller()->executeCommand("undo"); } /** @@ -360,7 +392,7 @@ void JSON::FrameParser::undo() */ void JSON::FrameParser::redo() { - m_textEdit.redo(); + m_widget->controller()->executeCommand("redo"); } /** @@ -369,7 +401,7 @@ void JSON::FrameParser::redo() void JSON::FrameParser::help() { // clang-format off - const auto url = QStringLiteral("https://github.com/Serial-Studio/Serial-Studio/wiki/Project-Editor#frame-parser-function-view"); + const auto url = QStringLiteral("https://github.com/Serial-Studio/Serial-Studio/wiki/Data-Flow-in-Serial-Studio#frame-parser-function"); QDesktopServices::openUrl(QUrl(url)); // clang-format on } @@ -379,7 +411,7 @@ void JSON::FrameParser::help() */ void JSON::FrameParser::copy() { - m_textEdit.copy(); + m_widget->controller()->executeCommand("copy"); } /** @@ -387,11 +419,7 @@ void JSON::FrameParser::copy() */ void JSON::FrameParser::paste() { - if (m_textEdit.canPaste()) - { - m_textEdit.paste(); - Q_EMIT modifiedChanged(); - } + m_widget->controller()->executeCommand("paste"); } /** @@ -422,7 +450,7 @@ void JSON::FrameParser::apply() void JSON::FrameParser::reload() { // Document has been modified, ask user if he/she wants to continue - if (m_textEdit.document()->isModified()) + if (isModified()) { auto ret = Misc::Utilities::showMessageBox( tr("The document has been modified!"), @@ -433,7 +461,7 @@ void JSON::FrameParser::reload() } // Load default template - m_textEdit.setPlainText(defaultCode()); + m_widget->textDocument()->setText(defaultCode()); (void)save(true); } @@ -443,7 +471,7 @@ void JSON::FrameParser::reload() void JSON::FrameParser::import() { // Document has been modified, ask user if he/she wants to continue - if (m_textEdit.document()->isModified()) + if (isModified()) { auto ret = Misc::Utilities::showMessageBox( tr("The document has been modified!"), @@ -464,8 +492,8 @@ void JSON::FrameParser::import() QFile file(path); if (file.open(QFile::ReadOnly)) { - auto data = file.readAll(); - m_textEdit.setPlainText(QString::fromUtf8(data)); + m_widget->textDocument()->setText(QString::fromUtf8(file.readAll())); + file.close(); (void)save(true); } } @@ -476,13 +504,13 @@ void JSON::FrameParser::import() */ void JSON::FrameParser::readCode() { - m_textEdit.document()->setModified(false); - const auto code = ProjectModel::instance().frameParserCode(); - if (m_textEdit.toPlainText() != code) + if (text() != code) { - m_textEdit.setPlainText(code); + m_widget->textDocument()->setText(code); + m_widget->textDocument()->textUndoStack()->clear(); (void)loadScript(code); + Q_EMIT modifiedChanged(); } } @@ -491,7 +519,7 @@ void JSON::FrameParser::readCode() */ void JSON::FrameParser::selectAll() { - m_textEdit.selectAll(); + m_widget->controller()->executeCommand("sel_all"); } /** @@ -500,18 +528,11 @@ void JSON::FrameParser::selectAll() */ void JSON::FrameParser::onThemeChanged() { - QPalette palette; - auto theme = &Misc::ThemeManager::instance(); - palette.setColor(QPalette::Text, theme->getColor("text")); - palette.setColor(QPalette::Base, theme->getColor("base")); - palette.setColor(QPalette::Button, theme->getColor("button")); - palette.setColor(QPalette::Window, theme->getColor("window")); - palette.setColor(QPalette::Highlight, theme->getColor("highlight")); - palette.setColor(QPalette::HighlightedText, - theme->getColor("highlighted_text")); - palette.setColor(QPalette::PlaceholderText, - theme->getColor("placeholder_text")); - m_textEdit.setPalette(palette); + static const auto *t = &Misc::ThemeManager::instance(); + const auto n = t->themeData().value("code-editor-theme").toString(); + const auto f = QString(":/rcc/edbee/themes/%1").arg(n); + const auto d = edbee::Edbee::instance()->themeManager()->readThemeFile(f); + m_widget->textRenderer()->setTheme(d); } /** @@ -520,9 +541,9 @@ void JSON::FrameParser::onThemeChanged() */ void JSON::FrameParser::renderWidget() { - if (isVisible()) + if (isVisible() && m_widget) { - m_pixmap = m_textEdit.grab(); + m_pixmap = m_widget->grab(); update(); } } @@ -534,7 +555,9 @@ void JSON::FrameParser::resizeWidget() { if (width() > 0 && height() > 0) { - m_textEdit.setFixedSize(width(), height()); + m_widget->setFixedSize(width(), height()); + m_widget->updateRendererViewport(); + m_widget->updateComponents(); renderWidget(); } } @@ -554,7 +577,8 @@ void JSON::FrameParser::paint(QPainter *painter) */ void JSON::FrameParser::keyPressEvent(QKeyEvent *event) { - DW_EXEC_EVENT(&m_textEdit, keyPressEvent, event); + DW_EXEC_EVENT(m_widget->textEditorComponent(), edbee::TextEditorComponent, + keyPressEvent, event); } /** @@ -562,7 +586,8 @@ void JSON::FrameParser::keyPressEvent(QKeyEvent *event) */ void JSON::FrameParser::keyReleaseEvent(QKeyEvent *event) { - DW_EXEC_EVENT(&m_textEdit, keyReleaseEvent, event); + DW_EXEC_EVENT(m_widget->textEditorComponent(), edbee::TextEditorComponent, + keyReleaseEvent, event); } /** @@ -570,7 +595,8 @@ void JSON::FrameParser::keyReleaseEvent(QKeyEvent *event) */ void JSON::FrameParser::inputMethodEvent(QInputMethodEvent *event) { - DW_EXEC_EVENT(&m_textEdit, inputMethodEvent, event); + DW_EXEC_EVENT(m_widget->textEditorComponent(), edbee::TextEditorComponent, + inputMethodEvent, event); } /** @@ -578,7 +604,8 @@ void JSON::FrameParser::inputMethodEvent(QInputMethodEvent *event) */ void JSON::FrameParser::focusInEvent(QFocusEvent *event) { - DW_EXEC_EVENT(&m_textEdit, focusInEvent, event); + DW_EXEC_EVENT(m_widget->textEditorComponent(), edbee::TextEditorComponent, + focusInEvent, event); } /** @@ -586,7 +613,8 @@ void JSON::FrameParser::focusInEvent(QFocusEvent *event) */ void JSON::FrameParser::focusOutEvent(QFocusEvent *event) { - DW_EXEC_EVENT(&m_textEdit, focusOutEvent, event); + DW_EXEC_EVENT(m_widget->textEditorComponent(), edbee::TextEditorComponent, + focusOutEvent, event); } /** @@ -594,7 +622,8 @@ void JSON::FrameParser::focusOutEvent(QFocusEvent *event) */ void JSON::FrameParser::mousePressEvent(QMouseEvent *event) { - DW_EXEC_EVENT(&m_textEdit, mousePressEvent, event); + DW_EXEC_EVENT(m_widget->textEditorComponent(), edbee::TextEditorComponent, + mousePressEvent, event); } /** @@ -602,7 +631,8 @@ void JSON::FrameParser::mousePressEvent(QMouseEvent *event) */ void JSON::FrameParser::mouseMoveEvent(QMouseEvent *event) { - DW_EXEC_EVENT(&m_textEdit, mouseMoveEvent, event); + DW_EXEC_EVENT(m_widget->textEditorComponent(), edbee::TextEditorComponent, + mouseMoveEvent, event); } /** @@ -610,7 +640,8 @@ void JSON::FrameParser::mouseMoveEvent(QMouseEvent *event) */ void JSON::FrameParser::mouseReleaseEvent(QMouseEvent *event) { - DW_EXEC_EVENT(&m_textEdit, mouseReleaseEvent, event); + DW_EXEC_EVENT(m_widget->textEditorComponent(), edbee::TextEditorComponent, + mouseReleaseEvent, event); } /** @@ -618,7 +649,8 @@ void JSON::FrameParser::mouseReleaseEvent(QMouseEvent *event) */ void JSON::FrameParser::mouseDoubleClickEvent(QMouseEvent *event) { - DW_EXEC_EVENT(&m_textEdit, mouseDoubleClickEvent, event); + DW_EXEC_EVENT(m_widget->textEditorComponent(), edbee::TextEditorComponent, + mouseDoubleClickEvent, event); } /** @@ -626,7 +658,8 @@ void JSON::FrameParser::mouseDoubleClickEvent(QMouseEvent *event) */ void JSON::FrameParser::wheelEvent(QWheelEvent *event) { - DW_EXEC_EVENT(&m_textEdit, wheelEvent, event); + DW_EXEC_EVENT(m_widget->textScrollArea(), edbee::TextEditorScrollArea, + wheelEvent, event); } /** @@ -634,7 +667,8 @@ void JSON::FrameParser::wheelEvent(QWheelEvent *event) */ void JSON::FrameParser::dragEnterEvent(QDragEnterEvent *event) { - DW_EXEC_EVENT(&m_textEdit, dragEnterEvent, event); + DW_EXEC_EVENT(m_widget->textEditorComponent(), edbee::TextEditorComponent, + dragEnterEvent, event); } /** @@ -642,7 +676,8 @@ void JSON::FrameParser::dragEnterEvent(QDragEnterEvent *event) */ void JSON::FrameParser::dragMoveEvent(QDragMoveEvent *event) { - DW_EXEC_EVENT(&m_textEdit, dragMoveEvent, event); + DW_EXEC_EVENT(m_widget->textEditorComponent(), edbee::TextEditorComponent, + dragMoveEvent, event); } /** @@ -650,7 +685,8 @@ void JSON::FrameParser::dragMoveEvent(QDragMoveEvent *event) */ void JSON::FrameParser::dragLeaveEvent(QDragLeaveEvent *event) { - DW_EXEC_EVENT(&m_textEdit, dragLeaveEvent, event); + DW_EXEC_EVENT(m_widget->textEditorComponent(), edbee::TextEditorComponent, + dragLeaveEvent, event); } /** @@ -658,5 +694,6 @@ void JSON::FrameParser::dragLeaveEvent(QDragLeaveEvent *event) */ void JSON::FrameParser::dropEvent(QDropEvent *event) { - DW_EXEC_EVENT(&m_textEdit, dropEvent, event); + DW_EXEC_EVENT(m_widget->textEditorComponent(), edbee::TextEditorComponent, + dropEvent, event); } diff --git a/app/src/JSON/FrameParser.h b/app/src/JSON/FrameParser.h index 3d57fa3a..60e02f55 100644 --- a/app/src/JSON/FrameParser.h +++ b/app/src/JSON/FrameParser.h @@ -32,7 +32,8 @@ #include <QJSValue> #include <QJSEngine> -#include <qsourcehighliter.h> +#include <edbee/edbee.h> +#include <edbee/texteditorwidget.h> namespace JSON { @@ -41,6 +42,8 @@ class FrameParser : public QQuickPaintedItem Q_OBJECT Q_PROPERTY(QString text READ text NOTIFY textChanged) Q_PROPERTY(bool isModified READ isModified NOTIFY modifiedChanged) + Q_PROPERTY(bool undoAvailable READ undoAvailable NOTIFY modifiedChanged) + Q_PROPERTY(bool redoAvailable READ redoAvailable NOTIFY modifiedChanged) signals: void textChanged(); @@ -55,6 +58,8 @@ public: [[nodiscard]] bool isModified() const; [[nodiscard]] QStringList parse(const QString &frame); + [[nodiscard]] bool undoAvailable() const; + [[nodiscard]] bool redoAvailable() const; [[nodiscard]] bool save(const bool silent = false); [[nodiscard]] bool loadScript(const QString &script); @@ -99,7 +104,6 @@ private: QPixmap m_pixmap; QJSEngine m_engine; QJSValue m_parseFunction; - QPlainTextEdit m_textEdit; - QSourceHighlite::QSourceHighliter *m_highlighter; + edbee::TextEditorWidget *m_widget; }; } // namespace JSON diff --git a/app/src/Misc/ThemeManager.cpp b/app/src/Misc/ThemeManager.cpp index f36ace1c..2b536656 100644 --- a/app/src/Misc/ThemeManager.cpp +++ b/app/src/Misc/ThemeManager.cpp @@ -68,10 +68,9 @@ Misc::ThemeManager::ThemeManager() QFile file(QStringLiteral(":/rcc/themes/%1.json").arg(theme)); if (file.open(QFile::ReadOnly)) { - auto document = QJsonDocument::fromJson(file.readAll()); - auto title = document.object().value("title").toString(); - auto colors = document.object().value("colors").toObject(); - m_themes.insert(title, colors); + const auto document = QJsonDocument::fromJson(file.readAll()); + const auto title = document.object().value("title").toString(); + m_themes.insert(title, document.object()); file.close(); } @@ -121,6 +120,15 @@ const QJsonObject &Misc::ThemeManager::colors() const return m_colors; } +/** + * @brief Fetches the current theme as a QJsonObject. + * @return QJsonObject containing all the properties of the loaded theme. + */ +const QJsonObject &Misc::ThemeManager::themeData() const +{ + return m_themeData; +} + /** * @brief Returns a list of theme names that are available. * @return QStringList containing the names of all loaded themes. @@ -158,11 +166,14 @@ void Misc::ThemeManager::setTheme(const int index) if (index < 0 || index >= availableThemes().count()) filteredIndex = 0; - // Update the theme & obtain the colors + // Update the theme name m_theme = filteredIndex; m_settings.setValue("Theme", filteredIndex); m_themeName = availableThemes().at(filteredIndex); - m_colors = m_themes.value(m_themeName); + + // Obtain the data for the theme name + m_themeData = m_themes.value(m_themeName); + m_colors = m_themeData.value("colors").toObject(); // Tell OS if we prefer dark mode or light mode auto bg = getColor("base"); diff --git a/app/src/Misc/ThemeManager.h b/app/src/Misc/ThemeManager.h index ada95928..8a0bd67c 100644 --- a/app/src/Misc/ThemeManager.h +++ b/app/src/Misc/ThemeManager.h @@ -127,6 +127,7 @@ public: [[nodiscard]] int theme() const; [[nodiscard]] const QString &themeName() const; [[nodiscard]] const QJsonObject &colors() const; + [[nodiscard]] const QJsonObject &themeData() const; [[nodiscard]] const QStringList &availableThemes() const; [[nodiscard]] QColor getColor(const QString &name) const; @@ -139,6 +140,7 @@ private: QSettings m_settings; QJsonObject m_colors; + QJsonObject m_themeData; QStringList m_availableThemes; QMap<QString, QJsonObject> m_themes; diff --git a/app/src/SIMD/SIMD.h b/app/src/SIMD/SIMD.h index bba516e3..d46b967b 100644 --- a/app/src/SIMD/SIMD.h +++ b/app/src/SIMD/SIMD.h @@ -25,7 +25,7 @@ #include <cmath> #include <cstddef> #include <algorithm> -#include <x86/sse2.h> +#include <x86/avx.h> #include <QVector> #include <QPointF> @@ -51,13 +51,13 @@ template<typename T> inline void fill(T *data, size_t count, T value) { // Get the number of items that can be processed in a SIMD register - constexpr int simdWidth = sizeof(simde__m128d) / sizeof(T); + constexpr int simdWidth = sizeof(simde__m256d) / sizeof(T); // SIMD bulk initialization size_t i = 0; - simde__m128d fillValue = simde_mm_set1_pd(value); + simde__m256d fillValue = simde_mm256_set1_pd(value); for (; i + simdWidth <= count; i += simdWidth) - simde_mm_storeu_pd(data + i, fillValue); + simde_mm256_storeu_pd(data + i, fillValue); // Handle remaining elements using a scalar loop for (; i < count; ++i) @@ -82,14 +82,14 @@ template<typename T> inline void shift(T *data, size_t count, T value) { // Get the number of items that can be processed in a SIMD register - constexpr int simdWidth = sizeof(simde__m128d) / sizeof(T); + constexpr int simdWidth = sizeof(simde__m256d) / sizeof(T); // Shift elements using SIMD operations size_t i = 0; for (; i + simdWidth <= count; i += simdWidth) { - simde__m128d next = simde_mm_loadu_pd(data + i + 1); - simde_mm_storeu_pd(data + i, next); + simde__m256d next = simde_mm256_loadu_pd(data + i + 1); + simde_mm256_storeu_pd(data + i, next); } // Handle remaining elements using a scalar loop @@ -116,21 +116,21 @@ template<typename T> inline T findMin(const T *data, size_t count) { // Get the number of items that can be processed in a SIMD register - constexpr int simdWidth = sizeof(simde__m128d) / sizeof(T); + constexpr int simdWidth = sizeof(simde__m256d) / sizeof(T); // SIMD comparisons size_t i = 0; - simde__m128d minVec = simde_mm_set1_pd(data[0]); + simde__m256d minVec = simde_mm256_set1_pd(data[0]); for (; i + simdWidth <= count; i += simdWidth) { - simde__m128d values = simde_mm_loadu_pd(&data[i]); - minVec = simde_mm_min_pd(minVec, values); + simde__m256d values = simde_mm256_loadu_pd(&data[i]); + minVec = simde_mm256_min_pd(minVec, values); } // Reduce SIMD register to scalar T minVal = data[0]; alignas(simdWidth) T buffer[simdWidth]; - simde_mm_storeu_pd(buffer, minVec); + simde_mm256_storeu_pd(buffer, minVec); for (int j = 0; j < simdWidth; ++j) minVal = std::min<T>(minVal, buffer[j]); @@ -157,21 +157,21 @@ template<typename T> inline T findMax(const T *data, size_t count) { // Get the number of items that can be processed in a SIMD register - constexpr int simdWidth = sizeof(simde__m128d) / sizeof(T); + constexpr int simdWidth = sizeof(simde__m256d) / sizeof(T); // SIMD comparisons size_t i = 0; - simde__m128d maxVec = simde_mm_set1_pd(data[0]); + simde__m256d maxVec = simde_mm256_set1_pd(data[0]); for (; i + simdWidth <= count; i += simdWidth) { - simde__m128d values = simde_mm_loadu_pd(&data[i]); - maxVec = simde_mm_max_pd(maxVec, values); + simde__m256d values = simde_mm256_loadu_pd(&data[i]); + maxVec = simde_mm256_max_pd(maxVec, values); } // Reduce SIMD register to scalar T maxVal = data[0]; alignas(simdWidth) T buffer[simdWidth]; - simde_mm_storeu_pd(buffer, maxVec); + simde_mm256_storeu_pd(buffer, maxVec); for (int j = 0; j < simdWidth; ++j) maxVal = std::max<T>(maxVal, buffer[j]); @@ -204,23 +204,31 @@ template<typename Extractor> inline qreal findMin(const QVector<QPointF> &data, Extractor extractor) { // Get the number of items that can be processed in a SIMD register - constexpr int simdWidth = sizeof(simde__m128d) / sizeof(qreal); + constexpr int simdWidth = sizeof(simde__m256d) / sizeof(qreal); - // SIMD comparisons + // Prepare parameters for comparisons size_t i = 0; size_t count = data.size(); - auto minVec = simde_mm_set1_pd(extractor(data[0])); + if (count == 0) + return 0; + + // Initialize SIMD vector with the first extracted value + simde__m256d minVec = simde_mm256_set1_pd(extractor(data[0])); + + // SIMD comparisons for (; i + simdWidth <= count; i += simdWidth) { - auto values = simde_mm_set_pd(extractor(data[i + 1]), extractor(data[i])); - minVec = simde_mm_min_pd(minVec, values); + simde__m256d values + = simde_mm256_set_pd(extractor(data[i + 3]), extractor(data[i + 2]), + extractor(data[i + 1]), extractor(data[i])); + minVec = simde_mm256_min_pd(minVec, values); } // Reduce SIMD register to scalar - qreal minVal = extractor(data[0]); - alignas(16) qreal buffer[simdWidth]; - simde_mm_storeu_pd(buffer, minVec); - for (int j = 0; j < simdWidth; ++j) + alignas(32) qreal buffer[simdWidth]; + simde_mm256_storeu_pd(buffer, minVec); + qreal minVal = buffer[0]; + for (int j = 1; j < simdWidth; ++j) minVal = std::min<qreal>(minVal, buffer[j]); // Scalar fallback for remaining elements @@ -252,23 +260,31 @@ template<typename Extractor> inline qreal findMax(const QVector<QPointF> &data, Extractor extractor) { // Get the number of items that can be processed in a SIMD register - constexpr int simdWidth = sizeof(simde__m128d) / sizeof(qreal); + constexpr int simdWidth = sizeof(simde__m256d) / sizeof(qreal); - // SIMD comparisons + // Prepare parameters for comparisons size_t i = 0; size_t count = data.size(); - auto maxVec = simde_mm_set1_pd(extractor(data[0])); + if (count == 0) + return 0; + + // Initialize SIMD vector with the first extracted value + simde__m256d maxVec = simde_mm256_set1_pd(extractor(data[0])); + + // SIMD comparisons for (; i + simdWidth <= count; i += simdWidth) { - auto values = simde_mm_set_pd(extractor(data[i + 1]), extractor(data[i])); - maxVec = simde_mm_max_pd(maxVec, values); + simde__m256d values + = simde_mm256_set_pd(extractor(data[i + 3]), extractor(data[i + 2]), + extractor(data[i + 1]), extractor(data[i])); + maxVec = simde_mm256_max_pd(maxVec, values); } // Reduce SIMD register to scalar - qreal maxVal = extractor(data[0]); - alignas(16) qreal buffer[simdWidth]; - simde_mm_storeu_pd(buffer, maxVec); - for (int j = 0; j < simdWidth; ++j) + alignas(32) qreal buffer[simdWidth]; + simde_mm256_storeu_pd(buffer, maxVec); + qreal maxVal = buffer[0]; + for (int j = 1; j < simdWidth; ++j) maxVal = std::max<qreal>(maxVal, buffer[j]); // Scalar fallback for remaining elements diff --git a/app/src/UI/Dashboard.cpp b/app/src/UI/Dashboard.cpp index bb5055e6..b1947491 100644 --- a/app/src/UI/Dashboard.cpp +++ b/app/src/UI/Dashboard.cpp @@ -725,7 +725,7 @@ void UI::Dashboard::updatePlots() const auto &dataset = getDatasetWidget(SerialStudio::DashboardPlot, i); auto *data = m_linearPlotValues[i].data(); auto count = m_linearPlotValues[i].count(); - SIMD::shift<qreal>(data, count, dataset.value().toDouble()); + SIMD::shift<qreal>(data, count, dataset.value().toFloat()); } // Append latest values to FFT plots data @@ -734,7 +734,7 @@ void UI::Dashboard::updatePlots() const auto &dataset = getDatasetWidget(SerialStudio::DashboardFFT, i); auto *data = m_fftPlotValues[i].data(); auto count = m_fftPlotValues[i].count(); - SIMD::shift<qreal>(data, count, dataset.value().toDouble()); + SIMD::shift<qreal>(data, count, dataset.value().toFloat()); } // Append latest values to multiplots data @@ -746,7 +746,7 @@ void UI::Dashboard::updatePlots() const auto &dataset = group.datasets()[j]; auto *data = m_multiplotValues[i][j].data(); auto count = m_multiplotValues[i][j].count(); - SIMD::shift<qreal>(data, count, dataset.value().toDouble()); + SIMD::shift<qreal>(data, count, dataset.value().toFloat()); } } } diff --git a/examples/HexadecimalADC/HexadecimalADC.json b/examples/HexadecimalADC/HexadecimalADC.json index 4c70632d..70aa738f 100644 --- a/examples/HexadecimalADC/HexadecimalADC.json +++ b/examples/HexadecimalADC/HexadecimalADC.json @@ -4,7 +4,7 @@ "decoder": 1, "frameDetection": 1, "frameEnd": ";", - "frameParser": "/**\n * This function parses a binary data frame (represented as a hexadecimal string),\n * and converts it into an array of decimal values (0-255).\n *\n * @param[in] frame The latest received frame as a hexadecimal string.\n * @return Array of integers containing the parsed frame elements.\n */\nfunction parse(frame) {\n let dataArray = [];\n for (let i = 0; i < frame.length; i += 2) {\n let hexByte = frame.substring(i, i + 2);\n let decimalValue = parseInt(hexByte, 16);\n dataArray.push(decimalValue * 5.0 / 255);\n }\n\n return dataArray;\n}", + "frameParser": "/**\n * This function parses a binary data frame (represented as a hexadecimal string),\n * and converts it into an array of decimal values ranging from 0 to 5 volts.\n *\n * @param[in] frame The latest received frame as a hexadecimal string.\n * @return Array of integers containing the parsed frame elements.\n */\nfunction parse(frame) {\n let dataArray = [];\n for (let i = 0; i < frame.length; i += 2) {\n let hexByte = frame.substring(i, i + 2);\n let decimalValue = parseInt(hexByte, 16);\n dataArray.push(decimalValue * 5.0 / 255);\n }\n\n return dataArray;\n}", "frameStart": "$", "groups": [ { diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 992238c6..5e067fd1 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -25,8 +25,8 @@ cmake_minimum_required(VERSION 3.19) add_subdirectory(simde) add_subdirectory(qmqtt) add_subdirectory(OpenSSL) +add_subdirectory(edbee-lib) add_subdirectory(QRealFourier) add_subdirectory(QSimpleUpdater) -add_subdirectory(QSourceHighlite) diff --git a/lib/QSourceHighlite/.clang-format b/lib/QSourceHighlite/.clang-format deleted file mode 100644 index d83582fc..00000000 --- a/lib/QSourceHighlite/.clang-format +++ /dev/null @@ -1,38 +0,0 @@ -BasedOnStyle: LLVM -Standard: Cpp11 -CommentPragmas: "^!|^:" -PointerBindsToType: false -SpaceAfterTemplateKeyword: false -BreakBeforeBinaryOperators: All -BreakBeforeBraces: Custom -BreakBeforeTernaryOperators: true -BreakConstructorInitializers: BeforeComma -ConstructorInitializerIndentWidth: 2 -NamespaceIndentation: None -AlignAfterOpenBracket: true -AlwaysBreakTemplateDeclarations: true -AllowShortFunctionsOnASingleLine: Inline -SortIncludes: false -IndentCaseLabels: true -IndentPPDirectives: AfterHash -AccessModifierOffset: -2 -IndentWidth: 2 -ColumnLimit: 80 - -BraceWrapping: - AfterClass: true - AfterControlStatement: true - AfterEnum: true - AfterFunction: true - AfterNamespace: true - AfterObjCDeclaration: true - AfterStruct: true - AfterUnion: true - BeforeCatch: true - BeforeElse: true - IndentBraces: false - -ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE ] -#StatementMacros ['Q_OBJECT', 'Q_UNUSED'] - - diff --git a/lib/QSourceHighlite/.gitignore b/lib/QSourceHighlite/.gitignore deleted file mode 100755 index 5ba03410..00000000 --- a/lib/QSourceHighlite/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -build-* -*.user diff --git a/lib/QSourceHighlite/CMakeLists.txt b/lib/QSourceHighlite/CMakeLists.txt deleted file mode 100644 index e633c632..00000000 --- a/lib/QSourceHighlite/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -# -# Copyright (c) 2024 Alex Spataru <https://github.com/alex-spataru> -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# - -#------------------------------------------------------------------------------- -# Project setup -#------------------------------------------------------------------------------- - -cmake_minimum_required(VERSION 3.19) -project(QSourceHighlite CXX) - -#------------------------------------------------------------------------------- -# C++ options -#------------------------------------------------------------------------------- - -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTOUIC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_VERBOSE_MAKEFILE ON) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -#------------------------------------------------------------------------------- -# Add external dependencies -#------------------------------------------------------------------------------- - -find_package(Qt6 COMPONENTS Gui Core Widgets REQUIRED) - -#------------------------------------------------------------------------------- -# Import source code & resources -#------------------------------------------------------------------------------- - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) - -set(SOURCES - languagedata.cpp - qsourcehighliter.cpp - qsourcehighliterthemes.cpp -) - -set(HEADERS - languagedata.h - qsourcehighliter.h - qsourcehighliterthemes.h -) - -#------------------------------------------------------------------------------- -# Compile & link the library -#------------------------------------------------------------------------------- - -add_library( - QSourceHighlite - STATIC - ${SOURCES} - ${HEADERS} -) - -target_link_libraries( - QSourceHighlite PUBLIC - - Qt6::Core - Qt6::Gui - Qt6::Widgets -) - -target_include_directories( - QSourceHighlite PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} -) diff --git a/lib/QSourceHighlite/LICENSE b/lib/QSourceHighlite/LICENSE deleted file mode 100755 index f0c6f9a1..00000000 --- a/lib/QSourceHighlite/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2019-2020 Waqar Ahmed -- <waqar.17a@gmail.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/lib/QSourceHighlite/README.md b/lib/QSourceHighlite/README.md deleted file mode 100755 index 21c7b4a6..00000000 --- a/lib/QSourceHighlite/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# Background - -It started as an internal component of [qmarkdowntextedit](https://github.com/pbek/qmarkdowntextedit) to provide syntax highlighting(kind of like **highlight.js**). Ithttps://github.com/pbek/qmarkdowntextedit is currently being used in QOwnNotes and you can test it there or run the demo here. - -It doesn't use any regex because I want it to be fast. It can currently load a 100,000 lines of source code in ~0.4 seconds on my 4th Gen Intel Core i5 4300U. - -# Screenshot - -![Cpp](screenshot/syntax.png) - -# Usage - -Add the `.pri` file to your project. Then initialize it like this: -```cpp -highlighter = new QSourceHighliter(plainTextEdit->document()); -highlighter->setCurrentLanguage(QSourceHighlighter::CodeCpp); -``` - -# Themes - -Currently there is only one theme 'Monokai' apart from the one that is created during highlighter initialization. More themes will be added soon. You can add more themes in QSourceHighlighterThemes. - -## Supported Languages - -Currently the following languages are supported (more being added): -- Bash script -- C -- C++ -- C# -- CMake -- CSS -- Go -- Html -- INI -- Java -- Javascript -- JSON -- Make -- PHP -- Python -- QML -- Rust -- SQL -- Typescript -- V lang -- XML -- YAML -- Houdini Vex - -## Adding more languages - -If you want to add a language, collect the language data like keywords and types and add it to the `languagedata.h` file. For some languages it may not work, so create an issue and I will write a separate parser for that language. - -## Dependencies - -It has no dependency except Qt ofcourse. It should work with any Qt version > 5 but if it fails please create an issue. - -## Building - -Load the project into Qt Creator and click run. - -## LICENSE - -MIT License - diff --git a/lib/QSourceHighlite/languagedata.cpp b/lib/QSourceHighlite/languagedata.cpp deleted file mode 100644 index 2a8f9201..00000000 --- a/lib/QSourceHighlite/languagedata.cpp +++ /dev/null @@ -1,5698 +0,0 @@ -/* - * Copyright (c) 2019-2020 Waqar Ahmed -- <waqar.17a@gmail.com> - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */ - -#include <QMultiHash> -#include <QLatin1String> -#include "languagedata.h" -/* ------------------------ - * TEMPLATE FOR LANG DATA - * ------------------------- - * - * loadXXXData, where XXX is the language - * keywords are the language keywords e.g, const - * types are built-in types i.e, int, char, var - * literals are words like, true false - * builtin are the library functions - * other can contain any other thing, for e.g, in cpp it contains the - preprocessor - - xxx_keywords = { - }; - - xxx_types = { - }; - - xxx_literals = { - }; - - xxx_builtin = { - }; - - xxx_other = { - }; - -*/ - -namespace QSourceHighlite -{ - -/**********************************************************/ -/* LuaData ************************************************/ -/**********************************************************/ - -static bool luaDataInitialized = false; -static LanguageData lua_keywords; -static LanguageData lua_types; -static LanguageData lua_builtin; -static LanguageData lua_literals; -static LanguageData lua_other; -void initLuaData() -{ - lua_keywords = LanguageData{ - {('a'), QLatin1String("and")}, {('b'), QLatin1String("break")}, - {('d'), QLatin1String("do")}, {('e'), QLatin1String("else")}, - {('e'), QLatin1String("elseif")}, {('e'), QLatin1String("end")}, - {('f'), QLatin1String("for")}, {('f'), QLatin1String("function")}, - {('i'), QLatin1String("if")}, {('i'), QLatin1String("in")}, - {('l'), QLatin1String("local")}, {('n'), QLatin1String("not")}, - {('o'), QLatin1String("or")}, {('r'), QLatin1String("repeat")}, - {('r'), QLatin1String("require")}, {('r'), QLatin1String("return")}, - {('t'), QLatin1String("then")}, {('u'), QLatin1String("until")}, - {('w'), QLatin1String("while")}}; - - lua_literals = LanguageData{{('f'), QLatin1String("false")}, - {('n'), QLatin1String("nil")}, - {('t'), QLatin1String("true")}}; - - lua_other = LanguageData{ - {('_'), QLatin1String("_G")}, {('_'), QLatin1String("__add")}, - {('_'), QLatin1String("__call")}, {('_'), QLatin1String("__contact")}, - {('_'), QLatin1String("__div")}, {('_'), QLatin1String("__eq")}, - {('_'), QLatin1String("__index")}, {('_'), QLatin1String("__le")}, - {('_'), QLatin1String("__lt")}, {('_'), QLatin1String("__mod")}, - {('_'), QLatin1String("__mul")}, {('_'), QLatin1String("__newindex")}, - {('_'), QLatin1String("__sub")}, {('_'), QLatin1String("__tostring")}, - {('_'), QLatin1String("__unm")}}; - - lua_builtin = LanguageData{{('d'), QLatin1String("debug")}, - {('d'), QLatin1String("dofile")}, - {('g'), QLatin1String("getfenv")}, - {('g'), QLatin1String("gethook")}, - {('g'), QLatin1String("getinfo")}, - {('g'), QLatin1String("getlocal")}, - {('g'), QLatin1String("getmetatable")}, - {('g'), QLatin1String("getregistry")}, - {('g'), QLatin1String("getupvalue")}, - {('i'), QLatin1String("ipairs")}, - {('l'), QLatin1String("load")}, - {('l'), QLatin1String("loadfile")}, - {('l'), QLatin1String("loadstring")}, - {('n'), QLatin1String("next")}, - {('p'), QLatin1String("pairs")}, - {('p'), QLatin1String("print")}, - {('r'), QLatin1String("rawequal")}, - {('r'), QLatin1String("rawget")}, - {('r'), QLatin1String("rawset")}, - {('s'), QLatin1String("select")}, - {('s'), QLatin1String("setfenv")}, - {('s'), QLatin1String("sethook")}, - {('s'), QLatin1String("setlocal")}, - {('s'), QLatin1String("setmetatable")}, - {('s'), QLatin1String("setupvalue")}, - {('t'), QLatin1String("tonumber")}, - {('t'), QLatin1String("tostring")}, - {('t'), QLatin1String("traceback")}, - {('t'), QLatin1String("type")}, - {('u'), QLatin1String("unpack")}}; -} - -void loadLuaData(LanguageData &typess, LanguageData &keywordss, - LanguageData &builtins, LanguageData &literalss, - LanguageData &others) -{ - if (!luaDataInitialized) - { - initLuaData(); - luaDataInitialized = true; - } - typess = lua_types; - keywordss = lua_keywords; - builtins = lua_builtin; - literalss = lua_literals; - others = lua_other; -} - -/**********************************************************/ -/* C/C++ Data *********************************************/ -/**********************************************************/ - -static bool cppDataInitialized = false; -static LanguageData cpp_keywords; -static LanguageData cpp_types; -static LanguageData cpp_builtin; -static LanguageData cpp_literals; -static LanguageData cpp_other; -void initCppData() -{ - cpp_keywords = LanguageData{{('a'), QLatin1String("alignas")}, - {('a'), QLatin1String("alignof")}, - {('a'), QLatin1String("and")}, - {('a'), QLatin1String("and_eq")}, - {('a'), QLatin1String("asm")}, - {('b'), QLatin1String("bit_and")}, - {('b'), QLatin1String("bit_or")}, - {('b'), QLatin1String("break")}, - {('c'), QLatin1String("case")}, - {('c'), QLatin1String("catch")}, - {('c'), QLatin1String("compl")}, - {('c'), QLatin1String("concept")}, - {('c'), QLatin1String("const")}, - {('c'), QLatin1String("constinit")}, - {('c'), QLatin1String("constexpr")}, - {('c'), QLatin1String("consteval")}, - {('c'), QLatin1String("const_cast")}, - {('c'), QLatin1String("continue")}, - {('c'), QLatin1String("co_await")}, - {('c'), QLatin1String("co_return")}, - {('c'), QLatin1String("co_yield")}, - {('d'), QLatin1String("decltype")}, - {('d'), QLatin1String("default")}, - {('d'), QLatin1String("delete")}, - {('d'), QLatin1String("do")}, - {('d'), QLatin1String("dynamic_cast")}, - {('e'), QLatin1String("else")}, - {('e'), QLatin1String("explicit")}, - {('e'), QLatin1String("export")}, - {('e'), QLatin1String("extern")}, - {('f'), QLatin1String("for")}, - {('f'), QLatin1String("friend")}, - {('g'), QLatin1String("goto")}, - {('i'), QLatin1String("if")}, - {('i'), QLatin1String("inline")}, - {('m'), QLatin1String("mutable")}, - {('n'), QLatin1String("new")}, - {('n'), QLatin1String("not")}, - {('n'), QLatin1String("not_eq")}, - {('n'), QLatin1String("noexcept")}, - {('o'), QLatin1String("or")}, - {('o'), QLatin1String("or_eq")}, - {('o'), QLatin1String("operator")}, - {('p'), QLatin1String("private")}, - {('p'), QLatin1String("protected")}, - {('p'), QLatin1String("public")}, - {('r'), QLatin1String("register")}, - {('r'), QLatin1String("reinterpret_cast")}, - {('r'), QLatin1String("requires")}, - {('r'), QLatin1String("return")}, - {('s'), QLatin1String("signal")}, - {('s'), QLatin1String("sizeof")}, - {('s'), QLatin1String("slot")}, - {('s'), QLatin1String("static")}, - {('s'), QLatin1String("static_assert")}, - {('s'), QLatin1String("static_cast")}, - {('s'), QLatin1String("switch")}, - {('t'), QLatin1String("template")}, - {('t'), QLatin1String("this")}, - {('t'), QLatin1String("thread_local")}, - {('t'), QLatin1String("throw")}, - {('t'), QLatin1String("try")}, - {('t'), QLatin1String("typeid")}, - {('t'), QLatin1String("typedef")}, - {('t'), QLatin1String("typename")}, - {('u'), QLatin1String("using")}, - {('v'), QLatin1String("volatile")}, - {('w'), QLatin1String("while")}, - {('x'), QLatin1String("xor")}, - {('x'), QLatin1String("xor_eq")}}; - - cpp_types = {{('a'), QLatin1String("auto")}, - {('b'), QLatin1String("bool")}, - {('c'), QLatin1String("char")}, - {('c'), QLatin1String("char8_t")}, - {('c'), QLatin1String("char16_t")}, - {('c'), QLatin1String("char32_t")}, - {('c'), QLatin1String("class")}, - {('d'), QLatin1String("double")}, - {('e'), QLatin1String("enum")}, - {('f'), QLatin1String("float")}, - {('i'), QLatin1String("int")}, - {('i'), QLatin1String("int8_t")}, - {('i'), QLatin1String("int16_t")}, - {('i'), QLatin1String("int32_t")}, - {('i'), QLatin1String("int64_t")}, - {('i'), QLatin1String("int_fast8_t")}, - {('i'), QLatin1String("int_fast16_t")}, - {('i'), QLatin1String("int_fast32_t")}, - {('i'), QLatin1String("int_fast64_t")}, - {('i'), QLatin1String("intmax_t")}, - {('i'), QLatin1String("intptr_t")}, - {('l'), QLatin1String("long")}, - {('n'), QLatin1String("namespace")}, - {('Q'), QLatin1String("QHash")}, - {('Q'), QLatin1String("QList")}, - {('Q'), QLatin1String("QMap")}, - {('Q'), QLatin1String("QString")}, - {('Q'), QLatin1String("QVector")}, - {('s'), QLatin1String("short")}, - {('s'), QLatin1String("size_t")}, - {('s'), QLatin1String("signed")}, - {('s'), QLatin1String("struct")}, - {('s'), QLatin1String("ssize_t")}, - {('u'), QLatin1String("uint8_t")}, - {('u'), QLatin1String("uint16_t")}, - {('u'), QLatin1String("uint32_t")}, - {('u'), QLatin1String("uint64_t")}, - {('u'), QLatin1String("uint_fast8_t")}, - {('u'), QLatin1String("uint_fast16_t")}, - {('u'), QLatin1String("uint_fast32_t")}, - {('u'), QLatin1String("uint_fast64_t")}, - {('u'), QLatin1String("uint_least8_t")}, - {('u'), QLatin1String("uint_least16_t")}, - {('u'), QLatin1String("uint_least32_t")}, - {('u'), QLatin1String("uint_least64_t")}, - {('u'), QLatin1String("uintmax_t")}, - {('u'), QLatin1String("uintptr_t")}, - {('u'), QLatin1String("unsigned")}, - {('u'), QLatin1String("union")}, - {('v'), QLatin1String("void")}, - {('w'), QLatin1String("wchar_t")}}; - - cpp_literals = {{('f'), QLatin1String("false")}, - {('n'), QLatin1String("nullptr")}, - {('N'), QLatin1String("NULL")}, - {('t'), QLatin1String("true")}}; - - cpp_builtin = {{('s'), QLatin1String("std")}, - {('s'), QLatin1String("string")}, - {('w'), QLatin1String("wstring")}, - {('c'), QLatin1String("cin")}, - {('c'), QLatin1String("cout")}, - {('c'), QLatin1String("cerr")}, - {('c'), QLatin1String("clog")}, - {('s'), QLatin1String("stdin")}, - {('s'), QLatin1String("stdout")}, - {('s'), QLatin1String("stderr")}, - {('s'), QLatin1String("stringstream")}, - {('i'), QLatin1String("istringstream")}, - {('o'), QLatin1String("ostringstream")}, - {('a'), QLatin1String("auto_ptr")}, - {('d'), QLatin1String("deque")}, - {('l'), QLatin1String("list")}, - {('q'), QLatin1String("queue")}, - {('s'), QLatin1String("stack")}, - {('v'), QLatin1String("vector")}, - {('m'), QLatin1String("map")}, - {('s'), QLatin1String("set")}, - {('b'), QLatin1String("bitset")}, - {('m'), QLatin1String("multiset")}, - {('m'), QLatin1String("multimap")}, - {('u'), QLatin1String("unordered_set")}, - {('u'), QLatin1String("unordered_map")}, - {('u'), QLatin1String("unordered_multiset")}, - {('u'), QLatin1String("unordered_multimap")}, - {('a'), QLatin1String("array")}, - {('s'), QLatin1String("shared_ptr")}, - {('a'), QLatin1String("abort")}, - {('t'), QLatin1String("terminate")}, - {('a'), QLatin1String("abs")}, - {('a'), QLatin1String("acos")}, - {('a'), QLatin1String("asin")}, - {('a'), QLatin1String("atan2")}, - {('a'), QLatin1String("atan")}, - {('c'), QLatin1String("calloc")}, - {('c'), QLatin1String("ceil")}, - {('c'), QLatin1String("cosh")}, - {('c'), QLatin1String("cos")}, - {('e'), QLatin1String("exit")}, - {('e'), QLatin1String("exp")}, - {('f'), QLatin1String("fabs")}, - {('f'), QLatin1String("floor")}, - {('f'), QLatin1String("fmod")}, - {('f'), QLatin1String("fprintf")}, - {('f'), QLatin1String("fputs")}, - {('f'), QLatin1String("free")}, - {('f'), QLatin1String("frexp")}, - {('f'), QLatin1String("fscanf")}, - {('f'), QLatin1String("future")}, - {('i'), QLatin1String("isalnum")}, - {('i'), QLatin1String("isalpha")}, - {('i'), QLatin1String("iscntrl")}, - {('i'), QLatin1String("isdigit")}, - {('i'), QLatin1String("isgraph")}, - {('i'), QLatin1String("islower")}, - {('i'), QLatin1String("isprint")}, - {('i'), QLatin1String("ispunct")}, - {('i'), QLatin1String("isspace")}, - {('i'), QLatin1String("isupper")}, - {('i'), QLatin1String("isxdigit")}, - {('t'), QLatin1String("tolower")}, - {('t'), QLatin1String("toupper")}, - {('l'), QLatin1String("labs")}, - {('l'), QLatin1String("ldexp")}, - {('l'), QLatin1String("log10")}, - {('l'), QLatin1String("log")}, - {('m'), QLatin1String("malloc")}, - {('r'), QLatin1String("realloc")}, - {('m'), QLatin1String("main")}, - {('m'), QLatin1String("memchr")}, - {('m'), QLatin1String("memcmp")}, - {('m'), QLatin1String("memcpy")}, - {('m'), QLatin1String("memset")}, - {('m'), QLatin1String("modf")}, - {('p'), QLatin1String("pow")}, - {('p'), QLatin1String("printf")}, - {('p'), QLatin1String("putchar")}, - {('p'), QLatin1String("puts")}, - {('s'), QLatin1String("scanf")}, - {('s'), QLatin1String("sinh")}, - {('s'), QLatin1String("sin")}, - {('s'), QLatin1String("snprintf")}, - {('s'), QLatin1String("sprintf")}, - {('s'), QLatin1String("sqrt")}, - {('s'), QLatin1String("sscanf")}, - {('s'), QLatin1String("strcat")}, - {('s'), QLatin1String("strchr")}, - {('s'), QLatin1String("strcmp")}, - {('s'), QLatin1String("strcpy")}, - {('s'), QLatin1String("strcspn")}, - {('s'), QLatin1String("strlen")}, - {('s'), QLatin1String("strncat")}, - {('s'), QLatin1String("strncmp")}, - {('s'), QLatin1String("strncpy")}, - {('s'), QLatin1String("strpbrk")}, - {('s'), QLatin1String("strrchr")}, - {('s'), QLatin1String("strspn")}, - {('s'), QLatin1String("strstr")}, - {('t'), QLatin1String("tanh")}, - {('t'), QLatin1String("tan")}, - {('v'), QLatin1String("vfprintf")}, - {('v'), QLatin1String("vprintf")}, - {('v'), QLatin1String("vsprintf")}, - {('e'), QLatin1String("endl")}, - {('i'), QLatin1String("initializer_list")}, - {('u'), QLatin1String("unique_ptr")}, - {('c'), QLatin1String("complex")}, - {('i'), QLatin1String("imaginary")}}; - - cpp_other - = {{('d'), QLatin1String("define")}, {('e'), QLatin1String("else")}, - {('e'), QLatin1String("elif")}, {('e'), QLatin1String("endif")}, - {('e'), QLatin1String("error")}, {('i'), QLatin1String("if")}, - {('i'), QLatin1String("ifdef")}, {('i'), QLatin1String("ifndef")}, - {('i'), QLatin1String("include")}, {('l'), QLatin1String("line")}, - {('p'), QLatin1String("pragma")}, {('P'), QLatin1String("_Pragma")}, - {('u'), QLatin1String("undef")}, {('w'), QLatin1String("warning")}}; -} -void loadCppData(LanguageData &typess, LanguageData &keywordss, - LanguageData &builtins, LanguageData &literalss, - LanguageData &others) -{ - if (!cppDataInitialized) - { - initCppData(); - cppDataInitialized = true; - } - - typess = cpp_types; - keywordss = cpp_keywords; - builtins = cpp_builtin; - literalss = cpp_literals; - others = cpp_other; -} - -/**********************************************************/ -/* Shell Data *********************************************/ -/**********************************************************/ - -static bool shellDataInitialized = false; -static LanguageData shell_keywords; -static LanguageData shell_types; -static LanguageData shell_literals; -static LanguageData shell_builtin; -static LanguageData shell_other; -void initShellData() -{ - shell_keywords - = {{('i'), QLatin1String("if")}, {('t'), QLatin1String("then")}, - {('e'), QLatin1String("else")}, {('e'), QLatin1String("elif")}, - {('f'), QLatin1String("fi")}, {('f'), QLatin1String("for")}, - {('w'), QLatin1String("while")}, {('i'), QLatin1String("in")}, - {('d'), QLatin1String("do")}, {('d'), QLatin1String("done")}, - {('c'), QLatin1String("case")}, {('e'), QLatin1String("esac")}, - {('f'), QLatin1String("function")}}; - - shell_types = {}; - - shell_literals - = {{('f'), QLatin1String("false")}, {('t'), QLatin1String("true")}}; - - shell_builtin = {{('b'), QLatin1String("break")}, - {('c'), QLatin1String("cd")}, - {('c'), QLatin1String("continue")}, - {('e'), QLatin1String("eval")}, - {('e'), QLatin1String("exec")}, - {('e'), QLatin1String("exit")}, - {('e'), QLatin1String("export")}, - {('g'), QLatin1String("getopts")}, - {('h'), QLatin1String("hash")}, - {('p'), QLatin1String("pwd")}, - {('r'), QLatin1String("readonly")}, - {('r'), QLatin1String("return")}, - {('s'), QLatin1String("shift")}, - {('t'), QLatin1String("test")}, - {('t'), QLatin1String("timestrap")}, - {('u'), QLatin1String("umask")}, - {('u'), QLatin1String("unset")}, - {('B'), QLatin1String("Bash")}, - {('a'), QLatin1String("alias")}, - {('b'), QLatin1String("bind")}, - {('b'), QLatin1String("builtin")}, - {('c'), QLatin1String("caller")}, - {('c'), QLatin1String("command")}, - {('d'), QLatin1String("declare")}, - {('e'), QLatin1String("echo")}, - {('e'), QLatin1String("enable")}, - {('h'), QLatin1String("help")}, - {('l'), QLatin1String("let")}, - {('l'), QLatin1String("local")}, - {('l'), QLatin1String("logout")}, - {('m'), QLatin1String("mapfile")}, - {('p'), QLatin1String("printfread")}, - {('r'), QLatin1String("readarray")}, - {('s'), QLatin1String("source")}, - {('t'), QLatin1String("type")}, - {('t'), QLatin1String("typeset")}, - {('u'), QLatin1String("ulimit")}, - {('u'), QLatin1String("unalias")}, - {('m'), QLatin1String("modifiers")}, - {('s'), QLatin1String("set")}, - {('s'), QLatin1String("shopt")}, - {('a'), QLatin1String("autoload")}, - {('b'), QLatin1String("bg")}, - {('b'), QLatin1String("bindkey")}, - {('b'), QLatin1String("bye")}, - {('c'), QLatin1String("cap")}, - {('c'), QLatin1String("chdir")}, - {('c'), QLatin1String("clone")}, - {('c'), QLatin1String("comparguments")}, - {('c'), QLatin1String("compcall")}, - {('c'), QLatin1String("compctl")}, - {('c'), QLatin1String("compdescribe")}, - {('c'), QLatin1String("compfilescompgroups")}, - {('c'), QLatin1String("compquote")}, - {('c'), QLatin1String("comptags")}, - {('c'), QLatin1String("comptry")}, - {('c'), QLatin1String("compvalues")}, - {('d'), QLatin1String("dirs")}, - {('d'), QLatin1String("disable")}, - {('d'), QLatin1String("disown")}, - {('e'), QLatin1String("echotc")}, - {('e'), QLatin1String("echoti")}, - {('e'), QLatin1String("emulatefc")}, - {('f'), QLatin1String("fg")}, - {('f'), QLatin1String("float")}, - {('f'), QLatin1String("functions")}, - {('g'), QLatin1String("getcap")}, - {('g'), QLatin1String("getln")}, - {('h'), QLatin1String("history")}, - {('i'), QLatin1String("integer")}, - {('j'), QLatin1String("jobs")}, - {('k'), QLatin1String("kill")}, - {('l'), QLatin1String("limit")}, - {('l'), QLatin1String("log")}, - {('n'), QLatin1String("noglob")}, - {('p'), QLatin1String("popd")}, - {('p'), QLatin1String("printpushd")}, - {('p'), QLatin1String("pushln")}, - {('r'), QLatin1String("rehash")}, - {('s'), QLatin1String("sched")}, - {('s'), QLatin1String("setcap")}, - {('s'), QLatin1String("setopt")}, - {('s'), QLatin1String("stat")}, - {('s'), QLatin1String("suspend")}, - {('t'), QLatin1String("ttyctl")}, - {('u'), QLatin1String("unfunction")}, - {('u'), QLatin1String("unhash")}, - {('u'), QLatin1String("unlimitunsetopt")}, - {('v'), QLatin1String("vared")}, - {('w'), QLatin1String("wait")}, - {('w'), QLatin1String("whence")}, - {('w'), QLatin1String("where")}, - {('w'), QLatin1String("which")}, - {('z'), QLatin1String("zcompile")}, - {('z'), QLatin1String("zformat")}, - {('z'), QLatin1String("zftp")}, - {('z'), QLatin1String("zle")}, - {('z'), QLatin1String("zmodload")}, - {('z'), QLatin1String("zparseopts")}, - {('z'), QLatin1String("zprof")}, - {('z'), QLatin1String("zpty")}, - {('z'), QLatin1String("zregexparse")}, - {('z'), QLatin1String("zsocket")}, - {('z'), QLatin1String("zstyle")}, - {('z'), QLatin1String("ztcp")}, - {('g'), QLatin1String("git")}, - {('r'), QLatin1String("rm")}, - {('s'), QLatin1String("sudo")}, - {('f'), QLatin1String("fdisk")}, - {('a'), QLatin1String("apt")}, - {('s'), QLatin1String("snap")}, - {('f'), QLatin1String("flatpak")}, - {('s'), QLatin1String("snapcraft")}, - {('y'), QLatin1String("yaourt")}, - {('n'), QLatin1String("nmcli")}, - {('p'), QLatin1String("pacman")}, - {('p'), QLatin1String("pamac")}, - {('f'), QLatin1String("fsck")}, - {('m'), QLatin1String("mount")}, - {('m'), QLatin1String("mkdir")}, - {('m'), QLatin1String("mkswap")}, - {('s'), QLatin1String("sleep")}, - {('l'), QLatin1String("ls")}, - {('w'), QLatin1String("wget")}, - {('k'), QLatin1String("kill")}, - {('k'), QLatin1String("killall")}, - {('g'), QLatin1String("gdb")}, - {('Q'), QLatin1String("QOwnNotes")}, - {('q'), QLatin1String("qownnotes")}, - {('d'), QLatin1String("docker")}, - {('o'), QLatin1String("openssl")}, - {('p'), QLatin1String("php")}, - {('p'), QLatin1String("python")}, - {('p'), QLatin1String("perl")}, - {('g'), QLatin1String("go")}, - {('c'), QLatin1String("curl")}}; - - shell_other = {}; -} - -void loadShellData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other) -{ - if (!shellDataInitialized) - { - initShellData(); - shellDataInitialized = true; - } - types = shell_types; - keywords = shell_keywords; - builtin = shell_builtin; - literals = shell_literals; - other = shell_other; -} - -/**********************************************************/ -/* JS Data *********************************************/ -/**********************************************************/ -static bool JSDataInitialized = false; -static LanguageData js_keywords; -static LanguageData js_types; -static LanguageData js_literals; -static LanguageData js_builtin; -static LanguageData js_other; -void initJSData() -{ - js_keywords = { - {('i'), QLatin1String("in")}, {('o'), QLatin1String("of")}, - {('i'), QLatin1String("if")}, {('f'), QLatin1String("for")}, - {('w'), QLatin1String("while")}, {('f'), QLatin1String("finally")}, - {('n'), QLatin1String("new")}, {('f'), QLatin1String("function")}, - {('d'), QLatin1String("do")}, {('r'), QLatin1String("return")}, - {('v'), QLatin1String("void")}, {('e'), QLatin1String("else")}, - {('b'), QLatin1String("break")}, {('c'), QLatin1String("catch")}, - {('i'), QLatin1String("instanceof")}, {('w'), QLatin1String("with")}, - {('t'), QLatin1String("throw")}, {('c'), QLatin1String("case")}, - {('d'), QLatin1String("default")}, {('t'), QLatin1String("try")}, - {('t'), QLatin1String("this")}, {('s'), QLatin1String("switch")}, - {('c'), QLatin1String("continue")}, {('t'), QLatin1String("typeof")}, - {('d'), QLatin1String("delete")}, {('l'), QLatin1String("let")}, - {('y'), QLatin1String("yield")}, {('c'), QLatin1String("const")}, - {('e'), QLatin1String("export")}, {('s'), QLatin1String("super")}, - {('d'), QLatin1String("debugger")}, {('a'), QLatin1String("as")}, - {('a'), QLatin1String("async")}, {('a'), QLatin1String("await")}, - {('s'), QLatin1String("static")}, {('i'), QLatin1String("import")}, - {('f'), QLatin1String("from")}, {('a'), QLatin1String("as")}}; - - js_types - = {{('v'), QLatin1String("var")}, {('c'), QLatin1String("class")}, - {('b'), QLatin1String("byte")}, {('e'), QLatin1String("enum")}, - {('f'), QLatin1String("float")}, {('s'), QLatin1String("short")}, - {('l'), QLatin1String("long")}, {('i'), QLatin1String("int")}, - {('v'), QLatin1String("void")}, {('b'), QLatin1String("boolean")}, - {('d'), QLatin1String("double")}}; - - js_literals - = {{('f'), QLatin1String("false")}, {('n'), QLatin1String("null")}, - {('t'), QLatin1String("true")}, {('u'), QLatin1String("undefined")}, - {('N'), QLatin1String("NaN")}, {('I'), QLatin1String("Infinity")}}; - - js_builtin = {{('e'), QLatin1String("eval")}, - {('i'), QLatin1String("isFinite")}, - {('i'), QLatin1String("isNaN")}, - {('p'), QLatin1String("parseFloat")}, - {('p'), QLatin1String("parseInt")}, - {('d'), QLatin1String("decodeURI")}, - {('d'), QLatin1String("decodeURIComponent")}, - {('e'), QLatin1String("encodeURI")}, - {('e'), QLatin1String("encodeURIComponent")}, - {('e'), QLatin1String("escape")}, - {('u'), QLatin1String("unescape")}, - {('O'), QLatin1String("Object")}, - {('F'), QLatin1String("Function")}, - {('B'), QLatin1String("Boolean")}, - {('E'), QLatin1String("Error")}, - {('E'), QLatin1String("EvalError")}, - {('I'), QLatin1String("InternalError")}, - {('R'), QLatin1String("RangeError")}, - {('R'), QLatin1String("ReferenceError")}, - {('S'), QLatin1String("StopIteration")}, - {('S'), QLatin1String("SyntaxError")}, - {('T'), QLatin1String("TypeError")}, - {('U'), QLatin1String("URIError")}, - {('N'), QLatin1String("Number")}, - {('M'), QLatin1String("Math")}, - {('D'), QLatin1String("Date")}, - {('S'), QLatin1String("String")}, - {('R'), QLatin1String("RegExp")}, - {('A'), QLatin1String("Array")}, - {('F'), QLatin1String("Float32Array")}, - {('F'), QLatin1String("Float64Array")}, - {('I'), QLatin1String("Int16Array")}, - {('I'), QLatin1String("Int32Array")}, - {('I'), QLatin1String("Int8Array")}, - {('U'), QLatin1String("Uint16Array")}, - {('U'), QLatin1String("Uint32Array")}, - {('U'), QLatin1String("Uint8Array")}, - {('U'), QLatin1String("Uint8ClampedArray")}, - {('A'), QLatin1String("ArrayBuffer")}, - {('D'), QLatin1String("DataView")}, - {('J'), QLatin1String("JSON")}, - {('I'), QLatin1String("Intl")}, - {('a'), QLatin1String("arguments")}, - {('r'), QLatin1String("require")}, - {('m'), QLatin1String("module")}, - {('c'), QLatin1String("console")}, - {('w'), QLatin1String("window")}, - {('d'), QLatin1String("document")}, - {('S'), QLatin1String("Symbol")}, - {('S'), QLatin1String("Set")}, - {('M'), QLatin1String("Map")}, - {('W'), QLatin1String("WeakSet")}, - {('W'), QLatin1String("WeakMap")}, - {('P'), QLatin1String("Proxy")}, - {('R'), QLatin1String("Reflect")}, - {('P'), QLatin1String("Promise")}}; - - js_other = {}; -} - -void loadJSData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other) -{ - if (!JSDataInitialized) - { - initJSData(); - JSDataInitialized = true; - } - types = js_types; - keywords = js_keywords; - builtin = js_builtin; - literals = js_literals; - other = js_other; -} - -/**********************************************************/ -/* PHP Data *********************************************/ -/**********************************************************/ -static bool PHPDataInitialized = false; -static LanguageData php_keywords; -static LanguageData php_types; -static LanguageData php_literals; -static LanguageData php_builtin; -static LanguageData php_other; -void initPHPData() -{ - php_keywords = {{('a'), QLatin1String("and")}, - {('l'), QLatin1String("list")}, - {('a'), QLatin1String("abstract")}, - {('g'), QLatin1String("global")}, - {('p'), QLatin1String("private")}, - {('e'), QLatin1String("echo")}, - {('i'), QLatin1String("interface")}, - {('a'), QLatin1String("as")}, - {('s'), QLatin1String("static")}, - {('e'), QLatin1String("endswitch")}, - {('i'), QLatin1String("if")}, - {('e'), QLatin1String("endwhile")}, - {('o'), QLatin1String("or")}, - {('c'), QLatin1String("const")}, - {('f'), QLatin1String("for")}, - {('e'), QLatin1String("endforeach")}, - {('s'), QLatin1String("self")}, - {('w'), QLatin1String("while")}, - {('i'), QLatin1String("isset")}, - {('p'), QLatin1String("public")}, - {('p'), QLatin1String("protected")}, - {('e'), QLatin1String("exit")}, - {('f'), QLatin1String("foreach")}, - {('t'), QLatin1String("throw")}, - {('e'), QLatin1String("elseif")}, - {('e'), QLatin1String("empty")}, - {('d'), QLatin1String("do")}, - {('x'), QLatin1String("xor")}, - {('r'), QLatin1String("return")}, - {('p'), QLatin1String("parent")}, - {('c'), QLatin1String("clone")}, - {('u'), QLatin1String("use")}, - {('e'), QLatin1String("else")}, - {('b'), QLatin1String("break")}, - {('p'), QLatin1String("print")}, - {('e'), QLatin1String("eval")}, - {('n'), QLatin1String("new")}, - {('c'), QLatin1String("catch")}, - {('c'), QLatin1String("case")}, - {('e'), QLatin1String("exception")}, - {('d'), QLatin1String("default")}, - {('d'), QLatin1String("die")}, - {('e'), QLatin1String("enddeclare")}, - {('f'), QLatin1String("final")}, - {('t'), QLatin1String("try")}, - {('s'), QLatin1String("switch")}, - {('c'), QLatin1String("continue")}, - {('e'), QLatin1String("endfor")}, - {('e'), QLatin1String("endif")}, - {('d'), QLatin1String("declare")}, - {('u'), QLatin1String("unset")}, - {('t'), QLatin1String("trait")}, - {('g'), QLatin1String("goto")}, - {('i'), QLatin1String("instanceof")}, - {('i'), QLatin1String("insteadof")}, - {('y'), QLatin1String("yield")}, - {('f'), QLatin1String("finally")}}; - - php_types = {{('v'), QLatin1String("var")}, - {('c'), QLatin1String("class")}, - {('e'), QLatin1String("enum")}, - {('a'), QLatin1String("array")}}; - - php_literals = {{('f'), QLatin1String("false")}, - {('t'), QLatin1String("true")}, - {('n'), QLatin1String("null")}}; - - php_builtin = { - - }; - - php_other = {{('i'), QLatin1String("include_once")}, - {('i'), QLatin1String("include")}, - {('_'), QLatin1String("__FILE__")}, - {('r'), QLatin1String("require")}, - {('r'), QLatin1String("require_once")}, - {('_'), QLatin1String("__CLASS__")}, - {('_'), QLatin1String("__LINE__")}, - {('_'), QLatin1String("__METHOD__")}, - {('_'), QLatin1String("__FUNCTION__")}, - {('_'), QLatin1String("__DIR__")}, - {('_'), QLatin1String("__NAMESPACE__")}, - - {('S'), QLatin1String("SERVER")}, - {('G'), QLatin1String("GET")}, - {('P'), QLatin1String("POST")}, - {('F'), QLatin1String("FILES")}, - {('R'), QLatin1String("REQUEST")}, - {('S'), QLatin1String("SESSION")}, - {('E'), QLatin1String("ENV")}, - {('C'), QLatin1String("COOKIE")}, - {('G'), QLatin1String("GLOBALS")}, - {('H'), QLatin1String("HTTP_RAW_POST_DATA")}, - {('a'), QLatin1String("argc")}, - {('a'), QLatin1String("argv")}, - {('p'), QLatin1String("php_errormsg")}, - {('h'), QLatin1String("http_response_header")}}; -} -void loadPHPData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other) -{ - if (!PHPDataInitialized) - { - initPHPData(); - PHPDataInitialized = true; - } - types = php_types; - keywords = php_keywords; - builtin = php_builtin; - literals = php_literals; - other = php_other; -} - -/**********************************************************/ -/* QML Data *********************************************/ -/**********************************************************/ -static bool QMLDataInitialized = false; -static LanguageData qml_keywords; -static LanguageData qml_types; -static LanguageData qml_literals; -static LanguageData qml_builtin; -static LanguageData qml_other; - -void initQMLData() -{ - qml_keywords = {{('d'), QLatin1String("default")}, - {('p'), QLatin1String("property")}, - {('i'), QLatin1String("int")}, - {('v'), QLatin1String("var")}, - {('s'), QLatin1String("string")}, - {('f'), QLatin1String("function")}, - {('r'), QLatin1String("readonly")}, - {('M'), QLatin1String("MouseArea")}, - {('d'), QLatin1String("delegate")}, - {('i'), QLatin1String("if")}, - {('e'), QLatin1String("else")}, - - {('e'), QLatin1String("eval")}, - {('i'), QLatin1String("isFinite")}, - {('i'), QLatin1String("isNaN")}, - {('p'), QLatin1String("parseFloat")}, - {('p'), QLatin1String("parseInt")}, - {('d'), QLatin1String("decodeURI")}, - {('d'), QLatin1String("decodeURIComponent")}, - {('e'), QLatin1String("encodeURI")}, - {('e'), QLatin1String("encodeURIComponent")}, - {('e'), QLatin1String("escape")}, - {('u'), QLatin1String("unescape")}, - {('O'), QLatin1String("Object")}, - {('E'), QLatin1String("Error")}, - {('E'), QLatin1String("EvalError")}, - {('I'), QLatin1String("InternalError")}, - {('R'), QLatin1String("RangeError")}, - {('R'), QLatin1String("ReferenceError")}, - {('S'), QLatin1String("StopIteration")}, - {('S'), QLatin1String("SyntaxError")}, - {('T'), QLatin1String("TypeError")}, - {('U'), QLatin1String("URIError")}, - {('N'), QLatin1String("Number")}, - {('M'), QLatin1String("Math")}, - {('D'), QLatin1String("Date")}, - {('S'), QLatin1String("String")}, - {('R'), QLatin1String("RegExp")}, - {('A'), QLatin1String("Array")}, - {('F'), QLatin1String("Float32Array")}, - {('F'), QLatin1String("Float64Array")}, - {('I'), QLatin1String("Int16Array")}, - {('I'), QLatin1String("Int32Array")}, - {('I'), QLatin1String("Int8Array")}, - {('U'), QLatin1String("Uint16Array")}, - {('U'), QLatin1String("Uint32Array")}, - {('U'), QLatin1String("Uint8Array")}, - {('U'), QLatin1String("Uint8ClampedArray")}, - {('A'), QLatin1String("ArrayBuffer")}, - {('D'), QLatin1String("DataView")}, - {('J'), QLatin1String("JSON")}, - {('I'), QLatin1String("Intl")}, - {('a'), QLatin1String("arguments")}, - {('m'), QLatin1String("module")}, - {('c'), QLatin1String("console")}, - {('w'), QLatin1String("window")}, - {('d'), QLatin1String("document")}, - {('S'), QLatin1String("Symbol")}, - {('S'), QLatin1String("Set")}, - {('M'), QLatin1String("Map")}, - {('W'), QLatin1String("WeakSet")}, - {('W'), QLatin1String("WeakMap")}, - {('P'), QLatin1String("Proxy")}, - {('R'), QLatin1String("Reflect")}, - {('B'), QLatin1String("Behavior")}, - {('c'), QLatin1String("color")}, - {('c'), QLatin1String("coordinate")}, - {('d'), QLatin1String("date")}, - {('e'), QLatin1String("enumeration")}, - {('f'), QLatin1String("font")}, - {('g'), QLatin1String("geocircle")}, - {('g'), QLatin1String("georectangle")}, - {('g'), QLatin1String("geoshape")}, - {('l'), QLatin1String("list")}, - {('m'), QLatin1String("matrix4x4")}, - {('p'), QLatin1String("parent")}, - {('p'), QLatin1String("point")}, - {('q'), QLatin1String("quaternion")}, - {('r'), QLatin1String("real")}, - {('s'), QLatin1String("size")}, - {('s'), QLatin1String("string")}, - {('v'), QLatin1String("variant")}, - {('v'), QLatin1String("vector2d")}, - {('v'), QLatin1String("vector3d")}, - {('v'), QLatin1String("vector4d")}, - {('P'), QLatin1String("Promise")}}; - - qml_types = { - {('R'), QLatin1String("Rectangle")}, {('T'), QLatin1String("Text")}, - {('c'), QLatin1String("color")}, {('I'), QLatin1String("Item")}, - {('u'), QLatin1String("url")}, {('C'), QLatin1String("Component")}, - {('B'), QLatin1String("Button")}, {('T'), QLatin1String("TextInput")}, - {('L'), QLatin1String("ListView")}, - - }; - - qml_literals - = {{('f'), QLatin1String("false")}, {('t'), QLatin1String("true")}}; - - qml_builtin = { - - }; - - qml_other = {{('i'), QLatin1String("import")}}; -} -void loadQMLData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other) -{ - if (!QMLDataInitialized) - { - initQMLData(); - QMLDataInitialized = true; - } - types = qml_types; - keywords = qml_keywords; - builtin = qml_builtin; - literals = qml_literals; - other = qml_other; -} - -/**********************************************************/ -/* Python Data *********************************************/ -/**********************************************************/ -static bool PyDataInitialized = false; -static LanguageData py_keywords; -static LanguageData py_types; -static LanguageData py_literals; -static LanguageData py_builtin; -static LanguageData py_other; - -void initPyData() -{ - py_keywords = { - {('a'), QLatin1String("and")}, {('e'), QLatin1String("elif")}, - {('i'), QLatin1String("is")}, {('g'), QLatin1String("global")}, - {('a'), QLatin1String("as")}, {('i'), QLatin1String("in")}, - {('i'), QLatin1String("if")}, {('f'), QLatin1String("from")}, - {('r'), QLatin1String("raise")}, {('f'), QLatin1String("for")}, - {('e'), QLatin1String("except")}, {('f'), QLatin1String("finally")}, - {('p'), QLatin1String("print")}, {('p'), QLatin1String("pass")}, - {('r'), QLatin1String("return")}, {('e'), QLatin1String("exec")}, - {('e'), QLatin1String("else")}, {('b'), QLatin1String("break")}, - {('n'), QLatin1String("not")}, {('w'), QLatin1String("with")}, - {('c'), QLatin1String("class")}, {('a'), QLatin1String("assert")}, - {('y'), QLatin1String("yield")}, {('t'), QLatin1String("try")}, - {('w'), QLatin1String("while")}, {('c'), QLatin1String("continue")}, - {('d'), QLatin1String("del")}, {('o'), QLatin1String("or")}, - {('d'), QLatin1String("def")}, {('l'), QLatin1String("lambda")}, - {('a'), QLatin1String("async")}, {('a'), QLatin1String("await")}, - {('n'), QLatin1String("nonlocal")}, - }; - - py_types = { - - }; - - py_literals = {{('F'), QLatin1String("False")}, - {('T'), QLatin1String("True")}, - {('N'), QLatin1String("None")}}; - - py_builtin = {{('_'), QLatin1String("__import__")}, - {('a'), QLatin1String("abs")}, - {('a'), QLatin1String("all")}, - {('a'), QLatin1String("any")}, - {('a'), QLatin1String("apply")}, - {('a'), QLatin1String("ascii")}, - {('b'), QLatin1String("basestring")}, - {('b'), QLatin1String("bin")}, - {('b'), QLatin1String("bool")}, - {('b'), QLatin1String("buffer")}, - {('b'), QLatin1String("bytearray")}, - {('b'), QLatin1String("bytes")}, - {('c'), QLatin1String("callable")}, - {('c'), QLatin1String("chr")}, - {('c'), QLatin1String("classmethod")}, - {('c'), QLatin1String("cmp")}, - {('c'), QLatin1String("coerce")}, - {('c'), QLatin1String("compile")}, - {('c'), QLatin1String("complex")}, - {('d'), QLatin1String("delattr")}, - {('d'), QLatin1String("dict")}, - {('d'), QLatin1String("dir")}, - {('d'), QLatin1String("divmod")}, - {('e'), QLatin1String("enumerate")}, - {('e'), QLatin1String("eval")}, - {('e'), QLatin1String("execfile")}, - {('f'), QLatin1String("file")}, - {('f'), QLatin1String("filter")}, - {('f'), QLatin1String("float")}, - {('f'), QLatin1String("format")}, - {('f'), QLatin1String("frozenset")}, - {('g'), QLatin1String("getattr")}, - {('g'), QLatin1String("globals")}, - {('h'), QLatin1String("hasattr")}, - {('h'), QLatin1String("hash")}, - {('h'), QLatin1String("help")}, - {('h'), QLatin1String("hex")}, - {('i'), QLatin1String("id")}, - {('i'), QLatin1String("input")}, - {('i'), QLatin1String("int")}, - {('i'), QLatin1String("intern")}, - {('i'), QLatin1String("isinstance")}, - {('i'), QLatin1String("issubclass")}, - {('i'), QLatin1String("iter")}, - {('l'), QLatin1String("len")}, - {('l'), QLatin1String("list")}, - {('l'), QLatin1String("locals")}, - {('l'), QLatin1String("long")}, - {('m'), QLatin1String("map")}, - {('m'), QLatin1String("max")}, - {('m'), QLatin1String("memoryview")}, - {('m'), QLatin1String("min")}, - {('n'), QLatin1String("next")}, - {('o'), QLatin1String("object")}, - {('o'), QLatin1String("oct")}, - {('o'), QLatin1String("open")}, - {('o'), QLatin1String("ord")}, - {('p'), QLatin1String("pow")}, - {('p'), QLatin1String("property")}, - {('r'), QLatin1String("range")}, - {('r'), QLatin1String("raw_input")}, - {('r'), QLatin1String("reduce")}, - {('r'), QLatin1String("reload")}, - {('r'), QLatin1String("repr")}, - {('r'), QLatin1String("reversed")}, - {('r'), QLatin1String("round")}, - {('s'), QLatin1String("set")}, - {('s'), QLatin1String("setattr")}, - {('s'), QLatin1String("slice")}, - {('s'), QLatin1String("sorted")}, - {('s'), QLatin1String("staticmethod")}, - {('s'), QLatin1String("str")}, - {('s'), QLatin1String("sum")}, - {('s'), QLatin1String("super")}, - {('t'), QLatin1String("tuple")}, - {('t'), QLatin1String("type")}, - {('u'), QLatin1String("unichr")}, - {('u'), QLatin1String("unicode")}, - {('v'), QLatin1String("vars")}, - {('x'), QLatin1String("xrange")}, - {('z'), QLatin1String("zip")}}; - - py_other = {{('i'), QLatin1String("import")}}; -} -void loadPythonData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other) -{ - if (!PyDataInitialized) - { - initPyData(); - PyDataInitialized = true; - } - types = py_types; - keywords = py_keywords; - builtin = py_builtin; - literals = py_literals; - other = py_other; -} - -/********************************************************/ -/*** Rust DATA ***********************************/ -/********************************************************/ -static bool rustDataInitialized = false; -static LanguageData rust_keywords; -static LanguageData rust_types; -static LanguageData rust_literals; -static LanguageData rust_builtin; -static LanguageData rust_other; -void initRustData() -{ - rust_keywords = { - {('a'), QLatin1String("abstract")}, {('a'), QLatin1String("alignof")}, - {('a'), QLatin1String("as")}, {('a'), QLatin1String("async")}, - {('a'), QLatin1String("await")}, {('b'), QLatin1String("be")}, - {('b'), QLatin1String("box")}, {('b'), QLatin1String("break")}, - {('c'), QLatin1String("const")}, {('c'), QLatin1String("continue")}, - {('c'), QLatin1String("crate")}, {('d'), QLatin1String("do")}, - {('d'), QLatin1String("dyn")}, {('e'), QLatin1String("else")}, - {('e'), QLatin1String("extern")}, {('f'), QLatin1String("final")}, - {('f'), QLatin1String("fn")}, {('f'), QLatin1String("for")}, - {('i'), QLatin1String("if")}, {('i'), QLatin1String("impl")}, - {('i'), QLatin1String("in")}, {('l'), QLatin1String("let")}, - {('l'), QLatin1String("loop")}, {('m'), QLatin1String("match")}, - {('m'), QLatin1String("mod")}, {('m'), QLatin1String("move")}, - {('m'), QLatin1String("mut")}, {('o'), QLatin1String("offsetof")}, - {('o'), QLatin1String("once")}, {('o'), QLatin1String("override")}, - {('p'), QLatin1String("priv")}, {('p'), QLatin1String("pub")}, - {('p'), QLatin1String("pure")}, {('r'), QLatin1String("ref")}, - {('r'), QLatin1String("return")}, {('s'), QLatin1String("sizeof")}, - {('s'), QLatin1String("static")}, {('s'), QLatin1String("self")}, - {('S'), QLatin1String("Self")}, {('s'), QLatin1String("super")}, - {('t'), QLatin1String("trait")}, {('t'), QLatin1String("type")}, - {('t'), QLatin1String("typeof")}, {('u'), QLatin1String("unsafe")}, - {('u'), QLatin1String("unsized")}, {('u'), QLatin1String("use")}, - {('v'), QLatin1String("virtual")}, {('w'), QLatin1String("where")}, - {('w'), QLatin1String("while")}, {('y'), QLatin1String("yield")}, - }; - - rust_types - = {{('u'), QLatin1String("union")}, {('e'), QLatin1String("enum")}, - {('s'), QLatin1String("struct")}, - - {('i'), QLatin1String("i8")}, {('i'), QLatin1String("i16")}, - {('i'), QLatin1String("i32")}, {('i'), QLatin1String("i64")}, - {('i'), QLatin1String("i128")}, {('i'), QLatin1String("isize")}, - {('u'), QLatin1String("u8")}, {('u'), QLatin1String("u16")}, - {('u'), QLatin1String("u32")}, {('u'), QLatin1String("u64")}, - {('u'), QLatin1String("u128")}, {('u'), QLatin1String("usize")}, - {('f'), QLatin1String("f32")}, {('f'), QLatin1String("f64")}, - {('s'), QLatin1String("str")}, {('c'), QLatin1String("char")}, - {('b'), QLatin1String("bool")}, {('B'), QLatin1String("Box")}, - {('O'), QLatin1String("Option")}, {('R'), QLatin1String("Result")}, - {('S'), QLatin1String("String")}, {('V'), QLatin1String("Vec")}}; - - rust_literals - = {{('f'), QLatin1String("false")}, {('t'), QLatin1String("true")}}; - - rust_builtin = { - - }; - - rust_other = {{('a'), QLatin1String("assert!")}, - {('a'), QLatin1String("assert_eq!")}, - {('b'), QLatin1String("bitflags!")}, - {('b'), QLatin1String("bytes!")}, - {('c'), QLatin1String("cfg!")}, - {('c'), QLatin1String("col!")}, - {('c'), QLatin1String("concat!")}, - {('c'), QLatin1String("concat_idents!")}, - {('d'), QLatin1String("debug_assert!")}, - {('d'), QLatin1String("debug_assert_eq!")}, - {('e'), QLatin1String("env!")}, - {('p'), QLatin1String("panic!")}, - {('f'), QLatin1String("file!")}, - {('f'), QLatin1String("format!")}, - {('f'), QLatin1String("format_args!")}, - {('i'), QLatin1String("include_bin!")}, - {('i'), QLatin1String("include_str!")}, - {('l'), QLatin1String("line!")}, - {('l'), QLatin1String("local_data_key!")}, - {('m'), QLatin1String("module_path!")}, - {('o'), QLatin1String("option_env!")}, - {('p'), QLatin1String("print!")}, - {('p'), QLatin1String("println!")}, - {('s'), QLatin1String("select!")}, - {('s'), QLatin1String("stringify!")}, - {('t'), QLatin1String("try!")}, - {('u'), QLatin1String("unimplemented!")}, - {('u'), QLatin1String("unreachable!")}, - {('v'), QLatin1String("vec!")}, - {('w'), QLatin1String("write!")}, - {('w'), QLatin1String("writeln!")}, - {('m'), QLatin1String("macro_rules!")}, - {('a'), QLatin1String("assert_ne!")}, - {('d'), QLatin1String("debug_assert_ne!")}}; -} -void loadRustData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other) -{ - if (!rustDataInitialized) - { - initRustData(); - rustDataInitialized = true; - } - types = rust_types; - keywords = rust_keywords; - builtin = rust_builtin; - literals = rust_literals; - other = rust_other; -} - -/********************************************************/ -/*** Java DATA ***********************************/ -/********************************************************/ -static bool javaDataInitialized = false; -static LanguageData java_keywords; -static LanguageData java_types; -static LanguageData java_literals; -static LanguageData java_builtin; -static LanguageData java_other; -void initJavaData() -{ - java_keywords = {{('a'), QLatin1String("abstract")}, - {('a'), QLatin1String("assert")}, - {('b'), QLatin1String("break")}, - {('c'), QLatin1String("case")}, - {('c'), QLatin1String("catch")}, - {('c'), QLatin1String("const")}, - {('c'), QLatin1String("continue")}, - {('d'), QLatin1String("default")}, - {('d'), QLatin1String("do")}, - {('e'), QLatin1String("else")}, - {('e'), QLatin1String("exports")}, - {('e'), QLatin1String("extends")}, - {('f'), QLatin1String("final")}, - {('f'), QLatin1String("finally")}, - {('f'), QLatin1String("for")}, - {('g'), QLatin1String("goto")}, - {('i'), QLatin1String("if")}, - {('i'), QLatin1String("implements")}, - {('i'), QLatin1String("import")}, - {('i'), QLatin1String("instanceof")}, - {('i'), QLatin1String("interface")}, - {('l'), QLatin1String("long")}, - {('m'), QLatin1String("module")}, - {('n'), QLatin1String("native")}, - {('n'), QLatin1String("new")}, - {('n'), QLatin1String("null")}, - {('o'), QLatin1String("open")}, - {('o'), QLatin1String("opens")}, - {('p'), QLatin1String("package")}, - {('p'), QLatin1String("private")}, - {('p'), QLatin1String("protected")}, - {('p'), QLatin1String("provides")}, - {('p'), QLatin1String("public")}, - {('r'), QLatin1String("requires")}, - {('r'), QLatin1String("return")}, - {('s'), QLatin1String("static")}, - {('s'), QLatin1String("strictfp")}, - {('s'), QLatin1String("super")}, - {('s'), QLatin1String("switch")}, - {('s'), QLatin1String("synchronized")}, - {('t'), QLatin1String("this")}, - {('t'), QLatin1String("throw")}, - {('t'), QLatin1String("throws")}, - {('t'), QLatin1String("to")}, - {('t'), QLatin1String("transient")}, - {('t'), QLatin1String("transitive")}, - {('t'), QLatin1String("try")}, - {('u'), QLatin1String("uses")}, - {('v'), QLatin1String("var")}, - {('v'), QLatin1String("volatile")}, - {('w'), QLatin1String("while")}, - {('w'), QLatin1String("with")}, - {('y'), QLatin1String("yield")}}; - - java_types = { - {('v'), QLatin1String("void")}, {('f'), QLatin1String("float")}, - {('b'), QLatin1String("boolean")}, {('b'), QLatin1String("byte")}, - {('i'), QLatin1String("int")}, {('c'), QLatin1String("char")}, - {('c'), QLatin1String("class")}, {('d'), QLatin1String("double")}, - {('e'), QLatin1String("enum")}, {('s'), QLatin1String("short")}, - - }; - - java_literals - = {{('f'), QLatin1String("false")}, {('t'), QLatin1String("true")}}; - - java_builtin = { - - }; - - java_other = { - - }; -} -void loadJavaData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other) -{ - if (!javaDataInitialized) - { - initJavaData(); - javaDataInitialized = true; - } - types = java_types; - keywords = java_keywords; - builtin = java_builtin; - literals = java_literals; - other = java_other; -} - -/********************************************************/ -/*** C# DATA *************************************/ -/********************************************************/ -static bool csharpDataInitialized = false; -static LanguageData csharp_keywords; -static LanguageData csharp_types; -static LanguageData csharp_literals; -static LanguageData csharp_builtin; -static LanguageData csharp_other; -void initCSharpData() -{ - csharp_keywords = {{('a'), QLatin1String("abstract")}, - {('a'), QLatin1String("add")}, - {('a'), QLatin1String("alias")}, - {('a'), QLatin1String("as")}, - {('a'), QLatin1String("ascending")}, - {('a'), QLatin1String("async")}, - {('a'), QLatin1String("await")}, - {('b'), QLatin1String("base")}, - {('b'), QLatin1String("break")}, - {('c'), QLatin1String("case")}, - {('c'), QLatin1String("catch")}, - {('c'), QLatin1String("checked")}, - {('c'), QLatin1String("const")}, - {('c'), QLatin1String("continue")}, - {('d'), QLatin1String("decimal")}, - {('d'), QLatin1String("default")}, - {('d'), QLatin1String("delegate")}, - {('d'), QLatin1String("descending")}, - {('d'), QLatin1String("do")}, - {('d'), QLatin1String("dynamic")}, - {('e'), QLatin1String("else")}, - {('e'), QLatin1String("event")}, - {('e'), QLatin1String("explicit")}, - {('e'), QLatin1String("extern")}, - {('f'), QLatin1String("finally")}, - {('f'), QLatin1String("fixed")}, - {('f'), QLatin1String("for")}, - {('f'), QLatin1String("foreach")}, - {('f'), QLatin1String("from")}, - {('g'), QLatin1String("get")}, - {('g'), QLatin1String("global")}, - {('g'), QLatin1String("goto")}, - {('g'), QLatin1String("group")}, - {('i'), QLatin1String("if")}, - {('i'), QLatin1String("implicit")}, - {('i'), QLatin1String("in")}, - {('i'), QLatin1String("interface")}, - {('i'), QLatin1String("internal")}, - {('i'), QLatin1String("into")}, - {('i'), QLatin1String("is")}, - {('j'), QLatin1String("join")}, - {('l'), QLatin1String("let")}, - {('l'), QLatin1String("lock")}, - {('l'), QLatin1String("long")}, - {('n'), QLatin1String("namespace")}, - {('n'), QLatin1String("new")}, - {('o'), QLatin1String("object")}, - {('o'), QLatin1String("operator")}, - {('o'), QLatin1String("orderby")}, - {('o'), QLatin1String("out")}, - {('o'), QLatin1String("override")}, - {('p'), QLatin1String("params")}, - {('p'), QLatin1String("partial")}, - {('p'), QLatin1String("private")}, - {('p'), QLatin1String("protected")}, - {('p'), QLatin1String("public")}, - {('r'), QLatin1String("readonly")}, - {('r'), QLatin1String("ref")}, - {('r'), QLatin1String("remove")}, - {('r'), QLatin1String("return")}, - {('s'), QLatin1String("sealed")}, - {('s'), QLatin1String("select")}, - {('s'), QLatin1String("set")}, - {('s'), QLatin1String("sizeof")}, - {('s'), QLatin1String("stackalloc")}, - {('s'), QLatin1String("static")}, - {('s'), QLatin1String("switch")}, - {('t'), QLatin1String("this")}, - {('t'), QLatin1String("throw")}, - {('t'), QLatin1String("try")}, - {('t'), QLatin1String("typeof")}, - {('u'), QLatin1String("unchecked")}, - {('u'), QLatin1String("unsafe")}, - {('u'), QLatin1String("using")}, - {('v'), QLatin1String("value")}, - {('v'), QLatin1String("virtual")}, - {('v'), QLatin1String("volatile")}, - {('w'), QLatin1String("where")}, - {('w'), QLatin1String("while")}, - {('y'), QLatin1String("yield")}}; - - csharp_types = { - {('b'), QLatin1String("bool")}, {('b'), QLatin1String("byte")}, - {('c'), QLatin1String("char")}, {('c'), QLatin1String("class")}, - {('d'), QLatin1String("double")}, {('e'), QLatin1String("enum")}, - {('f'), QLatin1String("float")}, {('i'), QLatin1String("int")}, - {('s'), QLatin1String("sbyte")}, {('s'), QLatin1String("short")}, - {('s'), QLatin1String("string")}, {('s'), QLatin1String("struct")}, - {('u'), QLatin1String("uint")}, {('u'), QLatin1String("ulong")}, - {('u'), QLatin1String("ushort")}, {('v'), QLatin1String("var")}, - {('v'), QLatin1String("void")}, - }; - - csharp_literals = {{('f'), QLatin1String("false")}, - {('t'), QLatin1String("true")}, - {('n'), QLatin1String("null")}}; - - csharp_builtin = { - - }; - - csharp_other = { - {('d'), QLatin1String("define")}, {('e'), QLatin1String("elif")}, - {('e'), QLatin1String("else")}, {('e'), QLatin1String("endif")}, - {('e'), QLatin1String("endregion")}, {('e'), QLatin1String("error")}, - {('i'), QLatin1String("if")}, {('l'), QLatin1String("line")}, - {('p'), QLatin1String("pragma")}, {('r'), QLatin1String("region")}, - {('u'), QLatin1String("undef")}, {('w'), QLatin1String("warning")}}; -} -void loadCSharpData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other) -{ - if (!csharpDataInitialized) - { - initCSharpData(); - csharpDataInitialized = true; - } - types = csharp_types; - keywords = csharp_keywords; - builtin = csharp_builtin; - literals = csharp_literals; - other = csharp_other; -} - -/********************************************************/ -/*** Go DATA *************************************/ -/********************************************************/ -static bool goDataInitialized = false; -static LanguageData go_keywords; -static LanguageData go_types; -static LanguageData go_literals; -static LanguageData go_builtin; -static LanguageData go_other; -void initGoData() -{ - go_keywords = { - {('b'), QLatin1String("break")}, - {('c'), QLatin1String("case")}, - {('c'), QLatin1String("chan")}, - {('c'), QLatin1String("const")}, - {('c'), QLatin1String("continue")}, - {('d'), QLatin1String("default")}, - {('d'), QLatin1String("defer")}, - {('e'), QLatin1String("else")}, - {('f'), QLatin1String("fallthrough")}, - {('f'), QLatin1String("for")}, - {('f'), QLatin1String("func")}, - {('g'), QLatin1String("go")}, - {('t'), QLatin1String("to")}, - {('i'), QLatin1String("if")}, - {('i'), QLatin1String("import")}, - {('i'), QLatin1String("interface")}, - {('p'), QLatin1String("package")}, - {('r'), QLatin1String("range")}, - {('r'), QLatin1String("return")}, - {('s'), QLatin1String("select")}, - {('s'), QLatin1String("struct")}, - {('s'), QLatin1String("switch")}, - {('t'), QLatin1String("type")}, - }; - - go_types = { - {('m'), QLatin1String("map")}, {('s'), QLatin1String("struct")}, - {('v'), QLatin1String("var")}, {('b'), QLatin1String("bool")}, - {('b'), QLatin1String("byte")}, {('c'), QLatin1String("complex64")}, - {('c'), QLatin1String("complex128")}, {('f'), QLatin1String("float32")}, - {('f'), QLatin1String("float64")}, {('i'), QLatin1String("int8")}, - {('i'), QLatin1String("int16")}, {('i'), QLatin1String("int32")}, - {('i'), QLatin1String("int64")}, {('s'), QLatin1String("string")}, - {('u'), QLatin1String("uint8")}, {('u'), QLatin1String("uint16")}, - {('u'), QLatin1String("uint32")}, {('u'), QLatin1String("uint64")}, - {('i'), QLatin1String("int")}, {('u'), QLatin1String("uint")}, - {('u'), QLatin1String("uintptr")}, {('r'), QLatin1String("rune")}}; - - go_literals = {{('f'), QLatin1String("false")}, - {('t'), QLatin1String("true")}, - {('n'), QLatin1String("nil")}, - {('i'), QLatin1String("iota")}}; - - go_builtin - = {{('a'), QLatin1String("append")}, {('c'), QLatin1String("cap")}, - {('c'), QLatin1String("close")}, {('c'), QLatin1String("complex")}, - {('c'), QLatin1String("copy")}, {('i'), QLatin1String("imag")}, - {('l'), QLatin1String("len")}, {('m'), QLatin1String("make")}, - {('n'), QLatin1String("new")}, {('p'), QLatin1String("panic")}, - {('p'), QLatin1String("print")}, {('p'), QLatin1String("println")}, - {('r'), QLatin1String("real")}, {('r'), QLatin1String("recover")}, - {('d'), QLatin1String("delete")}}; - - go_other = { - - }; -} -void loadGoData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other) -{ - if (!goDataInitialized) - { - initGoData(); - goDataInitialized = true; - } - types = go_types; - keywords = go_keywords; - builtin = go_builtin; - literals = go_literals; - other = go_other; -} - -/********************************************************/ -/*** V DATA **************************************/ -/********************************************************/ -static bool vDataInitialized = false; -static LanguageData v_keywords; -static LanguageData v_types; -static LanguageData v_literals; -static LanguageData v_builtin; -static LanguageData v_other; -void initVData() -{ - v_keywords = { - {('b'), QLatin1String("break")}, {('c'), QLatin1String("const")}, - {('c'), QLatin1String("continue")}, {('d'), QLatin1String("defer")}, - {('e'), QLatin1String("else")}, {('f'), QLatin1String("for")}, - {('f'), QLatin1String("fn")}, {('g'), QLatin1String("go")}, - {('g'), QLatin1String("goto")}, {('i'), QLatin1String("if")}, - {('i'), QLatin1String("import")}, {('i'), QLatin1String("interface")}, - {('r'), QLatin1String("return")}, {('s'), QLatin1String("struct")}, - {('s'), QLatin1String("switch")}, {('t'), QLatin1String("type")}, - {('p'), QLatin1String("pub")}, {('o'), QLatin1String("or")}, - {('n'), QLatin1String("none")}}; - - v_types - = {{('m'), QLatin1String("map")}, {('s'), QLatin1String("struct")}, - {('b'), QLatin1String("bool")}, {('b'), QLatin1String("byte")}, - {('f'), QLatin1String("f32")}, {('f'), QLatin1String("f64")}, - {('i'), QLatin1String("i8")}, {('i'), QLatin1String("i16")}, - {('i'), QLatin1String("int")}, {('i'), QLatin1String("i64")}, - {('i'), QLatin1String("i128")}, {('s'), QLatin1String("string")}, - {('u'), QLatin1String("u16")}, {('u'), QLatin1String("u32")}, - {('u'), QLatin1String("u64")}, {('u'), QLatin1String("u128")}, - {('u'), QLatin1String("byteptr")}, {('u'), QLatin1String("voidptr")}, - {('r'), QLatin1String("rune")}}; - - v_literals = { - {('f'), QLatin1String("false")}, - {('t'), QLatin1String("true")}, - }; - - v_builtin = {}; - - v_other = { - - }; -} -void loadVData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other) -{ - if (!vDataInitialized) - { - initVData(); - vDataInitialized = true; - } - types = v_types; - keywords = v_keywords; - builtin = v_builtin; - literals = v_literals; - other = v_other; -} - -/********************************************************/ -/*** SQL DATA ************************************/ -/********************************************************/ -static bool sqlDataInitialized = false; -static LanguageData sql_keywords; -static LanguageData sql_types; -static LanguageData sql_literals; -static LanguageData sql_builtin; -static LanguageData sql_other; -void initSQLData() -{ - sql_keywords = {{('A'), QLatin1String("ACTION")}, - {('A'), QLatin1String("ADD")}, - {('A'), QLatin1String("AFTER")}, - {('A'), QLatin1String("ALGORITHM")}, - {('A'), QLatin1String("ALL")}, - {('A'), QLatin1String("ALTER")}, - {('A'), QLatin1String("ANALYZE")}, - {('A'), QLatin1String("ANY")}, - {('A'), QLatin1String("APPLY")}, - {('A'), QLatin1String("AS")}, - {('A'), QLatin1String("ASC")}, - {('A'), QLatin1String("AUTHORIZATION")}, - {('A'), QLatin1String("AUTO_INCREMENT")}, - {('B'), QLatin1String("BACKUP")}, - {('B'), QLatin1String("BDB")}, - {('B'), QLatin1String("BEGIN")}, - {('B'), QLatin1String("BERKELEYDB")}, - {('B'), QLatin1String("BIGINT")}, - {('B'), QLatin1String("BINARY")}, - {('B'), QLatin1String("BIT")}, - {('B'), QLatin1String("BLOB")}, - {('B'), QLatin1String("BOOL")}, - {('B'), QLatin1String("BOOLEAN")}, - {('B'), QLatin1String("BREAK")}, - {('B'), QLatin1String("BROWSE")}, - {('B'), QLatin1String("BTREE")}, - {('B'), QLatin1String("BULK")}, - {('B'), QLatin1String("BY")}, - {('C'), QLatin1String("CALL")}, - {('C'), QLatin1String("CASCADED")}, - {('C'), QLatin1String("CASE")}, - {('C'), QLatin1String("CHAIN")}, - {('C'), QLatin1String("CHARACTER")}, - {('S'), QLatin1String("SET")}, - {('C'), QLatin1String("CHECKPOINT")}, - {('C'), QLatin1String("CLOSE")}, - {('C'), QLatin1String("CLUSTERED")}, - {('C'), QLatin1String("COALESCE")}, - {('C'), QLatin1String("COLLATE")}, - {('C'), QLatin1String("COLUMNS")}, - {('C'), QLatin1String("COMMENT")}, - {('C'), QLatin1String("COMMITTED")}, - {('C'), QLatin1String("COMPUTE")}, - {('C'), QLatin1String("CONNECT")}, - {('C'), QLatin1String("CONSISTENT")}, - {('C'), QLatin1String("CONSTRAINT")}, - {('C'), QLatin1String("CONTAINSTABLE")}, - {('C'), QLatin1String("CONTINUE")}, - {('C'), QLatin1String("CONVERT")}, - {('C'), QLatin1String("CREATE")}, - {('C'), QLatin1String("CROSS")}, - {('C'), QLatin1String("CURRENT_DATE")}, - {('_'), QLatin1String("_TIME")}, - {('_'), QLatin1String("_TIMESTAMP")}, - {('_'), QLatin1String("_USER")}, - {('C'), QLatin1String("CURSOR")}, - {('C'), QLatin1String("CYCLE")}, - {('D'), QLatin1String("DATABASES")}, - {('D'), QLatin1String("DATETIME")}, - {('D'), QLatin1String("DAY")}, - {('D'), QLatin1String("DBCC")}, - {('D'), QLatin1String("DEALLOCATE")}, - {('D'), QLatin1String("DEC")}, - {('D'), QLatin1String("DECIMAL")}, - {('D'), QLatin1String("DECLARE")}, - {('D'), QLatin1String("DEFAULT")}, - {('D'), QLatin1String("DEFINER")}, - {('D'), QLatin1String("DELAYED")}, - {('D'), QLatin1String("DELETE")}, - {('D'), QLatin1String("DELIMITERS")}, - {('D'), QLatin1String("DENY")}, - {('D'), QLatin1String("DESC")}, - {('D'), QLatin1String("DESCRIBE")}, - {('D'), QLatin1String("DETERMINISTIC")}, - {('D'), QLatin1String("DISABLE")}, - {('D'), QLatin1String("DISCARD")}, - {('D'), QLatin1String("DISK")}, - {('D'), QLatin1String("DISTINCT")}, - {('D'), QLatin1String("DISTINCTROW")}, - {('D'), QLatin1String("DISTRIBUTED")}, - {('D'), QLatin1String("DO")}, - {('D'), QLatin1String("DOUBLE")}, - {('D'), QLatin1String("DROP")}, - {('D'), QLatin1String("DUMMY")}, - {('D'), QLatin1String("DUMPFILE")}, - {('D'), QLatin1String("DUPLICATE")}, - {('E'), QLatin1String("ELSEIF")}, - {('E'), QLatin1String("ENABLE")}, - {('E'), QLatin1String("ENCLOSED")}, - {('E'), QLatin1String("END")}, - {('E'), QLatin1String("ENGINE")}, - {('E'), QLatin1String("ENUM")}, - {('E'), QLatin1String("ERRLVL")}, - {('E'), QLatin1String("ERRORS")}, - {('E'), QLatin1String("ESCAPED")}, - {('E'), QLatin1String("EXCEPT")}, - {('E'), QLatin1String("EXECUTE")}, - {('E'), QLatin1String("EXISTS")}, - {('E'), QLatin1String("EXIT")}, - {('E'), QLatin1String("EXPLAIN")}, - {('E'), QLatin1String("EXTENDED")}, - {('F'), QLatin1String("FETCH")}, - {('F'), QLatin1String("FIELDS")}, - {('F'), QLatin1String("FILE")}, - {('F'), QLatin1String("FILLFACTOR")}, - {('F'), QLatin1String("FIRST")}, - {('F'), QLatin1String("FIXED")}, - {('F'), QLatin1String("FLOAT")}, - {('F'), QLatin1String("FOLLOWING")}, - {('F'), QLatin1String("FOR")}, - {('E'), QLatin1String("EACH")}, - {('R'), QLatin1String("ROW")}, - {('F'), QLatin1String("FORCE")}, - {('F'), QLatin1String("FOREIGN")}, - {('F'), QLatin1String("FREETEXTTABLE")}, - {('F'), QLatin1String("FROM")}, - {('F'), QLatin1String("FULL")}, - {('F'), QLatin1String("FUNCTION")}, - {('G'), QLatin1String("GEOMETRYCOLLECTION")}, - {('G'), QLatin1String("GLOBAL")}, - {('G'), QLatin1String("GOTO")}, - {('G'), QLatin1String("GRANT")}, - {('G'), QLatin1String("GROUP")}, - {('H'), QLatin1String("HANDLER")}, - {('H'), QLatin1String("HASH")}, - {('H'), QLatin1String("HAVING")}, - {('H'), QLatin1String("HOLDLOCK")}, - {('H'), QLatin1String("HOUR")}, - {('I'), QLatin1String("IDENTITY_INSERT")}, - {('C'), QLatin1String("COL")}, - {('I'), QLatin1String("IF")}, - {('I'), QLatin1String("IGNORE")}, - {('I'), QLatin1String("IMPORT")}, - {('I'), QLatin1String("INDEX")}, - {('I'), QLatin1String("INFILE")}, - {('I'), QLatin1String("INNER")}, - {('I'), QLatin1String("INNODB")}, - {('I'), QLatin1String("INOUT")}, - {('I'), QLatin1String("INSERT")}, - {('I'), QLatin1String("INT")}, - {('I'), QLatin1String("INTEGER")}, - {('I'), QLatin1String("INTERSECT")}, - {('I'), QLatin1String("INTERVAL")}, - {('I'), QLatin1String("INTO")}, - {('I'), QLatin1String("INVOKER")}, - {('I'), QLatin1String("ISOLATION")}, - {('I'), QLatin1String("ITERATE")}, - {('J'), QLatin1String("JOIN")}, - {('K'), QLatin1String("KEYS")}, - {('K'), QLatin1String("KILL")}, - {('L'), QLatin1String("LANGUAGE")}, - {('L'), QLatin1String("LAST")}, - {('L'), QLatin1String("LEAVE")}, - {('L'), QLatin1String("LEFT")}, - {('L'), QLatin1String("LEVEL")}, - {('L'), QLatin1String("LIMIT")}, - {('L'), QLatin1String("LINENO")}, - {('L'), QLatin1String("LINES")}, - {('L'), QLatin1String("LINESTRING")}, - {('L'), QLatin1String("LOAD")}, - {('L'), QLatin1String("LOCAL")}, - {('L'), QLatin1String("LOCK")}, - {('L'), QLatin1String("LONGBLOB")}, - {('T'), QLatin1String("TEXT")}, - {('L'), QLatin1String("LOOP")}, - {('M'), QLatin1String("MATCHED")}, - {('M'), QLatin1String("MEDIUMBLOB")}, - {('I'), QLatin1String("INT")}, - {('T'), QLatin1String("TEXT")}, - {('M'), QLatin1String("MERGE")}, - {('M'), QLatin1String("MIDDLEINT")}, - {('M'), QLatin1String("MINUTE")}, - {('M'), QLatin1String("MODE")}, - {('M'), QLatin1String("MODIFIES")}, - {('M'), QLatin1String("MODIFY")}, - {('M'), QLatin1String("MONTH")}, - {('M'), QLatin1String("MULTILINESTRING")}, - {('P'), QLatin1String("POINT")}, - {('P'), QLatin1String("POLYGON")}, - {('N'), QLatin1String("NATIONAL")}, - {('N'), QLatin1String("NATURAL")}, - {('N'), QLatin1String("NCHAR")}, - {('N'), QLatin1String("NEXT")}, - {('N'), QLatin1String("NO")}, - {('N'), QLatin1String("NONCLUSTERED")}, - {('N'), QLatin1String("NULLIF")}, - {('N'), QLatin1String("NUMERIC")}, - {('O'), QLatin1String("OFF")}, - {('O'), QLatin1String("OFFSETS")}, - {('O'), QLatin1String("ON")}, - {('O'), QLatin1String("OPENDATASOURCE")}, - {('Q'), QLatin1String("QUERY")}, - {('R'), QLatin1String("ROWSET")}, - {('O'), QLatin1String("OPTIMIZE")}, - {('O'), QLatin1String("OPTIONALLY")}, - {('O'), QLatin1String("ORDER")}, - {('O'), QLatin1String("OUTER")}, - {('F'), QLatin1String("FILE")}, - {('O'), QLatin1String("OVER")}, - {('P'), QLatin1String("PARTIAL")}, - {('P'), QLatin1String("PARTITION")}, - {('P'), QLatin1String("PERCENT")}, - {('P'), QLatin1String("PIVOT")}, - {('P'), QLatin1String("PLAN")}, - {('P'), QLatin1String("POINT")}, - {('P'), QLatin1String("POLYGON")}, - {('P'), QLatin1String("PRECEDING")}, - {('P'), QLatin1String("PRECISION")}, - {('P'), QLatin1String("PREPARE")}, - {('P'), QLatin1String("PREV")}, - {('P'), QLatin1String("PRIMARY")}, - {('P'), QLatin1String("PRINT")}, - {('P'), QLatin1String("PRIVILEGES")}, - {('P'), QLatin1String("PROCEDURE")}, - {('P'), QLatin1String("PUBLIC")}, - {('P'), QLatin1String("PURGE")}, - {('Q'), QLatin1String("QUICK")}, - {('R'), QLatin1String("RAISERROR")}, - {('R'), QLatin1String("READS")}, - {('R'), QLatin1String("REAL")}, - {('R'), QLatin1String("RECONFIGURE")}, - {('R'), QLatin1String("REFERENCES")}, - {('R'), QLatin1String("RELEASE")}, - {('R'), QLatin1String("RENAME")}, - {('R'), QLatin1String("REPEATABLE")}, - {('R'), QLatin1String("REPLACE")}, - {('R'), QLatin1String("REPLICATION")}, - {('R'), QLatin1String("REQUIRE")}, - {('R'), QLatin1String("RESIGNAL")}, - {('R'), QLatin1String("RESTORE")}, - {('R'), QLatin1String("RESTRICT")}, - {('R'), QLatin1String("RETURNS")}, - {('R'), QLatin1String("REVOKE")}, - {('R'), QLatin1String("RIGHT")}, - {('R'), QLatin1String("ROLLBACK")}, - {('R'), QLatin1String("ROUTINE")}, - {('R'), QLatin1String("ROWCOUNT")}, - {('G'), QLatin1String("GUIDCOL")}, - {('R'), QLatin1String("RTREE")}, - {('R'), QLatin1String("RULE")}, - {('S'), QLatin1String("SAVEPOINT")}, - {('S'), QLatin1String("SCHEMA")}, - {('S'), QLatin1String("SECOND")}, - {('S'), QLatin1String("SELECT")}, - {('S'), QLatin1String("SERIALIZABLE")}, - {('S'), QLatin1String("SESSION_USER")}, - {('S'), QLatin1String("SETUSER")}, - {('S'), QLatin1String("SHARE")}, - {('S'), QLatin1String("SHOW")}, - {('S'), QLatin1String("SHUTDOWN")}, - {('S'), QLatin1String("SIMPLE")}, - {('S'), QLatin1String("SMALLINT")}, - {('S'), QLatin1String("SNAPSHOT")}, - {('S'), QLatin1String("SOME")}, - {('S'), QLatin1String("SONAME")}, - {('S'), QLatin1String("SQL")}, - {('S'), QLatin1String("STARTING")}, - {('S'), QLatin1String("STATISTICS")}, - {('S'), QLatin1String("STATUS")}, - {('S'), QLatin1String("STRIPED")}, - {('S'), QLatin1String("SYSTEM_USER")}, - {('T'), QLatin1String("TABLES")}, - {('T'), QLatin1String("TABLESPACE")}, - {('T'), QLatin1String("TEMPORARY")}, - {('T'), QLatin1String("TABLE")}, - {('T'), QLatin1String("TERMINATED")}, - {('T'), QLatin1String("TEXTSIZE")}, - {('T'), QLatin1String("THEN")}, - {('T'), QLatin1String("TIMESTAMP")}, - {('T'), QLatin1String("TINYBLOB")}, - {('I'), QLatin1String("INT")}, - {('T'), QLatin1String("TEXT")}, - {('T'), QLatin1String("TOP")}, - {('T'), QLatin1String("TRANSACTIONS")}, - {('T'), QLatin1String("TRIGGER")}, - {('T'), QLatin1String("TRUNCATE")}, - {('T'), QLatin1String("TSEQUAL")}, - {('T'), QLatin1String("TYPES")}, - {('U'), QLatin1String("UNBOUNDED")}, - {('U'), QLatin1String("UNCOMMITTED")}, - {('U'), QLatin1String("UNDEFINED")}, - {('U'), QLatin1String("UNION")}, - {('U'), QLatin1String("UNIQUE")}, - {('U'), QLatin1String("UNLOCK")}, - {('U'), QLatin1String("UNPIVOT")}, - {('U'), QLatin1String("UNSIGNED")}, - {('U'), QLatin1String("UPDATETEXT")}, - {('U'), QLatin1String("USAGE")}, - {('U'), QLatin1String("USE")}, - {('U'), QLatin1String("USER")}, - {('U'), QLatin1String("USING")}, - {('V'), QLatin1String("VALUES")}, - {('V'), QLatin1String("VARBINARY")}, - {('C'), QLatin1String("CHAR")}, - {('C'), QLatin1String("CHARACTER")}, - {('Y'), QLatin1String("YING")}, - {('V'), QLatin1String("VIEW")}, - {('W'), QLatin1String("WAITFOR")}, - {('W'), QLatin1String("WARNINGS")}, - {('W'), QLatin1String("WHEN")}, - {('W'), QLatin1String("WHERE")}, - {('W'), QLatin1String("WHILE")}, - {('W'), QLatin1String("WITH")}, - {('R'), QLatin1String("ROLLUP")}, - {('I'), QLatin1String("IN")}, - {('W'), QLatin1String("WORK")}, - {('W'), QLatin1String("WRITETEXT")}, - {('Y'), QLatin1String("YEAR")}}; - - sql_types = { - - }; - - sql_literals = { - {('A'), QLatin1String("TRUE")}, - {('F'), QLatin1String("FALSE")}, - {('N'), QLatin1String("NULL")}, - }; - - sql_builtin - = {{('A'), QLatin1String("AVG")}, {('C'), QLatin1String("COUNT")}, - {('F'), QLatin1String("FIRST")}, {('F'), QLatin1String("FORMAT")}, - {('L'), QLatin1String("LAST")}, {('L'), QLatin1String("LCASE")}, - {('L'), QLatin1String("LEN")}, {('M'), QLatin1String("MAX")}, - {('M'), QLatin1String("MID")}, {('M'), QLatin1String("MIN")}, - {('M'), QLatin1String("MOD")}, {('N'), QLatin1String("NOW")}, - {('R'), QLatin1String("ROUND")}, {('S'), QLatin1String("SUM")}, - {('U'), QLatin1String("UCASE")}}; - - sql_other = { - - }; -} -void loadSQLData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other) -{ - if (!sqlDataInitialized) - { - initSQLData(); - sqlDataInitialized = true; - } - types = sql_types; - keywords = sql_keywords; - builtin = sql_builtin; - literals = sql_literals; - other = sql_other; -} - -/********************************************************/ -/*** JSON DATA ***********************************/ -/********************************************************/ -static bool jsonDataInitialized = false; -static LanguageData json_keywords; -static LanguageData json_types; -static LanguageData json_literals; -static LanguageData json_builtin; -static LanguageData json_other; -void initJSONData() -{ - json_keywords = {}; - - json_types = {}; - - json_literals = {{('f'), QLatin1String("false")}, - {('t'), QLatin1String("true")}, - {('n'), QLatin1String("null")}}; - - json_builtin = {}; - - json_other = {}; -} -void loadJSONData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other) -{ - if (!jsonDataInitialized) - { - initJSONData(); - jsonDataInitialized = true; - } - types = json_types; - keywords = json_keywords; - builtin = json_builtin; - literals = json_literals; - other = json_other; -} - -/********************************************************/ -/*** CSS DATA ***********************************/ -/********************************************************/ -static bool cssDataInitialized = false; -static LanguageData css_keywords; -static LanguageData css_types; -static LanguageData css_literals; -static LanguageData css_builtin; -static LanguageData css_other; -void initCSSData() -{ - css_keywords = {{'i', QLatin1String("important")}, - {'p', QLatin1String("px")}, - {'e', QLatin1String("em")}}; - - css_types = { - {'a', QLatin1String("align")}, {'c', QLatin1String("content")}, - {'i', QLatin1String("items")}, {'s', QLatin1String("self")}, - {'a', QLatin1String("all")}, {'a', QLatin1String("animation")}, - {'d', QLatin1String("delay")}, {'d', QLatin1String("direction")}, - {'d', QLatin1String("duration")}, {'f', QLatin1String("fill")}, - {'m', QLatin1String("mode")}, {'i', QLatin1String("iteration")}, - {'c', QLatin1String("count")}, {'n', QLatin1String("name")}, - {'p', QLatin1String("play")}, {'s', QLatin1String("state")}, - {'t', QLatin1String("timing")}, {'f', QLatin1String("function")}, - {'a', QLatin1String("azimuth")}, {'b', QLatin1String("backface")}, - {'v', QLatin1String("visibility")}, {'a', QLatin1String("attachment")}, - {'b', QLatin1String("blend")}, {'m', QLatin1String("mode")}, - {'c', QLatin1String("clip")}, {'c', QLatin1String("color")}, - {'i', QLatin1String("image")}, {'o', QLatin1String("origin")}, - {'p', QLatin1String("position")}, {'r', QLatin1String("repeat")}, - {'s', QLatin1String("size")}, {'b', QLatin1String("background")}, - {'b', QLatin1String("bleed")}, {'c', QLatin1String("color")}, - {'r', QLatin1String("radius")}, {'r', QLatin1String("radius")}, - {'s', QLatin1String("style")}, {'w', QLatin1String("width")}, - {'b', QLatin1String("bottom")}, {'c', QLatin1String("collapse")}, - {'c', QLatin1String("color")}, {'i', QLatin1String("image")}, - {'o', QLatin1String("outset")}, {'r', QLatin1String("repeat")}, - {'s', QLatin1String("source")}, {'s', QLatin1String("slice")}, - {'w', QLatin1String("width")}, {'c', QLatin1String("color")}, - {'s', QLatin1String("style")}, {'w', QLatin1String("width")}, - {'l', QLatin1String("left")}, {'r', QLatin1String("radius")}, - {'c', QLatin1String("color")}, {'s', QLatin1String("style")}, - {'w', QLatin1String("width")}, {'r', QLatin1String("right")}, - {'s', QLatin1String("spacing")}, {'s', QLatin1String("style")}, - {'c', QLatin1String("color")}, {'l', QLatin1String("left")}, - {'r', QLatin1String("radius")}, {'r', QLatin1String("radius")}, - {'s', QLatin1String("style")}, {'w', QLatin1String("width")}, - {'t', QLatin1String("top")}, {'w', QLatin1String("width")}, - {'b', QLatin1String("border")}, {'b', QLatin1String("bottom")}, - {'b', QLatin1String("break")}, {'b', QLatin1String("box")}, - {'s', QLatin1String("shadow")}, {'b', QLatin1String("box")}, - {'s', QLatin1String("sizing")}, {'a', QLatin1String("after")}, - {'b', QLatin1String("before")}, {'b', QLatin1String("break")}, - {'i', QLatin1String("inside")}, {'c', QLatin1String("caption")}, - {'s', QLatin1String("side")}, {'c', QLatin1String("caret")}, - {'c', QLatin1String("color")}, {'c', QLatin1String("clear")}, - {'c', QLatin1String("clip")}, {'c', QLatin1String("color")}, - {'c', QLatin1String("columns")}, {'c', QLatin1String("column")}, - {'c', QLatin1String("count")}, {'f', QLatin1String("fill")}, - {'g', QLatin1String("gap")}, {'r', QLatin1String("rule")}, - {'c', QLatin1String("color")}, {'s', QLatin1String("style")}, - {'w', QLatin1String("width")}, {'s', QLatin1String("span")}, - {'w', QLatin1String("width")}, {'c', QLatin1String("content")}, - {'i', QLatin1String("increment")}, {'c', QLatin1String("counter")}, - {'r', QLatin1String("reset")}, {'a', QLatin1String("after")}, - {'b', QLatin1String("before")}, {'c', QLatin1String("cue")}, - {'c', QLatin1String("cursor")}, {'d', QLatin1String("direction")}, - {'d', QLatin1String("display")}, {'e', QLatin1String("elevation")}, - {'e', QLatin1String("empty")}, {'c', QLatin1String("cells")}, - {'f', QLatin1String("filter")}, {'f', QLatin1String("flex")}, - {'b', QLatin1String("basis")}, {'d', QLatin1String("direction")}, - {'f', QLatin1String("feature")}, {'s', QLatin1String("settings")}, - {'f', QLatin1String("flex")}, {'f', QLatin1String("flow")}, - {'g', QLatin1String("grow")}, {'s', QLatin1String("shrink")}, - {'w', QLatin1String("wrap")}, {'f', QLatin1String("float")}, - {'f', QLatin1String("family")}, {'k', QLatin1String("kerning")}, - {'l', QLatin1String("language")}, {'o', QLatin1String("override")}, - {'a', QLatin1String("adjust")}, {'s', QLatin1String("size")}, - {'s', QLatin1String("stretch")}, {'s', QLatin1String("style")}, - {'s', QLatin1String("synthesis")}, {'v', QLatin1String("variant")}, - {'a', QLatin1String("alternates")}, {'c', QLatin1String("caps")}, - {'e', QLatin1String("east")}, {'a', QLatin1String("asian")}, - {'l', QLatin1String("ligatures")}, {'n', QLatin1String("numeric")}, - {'p', QLatin1String("position")}, {'w', QLatin1String("weight")}, - {'f', QLatin1String("font")}, {'a', QLatin1String("area")}, - {'a', QLatin1String("auto")}, {'c', QLatin1String("columns")}, - {'f', QLatin1String("flow")}, {'r', QLatin1String("rows")}, - {'e', QLatin1String("end")}, {'g', QLatin1String("gap")}, - {'s', QLatin1String("start")}, {'c', QLatin1String("column")}, - {'g', QLatin1String("gap")}, {'e', QLatin1String("end")}, - {'g', QLatin1String("gap")}, {'s', QLatin1String("start")}, - {'r', QLatin1String("row")}, {'a', QLatin1String("areas")}, - {'c', QLatin1String("columns")}, {'r', QLatin1String("rows")}, - {'t', QLatin1String("template")}, {'g', QLatin1String("grid")}, - {'h', QLatin1String("hanging")}, {'p', QLatin1String("punctuation")}, - {'h', QLatin1String("height")}, {'h', QLatin1String("hyphens")}, - {'i', QLatin1String("isolation")}, {'j', QLatin1String("justify")}, - {'c', QLatin1String("content")}, {'i', QLatin1String("items")}, - {'s', QLatin1String("self")}, {'l', QLatin1String("leftimage")}, - {'l', QLatin1String("letter")}, {'s', QLatin1String("spacing")}, - {'b', QLatin1String("break")}, {'l', QLatin1String("line")}, - {'s', QLatin1String("style")}, {'i', QLatin1String("image")}, - {'s', QLatin1String("style")}, {'p', QLatin1String("position")}, - {'t', QLatin1String("type")}, {'l', QLatin1String("list")}, - {'s', QLatin1String("style")}, {'b', QLatin1String("bottom")}, - {'l', QLatin1String("left")}, {'r', QLatin1String("right")}, - {'t', QLatin1String("top")}, {'m', QLatin1String("margin")}, - {'m', QLatin1String("marker")}, {'o', QLatin1String("offset")}, - {'m', QLatin1String("marks")}, {'m', QLatin1String("max")}, - {'h', QLatin1String("height")}, {'w', QLatin1String("width")}, - {'m', QLatin1String("min")}, {'m', QLatin1String("mix")}, - {'b', QLatin1String("blend")}, {'m', QLatin1String("mode")}, - {'n', QLatin1String("nav")}, {'u', QLatin1String("up")}, - {'d', QLatin1String("down")}, {'l', QLatin1String("left")}, - {'r', QLatin1String("right")}, {'o', QLatin1String("opacity")}, - {'o', QLatin1String("order")}, {'o', QLatin1String("orphans")}, - {'c', QLatin1String("color")}, {'o', QLatin1String("offset")}, - {'s', QLatin1String("style")}, {'w', QLatin1String("width")}, - {'o', QLatin1String("outline")}, {'w', QLatin1String("wrap")}, - {'o', QLatin1String("overflow")}, {'b', QLatin1String("bottom")}, - {'l', QLatin1String("left")}, {'r', QLatin1String("right")}, - {'t', QLatin1String("top")}, {'p', QLatin1String("padding")}, - {'b', QLatin1String("break")}, {'a', QLatin1String("after")}, - {'b', QLatin1String("before")}, {'i', QLatin1String("inside")}, - {'p', QLatin1String("page")}, {'a', QLatin1String("after")}, - {'b', QLatin1String("before")}, {'p', QLatin1String("pause")}, - {'p', QLatin1String("perspective")}, {'o', QLatin1String("origin")}, - {'r', QLatin1String("range")}, {'p', QLatin1String("pitch")}, - {'c', QLatin1String("content")}, {'i', QLatin1String("items")}, - {'p', QLatin1String("place")}, {'s', QLatin1String("self")}, - {'p', QLatin1String("play")}, {'d', QLatin1String("during")}, - {'p', QLatin1String("position")}, {'q', QLatin1String("quotes")}, - {'r', QLatin1String("resize")}, {'r', QLatin1String("rest")}, - {'a', QLatin1String("after")}, {'b', QLatin1String("before")}, - {'r', QLatin1String("rest")}, {'r', QLatin1String("richness")}, - {'r', QLatin1String("right")}, {'s', QLatin1String("size")}, - {'h', QLatin1String("header")}, {'n', QLatin1String("numeral")}, - {'s', QLatin1String("speak")}, {'p', QLatin1String("punctuation")}, - {'s', QLatin1String("speak")}, {'s', QLatin1String("speech")}, - {'r', QLatin1String("rate")}, {'s', QLatin1String("stress")}, - {'t', QLatin1String("tab")}, {'s', QLatin1String("size")}, - {'t', QLatin1String("table")}, {'l', QLatin1String("layout")}, - {'t', QLatin1String("text")}, {'a', QLatin1String("align")}, - {'l', QLatin1String("last")}, {'d', QLatin1String("decoration")}, - {'c', QLatin1String("color")}, {'l', QLatin1String("line")}, - {'s', QLatin1String("skip")}, {'s', QLatin1String("style")}, - {'i', QLatin1String("indent")}, {'o', QLatin1String("overflow")}, - {'s', QLatin1String("shadow")}, {'t', QLatin1String("transform")}, - {'u', QLatin1String("underline")}, {'p', QLatin1String("position")}, - {'t', QLatin1String("top")}, {'t', QLatin1String("transform")}, - {'o', QLatin1String("origin")}, {'s', QLatin1String("style")}, - {'t', QLatin1String("transition")}, {'d', QLatin1String("delay")}, - {'d', QLatin1String("duration")}, {'p', QLatin1String("property")}, - {'t', QLatin1String("timing")}, {'f', QLatin1String("function")}, - {'u', QLatin1String("unicode")}, {'b', QLatin1String("bidi")}, - {'v', QLatin1String("vertical")}, {'a', QLatin1String("align")}, - {'v', QLatin1String("visibility")}, {'b', QLatin1String("balance")}, - {'d', QLatin1String("duration")}, {'f', QLatin1String("family")}, - {'p', QLatin1String("pitch")}, {'r', QLatin1String("range")}, - {'r', QLatin1String("rate")}, {'s', QLatin1String("stress")}, - {'v', QLatin1String("volume")}, {'v', QLatin1String("voice")}, - {'v', QLatin1String("volume")}, {'w', QLatin1String("white")}, - {'s', QLatin1String("space")}, {'w', QLatin1String("widows")}, - {'w', QLatin1String("width")}, {'w', QLatin1String("will")}, - {'c', QLatin1String("change")}, {'w', QLatin1String("word")}, - {'b', QLatin1String("break")}, {'s', QLatin1String("spacing")}, - {'w', QLatin1String("wrap")}, {'x', QLatin1String("x")}, - {'y', QLatin1String("y")}, {'z', QLatin1String("z")}, - {'i', QLatin1String("index")}, {'r', QLatin1String("rgb")}, - {'s', QLatin1String("sans")}, {'s', QLatin1String("serif")}, - {'n', QLatin1String("normal")}}; - - css_literals = {}; - - css_builtin = {}; - - css_other = {}; -} -void loadCSSData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other) -{ - if (!cssDataInitialized) - { - initCSSData(); - cssDataInitialized = true; - } - types = css_types; - keywords = css_keywords; - builtin = css_builtin; - literals = css_literals; - other = css_other; -} - -/********************************************************/ -/*** Typescript DATA *********************************/ -/********************************************************/ -static bool typescriptDataInitialized = false; -static LanguageData typescript_keywords; -static LanguageData typescript_types; -static LanguageData typescript_literals; -static LanguageData typescript_builtin; -static LanguageData typescript_other; -void initTypescriptData() -{ - typescript_keywords - = {{'i', QLatin1String("in")}, {'i', QLatin1String("if")}, - {'f', QLatin1String("for")}, {'w', QLatin1String("while")}, - {'f', QLatin1String("finally")}, {'n', QLatin1String("new")}, - {'f', QLatin1String("function")}, {'d', QLatin1String("do")}, - {'r', QLatin1String("return")}, {'v', QLatin1String("void")}, - {'e', QLatin1String("else")}, {'b', QLatin1String("break")}, - {'c', QLatin1String("catch")}, {'i', QLatin1String("instanceof")}, - {'w', QLatin1String("with")}, {'t', QLatin1String("throw")}, - {'c', QLatin1String("case")}, {'d', QLatin1String("default")}, - {'t', QLatin1String("try")}, {'t', QLatin1String("this")}, - {'s', QLatin1String("switch")}, {'c', QLatin1String("continue")}, - {'t', QLatin1String("typeof")}, {'d', QLatin1String("delete")}, - {'l', QLatin1String("let")}, {'y', QLatin1String("yield")}, - {'c', QLatin1String("const")}, {'p', QLatin1String("public")}, - {'p', QLatin1String("private")}, {'p', QLatin1String("protected")}, - {'g', QLatin1String("get")}, {'s', QLatin1String("set")}, - {'s', QLatin1String("super")}, {'s', QLatin1String("static")}, - {'i', QLatin1String("implements")}, {'e', QLatin1String("export")}, - {'i', QLatin1String("import")}, {'d', QLatin1String("declare")}, - {'t', QLatin1String("type")}, {'n', QLatin1String("namespace")}, - {'a', QLatin1String("abstract")}, {'a', QLatin1String("as")}, - {'f', QLatin1String("from")}, {'e', QLatin1String("extends")}, - {'a', QLatin1String("async")}, {'a', QLatin1String("await")}}; - - typescript_types = {{'v', QLatin1String("var")}, - {'c', QLatin1String("class")}, - {'e', QLatin1String("enum")}}; - - typescript_literals - = {{('f'), QLatin1String("false")}, {('n'), QLatin1String("null")}, - {('t'), QLatin1String("true")}, {('u'), QLatin1String("undefined")}, - {('N'), QLatin1String("NaN")}, {('I'), QLatin1String("Infinity")}}; - - typescript_builtin = {{'e', QLatin1String("eval")}, - {'i', QLatin1String("isFinite")}, - {'i', QLatin1String("isNaN")}, - {'p', QLatin1String("parseFloat")}, - {'p', QLatin1String("parseInt")}, - {'d', QLatin1String("decodeURI")}, - {'d', QLatin1String("decodeURIComponent")}, - {'e', QLatin1String("encodeURI")}, - {'e', QLatin1String("encodeURIComponent")}, - {'e', QLatin1String("escape")}, - {'u', QLatin1String("unescape")}, - {'O', QLatin1String("Object")}, - {'F', QLatin1String("Function")}, - {'B', QLatin1String("Boolean")}, - {'E', QLatin1String("Error")}, - {'E', QLatin1String("EvalError")}, - {'I', QLatin1String("InternalError")}, - {'R', QLatin1String("RangeError")}, - {'R', QLatin1String("ReferenceError")}, - {'S', QLatin1String("StopIteration")}, - {'S', QLatin1String("SyntaxError")}, - {'T', QLatin1String("TypeError")}, - {'U', QLatin1String("URIError")}, - {'N', QLatin1String("Number")}, - {'M', QLatin1String("Math")}, - {'D', QLatin1String("Date")}, - {'S', QLatin1String("String")}, - {'R', QLatin1String("RegExp")}, - {'A', QLatin1String("Array")}, - {'F', QLatin1String("Float32Array")}, - {'F', QLatin1String("Float64Array")}, - {'I', QLatin1String("Int16Array")}, - {'I', QLatin1String("Int32Array")}, - {'I', QLatin1String("Int8Array")}, - {'U', QLatin1String("Uint16Array")}, - {'U', QLatin1String("Uint32Array")}, - {'U', QLatin1String("Uint8Array")}, - {'U', QLatin1String("Uint8ClampedArray")}, - {'A', QLatin1String("ArrayBuffer")}, - {'D', QLatin1String("DataView")}, - {'J', QLatin1String("JSON")}, - {'I', QLatin1String("Intl")}, - {'a', QLatin1String("arguments")}, - {'r', QLatin1String("require")}, - {'m', QLatin1String("module")}, - {'c', QLatin1String("console")}, - {'w', QLatin1String("window")}, - {'d', QLatin1String("document")}, - {'a', QLatin1String("any")}, - {'n', QLatin1String("number")}, - {'b', QLatin1String("boolean")}, - {'s', QLatin1String("string")}, - {'v', QLatin1String("void")}, - {'P', QLatin1String("Promise")}}; - - typescript_other = {}; -} -void loadTypescriptData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other) -{ - if (!typescriptDataInitialized) - { - initTypescriptData(); - typescriptDataInitialized = true; - } - types = typescript_types; - keywords = typescript_keywords; - builtin = typescript_builtin; - literals = typescript_literals; - other = typescript_other; -} - -/********************************************************/ -/*** YAML DATA ***************************************/ -/********************************************************/ -static bool YAMLDataInitialized = false; -static LanguageData YAML_keywords; -static LanguageData YAML_types; -static LanguageData YAML_literals; -static LanguageData YAML_builtin; -static LanguageData YAML_other; -void initYAMLData() -{ - YAML_keywords = {}; - YAML_types = {}; - YAML_literals = { - {('f'), QLatin1String("false")}, - {('t'), QLatin1String("true")}, - {('n'), QLatin1String("null")}, - }; - - YAML_builtin = {}; - YAML_other = {}; -} -void loadYAMLData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other) -{ - if (!YAMLDataInitialized) - { - initYAMLData(); - YAMLDataInitialized = true; - } - types = YAML_types; - keywords = YAML_keywords; - builtin = YAML_builtin; - literals = YAML_literals; - other = YAML_other; -} - -/********************************************************/ -/*** VEX DATA ***************************************/ -/********************************************************/ -static bool vexDataInitialized = false; -static LanguageData vex_keywords; -static LanguageData vex_types; -static LanguageData vex_literals; -static LanguageData vex_builtin; -static LanguageData vex_other; -void initVEXData() -{ - vex_keywords - = {{'b', QLatin1String("break")}, {'c', QLatin1String("continue")}, - {'d', QLatin1String("do")}, {'e', QLatin1String("else")}, - {'f', QLatin1String("for")}, {'f', QLatin1String("foreach")}, - {'f', QLatin1String("forpoints")}, {'f', QLatin1String("function")}, - {'g', QLatin1String("gather")}, {'i', QLatin1String("if")}, - {'i', QLatin1String("illuminance")}, {'r', QLatin1String("return")}, - {'w', QLatin1String("while")}}; - vex_types = { - {'b', QLatin1String("bsdf")}, {'c', QLatin1String("char")}, - {'c', QLatin1String("color")}, {'f', QLatin1String("float")}, - {'i', QLatin1String("int")}, {'i', QLatin1String("integer")}, - {'m', QLatin1String("matrix")}, {'m', QLatin1String("matrix2")}, - {'m', QLatin1String("matrix3")}, {'m', QLatin1String("matrix4")}, - {'n', QLatin1String("normal")}, {'p', QLatin1String("point")}, - {'s', QLatin1String("string")}, {'s', QLatin1String("struct")}, - {'t', QLatin1String("typedef")}, {'u', QLatin1String("union")}, - {'v', QLatin1String("vector")}, {'v', QLatin1String("vector2")}, - {'v', QLatin1String("vector4")}, {'v', QLatin1String("void")}, - }; - vex_literals = { - {('f'), QLatin1String("false")}, - {('t'), QLatin1String("true")}, - {('n'), QLatin1String("null")}, - }; - - vex_builtin = {{'D', QLatin1String("Du")}, - {'D', QLatin1String("Dv")}, - {'D', QLatin1String("Dw")}, - {'a', QLatin1String("abs")}, - {'a', QLatin1String("accessframe")}, - {'a', QLatin1String("acos")}, - {'a', QLatin1String("addattrib")}, - {'a', QLatin1String("addattribute")}, - {'a', QLatin1String("adddetailattrib")}, - {'a', QLatin1String("addgroup")}, - {'a', QLatin1String("addpoint")}, - {'a', QLatin1String("addpointattrib")}, - {'a', QLatin1String("addprim")}, - {'a', QLatin1String("addprimattrib")}, - {'a', QLatin1String("addvariablename")}, - {'a', QLatin1String("addvertex")}, - {'a', QLatin1String("addvertexattrib")}, - {'a', QLatin1String("addvisualizer")}, - {'a', QLatin1String("agentaddclip")}, - {'a', QLatin1String("agentclipcatalog")}, - {'a', QLatin1String("agentclipchannel")}, - {'a', QLatin1String("agentcliplength")}, - {'a', QLatin1String("agentclipnames")}, - {'a', QLatin1String("agentclipsample")}, - {'a', QLatin1String("agentclipsamplelocal")}, - {'a', QLatin1String("agentclipsamplerate")}, - {'a', QLatin1String("agentclipsampleworld")}, - {'a', QLatin1String("agentcliptimes")}, - {'a', QLatin1String("agentclipweights")}, - {'a', QLatin1String("agentcollisionlayer")}, - {'a', QLatin1String("agentcurrentlayer")}, - {'a', QLatin1String("agentlayerbindings")}, - {'a', QLatin1String("agentlayers")}, - {'a', QLatin1String("agentlayershapes")}, - {'a', QLatin1String("agentlocaltransform")}, - {'a', QLatin1String("agentlocaltransforms")}, - {'a', QLatin1String("agentrigchildren")}, - {'a', QLatin1String("agentrigfind")}, - {'a', QLatin1String("agentrigparent")}, - {'a', QLatin1String("agenttransformcount")}, - {'a', QLatin1String("agenttransformnames")}, - {'a', QLatin1String("agenttransformtolocal")}, - {'a', QLatin1String("agenttransformtoworld")}, - {'a', QLatin1String("agentworldtransform")}, - {'a', QLatin1String("agentworldtransforms")}, - {'a', QLatin1String("albedo")}, - {'a', QLatin1String("alphaname")}, - {'a', QLatin1String("ambient")}, - {'a', QLatin1String("anoise")}, - {'a', QLatin1String("append")}, - {'a', QLatin1String("area")}, - {'a', QLatin1String("argsort")}, - {'a', QLatin1String("array")}, - {'a', QLatin1String("ashikhmin")}, - {'a', QLatin1String("asin")}, - {'a', QLatin1String("assert_enabled")}, - {'a', QLatin1String("assign")}, - {'a', QLatin1String("atan")}, - {'a', QLatin1String("atan2")}, - {'a', QLatin1String("atof")}, - {'a', QLatin1String("atoi")}, - {'a', QLatin1String("atten")}, - {'a', QLatin1String("attrib")}, - {'a', QLatin1String("attribclass")}, - {'a', QLatin1String("attribsize")}, - {'a', QLatin1String("attribtype")}, - {'a', QLatin1String("attribtypeinfo")}, - {'a', QLatin1String("avg")}, - {'b', QLatin1String("binput")}, - {'b', QLatin1String("blackbody")}, - {'b', QLatin1String("blinn")}, - {'b', QLatin1String("blinnBRDF")}, - {'b', QLatin1String("bouncelabel")}, - {'b', QLatin1String("bouncemask")}, - {'b', QLatin1String("bumpmap")}, - {'b', QLatin1String("bumpmapA")}, - {'b', QLatin1String("bumpmapB")}, - {'b', QLatin1String("bumpmapG")}, - {'b', QLatin1String("bumpmapL")}, - {'b', QLatin1String("bumpmapR")}, - {'b', QLatin1String("bumpname")}, - {'c', QLatin1String("cbrt")}, - {'c', QLatin1String("ceil")}, - {'c', QLatin1String("ch")}, - {'c', QLatin1String("ch3")}, - {'c', QLatin1String("ch4")}, - {'c', QLatin1String("chend")}, - {'c', QLatin1String("chendf")}, - {'c', QLatin1String("chendt")}, - {'c', QLatin1String("chf")}, - {'c', QLatin1String("chi")}, - {'c', QLatin1String("chinput")}, - {'c', QLatin1String("chname")}, - {'c', QLatin1String("chnumchan")}, - {'c', QLatin1String("chp")}, - {'c', QLatin1String("chr")}, - {'c', QLatin1String("chramp")}, - {'c', QLatin1String("chrate")}, - {'c', QLatin1String("chs")}, - {'c', QLatin1String("chsraw")}, - {'c', QLatin1String("chstart")}, - {'c', QLatin1String("chstartf")}, - {'c', QLatin1String("chstartt")}, - {'c', QLatin1String("chv")}, - {'c', QLatin1String("cinput")}, - {'c', QLatin1String("ckspline")}, - {'c', QLatin1String("clamp")}, - {'c', QLatin1String("clip")}, - {'c', QLatin1String("colormap")}, - {'c', QLatin1String("colorname")}, - {'c', QLatin1String("computenormal")}, - {'c', QLatin1String("concat")}, - {'c', QLatin1String("cone")}, - {'c', QLatin1String("cos")}, - {'c', QLatin1String("cosh")}, - {'c', QLatin1String("cracktransform")}, - {'c', QLatin1String("cross")}, - {'c', QLatin1String("cspline")}, - {'c', QLatin1String("ctransform")}, - {'c', QLatin1String("curlnoise")}, - {'c', QLatin1String("curlnoise2d")}, - {'c', QLatin1String("curlxnoise")}, - {'c', QLatin1String("curlxnoise2d")}, - {'c', QLatin1String("cvex_bsdf")}, - {'d', QLatin1String("degrees")}, - {'d', QLatin1String("depthmap")}, - {'d', QLatin1String("depthname")}, - {'d', QLatin1String("detail")}, - {'d', QLatin1String("detailattrib")}, - {'d', QLatin1String("detailattribsize")}, - {'d', QLatin1String("detailattribtype")}, - {'d', QLatin1String("detailattribtypeinfo")}, - {'d', QLatin1String("detailintrinsic")}, - {'d', QLatin1String("determinant")}, - {'d', QLatin1String("diffuse")}, - {'d', QLatin1String("diffuseBRDF")}, - {'d', QLatin1String("dihedral")}, - {'d', QLatin1String("dimport")}, - {'d', QLatin1String("distance")}, - {'d', QLatin1String("distance2")}, - {'d', QLatin1String("dot")}, - {'d', QLatin1String("dsmpixel")}, - {'e', QLatin1String("eigenvalues")}, - {'e', QLatin1String("endswith")}, - {'e', QLatin1String("environment")}, - {'e', QLatin1String("erf")}, - {'e', QLatin1String("erf_inv")}, - {'e', QLatin1String("erfc")}, - {'e', QLatin1String("error")}, - {'e', QLatin1String("eulertoquaternion")}, - {'e', QLatin1String("eval_bsdf")}, - {'e', QLatin1String("exp")}, - {'e', QLatin1String("expand_udim")}, - {'e', QLatin1String("expandpointgroup")}, - {'e', QLatin1String("expandprimgroup")}, - {'f', QLatin1String("fastshadow")}, - {'f', QLatin1String("filamentsample")}, - {'f', QLatin1String("file_stat")}, - {'f', QLatin1String("filtershadow")}, - {'f', QLatin1String("filterstep")}, - {'f', QLatin1String("find")}, - {'f', QLatin1String("findattribval")}, - {'f', QLatin1String("findattribvalcount")}, - {'f', QLatin1String("finput")}, - {'f', QLatin1String("fit")}, - {'f', QLatin1String("fit01")}, - {'f', QLatin1String("fit10")}, - {'f', QLatin1String("fit11")}, - {'f', QLatin1String("floor")}, - {'f', QLatin1String("flownoise")}, - {'f', QLatin1String("flowpnoise")}, - {'f', QLatin1String("frac")}, - {'f', QLatin1String("fresnel")}, - {'f', QLatin1String("fromNDC")}, - {'f', QLatin1String("frontface")}, - {'f', QLatin1String("fuzzify")}, - {'f', QLatin1String("fuzzy_and")}, - {'f', QLatin1String("fuzzy_defuzz_centroid")}, - {'f', QLatin1String("fuzzy_nand")}, - {'f', QLatin1String("fuzzy_nor")}, - {'f', QLatin1String("fuzzy_not")}, - {'f', QLatin1String("fuzzy_nxor")}, - {'f', QLatin1String("fuzzy_or")}, - {'f', QLatin1String("fuzzy_xor")}, - {'g', QLatin1String("geoself")}, - {'g', QLatin1String("getattrib")}, - {'g', QLatin1String("getattribute")}, - {'g', QLatin1String("getbbox")}, - {'g', QLatin1String("getblurP")}, - {'g', QLatin1String("getbounces")}, - {'g', QLatin1String("getbounds")}, - {'g', QLatin1String("getcomp")}, - {'g', QLatin1String("getcomponents")}, - {'g', QLatin1String("getderiv")}, - {'g', QLatin1String("getfogname")}, - {'g', QLatin1String("getglobalraylevel")}, - {'g', QLatin1String("getlight")}, - {'g', QLatin1String("getlightid")}, - {'g', QLatin1String("getlightname")}, - {'g', QLatin1String("getlights")}, - {'g', QLatin1String("getlightscope")}, - {'g', QLatin1String("getmaterial")}, - {'g', QLatin1String("getobjectname")}, - {'g', QLatin1String("getphotonlight")}, - {'g', QLatin1String("getpointbbox")}, - {'g', QLatin1String("getprimid")}, - {'g', QLatin1String("getptextureid")}, - {'g', QLatin1String("getraylevel")}, - {'g', QLatin1String("getrayweight")}, - {'g', QLatin1String("getsamplestore")}, - {'g', QLatin1String("getscope")}, - {'g', QLatin1String("getsmoothP")}, - {'g', QLatin1String("getspace")}, - {'g', QLatin1String("getuvobjects")}, - {'g', QLatin1String("getuvtangents")}, - {'g', QLatin1String("gradient")}, - {'h', QLatin1String("hair")}, - {'h', QLatin1String("hasattrib")}, - {'h', QLatin1String("hasdetailattrib")}, - {'h', QLatin1String("haslight")}, - {'h', QLatin1String("hasplane")}, - {'h', QLatin1String("haspointattrib")}, - {'h', QLatin1String("hasprimattrib")}, - {'h', QLatin1String("hasvertexattrib")}, - {'h', QLatin1String("hedge_dstpoint")}, - {'h', QLatin1String("hedge_dstvertex")}, - {'h', QLatin1String("hedge_equivcount")}, - {'h', QLatin1String("hedge_isequiv")}, - {'h', QLatin1String("hedge_isprimary")}, - {'h', QLatin1String("hedge_isvalid")}, - {'h', QLatin1String("hedge_next")}, - {'h', QLatin1String("hedge_nextequiv")}, - {'h', QLatin1String("hedge_postdstpoint")}, - {'h', QLatin1String("hedge_postdstvertex")}, - {'h', QLatin1String("hedge_presrcpoint")}, - {'h', QLatin1String("hedge_presrcvertex")}, - {'h', QLatin1String("hedge_prev")}, - {'h', QLatin1String("hedge_prim")}, - {'h', QLatin1String("hedge_primary")}, - {'h', QLatin1String("hedge_srcpoint")}, - {'h', QLatin1String("hedge_srcvertex")}, - {'h', QLatin1String("henyeygreenstein")}, - {'h', QLatin1String("hscript_noise")}, - {'h', QLatin1String("hscript_rand")}, - {'h', QLatin1String("hscript_snoise")}, - {'h', QLatin1String("hscript_sturb")}, - {'h', QLatin1String("hscript_turb")}, - {'h', QLatin1String("hsvtorgb")}, - {'i', QLatin1String("iaspect")}, - {'i', QLatin1String("ichname")}, - {'i', QLatin1String("ident")}, - {'i', QLatin1String("idtopoint")}, - {'i', QLatin1String("idtoprim")}, - {'i', QLatin1String("iend")}, - {'i', QLatin1String("iendtime")}, - {'i', QLatin1String("ihasplane")}, - {'i', QLatin1String("import")}, - {'i', QLatin1String("ingroup")}, - {'i', QLatin1String("inpointgroup")}, - {'i', QLatin1String("inprimgroup")}, - {'i', QLatin1String("insert")}, - {'i', QLatin1String("instance")}, - {'i', QLatin1String("interpolate")}, - {'i', QLatin1String("intersect")}, - {'i', QLatin1String("intersect_all")}, - {'i', QLatin1String("intersect_lights")}, - {'i', QLatin1String("inumplanes")}, - {'i', QLatin1String("invert")}, - {'i', QLatin1String("invertexgroup")}, - {'i', QLatin1String("iplaneindex")}, - {'i', QLatin1String("iplanename")}, - {'i', QLatin1String("iplanesize")}, - {'i', QLatin1String("irate")}, - {'i', QLatin1String("irradiance")}, - {'i', QLatin1String("isalpha")}, - {'i', QLatin1String("isbound")}, - {'i', QLatin1String("isconnected")}, - {'i', QLatin1String("isdigit")}, - {'i', QLatin1String("isfinite")}, - {'i', QLatin1String("isfogray")}, - {'i', QLatin1String("isframes")}, - {'i', QLatin1String("isnan")}, - {'i', QLatin1String("isotropic")}, - {'i', QLatin1String("israytracing")}, - {'i', QLatin1String("issamples")}, - {'i', QLatin1String("isseconds")}, - {'i', QLatin1String("isshadowray")}, - {'i', QLatin1String("istart")}, - {'i', QLatin1String("istarttime")}, - {'i', QLatin1String("isuvrendering")}, - {'i', QLatin1String("isvalidindex")}, - {'i', QLatin1String("isvarying")}, - {'i', QLatin1String("itoa")}, - {'i', QLatin1String("ixres")}, - {'i', QLatin1String("iyres")}, - {'j', QLatin1String("join")}, - {'k', QLatin1String("kspline")}, - {'l', QLatin1String("len")}, - {'l', QLatin1String("length")}, - {'l', QLatin1String("length2")}, - {'l', QLatin1String("lerp")}, - {'l', QLatin1String("lightid")}, - {'l', QLatin1String("limit_sample_space")}, - {'l', QLatin1String("limport")}, - {'l', QLatin1String("lkspline")}, - {'l', QLatin1String("log")}, - {'l', QLatin1String("log10")}, - {'l', QLatin1String("lookat")}, - {'l', QLatin1String("lspline")}, - {'l', QLatin1String("lstrip")}, - {'l', QLatin1String("luminance")}, - {'l', QLatin1String("lumname")}, - {'m', QLatin1String("makebasis")}, - {'m', QLatin1String("maketransform")}, - {'m', QLatin1String("maskname")}, - {'m', QLatin1String("match")}, - {'m', QLatin1String("matchvex_blinn")}, - {'m', QLatin1String("matchvex_specular")}, - {'m', QLatin1String("mattrib")}, - {'m', QLatin1String("max")}, - {'m', QLatin1String("mdensity")}, - {'m', QLatin1String("metaimport")}, - {'m', QLatin1String("metamarch")}, - {'m', QLatin1String("metanext")}, - {'m', QLatin1String("metastart")}, - {'m', QLatin1String("metaweight")}, - {'m', QLatin1String("min")}, - {'m', QLatin1String("minpos")}, - {'m', QLatin1String("mspace")}, - {'n', QLatin1String("nametopoint")}, - {'n', QLatin1String("nametoprim")}, - {'n', QLatin1String("nbouncetypes")}, - {'n', QLatin1String("nearpoint")}, - {'n', QLatin1String("nearpoints")}, - {'n', QLatin1String("neighbour")}, - {'n', QLatin1String("neighbourcount")}, - {'n', QLatin1String("neighbours")}, - {'n', QLatin1String("newgroup")}, - {'n', QLatin1String("newsampler")}, - {'n', QLatin1String("nextsample")}, - {'n', QLatin1String("ninput")}, - {'n', QLatin1String("noise")}, - {'n', QLatin1String("noised")}, - {'n', QLatin1String("normal_bsdf")}, - {'n', QLatin1String("normalize")}, - {'n', QLatin1String("normalname")}, - {'n', QLatin1String("npoints")}, - {'n', QLatin1String("npointsgroup")}, - {'n', QLatin1String("nprimitives")}, - {'n', QLatin1String("nprimitivesgroup")}, - {'n', QLatin1String("nrandom")}, - {'n', QLatin1String("ntransform")}, - {'n', QLatin1String("nuniqueval")}, - {'n', QLatin1String("nvertices")}, - {'n', QLatin1String("nverticesgroup")}, - {'o', QLatin1String("occlusion")}, - {'o', QLatin1String("onoise")}, - {'o', QLatin1String("opdigits")}, - {'o', QLatin1String("opend")}, - {'o', QLatin1String("opfullpath")}, - {'o', QLatin1String("opstart")}, - {'o', QLatin1String("optransform")}, - {'o', QLatin1String("ord")}, - {'o', QLatin1String("osd_facecount")}, - {'o', QLatin1String("osd_firstpatch")}, - {'o', QLatin1String("osd_limitsurface")}, - {'o', QLatin1String("osd_limitsurfacevertex")}, - {'o', QLatin1String("osd_patchcount")}, - {'o', QLatin1String("osd_patches")}, - {'o', QLatin1String("outerproduct")}, - {'o', QLatin1String("ow_nspace")}, - {'o', QLatin1String("ow_space")}, - {'o', QLatin1String("ow_vspace")}, - {'p', QLatin1String("pack_inttosafefloat")}, - {'p', QLatin1String("pathtrace")}, - {'p', QLatin1String("pcclose")}, - {'p', QLatin1String("pcconvex")}, - {'p', QLatin1String("pcexport")}, - {'p', QLatin1String("pcfarthest")}, - {'p', QLatin1String("pcfilter")}, - {'p', QLatin1String("pcfind")}, - {'p', QLatin1String("pcfind_radius")}, - {'p', QLatin1String("pcgenerate")}, - {'p', QLatin1String("pcimport")}, - {'p', QLatin1String("pcimportbyidx3")}, - {'p', QLatin1String("pcimportbyidx4")}, - {'p', QLatin1String("pcimportbyidxf")}, - {'p', QLatin1String("pcimportbyidxi")}, - {'p', QLatin1String("pcimportbyidxp")}, - {'p', QLatin1String("pcimportbyidxs")}, - {'p', QLatin1String("pcimportbyidxv")}, - {'p', QLatin1String("pciterate")}, - {'p', QLatin1String("pcnumfound")}, - {'p', QLatin1String("pcopen")}, - {'p', QLatin1String("pcopenlod")}, - {'p', QLatin1String("pcsampleleaf")}, - {'p', QLatin1String("pcsize")}, - {'p', QLatin1String("pcunshaded")}, - {'p', QLatin1String("pcwrite")}, - {'p', QLatin1String("pgfind")}, - {'p', QLatin1String("phong")}, - {'p', QLatin1String("phongBRDF")}, - {'p', QLatin1String("phonglobe")}, - {'p', QLatin1String("photonmap")}, - {'p', QLatin1String("planeindex")}, - {'p', QLatin1String("planename")}, - {'p', QLatin1String("planesize")}, - {'p', QLatin1String("pluralize")}, - {'p', QLatin1String("pnoise")}, - {'p', QLatin1String("point")}, - {'p', QLatin1String("pointattrib")}, - {'p', QLatin1String("pointattribsize")}, - {'p', QLatin1String("pointattribtype")}, - {'p', QLatin1String("pointattribtypeinfo")}, - {'p', QLatin1String("pointedge")}, - {'p', QLatin1String("pointhedge")}, - {'p', QLatin1String("pointhedgenext")}, - {'p', QLatin1String("pointname")}, - {'p', QLatin1String("pointprims")}, - {'p', QLatin1String("pointvertex")}, - {'p', QLatin1String("pointvertices")}, - {'p', QLatin1String("polardecomp")}, - {'p', QLatin1String("pop")}, - {'p', QLatin1String("pow")}, - {'p', QLatin1String("prim")}, - {'p', QLatin1String("prim_attribute")}, - {'p', QLatin1String("prim_normal")}, - {'p', QLatin1String("primattrib")}, - {'p', QLatin1String("primattribsize")}, - {'p', QLatin1String("primattribtype")}, - {'p', QLatin1String("primattribtypeinfo")}, - {'p', QLatin1String("primhedge")}, - {'p', QLatin1String("primintrinsic")}, - {'p', QLatin1String("primpoint")}, - {'p', QLatin1String("primpoints")}, - {'p', QLatin1String("primuv")}, - {'p', QLatin1String("primvertex")}, - {'p', QLatin1String("primvertexcount")}, - {'p', QLatin1String("primvertices")}, - {'p', QLatin1String("print_once")}, - {'p', QLatin1String("printf")}, - {'p', QLatin1String("product")}, - {'p', QLatin1String("ptexture")}, - {'p', QLatin1String("ptlined")}, - {'p', QLatin1String("ptransform")}, - {'p', QLatin1String("push")}, - {'q', QLatin1String("qconvert")}, - {'q', QLatin1String("qdistance")}, - {'q', QLatin1String("qinvert")}, - {'q', QLatin1String("qmultiply")}, - {'q', QLatin1String("qrotate")}, - {'q', QLatin1String("quaternion")}, - {'r', QLatin1String("radians")}, - {'r', QLatin1String("rand")}, - {'r', QLatin1String("random")}, - {'r', QLatin1String("random_fhash")}, - {'r', QLatin1String("random_ihash")}, - {'r', QLatin1String("random_shash")}, - {'r', QLatin1String("random_sobol")}, - {'r', QLatin1String("rawbumpmap")}, - {'r', QLatin1String("rawbumpmapA")}, - {'r', QLatin1String("rawbumpmapB")}, - {'r', QLatin1String("rawbumpmapG")}, - {'r', QLatin1String("rawbumpmapL")}, - {'r', QLatin1String("rawbumpmapR")}, - {'r', QLatin1String("rawcolormap")}, - {'r', QLatin1String("rayhittest")}, - {'r', QLatin1String("rayimport")}, - {'r', QLatin1String("re_find")}, - {'r', QLatin1String("re_findall")}, - {'r', QLatin1String("re_match")}, - {'r', QLatin1String("re_replace")}, - {'r', QLatin1String("re_split")}, - {'r', QLatin1String("reflect")}, - {'r', QLatin1String("reflectlight")}, - {'r', QLatin1String("refract")}, - {'r', QLatin1String("refractlight")}, - {'r', QLatin1String("relativepath")}, - {'r', QLatin1String("relbbox")}, - {'r', QLatin1String("relpointbbox")}, - {'r', QLatin1String("removegroup")}, - {'r', QLatin1String("removeindex")}, - {'r', QLatin1String("removepoint")}, - {'r', QLatin1String("removeprim")}, - {'r', QLatin1String("removevalue")}, - {'r', QLatin1String("renderstate")}, - {'r', QLatin1String("reorder")}, - {'r', QLatin1String("resample_linear")}, - {'r', QLatin1String("resize")}, - {'r', QLatin1String("resolvemissedray")}, - {'r', QLatin1String("reverse")}, - {'r', QLatin1String("rgbtohsv")}, - {'r', QLatin1String("rgbtoxyz")}, - {'r', QLatin1String("rint")}, - {'r', QLatin1String("rotate")}, - {'r', QLatin1String("rotate_x_to")}, - {'r', QLatin1String("rstrip")}, - {'s', QLatin1String("sample_bsdf")}, - {'s', QLatin1String("sample_cauchy")}, - {'s', QLatin1String("sample_circle_arc")}, - {'s', QLatin1String("sample_circle_edge_uniform")}, - {'s', QLatin1String("sample_circle_slice")}, - {'s', QLatin1String("sample_circle_uniform")}, - {'s', QLatin1String("sample_direction_cone")}, - {'s', QLatin1String("sample_direction_uniform")}, - {'s', QLatin1String("sample_discrete")}, - {'s', QLatin1String("sample_exponential")}, - {'s', QLatin1String("sample_geometry")}, - {'s', QLatin1String("sample_hemisphere")}, - {'s', QLatin1String("sample_hypersphere_cone")}, - {'s', QLatin1String("sample_hypersphere_uniform")}, - {'s', QLatin1String("sample_light")}, - {'s', QLatin1String("sample_lognormal")}, - {'s', QLatin1String("sample_lognormal_by_median")}, - {'s', QLatin1String("sample_normal")}, - {'s', QLatin1String("sample_orientation_cone")}, - {'s', QLatin1String("sample_orientation_uniform")}, - {'s', QLatin1String("sample_photon")}, - {'s', QLatin1String("sample_sphere_cone")}, - {'s', QLatin1String("sample_sphere_uniform")}, - {'s', QLatin1String("sampledisk")}, - {'s', QLatin1String("scale")}, - {'s', QLatin1String("select")}, - {'s', QLatin1String("sensor_panorama_create")}, - {'s', QLatin1String("sensor_panorama_getcolor")}, - {'s', QLatin1String("sensor_panorama_getcone")}, - {'s', QLatin1String("sensor_panorama_getdepth")}, - {'s', QLatin1String("sensor_save")}, - {'s', QLatin1String("serialize")}, - {'s', QLatin1String("set")}, - {'s', QLatin1String("setagentclipnames")}, - {'s', QLatin1String("setagentcliptimes")}, - {'s', QLatin1String("setagentclipweights")}, - {'s', QLatin1String("setagentcollisionlayer")}, - {'s', QLatin1String("setagentcurrentlayer")}, - {'s', QLatin1String("setagentlocaltransform")}, - {'s', QLatin1String("setagentlocaltransforms")}, - {'s', QLatin1String("setagentworldtransform")}, - {'s', QLatin1String("setagentworldtransforms")}, - {'s', QLatin1String("setattrib")}, - {'s', QLatin1String("setattribtypeinfo")}, - {'s', QLatin1String("setcomp")}, - {'s', QLatin1String("setcurrentlight")}, - {'s', QLatin1String("setdetailattrib")}, - {'s', QLatin1String("setpointattrib")}, - {'s', QLatin1String("setpointgroup")}, - {'s', QLatin1String("setprimattrib")}, - {'s', QLatin1String("setprimgroup")}, - {'s', QLatin1String("setprimintrinsic")}, - {'s', QLatin1String("setprimvertex")}, - {'s', QLatin1String("setsamplestore")}, - {'s', QLatin1String("setvertexattrib")}, - {'s', QLatin1String("setvertexgroup")}, - {'s', QLatin1String("setvertexpoint")}, - {'s', QLatin1String("shadow")}, - {'s', QLatin1String("shadow_light")}, - {'s', QLatin1String("shadowmap")}, - {'s', QLatin1String("shimport")}, - {'s', QLatin1String("shl")}, - {'s', QLatin1String("shr")}, - {'s', QLatin1String("shrz")}, - {'s', QLatin1String("sign")}, - {'s', QLatin1String("simport")}, - {'s', QLatin1String("sin")}, - {'s', QLatin1String("sinh")}, - {'s', QLatin1String("sleep")}, - {'s', QLatin1String("slerp")}, - {'s', QLatin1String("slice")}, - {'s', QLatin1String("slideframe")}, - {'s', QLatin1String("smooth")}, - {'s', QLatin1String("smoothrotation")}, - {'s', QLatin1String("snoise")}, - {'s', QLatin1String("solvecubic")}, - {'s', QLatin1String("solvepoly")}, - {'s', QLatin1String("solvequadratic")}, - {'s', QLatin1String("sort")}, - {'s', QLatin1String("specular")}, - {'s', QLatin1String("specularBRDF")}, - {'s', QLatin1String("spline")}, - {'s', QLatin1String("split")}, - {'s', QLatin1String("splitpath")}, - {'s', QLatin1String("sprintf")}, - {'s', QLatin1String("sqrt")}, - {'s', QLatin1String("startswith")}, - {'s', QLatin1String("storelightexport")}, - {'s', QLatin1String("strip")}, - {'s', QLatin1String("strlen")}, - {'s', QLatin1String("sum")}, - {'s', QLatin1String("switch")}, - {'s', QLatin1String("swizzle")}, - {'t', QLatin1String("tan")}, - {'t', QLatin1String("tanh")}, - {'t', QLatin1String("tet_adjacent")}, - {'t', QLatin1String("tet_faceindex")}, - {'t', QLatin1String("teximport")}, - {'t', QLatin1String("texprintf")}, - {'t', QLatin1String("texture")}, - {'t', QLatin1String("texture3d")}, - {'t', QLatin1String("texture3dBox")}, - {'t', QLatin1String("titlecase")}, - {'t', QLatin1String("toNDC")}, - {'t', QLatin1String("tolower")}, - {'t', QLatin1String("toupper")}, - {'t', QLatin1String("trace")}, - {'t', QLatin1String("translate")}, - {'t', QLatin1String("translucent")}, - {'t', QLatin1String("transpose")}, - {'t', QLatin1String("trunc")}, - {'t', QLatin1String("tw_nspace")}, - {'t', QLatin1String("tw_space")}, - {'t', QLatin1String("tw_vspace")}, - {'u', QLatin1String("uniqueval")}, - {'u', QLatin1String("unpack_intfromsafefloat")}, - {'u', QLatin1String("unserialize")}, - {'u', QLatin1String("upush")}, - {'u', QLatin1String("uvunwrap")}, - {'v', QLatin1String("variance")}, - {'v', QLatin1String("velocityname")}, - {'v', QLatin1String("vertex")}, - {'v', QLatin1String("vertexattrib")}, - {'v', QLatin1String("vertexattribsize")}, - {'v', QLatin1String("vertexattribtype")}, - {'v', QLatin1String("vertexattribtypeinfo")}, - {'v', QLatin1String("vertexhedge")}, - {'v', QLatin1String("vertexindex")}, - {'v', QLatin1String("vertexnext")}, - {'v', QLatin1String("vertexpoint")}, - {'v', QLatin1String("vertexprev")}, - {'v', QLatin1String("vertexprim")}, - {'v', QLatin1String("vertexprimindex")}, - {'v', QLatin1String("vnoise")}, - {'v', QLatin1String("volume")}, - {'v', QLatin1String("volumegradient")}, - {'v', QLatin1String("volumeindex")}, - {'v', QLatin1String("volumeindexorigin")}, - {'v', QLatin1String("volumeindextopos")}, - {'v', QLatin1String("volumeindexv")}, - {'v', QLatin1String("volumepostoindex")}, - {'v', QLatin1String("volumeres")}, - {'v', QLatin1String("volumesample")}, - {'v', QLatin1String("volumesamplev")}, - {'v', QLatin1String("vtransform")}, - {'w', QLatin1String("warning")}, - {'w', QLatin1String("wireblinn")}, - {'w', QLatin1String("wirediffuse")}, - {'w', QLatin1String("wnoise")}, - {'w', QLatin1String("wo_nspace")}, - {'w', QLatin1String("wo_space")}, - {'w', QLatin1String("wo_vspace")}, - {'w', QLatin1String("writepixel")}, - {'w', QLatin1String("wt_nspace")}, - {'w', QLatin1String("wt_space")}, - {'w', QLatin1String("wt_vspace")}, - {'x', QLatin1String("xnoise")}, - {'x', QLatin1String("xnoised")}, - {'x', QLatin1String("xyzdist")}, - {'x', QLatin1String("xyztorgb")}}; - vex_other = { - {('d'), QLatin1String("define")}, {('e'), QLatin1String("else")}, - {('e'), QLatin1String("endif")}, {('i'), QLatin1String("if")}, - {('i'), QLatin1String("ifdef")}, {('i'), QLatin1String("ifndef")}, - {('i'), QLatin1String("include")}, {('p'), QLatin1String("pragma")}, - {('u'), QLatin1String("undef")}, - }; -} -void loadVEXData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other) -{ - if (!vexDataInitialized) - { - initVEXData(); - vexDataInitialized = true; - } - types = vex_types; - keywords = vex_keywords; - builtin = vex_builtin; - literals = vex_literals; - other = vex_other; -} - -/********************************************************/ -/*** CMAKE DATA ***************************************/ -/********************************************************/ -static bool cmakeDataInitialized = false; -static QMultiHash<char, QLatin1String> cmake_keywords; -static QMultiHash<char, QLatin1String> cmake_types; -static QMultiHash<char, QLatin1String> cmake_literals; -static QMultiHash<char, QLatin1String> cmake_builtin; -static QMultiHash<char, QLatin1String> cmake_other; -void initCMakeData() -{ - cmake_keywords = {{'b', QLatin1String("break")}, - {'c', QLatin1String("cmake_host_system_information")}, - {'c', QLatin1String("cmake_minimum_required")}, - {'c', QLatin1String("cmake_parse_arguments")}, - {'c', QLatin1String("cmake_policy")}, - {'c', QLatin1String("configure_file")}, - {'c', QLatin1String("continue")}, - {'e', QLatin1String("elseif")}, - {'e', QLatin1String("else")}, - {'e', QLatin1String("endforeach")}, - {'e', QLatin1String("endfunction")}, - {'e', QLatin1String("endif")}, - {'e', QLatin1String("endmacro")}, - {'e', QLatin1String("endwhile")}, - {'e', QLatin1String("execute_process")}, - {'f', QLatin1String("file")}, - {'f', QLatin1String("find_file")}, - {'f', QLatin1String("find_library")}, - {'f', QLatin1String("find_package")}, - {'f', QLatin1String("find_path")}, - {'f', QLatin1String("find_program")}, - {'f', QLatin1String("foreach")}, - {'f', QLatin1String("function")}, - {'g', QLatin1String("get_cmake_property")}, - {'g', QLatin1String("get_directory_property")}, - {'g', QLatin1String("get_filename_component")}, - {'g', QLatin1String("get_property")}, - {'i', QLatin1String("if")}, - {'i', QLatin1String("include")}, - {'i', QLatin1String("include_guard")}, - {'l', QLatin1String("list")}, - {'m', QLatin1String("macro")}, - {'m', QLatin1String("mark_as_advanced")}, - {'m', QLatin1String("math")}, - {'m', QLatin1String("message")}, - {'o', QLatin1String("option")}, - {'r', QLatin1String("return")}, - {'s', QLatin1String("separate_arguments")}, - {'s', QLatin1String("set_directory_properties")}, - {'s', QLatin1String("set")}, - {'s', QLatin1String("set_property")}, - {'s', QLatin1String("site_name")}, - {'s', QLatin1String("string")}, - {'u', QLatin1String("unset")}, - {'v', QLatin1String("variable_watch")}, - {'w', QLatin1String("while")}, - {'a', QLatin1String("add_compile_definitions")}, - {'a', QLatin1String("add_compile_options")}, - {'A', QLatin1String("ADD_COMPILE_OPTIONS")}, - {'a', QLatin1String("add_custom_command")}, - {'a', QLatin1String("add_custom_target")}, - {'a', QLatin1String("add_definitions")}, - {'a', QLatin1String("add_dependencies")}, - {'a', QLatin1String("add_executable")}, - {'a', QLatin1String("add_library")}, - {'a', QLatin1String("add_link_options")}, - {'a', QLatin1String("add_subdirectory")}, - {'a', QLatin1String("add_test")}, - {'a', QLatin1String("aux_source_directory")}, - {'b', QLatin1String("build_command")}, - {'c', QLatin1String("create_test_sourcelist")}, - {'d', QLatin1String("define_property")}, - {'e', QLatin1String("enable_language")}, - {'e', QLatin1String("enable_testing")}, - {'e', QLatin1String("export")}, - {'f', QLatin1String("fltk_wrap_ui")}, - {'g', QLatin1String("get_source_file_property")}, - {'g', QLatin1String("get_target_property")}, - {'g', QLatin1String("get_test_property")}, - {'i', QLatin1String("include_directories")}, - {'i', QLatin1String("include_external_msproject")}, - {'i', QLatin1String("include_regular_expression")}, - {'i', QLatin1String("install")}, - {'l', QLatin1String("link_directories")}, - {'l', QLatin1String("link_libraries")}, - {'l', QLatin1String("load_cache")}, - {'p', QLatin1String("project")}, - {'q', QLatin1String("qt_wrap_cpp")}, - {'q', QLatin1String("qt_wrap_ui")}, - {'r', QLatin1String("remove_definitions")}, - {'s', QLatin1String("set_source_files_properties")}, - {'s', QLatin1String("set_target_properties")}, - {'s', QLatin1String("set_tests_properties")}, - {'s', QLatin1String("source_group")}, - {'t', QLatin1String("target_compile_definitions")}, - {'t', QLatin1String("target_compile_features")}, - {'t', QLatin1String("target_compile_options")}, - {'t', QLatin1String("target_include_directories")}, - {'t', QLatin1String("target_link_directories")}, - {'t', QLatin1String("target_link_libraries")}, - {'t', QLatin1String("target_link_options")}, - {'t', QLatin1String("target_sources")}, - {'t', QLatin1String("try_compile")}, - {'t', QLatin1String("try_run")}, - {'c', QLatin1String("ctest_build")}, - {'c', QLatin1String("ctest_configure")}, - {'c', QLatin1String("ctest_coverage")}, - {'c', QLatin1String("ctest_empty_binary_directory")}, - {'c', QLatin1String("ctest_memcheck")}, - {'c', QLatin1String("ctest_read_custom_files")}, - {'c', QLatin1String("ctest_run_script")}, - {'c', QLatin1String("ctest_sleep")}, - {'c', QLatin1String("ctest_start")}, - {'c', QLatin1String("ctest_submit")}, - {'c', QLatin1String("ctest_test")}, - {'c', QLatin1String("ctest_update")}, - {'c', QLatin1String("ctest_upload")}, - {'b', QLatin1String("build_name")}, - {'e', QLatin1String("exec_program")}, - {'e', QLatin1String("export_library_dependencies")}, - {'i', QLatin1String("install_files")}, - {'i', QLatin1String("install_programs")}, - {'i', QLatin1String("install_targets")}, - {'l', QLatin1String("load_command")}, - {'m', QLatin1String("make_directory")}, - {'o', QLatin1String("output_required_files")}, - {'r', QLatin1String("remove")}, - {'s', QLatin1String("subdir_depends")}, - {'s', QLatin1String("subdirs")}, - {'u', QLatin1String("use_mangled_mesa")}, - {'u', QLatin1String("utility_source")}, - {'v', QLatin1String("variable_requires")}, - {'w', QLatin1String("write_file")}, - {'q', QLatin1String("qt5_use_modules")}, - {'q', QLatin1String("qt5_use_package")}, - {'q', QLatin1String("qt5_wrap_cpp")}, - {'a', QLatin1String("and")}, - {'o', QLatin1String("or")}, - {'n', QLatin1String("not")}, - {'c', QLatin1String("command")}, - {'p', QLatin1String("policy")}, - {'t', QLatin1String("target")}, - {'t', QLatin1String("test")}, - {'e', QLatin1String("exists")}, - {'i', QLatin1String("is_newer_than")}, - {'i', QLatin1String("is_directory")}, - {'i', QLatin1String("is_symlink")}, - {'i', QLatin1String("is_absolute")}, - {'m', QLatin1String("matches")}, - {'l', QLatin1String("less")}, - {'g', QLatin1String("greater")}, - {'e', QLatin1String("equal")}, - {'l', QLatin1String("less_equal")}, - {'g', QLatin1String("greater_equal")}, - {'s', QLatin1String("strless")}, - {'s', QLatin1String("strgreater")}, - {'s', QLatin1String("strequal")}, - {'s', QLatin1String("strless_equal")}, - {'s', QLatin1String("strgreater_equal")}, - {'v', QLatin1String("version_less")}, - {'v', QLatin1String("version_greater")}, - {'v', QLatin1String("version_equal")}, - {'v', QLatin1String("version_less_equal")}, - {'v', QLatin1String("version_greater_equal")}, - {'i', QLatin1String("in_list")}, - {'d', QLatin1String("defined")}}; - cmake_types = {}; - cmake_literals - = {{'o', QLatin1String("on")}, {'o', QLatin1String("off")}, - {'O', QLatin1String("ON")}, {'O', QLatin1String("OFF")}, - {'t', QLatin1String("true")}, {'f', QLatin1String("false")}, - {'T', QLatin1String("TRUE")}, {'F', QLatin1String("FALSE")}}; - cmake_builtin = {{'A', QLatin1String("ALLOW_DUPLICATE_CUSTOM_TARGETS")}, - {'A', QLatin1String("AUTOGEN_TARGETS_FOLDER")}, - {'A', QLatin1String("AUTOMOC_TARGETS_FOLDER")}, - {'D', QLatin1String("DEBUG_CONFIGURATIONS")}, - {'D', QLatin1String("DISABLED_FEATURES")}, - {'E', QLatin1String("ENABLED_FEATURES")}, - {'E', QLatin1String("ENABLED_LANGUAGES")}, - {'F', QLatin1String("FIND_LIBRARY_USE_LIB64_PATHS")}, - {'F', QLatin1String("FIND_LIBRARY_USE_OPENBSD_VERSIONING")}, - {'G', QLatin1String("GLOBAL_DEPENDS_DEBUG_MODE")}, - {'G', QLatin1String("GLOBAL_DEPENDS_NO_CYCLES")}, - {'I', QLatin1String("IN_TRY_COMPILE")}, - {'P', QLatin1String("PACKAGES_FOUND")}, - {'P', QLatin1String("PACKAGES_NOT_FOUND")}, - {'J', QLatin1String("JOB_POOLS")}, - {'P', QLatin1String("PREDEFINED_TARGETS_FOLDER")}, - {'E', QLatin1String("ECLIPSE_EXTRA_NATURES")}, - {'R', QLatin1String("REPORT_UNDEFINED_PROPERTIES")}, - {'R', QLatin1String("RULE_LAUNCH_COMPILE")}, - {'R', QLatin1String("RULE_LAUNCH_CUSTOM")}, - {'R', QLatin1String("RULE_LAUNCH_LINK")}, - {'R', QLatin1String("RULE_MESSAGES")}, - {'T', QLatin1String("TARGET_ARCHIVES_MAY_BE_SHARED_LIBS")}, - {'T', QLatin1String("TARGET_SUPPORTS_SHARED_LIBS")}, - {'U', QLatin1String("USE_FOLDERS")}, - {'A', QLatin1String("ADDITIONAL_MAKE_CLEAN_FILES")}, - {'C', QLatin1String("CACHE_VARIABLES")}, - {'C', QLatin1String("CLEAN_NO_CUSTOM")}, - {'C', QLatin1String("CMAKE_CONFIGURE_DEPENDS")}, - {'C', QLatin1String("COMPILE_DEFINITIONS")}, - {'C', QLatin1String("COMPILE_OPTIONS")}, - {'D', QLatin1String("DEFINITIONS")}, - {'E', QLatin1String("EXCLUDE_FROM_ALL")}, - {'I', QLatin1String("IMPLICIT_DEPENDS_INCLUDE_TRANSFORM")}, - {'I', QLatin1String("INCLUDE_DIRECTORIES")}, - {'I', QLatin1String("INCLUDE_REGULAR_EXPRESSION")}, - {'I', QLatin1String("INTERPROCEDURAL_OPTIMIZATION")}, - {'L', QLatin1String("LINK_DIRECTORIES")}, - {'L', QLatin1String("LISTFILE_STACK")}, - {'M', QLatin1String("MACROS")}, - {'P', QLatin1String("PARENT_DIRECTORY")}, - {'R', QLatin1String("RULE_LAUNCH_COMPILE")}, - {'R', QLatin1String("RULE_LAUNCH_CUSTOM")}, - {'R', QLatin1String("RULE_LAUNCH_LINK")}, - {'T', QLatin1String("TEST_INCLUDE_FILE")}, - {'V', QLatin1String("VARIABLES")}, - {'A', QLatin1String("ALIASED_TARGET")}, - {'A', QLatin1String("ARCHIVE_OUTPUT_DIRECTORY")}, - {'A', QLatin1String("ARCHIVE_OUTPUT_NAME")}, - {'A', QLatin1String("AUTOGEN_TARGET_DEPENDS")}, - {'A', QLatin1String("AUTOMOC_MOC_OPTIONS")}, - {'A', QLatin1String("AUTOMOC")}, - {'A', QLatin1String("AUTOUIC")}, - {'A', QLatin1String("AUTOUIC_OPTIONS")}, - {'A', QLatin1String("AUTORCC")}, - {'A', QLatin1String("AUTORCC_OPTIONS")}, - {'B', QLatin1String("BUILD_WITH_INSTALL_RPATH")}, - {'B', QLatin1String("BUNDLE_EXTENSION")}, - {'B', QLatin1String("BUNDLE")}, - {'C', QLatin1String("COMPATIBLE_INTERFACE_BOOL")}, - {'C', QLatin1String("COMPATIBLE_INTERFACE_NUMBER_MAX")}, - {'C', QLatin1String("COMPATIBLE_INTERFACE_NUMBER_MIN")}, - {'C', QLatin1String("COMPATIBLE_INTERFACE_STRING")}, - {'C', QLatin1String("COMPILE_DEFINITIONS")}, - {'C', QLatin1String("COMPILE_FLAGS")}, - {'C', QLatin1String("COMPILE_OPTIONS")}, - {'D', QLatin1String("DEBUG_POSTFIX")}, - {'D', QLatin1String("DEFINE_SYMBOL")}, - {'E', QLatin1String("EchoString")}, - {'E', QLatin1String("ENABLE_EXPORTS")}, - {'E', QLatin1String("EXCLUDE_FROM_ALL")}, - {'E', QLatin1String("EXCLUDE_FROM_DEFAULT_BUILD")}, - {'E', QLatin1String("EXPORT_NAME")}, - {'F', QLatin1String("FOLDER")}, - {'F', QLatin1String("Fortran_FORMAT")}, - {'F', QLatin1String("Fortran_MODULE_DIRECTORY")}, - {'F', QLatin1String("FRAMEWORK")}, - {'G', QLatin1String("GENERATOR_FILE_NAME")}, - {'G', QLatin1String("GNUtoMS")}, - {'H', QLatin1String("HAS_CXX")}, - {'I', QLatin1String("IMPLICIT_DEPENDS_INCLUDE_TRANSFORM")}, - {'I', QLatin1String("IMPORTED_CONFIGURATIONS")}, - {'I', QLatin1String("IMPORTED_IMPLIB")}, - {'I', QLatin1String("IMPORTED_LINK_DEPENDENT_LIBRARIES")}, - {'I', QLatin1String("IMPORTED_LINK_INTERFACE_LANGUAGES")}, - {'I', QLatin1String("IMPORTED_LINK_INTERFACE_LIBRARIES")}, - {'I', QLatin1String("IMPORTED_LINK_INTERFACE_MULTIPLICITY")}, - {'I', QLatin1String("IMPORTED_LOCATION")}, - {'I', QLatin1String("IMPORTED_NO_SONAME")}, - {'I', QLatin1String("IMPORTED")}, - {'I', QLatin1String("IMPORTED_SONAME")}, - {'I', QLatin1String("IMPORT_PREFIX")}, - {'I', QLatin1String("IMPORT_SUFFIX")}, - {'I', QLatin1String("INCLUDE_DIRECTORIES")}, - {'I', QLatin1String("INSTALL_NAME_DIR")}, - {'I', QLatin1String("INSTALL_RPATH")}, - {'I', QLatin1String("INSTALL_RPATH_USE_LINK_PATH")}, - {'I', QLatin1String("INTERFACE_AUTOUIC_OPTIONS")}, - {'I', QLatin1String("INTERFACE_COMPILE_DEFINITIONS")}, - {'I', QLatin1String("INTERFACE_COMPILE_OPTIONS")}, - {'I', QLatin1String("INTERFACE_INCLUDE_DIRECTORIES")}, - {'I', QLatin1String("INTERFACE_LINK_LIBRARIES")}, - {'I', QLatin1String("INTERFACE_POSITION_INDEPENDENT_CODE")}, - {'I', QLatin1String("INTERFACE_SYSTEM_INCLUDE_DIRECTORIES")}, - {'I', QLatin1String("INTERPROCEDURAL_OPTIMIZATION")}, - {'J', QLatin1String("JOB_POOL_COMPILE")}, - {'J', QLatin1String("JOB_POOL_LINK")}, - {'L', QLatin1String("LABELS")}, - {'L', QLatin1String("LIBRARY_OUTPUT_DIRECTORY")}, - {'L', QLatin1String("LIBRARY_OUTPUT_NAME")}, - {'L', QLatin1String("LINK_DEPENDS_NO_SHARED")}, - {'L', QLatin1String("LINK_DEPENDS")}, - {'L', QLatin1String("LINKER_LANGUAGE")}, - {'L', QLatin1String("LINK_FLAGS")}, - {'L', QLatin1String("LINK_INTERFACE_LIBRARIES")}, - {'L', QLatin1String("LINK_INTERFACE_MULTIPLICITY")}, - {'L', QLatin1String("LINK_LIBRARIES")}, - {'L', QLatin1String("LINK_SEARCH_END_STATIC")}, - {'L', QLatin1String("LINK_SEARCH_START_STATIC")}, - {'L', QLatin1String("LOCATION")}, - {'M', QLatin1String("MACOSX_BUNDLE_INFO_PLIST")}, - {'M', QLatin1String("MACOSX_BUNDLE")}, - {'M', QLatin1String("MACOSX_FRAMEWORK_INFO_PLIST")}, - {'M', QLatin1String("MACOSX_RPATH")}, - // {'N', QLatin1String("NAME")}, - {'N', QLatin1String("NO_SONAME")}, - {'N', QLatin1String("NO_SYSTEM_FROM_IMPORTED")}, - {'O', QLatin1String("OSX_ARCHITECTURES")}, - {'O', QLatin1String("OUTPUT_NAME")}, - {'P', QLatin1String("PDB_NAME")}, - {'P', QLatin1String("PDB_OUTPUT_DIRECTORY")}, - {'P', QLatin1String("POSITION_INDEPENDENT_CODE")}, - {'P', QLatin1String("POST_INSTALL_SCRIPT")}, - {'P', QLatin1String("PREFIX")}, - {'P', QLatin1String("PROPERTY")}, - {'P', QLatin1String("PRE_INSTALL_SCRIPT")}, - {'P', QLatin1String("PRIVATE_HEADER")}, - {'P', QLatin1String("PROJECT_LABEL")}, - {'P', QLatin1String("PUBLIC_HEADER")}, - {'R', QLatin1String("RESOURCE")}, - {'R', QLatin1String("RULE_LAUNCH_COMPILE")}, - {'R', QLatin1String("RULE_LAUNCH_CUSTOM")}, - {'R', QLatin1String("RULE_LAUNCH_LINK")}, - {'R', QLatin1String("RUNTIME_OUTPUT_DIRECTORY")}, - {'R', QLatin1String("RUNTIME_OUTPUT_NAME")}, - {'S', QLatin1String("SKIP_BUILD_RPATH")}, - {'S', QLatin1String("SOURCES")}, - {'S', QLatin1String("SOVERSION")}, - {'S', QLatin1String("STATIC_LIBRARY_FLAGS")}, - {'S', QLatin1String("SUFFIX")}, - {'T', QLatin1String("TARGET")}, - {'T', QLatin1String("TYPE")}, - {'V', QLatin1String("VERSION")}, - {'V', QLatin1String("VISIBILITY_INLINES_HIDDEN")}, - {'V', QLatin1String("VS_DOTNET_REFERENCES")}, - {'V', QLatin1String("VS_DOTNET_TARGET_FRAMEWORK_VERSION")}, - {'V', QLatin1String("VS_GLOBAL_KEYWORD")}, - {'V', QLatin1String("VS_GLOBAL_PROJECT_TYPES")}, - {'V', QLatin1String("VS_GLOBAL_ROOTNAMESPACE")}, - {'V', QLatin1String("VS_KEYWORD")}, - {'V', QLatin1String("VS_SCC_AUXPATH")}, - {'V', QLatin1String("VS_SCC_LOCALPATH")}, - {'V', QLatin1String("VS_SCC_PROJECTNAME")}, - {'V', QLatin1String("VS_SCC_PROVIDER")}, - {'V', QLatin1String("VS_WINRT_EXTENSIONS")}, - {'V', QLatin1String("VS_WINRT_REFERENCES")}, - {'W', QLatin1String("WIN32_EXECUTABLE")}, - {'A', QLatin1String("ATTACHED_FILES_ON_FAIL")}, - {'A', QLatin1String("ATTACHED_FILES")}, - {'C', QLatin1String("COST")}, - {'D', QLatin1String("DEPENDS")}, - {'E', QLatin1String("ENVIRONMENT")}, - {'F', QLatin1String("FAIL_REGULAR_EXPRESSION")}, - {'L', QLatin1String("LABELS")}, - {'M', QLatin1String("MEASUREMENT")}, - {'P', QLatin1String("PASS_REGULAR_EXPRESSION")}, - {'P', QLatin1String("PROCESSORS")}, - {'R', QLatin1String("REQUIRED_FILES")}, - {'R', QLatin1String("RESOURCE_LOCK")}, - {'R', QLatin1String("RUN_SERIAL")}, - {'S', QLatin1String("SKIP_RETURN_CODE")}, - {'T', QLatin1String("TIMEOUT")}, - {'W', QLatin1String("WILL_FAIL")}, - {'W', QLatin1String("WORKING_DIRECTORY")}, - {'A', QLatin1String("ABSTRACT")}, - {'A', QLatin1String("AUTOUIC_OPTIONS")}, - {'A', QLatin1String("AUTORCC_OPTIONS")}, - {'C', QLatin1String("COMPILE_DEFINITIONS")}, - {'C', QLatin1String("COMPILE_FLAGS")}, - {'E', QLatin1String("EXTERNAL_OBJECT")}, - {'F', QLatin1String("Fortran_FORMAT")}, - {'G', QLatin1String("GENERATED")}, - {'H', QLatin1String("HEADER_FILE_ONLY")}, - {'K', QLatin1String("KEEP_EXTENSION")}, - {'L', QLatin1String("LABELS")}, - // {'L', QLatin1String("LANGUAGE")}, - {'L', QLatin1String("LOCATION")}, - {'M', QLatin1String("MACOSX_PACKAGE_LOCATION")}, - {'O', QLatin1String("OBJECT_DEPENDS")}, - {'O', QLatin1String("OBJECT_OUTPUTS")}, - {'S', QLatin1String("SYMBOLIC")}, - {'W', QLatin1String("WRAP_EXCLUDE")}, - {'A', QLatin1String("ADVANCED")}, - {'H', QLatin1String("HELPSTRING")}, - {'M', QLatin1String("MODIFIED")}, - {'S', QLatin1String("STRINGS")}, - {'T', QLatin1String("TYPE")}, - {'V', QLatin1String("VALUE")}}; - cmake_other - = {{'C', QLatin1String("CMAKE_ARGC")}, - {'C', QLatin1String("CMAKE_ARGV0")}, - {'C', QLatin1String("CMAKE_AR")}, - {'C', QLatin1String("CMAKE_BINARY_DIR")}, - {'C', QLatin1String("CMAKE_BUILD_TOOL")}, - {'C', QLatin1String("CMAKE_CACHEFILE_DIR")}, - {'C', QLatin1String("CMAKE_CACHE_MAJOR_VERSION")}, - {'C', QLatin1String("CMAKE_CACHE_MINOR_VERSION")}, - {'C', QLatin1String("CMAKE_CACHE_PATCH_VERSION")}, - {'C', QLatin1String("CMAKE_CFG_INTDIR")}, - {'C', QLatin1String("CMAKE_COMMAND")}, - {'C', QLatin1String("CMAKE_CROSSCOMPILING")}, - {'C', QLatin1String("CMAKE_CTEST_COMMAND")}, - {'C', QLatin1String("CMAKE_CURRENT_BINARY_DIR")}, - {'C', QLatin1String("CMAKE_CURRENT_LIST_DIR")}, - {'C', QLatin1String("CMAKE_CURRENT_LIST_FILE")}, - {'C', QLatin1String("CMAKE_CURRENT_LIST_LINE")}, - {'C', QLatin1String("CMAKE_CURRENT_SOURCE_DIR")}, - {'C', QLatin1String("CMAKE_DL_LIBS")}, - {'C', QLatin1String("CMAKE_EDIT_COMMAND")}, - {'C', QLatin1String("CMAKE_EXECUTABLE_SUFFIX")}, - {'C', QLatin1String("CMAKE_EXTRA_GENERATOR")}, - {'C', QLatin1String("CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES")}, - {'C', QLatin1String("CMAKE_GENERATOR")}, - {'C', QLatin1String("CMAKE_GENERATOR_TOOLSET")}, - {'C', QLatin1String("CMAKE_HOME_DIRECTORY")}, - {'C', QLatin1String("CMAKE_IMPORT_LIBRARY_PREFIX")}, - {'C', QLatin1String("CMAKE_IMPORT_LIBRARY_SUFFIX")}, - {'C', QLatin1String("CMAKE_JOB_POOL_COMPILE")}, - {'C', QLatin1String("CMAKE_JOB_POOL_LINK")}, - {'C', QLatin1String("CMAKE_LINK_LIBRARY_SUFFIX")}, - {'C', QLatin1String("CMAKE_MAJOR_VERSION")}, - {'C', QLatin1String("CMAKE_MAKE_PROGRAM")}, - {'C', QLatin1String("CMAKE_MINIMUM_REQUIRED_VERSION")}, - {'C', QLatin1String("CMAKE_MINOR_VERSION")}, - {'C', QLatin1String("CMAKE_PARENT_LIST_FILE")}, - {'C', QLatin1String("CMAKE_PATCH_VERSION")}, - {'C', QLatin1String("CMAKE_PROJECT_NAME")}, - {'C', QLatin1String("CMAKE_RANLIB")}, - {'C', QLatin1String("CMAKE_ROOT")}, - {'C', QLatin1String("CMAKE_SCRIPT_MODE_FILE")}, - {'C', QLatin1String("CMAKE_SHARED_LIBRARY_PREFIX")}, - {'C', QLatin1String("CMAKE_SHARED_LIBRARY_SUFFIX")}, - {'C', QLatin1String("CMAKE_SHARED_MODULE_PREFIX")}, - {'C', QLatin1String("CMAKE_SHARED_MODULE_SUFFIX")}, - {'C', QLatin1String("CMAKE_SIZEOF_VOID_P")}, - {'C', QLatin1String("CMAKE_SKIP_INSTALL_RULES")}, - {'C', QLatin1String("CMAKE_SKIP_RPATH")}, - {'C', QLatin1String("CMAKE_SOURCE_DIR")}, - {'C', QLatin1String("CMAKE_STANDARD_LIBRARIES")}, - {'C', QLatin1String("CMAKE_STATIC_LIBRARY_PREFIX")}, - {'C', QLatin1String("CMAKE_STATIC_LIBRARY_SUFFIX")}, - {'C', QLatin1String("CMAKE_TOOLCHAIN_FILE")}, - {'C', QLatin1String("CMAKE_TWEAK_VERSION")}, - {'C', QLatin1String("CMAKE_VERBOSE_MAKEFILE")}, - {'C', QLatin1String("CMAKE_VERSION")}, - {'C', QLatin1String("CMAKE_VS_DEVENV_COMMAND")}, - {'C', QLatin1String("CMAKE_VS_INTEL_Fortran_PROJECT_VERSION")}, - {'C', QLatin1String("CMAKE_VS_MSBUILD_COMMAND")}, - {'C', QLatin1String("CMAKE_VS_MSDEV_COMMAND")}, - {'C', QLatin1String("CMAKE_VS_PLATFORM_TOOLSET")}, - {'C', QLatin1String("CMAKE_XCODE_PLATFORM_TOOLSET")}, - {'P', QLatin1String("PROJECT_BINARY_DIR")}, - // {'P', QLatin1String("PROJECT_NAME")}, - {'P', QLatin1String("PROJECT_SOURCE_DIR")}, - {'P', QLatin1String("PROJECT_VERSION")}, - {'P', QLatin1String("PROJECT_VERSION_MAJOR")}, - {'P', QLatin1String("PROJECT_VERSION_MINOR")}, - {'P', QLatin1String("PROJECT_VERSION_PATCH")}, - {'P', QLatin1String("PROJECT_VERSION_TWEAK")}, - {'B', QLatin1String("BUILD_SHARED_LIBS")}, - {'C', QLatin1String("CMAKE_ABSOLUTE_DESTINATION_FILES")}, - {'C', QLatin1String("CMAKE_APPBUNDLE_PATH")}, - {'C', QLatin1String("CMAKE_AUTOMOC_RELAXED_MODE")}, - {'C', QLatin1String("CMAKE_BACKWARDS_COMPATIBILITY")}, - {'C', QLatin1String("CMAKE_BUILD_TYPE")}, - {'C', QLatin1String("CMAKE_COLOR_MAKEFILE")}, - {'C', QLatin1String("CMAKE_CONFIGURATION_TYPES")}, - {'C', QLatin1String("CMAKE_DEBUG_TARGET_PROPERTIES")}, - {'C', QLatin1String("CMAKE_ERROR_DEPRECATED")}, - {'C', QLatin1String("CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION")}, - {'C', QLatin1String("CMAKE_SYSROOT")}, - {'C', QLatin1String("CMAKE_FIND_LIBRARY_PREFIXES")}, - {'C', QLatin1String("CMAKE_FIND_LIBRARY_SUFFIXES")}, - {'C', QLatin1String("CMAKE_FIND_NO_INSTALL_PREFIX")}, - {'C', QLatin1String("CMAKE_FIND_PACKAGE_WARN_NO_MODULE")}, - {'C', QLatin1String("CMAKE_FIND_ROOT_PATH")}, - {'C', QLatin1String("CMAKE_FIND_ROOT_PATH_MODE_INCLUDE")}, - {'C', QLatin1String("CMAKE_FIND_ROOT_PATH_MODE_LIBRARY")}, - {'C', QLatin1String("CMAKE_FIND_ROOT_PATH_MODE_PACKAGE")}, - {'C', QLatin1String("CMAKE_FIND_ROOT_PATH_MODE_PROGRAM")}, - {'C', QLatin1String("CMAKE_FRAMEWORK_PATH")}, - {'C', QLatin1String("CMAKE_IGNORE_PATH")}, - {'C', QLatin1String("CMAKE_INCLUDE_PATH")}, - {'C', QLatin1String("CMAKE_INCLUDE_DIRECTORIES_BEFORE")}, - {'C', QLatin1String("CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE")}, - {'C', QLatin1String("CMAKE_INSTALL_DEFAULT_COMPONENT_NAME")}, - {'C', QLatin1String("CMAKE_INSTALL_PREFIX")}, - {'C', QLatin1String("CMAKE_LIBRARY_PATH")}, - {'C', QLatin1String("CMAKE_MFC_FLAG")}, - {'C', QLatin1String("CMAKE_MODULE_PATH")}, - {'C', QLatin1String("CMAKE_NOT_USING_CONFIG_FLAGS")}, - {'C', QLatin1String("CMAKE_PREFIX_PATH")}, - {'C', QLatin1String("CMAKE_PROGRAM_PATH")}, - {'C', QLatin1String("CMAKE_SKIP_INSTALL_ALL_DEPENDENCY")}, - {'C', QLatin1String("CMAKE_STAGING_PREFIX")}, - {'C', QLatin1String("CMAKE_SYSTEM_IGNORE_PATH")}, - {'C', QLatin1String("CMAKE_SYSTEM_INCLUDE_PATH")}, - {'C', QLatin1String("CMAKE_SYSTEM_LIBRARY_PATH")}, - {'C', QLatin1String("CMAKE_SYSTEM_PREFIX_PATH")}, - {'C', QLatin1String("CMAKE_SYSTEM_PROGRAM_PATH")}, - {'C', QLatin1String("CMAKE_USER_MAKE_RULES_OVERRIDE")}, - {'C', QLatin1String("CMAKE_WARN_DEPRECATED")}, - {'C', QLatin1String("CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION")}, - {'A', QLatin1String("APPLE")}, - {'B', QLatin1String("BORLAND")}, - {'C', QLatin1String("CMAKE_CL_64")}, - {'C', QLatin1String("CMAKE_COMPILER_2005")}, - {'C', QLatin1String("CMAKE_HOST_APPLE")}, - {'C', QLatin1String("CMAKE_HOST_SYSTEM_NAME")}, - {'C', QLatin1String("CMAKE_HOST_SYSTEM_PROCESSOR")}, - {'C', QLatin1String("CMAKE_HOST_SYSTEM")}, - {'C', QLatin1String("CMAKE_HOST_SYSTEM_VERSION")}, - {'C', QLatin1String("CMAKE_HOST_UNIX")}, - {'C', QLatin1String("CMAKE_HOST_WIN32")}, - {'C', QLatin1String("CMAKE_LIBRARY_ARCHITECTURE_REGEX")}, - {'C', QLatin1String("CMAKE_LIBRARY_ARCHITECTURE")}, - {'C', QLatin1String("CMAKE_OBJECT_PATH_MAX")}, - {'C', QLatin1String("CMAKE_SYSTEM_NAME")}, - {'C', QLatin1String("CMAKE_SYSTEM_PROCESSOR")}, - {'C', QLatin1String("CMAKE_SYSTEM")}, - {'C', QLatin1String("CMAKE_SYSTEM_VERSION")}, - {'C', QLatin1String("CYGWIN")}, - {'E', QLatin1String("ENV")}, - {'M', QLatin1String("MSVC10")}, - {'M', QLatin1String("MSVC11")}, - {'M', QLatin1String("MSVC12")}, - {'M', QLatin1String("MSVC60")}, - {'M', QLatin1String("MSVC70")}, - {'M', QLatin1String("MSVC71")}, - {'M', QLatin1String("MSVC80")}, - {'M', QLatin1String("MSVC90")}, - {'M', QLatin1String("MSVC_IDE")}, - {'M', QLatin1String("MSVC")}, - {'M', QLatin1String("MSVC_VERSION")}, - {'U', QLatin1String("UNIX")}, - {'W', QLatin1String("WIN32")}, - {'X', QLatin1String("XCODE_VERSION")}, - {'C', QLatin1String("CMAKE_ARCHIVE_OUTPUT_DIRECTORY")}, - {'C', QLatin1String("CMAKE_AUTOMOC_MOC_OPTIONS")}, - {'C', QLatin1String("CMAKE_AUTOMOC")}, - {'C', QLatin1String("CMAKE_AUTORCC")}, - {'C', QLatin1String("CMAKE_AUTORCC_OPTIONS")}, - {'C', QLatin1String("CMAKE_AUTOUIC")}, - {'C', QLatin1String("CMAKE_AUTOUIC_OPTIONS")}, - {'C', QLatin1String("CMAKE_BUILD_WITH_INSTALL_RPATH")}, - {'C', QLatin1String("CMAKE_DEBUG_POSTFIX")}, - {'C', QLatin1String("CMAKE_EXE_LINKER_FLAGS")}, - {'C', QLatin1String("CMAKE_Fortran_FORMAT")}, - {'C', QLatin1String("CMAKE_Fortran_MODULE_DIRECTORY")}, - {'C', QLatin1String("CMAKE_GNUtoMS")}, - {'C', QLatin1String("CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE")}, - {'C', QLatin1String("CMAKE_INCLUDE_CURRENT_DIR")}, - {'C', QLatin1String("CMAKE_INSTALL_NAME_DIR")}, - {'C', QLatin1String("CMAKE_INSTALL_RPATH")}, - {'C', QLatin1String("CMAKE_INSTALL_RPATH_USE_LINK_PATH")}, - {'C', QLatin1String("CMAKE_LIBRARY_OUTPUT_DIRECTORY")}, - {'C', QLatin1String("CMAKE_LIBRARY_PATH_FLAG")}, - {'C', QLatin1String("CMAKE_LINK_DEF_FILE_FLAG")}, - {'C', QLatin1String("CMAKE_LINK_DEPENDS_NO_SHARED")}, - {'C', QLatin1String("CMAKE_LINK_INTERFACE_LIBRARIES")}, - {'C', QLatin1String("CMAKE_LINK_LIBRARY_FILE_FLAG")}, - {'C', QLatin1String("CMAKE_LINK_LIBRARY_FLAG")}, - {'C', QLatin1String("CMAKE_MACOSX_BUNDLE")}, - {'C', QLatin1String("CMAKE_MACOSX_RPATH")}, - {'C', QLatin1String("CMAKE_MODULE_LINKER_FLAGS")}, - {'C', QLatin1String("CMAKE_NO_BUILTIN_CHRPATH")}, - {'C', QLatin1String("CMAKE_NO_SYSTEM_FROM_IMPORTED")}, - {'C', QLatin1String("CMAKE_OSX_ARCHITECTURES")}, - {'C', QLatin1String("CMAKE_OSX_DEPLOYMENT_TARGET")}, - {'C', QLatin1String("CMAKE_OSX_SYSROOT")}, - {'C', QLatin1String("CMAKE_PDB_OUTPUT_DIRECTORY")}, - {'C', QLatin1String("CMAKE_POSITION_INDEPENDENT_CODE")}, - {'C', QLatin1String("CMAKE_RUNTIME_OUTPUT_DIRECTORY")}, - {'C', QLatin1String("CMAKE_SHARED_LINKER_FLAGS")}, - {'C', QLatin1String("CMAKE_SKIP_BUILD_RPATH")}, - {'C', QLatin1String("CMAKE_SKIP_INSTALL_RPATH")}, - {'C', QLatin1String("CMAKE_STATIC_LINKER_FLAGS")}, - {'C', QLatin1String("CMAKE_TRY_COMPILE_CONFIGURATION")}, - {'C', QLatin1String("CMAKE_USE_RELATIVE_PATHS")}, - {'C', QLatin1String("CMAKE_VISIBILITY_INLINES_HIDDEN")}, - {'C', QLatin1String("CMAKE_WIN32_EXECUTABLE")}, - {'E', QLatin1String("EXECUTABLE_OUTPUT_PATH")}, - {'L', QLatin1String("LIBRARY_OUTPUT_PATH")}, - {'C', QLatin1String("CMAKE_Fortran_MODDIR_DEFAULT")}, - {'C', QLatin1String("CMAKE_Fortran_MODDIR_FLAG")}, - {'C', QLatin1String("CMAKE_Fortran_MODOUT_FLAG")}, - {'C', QLatin1String("CMAKE_INTERNAL_PLATFORM_ABI")}, - {'C', QLatin1String("CPACK_ABSOLUTE_DESTINATION_FILES")}, - {'C', QLatin1String("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY")}, - {'C', QLatin1String("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION")}, - {'C', QLatin1String("CPACK_INCLUDE_TOPLEVEL_DIRECTORY")}, - {'C', QLatin1String("CPACK_INSTALL_SCRIPT")}, - {'C', QLatin1String("CPACK_PACKAGING_INSTALL_PREFIX")}, - {'C', QLatin1String("CPACK_SET_DESTDIR")}, - {'C', QLatin1String("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION")}}; -} - -void loadCMakeData(QMultiHash<char, QLatin1String> &types, - QMultiHash<char, QLatin1String> &keywords, - QMultiHash<char, QLatin1String> &builtin, - QMultiHash<char, QLatin1String> &literals, - QMultiHash<char, QLatin1String> &other) -{ - if (!cmakeDataInitialized) - { - initCMakeData(); - cmakeDataInitialized = true; - } - types = cmake_types; - keywords = cmake_keywords; - builtin = cmake_builtin; - literals = cmake_literals; - other = cmake_other; -} - -/********************************************************/ -/*** MAKE DATA ***************************************/ -/********************************************************/ -static bool makeDataInitialized = false; -static QMultiHash<char, QLatin1String> make_keywords; -static QMultiHash<char, QLatin1String> make_types; -static QMultiHash<char, QLatin1String> make_literals; -static QMultiHash<char, QLatin1String> make_builtin; -static QMultiHash<char, QLatin1String> make_other; -void initMakeData() -{ - make_keywords - = {{'i', QLatin1String("include")}, {'d', QLatin1String("define")}, - {'e', QLatin1String("else")}, {'e', QLatin1String("endef")}, - {'e', QLatin1String("endif")}, {'e', QLatin1String("export")}, - {'i', QLatin1String("ifn?def")}, {'i', QLatin1String("ifn?eq")}, - {'i', QLatin1String("include")}, {'o', QLatin1String("override")}, - {'p', QLatin1String("private")}, {'s', QLatin1String("sinclude")}, - {'u', QLatin1String("undefine")}, {'u', QLatin1String("unexport")}, - {'v', QLatin1String("vpath")}}; - make_types - = {{'a', QLatin1String("addsuffix")}, {'a', QLatin1String("abspath")}, - {'a', QLatin1String("and")}, {'a', QLatin1String("ar")}, - {'b', QLatin1String("basename")}, {'c', QLatin1String("call")}, - {'d', QLatin1String("dir")}, {'e', QLatin1String("error")}, - {'e', QLatin1String("eval")}, {'f', QLatin1String("file")}, - {'f', QLatin1String("filter")}, {'f', QLatin1String("find")}, - {'f', QLatin1String("findstring")}, {'f', QLatin1String("firstword")}, - {'f', QLatin1String("flavor")}, {'f', QLatin1String("foreach")}, - {'g', QLatin1String("guile")}, {'i', QLatin1String("if")}, - {'i', QLatin1String("info")}, {'i', QLatin1String("install")}, - {'j', QLatin1String("join")}, {'l', QLatin1String("lastword")}, - {'l', QLatin1String("load")}, {'n', QLatin1String("notdir")}, - {'o', QLatin1String("or")}, {'o', QLatin1String("origin")}, - {'p', QLatin1String("patsubst")}, {'r', QLatin1String("ranlib")}, - {'r', QLatin1String("realpath")}, {'r', QLatin1String("rm")}, - {'s', QLatin1String("shell")}, {'s', QLatin1String("sort")}, - {'s', QLatin1String("strip")}, {'s', QLatin1String("subst")}, - {'s', QLatin1String("suffix")}, {'v', QLatin1String("value")}, - {'w', QLatin1String("warning")}, {'w', QLatin1String("wildcard")}, - {'w', QLatin1String("word")}}; - make_literals = { - {'t', QLatin1String("true")}, - {'f', QLatin1String("false")}, - }; - make_builtin = {}; - make_other = { - {'C', QLatin1String("CFLAGS")}, - {'L', QLatin1String("LIBS")}, - {'P', QLatin1String("PREFIX")}, - }; -} - -void loadMakeData(QMultiHash<char, QLatin1String> &types, - QMultiHash<char, QLatin1String> &keywords, - QMultiHash<char, QLatin1String> &builtin, - QMultiHash<char, QLatin1String> &literals, - QMultiHash<char, QLatin1String> &other) -{ - if (!makeDataInitialized) - { - initMakeData(); - makeDataInitialized = true; - } - types = make_types; - keywords = make_keywords; - builtin = make_builtin; - literals = make_literals; - other = make_other; -} - -void loadAsmData(QMultiHash<char, QLatin1String> &types, - QMultiHash<char, QLatin1String> &keywords, - QMultiHash<char, QLatin1String> &builtin, - QMultiHash<char, QLatin1String> &literals, - QMultiHash<char, QLatin1String> &other) -{ - Q_UNUSED(literals); - types = {{'i', QLatin1String("ip")}, {'e', QLatin1String("eip")}, - {'r', QLatin1String("rip")}, {'a', QLatin1String("al")}, - {'a', QLatin1String("ah")}, {'b', QLatin1String("bl")}, - {'b', QLatin1String("bh")}, {'c', QLatin1String("cl")}, - {'c', QLatin1String("ch")}, {'d', QLatin1String("dl")}, - {'d', QLatin1String("dh")}, {'s', QLatin1String("sil")}, - {'d', QLatin1String("dil")}, {'b', QLatin1String("bpl")}, - {'s', QLatin1String("spl")}, {'r', QLatin1String("r8b")}, - {'r', QLatin1String("r9b")}, {'r', QLatin1String("r10b")}, - {'r', QLatin1String("r11b")}, {'r', QLatin1String("r12b")}, - {'r', QLatin1String("r13b")}, {'r', QLatin1String("r14b")}, - {'r', QLatin1String("r15b")}, {'b', QLatin1String("bx")}, - {'c', QLatin1String("cx")}, {'d', QLatin1String("dx")}, - {'s', QLatin1String("si")}, {'d', QLatin1String("di")}, - {'b', QLatin1String("bp")}, {'s', QLatin1String("sp")}, - {'r', QLatin1String("r8w")}, {'r', QLatin1String("r9w")}, - {'r', QLatin1String("r10w")}, {'r', QLatin1String("r11w")}, - {'r', QLatin1String("r12w")}, {'r', QLatin1String("r13w")}, - {'r', QLatin1String("r14w")}, {'r', QLatin1String("r15w")}, - {'e', QLatin1String("eax")}, {'e', QLatin1String("ebx")}, - {'e', QLatin1String("ecx")}, {'e', QLatin1String("edx")}, - {'e', QLatin1String("esi")}, {'e', QLatin1String("edi")}, - {'e', QLatin1String("ebp")}, {'e', QLatin1String("esp")}, - {'e', QLatin1String("eip")}, {'r', QLatin1String("r8d")}, - {'r', QLatin1String("r9d")}, {'r', QLatin1String("r10d")}, - {'r', QLatin1String("r11d")}, {'r', QLatin1String("r12d")}, - {'r', QLatin1String("r13d")}, {'r', QLatin1String("r14d")}, - {'r', QLatin1String("r15d")}, {'r', QLatin1String("rax")}, - {'r', QLatin1String("rbx")}, {'r', QLatin1String("rcx")}, - {'r', QLatin1String("rdx")}, {'r', QLatin1String("rsi")}, - {'r', QLatin1String("rdi")}, {'r', QLatin1String("rbp")}, - {'r', QLatin1String("rsp")}, {'r', QLatin1String("r8")}, - {'r', QLatin1String("r9")}, {'r', QLatin1String("r10")}, - {'r', QLatin1String("r11")}, {'r', QLatin1String("r12")}, - {'r', QLatin1String("r13")}, {'r', QLatin1String("r14")}, - {'r', QLatin1String("r15")}, {'d', QLatin1String("ds")}, - {'e', QLatin1String("es")}, {'f', QLatin1String("fs")}, - {'g', QLatin1String("gs")}, {'s', QLatin1String("ss")}, - {'s', QLatin1String("st0")}, {'s', QLatin1String("st1")}, - {'s', QLatin1String("st2")}, {'s', QLatin1String("st3")}, - {'s', QLatin1String("st4")}, {'s', QLatin1String("st5")}, - {'s', QLatin1String("st6")}, {'s', QLatin1String("st7")}, - {'m', QLatin1String("mm0")}, {'m', QLatin1String("mm1")}, - {'m', QLatin1String("mm2")}, {'m', QLatin1String("mm3")}, - {'m', QLatin1String("mm4")}, {'m', QLatin1String("mm5")}, - {'m', QLatin1String("mm6")}, {'m', QLatin1String("mm7")}, - {'x', QLatin1String("xmm0")}, {'x', QLatin1String("xmm1")}, - {'x', QLatin1String("xmm2")}, {'x', QLatin1String("xmm3")}, - {'x', QLatin1String("xmm4")}, {'x', QLatin1String("xmm5")}, - {'x', QLatin1String("xmm6")}, {'x', QLatin1String("xmm7")}, - {'x', QLatin1String("xmm8")}, {'x', QLatin1String("xmm9")}, - {'x', QLatin1String("xmm10")}, {'x', QLatin1String("xmm11")}, - {'x', QLatin1String("xmm12")}, {'x', QLatin1String("xmm13")}, - {'x', QLatin1String("xmm14")}, {'x', QLatin1String("xmm15")}, - {'x', QLatin1String("xmm16")}, {'x', QLatin1String("xmm17")}, - {'x', QLatin1String("xmm18")}, {'x', QLatin1String("xmm19")}, - {'x', QLatin1String("xmm20")}, {'x', QLatin1String("xmm21")}, - {'x', QLatin1String("xmm22")}, {'x', QLatin1String("xmm23")}, - {'x', QLatin1String("xmm24")}, {'x', QLatin1String("xmm25")}, - {'x', QLatin1String("xmm26")}, {'x', QLatin1String("xmm27")}, - {'x', QLatin1String("xmm28")}, {'x', QLatin1String("xmm29")}, - {'x', QLatin1String("xmm30")}, {'x', QLatin1String("xmm31")}, - {'y', QLatin1String("ymm0")}, {'y', QLatin1String("ymm1")}, - {'y', QLatin1String("ymm2")}, {'y', QLatin1String("ymm3")}, - {'y', QLatin1String("ymm4")}, {'y', QLatin1String("ymm5")}, - {'y', QLatin1String("ymm6")}, {'y', QLatin1String("ymm7")}, - {'y', QLatin1String("ymm8")}, {'y', QLatin1String("ymm9")}, - {'y', QLatin1String("ymm10")}, {'y', QLatin1String("ymm11")}, - {'y', QLatin1String("ymm12")}, {'y', QLatin1String("ymm13")}, - {'y', QLatin1String("ymm14")}, {'y', QLatin1String("ymm15")}, - {'y', QLatin1String("ymm16")}, {'y', QLatin1String("ymm17")}, - {'y', QLatin1String("ymm18")}, {'y', QLatin1String("ymm19")}, - {'y', QLatin1String("ymm20")}, {'y', QLatin1String("ymm21")}, - {'y', QLatin1String("ymm22")}, {'y', QLatin1String("ymm23")}, - {'y', QLatin1String("ymm24")}, {'y', QLatin1String("ymm25")}, - {'y', QLatin1String("ymm26")}, {'y', QLatin1String("ymm27")}, - {'y', QLatin1String("ymm28")}, {'y', QLatin1String("ymm29")}, - {'y', QLatin1String("ymm30")}, {'y', QLatin1String("ymm31")}, - {'z', QLatin1String("zmm0")}, {'z', QLatin1String("zmm1")}, - {'z', QLatin1String("zmm2")}, {'z', QLatin1String("zmm3")}, - {'z', QLatin1String("zmm4")}, {'z', QLatin1String("zmm5")}, - {'z', QLatin1String("zmm6")}, {'z', QLatin1String("zmm7")}, - {'z', QLatin1String("zmm8")}, {'z', QLatin1String("zmm9")}, - {'z', QLatin1String("zmm10")}, {'z', QLatin1String("zmm11")}, - {'z', QLatin1String("zmm12")}, {'z', QLatin1String("zmm13")}, - {'z', QLatin1String("zmm14")}, {'z', QLatin1String("zmm15")}, - {'z', QLatin1String("zmm16")}, {'z', QLatin1String("zmm17")}, - {'z', QLatin1String("zmm18")}, {'z', QLatin1String("zmm19")}, - {'z', QLatin1String("zmm20")}, {'z', QLatin1String("zmm21")}, - {'z', QLatin1String("zmm22")}, {'z', QLatin1String("zmm23")}, - {'z', QLatin1String("zmm24")}, {'z', QLatin1String("zmm25")}, - {'z', QLatin1String("zmm26")}, {'z', QLatin1String("zmm27")}, - {'z', QLatin1String("zmm28")}, {'z', QLatin1String("zmm29")}, - {'z', QLatin1String("zmm30")}, {'z', QLatin1String("zmm31")}, - {'k', QLatin1String("k0")}, {'k', QLatin1String("k1")}, - {'k', QLatin1String("k2")}, {'k', QLatin1String("k3")}, - {'k', QLatin1String("k4")}, {'k', QLatin1String("k5")}, - {'k', QLatin1String("k6")}, {'k', QLatin1String("k7")}, - {'b', QLatin1String("bnd0")}, {'b', QLatin1String("bnd1")}, - {'b', QLatin1String("bnd2")}, {'b', QLatin1String("bnd3")}, - {'c', QLatin1String("cr0")}, {'c', QLatin1String("cr1")}, - {'c', QLatin1String("cr2")}, {'c', QLatin1String("cr3")}, - {'c', QLatin1String("cr4")}, {'c', QLatin1String("cr8")}, - {'d', QLatin1String("dr0")}, {'d', QLatin1String("dr1")}, - {'d', QLatin1String("dr2")}, {'d', QLatin1String("dr3")}, - {'d', QLatin1String("dr8")}, {'t', QLatin1String("tr3")}, - {'t', QLatin1String("tr4")}, {'t', QLatin1String("tr5")}, - {'t', QLatin1String("tr6")}, {'t', QLatin1String("tr7")}, - {'r', QLatin1String("r0")}, {'r', QLatin1String("r1")}, - {'r', QLatin1String("r2")}, {'r', QLatin1String("r3")}, - {'r', QLatin1String("r4")}, {'r', QLatin1String("r5")}, - {'r', QLatin1String("r6")}, {'r', QLatin1String("r7")}, - {'r', QLatin1String("r0b")}, {'r', QLatin1String("r1b")}, - {'r', QLatin1String("r2b")}, {'r', QLatin1String("r3b")}, - {'r', QLatin1String("r4b")}, {'r', QLatin1String("r5b")}, - {'r', QLatin1String("r6b")}, {'r', QLatin1String("r7b")}, - {'r', QLatin1String("r0w")}, {'r', QLatin1String("r1w")}, - {'r', QLatin1String("r2w")}, {'r', QLatin1String("r3w")}, - {'r', QLatin1String("r4w")}, {'r', QLatin1String("r5w")}, - {'r', QLatin1String("r6w")}, {'r', QLatin1String("r7w")}, - {'r', QLatin1String("r0d")}, {'r', QLatin1String("r1d")}, - {'r', QLatin1String("r2d")}, {'r', QLatin1String("r3d")}, - {'r', QLatin1String("r4d")}, {'r', QLatin1String("r5d")}, - {'r', QLatin1String("r6d")}, {'r', QLatin1String("r7d")}, - {'r', QLatin1String("r0h")}, {'r', QLatin1String("r1h")}, - {'r', QLatin1String("r2h")}, {'r', QLatin1String("r3h")}, - {'r', QLatin1String("r0l")}, {'r', QLatin1String("r1l")}, - {'r', QLatin1String("r2l")}, {'r', QLatin1String("r3l")}, - {'r', QLatin1String("r4l")}, {'r', QLatin1String("r5l")}, - {'r', QLatin1String("r6l")}, {'r', QLatin1String("r7l")}, - {'r', QLatin1String("r8l")}, {'r', QLatin1String("r9l")}, - {'r', QLatin1String("r10l")}, {'r', QLatin1String("r11l")}, - {'r', QLatin1String("r12l")}, {'r', QLatin1String("r13l")}, - {'r', QLatin1String("r14l")}, {'r', QLatin1String("r15l")}, - {'d', QLatin1String("db")}, {'d', QLatin1String("dw")}, - {'d', QLatin1String("dd")}, {'d', QLatin1String("dq")}, - {'d', QLatin1String("dt")}, {'d', QLatin1String("ddq")}, - {'d', QLatin1String("do")}, {'d', QLatin1String("dy")}, - {'d', QLatin1String("dz")}, {'r', QLatin1String("resb")}, - {'r', QLatin1String("resw")}, {'r', QLatin1String("resd")}, - {'r', QLatin1String("resq")}, {'r', QLatin1String("rest")}, - {'r', QLatin1String("resdq")}, {'r', QLatin1String("reso")}, - {'r', QLatin1String("resy")}, {'r', QLatin1String("resz")}, - {'i', QLatin1String("inc")}, {'b', QLatin1String("bin")}, - {'e', QLatin1String("equ")}, {'t', QLatin1String("times")}, - {'b', QLatin1String("byte")}, {'w', QLatin1String("word")}, - {'d', QLatin1String("dword")}, {'q', QLatin1String("qword")}, - {'n', QLatin1String("nosplit")}, {'r', QLatin1String("rel")}, - {'a', QLatin1String("abs")}, {'s', QLatin1String("seg")}, - {'w', QLatin1String("wrt")}, {'s', QLatin1String("strict")}, - {'n', QLatin1String("near")}, {'f', QLatin1String("far")}, - {'a', QLatin1String("a32")}, {'p', QLatin1String("ptr")}}; - - keywords = { - {'l', QLatin1String("lock")}, - {'r', QLatin1String("rep")}, - {'r', QLatin1String("repe")}, - {'r', QLatin1String("repz")}, - {'r', QLatin1String("repne")}, - {'r', QLatin1String("repnz")}, - {'x', QLatin1String("xaquire")}, - {'x', QLatin1String("xrelease")}, - {'b', QLatin1String("bnd")}, - {'n', QLatin1String("nobnd")}, - {'a', QLatin1String("aaa")}, - {'a', QLatin1String("aad")}, - {'a', QLatin1String("aam")}, - {'a', QLatin1String("aas")}, - {'a', QLatin1String("adc")}, - {'a', QLatin1String("add")}, - {'a', QLatin1String("addl")}, - {'a', QLatin1String("and")}, - {'a', QLatin1String("arpl")}, - {'b', QLatin1String("bb0_reset")}, - {'b', QLatin1String("bb1_reset")}, - {'b', QLatin1String("bound")}, - {'b', QLatin1String("bsf")}, - {'b', QLatin1String("bsr")}, - {'b', QLatin1String("bswap")}, - {'b', QLatin1String("bt")}, - {'b', QLatin1String("btc")}, - {'b', QLatin1String("btr")}, - {'b', QLatin1String("bts")}, - {'c', QLatin1String("call")}, - {'c', QLatin1String("cbw")}, - {'c', QLatin1String("cdq")}, - {'c', QLatin1String("cdqe")}, - {'c', QLatin1String("clc")}, - {'c', QLatin1String("cld")}, - {'c', QLatin1String("cli")}, - {'c', QLatin1String("clts")}, - {'c', QLatin1String("cltd")}, - {'c', QLatin1String("cmc")}, - {'c', QLatin1String("cmp")}, - {'c', QLatin1String("cmpl")}, - {'c', QLatin1String("cmpsb")}, - {'c', QLatin1String("cmpsd")}, - {'c', QLatin1String("cmpsq")}, - {'c', QLatin1String("cmpsw")}, - {'c', QLatin1String("cmpxchg")}, - {'c', QLatin1String("cmpxchg486")}, - {'c', QLatin1String("cmpxchg8b")}, - {'c', QLatin1String("cmpxchg16b")}, - {'c', QLatin1String("cpuid")}, - {'c', QLatin1String("cpu_read")}, - {'c', QLatin1String("cpu_write")}, - {'c', QLatin1String("cqo")}, - {'c', QLatin1String("cwd")}, - {'c', QLatin1String("cwde")}, - {'d', QLatin1String("daa")}, - {'d', QLatin1String("das")}, - {'d', QLatin1String("dec")}, - {'d', QLatin1String("div")}, - {'d', QLatin1String("dmint")}, - {'e', QLatin1String("emms")}, - {'e', QLatin1String("enter")}, - {'e', QLatin1String("equ")}, - {'f', QLatin1String("f2xm1")}, - {'f', QLatin1String("fabs")}, - {'f', QLatin1String("fadd")}, - {'f', QLatin1String("faddp")}, - {'f', QLatin1String("fbld")}, - {'f', QLatin1String("fbstp")}, - {'f', QLatin1String("fchs")}, - {'f', QLatin1String("fclex")}, - {'f', QLatin1String("fcmovb")}, - {'f', QLatin1String("fcmovbe")}, - {'f', QLatin1String("fcmove")}, - {'f', QLatin1String("fcmovnb")}, - {'f', QLatin1String("fcmovnbe")}, - {'f', QLatin1String("fcmovne")}, - {'f', QLatin1String("fcmovnu")}, - {'f', QLatin1String("fcmovu")}, - {'f', QLatin1String("fcom")}, - {'f', QLatin1String("fcomi")}, - {'f', QLatin1String("fcomip")}, - {'f', QLatin1String("fcomp")}, - {'f', QLatin1String("fcompp")}, - {'f', QLatin1String("fcos")}, - {'f', QLatin1String("fdecstp")}, - {'f', QLatin1String("fdisi")}, - {'f', QLatin1String("fdiv")}, - {'f', QLatin1String("fdivp")}, - {'f', QLatin1String("fdivr")}, - {'f', QLatin1String("fdivrp")}, - {'f', QLatin1String("femms")}, - {'f', QLatin1String("feni")}, - {'f', QLatin1String("ffree")}, - {'f', QLatin1String("ffreep")}, - {'f', QLatin1String("fiadd")}, - {'f', QLatin1String("ficom")}, - {'f', QLatin1String("ficomp")}, - {'f', QLatin1String("fidiv")}, - {'f', QLatin1String("fidivr")}, - {'f', QLatin1String("fild")}, - {'f', QLatin1String("fimul")}, - {'f', QLatin1String("fincstp")}, - {'f', QLatin1String("finit")}, - {'f', QLatin1String("fist")}, - {'f', QLatin1String("fistp")}, - {'f', QLatin1String("fisttp")}, - {'f', QLatin1String("fisub")}, - {'f', QLatin1String("fisubr")}, - {'f', QLatin1String("fld")}, - {'f', QLatin1String("fld1")}, - {'f', QLatin1String("fldcw")}, - {'f', QLatin1String("fldenv")}, - {'f', QLatin1String("fldl2e")}, - {'f', QLatin1String("fldl2t")}, - {'f', QLatin1String("fldlg2")}, - {'f', QLatin1String("fldln2")}, - {'f', QLatin1String("fldpi")}, - {'f', QLatin1String("fldz")}, - {'f', QLatin1String("fmul")}, - {'f', QLatin1String("fmulp")}, - {'f', QLatin1String("fnclex")}, - {'f', QLatin1String("fndisi")}, - {'f', QLatin1String("fneni")}, - {'f', QLatin1String("fninit")}, - {'f', QLatin1String("fnop")}, - {'f', QLatin1String("fnsave")}, - {'f', QLatin1String("fnstcw")}, - {'f', QLatin1String("fnstenv")}, - {'f', QLatin1String("fnstsw")}, - {'f', QLatin1String("fpatan")}, - {'f', QLatin1String("fprem")}, - {'f', QLatin1String("fprem1")}, - {'f', QLatin1String("fptan")}, - {'f', QLatin1String("frndint")}, - {'f', QLatin1String("frstor")}, - {'f', QLatin1String("fsave")}, - {'f', QLatin1String("fscale")}, - {'f', QLatin1String("fsetpm")}, - {'f', QLatin1String("fsin")}, - {'f', QLatin1String("fsincos")}, - {'f', QLatin1String("fsqrt")}, - {'f', QLatin1String("fst")}, - {'f', QLatin1String("fstcw")}, - {'f', QLatin1String("fstenv")}, - {'f', QLatin1String("fstp")}, - {'f', QLatin1String("fstsw")}, - {'f', QLatin1String("fsub")}, - {'f', QLatin1String("fsubp")}, - {'f', QLatin1String("fsubr")}, - {'f', QLatin1String("fsubrp")}, - {'f', QLatin1String("ftst")}, - {'f', QLatin1String("fucom")}, - {'f', QLatin1String("fucomi")}, - {'f', QLatin1String("fucomip")}, - {'f', QLatin1String("fucomp")}, - {'f', QLatin1String("fucompp")}, - {'f', QLatin1String("fxam")}, - {'f', QLatin1String("fxch")}, - {'f', QLatin1String("fxtract")}, - {'f', QLatin1String("fyl2x")}, - {'f', QLatin1String("fyl2xp1")}, - {'g', QLatin1String("global")}, - {'g', QLatin1String("globl")}, - {'h', QLatin1String("hlt")}, - {'i', QLatin1String("ibts")}, - {'i', QLatin1String("icebp")}, - {'i', QLatin1String("idiv")}, - {'i', QLatin1String("idivl")}, - {'i', QLatin1String("idivq")}, - {'i', QLatin1String("imul")}, - {'i', QLatin1String("imull")}, - {'i', QLatin1String("imulq")}, - {'i', QLatin1String("in")}, - {'i', QLatin1String("inc")}, - {'i', QLatin1String("incbin")}, - {'i', QLatin1String("insb")}, - {'i', QLatin1String("insd")}, - {'i', QLatin1String("insw")}, - {'i', QLatin1String("int")}, - {'i', QLatin1String("int01")}, - {'i', QLatin1String("int1")}, - {'i', QLatin1String("int03")}, - {'i', QLatin1String("int3")}, - {'i', QLatin1String("into")}, - {'i', QLatin1String("invd")}, - {'i', QLatin1String("invpcid")}, - {'i', QLatin1String("invlpg")}, - {'i', QLatin1String("invlpga")}, - {'i', QLatin1String("iret")}, - {'i', QLatin1String("iretd")}, - {'i', QLatin1String("iretq")}, - {'i', QLatin1String("iretw")}, - {'j', QLatin1String("jcxz")}, - {'j', QLatin1String("jecxz")}, - {'j', QLatin1String("jrcxz")}, - {'j', QLatin1String("jmp")}, - {'j', QLatin1String("jmpe")}, - {'l', QLatin1String("lahf")}, - {'l', QLatin1String("lar")}, - {'l', QLatin1String("lds")}, - {'l', QLatin1String("lea")}, - {'l', QLatin1String("leal")}, - {'l', QLatin1String("leaq")}, - {'l', QLatin1String("leave")}, - {'l', QLatin1String("les")}, - {'l', QLatin1String("lfence")}, - {'l', QLatin1String("lfs")}, - {'l', QLatin1String("lgdt")}, - {'l', QLatin1String("lgs")}, - {'l', QLatin1String("lidt")}, - {'l', QLatin1String("lldt")}, - {'l', QLatin1String("lmsw")}, - {'l', QLatin1String("loadall")}, - {'l', QLatin1String("loadall286")}, - {'l', QLatin1String("lodsb")}, - {'l', QLatin1String("lodsd")}, - {'l', QLatin1String("lodsq")}, - {'l', QLatin1String("lodsw")}, - {'l', QLatin1String("loop")}, - {'l', QLatin1String("loope")}, - {'l', QLatin1String("loopne")}, - {'l', QLatin1String("loopnz")}, - {'l', QLatin1String("loopz")}, - {'l', QLatin1String("lsl")}, - {'l', QLatin1String("lss")}, - {'l', QLatin1String("ltr")}, - {'m', QLatin1String("mfence")}, - {'m', QLatin1String("monitor")}, - {'m', QLatin1String("mov")}, - {'m', QLatin1String("movd")}, - {'m', QLatin1String("movl")}, - {'m', QLatin1String("movq")}, - {'m', QLatin1String("movsb")}, - {'m', QLatin1String("movsd")}, - {'m', QLatin1String("movsq")}, - {'m', QLatin1String("movsw")}, - {'m', QLatin1String("movsx")}, - {'m', QLatin1String("movsxd")}, - {'m', QLatin1String("movzx")}, - {'m', QLatin1String("mul")}, - {'m', QLatin1String("mwait")}, - {'n', QLatin1String("neg")}, - {'n', QLatin1String("nop")}, - {'n', QLatin1String("not")}, - {'o', QLatin1String("or")}, - {'o', QLatin1String("out")}, - {'o', QLatin1String("outsb")}, - {'o', QLatin1String("outsd")}, - {'o', QLatin1String("outsw")}, - {'p', QLatin1String("packssdw")}, - {'p', QLatin1String("packsswb")}, - {'p', QLatin1String("packuswb")}, - {'p', QLatin1String("paddb")}, - {'p', QLatin1String("paddd")}, - {'p', QLatin1String("paddsb")}, - {'p', QLatin1String("paddsiw")}, - {'p', QLatin1String("paddsw")}, - {'p', QLatin1String("paddusb")}, - {'p', QLatin1String("paddusw")}, - {'p', QLatin1String("paddw")}, - {'p', QLatin1String("pand")}, - {'p', QLatin1String("pandn")}, - {'p', QLatin1String("pause")}, - {'p', QLatin1String("paveb")}, - {'p', QLatin1String("pavgusb")}, - {'p', QLatin1String("pcmpeqb")}, - {'p', QLatin1String("pcmpeqd")}, - {'p', QLatin1String("pcmpeqw")}, - {'p', QLatin1String("pcmpgtb")}, - {'p', QLatin1String("pcmpgtd")}, - {'p', QLatin1String("pcmpgtw")}, - {'p', QLatin1String("pdistib")}, - {'p', QLatin1String("pf2id")}, - {'p', QLatin1String("pfacc")}, - {'p', QLatin1String("pfadd")}, - {'p', QLatin1String("pfcmpeq")}, - {'p', QLatin1String("pfcmpge")}, - {'p', QLatin1String("pfcmpgt")}, - {'p', QLatin1String("pfmax")}, - {'p', QLatin1String("pfmin")}, - {'p', QLatin1String("pfmul")}, - {'p', QLatin1String("pfrcp")}, - {'p', QLatin1String("pfrcpit1")}, - {'p', QLatin1String("pfrcpit2")}, - {'p', QLatin1String("pfrsqit1")}, - {'p', QLatin1String("pfrsqrt")}, - {'p', QLatin1String("pfsub")}, - {'p', QLatin1String("pfsubr")}, - {'p', QLatin1String("pi2fd")}, - {'p', QLatin1String("pmachriw")}, - {'p', QLatin1String("pmaddwd")}, - {'p', QLatin1String("pmagw")}, - {'p', QLatin1String("pmulhriw")}, - {'p', QLatin1String("pmulhrwa")}, - {'p', QLatin1String("pmulhrwc")}, - {'p', QLatin1String("pmulhw")}, - {'p', QLatin1String("pmullw")}, - {'p', QLatin1String("pmvgezb")}, - {'p', QLatin1String("pmvlzb")}, - {'p', QLatin1String("pmvnzb")}, - {'p', QLatin1String("pmvzb")}, - {'p', QLatin1String("pop")}, - {'p', QLatin1String("popq")}, - {'p', QLatin1String("popa")}, - {'p', QLatin1String("popad")}, - {'p', QLatin1String("popaw")}, - {'p', QLatin1String("popf")}, - {'p', QLatin1String("popfd")}, - {'p', QLatin1String("popfq")}, - {'p', QLatin1String("popfw")}, - {'p', QLatin1String("por")}, - {'p', QLatin1String("prefetch")}, - {'p', QLatin1String("prefetchw")}, - {'p', QLatin1String("pslld")}, - {'p', QLatin1String("psllq")}, - {'p', QLatin1String("psllw")}, - {'p', QLatin1String("psrad")}, - {'p', QLatin1String("psraw")}, - {'p', QLatin1String("psrld")}, - {'p', QLatin1String("psrlq")}, - {'p', QLatin1String("psrlw")}, - {'p', QLatin1String("psubb")}, - {'p', QLatin1String("psubd")}, - {'p', QLatin1String("psubsb")}, - {'p', QLatin1String("psubsiw")}, - {'p', QLatin1String("psubsw")}, - {'p', QLatin1String("psubusb")}, - {'p', QLatin1String("psubusw")}, - {'p', QLatin1String("psubw")}, - {'p', QLatin1String("punpckhbw")}, - {'p', QLatin1String("punpckhdq")}, - {'p', QLatin1String("punpckhwd")}, - {'p', QLatin1String("punpcklbw")}, - {'p', QLatin1String("punpckldq")}, - {'p', QLatin1String("punpcklwd")}, - {'p', QLatin1String("push")}, - {'p', QLatin1String("pusha")}, - {'p', QLatin1String("pushq")}, - {'p', QLatin1String("pushad")}, - {'p', QLatin1String("pushaw")}, - {'p', QLatin1String("pushf")}, - {'p', QLatin1String("pushfd")}, - {'p', QLatin1String("pushfq")}, - {'p', QLatin1String("pushfw")}, - {'p', QLatin1String("pxor")}, - {'r', QLatin1String("rcl")}, - {'r', QLatin1String("rcr")}, - {'r', QLatin1String("rdshr")}, - {'r', QLatin1String("rdmsr")}, - {'r', QLatin1String("rdpmc")}, - {'r', QLatin1String("rdtsc")}, - {'r', QLatin1String("rdtscp")}, - {'r', QLatin1String("ret")}, - {'r', QLatin1String("retf")}, - {'r', QLatin1String("retn")}, - {'r', QLatin1String("retq")}, - {'r', QLatin1String("rol")}, - {'r', QLatin1String("ror")}, - {'r', QLatin1String("rdm")}, - {'r', QLatin1String("rsdc")}, - {'r', QLatin1String("rsldt")}, - {'r', QLatin1String("rsm")}, - {'r', QLatin1String("rsts")}, - {'s', QLatin1String("sahf")}, - {'s', QLatin1String("sal")}, - {'s', QLatin1String("sall")}, - {'s', QLatin1String("salq")}, - {'s', QLatin1String("salc")}, - {'s', QLatin1String("sar")}, - {'s', QLatin1String("sarl")}, - {'s', QLatin1String("sarq")}, - {'s', QLatin1String("sbb")}, - {'s', QLatin1String("scasb")}, - {'s', QLatin1String("scasd")}, - {'s', QLatin1String("scasq")}, - {'s', QLatin1String("scasw")}, - {'s', QLatin1String("sfence")}, - {'s', QLatin1String("sgdt")}, - {'s', QLatin1String("shl")}, - {'s', QLatin1String("shll")}, - {'s', QLatin1String("shllq")}, - {'s', QLatin1String("shld")}, - {'s', QLatin1String("shr")}, - {'s', QLatin1String("shrd")}, - {'s', QLatin1String("sidt")}, - {'s', QLatin1String("sldt")}, - {'s', QLatin1String("skinit")}, - {'s', QLatin1String("smi")}, - {'s', QLatin1String("smint")}, - {'s', QLatin1String("smintold")}, - {'s', QLatin1String("smsw")}, - {'s', QLatin1String("stc")}, - {'s', QLatin1String("std")}, - {'s', QLatin1String("sti")}, - {'s', QLatin1String("stosb")}, - {'s', QLatin1String("stosd")}, - {'s', QLatin1String("stosq")}, - {'s', QLatin1String("stosw")}, - {'s', QLatin1String("str")}, - {'s', QLatin1String("sub")}, - {'s', QLatin1String("svdc")}, - {'s', QLatin1String("svldt")}, - {'s', QLatin1String("svts")}, - {'s', QLatin1String("swapgs")}, - {'s', QLatin1String("syscall")}, - {'s', QLatin1String("sysenter")}, - {'s', QLatin1String("sysexit")}, - {'s', QLatin1String("sysret")}, - {'t', QLatin1String("test")}, - {'t', QLatin1String("testl")}, - {'t', QLatin1String("testq")}, - {'u', QLatin1String("ud0")}, - {'u', QLatin1String("ud1")}, - {'u', QLatin1String("ud2b")}, - {'u', QLatin1String("ud2")}, - {'u', QLatin1String("ud2a")}, - {'u', QLatin1String("umov")}, - {'v', QLatin1String("verr")}, - {'v', QLatin1String("verw")}, - {'f', QLatin1String("fwait")}, - {'w', QLatin1String("wbinvd")}, - {'w', QLatin1String("wrshr")}, - {'w', QLatin1String("wrmsr")}, - {'x', QLatin1String("xadd")}, - {'x', QLatin1String("xbts")}, - {'x', QLatin1String("xchg")}, - {'x', QLatin1String("xlatb")}, - {'x', QLatin1String("xlat")}, - {'x', QLatin1String("xor")}, - {'c', QLatin1String("cmove")}, - {'c', QLatin1String("cmovz")}, - {'c', QLatin1String("cmovne")}, - {'c', QLatin1String("cmovnz")}, - {'c', QLatin1String("cmova")}, - {'c', QLatin1String("cmovnbe")}, - {'c', QLatin1String("cmovae")}, - {'c', QLatin1String("cmovnb")}, - {'c', QLatin1String("cmovb")}, - {'c', QLatin1String("cmovnae")}, - {'c', QLatin1String("cmovbe")}, - {'c', QLatin1String("cmovna")}, - {'c', QLatin1String("cmovg")}, - {'c', QLatin1String("cmovnle")}, - {'c', QLatin1String("cmovge")}, - {'c', QLatin1String("cmovnl")}, - {'c', QLatin1String("cmovl")}, - {'c', QLatin1String("cmovnge")}, - {'c', QLatin1String("cmovle")}, - {'c', QLatin1String("cmovng")}, - {'c', QLatin1String("cmovc")}, - {'c', QLatin1String("cmovnc")}, - {'c', QLatin1String("cmovo")}, - {'c', QLatin1String("cmovno")}, - {'c', QLatin1String("cmovs")}, - {'c', QLatin1String("cmovns")}, - {'c', QLatin1String("cmovp")}, - {'c', QLatin1String("cmovpe")}, - {'c', QLatin1String("cmovnp")}, - {'c', QLatin1String("cmovpo")}, - {'j', QLatin1String("je")}, - {'j', QLatin1String("jz")}, - {'j', QLatin1String("jne")}, - {'j', QLatin1String("jnz")}, - {'j', QLatin1String("ja")}, - {'j', QLatin1String("jnbe")}, - {'j', QLatin1String("jae")}, - {'j', QLatin1String("jnb")}, - {'j', QLatin1String("jb")}, - {'j', QLatin1String("jnae")}, - {'j', QLatin1String("jbe")}, - {'j', QLatin1String("jna")}, - {'j', QLatin1String("jg")}, - {'j', QLatin1String("jnle")}, - {'j', QLatin1String("jge")}, - {'j', QLatin1String("jnl")}, - {'j', QLatin1String("jl")}, - {'j', QLatin1String("jnge")}, - {'j', QLatin1String("jle")}, - {'j', QLatin1String("jng")}, - {'j', QLatin1String("jc")}, - {'j', QLatin1String("jnc")}, - {'j', QLatin1String("jo")}, - {'j', QLatin1String("jno")}, - {'j', QLatin1String("js")}, - {'j', QLatin1String("jns")}, - {'j', QLatin1String("jpo")}, - {'j', QLatin1String("jnp")}, - {'j', QLatin1String("jpe")}, - {'j', QLatin1String("jp")}, - {'s', QLatin1String("sete")}, - {'s', QLatin1String("setz")}, - {'s', QLatin1String("setne")}, - {'s', QLatin1String("setnz")}, - {'s', QLatin1String("seta")}, - {'s', QLatin1String("setnbe")}, - {'s', QLatin1String("setae")}, - {'s', QLatin1String("setnb")}, - {'s', QLatin1String("setnc")}, - {'s', QLatin1String("setb")}, - {'s', QLatin1String("setnae")}, - {'s', QLatin1String("setcset")}, - {'s', QLatin1String("setbe")}, - {'s', QLatin1String("setna")}, - {'s', QLatin1String("setg")}, - {'s', QLatin1String("setnle")}, - {'s', QLatin1String("setge")}, - {'s', QLatin1String("setnl")}, - {'s', QLatin1String("setl")}, - {'s', QLatin1String("setnge")}, - {'s', QLatin1String("setle")}, - {'s', QLatin1String("setng")}, - {'s', QLatin1String("sets")}, - {'s', QLatin1String("setns")}, - {'s', QLatin1String("seto")}, - {'s', QLatin1String("setno")}, - {'s', QLatin1String("setpe")}, - {'s', QLatin1String("setp")}, - {'s', QLatin1String("setpo")}, - {'s', QLatin1String("setnp")}, - {'a', QLatin1String("addps")}, - {'a', QLatin1String("addss")}, - {'a', QLatin1String("andnps")}, - {'a', QLatin1String("andps")}, - {'c', QLatin1String("cmpeqps")}, - {'c', QLatin1String("cmpeqss")}, - {'c', QLatin1String("cmpleps")}, - {'c', QLatin1String("cmpless")}, - {'c', QLatin1String("cmpltps")}, - {'c', QLatin1String("cmpltss")}, - {'c', QLatin1String("cmpneqps")}, - {'c', QLatin1String("cmpneqss")}, - {'c', QLatin1String("cmpnleps")}, - {'c', QLatin1String("cmpnless")}, - {'c', QLatin1String("cmpnltps")}, - {'c', QLatin1String("cmpnltss")}, - {'c', QLatin1String("cmpordps")}, - {'c', QLatin1String("cmpordss")}, - {'c', QLatin1String("cmpunordps")}, - {'c', QLatin1String("cmpunordss")}, - {'c', QLatin1String("cmpps")}, - {'c', QLatin1String("cmpss")}, - {'c', QLatin1String("comiss")}, - {'c', QLatin1String("cvtpi2ps")}, - {'c', QLatin1String("cvtps2pi")}, - {'c', QLatin1String("cvtsi2ss")}, - {'c', QLatin1String("cvtss2si")}, - {'c', QLatin1String("cvttps2pi")}, - {'c', QLatin1String("cvttss2si")}, - {'d', QLatin1String("divps")}, - {'d', QLatin1String("divss")}, - {'l', QLatin1String("ldmxcsr")}, - {'m', QLatin1String("maxps")}, - {'m', QLatin1String("maxss")}, - {'m', QLatin1String("minps")}, - {'m', QLatin1String("minss")}, - {'m', QLatin1String("movaps")}, - {'m', QLatin1String("movhps")}, - {'m', QLatin1String("movlhps")}, - {'m', QLatin1String("movlps")}, - {'m', QLatin1String("movhlps")}, - {'m', QLatin1String("movmskps")}, - {'m', QLatin1String("movntps")}, - {'m', QLatin1String("movss")}, - {'m', QLatin1String("movups")}, - {'m', QLatin1String("mulps")}, - {'m', QLatin1String("mulss")}, - {'o', QLatin1String("orps")}, - {'r', QLatin1String("rcpps")}, - {'r', QLatin1String("rcpss")}, - {'r', QLatin1String("rsqrtps")}, - {'r', QLatin1String("rsqrtss")}, - {'s', QLatin1String("shufps")}, - {'s', QLatin1String("sqrtps")}, - {'s', QLatin1String("sqrtss")}, - {'s', QLatin1String("stmxcsr")}, - {'s', QLatin1String("subps")}, - {'s', QLatin1String("subss")}, - {'u', QLatin1String("ucomiss")}, - {'u', QLatin1String("unpckhps")}, - {'u', QLatin1String("unpcklps")}, - {'x', QLatin1String("xorps")}, - {'f', QLatin1String("fxrstor")}, - {'f', QLatin1String("fxrstor64")}, - {'f', QLatin1String("fxsave")}, - {'f', QLatin1String("fxsave64")}, - {'x', QLatin1String("xgetbv")}, - {'x', QLatin1String("xsetbv")}, - {'x', QLatin1String("xsave")}, - {'x', QLatin1String("xsave64")}, - {'x', QLatin1String("xsaveopt")}, - {'x', QLatin1String("xsaveopt64")}, - {'x', QLatin1String("xrstor")}, - {'x', QLatin1String("xrstor64")}, - {'p', QLatin1String("prefetchnta")}, - {'p', QLatin1String("prefetcht0")}, - {'p', QLatin1String("prefetcht1")}, - {'p', QLatin1String("prefetcht2")}, - {'m', QLatin1String("maskmovq")}, - {'m', QLatin1String("movntq")}, - {'p', QLatin1String("pavgb")}, - {'p', QLatin1String("pavgw")}, - {'p', QLatin1String("pextrw")}, - {'p', QLatin1String("pinsrw")}, - {'p', QLatin1String("pmaxsw")}, - {'p', QLatin1String("pmaxub")}, - {'p', QLatin1String("pminsw")}, - {'p', QLatin1String("pminub")}, - {'p', QLatin1String("pmovmskb")}, - {'p', QLatin1String("pmulhuw")}, - {'p', QLatin1String("psadbw")}, - {'p', QLatin1String("pshufw")}, - {'p', QLatin1String("pf2iw")}, - {'p', QLatin1String("pfnacc")}, - {'p', QLatin1String("pfpnacc")}, - {'p', QLatin1String("pi2fw")}, - {'p', QLatin1String("pswapd")}, - {'m', QLatin1String("maskmovdqu")}, - {'c', QLatin1String("clflush")}, - {'m', QLatin1String("movntdq")}, - {'m', QLatin1String("movnti")}, - {'m', QLatin1String("movntpd")}, - {'m', QLatin1String("movdqa")}, - {'m', QLatin1String("movdqu")}, - {'m', QLatin1String("movdq2q")}, - {'m', QLatin1String("movq2dq")}, - {'p', QLatin1String("paddq")}, - {'p', QLatin1String("pmuludq")}, - {'p', QLatin1String("pshufd")}, - {'p', QLatin1String("pshufhw")}, - {'p', QLatin1String("pshuflw")}, - {'p', QLatin1String("pslldq")}, - {'p', QLatin1String("psrldq")}, - {'p', QLatin1String("psubq")}, - {'p', QLatin1String("punpckhqdq")}, - {'p', QLatin1String("punpcklqdq")}, - {'a', QLatin1String("addpd")}, - {'a', QLatin1String("addsd")}, - {'a', QLatin1String("andnpd")}, - {'a', QLatin1String("andpd")}, - {'c', QLatin1String("cmpeqpd")}, - {'c', QLatin1String("cmpeqsd")}, - {'c', QLatin1String("cmplepd")}, - {'c', QLatin1String("cmplesd")}, - {'c', QLatin1String("cmpltpd")}, - {'c', QLatin1String("cmpltsd")}, - {'c', QLatin1String("cmpneqpd")}, - {'c', QLatin1String("cmpneqsd")}, - {'c', QLatin1String("cmpnlepd")}, - {'c', QLatin1String("cmpnlesd")}, - {'c', QLatin1String("cmpnltpd")}, - {'c', QLatin1String("cmpnltsd")}, - {'c', QLatin1String("cmpordpd")}, - {'c', QLatin1String("cmpordsd")}, - {'c', QLatin1String("cmpunordpd")}, - {'c', QLatin1String("cmpunordsd")}, - {'c', QLatin1String("cmppd")}, - {'c', QLatin1String("comisd")}, - {'c', QLatin1String("cvtdq2pd")}, - {'c', QLatin1String("cvtdq2ps")}, - {'c', QLatin1String("cvtpd2dq")}, - {'c', QLatin1String("cvtpd2pi")}, - {'c', QLatin1String("cvtpd2ps")}, - {'c', QLatin1String("cvtpi2pd")}, - {'c', QLatin1String("cvtps2dq")}, - {'c', QLatin1String("cvtps2pd")}, - {'c', QLatin1String("cvtsd2si")}, - {'c', QLatin1String("cvtsd2ss")}, - {'c', QLatin1String("cvtsi2sd")}, - {'c', QLatin1String("cvtss2sd")}, - {'c', QLatin1String("cvttpd2pi")}, - {'c', QLatin1String("cvttpd2dq")}, - {'c', QLatin1String("cvttps2dq")}, - {'c', QLatin1String("cvttsd2si")}, - {'d', QLatin1String("divpd")}, - {'d', QLatin1String("divsd")}, - {'m', QLatin1String("maxpd")}, - {'m', QLatin1String("maxsd")}, - {'m', QLatin1String("minpd")}, - {'m', QLatin1String("minsd")}, - {'m', QLatin1String("movapd")}, - {'m', QLatin1String("movhpd")}, - {'m', QLatin1String("movlpd")}, - {'m', QLatin1String("movmskpd")}, - {'m', QLatin1String("movupd")}, - {'m', QLatin1String("mulpd")}, - {'m', QLatin1String("mulsd")}, - {'o', QLatin1String("orpd")}, - {'s', QLatin1String("shufpd")}, - {'s', QLatin1String("sqrtpd")}, - {'s', QLatin1String("sqrtsd")}, - {'s', QLatin1String("subpd")}, - {'s', QLatin1String("subsd")}, - {'u', QLatin1String("ucomisd")}, - {'u', QLatin1String("unpckhpd")}, - {'u', QLatin1String("unpcklpd")}, - {'x', QLatin1String("xorpd")}, - {'a', QLatin1String("addsubpd")}, - {'a', QLatin1String("addsubps")}, - {'h', QLatin1String("haddpd")}, - {'h', QLatin1String("haddps")}, - {'h', QLatin1String("hsubpd")}, - {'h', QLatin1String("hsubps")}, - {'l', QLatin1String("lddqu")}, - {'m', QLatin1String("movddup")}, - {'m', QLatin1String("movshdup")}, - {'m', QLatin1String("movsldup")}, - {'c', QLatin1String("clgi")}, - {'s', QLatin1String("stgi")}, - {'v', QLatin1String("vmcall")}, - {'v', QLatin1String("vmclear")}, - {'v', QLatin1String("vmfunc")}, - {'v', QLatin1String("vmlaunch")}, - {'v', QLatin1String("vmload")}, - {'v', QLatin1String("vmmcall")}, - {'v', QLatin1String("vmptrld")}, - {'v', QLatin1String("vmptrst")}, - {'v', QLatin1String("vmread")}, - {'v', QLatin1String("vmresume")}, - {'v', QLatin1String("vmrun")}, - {'v', QLatin1String("vmsave")}, - {'v', QLatin1String("vmwrite")}, - {'v', QLatin1String("vmxoff")}, - {'v', QLatin1String("vmxon")}, - {'i', QLatin1String("invept")}, - {'i', QLatin1String("invvpid")}, - {'p', QLatin1String("pabsb")}, - {'p', QLatin1String("pabsw")}, - {'p', QLatin1String("pabsd")}, - {'p', QLatin1String("palignr")}, - {'p', QLatin1String("phaddw")}, - {'p', QLatin1String("phaddd")}, - {'p', QLatin1String("phaddsw")}, - {'p', QLatin1String("phsubw")}, - {'p', QLatin1String("phsubd")}, - {'p', QLatin1String("phsubsw")}, - {'p', QLatin1String("pmaddubsw")}, - {'p', QLatin1String("pmulhrsw")}, - {'p', QLatin1String("pshufb")}, - {'p', QLatin1String("psignb")}, - {'p', QLatin1String("psignw")}, - {'p', QLatin1String("psignd")}, - {'e', QLatin1String("extrq")}, - {'i', QLatin1String("insertq")}, - {'m', QLatin1String("movntsd")}, - {'m', QLatin1String("movntss")}, - {'l', QLatin1String("lzcnt")}, - {'b', QLatin1String("blendpd")}, - {'b', QLatin1String("blendps")}, - {'b', QLatin1String("blendvpd")}, - {'b', QLatin1String("blendvps")}, - {'d', QLatin1String("dppd")}, - {'d', QLatin1String("dpps")}, - {'e', QLatin1String("extractps")}, - {'i', QLatin1String("insertps")}, - {'m', QLatin1String("movntdqa")}, - {'m', QLatin1String("mpsadbw")}, - {'p', QLatin1String("packusdw")}, - {'p', QLatin1String("pblendvb")}, - {'p', QLatin1String("pblendw")}, - {'p', QLatin1String("pcmpeqq")}, - {'p', QLatin1String("pextrb")}, - {'p', QLatin1String("pextrd")}, - {'p', QLatin1String("pextrq")}, - {'p', QLatin1String("phminposuw")}, - {'p', QLatin1String("pinsrb")}, - {'p', QLatin1String("pinsrd")}, - {'p', QLatin1String("pinsrq")}, - {'p', QLatin1String("pmaxsb")}, - {'p', QLatin1String("pmaxsd")}, - {'p', QLatin1String("pmaxud")}, - {'p', QLatin1String("pmaxuw")}, - {'p', QLatin1String("pminsb")}, - {'p', QLatin1String("pminsd")}, - {'p', QLatin1String("pminud")}, - {'p', QLatin1String("pminuw")}, - {'p', QLatin1String("pmovsxbw")}, - {'p', QLatin1String("pmovsxbd")}, - {'p', QLatin1String("pmovsxbq")}, - {'p', QLatin1String("pmovsxwd")}, - {'p', QLatin1String("pmovsxwq")}, - {'p', QLatin1String("pmovsxdq")}, - {'p', QLatin1String("pmovzxbw")}, - {'p', QLatin1String("pmovzxbd")}, - {'p', QLatin1String("pmovzxbq")}, - {'p', QLatin1String("pmovzxwd")}, - {'p', QLatin1String("pmovzxwq")}, - {'p', QLatin1String("pmovzxdq")}, - {'p', QLatin1String("pmuldq")}, - {'p', QLatin1String("pmulld")}, - {'p', QLatin1String("ptest")}, - {'r', QLatin1String("roundpd")}, - {'r', QLatin1String("roundps")}, - {'r', QLatin1String("roundsd")}, - {'r', QLatin1String("roundss")}, - {'c', QLatin1String("crc32")}, - {'p', QLatin1String("pcmpestri")}, - {'p', QLatin1String("pcmpestrm")}, - {'p', QLatin1String("pcmpistri")}, - {'p', QLatin1String("pcmpistrm")}, - {'p', QLatin1String("pcmpgtq")}, - {'p', QLatin1String("popcnt")}, - {'g', QLatin1String("getsec")}, - {'p', QLatin1String("pfrcpv")}, - {'p', QLatin1String("pfrsqrtv")}, - {'m', QLatin1String("movbe")}, - {'a', QLatin1String("aesenc")}, - {'a', QLatin1String("aesenclast")}, - {'a', QLatin1String("aesdec")}, - {'a', QLatin1String("aesdeclast")}, - {'a', QLatin1String("aesimc")}, - {'a', QLatin1String("aeskeygenassist")}, - {'v', QLatin1String("vaesenc")}, - {'v', QLatin1String("vaesenclast")}, - {'v', QLatin1String("vaesdec")}, - {'v', QLatin1String("vaesdeclast")}, - {'v', QLatin1String("vaesimc")}, - {'v', QLatin1String("vaeskeygenassist")}, - {'v', QLatin1String("vaddpd")}, - {'v', QLatin1String("vaddps")}, - {'v', QLatin1String("vaddsd")}, - {'v', QLatin1String("vaddss")}, - {'v', QLatin1String("vaddsubpd")}, - {'v', QLatin1String("vaddsubps")}, - {'v', QLatin1String("vandpd")}, - {'v', QLatin1String("vandps")}, - {'v', QLatin1String("vandnpd")}, - {'v', QLatin1String("vandnps")}, - {'v', QLatin1String("vblendpd")}, - {'v', QLatin1String("vblendps")}, - {'v', QLatin1String("vblendvpd")}, - {'v', QLatin1String("vblendvps")}, - {'v', QLatin1String("vbroadcastss")}, - {'v', QLatin1String("vbroadcastsd")}, - {'v', QLatin1String("vbroadcastf128")}, - {'v', QLatin1String("vcmpeq_ospd")}, - {'v', QLatin1String("vcmpeqpd")}, - {'v', QLatin1String("vcmplt_ospd")}, - {'v', QLatin1String("vcmpltpd")}, - {'v', QLatin1String("vcmple_ospd")}, - {'v', QLatin1String("vcmplepd")}, - {'v', QLatin1String("vcmpunord_qpd")}, - {'v', QLatin1String("vcmpunordpd")}, - {'v', QLatin1String("vcmpneq_uqpd")}, - {'v', QLatin1String("vcmpneqpd")}, - {'v', QLatin1String("vcmpnlt_uspd")}, - {'v', QLatin1String("vcmpnltpd")}, - {'v', QLatin1String("vcmpnle_uspd")}, - {'v', QLatin1String("vcmpnlepd")}, - {'v', QLatin1String("vcmpord_qpd")}, - {'v', QLatin1String("vcmpordpd")}, - {'v', QLatin1String("vcmpeq_uqpd")}, - {'v', QLatin1String("vcmpnge_uspd")}, - {'v', QLatin1String("vcmpngepd")}, - {'v', QLatin1String("vcmpngt_uspd")}, - {'v', QLatin1String("vcmpngtpd")}, - {'v', QLatin1String("vcmpfalse_oqpd")}, - {'v', QLatin1String("vcmpfalsepd")}, - {'v', QLatin1String("vcmpneq_oqpd")}, - {'v', QLatin1String("vcmpge_ospd")}, - {'v', QLatin1String("vcmpgepd")}, - {'v', QLatin1String("vcmpgt_ospd")}, - {'v', QLatin1String("vcmpgtpd")}, - {'v', QLatin1String("vcmptrue_uqpd")}, - {'v', QLatin1String("vcmptruepd")}, - {'v', QLatin1String("vcmplt_oqpd")}, - {'v', QLatin1String("vcmple_oqpd")}, - {'v', QLatin1String("vcmpunord_spd")}, - {'v', QLatin1String("vcmpneq_uspd")}, - {'v', QLatin1String("vcmpnlt_uqpd")}, - {'v', QLatin1String("vcmpnle_uqpd")}, - {'v', QLatin1String("vcmpord_spd")}, - {'v', QLatin1String("vcmpeq_uspd")}, - {'v', QLatin1String("vcmpnge_uqpd")}, - {'v', QLatin1String("vcmpngt_uqpd")}, - {'v', QLatin1String("vcmpfalse_ospd")}, - {'v', QLatin1String("vcmpneq_ospd")}, - {'v', QLatin1String("vcmpge_oqpd")}, - {'v', QLatin1String("vcmpgt_oqpd")}, - {'v', QLatin1String("vcmptrue_uspd")}, - {'v', QLatin1String("vcmppd")}, - {'v', QLatin1String("vcmpeq_osps")}, - {'v', QLatin1String("vcmpeqps")}, - {'v', QLatin1String("vcmplt_osps")}, - {'v', QLatin1String("vcmpltps")}, - {'v', QLatin1String("vcmple_osps")}, - {'v', QLatin1String("vcmpleps")}, - {'v', QLatin1String("vcmpunord_qps")}, - {'v', QLatin1String("vcmpunordps")}, - {'v', QLatin1String("vcmpneq_uqps")}, - {'v', QLatin1String("vcmpneqps")}, - {'v', QLatin1String("vcmpnlt_usps")}, - {'v', QLatin1String("vcmpnltps")}, - {'v', QLatin1String("vcmpnle_usps")}, - {'v', QLatin1String("vcmpnleps")}, - {'v', QLatin1String("vcmpord_qps")}, - {'v', QLatin1String("vcmpordps")}, - {'v', QLatin1String("vcmpeq_uqps")}, - {'v', QLatin1String("vcmpnge_usps")}, - {'v', QLatin1String("vcmpngeps")}, - {'v', QLatin1String("vcmpngt_usps")}, - {'v', QLatin1String("vcmpngtps")}, - {'v', QLatin1String("vcmpfalse_oqps")}, - {'v', QLatin1String("vcmpfalseps")}, - {'v', QLatin1String("vcmpneq_oqps")}, - {'v', QLatin1String("vcmpge_osps")}, - {'v', QLatin1String("vcmpgeps")}, - {'v', QLatin1String("vcmpgt_osps")}, - {'v', QLatin1String("vcmpgtps")}, - {'v', QLatin1String("vcmptrue_uqps")}, - {'v', QLatin1String("vcmptrueps")}, - {'v', QLatin1String("vcmplt_oqps")}, - {'v', QLatin1String("vcmple_oqps")}, - {'v', QLatin1String("vcmpunord_sps")}, - {'v', QLatin1String("vcmpneq_usps")}, - {'v', QLatin1String("vcmpnlt_uqps")}, - {'v', QLatin1String("vcmpnle_uqps")}, - {'v', QLatin1String("vcmpord_sps")}, - {'v', QLatin1String("vcmpeq_usps")}, - {'v', QLatin1String("vcmpnge_uqps")}, - {'v', QLatin1String("vcmpngt_uqps")}, - {'v', QLatin1String("vcmpfalse_osps")}, - {'v', QLatin1String("vcmpneq_osps")}, - {'v', QLatin1String("vcmpge_oqps")}, - {'v', QLatin1String("vcmpgt_oqps")}, - {'v', QLatin1String("vcmptrue_usps")}, - {'v', QLatin1String("vcmpps")}, - {'v', QLatin1String("vcmpeq_ossd")}, - {'v', QLatin1String("vcmpeqsd")}, - {'v', QLatin1String("vcmplt_ossd")}, - {'v', QLatin1String("vcmpltsd")}, - {'v', QLatin1String("vcmple_ossd")}, - {'v', QLatin1String("vcmplesd")}, - {'v', QLatin1String("vcmpunord_qsd")}, - {'v', QLatin1String("vcmpunordsd")}, - {'v', QLatin1String("vcmpneq_uqsd")}, - {'v', QLatin1String("vcmpneqsd")}, - {'v', QLatin1String("vcmpnlt_ussd")}, - {'v', QLatin1String("vcmpnltsd")}, - {'v', QLatin1String("vcmpnle_ussd")}, - {'v', QLatin1String("vcmpnlesd")}, - {'v', QLatin1String("vcmpord_qsd")}, - {'v', QLatin1String("vcmpordsd")}, - {'v', QLatin1String("vcmpeq_uqsd")}, - {'v', QLatin1String("vcmpnge_ussd")}, - {'v', QLatin1String("vcmpngesd")}, - {'v', QLatin1String("vcmpngt_ussd")}, - {'v', QLatin1String("vcmpngtsd")}, - {'v', QLatin1String("vcmpfalse_oqsd")}, - {'v', QLatin1String("vcmpfalsesd")}, - {'v', QLatin1String("vcmpneq_oqsd")}, - {'v', QLatin1String("vcmpge_ossd")}, - {'v', QLatin1String("vcmpgesd")}, - {'v', QLatin1String("vcmpgt_ossd")}, - {'v', QLatin1String("vcmpgtsd")}, - {'v', QLatin1String("vcmptrue_uqsd")}, - {'v', QLatin1String("vcmptruesd")}, - {'v', QLatin1String("vcmplt_oqsd")}, - {'v', QLatin1String("vcmple_oqsd")}, - {'v', QLatin1String("vcmpunord_ssd")}, - {'v', QLatin1String("vcmpneq_ussd")}, - {'v', QLatin1String("vcmpnlt_uqsd")}, - {'v', QLatin1String("vcmpnle_uqsd")}, - {'v', QLatin1String("vcmpord_ssd")}, - {'v', QLatin1String("vcmpeq_ussd")}, - {'v', QLatin1String("vcmpnge_uqsd")}, - {'v', QLatin1String("vcmpngt_uqsd")}, - {'v', QLatin1String("vcmpfalse_ossd")}, - {'v', QLatin1String("vcmpneq_ossd")}, - {'v', QLatin1String("vcmpge_oqsd")}, - {'v', QLatin1String("vcmpgt_oqsd")}, - {'v', QLatin1String("vcmptrue_ussd")}, - {'v', QLatin1String("vcmpsd")}, - {'v', QLatin1String("vcmpeq_osss")}, - {'v', QLatin1String("vcmpeqss")}, - {'v', QLatin1String("vcmplt_osss")}, - {'v', QLatin1String("vcmpltss")}, - {'v', QLatin1String("vcmple_osss")}, - {'v', QLatin1String("vcmpless")}, - {'v', QLatin1String("vcmpunord_qss")}, - {'v', QLatin1String("vcmpunordss")}, - {'v', QLatin1String("vcmpneq_uqss")}, - {'v', QLatin1String("vcmpneqss")}, - {'v', QLatin1String("vcmpnlt_usss")}, - {'v', QLatin1String("vcmpnltss")}, - {'v', QLatin1String("vcmpnle_usss")}, - {'v', QLatin1String("vcmpnless")}, - {'v', QLatin1String("vcmpord_qss")}, - {'v', QLatin1String("vcmpordss")}, - {'v', QLatin1String("vcmpeq_uqss")}, - {'v', QLatin1String("vcmpnge_usss")}, - {'v', QLatin1String("vcmpngess")}, - {'v', QLatin1String("vcmpngt_usss")}, - {'v', QLatin1String("vcmpngtss")}, - {'v', QLatin1String("vcmpfalse_oqss")}, - {'v', QLatin1String("vcmpfalsess")}, - {'v', QLatin1String("vcmpneq_oqss")}, - {'v', QLatin1String("vcmpge_osss")}, - {'v', QLatin1String("vcmpgess")}, - {'v', QLatin1String("vcmpgt_osss")}, - {'v', QLatin1String("vcmpgtss")}, - {'v', QLatin1String("vcmptrue_uqss")}, - {'v', QLatin1String("vcmptruess")}, - {'v', QLatin1String("vcmplt_oqss")}, - {'v', QLatin1String("vcmple_oqss")}, - {'v', QLatin1String("vcmpunord_sss")}, - {'v', QLatin1String("vcmpneq_usss")}, - {'v', QLatin1String("vcmpnlt_uqss")}, - {'v', QLatin1String("vcmpnle_uqss")}, - {'v', QLatin1String("vcmpord_sss")}, - {'v', QLatin1String("vcmpeq_usss")}, - {'v', QLatin1String("vcmpnge_uqss")}, - {'v', QLatin1String("vcmpngt_uqss")}, - {'v', QLatin1String("vcmpfalse_osss")}, - {'v', QLatin1String("vcmpneq_osss")}, - {'v', QLatin1String("vcmpge_oqss")}, - {'v', QLatin1String("vcmpgt_oqss")}, - {'v', QLatin1String("vcmptrue_usss")}, - {'v', QLatin1String("vcmpss")}, - {'v', QLatin1String("vcomisd")}, - {'v', QLatin1String("vcomiss")}, - {'v', QLatin1String("vcvtdq2pd")}, - {'v', QLatin1String("vcvtdq2ps")}, - {'v', QLatin1String("vcvtpd2dq")}, - {'v', QLatin1String("vcvtpd2ps")}, - {'v', QLatin1String("vcvtps2dq")}, - {'v', QLatin1String("vcvtps2pd")}, - {'v', QLatin1String("vcvtsd2si")}, - {'v', QLatin1String("vcvtsd2ss")}, - {'v', QLatin1String("vcvtsi2sd")}, - {'v', QLatin1String("vcvtsi2ss")}, - {'v', QLatin1String("vcvtss2sd")}, - {'v', QLatin1String("vcvtss2si")}, - {'v', QLatin1String("vcvttpd2dq")}, - {'v', QLatin1String("vcvttps2dq")}, - {'v', QLatin1String("vcvttsd2si")}, - {'v', QLatin1String("vcvttss2si")}, - {'v', QLatin1String("vdivpd")}, - {'v', QLatin1String("vdivps")}, - {'v', QLatin1String("vdivsd")}, - {'v', QLatin1String("vdivss")}, - {'v', QLatin1String("vdppd")}, - {'v', QLatin1String("vdpps")}, - {'v', QLatin1String("vextractf128")}, - {'v', QLatin1String("vextractps")}, - {'v', QLatin1String("vhaddpd")}, - {'v', QLatin1String("vhaddps")}, - {'v', QLatin1String("vhsubpd")}, - {'v', QLatin1String("vhsubps")}, - {'v', QLatin1String("vinsertf128")}, - {'v', QLatin1String("vinsertps")}, - {'v', QLatin1String("vlddqu")}, - {'v', QLatin1String("vldqqu")}, - {'v', QLatin1String("vldmxcsr")}, - {'v', QLatin1String("vmaskmovdqu")}, - {'v', QLatin1String("vmaskmovps")}, - {'v', QLatin1String("vmaskmovpd")}, - {'v', QLatin1String("vmaxpd")}, - {'v', QLatin1String("vmaxps")}, - {'v', QLatin1String("vmaxsd")}, - {'v', QLatin1String("vmaxss")}, - {'v', QLatin1String("vminpd")}, - {'v', QLatin1String("vminps")}, - {'v', QLatin1String("vminsd")}, - {'v', QLatin1String("vminss")}, - {'v', QLatin1String("vmovapd")}, - {'v', QLatin1String("vmovaps")}, - {'v', QLatin1String("vmovd")}, - {'v', QLatin1String("vmovq")}, - {'v', QLatin1String("vmovddup")}, - {'v', QLatin1String("vmovdqa")}, - {'v', QLatin1String("vmovqqa")}, - {'v', QLatin1String("vmovdqu")}, - {'v', QLatin1String("vmovqqu")}, - {'v', QLatin1String("vmovhlps")}, - {'v', QLatin1String("vmovhpd")}, - {'v', QLatin1String("vmovhps")}, - {'v', QLatin1String("vmovlhps")}, - {'v', QLatin1String("vmovlpd")}, - {'v', QLatin1String("vmovlps")}, - {'v', QLatin1String("vmovmskpd")}, - {'v', QLatin1String("vmovmskps")}, - {'v', QLatin1String("vmovntdq")}, - {'v', QLatin1String("vmovntqq")}, - {'v', QLatin1String("vmovntdqa")}, - {'v', QLatin1String("vmovntpd")}, - {'v', QLatin1String("vmovntps")}, - {'v', QLatin1String("vmovsd")}, - {'v', QLatin1String("vmovshdup")}, - {'v', QLatin1String("vmovsldup")}, - {'v', QLatin1String("vmovss")}, - {'v', QLatin1String("vmovupd")}, - {'v', QLatin1String("vmovups")}, - {'v', QLatin1String("vmpsadbw")}, - {'v', QLatin1String("vmulpd")}, - {'v', QLatin1String("vmulps")}, - {'v', QLatin1String("vmulsd")}, - {'v', QLatin1String("vmulss")}, - {'v', QLatin1String("vorpd")}, - {'v', QLatin1String("vorps")}, - {'v', QLatin1String("vpabsb")}, - {'v', QLatin1String("vpabsw")}, - {'v', QLatin1String("vpabsd")}, - {'v', QLatin1String("vpacksswb")}, - {'v', QLatin1String("vpackssdw")}, - {'v', QLatin1String("vpackuswb")}, - {'v', QLatin1String("vpackusdw")}, - {'v', QLatin1String("vpaddb")}, - {'v', QLatin1String("vpaddw")}, - {'v', QLatin1String("vpaddd")}, - {'v', QLatin1String("vpaddq")}, - {'v', QLatin1String("vpaddsb")}, - {'v', QLatin1String("vpaddsw")}, - {'v', QLatin1String("vpaddusb")}, - {'v', QLatin1String("vpaddusw")}, - {'v', QLatin1String("vpalignr")}, - {'v', QLatin1String("vpand")}, - {'v', QLatin1String("vpandn")}, - {'v', QLatin1String("vpavgb")}, - {'v', QLatin1String("vpavgw")}, - {'v', QLatin1String("vpblendvb")}, - {'v', QLatin1String("vpblendw")}, - {'v', QLatin1String("vpcmpestri")}, - {'v', QLatin1String("vpcmpestrm")}, - {'v', QLatin1String("vpcmpistri")}, - {'v', QLatin1String("vpcmpistrm")}, - {'v', QLatin1String("vpcmpeqb")}, - {'v', QLatin1String("vpcmpeqw")}, - {'v', QLatin1String("vpcmpeqd")}, - {'v', QLatin1String("vpcmpeqq")}, - {'v', QLatin1String("vpcmpgtb")}, - {'v', QLatin1String("vpcmpgtw")}, - {'v', QLatin1String("vpcmpgtd")}, - {'v', QLatin1String("vpcmpgtq")}, - {'v', QLatin1String("vpermilpd")}, - {'v', QLatin1String("vpermilps")}, - {'v', QLatin1String("vperm2f128")}, - {'v', QLatin1String("vpextrb")}, - {'v', QLatin1String("vpextrw")}, - {'v', QLatin1String("vpextrd")}, - {'v', QLatin1String("vpextrq")}, - {'v', QLatin1String("vphaddw")}, - {'v', QLatin1String("vphaddd")}, - {'v', QLatin1String("vphaddsw")}, - {'v', QLatin1String("vphminposuw")}, - {'v', QLatin1String("vphsubw")}, - {'v', QLatin1String("vphsubd")}, - {'v', QLatin1String("vphsubsw")}, - {'v', QLatin1String("vpinsrb")}, - {'v', QLatin1String("vpinsrw")}, - {'v', QLatin1String("vpinsrd")}, - {'v', QLatin1String("vpinsrq")}, - {'v', QLatin1String("vpmaddwd")}, - {'v', QLatin1String("vpmaddubsw")}, - {'v', QLatin1String("vpmaxsb")}, - {'v', QLatin1String("vpmaxsw")}, - {'v', QLatin1String("vpmaxsd")}, - {'v', QLatin1String("vpmaxub")}, - {'v', QLatin1String("vpmaxuw")}, - {'v', QLatin1String("vpmaxud")}, - {'v', QLatin1String("vpminsb")}, - {'v', QLatin1String("vpminsw")}, - {'v', QLatin1String("vpminsd")}, - {'v', QLatin1String("vpminub")}, - {'v', QLatin1String("vpminuw")}, - {'v', QLatin1String("vpminud")}, - {'v', QLatin1String("vpmovmskb")}, - {'v', QLatin1String("vpmovsxbw")}, - {'v', QLatin1String("vpmovsxbd")}, - {'v', QLatin1String("vpmovsxbq")}, - {'v', QLatin1String("vpmovsxwd")}, - {'v', QLatin1String("vpmovsxwq")}, - {'v', QLatin1String("vpmovsxdq")}, - {'v', QLatin1String("vpmovzxbw")}, - {'v', QLatin1String("vpmovzxbd")}, - {'v', QLatin1String("vpmovzxbq")}, - {'v', QLatin1String("vpmovzxwd")}, - {'v', QLatin1String("vpmovzxwq")}, - {'v', QLatin1String("vpmovzxdq")}, - {'v', QLatin1String("vpmulhuw")}, - {'v', QLatin1String("vpmulhrsw")}, - {'v', QLatin1String("vpmulhw")}, - {'v', QLatin1String("vpmullw")}, - {'v', QLatin1String("vpmulld")}, - {'v', QLatin1String("vpmuludq")}, - {'v', QLatin1String("vpmuldq")}, - {'v', QLatin1String("vpor")}, - {'v', QLatin1String("vpsadbw")}, - {'v', QLatin1String("vpshufb")}, - {'v', QLatin1String("vpshufd")}, - {'v', QLatin1String("vpshufhw")}, - {'v', QLatin1String("vpshuflw")}, - {'v', QLatin1String("vpsignb")}, - {'v', QLatin1String("vpsignw")}, - {'v', QLatin1String("vpsignd")}, - {'v', QLatin1String("vpslldq")}, - {'v', QLatin1String("vpsrldq")}, - {'v', QLatin1String("vpsllw")}, - {'v', QLatin1String("vpslld")}, - {'v', QLatin1String("vpsllq")}, - {'v', QLatin1String("vpsraw")}, - {'v', QLatin1String("vpsrad")}, - {'v', QLatin1String("vpsrlw")}, - {'v', QLatin1String("vpsrld")}, - {'v', QLatin1String("vpsrlq")}, - {'v', QLatin1String("vptest")}, - {'v', QLatin1String("vpsubb")}, - {'v', QLatin1String("vpsubw")}, - {'v', QLatin1String("vpsubd")}, - {'v', QLatin1String("vpsubq")}, - {'v', QLatin1String("vpsubsb")}, - {'v', QLatin1String("vpsubsw")}, - {'v', QLatin1String("vpsubusb")}, - {'v', QLatin1String("vpsubusw")}, - {'v', QLatin1String("vpunpckhbw")}, - {'v', QLatin1String("vpunpckhwd")}, - {'v', QLatin1String("vpunpckhdq")}, - {'v', QLatin1String("vpunpckhqdq")}, - {'v', QLatin1String("vpunpcklbw")}, - {'v', QLatin1String("vpunpcklwd")}, - {'v', QLatin1String("vpunpckldq")}, - {'v', QLatin1String("vpunpcklqdq")}, - {'v', QLatin1String("vpxor")}, - {'v', QLatin1String("vrcpps")}, - {'v', QLatin1String("vrcpss")}, - {'v', QLatin1String("vrsqrtps")}, - {'v', QLatin1String("vrsqrtss")}, - {'v', QLatin1String("vroundpd")}, - {'v', QLatin1String("vroundps")}, - {'v', QLatin1String("vroundsd")}, - {'v', QLatin1String("vroundss")}, - {'v', QLatin1String("vshufpd")}, - {'v', QLatin1String("vshufps")}, - {'v', QLatin1String("vsqrtpd")}, - {'v', QLatin1String("vsqrtps")}, - {'v', QLatin1String("vsqrtsd")}, - {'v', QLatin1String("vsqrtss")}, - {'v', QLatin1String("vstmxcsr")}, - {'v', QLatin1String("vsubpd")}, - {'v', QLatin1String("vsubps")}, - {'v', QLatin1String("vsubsd")}, - {'v', QLatin1String("vsubss")}, - {'v', QLatin1String("vtestps")}, - {'v', QLatin1String("vtestpd")}, - {'v', QLatin1String("vucomisd")}, - {'v', QLatin1String("vucomiss")}, - {'v', QLatin1String("vunpckhpd")}, - {'v', QLatin1String("vunpckhps")}, - {'v', QLatin1String("vunpcklpd")}, - {'v', QLatin1String("vunpcklps")}, - {'v', QLatin1String("vxorpd")}, - {'v', QLatin1String("vxorps")}, - {'v', QLatin1String("vzeroall")}, - {'v', QLatin1String("vzeroupper")}, - {'p', QLatin1String("pclmullqlqdq")}, - {'p', QLatin1String("pclmulhqlqdq")}, - {'p', QLatin1String("pclmullqhqdq")}, - {'p', QLatin1String("pclmulhqhqdq")}, - {'p', QLatin1String("pclmulqdq")}, - {'v', QLatin1String("vpclmullqlqdq")}, - {'v', QLatin1String("vpclmulhqlqdq")}, - {'v', QLatin1String("vpclmullqhqdq")}, - {'v', QLatin1String("vpclmulhqhqdq")}, - {'v', QLatin1String("vpclmulqdq")}, - {'v', QLatin1String("vfmadd132ps")}, - {'v', QLatin1String("vfmadd132pd")}, - {'v', QLatin1String("vfmadd312ps")}, - {'v', QLatin1String("vfmadd312pd")}, - {'v', QLatin1String("vfmadd213ps")}, - {'v', QLatin1String("vfmadd213pd")}, - {'v', QLatin1String("vfmadd123ps")}, - {'v', QLatin1String("vfmadd123pd")}, - {'v', QLatin1String("vfmadd231ps")}, - {'v', QLatin1String("vfmadd231pd")}, - {'v', QLatin1String("vfmadd321ps")}, - {'v', QLatin1String("vfmadd321pd")}, - {'v', QLatin1String("vfmaddsub132ps")}, - {'v', QLatin1String("vfmaddsub132pd")}, - {'v', QLatin1String("vfmaddsub312ps")}, - {'v', QLatin1String("vfmaddsub312pd")}, - {'v', QLatin1String("vfmaddsub213ps")}, - {'v', QLatin1String("vfmaddsub213pd")}, - {'v', QLatin1String("vfmaddsub123ps")}, - {'v', QLatin1String("vfmaddsub123pd")}, - {'v', QLatin1String("vfmaddsub231ps")}, - {'v', QLatin1String("vfmaddsub231pd")}, - {'v', QLatin1String("vfmaddsub321ps")}, - {'v', QLatin1String("vfmaddsub321pd")}, - {'v', QLatin1String("vfmsub132ps")}, - {'v', QLatin1String("vfmsub132pd")}, - {'v', QLatin1String("vfmsub312ps")}, - {'v', QLatin1String("vfmsub312pd")}, - {'v', QLatin1String("vfmsub213ps")}, - {'v', QLatin1String("vfmsub213pd")}, - {'v', QLatin1String("vfmsub123ps")}, - {'v', QLatin1String("vfmsub123pd")}, - {'v', QLatin1String("vfmsub231ps")}, - {'v', QLatin1String("vfmsub231pd")}, - {'v', QLatin1String("vfmsub321ps")}, - {'v', QLatin1String("vfmsub321pd")}, - {'v', QLatin1String("vfmsubadd132ps")}, - {'v', QLatin1String("vfmsubadd132pd")}, - {'v', QLatin1String("vfmsubadd312ps")}, - {'v', QLatin1String("vfmsubadd312pd")}, - {'v', QLatin1String("vfmsubadd213ps")}, - {'v', QLatin1String("vfmsubadd213pd")}, - {'v', QLatin1String("vfmsubadd123ps")}, - {'v', QLatin1String("vfmsubadd123pd")}, - {'v', QLatin1String("vfmsubadd231ps")}, - {'v', QLatin1String("vfmsubadd231pd")}, - {'v', QLatin1String("vfmsubadd321ps")}, - {'v', QLatin1String("vfmsubadd321pd")}, - {'v', QLatin1String("vfnmadd132ps")}, - {'v', QLatin1String("vfnmadd132pd")}, - {'v', QLatin1String("vfnmadd312ps")}, - {'v', QLatin1String("vfnmadd312pd")}, - {'v', QLatin1String("vfnmadd213ps")}, - {'v', QLatin1String("vfnmadd213pd")}, - {'v', QLatin1String("vfnmadd123ps")}, - {'v', QLatin1String("vfnmadd123pd")}, - {'v', QLatin1String("vfnmadd231ps")}, - {'v', QLatin1String("vfnmadd231pd")}, - {'v', QLatin1String("vfnmadd321ps")}, - {'v', QLatin1String("vfnmadd321pd")}, - {'v', QLatin1String("vfnmsub132ps")}, - {'v', QLatin1String("vfnmsub132pd")}, - {'v', QLatin1String("vfnmsub312ps")}, - {'v', QLatin1String("vfnmsub312pd")}, - {'v', QLatin1String("vfnmsub213ps")}, - {'v', QLatin1String("vfnmsub213pd")}, - {'v', QLatin1String("vfnmsub123ps")}, - {'v', QLatin1String("vfnmsub123pd")}, - {'v', QLatin1String("vfnmsub231ps")}, - {'v', QLatin1String("vfnmsub231pd")}, - {'v', QLatin1String("vfnmsub321ps")}, - {'v', QLatin1String("vfnmsub321pd")}, - {'v', QLatin1String("vfmadd132ss")}, - {'v', QLatin1String("vfmadd132sd")}, - {'v', QLatin1String("vfmadd312ss")}, - {'v', QLatin1String("vfmadd312sd")}, - {'v', QLatin1String("vfmadd213ss")}, - {'v', QLatin1String("vfmadd213sd")}, - {'v', QLatin1String("vfmadd123ss")}, - {'v', QLatin1String("vfmadd123sd")}, - {'v', QLatin1String("vfmadd231ss")}, - {'v', QLatin1String("vfmadd231sd")}, - {'v', QLatin1String("vfmadd321ss")}, - {'v', QLatin1String("vfmadd321sd")}, - {'v', QLatin1String("vfmsub132ss")}, - {'v', QLatin1String("vfmsub132sd")}, - {'v', QLatin1String("vfmsub312ss")}, - {'v', QLatin1String("vfmsub312sd")}, - {'v', QLatin1String("vfmsub213ss")}, - {'v', QLatin1String("vfmsub213sd")}, - {'v', QLatin1String("vfmsub123ss")}, - {'v', QLatin1String("vfmsub123sd")}, - {'v', QLatin1String("vfmsub231ss")}, - {'v', QLatin1String("vfmsub231sd")}, - {'v', QLatin1String("vfmsub321ss")}, - {'v', QLatin1String("vfmsub321sd")}, - {'v', QLatin1String("vfnmadd132ss")}, - {'v', QLatin1String("vfnmadd132sd")}, - {'v', QLatin1String("vfnmadd312ss")}, - {'v', QLatin1String("vfnmadd312sd")}, - {'v', QLatin1String("vfnmadd213ss")}, - {'v', QLatin1String("vfnmadd213sd")}, - {'v', QLatin1String("vfnmadd123ss")}, - {'v', QLatin1String("vfnmadd123sd")}, - {'v', QLatin1String("vfnmadd231ss")}, - {'v', QLatin1String("vfnmadd231sd")}, - {'v', QLatin1String("vfnmadd321ss")}, - {'v', QLatin1String("vfnmadd321sd")}, - {'v', QLatin1String("vfnmsub132ss")}, - {'v', QLatin1String("vfnmsub132sd")}, - {'v', QLatin1String("vfnmsub312ss")}, - {'v', QLatin1String("vfnmsub312sd")}, - {'v', QLatin1String("vfnmsub213ss")}, - {'v', QLatin1String("vfnmsub213sd")}, - {'v', QLatin1String("vfnmsub123ss")}, - {'v', QLatin1String("vfnmsub123sd")}, - {'v', QLatin1String("vfnmsub231ss")}, - {'v', QLatin1String("vfnmsub231sd")}, - {'v', QLatin1String("vfnmsub321ss")}, - {'v', QLatin1String("vfnmsub321sd")}, - {'r', QLatin1String("rdfsbase")}, - {'r', QLatin1String("rdgsbase")}, - {'r', QLatin1String("rdrand")}, - {'w', QLatin1String("wrfsbase")}, - {'w', QLatin1String("wrgsbase")}, - {'v', QLatin1String("vcvtph2ps")}, - {'v', QLatin1String("vcvtps2ph")}, - {'a', QLatin1String("adcx")}, - {'a', QLatin1String("adox")}, - {'r', QLatin1String("rdseed")}, - {'c', QLatin1String("clac")}, - {'s', QLatin1String("stac")}, - {'x', QLatin1String("xstore")}, - {'x', QLatin1String("xcryptecb")}, - {'x', QLatin1String("xcryptcbc")}, - {'x', QLatin1String("xcryptctr")}, - {'x', QLatin1String("xcryptcfb")}, - {'x', QLatin1String("xcryptofb")}, - {'m', QLatin1String("montmul")}, - {'x', QLatin1String("xsha1")}, - {'x', QLatin1String("xsha256")}, - {'l', QLatin1String("llwpcb")}, - {'s', QLatin1String("slwpcb")}, - {'l', QLatin1String("lwpval")}, - {'l', QLatin1String("lwpins")}, - {'v', QLatin1String("vfmaddpd")}, - {'v', QLatin1String("vfmaddps")}, - {'v', QLatin1String("vfmaddsd")}, - {'v', QLatin1String("vfmaddss")}, - {'v', QLatin1String("vfmaddsubpd")}, - {'v', QLatin1String("vfmaddsubps")}, - {'v', QLatin1String("vfmsubaddpd")}, - {'v', QLatin1String("vfmsubaddps")}, - {'v', QLatin1String("vfmsubpd")}, - {'v', QLatin1String("vfmsubps")}, - {'v', QLatin1String("vfmsubsd")}, - {'v', QLatin1String("vfmsubss")}, - {'v', QLatin1String("vfnmaddpd")}, - {'v', QLatin1String("vfnmaddps")}, - {'v', QLatin1String("vfnmaddsd")}, - {'v', QLatin1String("vfnmaddss")}, - {'v', QLatin1String("vfnmsubpd")}, - {'v', QLatin1String("vfnmsubps")}, - {'v', QLatin1String("vfnmsubsd")}, - {'v', QLatin1String("vfnmsubss")}, - {'v', QLatin1String("vfrczpd")}, - {'v', QLatin1String("vfrczps")}, - {'v', QLatin1String("vfrczsd")}, - {'v', QLatin1String("vfrczss")}, - {'v', QLatin1String("vpcmov")}, - {'v', QLatin1String("vpcomb")}, - {'v', QLatin1String("vpcomd")}, - {'v', QLatin1String("vpcomq")}, - {'v', QLatin1String("vpcomub")}, - {'v', QLatin1String("vpcomud")}, - {'v', QLatin1String("vpcomuq")}, - {'v', QLatin1String("vpcomuw")}, - {'v', QLatin1String("vpcomw")}, - {'v', QLatin1String("vphaddbd")}, - {'v', QLatin1String("vphaddbq")}, - {'v', QLatin1String("vphaddbw")}, - {'v', QLatin1String("vphadddq")}, - {'v', QLatin1String("vphaddubd")}, - {'v', QLatin1String("vphaddubq")}, - {'v', QLatin1String("vphaddubw")}, - {'v', QLatin1String("vphaddudq")}, - {'v', QLatin1String("vphadduwd")}, - {'v', QLatin1String("vphadduwq")}, - {'v', QLatin1String("vphaddwd")}, - {'v', QLatin1String("vphaddwq")}, - {'v', QLatin1String("vphsubbw")}, - {'v', QLatin1String("vphsubdq")}, - {'v', QLatin1String("vphsubwd")}, - {'v', QLatin1String("vpmacsdd")}, - {'v', QLatin1String("vpmacsdqh")}, - {'v', QLatin1String("vpmacsdql")}, - {'v', QLatin1String("vpmacssdd")}, - {'v', QLatin1String("vpmacssdqh")}, - {'v', QLatin1String("vpmacssdql")}, - {'v', QLatin1String("vpmacsswd")}, - {'v', QLatin1String("vpmacssww")}, - {'v', QLatin1String("vpmacswd")}, - {'v', QLatin1String("vpmacsww")}, - {'v', QLatin1String("vpmadcsswd")}, - {'v', QLatin1String("vpmadcswd")}, - {'v', QLatin1String("vpperm")}, - {'v', QLatin1String("vprotb")}, - {'v', QLatin1String("vprotd")}, - {'v', QLatin1String("vprotq")}, - {'v', QLatin1String("vprotw")}, - {'v', QLatin1String("vpshab")}, - {'v', QLatin1String("vpshad")}, - {'v', QLatin1String("vpshaq")}, - {'v', QLatin1String("vpshaw")}, - {'v', QLatin1String("vpshlb")}, - {'v', QLatin1String("vpshld")}, - {'v', QLatin1String("vpshlq")}, - {'v', QLatin1String("vpshlw")}, - {'v', QLatin1String("vbroadcasti128")}, - {'v', QLatin1String("vpblendd")}, - {'v', QLatin1String("vpbroadcastb")}, - {'v', QLatin1String("vpbroadcastw")}, - {'v', QLatin1String("vpbroadcastd")}, - {'v', QLatin1String("vpbroadcastq")}, - {'v', QLatin1String("vpermd")}, - {'v', QLatin1String("vpermpd")}, - {'v', QLatin1String("vpermps")}, - {'v', QLatin1String("vpermq")}, - {'v', QLatin1String("vperm2i128")}, - {'v', QLatin1String("vextracti128")}, - {'v', QLatin1String("vinserti128")}, - {'v', QLatin1String("vpmaskmovd")}, - {'v', QLatin1String("vpmaskmovq")}, - {'v', QLatin1String("vpsllvd")}, - {'v', QLatin1String("vpsllvq")}, - {'v', QLatin1String("vpsravd")}, - {'v', QLatin1String("vpsrlvd")}, - {'v', QLatin1String("vpsrlvq")}, - {'v', QLatin1String("vgatherdpd")}, - {'v', QLatin1String("vgatherqpd")}, - {'v', QLatin1String("vgatherdps")}, - {'v', QLatin1String("vgatherqps")}, - {'v', QLatin1String("vpgatherdd")}, - {'v', QLatin1String("vpgatherqd")}, - {'v', QLatin1String("vpgatherdq")}, - {'v', QLatin1String("vpgatherqq")}, - {'x', QLatin1String("xabort")}, - {'x', QLatin1String("xbegin")}, - {'x', QLatin1String("xend")}, - {'x', QLatin1String("xtest")}, - {'a', QLatin1String("andn")}, - {'b', QLatin1String("bextr")}, - {'b', QLatin1String("blci")}, - {'b', QLatin1String("blcic")}, - {'b', QLatin1String("blsi")}, - {'b', QLatin1String("blsic")}, - {'b', QLatin1String("blcfill")}, - {'b', QLatin1String("blsfill")}, - {'b', QLatin1String("blcmsk")}, - {'b', QLatin1String("blsmsk")}, - {'b', QLatin1String("blsr")}, - {'b', QLatin1String("blcs")}, - {'b', QLatin1String("bzhi")}, - {'m', QLatin1String("mulx")}, - {'p', QLatin1String("pdep")}, - {'p', QLatin1String("pext")}, - {'r', QLatin1String("rorx")}, - {'s', QLatin1String("sarx")}, - {'s', QLatin1String("shlx")}, - {'s', QLatin1String("shrx")}, - {'t', QLatin1String("tzcnt")}, - {'t', QLatin1String("tzmsk")}, - {'t', QLatin1String("t1mskc")}, - {'v', QLatin1String("valignd")}, - {'v', QLatin1String("valignq")}, - {'v', QLatin1String("vblendmpd")}, - {'v', QLatin1String("vblendmps")}, - {'v', QLatin1String("vbroadcastf32x4")}, - {'v', QLatin1String("vbroadcastf64x4")}, - {'v', QLatin1String("vbroadcasti32x4")}, - {'v', QLatin1String("vbroadcasti64x4")}, - {'v', QLatin1String("vcompresspd")}, - {'v', QLatin1String("vcompressps")}, - {'v', QLatin1String("vcvtpd2udq")}, - {'v', QLatin1String("vcvtps2udq")}, - {'v', QLatin1String("vcvtsd2usi")}, - {'v', QLatin1String("vcvtss2usi")}, - {'v', QLatin1String("vcvttpd2udq")}, - {'v', QLatin1String("vcvttps2udq")}, - {'v', QLatin1String("vcvttsd2usi")}, - {'v', QLatin1String("vcvttss2usi")}, - {'v', QLatin1String("vcvtudq2pd")}, - {'v', QLatin1String("vcvtudq2ps")}, - {'v', QLatin1String("vcvtusi2sd")}, - {'v', QLatin1String("vcvtusi2ss")}, - {'v', QLatin1String("vexpandpd")}, - {'v', QLatin1String("vexpandps")}, - {'v', QLatin1String("vextractf32x4")}, - {'v', QLatin1String("vextractf64x4")}, - {'v', QLatin1String("vextracti32x4")}, - {'v', QLatin1String("vextracti64x4")}, - {'v', QLatin1String("vfixupimmpd")}, - {'v', QLatin1String("vfixupimmps")}, - {'v', QLatin1String("vfixupimmsd")}, - {'v', QLatin1String("vfixupimmss")}, - {'v', QLatin1String("vgetexppd")}, - {'v', QLatin1String("vgetexpps")}, - {'v', QLatin1String("vgetexpsd")}, - {'v', QLatin1String("vgetexpss")}, - {'v', QLatin1String("vgetmantpd")}, - {'v', QLatin1String("vgetmantps")}, - {'v', QLatin1String("vgetmantsd")}, - {'v', QLatin1String("vgetmantss")}, - {'v', QLatin1String("vinsertf32x4")}, - {'v', QLatin1String("vinsertf64x4")}, - {'v', QLatin1String("vinserti32x4")}, - {'v', QLatin1String("vinserti64x4")}, - {'v', QLatin1String("vmovdqa32")}, - {'v', QLatin1String("vmovdqa64")}, - {'v', QLatin1String("vmovdqu32")}, - {'v', QLatin1String("vmovdqu64")}, - {'v', QLatin1String("vpabsq")}, - {'v', QLatin1String("vpandd")}, - {'v', QLatin1String("vpandnd")}, - {'v', QLatin1String("vpandnq")}, - {'v', QLatin1String("vpandq")}, - {'v', QLatin1String("vpblendmd")}, - {'v', QLatin1String("vpblendmq")}, - {'v', QLatin1String("vpcmpltd")}, - {'v', QLatin1String("vpcmpled")}, - {'v', QLatin1String("vpcmpneqd")}, - {'v', QLatin1String("vpcmpnltd")}, - {'v', QLatin1String("vpcmpnled")}, - {'v', QLatin1String("vpcmpd")}, - {'v', QLatin1String("vpcmpltq")}, - {'v', QLatin1String("vpcmpleq")}, - {'v', QLatin1String("vpcmpneqq")}, - {'v', QLatin1String("vpcmpnltq")}, - {'v', QLatin1String("vpcmpnleq")}, - {'v', QLatin1String("vpcmpq")}, - {'v', QLatin1String("vpcmpequd")}, - {'v', QLatin1String("vpcmpltud")}, - {'v', QLatin1String("vpcmpleud")}, - {'v', QLatin1String("vpcmpnequd")}, - {'v', QLatin1String("vpcmpnltud")}, - {'v', QLatin1String("vpcmpnleud")}, - {'v', QLatin1String("vpcmpud")}, - {'v', QLatin1String("vpcmpequq")}, - {'v', QLatin1String("vpcmpltuq")}, - {'v', QLatin1String("vpcmpleuq")}, - {'v', QLatin1String("vpcmpnequq")}, - {'v', QLatin1String("vpcmpnltuq")}, - {'v', QLatin1String("vpcmpnleuq")}, - {'v', QLatin1String("vpcmpuq")}, - {'v', QLatin1String("vpcompressd")}, - {'v', QLatin1String("vpcompressq")}, - {'v', QLatin1String("vpermi2d")}, - {'v', QLatin1String("vpermi2pd")}, - {'v', QLatin1String("vpermi2ps")}, - {'v', QLatin1String("vpermi2q")}, - {'v', QLatin1String("vpermt2d")}, - {'v', QLatin1String("vpermt2pd")}, - {'v', QLatin1String("vpermt2ps")}, - {'v', QLatin1String("vpermt2q")}, - {'v', QLatin1String("vpexpandd")}, - {'v', QLatin1String("vpexpandq")}, - {'v', QLatin1String("vpmaxsq")}, - {'v', QLatin1String("vpmaxuq")}, - {'v', QLatin1String("vpminsq")}, - {'v', QLatin1String("vpminuq")}, - {'v', QLatin1String("vpmovdb")}, - {'v', QLatin1String("vpmovdw")}, - {'v', QLatin1String("vpmovqb")}, - {'v', QLatin1String("vpmovqd")}, - {'v', QLatin1String("vpmovqw")}, - {'v', QLatin1String("vpmovsdb")}, - {'v', QLatin1String("vpmovsdw")}, - {'v', QLatin1String("vpmovsqb")}, - {'v', QLatin1String("vpmovsqd")}, - {'v', QLatin1String("vpmovsqw")}, - {'v', QLatin1String("vpmovusdb")}, - {'v', QLatin1String("vpmovusdw")}, - {'v', QLatin1String("vpmovusqb")}, - {'v', QLatin1String("vpmovusqd")}, - {'v', QLatin1String("vpmovusqw")}, - {'v', QLatin1String("vpord")}, - {'v', QLatin1String("vporq")}, - {'v', QLatin1String("vprold")}, - {'v', QLatin1String("vprolq")}, - {'v', QLatin1String("vprolvd")}, - {'v', QLatin1String("vprolvq")}, - {'v', QLatin1String("vprord")}, - {'v', QLatin1String("vprorq")}, - {'v', QLatin1String("vprorvd")}, - {'v', QLatin1String("vprorvq")}, - {'v', QLatin1String("vpscatterdd")}, - {'v', QLatin1String("vpscatterdq")}, - {'v', QLatin1String("vpscatterqd")}, - {'v', QLatin1String("vpscatterqq")}, - {'v', QLatin1String("vpsraq")}, - {'v', QLatin1String("vpsravq")}, - {'v', QLatin1String("vpternlogd")}, - {'v', QLatin1String("vpternlogq")}, - {'v', QLatin1String("vptestmd")}, - {'v', QLatin1String("vptestmq")}, - {'v', QLatin1String("vptestnmd")}, - {'v', QLatin1String("vptestnmq")}, - {'v', QLatin1String("vpxord")}, - {'v', QLatin1String("vpxorq")}, - {'v', QLatin1String("vrcp14pd")}, - {'v', QLatin1String("vrcp14ps")}, - {'v', QLatin1String("vrcp14sd")}, - {'v', QLatin1String("vrcp14ss")}, - {'v', QLatin1String("vrndscalepd")}, - {'v', QLatin1String("vrndscaleps")}, - {'v', QLatin1String("vrndscalesd")}, - {'v', QLatin1String("vrndscaless")}, - {'v', QLatin1String("vrsqrt14pd")}, - {'v', QLatin1String("vrsqrt14ps")}, - {'v', QLatin1String("vrsqrt14sd")}, - {'v', QLatin1String("vrsqrt14ss")}, - {'v', QLatin1String("vscalefpd")}, - {'v', QLatin1String("vscalefps")}, - {'v', QLatin1String("vscalefsd")}, - {'v', QLatin1String("vscalefss")}, - {'v', QLatin1String("vscatterdpd")}, - {'v', QLatin1String("vscatterdps")}, - {'v', QLatin1String("vscatterqpd")}, - {'v', QLatin1String("vscatterqps")}, - {'v', QLatin1String("vshuff32x4")}, - {'v', QLatin1String("vshuff64x2")}, - {'v', QLatin1String("vshufi32x4")}, - {'v', QLatin1String("vshufi64x2")}, - {'k', QLatin1String("kandnw")}, - {'k', QLatin1String("kandw")}, - {'k', QLatin1String("kmovw")}, - {'k', QLatin1String("knotw")}, - {'k', QLatin1String("kortestw")}, - {'k', QLatin1String("korw")}, - {'k', QLatin1String("kshiftlw")}, - {'k', QLatin1String("kshiftrw")}, - {'k', QLatin1String("kunpckbw")}, - {'k', QLatin1String("kxnorw")}, - {'k', QLatin1String("kxorw")}, - {'v', QLatin1String("vpbroadcastmb2q")}, - {'v', QLatin1String("vpbroadcastmw2d")}, - {'v', QLatin1String("vpconflictd")}, - {'v', QLatin1String("vpconflictq")}, - {'v', QLatin1String("vplzcntd")}, - {'v', QLatin1String("vplzcntq")}, - {'v', QLatin1String("vexp2pd")}, - {'v', QLatin1String("vexp2ps")}, - {'v', QLatin1String("vrcp28pd")}, - {'v', QLatin1String("vrcp28ps")}, - {'v', QLatin1String("vrcp28sd")}, - {'v', QLatin1String("vrcp28ss")}, - {'v', QLatin1String("vrsqrt28pd")}, - {'v', QLatin1String("vrsqrt28ps")}, - {'v', QLatin1String("vrsqrt28sd")}, - {'v', QLatin1String("vrsqrt28ss")}, - {'v', QLatin1String("vgatherpf0dpd")}, - {'v', QLatin1String("vgatherpf0dps")}, - {'v', QLatin1String("vgatherpf0qpd")}, - {'v', QLatin1String("vgatherpf0qps")}, - {'v', QLatin1String("vgatherpf1dpd")}, - {'v', QLatin1String("vgatherpf1dps")}, - {'v', QLatin1String("vgatherpf1qpd")}, - {'v', QLatin1String("vgatherpf1qps")}, - {'v', QLatin1String("vscatterpf0dpd")}, - {'v', QLatin1String("vscatterpf0dps")}, - {'v', QLatin1String("vscatterpf0qpd")}, - {'v', QLatin1String("vscatterpf0qps")}, - {'v', QLatin1String("vscatterpf1dpd")}, - {'v', QLatin1String("vscatterpf1dps")}, - {'v', QLatin1String("vscatterpf1qpd")}, - {'v', QLatin1String("vscatterpf1qps")}, - {'p', QLatin1String("prefetchwt1")}, - {'b', QLatin1String("bndmk")}, - {'b', QLatin1String("bndcl")}, - {'b', QLatin1String("bndcu")}, - {'b', QLatin1String("bndcn")}, - {'b', QLatin1String("bndmov")}, - {'b', QLatin1String("bndldx")}, - {'b', QLatin1String("bndstx")}, - {'s', QLatin1String("sha1rnds4")}, - {'s', QLatin1String("sha1nexte")}, - {'s', QLatin1String("sha1msg1")}, - {'s', QLatin1String("sha1msg2")}, - {'s', QLatin1String("sha256rnds2")}, - {'s', QLatin1String("sha256msg1")}, - {'s', QLatin1String("sha256msg2")}, - {'h', QLatin1String("hint_nop")}, - }; - - other = { - {'s', QLatin1String("section")}, - }; - builtin = { - - {'t', QLatin1String("text")}, - {'c', QLatin1String("code")}, - {'d', QLatin1String("data")}, - {'b', QLatin1String("bss")}}; -} - -} // namespace QSourceHighlite diff --git a/lib/QSourceHighlite/languagedata.h b/lib/QSourceHighlite/languagedata.h deleted file mode 100644 index bc523535..00000000 --- a/lib/QSourceHighlite/languagedata.h +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright (c) 2019-2020 Waqar Ahmed -- <waqar.17a@gmail.com> - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */ - -#ifndef QOWNLANGUAGEDATA_H -#define QOWNLANGUAGEDATA_H - -template<typename key, typename val> -class QMultiHash; - -class QLatin1String; - -namespace QSourceHighlite -{ - -using LanguageData = QMultiHash<char, QLatin1String>; - -/**********************************************************/ -/* LuaData ************************************************/ -/**********************************************************/ -void loadLuaData(LanguageData &typess, LanguageData &keywordss, - LanguageData &builtins, LanguageData &literalss, - LanguageData &others); - -/**********************************************************/ -/* C/C++ Data *********************************************/ -/**********************************************************/ -void loadCppData(LanguageData &typess, LanguageData &keywordss, - LanguageData &builtins, LanguageData &literalss, - LanguageData &others); - -/**********************************************************/ -/* Shell Data *********************************************/ -/**********************************************************/ -void loadShellData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other); - -/**********************************************************/ -/* JS Data *********************************************/ -/**********************************************************/ -void loadJSData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other); - -/**********************************************************/ -/* PHP Data *********************************************/ -/**********************************************************/ -void loadPHPData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other); - -/**********************************************************/ -/* QML Data *********************************************/ -/**********************************************************/ -void loadQMLData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other); - -/**********************************************************/ -/* Python Data *********************************************/ -/**********************************************************/ -void loadPythonData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other); - -/********************************************************/ -/*** Rust DATA ***********************************/ -/********************************************************/ -void loadRustData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other); - -/********************************************************/ -/*** Java DATA ***********************************/ -/********************************************************/ -void loadJavaData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other); - -/********************************************************/ -/*** C# DATA *************************************/ -/********************************************************/ -void loadCSharpData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other); - -/********************************************************/ -/*** Go DATA *************************************/ -/********************************************************/ -void loadGoData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other); - -/********************************************************/ -/*** V DATA **************************************/ -/********************************************************/ -void loadVData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other); - -/********************************************************/ -/*** SQL DATA ************************************/ -/********************************************************/ -void loadSQLData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other); - -/********************************************************/ -/*** JSON DATA ***********************************/ -/********************************************************/ -void loadJSONData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other); - -/********************************************************/ -/*** CSS DATA ***********************************/ -/********************************************************/ -void loadCSSData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other); - -/********************************************************/ -/*** Typescript DATA *********************************/ -/********************************************************/ -void loadTypescriptData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other); - -/********************************************************/ -/*** YAML DATA ***************************************/ -/********************************************************/ -void loadYAMLData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other); - -/********************************************************/ -/*** VEX DATA ***************************************/ -/********************************************************/ -void loadVEXData(LanguageData &types, LanguageData &keywords, - LanguageData &builtin, LanguageData &literals, - LanguageData &other); - -/********************************************************/ -/*** CMake DATA **************************************/ -/********************************************************/ -void loadCMakeData(QMultiHash<char, QLatin1String> &types, - QMultiHash<char, QLatin1String> &keywords, - QMultiHash<char, QLatin1String> &builtin, - QMultiHash<char, QLatin1String> &literals, - QMultiHash<char, QLatin1String> &other); - -/********************************************************/ -/*** Make DATA ***************************************/ -/********************************************************/ -void loadMakeData(QMultiHash<char, QLatin1String> &types, - QMultiHash<char, QLatin1String> &keywords, - QMultiHash<char, QLatin1String> &builtin, - QMultiHash<char, QLatin1String> &literals, - QMultiHash<char, QLatin1String> &other); - -void loadAsmData(QMultiHash<char, QLatin1String> &types, - QMultiHash<char, QLatin1String> &keywords, - QMultiHash<char, QLatin1String> &builtin, - QMultiHash<char, QLatin1String> &literals, - QMultiHash<char, QLatin1String> &other); -} // namespace QSourceHighlite -#endif diff --git a/lib/QSourceHighlite/qsourcehighliter.cpp b/lib/QSourceHighlite/qsourcehighliter.cpp deleted file mode 100644 index 079bd676..00000000 --- a/lib/QSourceHighlite/qsourcehighliter.cpp +++ /dev/null @@ -1,1099 +0,0 @@ -/* - * Copyright (c) 2019-2020 Waqar Ahmed -- <waqar.17a@gmail.com> - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */ - -#include "qsourcehighliter.h" -#include "languagedata.h" -#include "qsourcehighliterthemes.h" - -#include <QDebug> -#include <algorithm> -#include <QTextDocument> - -namespace QSourceHighlite -{ - -QSourceHighliter::QSourceHighliter(QTextDocument *doc) - : QSyntaxHighlighter(doc) - , _language(CodeC) -{ - initFormats(); -} - -QSourceHighliter::QSourceHighliter(QTextDocument *doc, - QSourceHighliter::Themes theme) - : QSyntaxHighlighter(doc) - , _language(CodeC) -{ - setTheme(theme); -} - -void QSourceHighliter::initFormats() -{ - /**************************************** - * Formats for syntax highlighting - ***************************************/ - - QTextCharFormat format = QTextCharFormat(); - - _formats[Token::CodeBlock] = format; - format = QTextCharFormat(); - - format.setForeground(QColor("#F92672")); - _formats[Token::CodeKeyWord] = format; - format = QTextCharFormat(); - - format.setForeground(QColor("#a39b4e")); - _formats[Token::CodeString] = format; - format = QTextCharFormat(); - - format.setForeground(QColor("#75715E")); - _formats[Token::CodeComment] = format; - format = QTextCharFormat(); - - format.setForeground(QColor("#54aebf")); - _formats[Token::CodeType] = format; - - format = QTextCharFormat(); - format.setForeground(QColor("#db8744")); - _formats[Token::CodeOther] = format; - - format = QTextCharFormat(); - format.setForeground(QColor("#AE81FF")); - _formats[Token::CodeNumLiteral] = format; - - format = QTextCharFormat(); - format.setForeground(QColor("#018a0f")); - _formats[Token::CodeBuiltIn] = format; -} - -void QSourceHighliter::setCurrentLanguage(Language language) -{ - if (language != _language) - _language = language; -} - -QSourceHighliter::Language QSourceHighliter::currentLanguage() -{ - return _language; -} - -void QSourceHighliter::setTheme(QSourceHighliter::Themes theme) -{ - _formats = QSourceHighliterTheme::theme(theme); - rehighlight(); -} - -void QSourceHighliter::highlightBlock(const QString &text) -{ - if (currentBlock() == document()->firstBlock()) - { - setCurrentBlockState(_language); - } - else - { - previousBlockState() == _language ? setCurrentBlockState(_language) - : setCurrentBlockState(_language + 1); - } - - highlightSyntax(text); -} - -/** - * @brief Does the code syntax highlighting - * @param text - */ -void QSourceHighliter::highlightSyntax(const QString &text) -{ - if (text.isEmpty()) - return; - - const auto textLen = text.length(); - - QChar comment; - bool isCSS = false; - bool isYAML = false; - bool isMake = false; - bool isAsm = false; - bool isSQL = false; - - LanguageData keywords{}, others{}, types{}, builtin{}, literals{}; - - switch (currentBlockState()) - { - case CodeLua: - case CodeLuaComment: - loadLuaData(types, keywords, builtin, literals, others); - break; - case CodeCpp: - case CodeCppComment: - loadCppData(types, keywords, builtin, literals, others); - break; - case CodeJs: - case CodeJsComment: - loadJSData(types, keywords, builtin, literals, others); - break; - case CodeC: - case CodeCComment: - loadCppData(types, keywords, builtin, literals, others); - break; - case CodeBash: - loadShellData(types, keywords, builtin, literals, others); - comment = QLatin1Char('#'); - break; - case CodePHP: - case CodePHPComment: - loadPHPData(types, keywords, builtin, literals, others); - break; - case CodeQML: - case CodeQMLComment: - loadQMLData(types, keywords, builtin, literals, others); - break; - case CodePython: - loadPythonData(types, keywords, builtin, literals, others); - comment = QLatin1Char('#'); - break; - case CodeRust: - case CodeRustComment: - loadRustData(types, keywords, builtin, literals, others); - break; - case CodeJava: - case CodeJavaComment: - loadJavaData(types, keywords, builtin, literals, others); - break; - case CodeCSharp: - case CodeCSharpComment: - loadCSharpData(types, keywords, builtin, literals, others); - break; - case CodeGo: - case CodeGoComment: - loadGoData(types, keywords, builtin, literals, others); - break; - case CodeV: - case CodeVComment: - loadVData(types, keywords, builtin, literals, others); - break; - case CodeSQL: - isSQL = true; - loadSQLData(types, keywords, builtin, literals, others); - break; - case CodeJSON: - loadJSONData(types, keywords, builtin, literals, others); - break; - case CodeXML: - xmlHighlighter(text); - return; - case CodeCSS: - case CodeCSSComment: - isCSS = true; - loadCSSData(types, keywords, builtin, literals, others); - break; - case CodeTypeScript: - case CodeTypeScriptComment: - loadTypescriptData(types, keywords, builtin, literals, others); - break; - case CodeYAML: - isYAML = true; - loadYAMLData(types, keywords, builtin, literals, others); - comment = QLatin1Char('#'); - break; - case CodeINI: - comment = QLatin1Char('#'); - break; - case CodeVex: - case CodeVexComment: - loadVEXData(types, keywords, builtin, literals, others); - break; - case CodeCMake: - loadCMakeData(types, keywords, builtin, literals, others); - comment = QLatin1Char('#'); - break; - case CodeMake: - isMake = true; - loadMakeData(types, keywords, builtin, literals, others); - comment = QLatin1Char('#'); - break; - case CodeAsm: - isAsm = true; - loadAsmData(types, keywords, builtin, literals, others); - comment = QLatin1Char('#'); - break; - default: - break; - } - - // keep the default code block format - // this statement is very slow - // TODO: do this formatting when necessary instead of - // applying it to the whole block in the beginning - setFormat(0, textLen, _formats[CodeBlock]); - - auto applyCodeFormat - = [this](int i, const LanguageData &data, const QString &text, - const QTextCharFormat &fmt) -> int { - // check if we are at the beginning OR if this is the start of a word - if (i == 0 - || (!text.at(i - 1).isLetterOrNumber() - && text.at(i - 1) != QLatin1Char('_'))) - { - const auto wordList = data.values(text.at(i).toLatin1()); - for (const QLatin1String &word : wordList) - { - // we have a word match check - // 1. if we are at the end - // 2. if we have a complete word - if (word == strMidRef(text, i, word.size()) - && (i + word.size() == text.length() - || (!text.at(i + word.size()).isLetterOrNumber() - && text.at(i + word.size()) != QLatin1Char('_')))) - { - setFormat(i, word.size(), fmt); - i += word.size(); - } - } - } - return i; - }; - - const QTextCharFormat &formatType = _formats[CodeType]; - const QTextCharFormat &formatKeyword = _formats[CodeKeyWord]; - const QTextCharFormat &formatComment = _formats[CodeComment]; - const QTextCharFormat &formatNumLit = _formats[CodeNumLiteral]; - const QTextCharFormat &formatBuiltIn = _formats[CodeBuiltIn]; - const QTextCharFormat &formatOther = _formats[CodeOther]; - - for (int i = 0; i < textLen; ++i) - { - - if (currentBlockState() % 2 != 0) - goto Comment; - - while (i < textLen && !text[i].isLetter()) - { - if (text[i].isSpace()) - { - ++i; - // make sure we don't cross the bound - if (i == textLen) - return; - if (text[i].isLetter()) - break; - else - continue; - } - // inline comment - if (comment.isNull() && text[i] == QLatin1Char('/')) - { - if ((i + 1) < textLen) - { - if (text[i + 1] == QLatin1Char('/')) - { - setFormat(i, textLen, formatComment); - return; - } - else if (text[i + 1] == QLatin1Char('*')) - { - Comment: - // find a comment end after current position. - int next = text.indexOf(QLatin1String("*/"), i); - if (next == -1) - { - // we didn't find a comment end. - // Check if we are already in a comment block - if (currentBlockState() % 2 == 0) - setCurrentBlockState(currentBlockState() + 1); - setFormat(i, textLen, formatComment); - return; - } - else - { - // we found a comment end - // mark this block as code if it was previously comment - // first check if the comment ended on the same line - // if modulo 2 is not equal to zero, it means we are in a comment - //-1 will set this block's state as language - if (currentBlockState() % 2 != 0) - { - setCurrentBlockState(currentBlockState() - 1); - } - next += 2; - setFormat(i, next - i, formatComment); - i = next; - if (i >= textLen) - return; - } - } - } - } - else if (isSQL && comment.isNull() && text[i] == QLatin1Char('-')) - { - if ((i + 1) < textLen) - { - if (text[i + 1] == QLatin1Char('-')) - { - setFormat(i, textLen, formatComment); - return; - } - } - } - else if (text[i] == comment) - { - setFormat(i, textLen, formatComment); - i = textLen; - // integer literal - } - else if (text[i].isNumber()) - { - i = highlightNumericLiterals(text, i); - // string literals - } - else if (text[i] == QLatin1Char('\"')) - { - i = highlightStringLiterals('\"', text, i); - } - else if (text[i] == QLatin1Char('\'')) - { - i = highlightStringLiterals('\'', text, i); - } - if (i >= textLen) - { - break; - } - ++i; - } - - const int pos = i; - - if (i == textLen || !text[i].isLetter()) - continue; - - /* Highlight Types */ - i = applyCodeFormat(i, types, text, formatType); - /************************************************ - next letter is usually a space, in that case - going forward is useless, so continue; - We can ++i here and go to the beginning of the next word - so that the next formatter can check for formatting but this will - cause problems in case the next word is also of 'Type' or the current - type(keyword/builtin). We can work around it and reset the value of i - in the beginning of the loop to the word's first letter but I am not - sure about its efficiency yet. - ************************************************/ - if (i == textLen || !text[i].isLetter()) - continue; - - /* Highlight Keywords */ - i = applyCodeFormat(i, keywords, text, formatKeyword); - if (i == textLen || !text[i].isLetter()) - continue; - - /* Highlight Literals (true/false/NULL,nullptr) */ - i = applyCodeFormat(i, literals, text, formatNumLit); - if (i == textLen || !text[i].isLetter()) - continue; - - /* Highlight Builtin library stuff */ - i = applyCodeFormat(i, builtin, text, formatBuiltIn); - if (i == textLen || !text[i].isLetter()) - continue; - - /* Highlight other stuff (preprocessor etc.) */ - if ((i == 0 || !text.at(i - 1).isLetter()) - && others.contains(text[i].toLatin1())) - { - const QList<QLatin1String> wordList = others.values(text[i].toLatin1()); - for (const QLatin1String &word : wordList) - { - if (word == strMidRef(text, i, word.size()) // we have a word match - && (i + word.size() == text.length() // check if we are at the end - || !text.at(i + word.size()) - .isLetter()) // OR if we have a complete word - ) - { - currentBlockState() == CodeCpp - ? setFormat(i - 1, word.size() + 1, formatOther) - : setFormat(i, word.size(), formatOther); - i += word.size(); - } - } - } - - // we were unable to find any match, lets skip this word - if (pos == i) - { - int count = i; - while (count < textLen) - { - if (!text[count].isLetter()) - break; - ++count; - } - i = count; - } - } - - if (isCSS) - cssHighlighter(text); - if (isYAML) - ymlHighlighter(text); - if (isMake) - makeHighlighter(text); - if (isAsm) - asmHighlighter(text); -} - -/** - * @brief Highlight string literals in code - * @param strType str type i.e., ' or " - * @param text the text being scanned - * @param i pos of i in loop - * @return pos of i after the string - */ -int QSourceHighliter::highlightStringLiterals(const QChar strType, - const QString &text, int i) -{ - setFormat(i, 1, _formats[CodeString]); - ++i; - - while (i < text.length()) - { - // look for string end - // make sure it's not an escape seq - if (text.at(i) == strType && text.at(i - 1) != QLatin1Char('\\')) - { - setFormat(i, 1, _formats[CodeString]); - ++i; - break; - } - // look for escape sequence - if (text.at(i) == QLatin1Char('\\') && (i + 1) < text.length()) - { - int len = 0; - switch (text.at(i + 1).toLatin1()) - { - case 'a': - case 'b': - case 'e': - case 'f': - case 'n': - case 'r': - case 't': - case 'v': - case '\'': - case '"': - case '\\': - case '\?': - // 2 because we have to highlight \ as well as the following char - len = 2; - break; - // octal esc sequence \123 - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': { - if (i + 4 <= text.length()) - { - bool isCurrentOctal = true; - if (!isOctal(text.at(i + 2).toLatin1())) - { - isCurrentOctal = false; - break; - } - if (!isOctal(text.at(i + 3).toLatin1())) - { - isCurrentOctal = false; - break; - } - len = isCurrentOctal ? 4 : 0; - } - break; - } - // hex numbers \xFA - case 'x': { - if (i + 3 <= text.length()) - { - bool isCurrentHex = true; - if (!isHex(text.at(i + 2).toLatin1())) - { - isCurrentHex = false; - break; - } - if (!isHex(text.at(i + 3).toLatin1())) - { - isCurrentHex = false; - break; - } - len = isCurrentHex ? 4 : 0; - } - break; - } - // TODO: implement unicode code point escaping - default: - break; - } - - // if len is zero, that means this wasn't an esc seq - // increment i so that we skip this backslash - if (len == 0) - { - setFormat(i, 1, _formats[CodeString]); - ++i; - continue; - } - - setFormat(i, len, _formats[CodeNumLiteral]); - i += len; - continue; - } - setFormat(i, 1, _formats[CodeString]); - ++i; - } - return i; -} - -/** - * @brief Highlight number literals in code - * @param text the text being scanned - * @param i pos of i in loop - * @return pos of i after the number - */ -int QSourceHighliter::highlightNumericLiterals(const QString &text, int i) -{ - bool isPreAllowed = false; - if (i == 0) - isPreAllowed = true; - else - { - // these values are allowed before a number - switch (text.at(i - 1).toLatin1()) - { - // css number - case ':': - if (currentBlockState() == CodeCSS) - isPreAllowed = true; - break; - case '$': - if (currentBlockState() == CodeAsm) - isPreAllowed = true; - break; - case '[': - case '(': - case '{': - case ' ': - case ',': - case '=': - case '+': - case '-': - case '*': - case '/': - case '%': - case '<': - case '>': - isPreAllowed = true; - break; - } - } - - if (!isPreAllowed) - return i; - - const int start = i; - - if ((i + 1) >= text.length()) - { - setFormat(i, 1, _formats[CodeNumLiteral]); - return ++i; - } - - ++i; - // hex numbers highlighting (only if there's a preceding zero) - if (text.at(i) == QChar('x') && text.at(i - 1) == QChar('0')) - ++i; - - while (i < text.length()) - { - if (!text.at(i).isNumber() && text.at(i) != QChar('.') - && text.at(i) != QChar('e')) // exponent - break; - ++i; - } - - bool isPostAllowed = false; - if (i == text.length()) - { - // cant have e at the end - if (text.at(i - 1) != QChar('e')) - isPostAllowed = true; - } - else - { - // these values are allowed after a number - switch (text.at(i).toLatin1()) - { - case ']': - case ')': - case '}': - case ' ': - case ',': - case '=': - case '+': - case '-': - case '*': - case '/': - case '%': - case '>': - case '<': - case ';': - isPostAllowed = true; - break; - // for 100u, 1.0F - case 'p': - if (currentBlockState() == CodeCSS) - if (i + 1 < text.length() && text.at(i + 1) == QChar('x')) - { - if (i + 2 == text.length() || !text.at(i + 2).isLetterOrNumber()) - isPostAllowed = true; - } - break; - case 'e': - if (currentBlockState() == CodeCSS) - if (i + 1 < text.length() && text.at(i + 1) == QChar('m')) - { - if (i + 2 == text.length() || !text.at(i + 2).isLetterOrNumber()) - isPostAllowed = true; - } - break; - case 'u': - case 'l': - case 'f': - case 'U': - case 'L': - case 'F': - if (i + 1 == text.length() || !text.at(i + 1).isLetterOrNumber()) - { - isPostAllowed = true; - ++i; - } - break; - } - } - if (isPostAllowed) - { - int end = i; - setFormat(start, end - start, _formats[CodeNumLiteral]); - } - // decrement so that the index is at the last number, not after it - return --i; -} - -/** - * @brief The YAML highlighter - * @param text - * @details This function post processes a line after the main syntax - * highlighter has run for additional highlighting. It does these things - * - * If the current line is a comment, skip it - * - * Highlight all the words that have a colon after them as 'keyword' except: - * If the word is a string, skip it. - * If the colon is in between a path, skip it (C:\) - * - * Once the colon is found, the function will skip every character except 'h' - * - * If an h letter is found, check the next 4/5 letters for http/https and - * highlight them as a link (underlined) - */ -void QSourceHighliter::ymlHighlighter(const QString &text) -{ - if (text.isEmpty()) - return; - const auto textLen = text.length(); - bool colonNotFound = false; - - // if this is a comment don't do anything and just return - if (text.trimmed().at(0) == QLatin1Char('#')) - return; - - for (int i = 0; i < textLen; ++i) - { - if (!text.at(i).isLetter()) - continue; - - if (colonNotFound && text.at(i) != QLatin1Char('h')) - continue; - - // we found a string literal, skip it - if (i != 0 - && (text.at(i - 1) == QLatin1Char('"') - || text.at(i - 1) == QLatin1Char('\''))) - { - const int next = text.indexOf(text.at(i - 1), i); - if (next == -1) - break; - i = next; - continue; - } - - const int colon = text.indexOf(QLatin1Char(':'), i); - - // if colon isn't found, we set this true - if (colon == -1) - colonNotFound = true; - - if (!colonNotFound) - { - // if the line ends here, format and return - if (colon + 1 == textLen) - { - setFormat(i, colon - i, _formats[CodeKeyWord]); - return; - } - else - { - // colon is found, check if it isn't some path or something else - if (!(text.at(colon + 1) == QLatin1Char('\\') - && text.at(colon + 1) == QLatin1Char('/'))) - { - setFormat(i, colon - i, _formats[CodeKeyWord]); - } - } - } - - // underlined links - if (text.at(i) == QLatin1Char('h')) - { - if (strMidRef(text, i, 5) == QLatin1String("https") - || strMidRef(text, i, 4) == QLatin1String("http")) - { - int space = text.indexOf(QChar(' '), i); - if (space == -1) - space = textLen; - QTextCharFormat f = _formats[CodeString]; - f.setUnderlineStyle(QTextCharFormat::SingleUnderline); - setFormat(i, space - i, f); - i = space; - } - } - } -} - -void QSourceHighliter::cssHighlighter(const QString &text) -{ - if (text.isEmpty()) - return; - const auto textLen = text.length(); - for (int i = 0; i < textLen; ++i) - { - if (text[i] == QLatin1Char('.') || text[i] == QLatin1Char('#')) - { - if (i + 1 >= textLen) - return; - if (text[i + 1].isSpace() || text[i + 1].isNumber()) - continue; - int space = text.indexOf(QLatin1Char(' '), i); - if (space < 0) - { - space = text.indexOf('{'); - if (space < 0) - { - space = textLen; - } - } - setFormat(i, space - i, _formats[CodeKeyWord]); - i = space; - } - else if (text[i] == QLatin1Char('c')) - { - if (strMidRef(text, i, 5) == QLatin1String("color")) - { - i += 5; - int colon = text.indexOf(QLatin1Char(':'), i); - if (colon < 0) - continue; - i = colon; - i++; - while (i < textLen) - { - if (!text[i].isSpace()) - break; - i++; - } - int semicolon = text.indexOf(QLatin1Char(';')); - if (semicolon < 0) - semicolon = textLen; - const QString color = text.mid(i, semicolon - i); - QTextCharFormat f = _formats[CodeBlock]; - QColor c(color); - if (color.startsWith(QLatin1String("rgb"))) - { - int t = text.indexOf(QLatin1Char('('), i); - int rPos = text.indexOf(QLatin1Char(','), t); - int gPos = text.indexOf(QLatin1Char(','), rPos + 1); - int bPos = text.indexOf(QLatin1Char(')'), gPos); - if (rPos > -1 && gPos > -1 && bPos > -1) - { - const auto r = strMidRef(text, t + 1, rPos - (t + 1)); - const auto g = strMidRef(text, rPos + 1, gPos - (rPos + 1)); - const auto b = strMidRef(text, gPos + 1, bPos - (gPos + 1)); - c.setRgb(r.toInt(), g.toInt(), b.toInt()); - } - else - { - c = _formats[CodeBlock].background().color(); - } - } - - if (!c.isValid()) - { - continue; - } - - int lightness{}; - QColor foreground; - // really dark - if (c.lightness() <= 20) - { - foreground = Qt::white; - } - else if (c.lightness() > 20 && c.lightness() <= 51) - { - foreground = QColor("#ccc"); - } - else if (c.lightness() > 51 && c.lightness() <= 78) - { - foreground = QColor("#bbb"); - } - else if (c.lightness() > 78 && c.lightness() <= 110) - { - foreground = QColor("#bbb"); - } - else if (c.lightness() > 127) - { - lightness = c.lightness() + 100; - foreground = c.darker(lightness); - } - else - { - lightness = c.lightness() + 100; - foreground = c.lighter(lightness); - } - - f.setBackground(c); - f.setForeground(foreground); - setFormat(i, semicolon - i, QTextCharFormat()); // clear prev format - setFormat(i, semicolon - i, f); - i = semicolon; - } - } - } -} - -void QSourceHighliter::xmlHighlighter(const QString &text) -{ - if (text.isEmpty()) - return; - const auto textLen = text.length(); - - setFormat(0, textLen, _formats[CodeBlock]); - - for (int i = 0; i < textLen; ++i) - { - if (text[i] == QLatin1Char('<') && text[i + 1] != QLatin1Char('!')) - { - - const int found = text.indexOf(QLatin1Char('>'), i); - if (found > 0) - { - ++i; - if (text[i] == QLatin1Char('/')) - ++i; - setFormat(i, found - i, _formats[CodeKeyWord]); - } - } - - if (text[i] == QLatin1Char('=')) - { - int lastSpace = text.lastIndexOf(QLatin1Char(' '), i); - if (lastSpace == i - 1) - lastSpace = text.lastIndexOf(QLatin1Char(' '), i - 2); - if (lastSpace > 0) - { - setFormat(lastSpace, i - lastSpace, _formats[CodeBuiltIn]); - } - } - - if (text[i] == QLatin1Char('\"')) - { - const int pos = i; - int cnt = 1; - ++i; - // bound check - if ((i + 1) >= textLen) - return; - while (i < textLen) - { - if (text[i] == QLatin1Char('\"')) - { - ++cnt; - ++i; - break; - } - ++i; - ++cnt; - // bound check - if ((i + 1) >= textLen) - { - ++cnt; - break; - } - } - setFormat(pos, cnt, _formats[CodeString]); - } - } -} - -void QSourceHighliter::makeHighlighter(const QString &text) -{ - int colonPos = text.indexOf(QLatin1Char(':')); - if (colonPos == -1) - return; - setFormat(0, colonPos, _formats[Token::CodeBuiltIn]); -} - -/** - * @brief highlight inline labels such as 'func()' in "call func()" - * @param text - */ -void QSourceHighliter::highlightInlineAsmLabels(const QString &text) -{ -#define Q(s) QStringLiteral(s) - static const QString jumps[27] - = {// 0 - 19 - Q("jmp"), Q("je"), Q("jne"), Q("jz"), Q("jnz"), Q("ja"), Q("jb"), - Q("jg"), Q("jge"), Q("jae"), Q("jl"), Q("jle"), Q("jbe"), Q("jo"), - Q("jno"), Q("js"), Q("jns"), Q("jcxz"), Q("jecxz"), Q("jrcxz"), - // 20 - 24 - Q("loop"), Q("loope"), Q("loopne"), Q("loopz"), Q("loopnz"), - // 25 - 26 - Q("call"), Q("callq")}; -#undef Q - - auto format = _formats[Token::CodeBuiltIn]; - format.setFontUnderline(true); - - const QString trimmed = text.trimmed(); - int start = -1; - int end = -1; - char c{}; - if (!trimmed.isEmpty()) - c = trimmed.at(0).toLatin1(); - if (c == 'j') - { - start = 0; - end = 20; - } - else if (c == 'c') - { - start = 25; - end = 27; - } - else if (c == 'l') - { - start = 20; - end = 25; - } - else - { - return; - } - - auto skipSpaces = [&text](int &j) { - while (text.at(j).isSpace()) - j++; - return j; - }; - - for (int i = start; i < end; ++i) - { - if (trimmed.startsWith(jumps[i])) - { - int j = 0; - skipSpaces(j); - j = j + jumps[i].length() + 1; - skipSpaces(j); - int len = text.length() - j; - setFormat(j, len, format); - } - } -} - -void QSourceHighliter::asmHighlighter(const QString &text) -{ - highlightInlineAsmLabels(text); - // label highlighting - // examples: - // L1: - // LFB1: # local func begin - // - // following e.gs are not a label - // mov %eax, Count::count(%rip) - //.string ": #%s" - - // look for the last occurence of a colon - int colonPos = text.lastIndexOf(QLatin1Char(':')); - if (colonPos == -1) - return; - // check if this colon is in a comment maybe? - bool isComment = text.lastIndexOf('#', colonPos) != -1; - if (isComment) - { - int commentPos = text.lastIndexOf('#', colonPos); - colonPos = text.lastIndexOf(':', commentPos); - } - - auto format = _formats[Token::CodeBuiltIn]; - format.setFontUnderline(true); - - if (colonPos >= text.length() - 1) - { - setFormat(0, colonPos, format); - } - - int i = 0; - bool isLabel = true; - for (i = colonPos + 1; i < text.length(); ++i) - { - if (!text.at(i).isSpace()) - { - isLabel = false; - break; - } - } - - if (!isLabel && i < text.length() && text.at(i) == QLatin1Char('#')) - setFormat(0, colonPos, format); -} -} // namespace QSourceHighlite diff --git a/lib/QSourceHighlite/qsourcehighliter.h b/lib/QSourceHighlite/qsourcehighliter.h deleted file mode 100644 index 726f0b2f..00000000 --- a/lib/QSourceHighlite/qsourcehighliter.h +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (c) 2019-2020 Waqar Ahmed -- <waqar.17a@gmail.com> - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */ - -#ifndef QSOURCEHIGHLITER_H -#define QSOURCEHIGHLITER_H - -#include <QSyntaxHighlighter> - -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) -# include <QStringView> -#endif - -namespace QSourceHighlite -{ - -class QSourceHighliter : public QSyntaxHighlighter -{ -public: - enum Themes - { - Monokai = 1 - }; - - explicit QSourceHighliter(QTextDocument *doc); - QSourceHighliter(QTextDocument *doc, Themes theme); - - // languages - /********* - * When adding a language make sure that its value is a multiple of 2 - * This is because we use the next number as comment for that language - * In case the language doesn't support multiline comments in the traditional - * C++ sense, leave the next value empty. Otherwise mark the next value as - * comment for that language. e.g CodeCpp = 200 CodeCppComment = 201 - */ - enum Language - { - // languages - CodeCpp = 200, - CodeCppComment = 201, - CodeJs = 202, - CodeJsComment = 203, - CodeC = 204, - CodeCComment = 205, - CodeBash = 206, - CodePHP = 208, - CodePHPComment = 209, - CodeQML = 210, - CodeQMLComment = 211, - CodePython = 212, - CodeRust = 214, - CodeRustComment = 215, - CodeJava = 216, - CodeJavaComment = 217, - CodeCSharp = 218, - CodeCSharpComment = 219, - CodeGo = 220, - CodeGoComment = 221, - CodeV = 222, - CodeVComment = 223, - CodeSQL = 224, - CodeJSON = 226, - CodeXML = 228, - CodeCSS = 230, - CodeCSSComment = 231, - CodeTypeScript = 232, - CodeTypeScriptComment = 233, - CodeYAML = 234, - CodeINI = 236, - CodeVex = 238, - CodeVexComment = 239, - CodeCMake = 240, - CodeMake = 242, - CodeAsm = 244, - CodeLua = 246, - CodeLuaComment = 247 - }; - Q_ENUM(Language) - - enum Token - { - CodeBlock, - CodeKeyWord, - CodeString, - CodeComment, - CodeType, - CodeOther, - CodeNumLiteral, - CodeBuiltIn, - }; - Q_ENUM(Token) - - void setCurrentLanguage(Language language); - Q_REQUIRED_RESULT Language currentLanguage(); - void setTheme(Themes theme); - -protected: - void highlightBlock(const QString &text) override; - -private: - void highlightSyntax(const QString &text); - Q_REQUIRED_RESULT int highlightNumericLiterals(const QString &text, int i); - Q_REQUIRED_RESULT int highlightStringLiterals(const QChar strType, - const QString &text, int i); - - /** - * @brief returns true if c is octal - * @param c the char being checked - * @returns true if the number is octal, false otherwise - */ - Q_REQUIRED_RESULT static constexpr inline bool isOctal(const char c) - { - return (c >= '0' && c <= '7'); - } - - /** - * @brief returns true if c is hex - * @param c the char being checked - * @returns true if the number is hex, false otherwise - */ - Q_REQUIRED_RESULT static constexpr inline bool isHex(const char c) - { - return ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') - || (c >= 'A' && c <= 'F')); - } - - void cssHighlighter(const QString &text); - void ymlHighlighter(const QString &text); - void xmlHighlighter(const QString &text); - void makeHighlighter(const QString &text); - void highlightInlineAsmLabels(const QString &text); - void asmHighlighter(const QString &text); - void initFormats(); - -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - static inline QStringView strMidRef(const QString &str, qsizetype position, - qsizetype n = -1) - { - return QStringView(str).mid(position, n); - } -#else - static inline QStringRef strMidRef(const QString &str, int position, - int n = -1) - { - return str.midRef(position, n); - } -#endif - - QHash<Token, QTextCharFormat> _formats; - Language _language; -}; -} // namespace QSourceHighlite -#endif // QSOURCEHIGHLITER_H diff --git a/lib/QSourceHighlite/qsourcehighliterthemes.cpp b/lib/QSourceHighlite/qsourcehighliterthemes.cpp deleted file mode 100644 index 80afb91b..00000000 --- a/lib/QSourceHighlite/qsourcehighliterthemes.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2019-2020 Waqar Ahmed -- <waqar.17a@gmail.com> - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */ - -#include "qsourcehighliterthemes.h" - -namespace QSourceHighlite -{ - -static QHash<QSourceHighliter::Token, QTextCharFormat> formats() -{ - QHash<QSourceHighliter::Token, QTextCharFormat> _formats; - - QTextCharFormat defaultFormat = QTextCharFormat(); - - _formats[QSourceHighliter::Token::CodeBlock] = defaultFormat; - _formats[QSourceHighliter::Token::CodeKeyWord] = defaultFormat; - _formats[QSourceHighliter::Token::CodeString] = defaultFormat; - _formats[QSourceHighliter::Token::CodeComment] = defaultFormat; - _formats[QSourceHighliter::Token::CodeType] = defaultFormat; - _formats[QSourceHighliter::Token::CodeOther] = defaultFormat; - _formats[QSourceHighliter::Token::CodeNumLiteral] = defaultFormat; - _formats[QSourceHighliter::Token::CodeBuiltIn] = defaultFormat; - - return _formats; -} - -static QHash<QSourceHighliter::Token, QTextCharFormat> monokai() -{ - QHash<QSourceHighliter::Token, QTextCharFormat> _formats = formats(); - - _formats[QSourceHighliter::Token::CodeBlock].setForeground( - QColor(227, 226, 214)); - _formats[QSourceHighliter::Token::CodeKeyWord].setForeground( - QColor(249, 38, 114)); - _formats[QSourceHighliter::Token::CodeString].setForeground( - QColor(230, 219, 116)); - _formats[QSourceHighliter::Token::CodeComment].setForeground( - QColor(117, 113, 94)); - _formats[QSourceHighliter::Token::CodeType].setForeground( - QColor(102, 217, 239)); - _formats[QSourceHighliter::Token::CodeOther].setForeground( - QColor(249, 38, 114)); - _formats[QSourceHighliter::Token::CodeNumLiteral].setForeground( - QColor(174, 129, 255)); - _formats[QSourceHighliter::Token::CodeBuiltIn].setForeground( - QColor(166, 226, 46)); - - return _formats; -} - -QHash<QSourceHighliter::Token, QTextCharFormat> -QSourceHighliterTheme::theme(QSourceHighliter::Themes theme) -{ - switch (theme) - { - case QSourceHighliter::Themes::Monokai: - return monokai(); - default: - return {}; - } -} - -} // namespace QSourceHighlite diff --git a/lib/QSourceHighlite/qsourcehighliterthemes.h b/lib/QSourceHighlite/qsourcehighliterthemes.h deleted file mode 100644 index 6dd5a4a6..00000000 --- a/lib/QSourceHighlite/qsourcehighliterthemes.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2019-2020 Waqar Ahmed -- <waqar.17a@gmail.com> - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */ - -#ifndef QSOURCEHIGHLITERTHEMES_H -#define QSOURCEHIGHLITERTHEMES_H - -#include "qsourcehighliter.h" - -namespace QSourceHighlite -{ - -namespace QSourceHighliterTheme -{ -QHash<QSourceHighliter::Token, QTextCharFormat> theme(QSourceHighliter::Themes); - -} // namespace QSourceHighliterTheme - -} // namespace QSourceHighlite -#endif // QSOURCEHIGHLITERTHEMES_H diff --git a/lib/edbee-lib/CMakeLists.txt b/lib/edbee-lib/CMakeLists.txt new file mode 100644 index 00000000..40ce2441 --- /dev/null +++ b/lib/edbee-lib/CMakeLists.txt @@ -0,0 +1,197 @@ +# Should be called before PROJECT. +CMAKE_MINIMUM_REQUIRED(VERSION 3.1...3.20) + +IF(POLICY CMP0020) + CMAKE_POLICY(SET CMP0020 NEW) +ENDIF() + +# hack?? https://stackoverflow.com/questions/31561309/cmake-warnings-under-os-x-macosx-rpath-is-not-specified-for-the-following-targe +set(CMAKE_MACOSX_RPATH 1) + +PROJECT(edbee-lib) + +add_subdirectory(vendor/qslog/ qslog) + +SET(SOURCES + edbee/commands/commentcommand.cpp + edbee/commands/copycommand.cpp + edbee/commands/cutcommand.cpp + edbee/commands/debugcommand.cpp + edbee/commands/duplicatecommand.cpp + edbee/commands/findcommand.cpp + edbee/commands/movelinecommand.cpp + edbee/commands/newlinecommand.cpp + edbee/commands/pastecommand.cpp + edbee/commands/redocommand.cpp + edbee/commands/removecommand.cpp + edbee/commands/replaceselectioncommand.cpp + edbee/commands/selectioncommand.cpp + edbee/commands/tabcommand.cpp + edbee/commands/togglereadonlycommand.cpp + edbee/commands/undocommand.cpp + edbee/data/factorycommandmap.cpp + edbee/data/factorykeymap.cpp + edbee/edbee.cpp + edbee/io/baseplistparser.cpp + edbee/io/jsonparser.cpp + edbee/io/keymapparser.cpp + edbee/io/textdocumentserializer.cpp + edbee/io/tmlanguageparser.cpp + edbee/io/tmthemeparser.cpp + edbee/lexers/grammartextlexer.cpp + edbee/models/change.cpp + edbee/models/changes/abstractrangedchange.cpp + edbee/models/changes/linedatachange.cpp + edbee/models/changes/linedatalistchange.cpp + edbee/models/changes/mergablechangegroup.cpp + edbee/models/changes/selectionchange.cpp + edbee/models/changes/textchange.cpp + edbee/models/changes/textchangewithcaret.cpp + edbee/models/chardocument/chartextbuffer.cpp + edbee/models/chardocument/chartextdocument.cpp + edbee/models/dynamicvariables.cpp + edbee/models/textautocompleteprovider.cpp + edbee/models/textbuffer.cpp + edbee/models/textdocument.cpp + edbee/models/textdocumentfilter.cpp + edbee/models/textdocumentscopes.cpp + edbee/models/texteditorcommandmap.cpp + edbee/models/texteditorconfig.cpp + edbee/models/texteditorkeymap.cpp + edbee/models/textgrammar.cpp + edbee/models/textlexer.cpp + edbee/models/textlinedata.cpp + edbee/models/textrange.cpp + edbee/models/textsearcher.cpp + edbee/models/textundostack.cpp + edbee/texteditorcommand.cpp + edbee/texteditorcontroller.cpp + edbee/texteditorwidget.cpp + edbee/util/cascadingqvariantmap.cpp + edbee/util/gapvector.h + edbee/util/lineending.cpp + edbee/util/lineoffsetvector.cpp + edbee/util/mem/debug_allocs.cpp + edbee/util/mem/debug_new.cpp + edbee/util/rangelineiterator.cpp + edbee/util/rangesetlineiterator.cpp + edbee/util/regexp.cpp + edbee/util/simpleprofiler.cpp + edbee/util/test.cpp + edbee/util/textcodec.cpp + edbee/util/textcodecdetector.cpp + edbee/util/util.cpp + edbee/views/accessibletexteditorwidget.cpp + edbee/views/components/texteditorautocompletecomponent.cpp + edbee/views/components/texteditorcomponent.cpp + edbee/views/components/texteditorrenderer.cpp + edbee/views/components/textmargincomponent.cpp + edbee/views/textcaretcache.cpp + edbee/views/texteditorscrollarea.cpp + edbee/views/textlayout.cpp + edbee/views/textrenderer.cpp + edbee/views/textselection.cpp + edbee/views/texttheme.cpp +) + +SET(HEADERS + edbee/commands/commentcommand.h + edbee/commands/copycommand.h + edbee/commands/cutcommand.h + edbee/commands/debugcommand.h + edbee/commands/duplicatecommand.h + edbee/commands/findcommand.h + edbee/commands/movelinecommand.h + edbee/commands/newlinecommand.h + edbee/commands/pastecommand.h + edbee/commands/redocommand.h + edbee/commands/removecommand.h + edbee/commands/replaceselectioncommand.h + edbee/commands/selectioncommand.h + edbee/commands/tabcommand.h + edbee/commands/togglereadonlycommand.h + edbee/commands/undocommand.h + edbee/data/factorycommandmap.h + edbee/data/factorykeymap.h + edbee/debug.h + edbee/edbee.h + edbee/io/baseplistparser.h + edbee/io/jsonparser.h + edbee/io/keymapparser.h + edbee/io/textdocumentserializer.h + edbee/io/tmlanguageparser.h + edbee/io/tmthemeparser.h + edbee/lexers/grammartextlexer.h + edbee/models/change.h + edbee/models/changes/abstractrangedchange.h + edbee/models/changes/linedatachange.h + edbee/models/changes/linedatalistchange.h + edbee/models/changes/mergablechangegroup.h + edbee/models/changes/selectionchange.h + edbee/models/changes/textchange.h + edbee/models/changes/textchangewithcaret.h + edbee/models/chardocument/chartextbuffer.h + edbee/models/chardocument/chartextdocument.h + edbee/models/dynamicvariables.h + edbee/models/textautocompleteprovider.h + edbee/models/textbuffer.h + edbee/models/textdocument.h + edbee/models/textdocumentfilter.h + edbee/models/textdocumentscopes.h + edbee/models/texteditorcommandmap.h + edbee/models/texteditorconfig.h + edbee/models/texteditorkeymap.h + edbee/models/textgrammar.h + edbee/models/textlexer.h + edbee/models/textlinedata.h + edbee/models/textrange.h + edbee/models/textsearcher.h + edbee/models/textundostack.h + edbee/texteditorcommand.h + edbee/texteditorcontroller.h + edbee/texteditorwidget.h + edbee/util/cascadingqvariantmap.h + edbee/util/lineending.h + edbee/util/lineoffsetvector.h + edbee/util/logging.h + edbee/util/mem/debug_allocs.h + edbee/util/mem/debug_new.h + edbee/util/rangelineiterator.h + edbee/util/rangesetlineiterator.h + edbee/util/regexp.h + edbee/util/simpleprofiler.h + edbee/util/test.h + edbee/util/textcodec.h + edbee/util/textcodecdetector.h + edbee/util/util.h + edbee/views/accessibletexteditorwidget.h + edbee/views/components/texteditorautocompletecomponent.h + edbee/views/components/texteditorcomponent.h + edbee/views/components/texteditorrenderer.h + edbee/views/components/textmargincomponent.h + edbee/views/textcaretcache.h + edbee/views/texteditorscrollarea.h + edbee/views/textlayout.h + edbee/views/textrenderer.h + edbee/views/textselection.h + edbee/views/texttheme.h +) + +add_subdirectory(vendor/onig/ onig) + +find_package(Qt6 REQUIRED COMPONENTS Core Widgets Core5Compat) +set(QT_LIBS Qt6::Core Qt6::Widgets Qt6::Core5Compat) + +ADD_LIBRARY(edbee-lib STATIC + ${SOURCES} ${HEADERS} ${ONIG_SOURCES} + ${ONIG_HEADERS}) + +target_link_libraries(edbee-lib QsLog ${QT_LIBS}) + +set_target_properties(edbee-lib PROPERTIES AUTOMOC ON CXX_STANDARD 11) + +TARGET_INCLUDE_DIRECTORIES(edbee-lib PUBLIC + ${QS_LOG_INCLUDE_DIRS} + ${ONIG_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/lib/edbee-lib/Doxyfile b/lib/edbee-lib/Doxyfile new file mode 100644 index 00000000..7e667a38 --- /dev/null +++ b/lib/edbee-lib/Doxyfile @@ -0,0 +1,1801 @@ +# Doxyfile 1.8.0 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or sequence of words) that should +# identify the project. Note that if you do not use Doxywizard you need +# to put quotes around the project name if it contains spaces. + +PROJECT_NAME = "edbee - Qt Editor Library" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "" + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = images/doc-logo.png + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = ../edbee-lib-doxydocs + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = YES + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding +# "class=itcl::class" will allow you to use the command class in the +# itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all +# comments according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you +# can mix doxygen, HTML, and XML commands with Markdown formatting. +# Disable only in case of backward compatibilities issues. + +MARKDOWN_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and +# unions with only public data fields will be shown inline in the documentation +# of the scope in which they are defined (i.e. file, namespace, or group +# documentation), provided this scope is documented. If set to NO (the default), +# structs, classes, and unions are shown on a separate page (for HTML and Man +# pages) or section (for LaTeX and RTF). + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +SYMBOL_CACHE_SIZE = 0 + +# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be +# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given +# their name and scope. Since this can be an expensive process and often the +# same symbol appear multiple times in the code, doxygen keeps a cache of +# pre-resolved symbols. If the cache is too small doxygen will become slower. +# If the cache is too large, memory is wasted. The cache size is given by this +# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal scope will be included in the documentation. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command <command> <input-file>, where <command> is the value of +# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files +# containing the references data. This must be a list of .bib files. The +# .bib extension is automatically appended if omitted. Using this command +# requires the bibtex tool to be installed. See also +# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style +# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this +# feature you need bibtex and perl available in the search path. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command <filter> <input-file>, where <filter> +# is the value of the INPUT_FILTER tag, and <input-file> is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +#INPUT_FILTER = +INPUT_FILTER = "sed -e 's/\/\/.*TODO/\/\/\/ \\todo/' -e 's/\/\/.*FIXME/\/\/\/ \\todo/'" + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is advised to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when +# changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# style sheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the style sheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = YES + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters"> +# Qt Help Project / Custom Filters</a>. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes"> +# Qt Help Project / Filter Attributes</a>. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) +# at top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. Since the tabs have the same information as the +# navigation tree you can set this option to NO if you already set +# GENERATE_TREEVIEW to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. +# Since the tree basically has the same information as the tab index you +# could consider to set DISABLE_INDEX to NO when enabling this option. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you may also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to +# the MathJax Content Delivery Network so you can quickly see the result without +# installing MathJax. +# However, it is strongly recommended to install a local +# copy of MathJax from http://www.mathjax.org before deployment. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension +# names that should be enabled during MathJax rendering. + +MATHJAX_EXTENSIONS = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = YES + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4 + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the +# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See +# http://en.wikipedia.org/wiki/BibTeX for more info. + +LATEX_BIB_STYLE = plain + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load style sheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. For each +# tag file the location of the external documentation should be added. The +# format of a tag file without this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths +# or URLs. Note that each tag file must have a unique name (where the name does +# NOT include the path). If a tag file is not located in the directory in which +# doxygen is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = YES + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 1 + +# By default doxygen will use the Helvetica font for all dot files that +# doxygen generates. When you want a differently looking font you can specify +# the font name using DOT_FONTNAME. You need to make sure dot is able to find +# the font, which can be done by putting it in a standard location or by setting +# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the Helvetica font. +# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to +# set the path where dot can find it. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = YES + +# If the UML_LOOK tag is enabled, the fields and methods are shown inside +# the class node. If there are many fields or methods and many nodes the +# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS +# threshold limits the number of items for each type to make the size more +# managable. Set this to 0 for no limit. Note that the threshold may be +# exceeded by 50% before the limit is enforced. + +UML_LIMIT_NUM_FIELDS = 10 + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. If you choose svg you need to set +# HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible in IE 9+ (other browsers do not have this requirement). + +DOT_IMAGE_FORMAT = png + +# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to +# enable generation of interactive SVG images that allow zooming and panning. +# Note that this requires a modern browser other than Internet Explorer. +# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you +# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible. Older versions of IE do not have SVG support. + +INTERACTIVE_SVG = NO + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/lib/edbee-lib/doc/coding-style.md b/lib/edbee-lib/doc/coding-style.md new file mode 100644 index 00000000..44ba5484 --- /dev/null +++ b/lib/edbee-lib/doc/coding-style.md @@ -0,0 +1,126 @@ +Coding Style {#coding-style} +============ + +The coding style is based on google's styleguide: + +<http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml> + +* default names: defaultNames +* class names : ClassNames +* const names : CONSTANT_NAMES + +Reference, pointer location can be placed next to type typename or to the variable name +* good: TypeName* object; TypeName& name; +* good: TypeName *object; TypeName &name; +* bad: TypeName * object; TypeName & name; + + +Member instances should be private. Subclasses should never access data members directly unless it's stricly necessary. + +class members +------------- + +A class member name is postfixed with '_'. (To prevent clashes with getter functions) + +~~~{.cpp} +int itemName_; +~~~ + +A class member pointer that is NOT owned by the classes show be postfixed with "Ref". +For example a reference to a buffer is added like this + +~~~{.cpp} +TextBuffer* bufferRef_; +~~~ + +When you have a list of reference the following name is used: + +~~~{.cpp} +QList<Item*> itemRefList_; +~~~ + + +Method definitions +------------------ + +Separate methods from each other with 2 blank lines. This improves the visible separation of method bodies. + + +Ownership +--------- + +In C / C++ you need to do your own garabage collection. So ownership is important. Here are some rules to make the +ownership in the code clear: + +* all class members are 'owned' by the class. If not add the postfix "Ref" (see class members) +* transfering ownership from x => y, prefix the function with the word "give" or "take". +* object.give( x ) gives the ownership of x to object +* object.take( x ) removes the ownership of x from object + +When it is possible for a class to have the ownership of an object optionally, the way to do this is the following. (See redbee::TextEditorController.textDocument[Ref]) + +* give the class 2 members. For example in the case of a document: +* document_, this is the 'owned' document (only if the document is owner else it is 0) +* documentRef_ , this is the reference to the document. This can be a reference to document_ +* For working with the document the documentRef_ member is used +* For destruction/giving etc. the document_ member is used + +When using lists yout can use the following structure + +~~~{.cpp} +QList<ClassName*> objectList_ ; // when owning the items (use qDeleteAll in the destructor) +QList<ClassName*> objectRefList_; // use this when you do not own the objectlist +~~~ + + +Memory Leak Detection and include order +--------------------------------------- + +We use custom memory leak detection. To enable this leak detection it is required to include 'debug.h' +You must include "debug.h" in every Source file AFTER all pre-compiled items and header files. Example: + +~~~{.cpp} +// first you should include the source's header file. (This allows you to see if the headers users 'missing' dependencies' +#include "header-file-of-this-source-file.h" + +// then include all Qt headers (and other external libraries) (sorted alpabeticly). +#include <QHeaders> + +// after this include your other header files from your project (alpabeticly is nice!) +#include "other-custom-headers.h" + +// then include debug.h so memory leak detection can do it's work +#include "debug.h" +~~~ + +This implies that you should never use a new or delete keyword in a header file!!! +main.cpp is different, it includes all DEBUG_NEW stuff below ALL existing header files! + + +Documentation +-------------- + +We make use of doxygen: <http://www.doxygen.org> + +- Put member documentation in the header file. Above the member definition with '/// description'. Or next to the definition '///< description' +- Put class documentation in the header file +- Put method documentation in the source file of the class + + +Header files +------------ +- Use #pragma once.. Most platforms support this keyword, so use it. #ifdef structure is outdated +- Never use code in a header file. Even not for getters and setters. (It has been done in this project on certain places, but recommendation is to not do it, because it can case strange build errors) +- You can make an exception (of course) for template classes / function +- limit the use of templates! This slows down the compilation process and gives very crappy error messages +- Prefer pointers/references above class inclusions in the header file + + +Enumerations +------------ +On several places in the code you will find enumeration definitions. We do not aways force the enumeration +type for variables. The reason for this is, that somethimes it's desirable to extends the number of enumeration options. +And when forcing a enumeration type, you cannot easy pass a custom value and are limited to the predefined definitions. + + + diff --git a/lib/edbee-lib/doc/index.md b/lib/edbee-lib/doc/index.md new file mode 100644 index 00000000..5c1db451 --- /dev/null +++ b/lib/edbee-lib/doc/index.md @@ -0,0 +1,8 @@ +edbee documentation {#mainpage} +=================== + +This is the generated documentation for the edbee library. +Please use the menu above to navigate... + +[Coding Style](@ref coding-style) + diff --git a/lib/edbee-lib/edbee-lib.pri b/lib/edbee-lib/edbee-lib.pri new file mode 100644 index 00000000..5ae6833a --- /dev/null +++ b/lib/edbee-lib/edbee-lib.pri @@ -0,0 +1,191 @@ + + +INCLUDEPATH += $$PWD + +SOURCES += \ + $$PWD/edbee/commands/commentcommand.cpp \ + $$PWD/edbee/commands/copycommand.cpp \ + $$PWD/edbee/commands/cutcommand.cpp \ + $$PWD/edbee/commands/debugcommand.cpp \ + $$PWD/edbee/commands/duplicatecommand.cpp \ + $$PWD/edbee/commands/findcommand.cpp \ + $$PWD/edbee/commands/movelinecommand.cpp \ + $$PWD/edbee/commands/newlinecommand.cpp \ + $$PWD/edbee/commands/pastecommand.cpp \ + $$PWD/edbee/commands/redocommand.cpp \ + $$PWD/edbee/commands/removecommand.cpp \ + $$PWD/edbee/commands/replaceselectioncommand.cpp \ + $$PWD/edbee/commands/selectioncommand.cpp \ + $$PWD/edbee/commands/tabcommand.cpp \ + $$PWD/edbee/commands/togglereadonlycommand.cpp \ + $$PWD/edbee/commands/undocommand.cpp \ + $$PWD/edbee/data/factorycommandmap.cpp \ + $$PWD/edbee/data/factorykeymap.cpp \ + $$PWD/edbee/edbee.cpp \ + $$PWD/edbee/io/baseplistparser.cpp \ + $$PWD/edbee/io/jsonparser.cpp \ + $$PWD/edbee/io/keymapparser.cpp \ + $$PWD/edbee/io/textdocumentserializer.cpp \ + $$PWD/edbee/io/tmlanguageparser.cpp \ + $$PWD/edbee/io/tmthemeparser.cpp \ + $$PWD/edbee/lexers/grammartextlexer.cpp \ + $$PWD/edbee/models/change.cpp \ + $$PWD/edbee/models/changes/abstractrangedchange.cpp \ + $$PWD/edbee/models/changes/linedatachange.cpp \ + $$PWD/edbee/models/changes/linedatalistchange.cpp \ + $$PWD/edbee/models/changes/mergablechangegroup.cpp \ + $$PWD/edbee/models/changes/selectionchange.cpp \ + $$PWD/edbee/models/changes/textchange.cpp \ + $$PWD/edbee/models/changes/textchangewithcaret.cpp \ + $$PWD/edbee/models/chardocument/chartextbuffer.cpp \ + $$PWD/edbee/models/chardocument/chartextdocument.cpp \ + $$PWD/edbee/models/dynamicvariables.cpp \ + $$PWD/edbee/models/textautocompleteprovider.cpp \ + $$PWD/edbee/models/textbuffer.cpp \ + $$PWD/edbee/models/textdocument.cpp \ + $$PWD/edbee/models/textdocumentfilter.cpp \ + $$PWD/edbee/models/textdocumentscopes.cpp \ + $$PWD/edbee/models/texteditorcommandmap.cpp \ + $$PWD/edbee/models/texteditorconfig.cpp \ + $$PWD/edbee/models/texteditorkeymap.cpp \ + $$PWD/edbee/models/textgrammar.cpp \ + $$PWD/edbee/models/textlexer.cpp \ + $$PWD/edbee/models/textlinedata.cpp \ + $$PWD/edbee/models/textrange.cpp \ + $$PWD/edbee/models/textsearcher.cpp \ + $$PWD/edbee/models/textundostack.cpp \ + $$PWD/edbee/texteditorcommand.cpp \ + $$PWD/edbee/texteditorcontroller.cpp \ + $$PWD/edbee/texteditorwidget.cpp \ + $$PWD/edbee/util/cascadingqvariantmap.cpp \ + $$PWD/edbee/util/gapvector.h \ + $$PWD/edbee/util/lineending.cpp \ + $$PWD/edbee/util/lineoffsetvector.cpp \ + $$PWD/edbee/util/mem/debug_allocs.cpp \ + $$PWD/edbee/util/mem/debug_new.cpp \ + $$PWD/edbee/util/rangelineiterator.cpp \ + $$PWD/edbee/util/rangesetlineiterator.cpp \ + $$PWD/edbee/util/regexp.cpp \ + $$PWD/edbee/util/simpleprofiler.cpp \ + $$PWD/edbee/util/test.cpp \ + $$PWD/edbee/util/textcodec.cpp \ + $$PWD/edbee/util/textcodecdetector.cpp \ + $$PWD/edbee/util/util.cpp \ + $$PWD/edbee/views/accessibletexteditorwidget.cpp \ + $$PWD/edbee/views/components/texteditorautocompletecomponent.cpp \ + $$PWD/edbee/views/components/texteditorcomponent.cpp \ + $$PWD/edbee/views/components/texteditorrenderer.cpp \ + $$PWD/edbee/views/components/textmargincomponent.cpp \ + $$PWD/edbee/views/textcaretcache.cpp \ + $$PWD/edbee/views/texteditorscrollarea.cpp \ + $$PWD/edbee/views/textlayout.cpp \ + $$PWD/edbee/views/textrenderer.cpp \ + $$PWD/edbee/views/textselection.cpp \ + $$PWD/edbee/views/texttheme.cpp + +HEADERS += \ + $$PWD/edbee/commands/commentcommand.h \ + $$PWD/edbee/commands/copycommand.h \ + $$PWD/edbee/commands/cutcommand.h \ + $$PWD/edbee/commands/debugcommand.h \ + $$PWD/edbee/commands/duplicatecommand.h \ + $$PWD/edbee/commands/findcommand.h \ + $$PWD/edbee/commands/movelinecommand.h \ + $$PWD/edbee/commands/newlinecommand.h \ + $$PWD/edbee/commands/pastecommand.h \ + $$PWD/edbee/commands/redocommand.h \ + $$PWD/edbee/commands/removecommand.h \ + $$PWD/edbee/commands/replaceselectioncommand.h \ + $$PWD/edbee/commands/selectioncommand.h \ + $$PWD/edbee/commands/tabcommand.h \ + $$PWD/edbee/commands/togglereadonlycommand.h \ + $$PWD/edbee/commands/undocommand.h \ + $$PWD/edbee/data/factorycommandmap.h \ + $$PWD/edbee/data/factorykeymap.h \ + $$PWD/edbee/debug.h \ + $$PWD/edbee/edbee.h \ + $$PWD/edbee/exports.h \ + $$PWD/edbee/io/baseplistparser.h \ + $$PWD/edbee/io/jsonparser.h \ + $$PWD/edbee/io/keymapparser.h \ + $$PWD/edbee/io/textdocumentserializer.h \ + $$PWD/edbee/io/tmlanguageparser.h \ + $$PWD/edbee/io/tmthemeparser.h \ + $$PWD/edbee/lexers/grammartextlexer.h \ + $$PWD/edbee/models/change.h \ + $$PWD/edbee/models/changes/abstractrangedchange.h \ + $$PWD/edbee/models/changes/linedatachange.h \ + $$PWD/edbee/models/changes/linedatalistchange.h \ + $$PWD/edbee/models/changes/mergablechangegroup.h \ + $$PWD/edbee/models/changes/selectionchange.h \ + $$PWD/edbee/models/changes/textchange.h \ + $$PWD/edbee/models/changes/textchangewithcaret.h \ + $$PWD/edbee/models/chardocument/chartextbuffer.h \ + $$PWD/edbee/models/chardocument/chartextdocument.h \ + $$PWD/edbee/models/dynamicvariables.h \ + $$PWD/edbee/models/textautocompleteprovider.h \ + $$PWD/edbee/models/textbuffer.h \ + $$PWD/edbee/models/textdocument.h \ + $$PWD/edbee/models/textdocumentfilter.h \ + $$PWD/edbee/models/textdocumentscopes.h \ + $$PWD/edbee/models/texteditorcommandmap.h \ + $$PWD/edbee/models/texteditorconfig.h \ + $$PWD/edbee/models/texteditorkeymap.h \ + $$PWD/edbee/models/textgrammar.h \ + $$PWD/edbee/models/textlexer.h \ + $$PWD/edbee/models/textlinedata.h \ + $$PWD/edbee/models/textrange.h \ + $$PWD/edbee/models/textsearcher.h \ + $$PWD/edbee/models/textundostack.h \ + $$PWD/edbee/texteditorcommand.h \ + $$PWD/edbee/texteditorcontroller.h \ + $$PWD/edbee/texteditorwidget.h \ + $$PWD/edbee/util/cascadingqvariantmap.h \ + $$PWD/edbee/util/lineending.h \ + $$PWD/edbee/util/lineoffsetvector.h \ + $$PWD/edbee/util/logging.h \ + $$PWD/edbee/util/mem/debug_allocs.h \ + $$PWD/edbee/util/mem/debug_new.h \ + $$PWD/edbee/util/rangelineiterator.h \ + $$PWD/edbee/util/rangesetlineiterator.h \ + $$PWD/edbee/util/regexp.h \ + $$PWD/edbee/util/simpleprofiler.h \ + $$PWD/edbee/util/test.h \ + $$PWD/edbee/util/textcodec.h \ + $$PWD/edbee/util/textcodecdetector.h \ + $$PWD/edbee/util/util.h \ + $$PWD/edbee/views/accessibletexteditorwidget.h \ + $$PWD/edbee/views/components/texteditorautocompletecomponent.h \ + $$PWD/edbee/views/components/texteditorcomponent.h \ + $$PWD/edbee/views/components/texteditorrenderer.h \ + $$PWD/edbee/views/components/textmargincomponent.h \ + $$PWD/edbee/views/textcaretcache.h \ + $$PWD/edbee/views/texteditorscrollarea.h \ + $$PWD/edbee/views/textlayout.h \ + $$PWD/edbee/views/textrenderer.h \ + $$PWD/edbee/views/textselection.h \ + $$PWD/edbee/views/texttheme.h + +## Extra dependencies +##==================== +include($$PWD/../vendor/qslog/QsLog.pri) +include($$PWD/../vendor/onig/onig.pri) + +## Files that can usefully listed inside Qt IDE (Qt Creator, as "Other files") +##============================================================================ +DISTFILES += \ + $$PWD/../CHANGELOG.md \ + $$PWD/../LICENSE \ + $$PWD/../README.md \ + $$PWD/../.travis.yml \ + $$PWD/../.gitignore \ + $$PWD/../CMakeLists.txt \ + $$PWD/../CI/travis.install.sh \ + $$PWD/../CI/travis.osx.install.sh \ + $$PWD/../CI/travis.before_install.sh \ + $$PWD/../CI/travis.osx.before_install.sh \ + $$PWD/CMakeLists.txt \ + $$PWD/Doxyfile \ + $$PWD/doc/coding-style.md \ + $$PWD/doc/index.md \ + $$PWD/images/doc-logo.png diff --git a/lib/edbee-lib/edbee-lib.pro b/lib/edbee-lib/edbee-lib.pro new file mode 100644 index 00000000..eaf8e7f1 --- /dev/null +++ b/lib/edbee-lib/edbee-lib.pro @@ -0,0 +1,33 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2013-01-03T08:11:25 +# +#------------------------------------------------- + +QT += core gui widgets + +# for the time being: +greaterThan(QT_MAJOR_VERSION,5): QT += core5compat + + +TARGET = edbee +TEMPLATE = lib +CONFIG += staticlib + +# Define EDBEE_BEGUG to enable memory debugging +DEFINES += EDBEE_DEBUG + +# DEFINE 'EDBEE_SANITIZE' to enable santitize bounds checks +EDBEE_SANITIZE = $$(EDBEE_SANITIZE) +!isEmpty( EDBEE_SANITIZE ) { + warning('*** SANITIZE ENABLED! edbee-lib ***') + QMAKE_CXXFLAGS+=-fsanitize=address -fsanitize=bounds -fsanitize-undefined-trap-on-error + QMAKE_LFLAGS+=-fsanitize=address -fsanitize=bounds -fsanitize-undefined-trap-on-error +} + +# This seems to be required for Windows +INCLUDEPATH += $$PWD +DEPENDPATH += $$PWD +DEFINES += QT_NODLL + +include(edbee-lib.pri) diff --git a/lib/edbee-lib/edbee/commands/commentcommand.cpp b/lib/edbee-lib/edbee/commands/commentcommand.cpp new file mode 100644 index 00000000..bfb30dee --- /dev/null +++ b/lib/edbee-lib/edbee/commands/commentcommand.cpp @@ -0,0 +1,524 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "commentcommand.h" + +#include "edbee/edbee.h" +#include "edbee/models/dynamicvariables.h" +#include "edbee/models/textlexer.h" +#include "edbee/models/texteditorconfig.h" +#include "edbee/models/textbuffer.h" +#include "edbee/models/textdocument.h" +#include "edbee/models/textdocumentscopes.h" +#include "edbee/views/textselection.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/util/rangelineiterator.h" +#include "edbee/util/regexp.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +// TODO, we need to rewrite this for improved testability +// TODO, this code can be much clearer, if we let go of the TM_ structure!! + +/// A helper structures for storing comment start and end definitions +class CommentDefinitionItem +{ +public: + /// constructs the definition + CommentDefinitionItem(const QString &startIn, const QString &endIn) + : start_(startIn) + , end_(endIn) + , commentStartRegExp_(0) + , removeCommentStartRegeExp_(0) + { + } + + /// the destructor + virtual ~CommentDefinitionItem() + { + delete removeCommentStartRegeExp_; + delete commentStartRegExp_; + } + + /// returns the start regular expression + const QString &start() { return start_; } + + /// returns the end regular expression + const QString &end() { return end_; } + + /// returns true if the definition is a block comment + bool isBlockComment() { return !end_.isEmpty(); } + + /// creates the regexp for the start regular expression + RegExp *commentStartRegExp() + { + if (!commentStartRegExp_) + { + commentStartRegExp_ = new RegExp( + QStringLiteral("^\\s*%1").arg(RegExp::escape(start().trimmed()))); + } + return commentStartRegExp_; + } + + /// creates the regexp for removing a comment + RegExp *removeCommentStartRegeExp() + { + if (!removeCommentStartRegeExp_) + { + removeCommentStartRegeExp_ + = new RegExp(QStringLiteral("^[^\\S\n]*(%1[^\\S\n]?)") + .arg(RegExp::escape(start().trimmed()))); + } + return removeCommentStartRegeExp_; + } + +private: + QString start_; + QString end_; + RegExp *commentStartRegExp_; + RegExp *removeCommentStartRegeExp_; +}; + +/// A class to temporary store all comment definitions for the current scope +/// placed in a class so we can make use of +class CommentDefinition +{ +public: + /// the destructor deletes all mail comment definitions + ~CommentDefinition() { qDeleteAll(commentDefinitionList_); } + + /// returns a reference to the list for direct access + QList<CommentDefinitionItem *> &list() { return commentDefinitionList_; } + + /// this method returns the first comment definition with the given criteria + /// It return 0 if no block definition has been found + /// @param block should we find a block definition + CommentDefinitionItem *findDefinition(bool block) + { + foreach (CommentDefinitionItem *item, commentDefinitionList_) + { + if (block == item->isBlockComment()) + { + return item; + } + } + return 0; + } + +private: + QList<CommentDefinitionItem *> commentDefinitionList_; +}; + +//-------------------------------- + +/// This method checks if all lines are comment +/// @param doc the document to check +/// @param range the range for checking all commented lines +/// @param commentStart the text used as the line comment prefix +/// @return true if all lines are commented +static bool +areAllLinesCommented(TextDocument *doc, TextRange &range, + const QList<CommentDefinitionItem *> &definitions) +{ + + // we directly check in the buffer for fast regexp without QString creation + TextBuffer *buf = doc->buffer(); + + // iterate over all lines + RangeLineIterator itr(doc, range); + while (itr.hasNext()) + { + + int line = itr.next(); + int lineLength = doc->lineLengthWithoutNewline(line); + + // when it's the last line and its blank, we must skip it + if (!itr.hasNext() && lineLength == 0) + { + continue; + } + + // directly search in the raw data pointer buffer to prevent QString + // creation + int offset = doc->offsetFromLine(line); + + // iterate over all line definitions + bool found = false; + foreach (CommentDefinitionItem *def, definitions) + { + + // skip block comments + if (def->isBlockComment()) + { + continue; + } + + RegExp *commentStartRegExp = def->commentStartRegExp(); + + /// toggle the found flag if a comment is found and break + if (commentStartRegExp->indexIn(buf->rawDataPointer(), offset, + offset + doc->lineLength(line) - 1) + >= 0) + { + found = true; + break; + } + } + + if (!found) + { + return false; + } + } + return true; +} + +/// removes all line comments from the iven line +/// @param doc the document to change +/// @param range the range to remove the comments +/// @param commentStart the text used as the line comment prefix +static void removeLineComment(TextDocument *doc, TextRange &range, + const QList<CommentDefinitionItem *> &definitions) +{ + // RegExp regExp( QStringLiteral("^[^\\S\n]*(%1[^\\S\n]?)").arg( + // RegExp::escape(commentStart.trimmed() ) ) ); + TextBuffer *buf = doc->buffer(); + + // iterate over all lines and build all ranges + RangeLineIterator itr(doc, range); + while (itr.hasNext()) + { + + // directly search in the raw data pointer buffer to prevent QString + // creation + int line = itr.next(); + int offset = doc->offsetFromLine(line); + + // iterate over alll definitions + foreach (CommentDefinitionItem *def, definitions) + { + + // skip block comments + if (def->isBlockComment()) + { + continue; + } + + RegExp *regExp = def->removeCommentStartRegeExp(); + + // perform a regexp to extract the comment that needs to be removed + if (regExp->indexIn(buf->rawDataPointer(), offset, + offset + doc->lineLength(line)) + >= 0) + { + + // remove the found regexp and goto the next line + doc->replace(regExp->pos(1), regExp->len(1), ""); + break; + } + } + } +} + +/// Adds comments on all line starts +/// @param doc the document to insert the comment +/// @param range the textrange to insert comments +/// @param str the comment prefix +static void insertLineComments(TextDocument *doc, TextRange &range, + const QString &str) +{ + TextBuffer *buf = doc->buffer(); + + // iterate over all lines and build all ranges + RangeLineIterator itr(doc, range); + while (itr.hasNext()) + { + + // directly search in the raw data pointer buffer to prevent QString + // creation + int line = itr.next(); + int offset = doc->offsetFromLine(line); + int lineLength = doc->lineLengthWithoutNewline(line); + + // when it's the last line and its blank, we must skip it + if (!itr.hasNext() && lineLength == 0) + { + continue; + } + + // when there's no comment found at this line return false + int wordStart = buf->findCharPosWithinRangeOrClamp( + offset, 1, doc->config()->whitespaces(), false, offset, + offset + lineLength); + doc->replace(wordStart, 0, str); + } +} + +/// Removes a block comment if possible +/// @param controller the controller to perform the operation on +/// @param range the current textrange +/// @param commentStart the start of the commment +/// @param commentEnd the end of the comment +/// @return this method returns true if the block comment was remoed +static bool +removeBlockComment(TextEditorController *controller, TextRange &range, + const QList<CommentDefinitionItem *> &definitions) +{ + TextDocument *doc = controller->textDocument(); + TextDocumentScopes *scopes = doc->scopes(); + + // it seems that every language in sublime/textmate use the comment.block + // convention + TextScope *blockCommentScope + = Edbee::instance()->scopeManager()->refTextScope("comment.block"); + + // we only fetch multi-line scoped textranges + int middleRange = range.min() + (range.max() - range.min()) / 2; + + // With this uberdirty for loop, we also check if there's a commentscope + // 1 character to the left. (this is required to fix the uncommnt block issue + // when the caret is next to the comment :) + for (int i = 0; middleRange && i < 2; ++i) + { + + QVector<ScopedTextRange *> scopedRanges + = scopes->createScopedRangesAtOffsetList(middleRange); + + foreach (ScopedTextRange *scopedRange, scopedRanges) + { + TextScope *scope = scopedRange->scope(); + + // did we found a block comment + if (scope->startsWith(blockCommentScope)) + { + int min = scopedRange->min(); + int max = scopedRange->max(); + + // check all 'block' comments + foreach (CommentDefinitionItem *def, definitions) + { + + // skip if not a blockcomment + if (!def->isBlockComment()) + { + continue; + } + + const QString &commentStart = def->start(); + const QString &commentEnd = def->end(); + + // when the scope starts and ends with the comment start and end + // remove it + if (doc->textPart(min, commentStart.length()) == commentStart + && doc->textPart(max - commentEnd.length(), commentEnd.length()) + == commentEnd) + { + + // * warning! * we cannot use the scoped rangeset directly + // when we replace a text, the scoped rangeset could be invalidated + // and destroyed! + + // next remove the range + doc->replace(min, commentStart.length(), ""); + doc->replace(max - commentEnd.length() - commentStart.length(), + commentEnd.length(), ""); + + qDeleteAll(scopedRanges); + return true; + } + } + } + } + qDeleteAll(scopedRanges); + + // 1 char to the left + --middleRange; + } + return false; +} + +/// Insert a block comment +/// Adds a comment start and end around the current text range. +/// If the textrange is empty, it first is expanded to a full line +/// @param controller the controller to insert a comment for +/// @param range the range to insert a block comment for +/// @param commentStart the start of the comment +/// @param commentEnd the end of the comment +/// @return the last affected range +static int insertBlockComment(TextEditorController *controller, + TextRange &range, const QString &commentStart, + const QString &commentEnd) +{ + TextDocument *doc = controller->textDocument(); + + // for safety I don't use the range anymore. It's adjusted automatically, but + // could in theory vanish + int min = range.min(); + int max = range.max(); + + // when the range is 'blank' expand it to a full line + if (range.isEmpty()) + { + int line = doc->lineFromOffset(min); + min = doc->offsetFromLine(line); + max = min + doc->lineLengthWithoutNewline(line); + // range.expandToFullLine(doc,0); + // range.deselectTrailingNewLine(doc); + } + + doc->replace(min, 0, commentStart); + doc->replace(max + commentStart.length(), 0, commentEnd); + + return max + commentStart.length() + commentEnd.length(); +} + +/// Collect all active comment structures +static bool getCommentDefinitions(TextEditorController *controller, + TextRange &range, + QList<CommentDefinitionItem *> &definitions) +{ + TextDocument *doc = controller->textDocument(); + TextDocumentScopes *scopes = doc->scopes(); + + // retrieve the starting scope + TextScopeList startScopeList = scopes->scopesAtOffset(range.min(), true); + + // next find all comment definitions + QString padding; + int index = 1; + do + { + // retrieve the comment start + // when there's no comment start then we're done + QString commentStart + = controller->dynamicVariables() + ->value(QStringLiteral("TM_COMMENT_START%1").arg(padding), + &startScopeList) + .toString(); + if (commentStart.isEmpty()) + { + break; + } + + // when there's a start there could be an ending (for block comments) + QString commentEnd + = controller->dynamicVariables() + ->value(QStringLiteral("TM_COMMENT_END%1").arg(padding), + &startScopeList) + .toString(); + definitions.push_back(new CommentDefinitionItem(commentStart, commentEnd)); + + // increase the index and change the padding + ++index; + padding = QStringLiteral("_%1").arg(index); + } while (true); + + // return true if the comment isn't empty + return !definitions.isEmpty(); +} + +/// Comments the given range +/// @param controller the controller that conatins the controller +/// @param range the range to comment +/// @return the last affected offset +static int commentRange(TextEditorController *controller, TextRange &range, + bool block) +{ + CommentDefinition defs; + // retrieve all comment definitions + if (!getCommentDefinitions(controller, range, defs.list())) + { + return range.max(); + } + + // here we need to remove an active block comment, if there is one + if (removeBlockComment(controller, range, defs.list())) + { + return range.max(); + } + + // find the first block definition + CommentDefinitionItem *blockDef = defs.findDefinition(true); + CommentDefinitionItem *lineDef = defs.findDefinition(false); + + // check if we need to do a block comment + if (blockDef && (block || !lineDef)) + { + return insertBlockComment(controller, range, blockDef->start(), + blockDef->end()); + + // check if we need to perform a line comment + } + else if (lineDef) + { + TextDocument *doc = controller->textDocument(); + + // we need to remove all comments + if (areAllLinesCommented(doc, range, defs.list())) + { + removeLineComment(doc, range, defs.list()); + + // add comments + } + else + { + insertLineComments(doc, range, lineDef->start()); + } + } + return range.max(); +} + +//--------------------------- + +/// constructs the comment comment +/// @param block should we try a block comment +CommentCommand::CommentCommand(bool block) + : block_(block) +{ +} + +/// Executes the given comment +/// @param controller the controller this command is executed for +void CommentCommand::execute(TextEditorController *controller) +{ + // iterate over all ranges + TextRangeSet *selection + = new DynamicTextRangeSet(controller->textSelection()); + TextDocument *doc = controller->textDocument(); + + // start changing the document + // int lastOffset = -1; + + doc->beginChanges(controller); + for (int i = 0, cnt = selection->rangeCount(); i < cnt; ++i) + { + + TextRange range = selection->range(i); + + // assert the ranges are all lexed! + controller->textDocument()->textLexer()->lexRange(range.min(), range.max()); + + // comment the range and get the last offset + // lastOffset = commentRange( controller, range, block_ ); + commentRange(controller, range, block_); + } + + doc->giveSelection(controller, selection); + doc->endChanges(0); + + // the following call shouldn't be necessary + controller->update(); +} + +/// converts this command to a string +QString CommentCommand::toString() +{ + return "CommentCommand"; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/commentcommand.h b/lib/edbee-lib/edbee/commands/commentcommand.h new file mode 100644 index 00000000..6aeb95d5 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/commentcommand.h @@ -0,0 +1,34 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QString> + +#include "edbee/texteditorcommand.h" + +namespace edbee +{ + +class TextEditorController; + +/// This command is used for commenting / decommenting a line +/// We cannot implement this truely at the moment, we first need support for +/// making scope-based 'environment-variables' so we can creating something like +/// TM_COMMENT_START +class EDBEE_EXPORT CommentCommand : public TextEditorCommand +{ +public: + CommentCommand(bool block); + virtual void execute(TextEditorController *controller) override; + virtual QString toString() override; + +private: + bool block_; ///< When this flag is set it uses a block comment (if possible) +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/copycommand.cpp b/lib/edbee-lib/edbee/commands/copycommand.cpp new file mode 100644 index 00000000..a5f96cab --- /dev/null +++ b/lib/edbee-lib/edbee/commands/copycommand.cpp @@ -0,0 +1,67 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "copycommand.h" + +#include <QApplication> +#include <QClipboard> +#include <QMimeData> + +#include "edbee/texteditorcontroller.h" +#include "edbee/views/textselection.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// An internal mime-type, used for identifying special copy/paste operations of +/// edbee +const QString CopyCommand::EDBEE_TEXT_TYPE("application/vnd.edbee.text-type"); + +/// Copies the current selection to the clipboard +void CopyCommand::execute(TextEditorController *controller) +{ + QClipboard *clipboard = QApplication::clipboard(); + TextSelection *sel = controller->textSelection(); + + // get the selected text + QString str = sel->getSelectedText(); + if (!str.isEmpty()) + { + clipboard->setText(str); + + // perform a full-lines copy.. The full line of the caret's position is + // copied + } + else + { + + str = sel->getSelectedTextExpandedToFullLines(); + + // we don't want to detect a memory leak because Qt is going to delete our + // mime data + edbee::pause_memleak_detection(true); + QMimeData *mimeData = new QMimeData(); + edbee::pause_memleak_detection(false); + mimeData->setText(str); + mimeData->setData(EDBEE_TEXT_TYPE, "line"); + clipboard->setMimeData(mimeData); + // delete mimeData; + } +} + +/// Convers this command to string +QString CopyCommand::toString() +{ + return "CopyCommand"; +} + +bool CopyCommand::readonly() +{ + return true; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/copycommand.h b/lib/edbee-lib/edbee/commands/copycommand.h new file mode 100644 index 00000000..814fe445 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/copycommand.h @@ -0,0 +1,31 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QString> + +#include "edbee/texteditorcommand.h" + +namespace edbee +{ + +class TextEditorController; + +/// This command is used for copying data to the clipboard +class EDBEE_EXPORT CopyCommand : public TextEditorCommand +{ +public: + static const QString EDBEE_TEXT_TYPE; + +public: + virtual void execute(TextEditorController *controller) override; + virtual QString toString() override; + virtual bool readonly() override; +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/cutcommand.cpp b/lib/edbee-lib/edbee/commands/cutcommand.cpp new file mode 100644 index 00000000..21c15641 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/cutcommand.cpp @@ -0,0 +1,88 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "cutcommand.h" + +#include <QApplication> +#include <QClipboard> +#include <QMimeData> + +#include "edbee/commands/copycommand.h" + +#include "edbee/models/textdocument.h" +#include "edbee/models/change.h" +#include "edbee/models/textrange.h" +#include "edbee/models/textundostack.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/views/textselection.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// Performs the cut command +/// @param controller the controller context +void CutCommand::execute(TextEditorController *controller) +{ + QClipboard *clipboard = QApplication::clipboard(); + TextRangeSet *sel = controller->textSelection(); + + // get the selected text + QString str = sel->getSelectedText(); + if (!str.isEmpty()) + { + clipboard->setText(str); + controller->replaceSelection("", 0); + return; + + // perform a full-lines cut + } + else + { + + // fetch the selected lines + TextRangeSet newSel(*sel); + newSel.expandToFullLines(1); + str = newSel.getSelectedText(); + + // we only coalesce if 1 range is available + int coalesceId = (sel->rangeCount() != 1) ? 0 : CoalesceId_CutLine; + + // when the previous command was a cut + // and there's a line on the stack, we need to expand the line + if (controller->textDocument() + ->textUndoStack() + ->lastCoalesceIdAtCurrentLevel() + == CoalesceId_CutLine) + { + QClipboard *clipboard = QApplication::clipboard(); + const QMimeData *mimeData = clipboard->mimeData(); + if (mimeData->hasFormat(CopyCommand::EDBEE_TEXT_TYPE)) + { + str = mimeData->text() + str; + } + } + + // set the new clipboard data + QMimeData *mimeData = new QMimeData(); + mimeData->setText(str); + mimeData->setData(CopyCommand::EDBEE_TEXT_TYPE, "line"); + clipboard->setMimeData(mimeData); + // delete mimeData; + + // remove the selection + controller->replaceRangeSet(newSel, "", coalesceId); + return; + } +} + +/// Converts this command to a string +QString CutCommand::toString() +{ + return "CutCommand"; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/cutcommand.h b/lib/edbee-lib/edbee/commands/cutcommand.h new file mode 100644 index 00000000..3f65353e --- /dev/null +++ b/lib/edbee-lib/edbee/commands/cutcommand.h @@ -0,0 +1,28 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include "edbee/texteditorcommand.h" + +namespace edbee +{ + +class TextEditorController; + +/// Performs a cut command. The cut command removes the selected content +/// and places onto the clipboard. +/// +/// When pressing cut without selection, the full line is cut +class EDBEE_EXPORT CutCommand : public TextEditorCommand +{ +public: + virtual void execute(TextEditorController *controller) override; + virtual QString toString() override; +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/debugcommand.cpp b/lib/edbee-lib/edbee/commands/debugcommand.cpp new file mode 100644 index 00000000..88a0c34b --- /dev/null +++ b/lib/edbee-lib/edbee/commands/debugcommand.cpp @@ -0,0 +1,120 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "debugcommand.h" + +#include "edbee/models/textdocument.h" +#include "edbee/models/textdocumentscopes.h" +#include "edbee/models/textlexer.h" +#include "edbee/models/textrange.h" +#include "edbee/models/textundostack.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/views/textselection.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +DebugCommand::DebugCommand(DebugCommandType command) + : command_(command) +{ +} + +void DebugCommand::execute(TextEditorController *controller) +{ + switch (command_) + { + case DumpScopes: + dumpScopes(controller); + break; + case RebuildScopes: + rebuildScopes(controller); + break; + case DumpUndoStack: + dumpUndoStack(controller); + break; + case DumpCharacterCodes: + dumpCharacterCodes(controller); + break; + } +} + +QString DebugCommand::toString() +{ + return "DebugCommand"; +} + +bool DebugCommand::readonly() +{ + return true; +} + +/// This method dumps the scopes +void DebugCommand::dumpScopes(TextEditorController *controller) +{ + TextDocumentScopes *scopes = controller->textDocument()->scopes(); + QString dump = "\nMultiLineScopes:---\n"; + dump.append(QString(scopes->toString()).replace("|", "\n")); + + dump.append("\nPer Line:---\n"); + for (int i = 0; i < scopes->scopedLineCount(); ++i) + { + ScopedTextRangeList *range = scopes->scopedRangesAtLine(i); + dump.append(QStringLiteral("%1: %2\n").arg(i).arg(range->toString())); + } + + qlog_info() << dump; +} + +/// rebuilds all scopes +void DebugCommand::rebuildScopes(TextEditorController *controller) +{ + TextDocument *document = controller->textDocument(); + TextDocumentScopes *scopes = document->scopes(); + TextLexer *lexer = document->textLexer(); + + /// lex the complete document + scopes->removeScopesAfterOffset(0); + lexer->lexRange(0, document->length()); +} + +/// dumps the undostack +void DebugCommand::dumpUndoStack(TextEditorController *controller) +{ + qlog_info() << controller->textDocument()->textUndoStack()->dumpStack(); +} + +/// dumps the character codes (around the FIRST caret) +void DebugCommand::dumpCharacterCodes(TextEditorController *controller) +{ + static int count = 3; // 2 chars before caret and 2 chars after caret + + // get the current range + TextSelection *sel = controller->textSelection(); + TextRange range = sel->range(0); + + QString line; + + // iterate over the characters + int start = qMax(range.caret() - count, 0); + int end + = qMin(range.caret() + count, controller->textDocument()->length() - 1); + for (int i = start; i <= end; ++i) + { + QChar c = controller->textDocument()->charAt(i); + if (i == range.caret()) + { + line.append("| "); + } + + line.append(QString::number((int)c.unicode(), 16)); + line.append(" "); + } + + qlog_info() << "charcodes: " << line; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/debugcommand.h b/lib/edbee-lib/edbee/commands/debugcommand.h new file mode 100644 index 00000000..9cb180c9 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/debugcommand.h @@ -0,0 +1,45 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include "edbee/texteditorcommand.h" + +namespace edbee +{ + +/// A debug command, for simply suppling/dumping some editor state information +/// to the console +class EDBEE_EXPORT DebugCommand : public TextEditorCommand +{ +public: + enum DebugCommandType + { + DumpScopes, + RebuildScopes, + DumpUndoStack, + DumpCharacterCodes + }; + + DebugCommand(DebugCommandType command); + + virtual void execute(TextEditorController *controller) override; + virtual QString toString() override; + virtual bool readonly() override; + +protected: + void dumpScopes(TextEditorController *controller); + void rebuildScopes(TextEditorController *controller); + + void dumpUndoStack(TextEditorController *controller); + void dumpCharacterCodes(TextEditorController *controller); + +private: + DebugCommandType command_; ///< the command to execute +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/duplicatecommand.cpp b/lib/edbee-lib/edbee/commands/duplicatecommand.cpp new file mode 100644 index 00000000..ffdfe8b9 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/duplicatecommand.cpp @@ -0,0 +1,78 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "duplicatecommand.h" + +#include "edbee/models/changes/mergablechangegroup.h" +#include "edbee/models/textdocument.h" +#include "edbee/models/textrange.h" +#include "edbee/views/textselection.h" +#include "edbee/texteditorcontroller.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// Executes the duplication command +/// @param controller the active controller +void DuplicateCommand::execute(TextEditorController *controller) +{ + // create a new range set and the new texts + TextRangeSet newRanges(controller->textSelection()); + TextRangeSet *newSelection = new TextRangeSet(controller->textSelection()); + QStringList newTexts; + TextDocument *doc = controller->textDocument(); + + // iterate over all range and build the new texts to insert + int delta = 0; + for (int i = 0, cnt = newRanges.rangeCount(); i < cnt; ++i) + { + TextRange &range = newRanges.range(i); + + // when the range is empty we need to use the complete line line (inclusive + // the newline) + if (range.isEmpty()) + { + + // get the complete line + int line = doc->lineFromOffset(range.caret()); + range.setCaret(doc->offsetFromLine(line)); + range.setAnchor(range.caret()); + newTexts.append( + QStringLiteral("%1\n").arg(doc->lineWithoutNewline(line))); + } + else + { + + // append the new text, and change the insert position to the place before + // the caret :) + newTexts.append(doc->textPart(range.min(), range.length())); + range.maxVar() = range.min(); + } + + // change the spatial of the new selection + // insert the spatial at the caret position. + // we only insert text so the length = 0 and the new length is the length of + // the inserted text + int length = newTexts.last().length(); + newSelection->changeSpatial(range.caret() + delta, 0, length); + delta += length; + } + + // replace the texts + doc->beginChanges(controller); + doc->replaceRangeSet(newRanges, newTexts); + doc->giveSelection(controller, newSelection); + doc->endChanges(CoalesceId_Duplicate); +} + +/// Returns the textual representation of this command +QString DuplicateCommand::toString() +{ + return "DuplicateCommand"; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/duplicatecommand.h b/lib/edbee-lib/edbee/commands/duplicatecommand.h new file mode 100644 index 00000000..2fb7ced7 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/duplicatecommand.h @@ -0,0 +1,25 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include "edbee/texteditorcommand.h" + +namespace edbee +{ + +/// The Duplicate command. +/// Duplicates the selected line or text +/// +class EDBEE_EXPORT DuplicateCommand : public TextEditorCommand +{ +public: + virtual void execute(TextEditorController *controller) override; + virtual QString toString() override; +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/findcommand.cpp b/lib/edbee-lib/edbee/commands/findcommand.cpp new file mode 100644 index 00000000..8e56e819 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/findcommand.cpp @@ -0,0 +1,143 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "findcommand.h" + +#include "edbee/models/texteditorconfig.h" +#include "edbee/models/textdocument.h" +#include "edbee/models/textrange.h" +#include "edbee/models/textsearcher.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/views/textselection.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// Constructs the find operation +/// @param findType the findtype to use +FindCommand::FindCommand(FindType findType) + : findType_(findType) +{ +} + +/// executes this command. What happens depends mainly on the FindType +/// @param controller the controller used for executing +void FindCommand::execute(TextEditorController *controller) +{ + TextSearcher *searcher = controller->textSearcher(); + TextRangeSet *currentSelection + = dynamic_cast<TextRangeSet *>(controller->textSelection()); + TextDocument *doc = controller->textDocument(); + + // uses the current selection for find or uses the current word (doesn't + // require a soft undo) + if (findType_ == UseSelectionForFind) + { + // when empty select the word + TextRange range = currentSelection->range( + 0); // Note: No reference we're changing TextRange copy! + if (range.isEmpty()) + { + range.expandToWord(doc, doc->config()->whitespaces(), + doc->config()->charGroups()); + } + searcher->setSearchTerm(doc->textPart(range.min(), range.length())); + return; + } + + // next process the operation and move the caret/selection + switch (findType_) + { + + // finds the next match of the current selected word + case FindNextMatch: + searcher->setReverse(false); + searcher->findNext(controller->widget()); + break; + + // finds the previous match of the current selected word + case FindPreviousMatch: + searcher->setReverse(true); + searcher->findNext(controller->widget()); + break; + + // finds and selects the next match + case SelectNextMatch: + searcher->setReverse(false); + searcher->selectNext(controller->widget()); + break; + + // finds and selects the previous match + case SelectPreviousMatch: + searcher->setReverse(true); + searcher->selectNext(controller->widget()); + break; + + // selects all matches + case SelectAllMatches: + searcher->selectAll(controller->widget()); + break; + + // use the current-selection for find or selects the current word + case SelectUnderExpand: + searcher->selectUnderExpand(controller->widget(), false); + break; + + // select all words under the given word/selection + case SelectAllUnder: + searcher->selectUnderExpand(controller->widget(), true); + break; + + default: + qlog_warn() << "Warning, invalid FindCommand supplied!"; + Q_ASSERT(false); + } + + controller->update(); +} + +/// Converts this find command to a string +/// This string describes the command (useful only for debugging purposes) +QString FindCommand::toString() +{ + QString str; + switch (findType_) + { + case UseSelectionForFind: + str = "UseSelectionForFind"; + break; + case FindNextMatch: + str = "FindNext"; + break; + case FindPreviousMatch: + str = "FindPrevious"; + break; + case SelectNextMatch: + str = "SelectNextMatch"; + break; + case SelectPreviousMatch: + str = "SelectPreviousMatch"; + break; + case SelectAllMatches: + str = "SelectAllMatches"; + break; + case SelectUnderExpand: + str = "SelectUnderExpand"; + break; + case SelectAllUnder: + str = "SelectAllUnder"; + break; + } + return QStringLiteral("FindCommand(%1)").arg(str); +} + +bool FindCommand::readonly() +{ + return true; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/findcommand.h b/lib/edbee-lib/edbee/commands/findcommand.h new file mode 100644 index 00000000..5849cb8d --- /dev/null +++ b/lib/edbee-lib/edbee/commands/findcommand.h @@ -0,0 +1,46 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include "edbee/texteditorcommand.h" + +namespace edbee +{ + +class EDBEE_EXPORT FindCommand : public TextEditorCommand +{ +public: + enum FindType + { + UseSelectionForFind, //< uses the current selection for find + FindNextMatch, //< finds the next match + FindPreviousMatch, //< finds the previous match + SelectNextMatch, //< adds the next match to the selection + SelectPreviousMatch, //< adds the previous match to the selection + SelectAllMatches, //< select all matches + + SelectUnderExpand, ///< A smart selection: when there's no selection the + ///< current word is used and selected, else the next + ///< word is selected + SelectAllUnder ///< A smart selection: when there's no selection the current + ///< word is used, and all occurences in the document are + ///< selected + + }; + + FindCommand(FindType findType); + + virtual void execute(TextEditorController *controller) override; + virtual QString toString() override; + virtual bool readonly() override; + +private: + FindType findType_; ///< the current find-type +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/movelinecommand.cpp b/lib/edbee-lib/edbee/commands/movelinecommand.cpp new file mode 100644 index 00000000..d63d6167 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/movelinecommand.cpp @@ -0,0 +1,132 @@ +#include "movelinecommand.h" + +#include "edbee/models/change.h" +#include "edbee/models/textdocument.h" +#include "edbee/models/textrange.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/views/textselection.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +MoveLineCommand::MoveLineCommand(int direction) + : direction_(direction) +{ +} + +MoveLineCommand::~MoveLineCommand() {} + +/// Calculates the new ranges after moving +/* +static void calculateNewSelectionRanges( TextDocument* doc, TextRangeSet& +newCaretSelection, int direction ) +{ + for( int i=0,cnt=newCaretSelection.rangeCount(); i<cnt; ++i) { + TextRange& range = newCaretSelection.range(i); + int& min = range.minVar(); + int& max = range.maxVar(); + + if( direction < 0 ) { + int line = doc->lineFromOffset(min); + int len = doc->lineLength(line-1); + min -= len; + max -= len; + } else { + int line = doc->lineFromOffset(max); + int len = doc->lineLength(line+1); + min += len; + max += len; + } + } +} +*/ + +/// all carets in the newCaretSelection are changed in the movedRange +void updateNewCaretSelectionForMove(TextDocument *doc, + TextRangeSet &newCaretSelection, + TextRange &movedRange, int direction) +{ + for (int i = 0, cnt = newCaretSelection.rangeCount(); i < cnt; ++i) + { + TextRange &newRange = newCaretSelection.range(i); + if (movedRange.min() <= newRange.min() + && newRange.max() <= movedRange.max()) + { + int min = movedRange.min(); + int max = movedRange.max(); + + int delta = 0; + if (direction < 0) + { + int line = doc->lineFromOffset(min); + delta = -doc->lineLength(line - 1); + } + else + { + int line = doc->lineFromOffset(max - 1); // -1 exclude the last newline + delta = doc->lineLength(line + 1); + } + + newRange.setCaretBounded(doc, newRange.caret() + delta); + newRange.setAnchorBounded(doc, newRange.anchor() + delta); + } + } +} + +void MoveLineCommand::execute(TextEditorController *controller) +{ + TextRangeSet *sel = controller->textSelection(); + TextDocument *doc = controller->textDocument(); + + // expand the selection in full-lines + TextRangeSet moveRangeSet(*sel); + moveRangeSet.expandToFullLines(1); + moveRangeSet.mergeOverlappingRanges(true); + + // because of the full-line expansion, we can assume that 0 means at the first + // line moving up on the first line is impossible + int firstOffset = moveRangeSet.firstRange().minVar(); + if (firstOffset + direction_ <= 0) + return; + + int lastOffset = moveRangeSet.lastRange().maxVar(); + if (lastOffset + direction_ > doc->length()) + return; + + // Calculate the new caret positions + TextRangeSet newCaretSelection(*sel); + for (int i = 0, cnt = moveRangeSet.rangeCount(); i < cnt; ++i) + { + TextRange &range = moveRangeSet.range(i); + updateNewCaretSelectionForMove(doc, newCaretSelection, range, direction_); + } + + // move the text in the correct direciton + controller->beginUndoGroup(); + for (int i = 0, cnt = moveRangeSet.rangeCount(); i < cnt; ++i) + { + TextRange &range = moveRangeSet.range(i); + + int line = doc->lineFromOffset(range.min()); + QString text = doc->textPart(range.min(), range.length()); + + controller->replace(range.min(), range.length(), QStringLiteral(), + 0); // remove the line + controller->replace(doc->offsetFromLine(line + direction_), 0, text, + 0); // add the line back + } + + *sel = newCaretSelection; // change the selection + + int coalesceID = CoalesceId_MoveLine + direction_ + 10; + controller->endUndoGroup(coalesceID, false); +} + +QString MoveLineCommand::toString() +{ + return "MoveLineCommand"; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/movelinecommand.h b/lib/edbee-lib/edbee/commands/movelinecommand.h new file mode 100644 index 00000000..d81bd604 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/movelinecommand.h @@ -0,0 +1,24 @@ +#pragma once + +#include "edbee/exports.h" + +#include "edbee/texteditorcommand.h" + +namespace edbee +{ + +/// moves +class EDBEE_EXPORT MoveLineCommand : public TextEditorCommand +{ +public: + MoveLineCommand(int direction); + virtual ~MoveLineCommand(); + + virtual void execute(TextEditorController *controller) override; + virtual QString toString() override; + +private: + int direction_; +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/newlinecommand.cpp b/lib/edbee-lib/edbee/commands/newlinecommand.cpp new file mode 100644 index 00000000..3e0ceb46 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/newlinecommand.cpp @@ -0,0 +1,203 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "newlinecommand.h" + +#include "edbee/models/texteditorconfig.h" +#include "edbee/models/textbuffer.h" +#include "edbee/models/textdocument.h" +#include "edbee/models/textrange.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/util/util.h" +#include "edbee/views/textselection.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// Constructs the newline command +/// @param metod the method +NewlineCommand::NewlineCommand(NewlineCommand::NewLineType method) + : newLineType_(method) +{ +} + +/// This method calculates the required 'smart' indent value at the given +/// positon +/// @param controller the controller +/// @param range the range to calculate the smart tab for +QString NewlineCommand::calculateSmartIndent(TextEditorController *controller, + TextRange &range) +{ + QString result; + + TextDocument *doc = controller->textDocument(); + TextBuffer *buf = doc->buffer(); + TextEditorConfig *config = doc->config(); + + // find the line column position + int caretOffset = range.min(); + int line = doc->lineFromOffset(range.min()); + int startOffset = doc->offsetFromLine(line); + int endOffset = qMin(caretOffset, doc->offsetFromLine(line + 1) - 1); + + // searches for the start of the current line + int charPos = buf->findCharPosWithinRangeOrClamp( + startOffset, 1, config->whitespaceWithoutNewline(), false, startOffset, + endOffset); + + // when the start is found + if (charPos > startOffset) + { + + // we have found the column index. This isn't yet the column, + // because when using tab-characters the column position can be different. + // calculate the position by converting the tabs to spaces + int column = Util() + .convertTabsToSpaces( + doc->textPart(startOffset, charPos - startOffset), + config->indentSize()) + .length(); + + // when a tab character is used, we need to add the given number of tabs + if (config->useTabChar()) + { + int tabs = column / config->indentSize(); + int spaces = column % config->indentSize(); + result.append(QStringLiteral("\t").repeated(tabs)); + if (spaces > 0) + { + result.append(QStringLiteral(" ").repeated(spaces)); + } + + // else we can add spaces to the given column position + } + else + { + result.append(QStringLiteral(" ").repeated(column)); + } + } + return result; +} + +/// Executes a 'normal' newline operation +void NewlineCommand::executeNormalNewline(TextEditorController *controller) +{ + TextDocument *doc = controller->textDocument(); + TextEditorConfig *config = doc->config(); + + // when no smarttab is enabled this function is simple + // the current selection is simple replaced by a newline :) + if (!config->smartTab()) + { + controller->replaceSelection("\n", + CoalesceId_InsertNewLine + NormalNewline); + return; + } + + // when we're using smart tab. We're going to indent every next line + // to the same level as the previous one + QStringList texts; + + TextSelection *sel = controller->textSelection(); + for (int i = 0, cnt = sel->rangeCount(); i < cnt; ++i) + { + TextRange &range = sel->range(i); + + // add the string to insert + texts.push_back( + QStringLiteral("\n%1").arg(calculateSmartIndent(controller, range))); + } + + // next execute the replace command + controller->replaceSelection(texts, CoalesceId_InsertNewLine + NormalNewline); +} + +/// Executes a special newline operation. (Inserts a newline before or the +/// current line) +/// @param controller the controller to execute this operation for +/// @param nextLine a nextline operation +void NewlineCommand::executeSpecialNewline(TextEditorController *controller, + bool nextLine) +{ + TextDocument *doc = controller->textDocument(); + TextEditorConfig *config = doc->config(); + + // we need to insert a newline above every caret + bool smart = config->smartTab(); + doc->beginChanges(controller); + + // iterate over the selection via a dynamic rangeset + DynamicTextRangeSet sel(controller->textSelection()); + TextRangeSet *newSelection = new TextRangeSet(doc); + int lastLine = -1; + int lineDelta = nextLine ? 1 : 0; + for (int i = 0; i < sel.rangeCount(); ++i) + { + + // only handle the line if it's another line then the previous + TextRange &range = sel.range(i); + int line = doc->lineFromOffset(range.caret()); + if (line > lastLine) + { + + // create a new range + int pos = doc->offsetFromLine(line + lineDelta) - 1; + TextRange newRange(pos, pos); + + QString text = QStringLiteral("\n%1").arg( + smart ? calculateSmartIndent(controller, newRange) : ""); + + // replaces the text + doc->replace(qMax(0, newRange.caret()), 0, text); + newRange.setCaret(pos + text.length()); + newRange.reset(); + + // add the range to the selection + newSelection->addRange(newRange); + lastLine = line; + } + } + + // give the selection and end the changes + doc->giveSelection(controller, newSelection); + doc->endChanges(CoalesceId_InsertNewLine + + (nextLine ? AddLineAfter : AddLineBefore)); + + // the following call shouldn't be necessary + controller->update(); +} + +/// Executes the insert newline command +/// @param controller the controller to execute this command for +void NewlineCommand::execute(TextEditorController *controller) +{ + switch (newLineType_) + { + case NormalNewline: + executeNormalNewline(controller); + break; + + case AddLineBefore: + executeSpecialNewline(controller, false); + break; + + case AddLineAfter: + executeSpecialNewline(controller, true); + break; + + default: + Q_ASSERT(false && "Invalid newLineType!"); + } +} + +/// Returns the command name +QString NewlineCommand::toString() +{ + return "NewlineCommand"; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/newlinecommand.h b/lib/edbee-lib/edbee/commands/newlinecommand.h new file mode 100644 index 00000000..923c175b --- /dev/null +++ b/lib/edbee-lib/edbee/commands/newlinecommand.h @@ -0,0 +1,46 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include "edbee/texteditorcommand.h" + +namespace edbee +{ + +class TextRange; + +/// Inserts a newline. +/// When smarttab is enabled it also inser leading tabs/spaces +class EDBEE_EXPORT NewlineCommand : public TextEditorCommand +{ +public: + enum NewLineType + { + NormalNewline = 0, + AddLineBefore = 1, + AddLineAfter = 2 + }; + + NewlineCommand(NewLineType method); + + QString calculateSmartIndent(TextEditorController *controller, + TextRange &range); + + virtual void executeNormalNewline(TextEditorController *controller); + + virtual void executeSpecialNewline(TextEditorController *controller, + bool nextLine); + + virtual void execute(TextEditorController *controller) override; + virtual QString toString() override; + +private: + NewLineType newLineType_; ///< The current newline type +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/pastecommand.cpp b/lib/edbee-lib/edbee/commands/pastecommand.cpp new file mode 100644 index 00000000..c6aa4858 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/pastecommand.cpp @@ -0,0 +1,95 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "pastecommand.h" + +#include <QApplication> +#include <QClipboard> +#include <QMimeData> +#include <QStringList> + +#include "edbee/commands/copycommand.h" +#include "edbee/models/changes/mergablechangegroup.h" +#include "edbee/models/textbuffer.h" +#include "edbee/models/change.h" +#include "edbee/models/textdocument.h" +#include "edbee/models/textrange.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/views/textselection.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// Default (blank) constructor +PasteCommand::PasteCommand() {} + +/// Returns the command id for coalescing this operation +int PasteCommand::commandId() +{ + return CoalesceId_Paste; +} + +/// Execute the paste command +/// @param controller the controller context this operation is executed for +void PasteCommand::execute(TextEditorController *controller) +{ + QClipboard *clipboard = QApplication::clipboard(); + const QMimeData *mimeData = clipboard->mimeData(); + QString text = clipboard->text(); + + TextDocument *doc = controller->textDocument(); + TextRangeSet *sel = controller->textSelection(); + + // a line-based paste + if (mimeData && mimeData->hasFormat(CopyCommand::EDBEE_TEXT_TYPE)) + { + TextRangeSet newRanges(doc); + for (int i = 0, cnt = sel->rangeCount(); i < cnt; ++i) + { + TextRange &range = sel->range(i); + int line = doc->lineFromOffset(range.min()); + int offset = doc->offsetFromLine(line); + newRanges.addRange(offset, offset); + } + + controller->replaceRangeSet(newRanges, text, commandId()); + return; + + // normal paste + } + else + { + if (!text.isEmpty()) + { + int lineCount = text.count("\n") + 1; + int rangeCount = controller->textSelection()->rangeCount(); + + // multi-line/caret copy paste + if (lineCount == rangeCount) + { + QStringList texts = text.split("\n"); + controller->replaceRangeSet(*controller->textSelection(), texts, + commandId()); + + // this the normal operation + } + else + { + controller->replaceSelection(text, commandId()); + } + } + return; + } +} + +/// Converst the command to a string (for fetching the commandname) +QString PasteCommand::toString() +{ + return "PasteCommand"; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/pastecommand.h b/lib/edbee-lib/edbee/commands/pastecommand.h new file mode 100644 index 00000000..258ece9d --- /dev/null +++ b/lib/edbee-lib/edbee/commands/pastecommand.h @@ -0,0 +1,34 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include "edbee/texteditorcommand.h" + +namespace edbee +{ + +class TextEditorController; + +/// Executes a paste command +/// This usually simply pastes the text at the given location. +/// There are two special cases: +/// - there's a line cutting/pasing mode to copy complete lines +/// - when the number of carets is equal to the number of lines, every line is +/// pasted at a caret +class EDBEE_EXPORT PasteCommand : public TextEditorCommand +{ +public: + PasteCommand(); + + virtual int commandId(); + + virtual void execute(TextEditorController *controller) override; + virtual QString toString() override; +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/redocommand.cpp b/lib/edbee-lib/edbee/commands/redocommand.cpp new file mode 100644 index 00000000..d633c235 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/redocommand.cpp @@ -0,0 +1,35 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "redocommand.h" + +#include "edbee/texteditorcontroller.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +RedoCommand::RedoCommand(bool soft) + : soft_(soft) +{ +} + +void RedoCommand::execute(TextEditorController *controller) +{ + controller->redo(soft_); +} + +QString RedoCommand::toString() +{ + return QStringLiteral("RedoCommand(%1)").arg(soft_ ? "soft" : "hard"); +} + +bool RedoCommand::readonly() +{ + return soft_; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/redocommand.h b/lib/edbee-lib/edbee/commands/redocommand.h new file mode 100644 index 00000000..9db040d8 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/redocommand.h @@ -0,0 +1,32 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QString> +#include "edbee/texteditorcommand.h" + +namespace edbee +{ + +class EDBEE_EXPORT RedoCommand : public TextEditorCommand +{ +public: + RedoCommand(bool soft = false); + + /// This method should return the command identifier + virtual int commandId() { return CoalesceId_None; } + + virtual void execute(TextEditorController *controller) override; + virtual QString toString() override; + virtual bool readonly() override; + +private: + bool soft_; +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/removecommand.cpp b/lib/edbee-lib/edbee/commands/removecommand.cpp new file mode 100644 index 00000000..46e939a5 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/removecommand.cpp @@ -0,0 +1,249 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "removecommand.h" + +#include "edbee/models/changes/mergablechangegroup.h" +#include "edbee/models/textdocument.h" +#include "edbee/models/texteditorconfig.h" +#include "edbee/models/textrange.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/views/textselection.h" +#include "edbee/util/util.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// The remove command constructor +/// @param removeMode the mode for removal +/// @param direction the direction for the removal +RemoveCommand::RemoveCommand(int removeMode, int direction) + : removeMode_(removeMode) + , direction_(direction) +{ +} + +/// This method returns the coalesceId to use +/// Currently all commands in the same direction will get the same coalesceId +/// @return the coalesceId to use +int RemoveCommand::coalesceId() const +{ + return CoalesceId_Remove + (direction_ == Left ? 1 : 2); +} + +/// Performs a smart backspace by adjusting the textrange so the backspace leads +/// to the start of a column +/// +/// @param controller to perform the smartbackspace for +/// @param caret the current caret position +/// +/// @return the new caret position +int RemoveCommand::smartBackspace(TextDocument *doc, int caret) +{ + TextBuffer *buf = doc->buffer(); + TextEditorConfig *config = doc->config(); + + // find the line column position + int line = doc->lineFromOffset(caret); + int lineStartOffset = doc->offsetFromLine(line); + int lineEndOffset = qMin(caret, doc->offsetFromLine(line + 1) - 1); + + // searches for the start of the current line + int firstNoneWhitespaceCharPos = buf->findCharPosWithinRangeOrClamp( + lineStartOffset, 1, config->whitespaceWithoutNewline(), false, + lineStartOffset, lineEndOffset); + + // only when the caret if before a characer + if (caret <= firstNoneWhitespaceCharPos + && lineStartOffset < firstNoneWhitespaceCharPos) + { + + // retrieve the whitespace-start-part of the line + QString linePrefix = doc->textPart( + lineStartOffset, firstNoneWhitespaceCharPos - lineStartOffset); + QList<int> lineColumnOffsets + = Util().tabColumnOffsets(linePrefix, config->indentSize()); + + // when we're exactly at a columnOffset, we need to get the previous + int lastColumnOffset = lineColumnOffsets.last() + lineStartOffset; + if (lastColumnOffset == caret) + { + lastColumnOffset + = lineStartOffset + + (lineColumnOffsets.size() > 1 + ? lineColumnOffsets.at(lineColumnOffsets.size() - 2) + : 0); + } + + // we need to got the given number of characters + return qMax(0, caret - (caret - lastColumnOffset)); + } + return qMax(0, caret - 1); +} + +/// Changes the ranges so one character on the left is removed +/// This method can switch to smart-backspace mode, so backspace moves to the +/// previous column at the start of the line +/// +/// @param controller the active controller +/// @param ranges (in/out) the ranges to modify for deletion +void RemoveCommand::rangesForRemoveChar(TextEditorController *controller, + TextRangeSet *ranges) +{ + // there's already a selection, just delete that one + if (ranges->hasSelection()) + { + return; + } + + // when there isn't a selection we need to 'smart-move' the caret + + // when a tab char is used (or we're deleting right) the operation is pretty + // simple, just delete the character on the left + if (direction_ == Right || controller->textDocument()->config()->useTabChar()) + { + ranges->moveCarets(directionSign()); + + // in the case of spaces, we need to some smart stuff :) + } + else + { + for (int i = 0, cnt = ranges->rangeCount(); i < cnt; ++i) + { + TextRange &range = ranges->range(i); + range.minVar() = smartBackspace(controller->textDocument(), range.min()); + } + } +} + +/// Changes the ranges so one word at the left is removed +/// +/// @param controller the active controller +/// @param ranges (in/out) the ranges to modify so it spans a word +void RemoveCommand::rangesForRemoveWord(TextEditorController *controller, + TextRangeSet *ranges) +{ + // there's already a selection, just delete that one + if (ranges->hasSelection()) + { + return; + } + + TextEditorConfig *config = controller->textDocument()->config(); + ranges->moveCaretsByCharGroup(directionSign(), + config->whitespaceWithoutNewline(), + config->charGroups()); +} + +/// Changes the ranges so one line at the left is removed +/// +/// @param controller the active controller +/// @param ranges (in/out) the ranges to modify so it spans a line +void RemoveCommand::rangesForRemoveLine(TextEditorController *controller, + TextRangeSet *ranges) +{ + TextDocument *doc = controller->textDocument(); + + // process all carets + int offset = direction_ == Left ? -1 : 0; + for (int rangeIdx = ranges->rangeCount() - 1; rangeIdx >= 0; --rangeIdx) + { + TextRange &range = ranges->range(rangeIdx); + QChar chr = doc->charAtOrNull(range.caret() + offset); + if (chr == '\n') + { + range.moveCaret(doc, directionSign()); + } + else + { + range.moveCaretToLineBoundary( + doc, directionSign(), + controller->textDocument()->config()->whitespaceWithoutNewline()); + } + } +} + +/// Performs the remove command +/// +/// @param controller the active controller +void RemoveCommand::execute(TextEditorController *controller) +{ + TextSelection *sel = controller->textSelection(); + TextRangeSet *ranges = new TextRangeSet(*sel); + + int coalesceId = this->coalesceId(); + + // depending on the delete mode we need to expand the selection + ranges->beginChanges(); + switch (removeMode_) + { + case RemoveChar: + rangesForRemoveChar(controller, ranges); + break; + case RemoveWord: + rangesForRemoveWord(controller, ranges); + break; + case RemoveLine: + rangesForRemoveLine(controller, ranges); + break; + default: + Q_ASSERT(false); + } + ranges->endChanges(); + + // when there still isn't a selection, simply delete/ignore this command + if (!ranges->hasSelection()) + { + delete ranges; + return; + } + + // use the simple replacerangeset function + TextDocument *doc = controller->textDocument(); + doc->beginChanges(controller); + doc->replaceRangeSet(*ranges, ""); + doc->giveSelection(controller, ranges); + doc->endChanges(coalesceId); + emit controller->backspacePressed(); +} + +/// Converts the command to a string +QString RemoveCommand::toString() +{ + // build the mode string + QString mode; + switch (removeMode_) + { + case RemoveChar: + mode = "Char"; + break; + case RemoveWord: + mode = "Word"; + break; + case RemoveLine: + mode = "Line"; + break; + default: + mode = "Unkown!"; + } + // build the direction string + QString dir = direction_ == Left ? "Left" : "Right"; + + // next returnt he string + return QStringLiteral("RemoveCommand(%1,%2)").arg(mode).arg(dir); +} + +/// This method returns the direction sign. +/// (It seems negative enumeration-values are not allowed on all compilers: +/// http://stackoverflow.com/questions/159034/are-c-enums-signed-or-unsigned ) +/// @return -1 if left direction, 1 on the right direction. +int RemoveCommand::directionSign() const +{ + return direction_ == Left ? -1 : 1; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/removecommand.h b/lib/edbee-lib/edbee/commands/removecommand.h new file mode 100644 index 00000000..044ea5a2 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/removecommand.h @@ -0,0 +1,69 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include "edbee/texteditorcommand.h" + +namespace edbee +{ + +class TextDocument; +class TextRangeSet; + +/// A delete command. This is a backspace or a delete operation +/// +/// The delete behaviour is pretty obvious, it just deletes :) +/// +/// The behaviour of the RemoveCharLeft depends on several factors: +/// +/// When the editor has enabled useTabChar_is enabled, backspace is very simple, +/// it simply deletes the previous character or the selection +/// +/// When spaces are used for tabs the behaviour is different. If the caret is +/// left of the first non-space character, it will move 1 column to the left, +/// depending on the tabsize +/// +class EDBEE_EXPORT RemoveCommand : public TextEditorCommand +{ +public: + enum RemoveMode + { + RemoveChar, ///< Remove a single character + RemoveWord, ///< Remove a single word + RemoveLine ///< Remove a line + }; + + enum Direction + { + Left, ///< Remove the item to the left + Right ///< Remove the item to ther right + }; + + RemoveCommand(int removeMode, int direction); + + int coalesceId() const; + int smartBackspace(TextDocument *doc, int caret); + + void rangesForRemoveChar(TextEditorController *controller, + TextRangeSet *ranges); + void rangesForRemoveWord(TextEditorController *controller, + TextRangeSet *ranges); + void rangesForRemoveLine(TextEditorController *controller, + TextRangeSet *ranges); + + virtual void execute(TextEditorController *controller) override; + virtual QString toString() override; + +private: + int directionSign() const; + + int removeMode_; ///< The remove mode + int direction_; ///< The remove direction +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/replaceselectioncommand.cpp b/lib/edbee-lib/edbee/commands/replaceselectioncommand.cpp new file mode 100644 index 00000000..1f7f1595 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/replaceselectioncommand.cpp @@ -0,0 +1,38 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "replaceselectioncommand.h" + +#include "edbee/texteditorcontroller.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// The constructor of the replaceSelection command +/// @param text the text to replace +/// @param coalesceId the coalesceId top merge undo operations +ReplaceSelectionCommand::ReplaceSelectionCommand(const QString &text, + int coalesceId) + : text_(text) + , coalesceId_(coalesceId) +{ +} + +/// Executes the replace selection command +/// @param controller the controller context this command runs ons +void ReplaceSelectionCommand::execute(TextEditorController *controller) +{ + controller->replaceSelection(text_, coalesceId_); +} + +/// Converts the current command to a string +QString ReplaceSelectionCommand::toString() +{ + return QStringLiteral("ReplaceSelectionCommand"); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/replaceselectioncommand.h b/lib/edbee-lib/edbee/commands/replaceselectioncommand.h new file mode 100644 index 00000000..d195e33f --- /dev/null +++ b/lib/edbee-lib/edbee/commands/replaceselectioncommand.h @@ -0,0 +1,31 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include "edbee/texteditorcommand.h" + +namespace edbee +{ + +/// This command can be used to replace the current selection with a given text +class EDBEE_EXPORT ReplaceSelectionCommand : public TextEditorCommand +{ +public: + ReplaceSelectionCommand(const QString &text, int caolesceId); + + virtual int commandId() { return coalesceId_; } + + virtual void execute(TextEditorController *controller) override; + virtual QString toString() override; + +private: + QString text_; ///< The text to 'replace' + int coalesceId_; ///< The coalesce id to use for this command +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/selectioncommand.cpp b/lib/edbee-lib/edbee/commands/selectioncommand.cpp new file mode 100644 index 00000000..cfced645 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/selectioncommand.cpp @@ -0,0 +1,271 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "selectioncommand.h" + +#include "edbee/models/change.h" +#include "edbee/models/textdocument.h" +#include "edbee/models/texteditorconfig.h" +#include "edbee/models/textrange.h" +#include "edbee/views/textselection.h" +#include "edbee/views/textrenderer.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/texteditorwidget.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// The constructor of the selection command +/// @param unit the unit of this command +/// @param amount the number of steps +/// @param keepSelection when true the anchor stays put (and the selection is +/// expanded) +SelectionCommand::SelectionCommand(SelectionType unit, int amount, + bool keepSelection, int rangeIndex) + : unit_(unit) + , amount_(amount) + , anchor_(-1) + , keepSelection_(keepSelection) + , rangeIndex_(rangeIndex) +{ +} + +/// The descructor of the command +SelectionCommand::~SelectionCommand() {} + +/// Return the command id +/// This is th coalesceId + the given selection item +int SelectionCommand::commandId() +{ + int coalesceId = CoalesceId_Selection + unit_ * 10; + if (amount_ > 0) + { + coalesceId += 1; + } + return coalesceId; +} + +/// execute the given selection command +/// @param controller the controller to execute the selection for +void SelectionCommand::execute(TextEditorController *controller) +{ + // save the selection state + TextDocument *document = controller->textDocument(); + TextRangeSet *currentSelection + = dynamic_cast<TextRangeSet *>(controller->textSelection()); + TextRangeSet *sel + = new TextRangeSet(*currentSelection); // start with the current selection + + bool resetAnchors = !keepSelection_; + + // handle the select operation + switch (unit_) + { + // character movement + case MoveCaretByCharacter: + sel->moveCarets(amount_); + break; + + // This results in clearing the selection if a selection is present or it + // results in a movement of the caret. When clearing a selection the caret + // is placed next to the selection (which side depends on the direction) + case MoveCaretsOrDeselect: + if (keepSelection_) + { + sel->moveCarets(amount_); + } + else + { + sel->moveCaretsOrDeselect(amount_); + } + break; + + case MoveCaretByWord: + sel->moveCaretsByCharGroup(amount_, + document->config()->whitespaceWithoutNewline(), + document->config()->charGroups()); + break; + + case MoveCaretByLine: + TextSelection::moveCaretsByLine(controller, sel, amount_); + break; + + case MoveCaretToWordBoundary: + sel->moveCaretsByCharGroup(amount_, + document->config()->whitespaceWithoutNewline(), + document->config()->charGroups()); + break; + + case MoveCaretToLineBoundary: + sel->moveCaretsToLineBoundary( + amount_, document->config()->whitespaceWithoutNewline()); + break; + + case MoveCaretToDocumentBegin: + sel->toSingleRange(); + sel->range(0).setCaret(0); + break; + + case MoveCaretToDocumentEnd: + sel->toSingleRange(); + sel->range(0).setCaret(controller->textDocument()->length()); + break; + + case MoveCaretByPage: { + // make sure the first line of the window is scrolled + TextRenderer *renderer = controller->textRenderer(); + TextEditorWidget *widget = controller->widget(); + int firstVisibleLine = renderer->firstVisibleLine(); + int linesPerPage = renderer->viewHeightInLines(); + + sel->beginChanges(); + TextSelection::moveCaretsByPage(controller, sel, amount_); + if (!keepSelection_) + { + sel->resetAnchors(); // we must reset anchors here because de + // process-changes will merge carets + } + sel->endChanges(); + + firstVisibleLine += linesPerPage * amount_; + widget->scrollTopToLine(firstVisibleLine); + + break; + } + case MoveCaretToExactOffset: { + if (rangeIndex_ < 0) + { + sel->toSingleRange(); + } + TextRange &range = sel->range(rangeIndex_ >= 0 ? rangeIndex_ : 0); + range.setCaret(amount_); + if (anchor_ >= 0) + range.setAnchor(anchor_); + break; + } + case SelectAll: + sel->toSingleRange(); + sel->setRange(0, document->buffer()->length()); + resetAnchors = false; // do not reset the anchors + break; + + case SelectWord: + sel->expandToWords(document->config()->whitespaces(), + document->config()->charGroups()); + resetAnchors = false; // do not reset the anchors + break; + + case SelectWordAt: + sel->selectWordAt(amount_, document->config()->whitespaces(), + document->config()->charGroups()); + resetAnchors = false; + break; + + case ToggleWordSelectionAt: + sel->toggleWordSelectionAt(amount_, document->config()->whitespaces(), + document->config()->charGroups()); + resetAnchors = false; + break; + + case SelectFullLine: + sel->expandToFullLines(amount_); + resetAnchors = false; + break; + + case AddCaretAtOffset: + sel->addRange(amount_, amount_); + resetAnchors = false; // do not reset the anchors + break; + + case AddCaretByLine: + TextSelection::addRangesByLine(controller, sel, amount_); + break; + + case ResetSelection: + + // when there's a selection ESCAPE clears the selection + if (sel->hasSelection()) + { + sel->clearSelection(); + } + else if (sel->rangeCount() > 1) + { + sel->toSingleRange(); + } + resetAnchors = false; // keep selection + break; + } + + if (resetAnchors) + { + sel->resetAnchors(); + } + + // no change? + if (currentSelection->equals(*sel)) + { + delete sel; + return; // 0 + } + + controller->changeAndGiveTextSelection(sel, commandId()); +} + +/// Converts the unit enumeration to a string +/// @param unit the unit enumeration value +/// @return the string representation of this unit +static QString unitToString(int unit) +{ + switch (unit) + { + case SelectionCommand::MoveCaretByCharacter: + return "MoveCaretByCharacter"; + case SelectionCommand::MoveCaretByWord: + return "MoveCaretByWord"; + case SelectionCommand::MoveCaretByLine: + return "MoveCaretByLine"; + case SelectionCommand::MoveCaretToLineBoundary: + return "MoveCaretToLineBoundary"; + case SelectionCommand::MoveCaretToDocumentBegin: + return "MoveCaretToDocumentBegin"; + case SelectionCommand::MoveCaretToDocumentEnd: + return "MoveCaretToDocumentEnd"; + case SelectionCommand::MoveCaretToExactOffset: + return "MoveCaretToExactOffset"; + case SelectionCommand::SelectAll: + return "SelectAll"; + case SelectionCommand::SelectWord: + return "SelectWord"; + case SelectionCommand::SelectWordAt: + return "SelectWordAt"; + case SelectionCommand::ToggleWordSelectionAt: + return "ToggleWordSelectionAt"; + case SelectionCommand::SelectFullLine: + return "SelectFullLine"; + case SelectionCommand::AddCaretAtOffset: + return "AddCaretAtOffset"; + case SelectionCommand::AddCaretByLine: + return "AddCaretByLine"; + case SelectionCommand::ResetSelection: + return "ResetToSingleCaret"; + default: + return "Unkown"; + } +} + +/// Converts this command to a strings +QString SelectionCommand::toString() +{ + return QStringLiteral("SelectionCommand(%1)").arg(unitToString(unit_)); +} + +bool SelectionCommand::readonly() +{ + return true; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/selectioncommand.h b/lib/edbee-lib/edbee/commands/selectioncommand.h new file mode 100644 index 00000000..504cc050 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/selectioncommand.h @@ -0,0 +1,85 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include "edbee/texteditorcommand.h" + +namespace edbee +{ + +/// The selection command is used to move the caret and anchors to +/// make selections and move the carets around +class EDBEE_EXPORT SelectionCommand : public TextEditorCommand +{ +public: + enum SelectionType + { + + // movement and selection + MoveCaretByCharacter, ///< Moves the caret(s) by the given amount of + ///< characters + MoveCaretsOrDeselect, ///< Moves the caret(s) by the given amount of + ///< characters or deselects the current selection + // SubWord, // TODO, implement subword selecting + MoveCaretByWord, ///< moves the caret(s) by the given amount of words + MoveCaretByLine, ///< moves the caret(s) by the given amount of lines + MoveCaretByPage, ///< moves the caret(s) by the given amount of pages + MoveCaretToWordBoundary, ///< moves the caret to a line-boundary (<0 begin + ///< of line, >0 end of line) + MoveCaretToLineBoundary, ///< moves the caret to a line-boundary (<0 begin + ///< of line, >0 end of line) + MoveCaretToDocumentBegin, ///< moves the caret to the document start + MoveCaretToDocumentEnd, ///< moves the caret to the document end + MoveCaretToExactOffset, ///< moves the caret to the given offset (given in + ///< amount). (This action also support the + ///< adjustment of the anchor) + + // selection only + SelectAll, ///< selects the complete document + SelectWord, ///< select a full word + SelectFullLine, ///< select a full line + SelectWordAt, ///< select 'toggles' a word. Double click on a word to select + ///< a word or deselect a word + ToggleWordSelectionAt, ///< Toggles the selection and caret at the given + ///< location + + // add an extra caret + AddCaretAtOffset, ///< adds a extra caret at the given offset (amount is the + ///< caret offset) + AddCaretByLine, ///< adds a caret at the given line amount is the amount of + ///< lines and the direction to add + ResetSelection + }; + +public: + explicit SelectionCommand(SelectionType unit, int amount = 0, + bool keepSelection = false, int rangeIndex = -1); + virtual ~SelectionCommand(); + + virtual int commandId(); + + virtual void execute(TextEditorController *controller) override; + virtual QString toString() override; + virtual bool readonly() override; + + SelectionType unit() { return unit_; } + int amount() { return amount_; } + bool keepSelection() { return keepSelection_; } + int rangeIndex() { return rangeIndex_; } + void setAnchor(int anchor) { anchor_ = anchor; } + int anchor() { return anchor_; } + +private: + SelectionType unit_; + int amount_; + int anchor_; ///< currently only used for word-selection / line selection + bool keepSelection_; + int rangeIndex_; +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/tabcommand.cpp b/lib/edbee-lib/edbee/commands/tabcommand.cpp new file mode 100644 index 00000000..e24c8051 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/tabcommand.cpp @@ -0,0 +1,213 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "tabcommand.h" + +#include "edbee/texteditorcontroller.h" +#include "edbee/models/changes/mergablechangegroup.h" +#include "edbee/models/texteditorconfig.h" +#include "edbee/models/textdocument.h" +#include "edbee/views/textselection.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// Constructs the tabcommand +/// @param direction the direction of the tab (Forward or Backward) +/// @param insertTab should we use a tab character? +TabCommand::TabCommand(TabCommand::Direction direction, bool insertTab) + : dir_(direction) + , insertTab_(insertTab) +{ +} + +/// indents or outdents in the given controller +/// @parma controller the controller +void TabCommand::indent(TextEditorController *controller) +{ + TextDocument *doc = controller->textDocument(); + TextSelection *sel = controller->textSelection(); + int tabSize = doc->config()->indentSize(); + bool useTab = false; // doc->config()->useTabChar(); + QString tab = useTab ? "\t" : QStringLiteral(" ").repeated(tabSize); + + controller->beginUndoGroup(new MergableChangeGroup(controller)); + + sel->beginChanges(); + + int lastLine = -1; + for (int i = 0, cnt = sel->rangeCount(); i < cnt; ++i) + { + TextRange &range = sel->range(i); + + // calculate the start and endline + int startLine = doc->lineFromOffset(range.min()); + int endLine = doc->lineFromOffset(range.max()); + + // when the last line is blank, we do NOT want to indent it (fixes #61) + if (startLine != endLine + && doc->columnFromOffsetAndLine(range.max(), endLine) == 0) + { + --endLine; + } + + // make sure we at least indent one line + if (startLine <= lastLine) + startLine = lastLine + 1; + + // now indent all lines + for (int line = startLine; line <= endLine; ++line) + { + int offset = doc->offsetFromLine(line); + + // insert-tab + if (dir_ == Forward) + { + doc->replace(offset, 0, tab); + sel->changeSpatial(offset, 0, tab.length(), true); + + // remove tab + } + else + { + int offsetNextLine = doc->offsetFromLine(line + 1) - 1; + int endOffset = offset; + for (int j = 0; j < tabSize; ++j) + { + int off = offset + j; + if (off >= doc->length()) + break; + QChar chr = doc->charAt(off); + + if (chr != ' ' && chr != '\t') + break; + if (off >= offsetNextLine) + break; + ++endOffset; + if (chr == '\t') + break; + } + if (offset != (endOffset - offset)) + { + doc->replace(offset, endOffset - offset, ""); + sel->changeSpatial(offset, endOffset - offset, 0, true); + } + } + } + lastLine = endLine; + } + + sel->endChanges(); + + controller->endUndoGroup(CoalesceId_Indent + dir_, true); +} + +/// TODO: Refactor :) +void TabCommand::execute(TextEditorController *controller) +{ + if (!insertTab_) + { + indent(controller); + return; + } + + // retrieve the settings + TextDocument *doc = controller->textDocument(); + TextSelection *sel = controller->textSelection(); + int tabSize = doc->config()->indentSize(); + bool useTab = doc->config()->useTabChar(); + QString ws = doc->config()->whitespaces(); + + // check if the changes are multi-line + bool multiLine = false; + bool atStartOfLine = true; + for (int i = 0, cnt = sel->rangeCount(); i < cnt && !multiLine; ++i) + { + TextRange &range = sel->range(i); + multiLine = multiLine + || doc->lineFromOffset(range.anchor()) + != doc->lineFromOffset(range.caret()); + + // no selection? we need to check if we are at the start of the line + if (!range.hasSelection() && atStartOfLine) + { + int pos = range.caret(); + int startPos = doc->offsetFromLine(doc->lineFromOffset(pos)); + --pos; // look hat the character before the pos + + // Q_ASSERT(startPos <= pos); + if (pos >= startPos) + { + while (pos > startPos && atStartOfLine) + { + QChar chr = doc->charAt(pos); + if (!ws.contains(chr)) + { + atStartOfLine = false; + } + --pos; + } + } + } + else + { + atStartOfLine = false; + } + } + + // a Line-moving operation + if (multiLine || (atStartOfLine && dir_ == Backward)) + { + indent(controller); + + // a character inserting operation + } + else + { + if (dir_ == Forward) + { + if (useTab) + { + controller->replaceSelection( + "\t", CoalesceId_Indent + SubCoalesceId_Indent_InsertTab); + } + else + { + + // we need to 'calculate' the number of spaces to add (per caret) + QStringList texts; + for (int i = 0, cnt = sel->rangeCount(); i < cnt; ++i) + { + TextRange &range = sel->range(i); + int offset = range.min(); + int col = doc->columnFromOffsetAndLine(offset); + + // calculate the number of spaces depending on the column + int spaces = tabSize - col % tabSize; + if (!spaces) + spaces = tabSize; + + // append the text + texts.push_back(QStringLiteral(" ").repeated(spaces)); + } + + controller->replaceSelection( + texts, CoalesceId_Indent + SubCoalesceId_Indent_InsertSpaces); + } + } + } +} + +/// Returs the name of this command +QString TabCommand::toString() +{ + if (dir_ == Backward) + return "TabCommand(back)"; + return "TabCommand(fwd)"; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/tabcommand.h b/lib/edbee-lib/edbee/commands/tabcommand.h new file mode 100644 index 00000000..1926dd51 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/tabcommand.h @@ -0,0 +1,46 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include "edbee/texteditorcommand.h" + +namespace edbee +{ + +/// For inserting/executing forward and backwards tabs +class EDBEE_EXPORT TabCommand : public TextEditorCommand +{ +public: + /// The possible directions of the tab command + enum Direction + { + Forward, + Backward + }; + + /// Extra possible coalesce (sub-ids) + enum + { + SubCoalesceId_Indent_Forward = Forward, + SubCoalesceId_Indent_Backward = Backward, + SubCoalesceId_Indent_InsertTab, + SubCoalesceId_Indent_InsertSpaces + }; + + TabCommand(Direction direction, bool insertTab); + + virtual void indent(TextEditorController *controller); + virtual void execute(TextEditorController *controller) override; + virtual QString toString() override; + +private: + Direction dir_; ///< The tab direction + bool insertTab_; ///< Should we insert a tab +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/togglereadonlycommand.cpp b/lib/edbee-lib/edbee/commands/togglereadonlycommand.cpp new file mode 100644 index 00000000..000efcab --- /dev/null +++ b/lib/edbee-lib/edbee/commands/togglereadonlycommand.cpp @@ -0,0 +1,32 @@ +#include "togglereadonlycommand.h" + +#include "edbee/texteditorcontroller.h" +#include "edbee/models/changes/mergablechangegroup.h" +#include "edbee/models/texteditorconfig.h" +#include "edbee/models/textdocument.h" +#include "edbee/views/textselection.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// Constructs the toggle readonly command +ToggleReadonlyCommand::ToggleReadonlyCommand() {} + +void ToggleReadonlyCommand::execute(TextEditorController *controller) +{ + controller->setReadonly(controller->readonly() ? false : true); +} + +QString ToggleReadonlyCommand::toString() +{ + return "ToggleReadOnlyCommand()"; +} + +bool ToggleReadonlyCommand::readonly() +{ + return true; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/togglereadonlycommand.h b/lib/edbee-lib/edbee/commands/togglereadonlycommand.h new file mode 100644 index 00000000..64c44d60 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/togglereadonlycommand.h @@ -0,0 +1,23 @@ +/** + * Copyright 2011-2020 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once +#include "edbee/exports.h" +#include "edbee/texteditorcommand.h" + +namespace edbee +{ + +class ToggleReadonlyCommand : public TextEditorCommand +{ +public: + ToggleReadonlyCommand(); + + virtual void execute(TextEditorController *controller) override; + virtual QString toString() override; + virtual bool readonly() override; +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/undocommand.cpp b/lib/edbee-lib/edbee/commands/undocommand.cpp new file mode 100644 index 00000000..622a96b6 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/undocommand.cpp @@ -0,0 +1,35 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "undocommand.h" + +#include "edbee/texteditorcontroller.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +UndoCommand::UndoCommand(bool soft) + : soft_(soft) +{ +} + +void UndoCommand::execute(TextEditorController *controller) +{ + controller->undo(soft_); +} + +QString UndoCommand::toString() +{ + return QStringLiteral("UndoCommand(%1)").arg(soft_ ? "soft" : "hard"); +} + +bool UndoCommand::readonly() +{ + return soft_; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/commands/undocommand.h b/lib/edbee-lib/edbee/commands/undocommand.h new file mode 100644 index 00000000..44cecb84 --- /dev/null +++ b/lib/edbee-lib/edbee/commands/undocommand.h @@ -0,0 +1,31 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QString> +#include "edbee/texteditorcommand.h" + +namespace edbee +{ + +class EDBEE_EXPORT UndoCommand : public TextEditorCommand +{ +public: + UndoCommand(bool soft = false); + + virtual int commandId() { return CoalesceId_None; } + + virtual void execute(TextEditorController *controller) override; + virtual QString toString() override; + virtual bool readonly() override; + +private: + bool soft_; ///< should this command perform a soft undo? +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/data/factorycommandmap.cpp b/lib/edbee-lib/edbee/data/factorycommandmap.cpp new file mode 100644 index 00000000..df19460e --- /dev/null +++ b/lib/edbee-lib/edbee/data/factorycommandmap.cpp @@ -0,0 +1,171 @@ +/** + * Copyright 2011-2020 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "factorycommandmap.h" + +#include "edbee/commands/commentcommand.h" +#include "edbee/commands/copycommand.h" +#include "edbee/commands/cutcommand.h" +#include "edbee/commands/debugcommand.h" +#include "edbee/commands/duplicatecommand.h" +#include "edbee/commands/findcommand.h" +#include "edbee/commands/pastecommand.h" +#include "edbee/commands/movelinecommand.h" +#include "edbee/commands/newlinecommand.h" +#include "edbee/commands/redocommand.h" +#include "edbee/commands/removecommand.h" +#include "edbee/commands/replaceselectioncommand.h" +#include "edbee/commands/selectioncommand.h" +#include "edbee/commands/tabcommand.h" +#include "edbee/commands/togglereadonlycommand.h" +#include "edbee/commands/undocommand.h" +#include "edbee/models/texteditorcommandmap.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +#define give(key, command) cm->give(key, command) + +/// This method adds all factory keys to the texteditor keymap +/// This method does NOT clear the existing items. +/// @param km the command manager +void FactoryCommandMap::fill(TextEditorCommandMap *cm) +{ + give("goto_next_char", + new SelectionCommand(SelectionCommand::MoveCaretsOrDeselect, 1)); + give("goto_prev_char", + new SelectionCommand(SelectionCommand::MoveCaretsOrDeselect, -1)); + give("goto_next_word", + new SelectionCommand(SelectionCommand::MoveCaretByWord, 1)); + give("goto_prev_word", + new SelectionCommand(SelectionCommand::MoveCaretByWord, -1)); + give("goto_bol", + new SelectionCommand(SelectionCommand::MoveCaretToLineBoundary, -1)); + give("goto_eol", + new SelectionCommand(SelectionCommand::MoveCaretToLineBoundary, 1)); + give("goto_next_line", + new SelectionCommand(SelectionCommand::MoveCaretByLine, 1)); + give("goto_prev_line", + new SelectionCommand(SelectionCommand::MoveCaretByLine, -1)); + give("goto_bof", + new SelectionCommand(SelectionCommand::MoveCaretToDocumentBegin)); + give("goto_eof", + new SelectionCommand(SelectionCommand::MoveCaretToDocumentEnd)); + give("goto_page_down", + new SelectionCommand(SelectionCommand::MoveCaretByPage, 1)); + give("goto_page_up", + new SelectionCommand(SelectionCommand::MoveCaretByPage, -1)); + + // selection + give("sel_next_char", + new SelectionCommand(SelectionCommand::MoveCaretByCharacter, 1, true)); + give("sel_prev_char", + new SelectionCommand(SelectionCommand::MoveCaretByCharacter, -1, true)); + give("sel_next_word", + new SelectionCommand(SelectionCommand::MoveCaretByWord, 1, true)); + give("sel_prev_word", + new SelectionCommand(SelectionCommand::MoveCaretByWord, -1, true)); + give("sel_to_bol", new SelectionCommand( + SelectionCommand::MoveCaretToLineBoundary, -1, true)); + give("sel_to_eol", new SelectionCommand( + SelectionCommand::MoveCaretToLineBoundary, 1, true)); + give("sel_to_next_line", + new SelectionCommand(SelectionCommand::MoveCaretByLine, 1, true)); + give("sel_to_prev_Line", + new SelectionCommand(SelectionCommand::MoveCaretByLine, -1, true)); + give("sel_to_bof", new SelectionCommand( + SelectionCommand::MoveCaretToDocumentBegin, -1, true)); + give("sel_to_eof", + new SelectionCommand(SelectionCommand::MoveCaretToDocumentEnd, 1, true)); + give("sel_page_down", + new SelectionCommand(SelectionCommand::MoveCaretByPage, 1, true)); + give("sel_page_up", + new SelectionCommand(SelectionCommand::MoveCaretByPage, -1, true)); + + give("sel_all", new SelectionCommand(SelectionCommand::SelectAll)); + give("sel_word", new SelectionCommand(SelectionCommand::SelectWord)); + give("sel_line", new SelectionCommand(SelectionCommand::SelectFullLine, 1)); + give("sel_prev_line", + new SelectionCommand(SelectionCommand::SelectFullLine, -1)); + give("add_caret_prev_line", + new SelectionCommand(SelectionCommand::AddCaretByLine, -1)); + give("add_caret_next_line", + new SelectionCommand(SelectionCommand::AddCaretByLine, 1)); + give("sel_reset", new SelectionCommand(SelectionCommand::ResetSelection)); + + // line entry + give("ins_newline", new NewlineCommand(NewlineCommand::NormalNewline)); + give("ins_newline_before", new NewlineCommand(NewlineCommand::AddLineBefore)); + give("ins_newline_after", new NewlineCommand(NewlineCommand::AddLineAfter)); + + // remove text at the left + give("del_left", + new RemoveCommand(RemoveCommand::RemoveChar, RemoveCommand::Left)); + give("del_word_left", + new RemoveCommand(RemoveCommand::RemoveWord, RemoveCommand::Left)); + give("del_line_left", + new RemoveCommand(RemoveCommand::RemoveLine, RemoveCommand::Left)); + + // remove text at the rigth + give("del_right", + new RemoveCommand(RemoveCommand::RemoveChar, RemoveCommand::Right)); + give("del_word_right", + new RemoveCommand(RemoveCommand::RemoveWord, RemoveCommand::Right)); + give("del_line_right", + new RemoveCommand(RemoveCommand::RemoveLine, RemoveCommand::Right)); + + // special text entry commands + give("duplicate", new DuplicateCommand()); + give("toggle_comment", new CommentCommand(false)); + give("toggle_block_comment", new CommentCommand(true)); + + // tab entry + // give( "tab", new ReplaceSelectionCommand( "\t", CoalesceId_InsertTab )); + /// TODO: add a backtab action here + // set( QKeySequence( Qt::Key_BackTab ), new ) + give("tab", new TabCommand(TabCommand::Forward, true)); + give("tab_back", new TabCommand(TabCommand::Backward, true)); + + give("indent", new TabCommand(TabCommand::Forward, false)); + give("outdent", new TabCommand(TabCommand::Backward, false)); + + // undo / redo comamnds + give("undo", new UndoCommand()); + give("redo", new RedoCommand()); + give("soft_undo", new UndoCommand(true)); + give("soft_redo", new RedoCommand(true)); + + // clipboard operations + give("copy", new CopyCommand()); + give("cut", new CutCommand()); + give("paste", new PasteCommand()); + + // debug commands + give("debug_dump_scopes", new DebugCommand(DebugCommand::DumpScopes)); + give("debug_rebuild_scopes", new DebugCommand(DebugCommand::RebuildScopes)); + give("debug_dump_undo_stack", new DebugCommand(DebugCommand::DumpUndoStack)); + give("debug_dump_character_codes", + new DebugCommand(DebugCommand::DumpCharacterCodes)); + + // find items + give("find_use_sel", new FindCommand(FindCommand::UseSelectionForFind)); + give("find_next_match", new FindCommand(FindCommand::FindNextMatch)); + give("find_prev_match", new FindCommand(FindCommand::FindPreviousMatch)); + give("sel_next_match", new FindCommand(FindCommand::SelectNextMatch)); + give("sel_prev_match", new FindCommand(FindCommand::SelectPreviousMatch)); + give("sel_all_matches", new FindCommand(FindCommand::SelectAllMatches)); + + give("select_under_expand", new FindCommand(FindCommand::SelectUnderExpand)); + give("select_all_under", new FindCommand(FindCommand::SelectAllUnder)); + + give("move_lines_up", new MoveLineCommand(-1)); + give("move_lines_down", new MoveLineCommand(1)); + + give("toggle_readonly", new ToggleReadonlyCommand()); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/data/factorycommandmap.h b/lib/edbee-lib/edbee/data/factorycommandmap.h new file mode 100644 index 00000000..11ef9628 --- /dev/null +++ b/lib/edbee-lib/edbee/data/factorycommandmap.h @@ -0,0 +1,22 @@ +/** + * Copyright 2011-2014 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +namespace edbee +{ + +class TextEditorCommandMap; + +/// This class contains the factory edbee command map +class EDBEE_EXPORT FactoryCommandMap +{ +public: + void fill(TextEditorCommandMap *cm); +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/data/factorykeymap.cpp b/lib/edbee-lib/edbee/data/factorykeymap.cpp new file mode 100644 index 00000000..5a71d8cf --- /dev/null +++ b/lib/edbee-lib/edbee/data/factorykeymap.cpp @@ -0,0 +1,137 @@ +/** + * Copyright 2011-2014 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "factorykeymap.h" + +#include "edbee/models/texteditorkeymap.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +#define add(key, value) km->add(key, value) + +/// This method adds all factory keys to the texteditor keymap +/// This method does NOT clear the existing items. +/// @param km the command manager +void FactoryKeyMap::fill(TextEditorKeyMap *km) +{ + // add( command, keyname/sequence ) + add("goto_next_char", "move_to_next_char"); + add("goto_prev_char", "move_to_previous_char"); + add("goto_next_word", "move_to_next_word"); + add("goto_prev_word", "move_to_previous_word"); + add("goto_bol", "move_to_start_of_line"); + add("goto_bol", "move_to_start_of_block"); + add("goto_eol", "move_to_end_of_line"); + add("goto_eol", "move_to_end_of_block"); + add("goto_next_line", "move_to_next_line"); + add("goto_prev_line", "move_to_previous_line"); + add("goto_bof", "move_to_start_of_document"); + add("goto_eof", "move_to_end_of_document"); + add("goto_page_down", "move_to_next_page"); + add("goto_page_up", "move_to_previous_page"); + + // selection + add("sel_next_char", "select_next_char"); + add("sel_prev_char", "select_previous_char"); + add("sel_next_word", "select_next_word"); + add("sel_prev_word", "select_previous_word"); + add("sel_to_bol", "select_start_of_line"); + add("sel_to_eol", "select_end_of_line"); + add("sel_to_next_line", "select_next_line"); + add("sel_to_prev_Line", "select_previous_line"); + add("sel_to_bof", "select_start_of_document"); + add("sel_to_eof", "select_end_of_document"); + add("sel_page_down", "select_next_page"); + add("sel_page_up", "select_previous_page"); + + add("sel_all", "select_all"); + // add("sel_word", "Ctrl+D" ); // is superseeded by 'find_under_expand' + add("sel_line", "Ctrl+L"); + add("sel_prev_line", "Ctrl+Shift+L"); + add("add_caret_prev_line", "Meta+shift+Up"); + add("add_caret_next_line", "Meta+shift+Down"); + add("sel_reset", "Escape"); + + // TODO: We need to build in support for alternative keymaps per platform + add("add_caret_prev_line", "Ctrl+Alt+Up"); + add("add_caret_next_line", "Ctrl+Alt+Down"); + + // line entry + add("ins_newline", "Enter"); + add("ins_newline", "Return"); + add("ins_newline", "Shift+Enter"); + add("ins_newline", "Shift+Return"); + add("ins_newline_before", "Ctrl+Shift+Return"); + add("ins_newline_before", "Ctrl+Shift+Enter"); + add("ins_newline_after", "Ctrl+Enter"); + add("ins_newline_after", "Ctrl+Return"); + + // deletion left + add("del_left", "Backspace"); + add("del_left", "Shift+Backspace"); + add("del_word_left", "Alt+Backspace"); + add("del_line_left", "Ctrl+Backspace"); + + // deletion right + add("del_right", "Delete"); + add("del_word_right", "Alt+Delete"); + add("del_line_right", "Ctrl+Delete"); + + // tab entry + add("tab", "Tab"); + // add( "tab_back", "Backtab" ); (Workaround for issue #72) + add("tab_back", "Shift+Tab"); + add("tab_back", "Shift+Backtab"); + add("indent", "Ctrl+]"); + add("outdent", "Ctrl+["); + + // special entry + add("duplicate", "Ctrl+Shift+D"); + add("toggle_comment", "Ctrl+/"); + add("toggle_block_comment", "Ctrl+Meta+/"); + + // undo / redo commands + add("undo", "undo"); + add("redo", "redo"); + add("soft_undo", "Ctrl+U"); + add("soft_redo", "Ctrl+Shift+U"); + + // clipboard operations + add("copy", "Ctrl+Insert"); + add("cut", "Shift+Delete"); + add("paste", "Shift+Insert"); + + add("copy", "copy"); + add("cut", "cut"); + add("paste", "paste"); + + // debug commands + add("debug_dump_scopes", "Ctrl+Shift+X,S"); + add("debug_rebuild_scopes", "Ctrl+Shift+X,R"); + add("debug_dump_undo_stack", "Ctrl+Shift+X,U"); + add("debug_dump_character_codes", "Ctrl+Shift+X,C"); + + // find commands + add("find_use_sel", "Ctrl+E"); + add("find_next_match", "find_next"); + add("find_prev_match", "find_previous"); + add("sel_next_match", "Meta+S"); + add("sel_prev_match", "Meta+Shift+S"); + add("sel_all_matches", "Ctrl+Shift+Meta+A"); + add("select_under_expand", "Ctrl+D"); + add("select_all_under", "Alt+F3"); + + // move lines + add("move_lines_up", "Ctrl+Meta+Up"); + add("move_lines_down", "Ctrl+Meta+Down"); + + // toggle readonly + add("toggle_readonly", "Ctrl+R"); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/data/factorykeymap.h b/lib/edbee-lib/edbee/data/factorykeymap.h new file mode 100644 index 00000000..790a0b46 --- /dev/null +++ b/lib/edbee-lib/edbee/data/factorykeymap.h @@ -0,0 +1,24 @@ +/** + * Copyright 2011-2014 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +namespace edbee +{ + +class TextEditorKeyMap; + +/** + * This class can fill the texteditor keymap with the factory defaults + */ +class EDBEE_EXPORT FactoryKeyMap +{ +public: + void fill(TextEditorKeyMap *km); +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/debug.h b/lib/edbee-lib/edbee/debug.h new file mode 100644 index 00000000..b783b596 --- /dev/null +++ b/lib/edbee-lib/edbee/debug.h @@ -0,0 +1,21 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/util/logging.h" + +#include "edbee/util/mem/debug_new.h" + +#if defined(QT_DEBUG) +/// This assert requires the inclusion of QApplication an QThread +# define Q_ASSERT_GUI_THREAD \ + Q_ASSERT(qApp->thread() == QThread::currentThread()) +# define Q_ASSERT_NOT_GUI_THREAD \ + Q_ASSERT(qApp->thread() != QThread::currentThread()) +#else +# define Q_ASSERT_GUI_THREAD +# define Q_ASSERT_NOT_GUI_THREAD +#endif diff --git a/lib/edbee-lib/edbee/edbee.cpp b/lib/edbee-lib/edbee/edbee.cpp new file mode 100644 index 00000000..bfe892e9 --- /dev/null +++ b/lib/edbee-lib/edbee/edbee.cpp @@ -0,0 +1,298 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "edbee.h" + +#include <QApplication> +#include <QAccessible> + +#include "edbee/models/textautocompleteprovider.h" +#include "edbee/models/dynamicvariables.h" +#include "edbee/models/textbuffer.h" +#include "edbee/models/texteditorcommandmap.h" +#include "edbee/models/texteditorkeymap.h" +#include "edbee/models/textdocumentscopes.h" +#include "edbee/models/textgrammar.h" +#include "edbee/util/textcodec.h" +#include "edbee/views/accessibletexteditorwidget.h" +#include "edbee/views/texttheme.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// The edbee instance singleton +static Edbee *theInstance = 0; + +/// The constructor +Edbee::Edbee() + : inited_(false) + , defaultCommandMap_(0) + , codecManager_(0) + , scopeManager_(0) + , grammarManager_(0) + , themeManager_(0) + , keyMapManager_(0) + , environmentVariables_(0) + , autoCompleteProviderList_(0) +{ +} + +/// The edbee destructors destroys the different managers +Edbee::~Edbee() +{ + delete autoCompleteProviderList_; + delete environmentVariables_; + delete keyMapManager_; + delete themeManager_; + delete grammarManager_; + delete scopeManager_; + delete codecManager_; + delete defaultCommandMap_; +} + +/// The singleton instance getter +Edbee *Edbee::instance() +{ + if (!theInstance) + { + theInstance = new Edbee(); + } + return theInstance; +} + +/// sets the path where to find the keymap files +/// @param keyMapPath the path with keymap files +void Edbee::setKeyMapPath(const QString &keyMapPath) +{ + keyMapPath_ = keyMapPath; +} + +/// Sets the grammar path +/// @param grammarPath the path with the grammar files +void Edbee::setGrammarPath(const QString &grammarPath) +{ + grammarPath_ = grammarPath; +} + +/// Sets the path where to find the theme files +/// @param themePath the path to find the themes +void Edbee::setThemePath(const QString &themePath) +{ + themePath_ = themePath; +} + +/// This method automatically initializes the edbee library it this hasn't +/// already been done +void Edbee::autoInit() +{ + if (!inited_) + { + init(); + autoShutDownOnAppExit(); + } +} + +/// TODO: We need a way to load the (scoped) environment variables +/// for now we just add some variables for some common languages +static void initHardCodedDynamicScopes(DynamicVariables *env) +{ + QString tcs("TM_COMMENT_START"); + QString tce("TM_COMMENT_END"); + QString tcs2("TM_COMMENT_START_2"); + QString tce2("TM_COMMENT_END_2"); + QString tcs3("TM_COMMENT_START_3"); + QString tce3("TM_COMMENT_END_3"); + env->setAndGiveScopedSelector(tcs, "# ", "source.yaml"); + + env->setAndGiveScopedSelector( + tcs, "// ", "source.c, source.c++, source.objc, source.objc++"); + env->setAndGiveScopedSelector( + tcs2, "/*", "source.c, source.c++, source.objc, source.objc++"); + env->setAndGiveScopedSelector( + tce2, "*/", "source.c, source.c++, source.objc, source.objc++"); + + env->setAndGiveScopedSelector(tcs, "-- ", "source.lua"); + env->setAndGiveScopedSelector(tcs2, "--[[", "source.lua"); + env->setAndGiveScopedSelector(tce2, "]]", "source.lua"); + + env->setAndGiveScopedSelector(tcs, "/*", "source.css"); + env->setAndGiveScopedSelector(tce, "*/", "source.css"); + + env->setAndGiveScopedSelector(tcs, "; ", "source.clojure"); + + env->setAndGiveScopedSelector(tcs, "# ", "source.coffee"); + env->setAndGiveScopedSelector(tcs2, "###", "source.coffee"); + env->setAndGiveScopedSelector(tce2, "###", "source.coffee"); + + env->setAndGiveScopedSelector(tcs, "<!-- ", "text.html"); + env->setAndGiveScopedSelector(tce, " -->", "text.html"); + + env->setAndGiveScopedSelector(tcs, "<!-- ", "text.xml"); + env->setAndGiveScopedSelector(tce, " -->", "text.xml"); + + env->setAndGiveScopedSelector(tcs, "// ", "source.java"); + env->setAndGiveScopedSelector(tcs2, "/*", "source.java"); + env->setAndGiveScopedSelector(tce2, "*/", "source.java"); + + env->setAndGiveScopedSelector(tcs, "// ", "source.js, source.json"); + env->setAndGiveScopedSelector(tcs2, "/*", "source.js, source.json"); + env->setAndGiveScopedSelector(tce2, "*/", "source.js, source.json"); + + env->setAndGiveScopedSelector(tcs, "// ", "source.php"); + env->setAndGiveScopedSelector(tcs2, "# ", "source.php"); + env->setAndGiveScopedSelector(tcs3, "/*", "source.php"); + env->setAndGiveScopedSelector(tce3, "*/", "source.php"); + + env->setAndGiveScopedSelector(tcs, "# ", "source.perl"); + + env->setAndGiveScopedSelector(tcs, "-# ", + "text.haml"); // I hate the default '/' + + env->setAndGiveScopedSelector(tcs, "# ", "source.js, source.ruby"); + env->setAndGiveScopedSelector(tcs2, "=begin", "source.js, source.ruby"); + env->setAndGiveScopedSelector(tce2, "=end", "source.js, source.ruby"); + + env->setAndGiveScopedSelector(tcs, "// ", "source.scss"); + env->setAndGiveScopedSelector(tcs2, "/*", "source.scss"); + env->setAndGiveScopedSelector(tce2, "*/", "source.scss"); + + env->setAndGiveScopedSelector(tcs, "-- ", "source.sql"); + env->setAndGiveScopedSelector(tcs2, "/*", "source.sql"); + env->setAndGiveScopedSelector(tce2, "*/", "source.sql"); + + env->setAndGiveScopedSelector(tcs, "# ", "source.shell"); +} + +/// initializes the engine on startup +void Edbee::init() +{ + defaultCommandMap_ = new TextEditorCommandMap(); + codecManager_ = new TextCodecManager(); + scopeManager_ = new TextScopeManager(); + themeManager_ = new TextThemeManager(); + grammarManager_ = new TextGrammarManager(); + keyMapManager_ = new TextKeyMapManager(); + environmentVariables_ = new DynamicVariables(); + autoCompleteProviderList_ = new TextAutoCompleteProviderList(); + + qRegisterMetaType<edbee::TextBufferChange>("edbee::TextBufferChange"); + + // register the AccessibileText interface + QAccessible::installFactory(edbee::AccessibleTextEditorWidget::factory); + + // factory fill the default command map + defaultCommandMap_->loadFactoryCommandMap(); + + // load all grammar definitions + if (!grammarPath_.isEmpty()) + { + grammarManager_->readAllGrammarFilesInPath(grammarPath_); + } + + // load all themes + if (!themePath_.isEmpty()) + { + themeManager_->listAllThemes(themePath_); + } + + // load the keymaps or fallback to the factory keymap + if (!keyMapPath_.isEmpty()) + { + keyMapManager_->loadAllKeyMaps(keyMapPath_); + } + else + { + keyMapManager_->loadFactoryKeyMap(); + } + + inited_ = true; + + // for now initialize the dynamic variables + initHardCodedDynamicScopes(environmentVariables_); +} + +/// destroys the texteditor manager and all related class +void Edbee::shutdown() +{ + delete theInstance; + theInstance = 0; +} + +/// Call this method to automatically shutdown the texteditor manager on +/// shutdown (This method listens to the qApp::aboutToQuit signal +void Edbee::autoShutDownOnAppExit() +{ + connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(shutdown())); +} + +/// returns the default editor keymap +TextEditorKeyMap *Edbee::defaultKeyMap() +{ + return keyMapManager()->get(""); +} + +/// Returns the default editor command map. This is the default command map +/// that's used by the editor components +/// @return the default command map +TextEditorCommandMap *Edbee::defaultCommandMap() +{ + return defaultCommandMap_; +} + +/// Returns the codec-manager for Edbee +TextCodecManager *Edbee::codecManager() +{ + Q_ASSERT(inited_); + return codecManager_; +} + +/// Returns the scope manager. The scope manager is a general class to share +/// scope names and identifiers between different editors +TextScopeManager *Edbee::scopeManager() +{ + Q_ASSERT(inited_); + return scopeManager_; +} + +/// Returns the grammar manager used by all editors +/// The grammar manager is used for sharing the different grammar definitions +/// between the different editors +TextGrammarManager *Edbee::grammarManager() +{ + Q_ASSERT(inited_); + return grammarManager_; +} + +/// Returns the theme manager +/// The theme manager is used to share themes between the different editors +TextThemeManager *Edbee::themeManager() +{ + Q_ASSERT(inited_); + return themeManager_; +} + +/// Returns the keymap manager +TextKeyMapManager *Edbee::keyMapManager() +{ + Q_ASSERT(inited_); + return keyMapManager_; +} + +/// Returns the dynamicvariables object +DynamicVariables *Edbee::environmentVariables() +{ + Q_ASSERT(inited_); + return environmentVariables_; +} + +TextAutoCompleteProviderList *Edbee::autoCompleteProviderList() +{ + Q_ASSERT(autoCompleteProviderList_); + return autoCompleteProviderList_; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/edbee.h b/lib/edbee-lib/edbee/edbee.h new file mode 100644 index 00000000..1d8abce4 --- /dev/null +++ b/lib/edbee-lib/edbee/edbee.h @@ -0,0 +1,81 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QObject> + +namespace edbee +{ + +class DynamicVariables; +class TextAutoCompleteProviderList; +class TextCodecManager; +class TextEditorCommandMap; +class TextEditorKeyMap; +class TextGrammarManager; +class TextKeyMapManager; +class TextScopeManager; +class TextThemeManager; + +/// The texteditor manager, +/// It manages all singleton objects for the editor +/// It performs the initialization and shutdown code for all editors +class EDBEE_EXPORT Edbee : public QObject +{ + Q_OBJECT +private: + Edbee(); + virtual ~Edbee(); + +public: + static Edbee *instance(); + + void setKeyMapPath(const QString &keyMapPath); + void setGrammarPath(const QString &grammarPath); + void setThemePath(const QString &themePath); + + void autoInit(); + +public slots: + void init(); + void shutdown(); + void autoShutDownOnAppExit(); + +public: + TextEditorKeyMap *defaultKeyMap(); + TextEditorCommandMap *defaultCommandMap(); + + TextCodecManager *codecManager(); + TextScopeManager *scopeManager(); + TextGrammarManager *grammarManager(); + TextThemeManager *themeManager(); + TextKeyMapManager *keyMapManager(); + DynamicVariables *environmentVariables(); + TextAutoCompleteProviderList *autoCompleteProviderList(); + +protected: + bool inited_; ///< This method is set to true if the manager is inited + + QString grammarPath_; ///< The path were to load all grammars from + QString themePath_; ///< The path to load all themes from + QString keyMapPath_; ///< The path to load all keymaps + + TextEditorCommandMap *defaultCommandMap_; ///< The default command map + + TextCodecManager *codecManager_; ///< The text-editor codec manager + TextScopeManager *scopeManager_; ///< The text-scope manager + TextGrammarManager *grammarManager_; ///< The grammar manager + TextThemeManager *themeManager_; ///< The text theme manager + TextKeyMapManager *keyMapManager_; ///< The keymap manager + DynamicVariables + *environmentVariables_; ///< The (dynamic) environment variables + TextAutoCompleteProviderList + *autoCompleteProviderList_; ///< The global autocomplete providers +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/exports.h b/lib/edbee-lib/edbee/exports.h new file mode 100644 index 00000000..c60047e6 --- /dev/null +++ b/lib/edbee-lib/edbee/exports.h @@ -0,0 +1,13 @@ +#pragma once + +#include <QtCore/qglobal.h> + +#ifdef EDBEE_SHARED +# ifdef EDBEE_EXPORT_SYMBOLS +# define EDBEE_EXPORT Q_DECL_EXPORT +# else +# define EDBEE_EXPORT Q_DECL_IMPORT +# endif +#else +# define EDBEE_EXPORT +#endif diff --git a/lib/edbee-lib/edbee/io/baseplistparser.cpp b/lib/edbee-lib/edbee/io/baseplistparser.cpp new file mode 100644 index 00000000..9484c0d6 --- /dev/null +++ b/lib/edbee-lib/edbee/io/baseplistparser.cpp @@ -0,0 +1,203 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include <QXmlStreamReader> + +#include "baseplistparser.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// The constructor for the parser +BasePListParser::BasePListParser() + : xml_(0) +{ +} + +/// the default desctructor +BasePListParser::~BasePListParser() +{ + delete xml_; +} + +/// Returns the last error message of the parsed file +QString BasePListParser::lastErrorMessage() const +{ + return lastErrorMessage_; +} + +/// Sets the last error message. +/// To correctly set the last error message while parsing please use raiseError +void BasePListParser::setLastErrorMessage(const QString &str) +{ + lastErrorMessage_ = str; +} + +/// Start the parsing of the plist. If it isn't a valid plist this method return +/// false. (it only checks and reads the existence of <plist>) +bool BasePListParser::beginParsing(QIODevice *device) +{ + lastErrorMessage_.clear(); + elementStack_.clear(); + + xml_ = new QXmlStreamReader(device); + if (readNextElement("plist")) + { + return true; + } + else + { + raiseError(QObject::tr("Start element not found!")); + return false; + } +} + +/// Closes the parsers +/// @return true if the parsing was succesful +bool BasePListParser::endParsing() +{ + bool result = !xml_->error(); + if (!result) + { + lastErrorMessage_ = QObject::tr("line %1: %2") + .arg(xml_->lineNumber()) + .arg(xml_->errorString()); + result = false; + } + delete xml_; + xml_ = 0; + return result; +} + +/// Call this method to raise an error and stop the xml parsing +/// @param str the error to raise +void BasePListParser::raiseError(const QString &str) +{ + xml_->raiseError(str); +} + +/// reads a list of qvariants +QList<QVariant> BasePListParser::readList() +{ + QList<QVariant> result; + QVariant value; + int level = currentStackLevel(); + while ((value = readNextPlistType(level)).isValid()) + { + result.append(value); + } + return result; +} + +/// reads a dictionary +QHash<QString, QVariant> BasePListParser::readDict() +{ + QHash<QString, QVariant> result; + int level = currentStackLevel(); + while (readNextElement("key", level)) + { + QString key = readElementText(); + QVariant data = readNextPlistType(); + result.insert(key, data); + } + return result; +} + +/// reads the next plist type +/// @param level the level we're currently parsing +QVariant BasePListParser::readNextPlistType(int level) +{ + if (readNextElement("", level)) + { + // reads a dictionary + if (xml_->name().compare(QLatin1String("dict"), Qt::CaseInsensitive) == 0) + { + return readDict(); + + // reads an array + } + else if (xml_->name().compare(QLatin1String("array"), Qt::CaseInsensitive) + == 0) + { + return readList(); + + // reads a string + } + else if (xml_->name().compare(QLatin1String("string"), Qt::CaseInsensitive) + == 0) + { + return readElementText(); + } + } + return QVariant(); +} + +/// Reads the next element and optionally expects it to be the given name +/// @param name the name taht's expected. Use '' to not check the name +/// @param minimum level the level the element should be. -1 means ignore this +/// argument +bool BasePListParser::readNextElement(const QString &name, int level) +{ + // qlog_info() << "* readNextElement(" << name << ","<<level<<")"; + + while (!xml_->atEnd()) + { + switch (xml_->readNext()) + { + case QXmlStreamReader::StartElement: + elementStack_.push(xml_->name().toString()); + // qlog_info() << "- <" << elementStack_.top() << " (" << + // elementStack_.size() << "/" << level << ")"; + + if (name.isEmpty()) + return true; // name doesn't matter + if (xml_->name().compare(name, Qt::CaseInsensitive) == 0) + return true; + xml_->raiseError(QObject::tr("Expected %1 while parsing").arg(name)); + return false; + + case QXmlStreamReader::EndElement: + // qlog_info() << "- </" << + // (elementStack_.isEmpty()?elementStack_.top():"") << " (" << + // elementStack_.size() << "/" << level << ")"; + if (!elementStack_.isEmpty()) + { + elementStack_.pop(); + } + + // end level detected + if (level >= 0 && elementStack_.size() < level) + { + return false; + } + break; + default: + // ignore + break; + } + } + return false; +} + +/// Reads the element text contents +QString BasePListParser::readElementText() +{ + QString result = xml_->readElementText(); + if (!elementStack_.isEmpty()) + { + elementStack_.pop(); + } + return result; +} + +/// returns the current stack-level +int BasePListParser::currentStackLevel() +{ + return elementStack_.size(); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/io/baseplistparser.h b/lib/edbee-lib/edbee/io/baseplistparser.h new file mode 100644 index 00000000..c7244731 --- /dev/null +++ b/lib/edbee-lib/edbee/io/baseplistparser.h @@ -0,0 +1,53 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QHash> +#include <QStack> +#include <QString> +#include <QVariant> + +class QIODevice; +class QXmlStreamReader; + +namespace edbee +{ + +/// A general plist xml-file parser +class EDBEE_EXPORT BasePListParser +{ +public: + BasePListParser(); + virtual ~BasePListParser(); + + QString lastErrorMessage() const; + + void setLastErrorMessage(const QString &str); + + bool beginParsing(QIODevice *device); + bool endParsing(); + + void raiseError(const QString &str); + + // general plist parsing + QList<QVariant> readList(); + QHash<QString, QVariant> readDict(); + QVariant readNextPlistType(int level = -1); + + bool readNextElement(const QString &name, int level = -1); + QString readElementText(); + + int currentStackLevel(); + +private: + QString lastErrorMessage_; ///< The last error message + QStack<QString> elementStack_; ///< The elements currently on the stack + QXmlStreamReader *xml_; ///< The reference of the xml reader +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/io/jsonparser.cpp b/lib/edbee-lib/edbee/io/jsonparser.cpp new file mode 100644 index 00000000..a216751c --- /dev/null +++ b/lib/edbee-lib/edbee/io/jsonparser.cpp @@ -0,0 +1,255 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include <QFile> +#include <QIODevice> +#include <QJsonArray> +#include <QJsonDocument> +#include <QJsonObject> + +#include "jsonparser.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// Constructs the jsonparser +JsonParser::JsonParser() + : errorMessage_() + , errorOffset_(0) + , errorLine_(0) + , errorColumn_(0) +{ +} + +/// The parser destructor +JsonParser::~JsonParser() {} + +/// loads the given keymap file returns true on success +/// @param filename the filename to parse +/// @return true if the file was parsed +bool JsonParser::parse(const QString &fileName) +{ + clearErrors(); + QFile file(fileName); + if (file.open(QIODevice::ReadOnly)) + { + bool result = parse(&file); + file.close(); + return result; + } + else + { + errorMessage_ = file.errorString(); + return false; + } +} + +/// Parses the given QIODevice +/// @param device the device to parse the json data +/// @return true if the file was successfully parsed +bool JsonParser::parse(QIODevice *device) +{ + clearErrors(); + bool opened = false; + if (!device->isOpen()) + { + if (!device->open(QIODevice::ReadOnly)) + { + errorMessage_ = device->errorString(); + return false; + } + opened = true; + } + + QByteArray bytesIn = device->readAll(); + bool result = parse(bytesIn); + if (opened) + device->close(); + return result; +} + +/// opens the given bytes as a json document +/// @param bytesIn the bytes of the Json document +/// @return true if the data was succeeful parsed +bool JsonParser::parse(const QByteArray &bytesIn) +{ + clearErrors(); + QByteArray bytes = stripCommentsFromJson(bytesIn); + QJsonParseError parseResult; + QJsonDocument document = QJsonDocument::fromJson(bytes, &parseResult); + if (parseResult.error != QJsonParseError::NoError) + { + errorMessage_ = parseResult.errorString(); + errorOffset_ = parseResult.offset; + + // convert the offset to a column and offset + errorLine_ = errorColumn_ = 0; + for (int i = 0, cnt = qMin(errorOffset_, bytes.size()); i < cnt; ++i) + { + ++errorColumn_; + if (bytes.at(i) == '\n') + { + errorColumn_ = 0; + ++errorLine_; + } + } + return false; + } + result_ = document.toVariant(); + return true; +} + +/// Returns the result of the json parsing +QVariant JsonParser::result() +{ + return result_; +} + +/// Clears the error flags/variables +void JsonParser::clearErrors() +{ + errorMessage_.clear(); + errorOffset_ = errorLine_ = errorColumn_ = 0; +} + +/// Returns the errormessage +QString JsonParser::errorMessage() const +{ + return errorMessage_; +} + +/// returns the line number of the error +int JsonParser::errorLine() const +{ + return errorLine_; +} + +/// Returns the error column +int JsonParser::errorColumn() const +{ + return errorColumn_; +} + +/// Returns the full eror message +QString JsonParser::fullErrorMessage() const +{ + if (!errorLine()) + return errorMessage(); + return QObject::tr("%1 @ line %2").arg(errorMessage()).arg(errorLine()); +} + +/// reads all bytes from the io device, while removing comments and keeping the +/// number of lines quick and dirty 'lexer' that replaces every comment by +/// spaces (so the number of charactes keeps the same) +QByteArray JsonParser::stripCommentsFromJson(const QByteArray &bytesIn) +{ + QByteArray result; + enum + { + StateNormal, + StateString, + StateLineComment, + StateBlockComment + } state + = StateNormal; + for (int i = 0, cnt = bytesIn.size(); i < cnt; ++i) + { + char c = bytesIn.at(i); + switch (state) + { + case StateNormal: + // a '/' + if (c == '/') + { + char c2 = ((i + 1) < cnt) ? bytesIn.at(i + 1) : 0; + if (c2 == '/') + { + i++; + state = StateLineComment; + result.append(' '); + result.append(' '); + break; + } + else if (c2 == '*') + { + i++; + state = StateBlockComment; + result.append(' '); + result.append(' '); + break; + } + // start of a string + } + else if (c == '\"') + { + state = StateString; + } + result.append(c); + break; + + case StateString: + if (c == '\\') + { + char c2 = ((i + 1) < cnt) ? bytesIn.at(i + 1) : 0; + if (c2 == '\"') + { + i++; + result.append('\\'); + result.append('\"'); + break; + } + } + else if (c == '\"') + { + state = StateNormal; + } + result.append(c); + break; + + case StateLineComment: + if (c == '\r') + { + result.append('\r'); + } + else if (c == '\n') + { + result.append(c); + state = StateNormal; + } + else + { + result.append(' '); + } + break; + + case StateBlockComment: + if (c == '*') + { + char c2 = ((i + 1) < cnt) ? bytesIn.at(i + 1) : 0; + if (c2 == '/') + { + i++; + state = StateNormal; + result.append(' '); + } + result.append(' '); + } + else if (c == '\r' || c == '\n') + { + result.append(c); + } + else + { + result.append(' '); + } + break; + } + } + return result; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/io/jsonparser.h b/lib/edbee-lib/edbee/io/jsonparser.h new file mode 100644 index 00000000..7143f8fb --- /dev/null +++ b/lib/edbee-lib/edbee/io/jsonparser.h @@ -0,0 +1,55 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QVariant> + +class QIODevice; + +namespace edbee +{ + +/// A Json Parser that supports strings in json sources! +/// standard json doesn't support comments. This class strips the comments +/// before passing it to qt the comments are replaced by spaces, this way the +/// line-numbers and column numbers will stay the same +class EDBEE_EXPORT JsonParser +{ +public: + JsonParser(); + virtual ~JsonParser(); + + bool parse(const QString &fileName); + bool parse(QIODevice *device); + bool parse(const QByteArray &bytesIn); + + QVariant result(); + + void clearErrors(); + + QString errorMessage() const; + int errorLine() const; + int errorColumn() const; + + QString fullErrorMessage() const; + +protected: + QByteArray stripCommentsFromJson(const QByteArray &bytesIn); + +private: + QString errorMessage_; ///< The error message + int errorOffset_; ///< The character offset of the error + int errorLine_; ///< The line number of the error + int errorColumn_; ///< The column number of the error + + QVariant + result_; ///< variant is the easiest format to play around with in Qt. The + ///< result will be QVariantMap (no hash!) or QVariantArray +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/io/keymapparser.cpp b/lib/edbee-lib/edbee/io/keymapparser.cpp new file mode 100644 index 00000000..31e7c639 --- /dev/null +++ b/lib/edbee-lib/edbee/io/keymapparser.cpp @@ -0,0 +1,140 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "keymapparser.h" + +#include <QFile> +#include <QIODevice> +#include <QJsonArray> +#include <QJsonDocument> +#include <QJsonObject> + +#include "edbee/io/jsonparser.h" +#include "edbee/models/texteditorkeymap.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// constructs the keymapparser +KeyMapParser::KeyMapParser() + : parser_(0) +{ + parser_ = new JsonParser(); +} + +/// destructs the keymapparser +KeyMapParser::~KeyMapParser() +{ + delete parser_; +} + +/// loads the given keymap file returns true on success +/// @param filename the file to parse +/// @param keyMap the keymapfile to put the results in +/// @return true on success +bool KeyMapParser::parse(const QString &filename, TextEditorKeyMap *keyMap) +{ + if (parser_->parse(filename)) + { + return parse(parser_->result(), keyMap); + } + buildErrorMessageFromParser(); + return false; +} + +bool KeyMapParser::parse(QIODevice *device, TextEditorKeyMap *keyMap) +{ + if (parser_->parse(device)) + { + return parse(parser_->result(), keyMap); + } + buildErrorMessageFromParser(); + return false; +} + +bool KeyMapParser::parse(const QByteArray &bytes, TextEditorKeyMap *keyMap) +{ + if (parser_->parse(bytes)) + { + return parse(parser_->result(), keyMap); + } + buildErrorMessageFromParser(); + return false; +} + +/// Parsers the variant map so the keymapManager is filled +/// @param variant the variant to parse +/// @param manager the manager to parse +/// @param manager the keymap manager +bool KeyMapParser::parse(const QVariant &variant, TextEditorKeyMap *keyMap) +{ + errorMessage_.clear(); + + // next read all exteniosn + QVariantList list = variant.toList(); + if (list.isEmpty()) + { + errorMessage_ = QObject::tr("No data found!"); + return false; + } + + foreach (QVariant var, list) + { + QVariantMap obj = var.toMap(); + if (obj.isEmpty()) + { + errorMessage_.append(QObject::tr("Expected object in keymap\n")); + } + else + { + parseBindingBlock(obj, keyMap); + } + } + return true; +} + +/// Returns the error message +QString KeyMapParser::errorMessage() const +{ + return errorMessage_; +} + +void KeyMapParser::buildErrorMessageFromParser() +{ + errorMessage_ = parser_->fullErrorMessage(); +} + +/// parses the given block +bool KeyMapParser::parseBindingBlock(const QVariantMap &valueObject, + TextEditorKeyMap *keyMap) +{ + QVariantMap context = valueObject.value("context").toMap(); + QVariantList bindings = valueObject.value("bindings").toList(); + + // add all bindings + foreach (QVariant bindingItem, bindings) + { + QVariantMap binding = bindingItem.toMap(); + QString keys = binding.value("keys").toString(); + QString command = binding.value("command").toString(); + + if (keys.size() > 0 && command.size() > 0) + { + + /// TODO: add binding to keymap + + if (!keyMap->add(command, keys)) + { + errorMessage_.append( + QObject::tr("Invalid keysequence used %1\n").arg(keys)); + } + } + } + return true; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/io/keymapparser.h b/lib/edbee-lib/edbee/io/keymapparser.h new file mode 100644 index 00000000..c66f5f1e --- /dev/null +++ b/lib/edbee-lib/edbee/io/keymapparser.h @@ -0,0 +1,76 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QHash> +#include <QString> +#include <QVariant> + +class QIODevice; + +namespace edbee +{ + +class JsonParser; +class TextEditorKeyMap; + +/// This emthod method can be used to load text-editor keymaps +/// +/// The json file has got the following format +/// +/// [ +/// { +/// "context": { +/// "name": "texteditor", // the part of the appliction these +/// bindigns used for. +/// ... +/// }, +/// "defaults": { +/// "context": [ { // the context defined here is +/// coppied to alle keybindings +/// {"key": "scope", "value": "source.php"}, +/// ... +/// }] +/// }, +/// "bindings": [ +/// { "keys": "Ctrl+M,U", "command": "display_undo_stack" }, // +/// todo, add scopes to keybindings +/// .... +/// ] +/// }, +/// ... +/// ] +/// +/// Context is still not completely thought over but it is used to make certain +/// keybindings context specific. Think for example of keybindings only used for +/// given language +/// +class EDBEE_EXPORT KeyMapParser +{ +public: + KeyMapParser(); + virtual ~KeyMapParser(); + + bool parse(const QString &filename, TextEditorKeyMap *keyMap); + bool parse(QIODevice *device, TextEditorKeyMap *keyMap); + bool parse(const QByteArray &bytes, TextEditorKeyMap *keyMap); + bool parse(const QVariant &variant, TextEditorKeyMap *keyMap); + + QString errorMessage() const; + +private: + void buildErrorMessageFromParser(); + + bool parseBindingBlock(const QVariantMap &valueObject, + TextEditorKeyMap *keyMap); + + QString errorMessage_; ///< The current error message + JsonParser *parser_; ///< The json parser +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/io/textdocumentserializer.cpp b/lib/edbee-lib/edbee/io/textdocumentserializer.cpp new file mode 100644 index 00000000..5ac2c6e6 --- /dev/null +++ b/lib/edbee-lib/edbee/io/textdocumentserializer.cpp @@ -0,0 +1,268 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "textdocumentserializer.h" + +#include <QBuffer> +#include <QIODevice> +#include <QTextCodec> + +#include "edbee/models/textdocument.h" +#include "edbee/util/lineending.h" +#include "edbee/util/textcodecdetector.h" +#include "edbee/util/textcodec.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +TextDocumentSerializer::TextDocumentSerializer(TextDocument *textDocument) + : textDocumentRef_(textDocument) + , blockSize_(8192) + , filterRef_(0) +{ +} + +/// loads the file data for the given (opened) ioDevice +/// @return true on success, +bool TextDocumentSerializer::loadWithoutOpening(QIODevice *ioDevice) +{ + errorString_.clear(); + + // start raw appending + textDocumentRef_->rawAppendBegin(); + + // read the file in blocks of 4096 bytes + TextCodec *detectedCodec = 0; + const LineEnding *detectedLineEnding = 0; + + QTextDecoder *textDecoder = 0; + + // read the buffer + QByteArray bytes(blockSize_ + 1, 0); + QString remainingBuffer; + + /// TODO: atEnd doesn't seem to work !?! + /// TODO: implement isStopRequested to stop loading if required + while (/*ioDeviceRef_->atEnd() &&*/ true /*!isStopRequested()*/) + { + + int bytesRead = ioDevice->read(bytes.data(), blockSize_ - 1); + if (bytesRead > 0) + { + bytes[bytesRead + 1] = 0; // 0 terminate the read bytes + + // In the first block we're need to detect the correct encoding + if (!detectedCodec) + { + TextCodecDetector codecDetector(bytes.constData(), bytesRead); + detectedCodec = codecDetector.detectCodec(); + Q_ASSERT(detectedCodec); + textDecoder = detectedCodec->makeDecoder(); + } + + // convert the bytes to a string + QString newBuffer = textDecoder->toUnicode(bytes.constData(), bytesRead); + + // next detect the line ending. When no line ending is detected 0 is + // returned! + if (!detectedLineEnding) + { + detectedLineEnding = LineEnding::detect(newBuffer); + } + + // when we detected a line ending + if (detectedLineEnding) + { + remainingBuffer.append(newBuffer); + remainingBuffer = appendBufferToDocument(remainingBuffer); + // else we need to append it to the rest + } + else + { + remainingBuffer.append(newBuffer); + } + } + + // we're done + if (bytesRead <= 0) + break; + } + + // When no line ending could be detected, take the unix line ending + if (!detectedLineEnding) + detectedLineEnding + = LineEnding::get(LineEnding::UnixType); // fallback to unix + if (!detectedCodec) + { + detectedCodec = TextCodecDetector::globalPreferedCodec(); + } + + // set the detected items + delete textDecoder; + textDocumentRef_->setEncoding(detectedCodec); + textDocumentRef_->setLineEnding(detectedLineEnding); + + // append the remaing line ending + remainingBuffer = appendBufferToDocument(remainingBuffer); + // fileDocument_->appendLine( remainingBuffer, + // FsFileDocument::Line::StateUnkown ) ; // append the last line + + // next detect the file type + // FileType *fileType = app()->fileTypeManager()->detectFileType( + // virtualFile()->fileName() ); fileDocument_->setFileType( fileType ); + + // start raw appending + textDocumentRef_->rawAppendEnd(); + return true; +} + +/// executes the file loading for the given (unopened) ioDevice +/// @return true on success, +bool TextDocumentSerializer::load(QIODevice *ioDevice) +{ + errorString_.clear(); + + // open the device + if (!ioDevice->open(QIODevice::ReadOnly)) + { + errorString_ = ioDevice->errorString(); + return false; + } + bool result = loadWithoutOpening(ioDevice); + ioDevice->close(); + + return result; +} + +/// loads the file data for the given (opened) ioDevice +/// @return true on success +bool TextDocumentSerializer::saveWithoutOpening(QIODevice *ioDevice) +{ + errorString_.clear(); + + // get the codec en encoder + TextCodec *codec = textDocumentRef_->encoding(); + QTextEncoder *encoder = codec->makeEncoder(); + QString lineEnding(textDocumentRef_->lineEnding()->chars()); + + // work via a buffer + QByteArray buffer; + for (int lineIdx = 0, cnt = textDocumentRef_->lineCount(); lineIdx < cnt; + ++lineIdx) + { + QString line = textDocumentRef_->lineWithoutNewline(lineIdx); + if (filter()) + { + // if this line is not selected move to the next + if (!filter()->saveLineSelector(this, lineIdx, line)) + { + continue; + } + } + buffer.append(encoder->fromUnicode(line)); + + // no newline after the last line + if (lineIdx + 1 < cnt) + { + buffer.append(encoder->fromUnicode(lineEnding)); + } + + // flush the bufer + if (buffer.size() >= blockSize_) + { + if (ioDevice->write(buffer) < 0) + { + errorString_ = ioDevice->errorString(); + buffer.clear(); + break; + } + buffer.clear(); + } + } + + // flush the last part of the buffer + if (buffer.size()) + { + if (ioDevice->write(buffer) < 0) + { + errorString_ = ioDevice->errorString(); + } + buffer.clear(); + } + delete encoder; + return errorString_.isEmpty(); +} + +/// Saves the given document to the iodevice +/// This method opens and closes the ioDevice.. +bool TextDocumentSerializer::save(QIODevice *ioDevice) +{ + errorString_.clear(); + + // open the device + if (!ioDevice->open(QIODevice::WriteOnly)) + { + errorString_ = ioDevice->errorString(); + return false; + } + + bool result = saveWithoutOpening(ioDevice); + ioDevice->close(); + + return result; +} + +/// This method appends the given lines to the document +/// @param strIn the string to append +/// @retirn the remaining last line +QString TextDocumentSerializer::appendBufferToDocument(const QString &strIn) +{ + // The code blow is to translate all newlines to the correct format + int lastPos = 0; + for (int pos = 0, len = strIn.length(); pos < len; ++pos) + { + + // we found an 'wrong' endline + QChar c = strIn.at(pos); + if (c == '\r') + { + // append the buffer + if (pos - lastPos - 1 >= 0) + { + textDocumentRef_->rawAppend(strIn.data() + lastPos, pos - lastPos); + lastPos = pos; + } + + // lookahead to check if it's a '\n' + if (pos + 1 < strIn.length()) + { + pos += 1; + QChar c2 = strIn.at(pos); + if (c2 != '\n') + { + pos -= 1; + } + lastPos = pos; + // textDocumentRef_->rawAppend('\n'); + // we need to process the last line-end (later) + } + else + { + return "\r"; + } + } + } + + if (strIn.length() - lastPos > 0) + { + textDocumentRef_->rawAppend(strIn.data() + lastPos, + strIn.length() - lastPos); + } + return ""; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/io/textdocumentserializer.h b/lib/edbee-lib/edbee/io/textdocumentserializer.h new file mode 100644 index 00000000..78a71f34 --- /dev/null +++ b/lib/edbee-lib/edbee/io/textdocumentserializer.h @@ -0,0 +1,63 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QString> + +class QIODevice; + +namespace edbee +{ + +class TextDocument; +class TextDocumentSerializer; + +class EDBEE_EXPORT TextDocumentSerializerFilter +{ +public: + /// A special filter class to filter lines while saving + /// @param serializer the text serialzer + /// @param lineIdx the line index that needs to be saved + /// @param line the line that's save + /// @return true if the line needs to be selected. return false to skip the + /// line + virtual bool saveLineSelector(TextDocumentSerializer *serializer, int lineIdx, + QString &line) + = 0; +}; + +/// A class used to load/save a text-file from and to an IODevice +class EDBEE_EXPORT TextDocumentSerializer +{ +public: + TextDocumentSerializer(TextDocument *textDocument); + + bool loadWithoutOpening(QIODevice *ioDevice); + bool load(QIODevice *ioDevice); + + bool saveWithoutOpening(QIODevice *ioDevice); + bool save(QIODevice *ioDevice); + + QString errorString() { return errorString_; } + void setFilter(TextDocumentSerializerFilter *filter) { filterRef_ = filter; } + TextDocumentSerializerFilter *filter() { return filterRef_; } + +private: + QString appendBufferToDocument(const QString &strIn); + +private: + TextDocument *textDocumentRef_; ///< The reference to the textdocument + int blockSize_; ///< The block-size to read/write. you must NOT makes this to + ///< small.. The first block is used to detected the + ///< encoding!! + QString + errorString_; ///< The last error (This is reset when calling load/save) + TextDocumentSerializerFilter *filterRef_; ///< The line filter +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/io/tmlanguageparser.cpp b/lib/edbee-lib/edbee/io/tmlanguageparser.cpp new file mode 100644 index 00000000..cdca5043 --- /dev/null +++ b/lib/edbee-lib/edbee/io/tmlanguageparser.cpp @@ -0,0 +1,299 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "tmlanguageparser.h" + +#include <QDir> +#include <QFile> +#include <QList> +#include <QHash> +#include <QVariant> +#include <QXmlStreamReader> + +#include "edbee/io/baseplistparser.h" +#include "edbee/io/jsonparser.h" +#include "edbee/models/textgrammar.h" +#include "edbee/edbee.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// Parses a textmate language +TmLanguageParser::TmLanguageParser() {} + +/// returns the last error message +QString TmLanguageParser::lastErrorMessage() const +{ + return lastErrorMessage_; +} + +/// Sets the last error message +void TmLanguageParser::setLastErrorMessage(const QString &str) +{ + lastErrorMessage_ = str; +} + +/// Parses a PList (XML Grammar file definition) +TextGrammar *TmLanguageParser::parsePlist(QIODevice *device) +{ + TextGrammar *result = nullptr; + + BasePListParser plistParser; + if (plistParser.beginParsing(device)) + { + QVariant plist = plistParser.readNextPlistType(); + result = createLanguage(plist); + } + + if (!plistParser.endParsing()) + { + delete result; + result = nullptr; + } + + // returns the language + return result; +} + +/// Parses a JSON grammar file definition +TextGrammar *TmLanguageParser::parseJson(QIODevice *device) +{ + TextGrammar *result = nullptr; + + JsonParser jsonParser; + if (jsonParser.parse(device)) + { + // QVariant plist = readNextPlistType( ); + QVariant parseResult = jsonParser.result(); + result = createLanguage(parseResult); + } + + return result; +} + +/// reads the content of a single file +/// @param device the device to read from. The device NEEDS to be open!! +/// @param json use the json parser +/// @return the language grammar or nullptr on error +TextGrammar *TmLanguageParser::parse(QIODevice *device, bool json) +{ + if (json) + { + return parseJson(device); + } + else + { + return parsePlist(device); + } +} + +/// Parses the given file +TextGrammar *TmLanguageParser::parse(QFile &file) +{ + if (file.open(QIODevice::ReadOnly)) + { + TextGrammar *result = parse(&file, file.fileName().endsWith(".json")); + file.close(); + return result; + } + else + { + setLastErrorMessage(file.errorString()); + return nullptr; + } +} + +/// parses the given grammar file +/// @param file the file to read +/// @return the language grammar or 0 on error +TextGrammar *TmLanguageParser::parse(const QString &fileName) +{ + QFile file(fileName); + return parse(file); +} + +/// sets the captures +void TmLanguageParser::addCapturesToGrammarRule( + TextGrammarRule *rule, QHash<QString, QVariant> captures, bool endCapture) +{ + if (captures.isEmpty()) + { + return; + } + QHashIterator<QString, QVariant> itr(captures); + while (itr.hasNext()) + { + itr.next(); + QHash<QString, QVariant> fields = itr.value().toHash(); + int keyIndex = itr.key().toInt(); + QString name = fields.value("name").toString(); + if (endCapture) + { + rule->setEndCapture(keyIndex, name); + } + else + { + rule->setCapture(keyIndex, name); + } + } +} + +/// Adds all patterns to the grammar rules +void TmLanguageParser::addPatternsToGrammarRule(TextGrammarRule *rule, + QList<QVariant> patterns) +{ + foreach (QVariant pattern, patterns) + { + TextGrammarRule *childRule = createGrammarRule(rule->grammar(), pattern); + if (childRule) + { + rule->giveRule(childRule); + } + } +} + +/// creates a grammar rue +TextGrammarRule *TmLanguageParser::createGrammarRule(TextGrammar *grammar, + const QVariant &data) +{ + QHash<QString, QVariant> map = data.toHash(); + QString match = map.value("match").toString(); + QString include = map.value("include").toString(); + QString begin = map.value("begin").toString(); + QString name = map.value("name").toString(); + + // match filled? + if (!match.isEmpty()) + { + TextGrammarRule *rule + = TextGrammarRule::createSingleLineRegExp(grammar, name, match); + QHash<QString, QVariant> captures = map.value("captures").toHash(); + addCapturesToGrammarRule(rule, captures); + return rule; + } + else if (!include.isEmpty()) + { + return TextGrammarRule::createIncludeRule(grammar, include); + } + else if (!begin.isEmpty()) + { + QString end = map.value("end").toString(); + + // TODO: contentScopeName + QString contentScope = name; + TextGrammarRule *rule = TextGrammarRule::createMultiLineRegExp( + grammar, name, contentScope, begin, end); + + // add the patterns + QList<QVariant> patterns = map.value("patterns").toList(); + addPatternsToGrammarRule(rule, patterns); + + if (map.contains("captures")) + { + QHash<QString, QVariant> captures = map.value("captures").toHash(); + addCapturesToGrammarRule(rule, captures); + addCapturesToGrammarRule(rule, captures, true); + } + if (map.contains("beginCaptures")) + { + QHash<QString, QVariant> captures = map.value("beginCaptures").toHash(); + addCapturesToGrammarRule(rule, captures); + } + if (map.contains("endCaptures")) + { + QHash<QString, QVariant> endCaptures = map.value("endCaptures").toHash(); + addCapturesToGrammarRule(rule, endCaptures, true); + } + return rule; + } + else + { + TextGrammarRule *rule = TextGrammarRule::createRuleList(grammar); + + // add the patterns + QList<QVariant> patterns = map.value("patterns").toList(); + addPatternsToGrammarRule(rule, patterns); + + return rule; + } + + // <key>angle_brackets</key> + // <dict> + // <key>begin</key> + // <string><</string> + // <key>end</key> + // <string>></string> + // <key>name</key> + // <string>meta.angle-brackets.c++</string> + // <key>patterns</key> + // <array> + // <dict> + // <key>include</key> + // <string>#angle_brackets</string> + // </dict> + // <dict> + // <key>include</key> + // <string>$base</string> + // </dict> + // </array> + // </dict> +} + +// parses the given language +TextGrammar *TmLanguageParser::createLanguage(QVariant &data) +{ + QHash<QString, QVariant> hashMap = data.toHash(); + QString name = hashMap.value("name").toString(); + QString scopeName = hashMap.value("scopeName").toString(); + QString uuid = hashMap.value("uuid").toString(); + + if (name.isEmpty() || scopeName.isEmpty()) + { + setLastErrorMessage("Name or scope is empty. Cannot parse language!"); + return nullptr; + } + + // construct the grammar + TextGrammar *grammar = new TextGrammar(scopeName, name); + + // and get the main patterns + // construct the main rule + TextGrammarRule *mainRule + = TextGrammarRule::createMainRule(grammar, scopeName); + grammar->giveMainRule(mainRule); + + QList<QVariant> patterns = hashMap.value("patterns").toList(); + addPatternsToGrammarRule(mainRule, patterns); + + // get the repos + QHash<QString, QVariant> repos = hashMap.value("repository").toHash(); + QHashIterator<QString, QVariant> itr(repos); + while (itr.hasNext()) + { + itr.next(); + TextGrammarRule *rule = createGrammarRule(grammar, itr.value()); + if (rule) + { + grammar->giveToRepos(itr.key(), rule); + } + else + { + qlog_warn() << "Error create grammar rule!"; + } + } + + // add the file types + QStringList fileTypes = hashMap.value("fileTypes").toStringList(); + foreach (QString fileType, fileTypes) + { + grammar->addFileExtension(fileType); + } + + return grammar; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/io/tmlanguageparser.h b/lib/edbee-lib/edbee/io/tmlanguageparser.h new file mode 100644 index 00000000..e6822357 --- /dev/null +++ b/lib/edbee-lib/edbee/io/tmlanguageparser.h @@ -0,0 +1,57 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QList> +#include <QMap> +#include <QStack> +#include <QVariant> + +class QFile; +class QIODevice; +class QXmlStreamReader; + +namespace edbee +{ + +class TextGrammar; +class TextGrammarManager; +class TextGrammarRule; + +/// For parsing a Textmate Language +class EDBEE_EXPORT TmLanguageParser +{ +public: + TmLanguageParser(); + TextGrammar *parsePlist(QIODevice *device); + TextGrammar *parseJson(QIODevice *device); + + TextGrammar *parse(QIODevice *device, bool json = false); + TextGrammar *parse(QFile &file); + TextGrammar *parse(const QString &fileName); + + QString lastErrorMessage() const; + +protected: + void setLastErrorMessage(const QString &str); + + void addCapturesToGrammarRule(TextGrammarRule *rule, + QHash<QString, QVariant> captures, + bool endCapture = false); + void addPatternsToGrammarRule(TextGrammarRule *rule, + QList<QVariant> patterns); + + TextGrammarRule *createGrammarRule(TextGrammar *grammar, + const QVariant &data); + TextGrammar *createLanguage(QVariant &data); + +private: + QString lastErrorMessage_; ///< The last error message +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/io/tmthemeparser.cpp b/lib/edbee-lib/edbee/io/tmthemeparser.cpp new file mode 100644 index 00000000..3d9a2e0e --- /dev/null +++ b/lib/edbee-lib/edbee/io/tmthemeparser.cpp @@ -0,0 +1,156 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "edbee/views/texttheme.h" +#include "tmthemeparser.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +TmThemeParser::TmThemeParser() {} + +/// parses theme color +QColor TmThemeParser::parseThemeColor(const QString &rgba) const +{ + // check if there's an alpha component + if (rgba.length() == 9) + { + QString argb = "#"; + argb.append(rgba.right(2)); // append the alpha part + argb.append(rgba.mid(1, 6)); // append the color part + return QColor(argb); + // return the color + } + else + { + return QColor(rgba); + } +} + +/// reads the content of a single file +/// @param device the device to read from. The device NEEDS to be open!! +/// @return the language grammar or 0 on error +TextTheme *TmThemeParser::readContent(QIODevice *device) +{ + TextTheme *result = 0; + + if (beginParsing(device)) + { + QVariant plist = readNextPlistType(); + result = createTheme(plist); + } + + if (!endParsing()) + { + delete result; + result = 0; + } + + // returns the language + return result; +} + +/// fetches the settings from the hashmap and puts them in the theme file +void TmThemeParser::fillRuleSettings(TextTheme *theme, + const QHash<QString, QVariant> &settings) +{ + // force an opaque background color + QColor background = parseThemeColor(settings.value("background").toString()); + if (background.alphaF() < 1.0) + { + background.setRedF(background.redF() * background.alphaF()); + background.setGreenF(background.greenF() * background.alphaF()); + background.setBlueF(background.blueF() * background.alphaF()); + background.setAlphaF(1.0); + } + theme->setBackgroundColor(background); + + theme->setForegroundColor( + parseThemeColor(settings.value("foreground").toString())); + theme->setCaretColor(parseThemeColor(settings.value("caret").toString())); + theme->setInvisiblesColor( + parseThemeColor(settings.value("invisibles").toString())); + theme->setLineHighlightColor( + parseThemeColor(settings.value("lineHighlight").toString())); + theme->setSelectionColor( + parseThemeColor(settings.value("selection").toString())); + theme->setFindHighlightForegroundColor( + parseThemeColor(settings.value("findHighlightForeground").toString())); + theme->setFindHighlightBackgroundColor( + parseThemeColor(settings.value("findHighlight").toString())); + theme->setSelectionBorderColor( + parseThemeColor(settings.value("selectionBorder").toString())); + theme->setActiveGuideColor( + parseThemeColor(settings.value("activeGuide").toString())); + theme->setBracketForegroundColor( + parseThemeColor(settings.value("bracketsForeground").toString())); + theme->setBracketOptions(settings.value("bracketsOptions").toString()); + theme->setBracketContentsForegroundColor( + parseThemeColor(settings.value("bracketContentsForeground").toString())); + theme->setBracketContentsOptions( + settings.value("bracketContentsOptions").toString()); + theme->setTagsOptions(settings.value("tagsOptions").toString()); +} + +/// parses all rules +void TmThemeParser::parseRules(TextTheme *theme, const QList<QVariant> &rules) +{ + foreach (const QVariant &rule, rules) + { + QHash<QString, QVariant> hashMap = rule.toHash(); + QString name = hashMap.value("name").toString(); + QString scope = hashMap.value("scope").toString(); + QString comment = hashMap.value("comment").toString(); + QHash<QString, QVariant> settings = hashMap.value("settings").toHash(); + + // no name or scope then it's the settings rule + if (name.isEmpty() && scope.isEmpty()) + { + fillRuleSettings(theme, settings); // yes it's true settings/settings ! + } + else + { + QColor foreground + = parseThemeColor(settings.value("foreground").toString()); + QColor background + = parseThemeColor(settings.value("background").toString()); + QString fontStyle(settings.value("fontStyle").toString()); + bool bold = fontStyle.contains("bold"); + bool italic = fontStyle.contains("italic"); + bool underline = fontStyle.contains("underline"); + + TextThemeRule *rule = new TextThemeRule( + name, scope, foreground, background, bold, italic, underline); + theme->giveThemeRule(rule); + } + } +} + +/// Reads and parsers the theme +TextTheme *TmThemeParser::createTheme(QVariant &data) +{ + QHash<QString, QVariant> hashMap = data.toHash(); + + QString name = hashMap.value("name").toString(); + QString uuid = hashMap.value("uuid").toString(); + + if (name.isEmpty()) + { + raiseError("Name is empty. Cannot parse theme!"); + return 0; + } + + TextTheme *theme = new TextTheme(); + + // fill the settings + QList<QVariant> rules = hashMap.value("settings").toList(); + parseRules(theme, rules); + + return theme; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/io/tmthemeparser.h b/lib/edbee-lib/edbee/io/tmthemeparser.h new file mode 100644 index 00000000..996f4368 --- /dev/null +++ b/lib/edbee-lib/edbee/io/tmthemeparser.h @@ -0,0 +1,37 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QHash> +#include <QString> +#include <QVariant> + +#include "baseplistparser.h" + +namespace edbee +{ + +class TextTheme; + +class EDBEE_EXPORT TmThemeParser : public BasePListParser +{ +public: + TmThemeParser(); + + QColor parseThemeColor(const QString &color) const; + + TextTheme *readContent(QIODevice *device); + +protected: + void fillRuleSettings(TextTheme *theme, + const QHash<QString, QVariant> &settings); + void parseRules(TextTheme *theme, const QList<QVariant> &settings); + TextTheme *createTheme(QVariant &data); +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/lexers/grammartextlexer.cpp b/lib/edbee-lib/edbee/lexers/grammartextlexer.cpp new file mode 100644 index 00000000..c4820a37 --- /dev/null +++ b/lib/edbee-lib/edbee/lexers/grammartextlexer.cpp @@ -0,0 +1,616 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "grammartextlexer.h" + +#include <limits> +#include <QStack> + +#include "edbee/models/textgrammar.h" +#include "edbee/models/textdocument.h" +#include "edbee/models/textdocumentscopes.h" +#include "edbee/util/regexp.h" +#include "edbee/edbee.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// Constructs the grammar textlexer +/// @param scopes a reference to the scopes model +GrammarTextLexer::GrammarTextLexer(TextDocumentScopes *scopes) + : TextLexer(scopes) + , lineRangeList_(0) +{ + setGrammar(Edbee::instance()->grammarManager()->defaultGrammar()); +} + +/// The destructor +GrammarTextLexer::~GrammarTextLexer() +{ + delete lineRangeList_; // just in case +} + +/// This method builds the end-regexp for the given multi-line-regexp +/// @param startRegExp the start regexp +/// @param endRegExStringIn the end regexp string +RegExp *GrammarTextLexer::createEndRegExp(RegExp *startRegExp, + const QString &endRegExpStringIn) +{ + // build the end-regexp string + QString endRegExpString; + RegExp matcher("\\\\(\\d+)"); // \(d+) + int lastPos = 0; + while (matcher.indexIn(endRegExpStringIn, lastPos) >= 0) + { + int len = matcher.len(); + int pos = matcher.pos(); + + // append the previous string + if (pos - lastPos > 0) + { + endRegExpString.append(endRegExpStringIn.mid(lastPos, pos - lastPos)); + } + + // append the 'match' + int nr = matcher.cap(1).toInt(); + if (nr >= 0) + { + endRegExpString.append(startRegExp->cap(nr)); + } + lastPos = pos + len + 1; + } + endRegExpString.append(endRegExpStringIn.mid(lastPos)); + return new RegExp(endRegExpString); +} + +/// Search the next grammar rule +/// @param (out) foundRegExp the found regexp +/// @param (out) foundPosition the found position +/// @return the grammarRule found +void GrammarTextLexer::findNextGrammarRule( + const QString &line, int offsetInLine, TextGrammarRule *activeRule, + TextGrammarRule *&foundRule, RegExp *&foundRegExp, int &foundPosition) +{ + + // next iterate over all rules and find the rule with the lowest offset + QStack<TextGrammarRule::Iterator *> ruleIterators; + ruleIterators.push(activeRule->createIterator()); + while (!ruleIterators.isEmpty()) + { + + while (ruleIterators.top()->hasNext()) + { + TextGrammarRule *rule + = ruleIterators.top()->next(); // activeRule->rule(i); + + bool processNewRule = false; + do + { + processNewRule = false; + // qlog_info() << " - " << ":" << rule->toString(false); + switch (rule->instruction()) + { + case TextGrammarRule::SingleLineRegExp: + case TextGrammarRule::MultiLineRegExp: { + // only use this match if the offset < foundPosition + int pos = rule->matchRegExp()->indexIn(line, offsetInLine); + if (pos >= 0) + { + if (pos < foundPosition) + { + foundRule = rule; + foundRegExp = rule->matchRegExp(); + foundPosition = pos; + } + } + break; + } + + // and include rule + case TextGrammarRule::IncludeCall: { + TextGrammarRule *includedRule = findIncludeGrammarRule(rule); + if (includedRule) + { + // a rule list, append the iterator + if (includedRule->isRuleList() || includedRule->isMainRule()) + { + ruleIterators.push_back(includedRule->createIterator()); + + // a normal rule? We need to process this one again + } + else + { + rule = includedRule; + processNewRule = true; + } + } + else + { + qlog_warn() << "ERROR, include rule" << rule->includeName() + << "not found!"; + } + break; + } + case TextGrammarRule::MainRule: + Q_ASSERT(false && "a mainrule as child is not allowed!"); + break; + case TextGrammarRule::RuleList: + Q_ASSERT(false && "a rule list is not directly allowed!"); + break; + default: + Q_ASSERT(false && "unkown rule"); + } + } while (processNewRule); + } // while hasNext + + delete ruleIterators.pop(); + + } // while ruleIterators +} + +/// This method processes the captures and adds them to the active line +/// @param foundRegExp the found regexp +/// @param foundCaptures the found captures +void GrammarTextLexer::processCaptures(RegExp *foundRegExp, + const QMap<int, QString> *foundCaptures) +{ + if (!foundCaptures->isEmpty()) + { + // qlog_info() << "found: captures:"; + QMapIterator<int, QString> itr(*foundCaptures); + while (itr.hasNext()) + { + itr.next(); + int captureIndex = itr.key(); + const QString scope = itr.value(); + + int capturePos = foundRegExp->pos(captureIndex); + if (capturePos >= 0) + { + int capLen = foundRegExp->len(captureIndex); + int start = capturePos; + int end = capturePos + capLen; + + // textScopes()->addScopedRange( + // currentDocOffset+capturePos, + // currentDocOffset+capturePos+capLen, scope, foundRule + // ); + lineRangeList_->giveRange(new ScopedTextRange( + start, end, + Edbee::instance()->scopeManager()->refTextScope(scope))); + } + } + } +} + +/// This is the main algorithm for finding and matching the correct scopes with +/// help of the regular expressions +/// @param currentDocOffset the current document offset +/// @param line the line that's being matches +/// @param offsetInLine (in/out) the current offset in the line +TextGrammarRule *GrammarTextLexer::findAndApplyNextGrammarRule( + int currentDocOffset, const QString &line, int &offsetInLine) +{ + Q_ASSERT(lineRangeList_); + + // qlog_info() << "--- matchNextGrammarRule: " << currentDocOffset << ", + // line:" << line << ":"<<offsetInLine << "--"; + MultiLineScopedTextRange *activeMultiRange = this->activeMultiLineRange(); + TextGrammarRule *activeRule = activeMultiRange->grammarRule(); + // qlog_info() << "--- matchNextGrammarRule ---------------------"; + // qlog_info() << " - activeRule : " << activeRule->toString(); + // qlog_info() << " - activeRange: " << activeRange->toString(); + + TextGrammarRule *foundRule = 0; + RegExp *foundRegExp = 0; + int foundPosition = std::numeric_limits<int>::max(); + + // first try to close the active rule + if (activeMultiRange->endRegExp()) + { + if (activeMultiRange->endRegExp()->indexIn(line, offsetInLine) >= 0) + { + foundRule = activeRule; + foundRegExp = activeMultiRange->endRegExp(); + foundPosition = foundRegExp->pos(); + } + } + + // find the grammar rule + findNextGrammarRule(line, offsetInLine, activeRule, foundRule, foundRegExp, + foundPosition); + + // next we have found the rule that matched a certain scope + if (foundRule) + { + int matchedLength = foundRegExp->matchedLength(); + // if( !matchedLength ) { matchedLength=1; } // always match at + // least 1 character! (else we're in big trouble ) + + int startPos = foundPosition; + int endPos = startPos + matchedLength; + // qlog_info() << " foundRule: " << foundRule->toString(false) << ", + // foundPosition:" << foundPosition <<" : " << startPos << "t/m" << endPos; + // qlog_info() << " foundRegExp: " << foundRegExp->pattern(); + + // the found captures + + // Did we found the endrule? Then we need to 'close' the current activeRule + if (activeMultiRange->endRegExp() == foundRegExp) + { + activeMultiRange->maxVar() + = currentDocOffset + endPos; // mark the end (DOC) + activeScopedTextRange()->maxVar() = endPos; // mark the end (TextScope) + + processCaptures(foundRegExp, &activeRule->endCaptures()); + + popActiveRange(); + + // a normal match or start of multi-line + } + else + { + TextScope *scopeRef = Edbee::instance()->scopeManager()->refTextScope( + foundRule->scopeName()); + + // did we find a multiline regexp. add the start of this scope + if (foundRule->isMultiLineRegExp()) + { + + ScopedTextRange *range + = new ScopedTextRange(startPos, line.length(), scopeRef); + lineRangeList_->giveRange(range); + + MultiLineScopedTextRange *multiRange = new MultiLineScopedTextRange( + currentDocOffset + startPos, textScopes()->textDocument()->length(), + scopeRef); + multiRange->setGrammarRule(foundRule); + multiRange->giveEndRegExp( + createEndRegExp(foundRegExp, foundRule->endRegExpString())); + + pushActiveRange(range, multiRange); + + // a single rule + } + else + { + // add the found regexp + lineRangeList_->giveRange( + new ScopedTextRange(startPos, endPos, scopeRef)); + // textScopes()->addScopedRange( startPos, endPos, + // foundRule->scopeName(), foundRule ); + } + + // next we need to add the 'captures' + processCaptures(foundRegExp, &foundRule->matchCaptures()); + } + + // increase the offset for the next search + // qlog_info() << " ++ " << matchedLength; + offsetInLine = foundPosition + matchedLength; + + return foundRule; + } + // qlog_info() << "-- not found ??"; + return 0; // no rule found +} + +/// internal method that returns the active grammar rule +MultiLineScopedTextRange *GrammarTextLexer::activeMultiLineRange() +{ + Q_ASSERT(!activeMultiLineRangesRefList_.isEmpty()); + MultiLineScopedTextRange *result = activeMultiLineRangesRefList_.last(); + Q_ASSERT(result->grammarRule()); + return result; +} + +/// Returns the active scoped text range +ScopedTextRange *GrammarTextLexer::activeScopedTextRange() +{ + Q_ASSERT(!activeScopedRangesRefList_.isEmpty()); + return activeScopedRangesRefList_.last(); +} + +/// removes the active range from the stack +/// If the ranges is added for the current line, it is removed from the +/// currentLineRangeList. If the range was started at a previous line, the item +/// is added to the closedActiveRangeRefList +void GrammarTextLexer::popActiveRange() +{ + Q_ASSERT(activeMultiLineRangesRefList_.size() + > 1); // there should be at least 2 items. The first one is the + // grammar rule! + Q_ASSERT(activeScopedRangesRefList_.size() + == activeMultiLineRangesRefList_.size()); + // + if (currentMultiLineRangeList_.isEmpty()) + { + closedMultiRangesRangesRefList_.append( + activeMultiLineRangesRefList_.last()); + // closedActiveRangesRefList_.append(range); + // pushed and popped on this line, no document-scope + } + else + { + delete currentMultiLineRangeList_.last(); + currentMultiLineRangeList_.pop_back(); + } + + activeMultiLineRangesRefList_.pop_back(); + activeScopedRangesRefList_.pop_back(); +} + +/// Adds the given range to the multiscoped textranges +/// And to the list of current line ranges +/// @param range the range top push +void GrammarTextLexer::pushActiveRange(ScopedTextRange *range, + MultiLineScopedTextRange *multiRange) +{ + activeMultiLineRangesRefList_.push_back(multiRange); + currentMultiLineRangeList_.push_back(multiRange); + activeScopedRangesRefList_.push_back(range); + // qlog_info() << "[push]"; + // activeRangesRefList_.push_back( range ); + // currentLineRangesList_.push_back(range); +} + +/// T his method finds the 'included' grammar rule +TextGrammarRule *GrammarTextLexer::findIncludeGrammarRule(TextGrammarRule *base) +{ + Q_ASSERT(base->isIncludeCall()); + QString name = base->includeName(); + + // repos call + if (name.startsWith("#")) + { + return base->grammar()->findFromRepos(name.mid(1)); + } + // another language call + // The difference between $base and $self is very subtle.. The exact + // difference is unkown to me.. + if (name == "$base" || name == "$self") + { + return grammar()->mainRule(); + } + + TextGrammar *grammar = Edbee::instance()->grammarManager()->get(name); + if (grammar) + { + return grammar->mainRule(); + } + return 0; +} + +/// This method is called to notify the lexer some data has been changed +// void GrammarTextLexer::textReplaced( int offset, int length, int newLength ) +void GrammarTextLexer::textChanged(const TextBufferChange &change) +{ + TextDocument *doc = textDocument(); + TextDocumentScopes *docScopes = textScopes(); + + int offsetStart = doc->offsetFromLine(change.line()); + docScopes->removeScopesAfterOffset(offsetStart); + + /// TODO: rebuild an optimized scope-rebuilding algorithm +} + +/// This method lexes a single line +/// @return the last indexed offset +/// WARNING lexline CANNOT be called indepdently of lexLines (beacuse lex-lines +/// set the activeScopes! +bool GrammarTextLexer::lexLine(int lineIdx, int ¤tDocOffset) +{ + TextDocument *doc = textDocument(); + TextDocumentScopes *docScopes = textScopes(); + + QString line = doc->line(lineIdx); //+ "\n"; + + // int lineStartOffset = doc->offsetFromLine(lineIdx); + + Q_ASSERT(currentMultiLineRangeList_.isEmpty()); + Q_ASSERT(closedMultiRangesRangesRefList_.isEmpty()); + Q_ASSERT(activeScopedRangesRefList_.isEmpty()); + + lineRangeList_ = new ScopedTextRangeList(); + + // append the active ranges + for (int i = 0, cnt = activeMultiLineRangesRefList_.size(); i < cnt; ++i) + { + MultiLineScopedTextRangeReference *range + = new MultiLineScopedTextRangeReference( + *activeMultiLineRangesRefList_.at(i)); + range->setAnchor(0); + range->setCaret(line.length()); + lineRangeList_->giveRange(range); + activeScopedRangesRefList_.append(range); + } + + // qlog_info() << ""; + // qlog_info() << + // "////////////////////////////////////////////////////////////////"; + // qlog_info() << " * " << lineIdx << ":" << line; + + // find the first 'matching' rule + int offsetInLine = 0; + int lastOffsetInLine = 0; + TextGrammarRule *lastFoundRule = 0; + while (true) + { + // QString debug; + // debug.append( QStringLiteral((" =[%1,%2,%3]= + // ").arg(lineIdx).arg(offsetInLine).arg(currentDocOffset) ); + TextGrammarRule *foundRule + = findAndApplyNextGrammarRule(currentDocOffset, line, offsetInLine); + // debug.append( QStringLiteral((" %1 + // (%2)").arg(foundRule?foundRule->scopeName():"<<null>").arg(offsetInLine) + // ); qlog_info() << debug; + if (!foundRule) + break; + + /// check the next offset + if (offsetInLine == lastOffsetInLine) + { + + if (lastFoundRule == foundRule) + { + + // I'm very much in doubt how to solve this. What should happend here? + // when the same ruleis found, we need to stop else we will keep on + // getting this rule forever. + // + // btw. A grammar that fires this situation is the Ruby Haml language + // when using the %tagname construct + // + // There are several options to fix this: + // 1. simply ending the parsing of this line with break (Risk is that + // the rest of the line isn't parsed) + // 2. increase offsetInLine to the next character. (Risk is that prasing + // goes wrong, and start identifying at the wrong position) + // 3. Keep a list with found rules and never allow the same rule again. + // (Compelexer to implement don't really know if this is the solution) + + // DEBUG info: + // qlog_info() << "Found grammar-rule("<< lineIdx << "," << + // offsetInLine<<")"; qlog_info() << " - line: " << line; qlog_info() << + // " - rule: " << foundRule->toString(); qlog_info() << " INFINITE LOOP + // PREVENTION"; + + // we're going for option [2] for the moment + ++offsetInLine; // never have an endless loop + + // option[1] also works. + // break; + } + } + lastFoundRule = foundRule; + + lastOffsetInLine = offsetInLine; + } + + // when there are no-multi-line spanning rules, set the independent flag + lineRangeList_->setIndependent(currentMultiLineRangeList_.isEmpty() + && closedMultiRangesRangesRefList_.isEmpty()); + lineRangeList_->squeeze(); // free unused memory + bool result = lineRangeList_->isIndependent(); + + // give the line to the document scopes + docScopes->giveLineScopedRangeList(lineIdx, lineRangeList_); + lineRangeList_ = 0; + + foreach (MultiLineScopedTextRange *scopedRange, currentMultiLineRangeList_) + { + docScopes->giveMultiLineScopedTextRange(scopedRange); + } + activeScopedRangesRefList_.clear(); + currentMultiLineRangeList_.clear(); + closedMultiRangesRangesRefList_.clear(); + + // increase the current document offset + currentDocOffset + += line.size(); // + 1; // +1 because we didn't retrieve the newline + return result; +} + +/// This method lexes a range of line +/// @return the last indexed offset +void GrammarTextLexer::lexLines(int lineStart, int lineCount) +{ + + // (INIT) ALGORITHM BELOW: + // + // - first find the current active scopes. + // - all multi-line-scopes that start on this line we need to 'remove' + // - all multi-line-scopes that end on this line we need to set the end to + // 'unkown' + // - next we must find the ruleset for the current scopes by going into the + // grammar rules + + // WHILE there are chars left to match + // - run all rule reg-exps for this scope and + // - also run all reg-exps for active multi-line scopes to find (a possibly + // new end-marker) + // - use the the rule regexp with the first offset. Add the range to the + // scopes + // - if this is a begin-block regexp, activate the new ruleset. (check if the + // end-regexp is here) + //------------------------ + + TextDocument *doc = textDocument(); + TextDocumentScopes *docScopes = textScopes(); + + // qlog_info() << "===== lexText(" << offset << "," << length << ") + // ["<<lineStart <<","<<lineEnd<<"] ======"; + + // next find all 'active' scoped ranges + int offsetStart = doc->offsetFromLine(lineStart); + activeMultiLineRangesRefList_ + = docScopes->multiLineScopedRangesBetweenOffsets(offsetStart, + offsetStart); + + // GrammarRule* activeRule = grammarRef_->mainRule(); + // if( !activeScopedRanges.isEmpty() ) { activeRule = + // activeScopedRanges.last()->grammarRule(); } Q_ASSERT( activeRule ); + + // next find the rule + int currentDocOffset = offsetStart; + bool independent = true; + for (int idx = 0; idx < lineCount; ++idx) + { + independent = lexLine(lineStart + idx, currentDocOffset) && independent; + } + + // only set the scoped offset if less and not indepdent + if (currentDocOffset < docScopes->lastScopedOffset()) + { + if (!independent) + { + docScopes->setLastScopedOffset(currentDocOffset); + docScopes->removeScopesAfterOffset(currentDocOffset); + } + // further down the document, update the scope + } + else + { + docScopes->setLastScopedOffset(currentDocOffset); + docScopes->removeScopesAfterOffset(currentDocOffset); + } +} + +/// This method is called when the given range needs to be lexed +/// +/// WARNING, this method must be VERY optimized and should 'remember' the lexing +/// states between calls. To invalidate the scopes/lexing state the textReplaced +/// method can be used +/// +/// @param beginOffset the first offset +/// @param endOffset the last offset to +void GrammarTextLexer::lexRange(int beginOffset, int endOffset) +{ + Q_UNUSED(beginOffset); + + // find the beginning of the given line + TextDocument *doc = textDocument(); + TextDocumentScopes *docScopes = textScopes(); + + // no lexing required + if (endOffset <= docScopes->lastScopedOffset()) + { + return; + } + + // first we need to find the correct location to start from + int offset + = docScopes->lastScopedOffset(); // qMin( docScopes->scopedToOffset(), + // offset ); + + int lineStart = doc->lineFromOffset(offset); + int lineEnd = doc->lineFromOffset(endOffset) + 1; + + lexLines(lineStart, lineEnd - lineStart); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/lexers/grammartextlexer.h b/lib/edbee-lib/edbee/lexers/grammartextlexer.h new file mode 100644 index 00000000..dc780699 --- /dev/null +++ b/lib/edbee-lib/edbee/lexers/grammartextlexer.h @@ -0,0 +1,91 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QMap> +#include <QList> +#include <QVector> + +#include "edbee/models/textlexer.h" + +namespace edbee +{ + +class MultiLineScopedTextRange; +class RegExp; +class ScopedTextRange; +class ScopedTextRangeList; +class TextDocumentScopes; +class TextGrammar; +class TextGrammarRule; + +/// A simple lexer matches texts with simple regular expressions +class EDBEE_EXPORT GrammarTextLexer : public TextLexer +{ +public: + GrammarTextLexer(TextDocumentScopes *scopes); + virtual ~GrammarTextLexer(); + + virtual void textChanged(const TextBufferChange &change); + +private: + virtual bool lexLine(int line, int ¤tDocOffset); + +public: + virtual void lexLines(int line, int lineCount); + virtual void lexRange(int beginOffset, int endOffset); + +private: + RegExp *createEndRegExp(RegExp *startRegExp, + const QString &endRegExpStringIn); + + void findNextGrammarRule(const QString &line, int offsetInLine, + TextGrammarRule *activeRule, + TextGrammarRule *&foundRule, RegExp *&foundRegExp, + int &foundPosition); + void processCaptures(RegExp *foundRegExp, + const QMap<int, QString> *foundCaptures); + + TextGrammarRule *findAndApplyNextGrammarRule(int currentDocOffset, + const QString &line, + int &offsetInLine); + + MultiLineScopedTextRange *activeMultiLineRange(); + ScopedTextRange *activeScopedTextRange(); + + void popActiveRange(); + void pushActiveRange(ScopedTextRange *range, + MultiLineScopedTextRange *multiRange); + + TextGrammarRule *findIncludeGrammarRule(TextGrammarRule *base); + +private: + QVector<MultiLineScopedTextRange *> + activeMultiLineRangesRefList_; ///< The current active scoped text ranges, + ///< DOC (this is only valid during + ///< parsing) + QVector<MultiLineScopedTextRange *> + currentMultiLineRangeList_; ///< The doc ranges currently created (only + ///< valid during parsing + QVector<MultiLineScopedTextRange *> + closedMultiRangesRangesRefList_; ///< A list of all ranges (from other + ///< lines) that have been closed. (only + ///< valid during parsing) + + QVector<ScopedTextRange *> + activeScopedRangesRefList_; ///< The current active scoped text ranges, + ///< LINE (this is only valid during parsing) + + // QVector<MultiLineScopedTextRange*> currentLineRangesList_; ///< The + // current scope ranges (only valid during parsing) + + ScopedTextRangeList *lineRangeList_; ///< The scopes at current line (only + ///< valid during parsing) +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/change.cpp b/lib/edbee-lib/edbee/models/change.cpp new file mode 100644 index 00000000..37ca2406 --- /dev/null +++ b/lib/edbee-lib/edbee/models/change.cpp @@ -0,0 +1,344 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "change.h" + +#include "edbee/models/textdocument.h" +#include "edbee/models/changes/textchange.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// a virtual empty destructor +Change::~Change() {} + +/// this method reverts the given operation +void Change::revert(TextDocument *) +{ + Q_ASSERT(false); +} + +/// Gives the change and merges it if possible. This method should return false +/// if the change couldn't be merged. When the method returns true the ownership +/// of the given textchange is transfered to this class. +/// @param document the document this change is for +/// @param textChange the textchange +/// @return true if the merge succeeded. The textChange ownership is only +/// tranfered if true if returend +bool Change::giveAndMerge(TextDocument *document, Change *textChange) +{ + Q_UNUSED(document) + Q_UNUSED(textChange) + return false; +} + +/// This method should return true if the change can be reverted +bool Change::canUndo() +{ + return false; +} + +/// This flag is used to mark this stack item as non-persistence requirable +/// The default behaviour is that every textchange requires persistence. It is +/// also possible to have certain changes that do not require persitence but +/// should be placed on the undo stack +bool Change::isPersistenceRequired() +{ + return true; +} + +/// A text command can belong to a controller/view +/// When it's a view only command. The undo only applies only to this view +/// warning a DOCUMENT change may NEVER return a controllerContext!! +TextEditorController *Change::controllerContext() +{ + return nullptr; +} + +/// this method can be used to check if the given change is a document change +bool Change::isDocumentChange() +{ + return controllerContext() == nullptr; +} + +/// This method returns true if this change is a group change. When an object is +/// group change it should be inherited by TextChangeGroup +bool Change::isGroup() +{ + return false; +} + +//-------------------------------------------------------------- + +/// Empty change doesn't do anything +bool EmptyDocumentChange::isPersistenceRequired() +{ + return false; +} + +/// does nothing +void EmptyDocumentChange::execute(TextDocument *) {} + +/// does nothing +void EmptyDocumentChange::revert(TextDocument *) {} + +/// returns the name of the textchange +QString EmptyDocumentChange::toString() +{ + return "EmptyDocumentTextChange"; +} + +//-------------------------------------------------------------- + +/// A controller specific textcommand. Warning you should NOT modify the +/// textdocument! +/// @param controller the controller this change is for +ControllerChange::ControllerChange(TextEditorController *controller) + : controllerRef_(controller) +{ +} + +/// A text command can belong to a controller/view +/// When it's a view only command. The undo only applies only to this view +TextEditorController *ControllerChange::controllerContext() +{ + return controllerRef_; +} + +/// returns the controller +TextEditorController *ControllerChange::controller() +{ + return controllerRef_; +} + +//-------------------------------------------------------------- + +/// default contructor +/// @param controller the controller this groups belongs to +ChangeGroup::ChangeGroup(TextEditorController *controller) + : ControllerChange(controller) + +{ +} + +/// The destructor deletes all added textchanges +ChangeGroup::~ChangeGroup() +{ + qDeleteAll(changeList_); + changeList_.clear(); +} + +/// A group change is a group change, so this method returns true :) +bool ChangeGroup::isGroup() +{ + return true; +} + +/// This method is called it the group is discardable. A discardable group will +/// be optimized away if the group is empty, or if there's a single item in the +/// group. A none-discardable group will always remain +bool ChangeGroup::isDiscardable() +{ + return true; +} + +/// This method is called if the group is closed and is added to the stack +/// Default implementation is to do nothing +void ChangeGroup::groupClosed() {} + +/// executes this command group +/// @param document the document the document to execute this for +void ChangeGroup::execute(TextDocument *document) +{ + Q_UNUSED(document) + for (int i = 0, cnt = size(); i < cnt; ++i) + { + at(i)->execute(document); + } +} + +/// Reverts the command gorup +void ChangeGroup::revert(TextDocument *document) +{ + Q_UNUSED(document) + for (int i = size() - 1; i >= 0; --i) + { + at(i)->revert(document); + } +} + +/// When another group is given, a merge is performed +bool ChangeGroup::giveAndMerge(TextDocument *document, Change *textChange) +{ + if (textChange->isGroup()) + { + + // move all changes from the given change-group to the new one + ChangeGroup *inGroup = dynamic_cast<ChangeGroup *>(textChange); + for (int i = 0, cnt = inGroup->size(); i < cnt; ++i) + { + giveChange(document, inGroup->at(i)); + } + while (inGroup->takeLast()) + ; + delete textChange; + + return true; + } + return false; +} + +/// This method flattens the undo-group by expanding all subgroups to local +/// groups +void ChangeGroup::flatten() +{ + for (int idx = 0; idx < changeList_.size(); ++idx) + { + ChangeGroup *group = dynamic_cast<ChangeGroup *>(changeList_[idx]); + if (group) + { + changeList_.removeAt(idx); + for (int i = 0; i < group->size(); ++i) + { + ChangeGroup *subGroup + = dynamic_cast<ChangeGroup *>(group->changeList_[i]); + if (subGroup) + { + subGroup->flatten(); // flatten the group + delete subGroup; + if (i >= group->size()) + break; // just make sure empty groups go right (in theory empty + // groups aren't possible) + } + changeList_.insert(idx + i, group->changeList_[i]); + } + group->changeList_.clear(); + delete group; + } + } +} + +void ChangeGroup::giveChange(TextDocument *doc, Change *change) +{ + Q_UNUSED(doc) + changeList_.append(change); +} + +Change *ChangeGroup::at(int idx) +{ + Q_ASSERT(idx < changeList_.size()); + return changeList_.at(idx); +} + +Change *ChangeGroup::take(int idx) +{ + Change *change = changeList_.at(idx); + changeList_.removeAt(idx); + return change; +} + +int ChangeGroup::size() +{ + return changeList_.size(); +} + +void ChangeGroup::clear(bool performDelete) +{ + if (performDelete) + qDeleteAll(changeList_); + changeList_.clear(); +} + +/// This method returns the last change in the change group +/// @return the last textchange +Change *ChangeGroup::last() +{ + if (size() == 0) + { + return nullptr; + } + return at(size() - 1); +} + +/// Takes the ownership of the last element and removes it from the stack +/// @return the last textchange +Change *ChangeGroup::takeLast() +{ + if (size() == 0) + { + return nullptr; + } + return take(size() - 1); +} + +/// The total number of items in the list (excluding the group items) +/// @return the number of items recussive (iterating) all groups +int ChangeGroup::recursiveSize() +{ + int itemCount = 0; + for (int i = 0, cnt = changeList_.size(); i < cnt; ++i) + { + ChangeGroup *group = dynamic_cast<ChangeGroup *>(changeList_[i]); + if (group) + { + itemCount += group->size(); + } + else + { + ++itemCount; + } + } + return itemCount; +} + +/// if this commandgroup only contains commands for a single controller context +/// Then this context is returned else 0 is returned +TextEditorController *ChangeGroup::controllerContext() +{ + TextEditorController *context = nullptr; + for (int i = size() - 1; i >= 0; --i) + { + TextEditorController *commandContext = at(i)->controllerContext(); + + // multiple context in 1 group means it's a 'hard' undo + if (commandContext == nullptr) + return nullptr; /// 0 is always 0! + if (commandContext && context && commandContext != context) + { + return nullptr; + } + if (!context && commandContext) + { + context = commandContext; + } + } + return context; +} + +/// Converts this change group to a string +QString ChangeGroup::toString() +{ + QString s; + s = QStringLiteral("%1/%2").arg(size()).arg(recursiveSize()); + // for( int i=0,cnt=changeList_.size(); i<cnt; ++i ) { + // s.append( changeList_.at(i)->toString() ); + // s.append(","); + // } + // s.remove(s.length()-1); + + QString extra; + for (int i = 0, cnt = size(); i < cnt; ++i) + { + extra.append(QStringLiteral(" - %1: ").arg(i)); + extra.append(at(i)->toString()); + extra.append("\n"); + } + + return QStringLiteral("ChangeGroup(%1)\n%2").arg(s).arg(extra); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/change.h b/lib/edbee-lib/edbee/models/change.h new file mode 100644 index 00000000..247d07d5 --- /dev/null +++ b/lib/edbee-lib/edbee/models/change.h @@ -0,0 +1,111 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QList> +#include <QString> + +namespace edbee +{ + +class TextDocument; +class TextEditorController; + +/// A basic change +class EDBEE_EXPORT Change +{ +public: + virtual ~Change(); + + /// This method should execute the command + virtual void execute(TextDocument *document) = 0; + virtual void revert(TextDocument *); + + virtual bool giveAndMerge(TextDocument *document, Change *textChange); + virtual bool canUndo(); + + virtual bool isPersistenceRequired(); + virtual TextEditorController *controllerContext(); + bool isDocumentChange(); + virtual bool isGroup(); + + virtual QString toString() = 0; +}; + +//-------------------------------------------------------------- + +/// A textdocument change +class EDBEE_EXPORT DocumentChange : public Change +{ +public: +}; + +//-------------------------------------------------------------- + +/// a document text-change that doesn't do anyhting :-) +class EDBEE_EXPORT EmptyDocumentChange : public Change +{ +public: + virtual bool isPersistenceRequired(); + virtual void execute(TextDocument *); + virtual void revert(TextDocument *); + virtual QString toString(); +}; + +//-------------------------------------------------------------- + +/// A textcontroller command. This can ALSO be a document command +class EDBEE_EXPORT ControllerChange : public Change +{ +public: + ControllerChange(TextEditorController *controller); + virtual TextEditorController *controllerContext(); + virtual TextEditorController *controller(); + +private: + TextEditorController *controllerRef_; ///< the controller +}; + +//-------------------------------------------------------------- + +/// An undoable-command-group +class EDBEE_EXPORT ChangeGroup : public ControllerChange +{ +public: + ChangeGroup(TextEditorController *controller); + virtual ~ChangeGroup(); + + virtual bool isGroup(); + + virtual bool isDiscardable(); + virtual void groupClosed(); + + virtual void execute(TextDocument *document); + virtual void revert(TextDocument *document); + + virtual bool giveAndMerge(TextDocument *document, Change *textChange); + virtual void flatten(); + + virtual void giveChange(TextDocument *doc, Change *change); + virtual Change *at(int idx); + virtual Change *take(int idx); + virtual int size(); + virtual void clear(bool performDelete = true); + Change *last(); + Change *takeLast(); + int recursiveSize(); + + virtual TextEditorController *controllerContext(); + + virtual QString toString(); + +private: + QList<Change *> changeList_; ///< A list of all actions +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/changes/abstractrangedchange.cpp b/lib/edbee-lib/edbee/models/changes/abstractrangedchange.cpp new file mode 100644 index 00000000..38b12531 --- /dev/null +++ b/lib/edbee-lib/edbee/models/changes/abstractrangedchange.cpp @@ -0,0 +1,184 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "abstractrangedchange.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// default destructor is empty +AbstractRangedChange::~AbstractRangedChange() {} + +/// Adds the given amount to the offset +/// @param amount the offset to add +void AbstractRangedChange::addOffset(int amount) +{ + setOffset(offset() + amount); +} + +/// Calculates the merged length +/// @param change the change that't being merged +int AbstractRangedChange::getMergedDocLength(AbstractRangedChange *change) +{ + int result = change->docLength(); + + // add the prefix of the a length + if (offset() < change->offset()) + { + result += (change->offset() - offset()); + } + + // add the postfix of the length + int aEnd = offset() + docLength(); + int bEnd = change->offset() + change->storedLength(); + if (bEnd < aEnd) + { + result += aEnd - bEnd; + } + return result; +} + +/// Calculates the merge data size, that's required for merging the given change +/// @param change the change to merge with this change +/// @return the size of this change +int AbstractRangedChange::getMergedStoredLength(AbstractRangedChange *change) +{ + int result = 0; + + // we first need to 'take' the leading part of the new change + if (change->offset() < offset()) + { + result += offset() - change->offset(); + } + + // we need to add the old data + result += storedLength(); + + // then we need to append the remainer + int delta = offset() - change->offset(); + int remainerOffset = docLength() + delta; + if (0 <= remainerOffset && remainerOffset < change->storedLength()) + { + result += change->storedLength() - remainerOffset; + } + return result; +} + +/// Per forms a memcopy or zero fills the given area +static void memcopy_or_zerofill(void *target, void *source, size_t size) +{ + if (source) + { + memcpy(target, source, size); + } + else + { + memset(target, 0, size); + } +} + +/// This method merges the data via a memcopy. I really don't like this way of +/// merging the data. though this is a way which support all kinds of arrays. I +/// cannot use inheritance, because the types like QString don't have a common +/// ancestor +/// +/// @param targetData the target of the data, (be sure enough space is +/// reserved!! +/// @param data pointer to the data of this change (this can be a 0 pointer!, +/// which results in 0-filling the target) +/// @param changeData pointer to the of the other change data (this can be a 0 +/// pointer!, which results in 0-filling the target) +/// @param change the other change of the data to merge +/// @param itemSize the size of single item +void AbstractRangedChange::mergeStoredDataViaMemcopy( + void *targetData, void *data, void *changeData, + AbstractRangedChange *change, int itemSize) +{ + char *target = (char *)targetData; + + // we first need to 'take' the leading part of the new change + if (change->offset() < offset()) + { + int size = itemSize * (offset() - change->offset()); + memcopy_or_zerofill(target, changeData, size); + target += size; + } + + // copy the other text + memcopy_or_zerofill(target, data, itemSize * storedLength()); + target += itemSize * storedLength(); + + // then we need to append the remainer + int delta = offset() - change->offset(); + int remainerOffset = docLength() + delta; + if (0 <= remainerOffset && remainerOffset < change->storedLength()) + { + memcopy_or_zerofill( + target, + changeData ? ((char *)changeData) + (remainerOffset * itemSize) : 0, + (change->storedLength() - remainerOffset) * itemSize); + } +} + +/// This method merges the change +/// @param document the document to merges +/// @param change the change change to merge +bool AbstractRangedChange::merge(AbstractRangedChange *change) +{ + // overlap is a bit harder + if (isOverlappedBy(change) || isTouchedBy(change)) + { + + // build the new sizes and offsets + int newOffset = qMin(offset(), change->offset()); + int newLength = getMergedDocLength(change); + + // merge the data + mergeStoredData(change); + + // when the data is meged assign the new dimensions + setDocLength(newLength); + setOffset(newOffset); + delete change; + return true; + } + return false; +} + +/// This method checks if this textchange is overlapped by the second textchange +/// overlapping is an exclusive overlap, which means the changes are really on +/// top of eachother to test if the changes are touching use isTouchedBy +/// @param secondChange the other change to compare it to +/// @return tue if the changes overlap +bool AbstractRangedChange::isOverlappedBy(AbstractRangedChange *secondChange) +{ + return (offset() < (secondChange->offset() + secondChange->docLength()) + && secondChange->offset() < (offset() + docLength())) + || (offset() < (secondChange->offset() + secondChange->storedLength()) + && secondChange->offset() < (offset() + docLength())); +} + +/// Touched ranges are ranges that are next to eachother +/// Touching means the end offset of one range is the start offset of the other +/// range +/// @param secondChange the other change to match +/// @return true if the changes overlap +bool AbstractRangedChange::isTouchedBy(AbstractRangedChange *secondChange) +{ + return offset() == (secondChange->offset() + secondChange->docLength()) + || (offset() + docLength()) == secondChange->offset() + // Delete operation should be supported + || (secondChange->docLength() < secondChange->storedLength() + && offset() + == (secondChange->offset() + secondChange->storedLength())) + // delete touch (Should we add those length < newlength condition!??) + //|| ( ( length() < newLength() ) && (offset() + newLength()) == + //secondChange->offset() ) + ; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/changes/abstractrangedchange.h b/lib/edbee-lib/edbee/models/changes/abstractrangedchange.h new file mode 100644 index 00000000..1ab6accc --- /dev/null +++ b/lib/edbee-lib/edbee/models/changes/abstractrangedchange.h @@ -0,0 +1,60 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include "edbee/models/change.h" + +namespace edbee +{ + +/// This is an abstract class for ranged changes +/// This are changes (text changes and line changes) that span a range in an +/// array. These ranges share a common alogrithm for performing merges, +/// detecting overlaps etc. +class EDBEE_EXPORT AbstractRangedChange : public Change +{ +public: + virtual ~AbstractRangedChange(); + + /// this method should return the offset of the change + virtual int offset() const = 0; + + /// this method should set the offset + virtual void setOffset(int value) = 0; + void addOffset(int amount); + + /// this method should set the old length + virtual void setDocLength(int value) = 0; + + /// this method should return the length in the document + virtual int docLength() const = 0; + + /// this method should return the length of this item in memory + virtual int storedLength() const = 0; + +protected: + /// implement this method to merge to old data. Sample implementation + /// + /// SingleTextChange* singleTextChange = + /// dynamic_cast<SingleTextChange*>(change); QString newText; newText.resize( + /// calculateMergeDataSize( change) ); mergeData( newText.data(), + /// text_.data(), singleTextChange->text_.data(), change, sizeof(QChar) ); + virtual void mergeStoredData(AbstractRangedChange *change) = 0; + + int getMergedDocLength(AbstractRangedChange *change); + int getMergedStoredLength(AbstractRangedChange *change); + void mergeStoredDataViaMemcopy(void *targetData, void *data, void *changeData, + AbstractRangedChange *change, int itemSize); + bool merge(AbstractRangedChange *change); + +public: + bool isOverlappedBy(AbstractRangedChange *secondChange); + bool isTouchedBy(AbstractRangedChange *secondChange); +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/changes/linedatachange.cpp b/lib/edbee-lib/edbee/models/changes/linedatachange.cpp new file mode 100644 index 00000000..cf2908c5 --- /dev/null +++ b/lib/edbee-lib/edbee/models/changes/linedatachange.cpp @@ -0,0 +1,107 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "linedatachange.h" + +#include "edbee/models/textdocument.h" +#include "edbee/models/textlinedata.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +LineDataChange::LineDataChange(int line, int field) + : line_(line) + , field_(field) + , lineData_(0) +{ +} + +LineDataChange::~LineDataChange() +{ + delete lineData_; +} + +void LineDataChange::giveLineData(TextLineData *lineData) +{ + lineData_ = lineData; +} + +void LineDataChange::execute(TextDocument *doc) +{ + changeLineData(doc); +} + +void LineDataChange::revert(TextDocument *doc) +{ + changeLineData(doc); +} + +/// merge is never a problem, simply +bool LineDataChange::giveAndMerge(TextDocument *document, Change *textChange) +{ + Q_UNUSED(document); + Q_UNUSED(textChange); + LineDataChange *change = dynamic_cast<LineDataChange *>(lineData_); + if (change) + { + if (line_ == change->line_ && field_ == change->field_) + { + delete textChange; + return true; + } + } + return false; +} + +/// line is moved with the given delta +void LineDataChange::applyLineDelta(int line, int length, int newLength) +{ + if (line <= line_) + { + line_ += newLength - length; + } +} + +/// Returns the debug text +QString LineDataChange::toString() +{ + return QStringLiteral("LineDataChange(%1,%2)").arg(line_).arg(field_); +} + +/// The change line data +void LineDataChange::changeLineData(TextDocument *doc) +{ + TextLineData *oldLineData = doc->lineDataManager()->take(line_, field_); + doc->lineDataManager()->give(line_, field_, lineData_); + lineData_ = oldLineData; +} + +/// Returns the line index +int LineDataChange::line() const +{ + return line_; +} + +/// Sets the line of this change +void LineDataChange::setLine(int line) +{ + line_ = line; +} + +/// retursn the field index of this line-data item +int LineDataChange::field() const +{ + return field_; +} + +/// sets the field position +void LineDataChange::setField(int field) +{ + field_ = field; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/changes/linedatachange.h b/lib/edbee-lib/edbee/models/changes/linedatachange.h new file mode 100644 index 00000000..dfd2e18c --- /dev/null +++ b/lib/edbee-lib/edbee/models/changes/linedatachange.h @@ -0,0 +1,51 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include "edbee/models/change.h" + +namespace edbee +{ + +class TextDocument; +class TextLineData; + +/// a class to handle line-data textchanges +class EDBEE_EXPORT LineDataChange : public Change +{ +public: + LineDataChange(int line, int field); + virtual ~LineDataChange(); + + void giveLineData(TextLineData *lineData); + + virtual void execute(TextDocument *document); + virtual void revert(TextDocument *doc); + + virtual bool giveAndMerge(TextDocument *document, Change *textChange); + + virtual void applyLineDelta(int line, int length, int newLength); + + virtual QString toString(); + + int line() const; + void setLine(int line); + + int field() const; + void setField(int field); + +private: + void changeLineData(TextDocument *doc); + +private: + int line_; ///< The line number + int field_; ///< The field index + TextLineData *lineData_; ///< The text-line data +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/changes/linedatalistchange.cpp b/lib/edbee-lib/edbee/models/changes/linedatalistchange.cpp new file mode 100644 index 00000000..d5870c70 --- /dev/null +++ b/lib/edbee-lib/edbee/models/changes/linedatalistchange.cpp @@ -0,0 +1,252 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "linedatalistchange.h" + +#include "edbee/models/textdocument.h" +#include "edbee/models/textlinedata.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +class TextLineDataManager; + +/// The line data text change constructor +/// @param manager the line data manager +/// @param line the starting line of the change +/// @param length the number of lines affected +/// @param newLength the new number of lines +LineDataListChange::LineDataListChange(TextLineDataManager *manager, int line, + int length, int newLength) + : managerRef_(manager) + , offset_(line) + , docLength_(newLength) + , oldListList_(nullptr) + , contentLength_(length) +{ +} + +/// Destructs the linedata textchange +LineDataListChange::~LineDataListChange() +{ + if (oldListList_) + { + for (int i = 0; i < contentLength_; ++i) + { + TextLineDataList *list = oldListList_[i]; + if (list) + { + list->destroy(managerRef_); + delete list; + } + } + delete[] oldListList_; + oldListList_ = 0; + } +} + +/// Executes the line data changes +/// @param document the document to execute the change for +void LineDataListChange::execute(TextDocument *document) +{ + Q_UNUSED(document); + // backup the old items + for (int i = 0; i < contentLength_; ++i) + { + TextLineDataList *list + = managerRef_->takeList(offset_ + i); // take the ownership of the list + if (list) + { + // jit allocation of the list! + if (!oldListList_) + { + oldListList_ = new TextLineDataList + *[contentLength_](); /// new X[]() => fills it with zero's + } + oldListList_[i] = list; + } + } + + // replace all old items with 0 values + managerRef_->fillWithEmpty(offset_, contentLength_, docLength_); +} + +/// Reverts the line data change +/// @param doc the document to execute the change for +void LineDataListChange::revert(TextDocument *doc) +{ + Q_UNUSED(doc); + if (oldListList_) + { + managerRef_->replace(offset_, docLength_, oldListList_, contentLength_); + delete oldListList_; + oldListList_ = 0; + } + else + { + managerRef_->fillWithEmpty(offset_, docLength_, contentLength_); + } +} + +/// This method merges the old data with the new data +/// @apram change the data to merge with +void LineDataListChange::mergeStoredData(AbstractRangedChange *change) +{ + LineDataListChange *lineTextChange + = dynamic_cast<LineDataListChange *>(change); + Q_ASSERT(lineTextChange); // this shouldn't happen + if (!lineTextChange) + return; + + // calculate the new size + int newOldListSize = getMergedStoredLength( + change); // qlog_info() << "CALCULATED: " << newOldListSize ; + + // no old data, we don't need to store anthing + if (this->oldListList_ == 0 && lineTextChange->oldListList_ == 0) + { + contentLength_ = newOldListSize; // also store the content list + return; + } + + // create the new list + TextLineDataList **newOldListList_ = new TextLineDataList *[newOldListSize]; + + // merge the stuff + mergeStoredDataViaMemcopy(newOldListList_, oldListList_, + lineTextChange->oldListList_, change, + sizeof(TextLineDataList *)); + + // we need to delete all items that aren't used anymore + if (oldListList_) + { + for (int i = 0; i < contentLength_; ++i) + { + bool found = false; + TextLineDataList *list = oldListList_[i]; + + // find it in this change + for (int j = 0; j < newOldListSize && !found; ++j) + { + found = (list == newOldListList_[j]); + } + + // delete the old list if not found + if (!found) + { + // list->destroy( // manager WTF !); + delete list; + } + } + delete[] oldListList_; + oldListList_ = 0; + } + + // same for other change + if (lineTextChange->oldListList_) + { + for (int i = 0; i < lineTextChange->contentLength_; ++i) + { + bool found = false; + TextLineDataList *list = lineTextChange->oldListList_[i]; + + // find it in this change + for (int j = 0; j < newOldListSize && !found; ++j) + { + found = (list == newOldListList_[j]); + } + + // delete the old list if not found + if (!found) + { + // list->destroy( // manager WTF !); + delete list; + } + } + delete[] lineTextChange->oldListList_; + lineTextChange->oldListList_ = 0; + } + + /// TODO: Know how and what to delete + oldListList_ = newOldListList_; + contentLength_ = newOldListSize; // also store the content list +} + +/// Merges mutliple textline changes together +/// @param document the document the changes are fior +/// @param textChange the other textchange +/// @return true if the merge succeed, false if not +bool LineDataListChange::giveAndMerge(TextDocument *document, + Change *textChange) +{ + Q_UNUSED(document); + Q_UNUSED(textChange); + LineDataListChange *change = dynamic_cast<LineDataListChange *>(textChange); + if (change) + { + return merge(change); + } + return false; +} + +/// Converts this change to a string +QString LineDataListChange::toString() +{ + return QStringLiteral("LineDataListTextChange(%1,%2,%3)") + .arg(offset_) + .arg(contentLength_) + .arg(docLength_); +} + +/// Returns the line +int LineDataListChange::offset() const +{ + return offset_; +} + +/// Sets the new offset +void LineDataListChange::setOffset(int value) +{ + offset_ = value; +} + +/// Retursn the length in the document/data +int LineDataListChange::docLength() const +{ + return docLength_; +} + +/// This method sets the old length +/// @param value the new old-length value +void LineDataListChange::setDocLength(int value) +{ + docLength_ = value; +} + +/// The lengt of the content in this object +int LineDataListChange::storedLength() const +{ + return contentLength_; +} + +/// returns the old list list +TextLineDataList **LineDataListChange::oldListList() +{ + return oldListList_; +} + +/// retursn the length of th eold list list +int LineDataListChange::oldListListLength() +{ + if (oldListList_) + { + return contentLength_; + } + return 0; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/changes/linedatalistchange.h b/lib/edbee-lib/edbee/models/changes/linedatalistchange.h new file mode 100644 index 00000000..039b267b --- /dev/null +++ b/lib/edbee-lib/edbee/models/changes/linedatalistchange.h @@ -0,0 +1,58 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QVector> + +#include "edbee/models/changes/abstractrangedchange.h" + +namespace edbee +{ + +class TextLineDataManager; +class TextLineDataList; + +/// A full line data text change. This means the growing or shrinking of the +/// line data buffer It stores the old-data list that needs to be remebered for +/// undoing +class EDBEE_EXPORT LineDataListChange : public AbstractRangedChange +{ +public: + LineDataListChange(TextLineDataManager *manager, int offset, int lenght, + int newLength); + virtual ~LineDataListChange(); + + virtual void execute(TextDocument *document); + virtual void revert(TextDocument *doc); + + virtual void mergeStoredData(AbstractRangedChange *change); + virtual bool giveAndMerge(TextDocument *document, Change *textChange); + + virtual QString toString(); + + int offset() const; + void setOffset(int value); + + virtual int docLength() const; + void setDocLength(int value); + + virtual int storedLength() const; + + TextLineDataList **oldListList(); + int oldListListLength(); + +private: + TextLineDataManager *managerRef_; ///< A reference to the manager + int offset_; ///< The line number start + int docLength_; ///< The number of new items (they all will be 0) + + TextLineDataList **oldListList_; /// The lists of items (old items) + int contentLength_; ///< The number of elements in the oldListList +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/changes/mergablechangegroup.cpp b/lib/edbee-lib/edbee/models/changes/mergablechangegroup.cpp new file mode 100644 index 00000000..bd98692c --- /dev/null +++ b/lib/edbee-lib/edbee/models/changes/mergablechangegroup.cpp @@ -0,0 +1,577 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "mergablechangegroup.h" + +#include "edbee/models/changes/abstractrangedchange.h" +#include "edbee/models/changes/selectionchange.h" +#include "edbee/models/changes/textchange.h" +#include "edbee/models/changes/linedatalistchange.h" +#include "edbee/models/textrange.h" +#include "edbee/views/textselection.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/util/util.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// The default complex textchange constructor +MergableChangeGroup::MergableChangeGroup(TextEditorController *controller) + : ChangeGroup(controller) + , previousSelection_(0) + , newSelection_(0) +{ + if (controller) + { + previousSelection_ = new TextRangeSet(*(controller->textSelection())); + } +} + +/// The default destructor +MergableChangeGroup::~MergableChangeGroup() +{ + clear(true); + delete newSelection_; + delete previousSelection_; +} + +/// default not discardable +bool MergableChangeGroup::isDiscardable() +{ + return false; +} + +/// the group is closed, we must 'store' the selection +void MergableChangeGroup::groupClosed() +{ + if (controller()) + { + delete newSelection_; + newSelection_ = new TextRangeSet(*(controller()->textSelection())); + } +} + +/// Executes this textchange +/// @param document the document to execute this operation for +void MergableChangeGroup::execute(TextDocument *document) +{ + ChangeGroup::execute(document); + if (newSelection_) + { + TextRangeSet *currentSelection + = dynamic_cast<TextRangeSet *>(controller()->textSelection()); + *currentSelection = *newSelection_; + } +} + +/// this method is called to revert the operation +/// reverts the given operation +void MergableChangeGroup::revert(TextDocument *document) +{ + ChangeGroup::revert(document); + if (previousSelection_) + { + TextRangeSet *currentSelection + = dynamic_cast<TextRangeSet *>(controller()->textSelection()); + *currentSelection = *previousSelection_; + } +} + +/// This method adds the given delta to the changes +void MergableChangeGroup::addOffsetDeltaToChanges( + QList<AbstractRangedChange *> &changes, int fromIndex, int delta) +{ + for (int i = fromIndex; i < changes.size(); ++i) + { + AbstractRangedChange *s2 = changes.at(i); + s2->addOffset(delta); + } +} + +/// This method finds the insert index for the given offset +/// @param offset the offset of the change +/// @return the inertindex used for inserting the data +int MergableChangeGroup::findInsertIndexForOffset( + QList<AbstractRangedChange *> &changes, int offset) +{ + int insertIndex = 0; + for (int i = 0, cnt = changes.size(); i < cnt; ++i) + { + AbstractRangedChange *change = changes.at(i); + if (change->offset() < offset) + { + insertIndex = i + 1; + } + } + return insertIndex; +} + +/// This method tries to merge the given textchagne +/// @param newChange the new change to merge +/// @param delta (out) the delta applied to this change +/// @return the merged index or -1 if not merged! +int MergableChangeGroup::mergeChange(QList<AbstractRangedChange *> &changes, + TextDocument *doc, + AbstractRangedChange *newChange, + int &delta) +{ + for (int i = 0, cnt = changes.size(); i < cnt; ++i) + { + AbstractRangedChange *change = changes.at(i); + + // we need the previous length and new-length to know how the delta is + // changed of the other items + int prevNewLength = change->docLength(); + int prevContentLength = change->storedLength(); + + // try to merge it + if (change->giveAndMerge(doc, newChange)) + { + + // apply the delta (newLength and length is reversed when in undo state!) + delta += (change->docLength() - prevNewLength) + - (change->storedLength() - prevContentLength); + return i; + } + } + return -1; +} + +/// When a normal merge was succesful (with mergeTextChange) we need to +/// inverseMerge the other overlapping textchanges +/// @param mergedAtIndex the index where the first merge was succeeded +/// @param orgStartOffset the offset of the orgingal merged textchange +/// @param orgEndoOffset the end offset of the original merged textchange +/// @param delta the current delta used for offset calculating +void MergableChangeGroup::inverseMergeRemainingOverlappingChanges( + QList<AbstractRangedChange *> &changes, TextDocument *doc, + int mergedAtIndex, int orgStartOffset, int orgEndOffset, int delta) +{ + AbstractRangedChange *mergedChange = changes.at(mergedAtIndex); + for (int i = mergedAtIndex + 1; i < changes.size(); ++i) + { + AbstractRangedChange *nextChange = changes.at(i); + + // only perform merging if the change overlapped a previous change + if (nextChange->offset() < orgEndOffset + && orgStartOffset < (nextChange->offset() + nextChange->docLength())) + { + + // take the delta of the previous change before the merge + int tmpDelta + = mergedChange->storedLength() - mergedChange->docLength() + delta; + + // alter the delta, so we find the correct merge index + nextChange->addOffset(tmpDelta); + + // notice the 'inversion of the merge. We apply the merged change to the + // next change + if (nextChange->giveAndMerge(doc, mergedChange)) + { + mergedChange = nextChange; + changes.removeAt(mergedAtIndex); + --i; + } + else + { + // remove the temporary delta + nextChange->addOffset(-tmpDelta); + break; // cannot merge, we're done + } + } + else + { + break; + } + } +} + +/// gives the given textchange to the merge routine +void MergableChangeGroup::giveChangeToList( + QList<AbstractRangedChange *> &changes, TextDocument *doc, + AbstractRangedChange *newChange) +{ + // qlog_info() << "giveSingleTextChange" << newChange->toString(); + // remember the orginal ranges so we know which changes are affected by this + // new change + int orgStartOffset = newChange->offset(); + int orgEndOffset = newChange->offset() + newChange->storedLength(); + + // some variables to remebmer + int addDeltaFromIndex + = size(); // From which change index should we add delta?! + int delta = 0; + + // First try to merge this new change + int mergedAtIndex = mergeChange(changes, doc, newChange, delta); + + // when we could merge the change, + // we need to try to merge it with next overlapping changes + if (mergedAtIndex >= 0) + { + + inverseMergeRemainingOverlappingChanges( + changes, doc, mergedAtIndex, orgStartOffset, orgEndOffset, delta); + addDeltaFromIndex = mergedAtIndex + 1; + + // not merged? then we need to add the change at the given index + } + else + { + + // find the insert index + int insertIndex = findInsertIndexForOffset(changes, newChange->offset()); + + // just insert change + textChangeList_.insert(insertIndex, newChange); + addDeltaFromIndex = insertIndex + 1; + + // apply the delta (newLength and length is reversed when in undo state!) + delta += newChange->storedLength() - newChange->docLength(); + } + + // next apply the delta to the following change + addOffsetDeltaToChanges(changes, addDeltaFromIndex, delta); +} + +/// Gives a single textchange +void MergableChangeGroup::giveSingleTextChange(TextDocument *doc, + TextChange *change) +{ + giveChangeToList(textChangeList_, doc, change); +} + +/// gives a line data list text change +void MergableChangeGroup::giveLineDataListTextChange( + TextDocument *doc, LineDataListChange *newChange) +{ + Q_UNUSED(doc); + this->lineDataTextChangeList_.append(newChange); // no merge for the moment + /* TODO: Work in progress below. This algorithm seems identical to the one + used with SingleTextChanges + * we need to abstract the interfaces and create a general merge-ranges + operation + * + // try to merge the change + int mergeIndex = -1; + int delta = 0; + int addDeltaIndex = lineDataTextChangeList_.size(); + + for( int i=0, cnt=lineDataTextChangeList_.size(); i<cnt; ++i ) { + LineDataListTextChange* change = lineDataTextChangeList_.at(i); + + // we need the previous length and new-length to know how the delta is + changed of the other items int prevLength = change->length(); int + prevNewLength = change->newLength(); + + if( change->giveAndMerge( doc, newChange ) ) { + mergeIndex = i; + delta += (change->length()-prevLength) - + (change->newLength()-prevNewLength); break; + } + } + + // when merge succeeded, add the delta index + if( mergeIndex >= 0 ) { + addDeltaIndex = mergeIndex+1; + } + + // when not merged, find the insert index + if( mergeIndex < 0 ) { + // STILL a TODO + lineDataTextChangeList_.append(newChange); + } + + // next add delta offsets from the given index + for(int i = addDeltaIndex,cnt=lineDataTextChangeList_.size(); i<cnt; ++i ) + { LineDataListTextChange* s2 = lineDataTextChangeList_.at(i); + s2->addDeltaToLine(delta); + } + */ +} + +/// Gives the change +void MergableChangeGroup::giveChange(TextDocument *doc, Change *change) +{ + // a single text change + TextChange *textChange = dynamic_cast<TextChange *>(change); + if (textChange) + { + // textChangeList_.append(textChange); + giveSingleTextChange(doc, textChange); + return; + } + + // a list text change + LineDataListChange *lineDataTextChange + = dynamic_cast<LineDataListChange *>(change); + if (lineDataTextChange) + { + giveLineDataListTextChange(doc, lineDataTextChange); + return; + } + + // a selection change simply is moved to the new selection object + SelectionChange *selectionChange = dynamic_cast<SelectionChange *>(change); + if (selectionChange) + { + delete newSelection_; + newSelection_ = selectionChange->takeRangeSet(); + + /// we can simply delete the change, the ComplexTextChange automatically + /// records the last change selection on the undoGroupEnd + delete change; + return; + } + + // a group changes, just add all the groups + ChangeGroup *group = dynamic_cast<ChangeGroup *>(change); + if (group) + { + moveChangesFromGroup(doc, group); + delete group; + return; + } + + // other changes are (currently) added to a misch change list. And are pretty + // scary for now :) + miscChangeList_.append(change); +} + +/// returns the textchange at the given index +Change *MergableChangeGroup::at(int idx) +{ + // plain text changes + if (idx < textChangeList_.size()) + { + return textChangeList_.at(idx); + } + // line-data changes + idx -= textChangeList_.size(); + if (idx < lineDataTextChangeList_.size()) + { + return lineDataTextChangeList_.at(idx); + } + // other changes + idx -= lineDataTextChangeList_.size(); + Q_ASSERT(idx < miscChangeList_.size()); + return miscChangeList_.at(idx); +} + +/// Takes the given item +Change *MergableChangeGroup::take(int idx) +{ + // plain text changes + if (idx < textChangeList_.size()) + { + return textChangeList_.takeAt(idx); + } + // line-data changes + idx -= textChangeList_.size(); + if (idx < lineDataTextChangeList_.size()) + { + return lineDataTextChangeList_.takeAt(idx); + } + // other changes + idx -= lineDataTextChangeList_.size(); + Q_ASSERT(idx < miscChangeList_.size()); + return miscChangeList_.takeAt(idx); +} + +/// returns the number of elements +int MergableChangeGroup::size() +{ + return textChangeList_.size() + lineDataTextChangeList_.size() + + miscChangeList_.size(); +} + +/// clears all items +void MergableChangeGroup::clear(bool performDelete) +{ + // delete + if (performDelete) + { + qDeleteAll(textChangeList_); + qDeleteAll(lineDataTextChangeList_); + qDeleteAll(miscChangeList_); + } + + // clear the changes + textChangeList_.clear(); + lineDataTextChangeList_.clear(); + miscChangeList_.clear(); +} + +/// this method tries to merge the textchange with this text change +bool MergableChangeGroup::giveAndMerge(TextDocument *document, + Change *textChange) +{ + giveChange(document, textChange); + return true; +} + +/// Converts this textchange to a textual representation +QString MergableChangeGroup::toString() +{ + return QStringLiteral("Complex::%1").arg(ChangeGroup::toString()); +} + +/// Converts the textchangeList as as string +/// The format is the following: +/// <offset>:<length>:<str>,... +/// +/// sample: +/// 0:2:ABC,1:2:QW +QString MergableChangeGroup::toSingleTextChangeTestString() +{ + QString result; + foreach (AbstractRangedChange *abstractChange, textChangeList_) + { + TextChange *change = dynamic_cast<TextChange *>(abstractChange); + if (change) + { + if (!result.isEmpty()) + result.append(","); + result.append(QStringLiteral("%1:%2:%3") + .arg(change->offset()) + .arg(change->docLength()) + .arg(change->storedText())); + } + } + return result; +} + +/// Moves all textchanges from the given group to this group +/// @param group the group to move the selection from +void MergableChangeGroup::moveChangesFromGroup(TextDocument *doc, + ChangeGroup *group) +{ + // qlog_info() << "moveChangeFromGroup **************** (MERGE)"; + // qlog_info() << "A:" << this->toString(); + // qlog_info() << "B:" << group->toString(); + + // process all changes + for (int i = 0, cnt = group->size(); i < cnt; ++i) + { + + Change *change = group->at(i); + + // handle nested groups + if (change->isGroup()) + { + ChangeGroup *childGroup = dynamic_cast<ChangeGroup *>(change); + if (childGroup) + { + moveChangesFromGroup(doc, childGroup); + delete childGroup; + continue; + } + } + + // merge the the change + giveChange(doc, change); + } + group->clear(false); // no delete we've taken the ownership + + // qlog_info() << "=1>:" << this->toString(); + + // next we need to compress the changes (merging changes that are next to + // eachother) + compressChanges(doc); + // qlog_info() << "************************"; + // qlog_info() << "=2>:" << this->toString(); + + // when it's a complex text change, also move the selection to this group + MergableChangeGroup *complexGroup + = dynamic_cast<MergableChangeGroup *>(group); + if (complexGroup) + { + qSwap(newSelection_, complexGroup->newSelection_); + } +} + +/// merges the given textchange as a group. +/// @param document the document this merge is for +/// @param textChange the textchange to merge +/// @return true if the textchange was merged as group. +bool MergableChangeGroup::mergeAsGroup(TextDocument *document, + Change *textChange) +{ + Q_UNUSED(document); + + // make sure it's a group + if (!textChange->isGroup()) + { + return false; + } + ChangeGroup *group = dynamic_cast<ChangeGroup *>(textChange); + if (!group) + { + return false; + } + + // move all changes from the other group to this group + moveChangesFromGroup(document, group); + + delete textChange; + return true; +} + +// merge the text selection +/// @param document the document this merge is for +/// @param textChange the textchange to merge +/// @return true if the textchange was merged as group. +bool MergableChangeGroup::mergeAsSelection(TextDocument *document, + Change *textChange) +{ + Q_UNUSED(document); + SelectionChange *selectionChange + = dynamic_cast<SelectionChange *>(textChange); + if (!selectionChange) + { + return false; + } + + // simply take the selection from the textchange and make this the new + // selection + delete newSelection_; + newSelection_ = selectionChange->takeRangeSet(); + delete textChange; + return true; +} + +/// Compresses the textchanges +/// @param document the document to merge the changes for +void MergableChangeGroup::compressTextChanges(TextDocument *document) +{ + // compress single text changes + for (int i = 0; i < textChangeList_.size(); ++i) + { + AbstractRangedChange *change1 = textChangeList_.at(i); + + // find the next text change + for (int j = i + 1; j < textChangeList_.size(); ++j) + { + AbstractRangedChange *change2 = textChangeList_.at(j); + if (change1->giveAndMerge(document, change2)) + { + textChangeList_.takeAt( + j); // just take it, the item is already deleted by the merge + --j; + } + } // for j + } // for i +} + +/// This is going to be the magic method that's going to merge all changes +/// @param document the document to merge the changes for +void MergableChangeGroup::compressChanges(TextDocument *document) +{ + compressTextChanges(document); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/changes/mergablechangegroup.h b/lib/edbee-lib/edbee/models/changes/mergablechangegroup.h new file mode 100644 index 00000000..dd00e717 --- /dev/null +++ b/lib/edbee-lib/edbee/models/changes/mergablechangegroup.h @@ -0,0 +1,104 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include "edbee/models/change.h" + +namespace edbee +{ + +class AbstractRangedChange; +class LineDataListChange; +class TextChange; +class TextRangeSet; + +/// A special mergable group textchange. Used by the editor to merge editing +/// operation together.. I hate the name, but currently don't know a better name +/// of this class :) +/// +/// This is a complete rewrite of the earlier implementation. This implemenation +/// simply adds all changes to a group. It tries to compress the changes that +/// are compressable This group has 1 previous selection and 1 next selection. +/// All selection changes are 'removed' and only the last and first state is +/// stored. +class EDBEE_EXPORT MergableChangeGroup : public ChangeGroup +{ +public: + MergableChangeGroup(TextEditorController *controller); + virtual ~MergableChangeGroup(); + + // this change cannot be optimized away + virtual bool isDiscardable(); + virtual void groupClosed(); + + virtual void execute(TextDocument *document); + virtual void revert(TextDocument *document); + +private: + void addOffsetDeltaToChanges(QList<AbstractRangedChange *> &changes, + int fromIndex, int delta); + int findInsertIndexForOffset(QList<AbstractRangedChange *> &changes, + int offset); + int mergeChange(QList<AbstractRangedChange *> &changes, TextDocument *doc, + AbstractRangedChange *newChange, int &delta); + void inverseMergeRemainingOverlappingChanges( + QList<AbstractRangedChange *> &changes, TextDocument *doc, + int mergedAtIndex, int orgStartOffset, int orgEndOffset, int delta); + + void giveChangeToList(QList<AbstractRangedChange *> &changes, + TextDocument *doc, AbstractRangedChange *change); + void giveAndMergeChangeToList(QList<AbstractRangedChange *> &changes, + TextDocument *doc, + AbstractRangedChange *change); + + // TODO: void giveAbstractRangedTextChange( TextDocument* doc, + // QList<AbstractRangedTextChange* changeList>& changes, + // AbstractRangedTextChange* change ); + +public: + void giveSingleTextChange(TextDocument *doc, TextChange *change); + void giveLineDataListTextChange(TextDocument *doc, + LineDataListChange *change); + + virtual void giveChange(TextDocument *doc, Change *change); + virtual Change *at(int idx); + virtual Change *take(int idx); + virtual int size(); + virtual void clear(bool performDelete = true); + + /// This method tries to merge the given change with the other change + /// The textChange supplied with this method should NOT have been executed + /// yet. It's the choice of this merge operation if the execution is required + /// @param textChange the textchange to merge + /// @return true if the merge has been successfull. False if nothing has been + /// merged and executed + virtual bool giveAndMerge(TextDocument *document, Change *textChange); + + virtual QString toString(); + QString toSingleTextChangeTestString(); + + void moveChangesFromGroup(TextDocument *doc, ChangeGroup *group); + +protected: + bool mergeAsGroup(TextDocument *document, Change *textChange); + bool mergeAsSelection(TextDocument *document, Change *textChange); + + void compressTextChanges(TextDocument *document); + void compressChanges(TextDocument *document); + +private: + QList<AbstractRangedChange *> textChangeList_; ///< The list of textchanges + QList<LineDataListChange *> + lineDataTextChangeList_; ///< The list with liendata text changes + QList<Change *> miscChangeList_; ///< Other textchanges + + TextRangeSet *previousSelection_; + TextRangeSet *newSelection_; +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/changes/selectionchange.cpp b/lib/edbee-lib/edbee/models/changes/selectionchange.cpp new file mode 100644 index 00000000..1232e985 --- /dev/null +++ b/lib/edbee-lib/edbee/models/changes/selectionchange.cpp @@ -0,0 +1,129 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "selectionchange.h" + +#include "edbee/models/textbuffer.h" +#include "edbee/models/texteditorconfig.h" +#include "edbee/models/change.h" +#include "edbee/models/textdocument.h" +#include "edbee/models/textrange.h" +#include "edbee/models/textundostack.h" +#include "edbee/views/accessibletexteditorwidget.h" +#include "edbee/views/textrenderer.h" +#include "edbee/views/textselection.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/texteditorwidget.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// The selection selection change constructor +/// @param controller the crontroler this selection change is for +SelectionChange::SelectionChange(TextEditorController *controller) + : ControllerChange(controller) + , rangeSet_(0) +{ +} + +/// destructs the textrange +SelectionChange::~SelectionChange() +{ + delete rangeSet_; +} + +/// Gives the textrange to the textchange +void SelectionChange::giveTextRangeSet(TextRangeSet *rangeSet) +{ + delete rangeSet_; + rangeSet_ = rangeSet; +} + +/// Takes ownership of the rangeset and clears the clearset +/// @return the rangeset +TextRangeSet *SelectionChange::takeRangeSet() +{ + TextRangeSet *result = rangeSet_; + rangeSet_ = 0; + return result; +} + +/// Executes the textchange +/// @param document the textdocument to execute this change for +void SelectionChange::execute(TextDocument *document) +{ + if (!rangeSet_) + { + return; + } + Q_UNUSED(document); + TextRangeSet *currentSelection + = dynamic_cast<TextRangeSet *>(controllerContext()->textSelection()); + TextRangeSet oldSelection(*currentSelection); + + *currentSelection = *rangeSet_; + *rangeSet_ = oldSelection; + + notifyChange(); +} + +/// Reverts the selection change +/// @param document the textdocument to revert this change for +void SelectionChange::revert(TextDocument *document) +{ + if (!rangeSet_) + { + return; + } + + Q_UNUSED(document); + TextRangeSet *currentSelection + = dynamic_cast<TextRangeSet *>(controllerContext()->textSelection()); + TextRangeSet newSelection(*currentSelection); + + *currentSelection = *rangeSet_; + *rangeSet_ = newSelection; + notifyChange(); +} + +/// This method tries to merge the given change with the other change +/// The textChange supplied with this method. Should NOT have been executed yet. +/// It's the choice of this merge operation if the execution is required +bool SelectionChange::giveAndMerge(TextDocument *document, Change *textChange) +{ + Q_UNUSED(document); + SelectionChange *selectionChange + = dynamic_cast<SelectionChange *>(textChange); + if (selectionChange) + { + // *rangeSet_ = *selectionChange->rangeSet_; + delete textChange; + return true; + } + return false; +} + +/// Convert this change to a string +QString SelectionChange::toString() +{ + return QStringLiteral("SelectionTextChange(%1)") + .arg(rangeSet_->rangesAsString()); +} + +/// This method is called internally for notifying the control the selection has +/// been changed Perhaps we should make e proper emit-signal for this purpose +void SelectionChange::notifyChange() +{ + /// TODO: make the controllerContext only repaint the affected areas via the + /// TextRangeSets + controllerContext()->onSelectionChanged(rangeSet_); + + AccessibleTextEditorWidget::notifyTextSelectionEvent( + controller()->widget(), controller()->textSelection()); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/changes/selectionchange.h b/lib/edbee-lib/edbee/models/changes/selectionchange.h new file mode 100644 index 00000000..1d0f1593 --- /dev/null +++ b/lib/edbee-lib/edbee/models/changes/selectionchange.h @@ -0,0 +1,47 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include "edbee/models/change.h" + +namespace edbee +{ + +class TextDocSelState; +class TextEditorController; +class TextRangeSet; + +/// Move the caret / and selection commands +class EDBEE_EXPORT SelectionChange : public ControllerChange +{ +public: + SelectionChange(TextEditorController *controller); + virtual ~SelectionChange(); + + virtual void giveTextRangeSet(TextRangeSet *rangeSet); + virtual TextRangeSet *takeRangeSet(); + + virtual void execute(TextDocument *document); + virtual void revert(TextDocument *document); + + virtual bool giveAndMerge(TextDocument *document, Change *textChange); + TextRangeSet *rangeSet() { return rangeSet_; } + + virtual QString toString(); + +protected: + void notifyChange(); + +private: + TextRangeSet + *rangeSet_; ///< This rangeset contains the new ranges OR the old ranges, + ///< depending on the state on the undo-stack (This is scary + ///< but saves us the storage of a compelte rangeSet) +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/changes/textchange.cpp b/lib/edbee-lib/edbee/models/changes/textchange.cpp new file mode 100644 index 00000000..ca73b573 --- /dev/null +++ b/lib/edbee-lib/edbee/models/changes/textchange.cpp @@ -0,0 +1,185 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "textchange.h" + +#include "edbee/models/textbuffer.h" +#include "edbee/models/textdocument.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// Constructs a single textchange +/// @param offset, the offset of the change +/// @param length, the length of the change +/// @param text , the new text +/// @param executed, a boolean (mainly used for testing) to mark this change as +/// exected +TextChange::TextChange(int offset, int length, const QString &text) + : offset_(offset) + , length_(length) + , text_(text) +{ +} + +/// undo's a single textchange +TextChange::~TextChange() {} + +/// executes the given textchange +/// @param document the document to execute the change on +void TextChange::execute(TextDocument *document) +{ + replaceText(document); +} + +/// Reverts the single textchange +/// @param document the document to execute the change on +void TextChange::revert(TextDocument *document) +{ + replaceText(document); +} + +/// This method merges the old data with the new data +/// @apram change the data to merge with +void TextChange::mergeStoredData(AbstractRangedChange *change) +{ + TextChange *singleTextChange = dynamic_cast<TextChange *>(change); + + QString newText; + newText.resize(getMergedStoredLength(change)); + mergeStoredDataViaMemcopy(newText.data(), text_.data(), + singleTextChange->text_.data(), change, + sizeof(QChar)); + /* + QString newText; + // we first need to 'take' the leading part of the new change + if( change->offset() < offset() ) { + newText.append( change->oldText(document).mid(0, offset() - + change->offset() ) ); + } + + newText.append(oldText(document)); + + // then we need to append the remainer + int delta = offset()-change->offset(); + int remainerOffset = newLength() + delta; + if( remainerOffset >= 0 ) { + if( remainerOffset < change->oldLength() ) { + //Q_ASSERT(false); // need to figure out if this works + newText.append( change->oldText( document ).mid(remainerOffset ) ); + } + } + + */ + text_ = newText; +} + +/// This method gives the given change to this textchange. The changes will be +/// merged if possible. This method currently only works with executed +/// changes!!! +/// +/// @param document the document +/// @param textChange the textchange to mege +/// @return true on success else false +bool TextChange::giveAndMerge(TextDocument *document, Change *textChange) +{ + Q_UNUSED(document); + TextChange *change = dynamic_cast<TextChange *>(textChange); + if (change) + { + return merge(change); + } + return false; +} + +/// converts the change to a string +QString TextChange::toString() +{ + // return "SingleTextChange"; + return QStringLiteral("SingleTextChange:%1").arg(testString()); +} + +/// Return the offset +/// @return the offset of the change +int TextChange::offset() const +{ + return offset_; +} + +/// set the new offset +/// @param offset the new offset +void TextChange::setOffset(int offset) +{ + offset_ = offset; +} + +/// This is the length in the document +int TextChange::docLength() const +{ + return length_; +} + +/// The content length is the length that's currently stored in memory. +int TextChange::storedLength() const +{ + return text_.size(); +} + +/// Set the length of the change +/// @param len sets the length of the change +void TextChange::setDocLength(int len) +{ + length_ = len; +} + +/// The text currently stored in this textchange +QString TextChange::storedText() const +{ + return text_; +} + +/// Sets the text of this change +/// @param text the new text +void TextChange::setStoredText(const QString &text) +{ + text_ = text; +} + +/// Appends the text to this change +void TextChange::appendStoredText(const QString &text) +{ + text_.append(text); +} + +/// This method returns the text currently in the document +const QString TextChange::docText(TextDocument *doc) const +{ + return doc->textPart(offset_, length_); +} + +/// This method returns a string used for testing +QString TextChange::testString() +{ + return QStringLiteral("%1:%2:%3") + .arg(offset_) + .arg(length_) + .arg(QString(text_).replace("\n", "§")); +} + +/// replaces the text and stores the 'old' content +/// @param document the document to change it for +void TextChange::replaceText(TextDocument *document) +{ + TextBuffer *buffer = document->buffer(); + QString old = buffer->textPart(offset_, length_); + + buffer->replaceText(offset_, length_, text_); + length_ = text_.length(); + text_ = old; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/changes/textchange.h b/lib/edbee-lib/edbee/models/changes/textchange.h new file mode 100644 index 00000000..8c46075a --- /dev/null +++ b/lib/edbee-lib/edbee/models/changes/textchange.h @@ -0,0 +1,61 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QString> + +#include "edbee/models/changes/abstractrangedchange.h" + +namespace edbee +{ + +/// This is the basic text change that's the base of the textchanges +/// +/// This class re-uses the variables offset/length and text. Depending on the +/// undo/redo state these variables contain the new data or the changed data +class EDBEE_EXPORT TextChange : public AbstractRangedChange +{ +public: + TextChange(int offset, int length, const QString &text); + virtual ~TextChange(); + + virtual void execute(TextDocument *document); + virtual void revert(TextDocument *document); + +protected: + virtual void mergeStoredData(AbstractRangedChange *change); + +public: + virtual bool giveAndMerge(TextDocument *document, Change *textChange); + + virtual QString toString(); + + int offset() const; + void setOffset(int offset); + virtual int docLength() const; + virtual int storedLength() const; + + void setDocLength(int len); + + QString storedText() const; + void setStoredText(const QString &text); + void appendStoredText(const QString &text); + const QString docText(TextDocument *doc) const; + + QString testString(); + +protected: + void replaceText(TextDocument *document); + +private: + int offset_; ///< The offset of the text + int length_; ///< the length of the change in the document + QString text_; ///< The text data +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/changes/textchangewithcaret.cpp b/lib/edbee-lib/edbee/models/changes/textchangewithcaret.cpp new file mode 100644 index 00000000..24be0b53 --- /dev/null +++ b/lib/edbee-lib/edbee/models/changes/textchangewithcaret.cpp @@ -0,0 +1,33 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "textchangewithcaret.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +TextChangeWithCaret::TextChangeWithCaret(int offset, int length, + const QString &text, int caret) + : TextChange(offset, length, text) + , caret_(caret) +{ +} + +/// returns the caret position +int TextChangeWithCaret::caret() const +{ + return caret_; +} + +/// Sets the caret position +/// @param caret the caret to set +void TextChangeWithCaret::setCaret(int caret) +{ + caret_ = caret; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/changes/textchangewithcaret.h b/lib/edbee-lib/edbee/models/changes/textchangewithcaret.h new file mode 100644 index 00000000..f67d007b --- /dev/null +++ b/lib/edbee-lib/edbee/models/changes/textchangewithcaret.h @@ -0,0 +1,31 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include "textchange.h" + +namespace edbee +{ + +/// A single text-change with an extra offset which represents the location of +/// the caret. Currently this class is passed a TextDocumentFilter which enables +/// it to alter the caret position I'm in doubt if we really need to implement +/// it this way. +class EDBEE_EXPORT TextChangeWithCaret : public TextChange +{ +public: + TextChangeWithCaret(int offset, int length, const QString &text, int caret); + + int caret() const; + void setCaret(int caret); + +private: + int caret_; ///< The new cret +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/chardocument/chartextbuffer.cpp b/lib/edbee-lib/edbee/models/chardocument/chartextbuffer.cpp new file mode 100644 index 00000000..7449643f --- /dev/null +++ b/lib/edbee-lib/edbee/models/chardocument/chartextbuffer.cpp @@ -0,0 +1,184 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include <QApplication> +#include <QThread> + +#include "chartextbuffer.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// The constructor of the textbuffer +/// @param a reference to the parent +CharTextBuffer::CharTextBuffer(QObject *parent) + : TextBuffer(parent) + , rawAppendStart_(-1) + , rawAppendLineStart_(-1) +{ +} + +/// Returns the length of the buffer +/// @return the length of the given text +int CharTextBuffer::length() const +{ + return buf_.length(); +} + +/// Returns the character at the given character +/// @param offset the offset of the given character +/// @return the character at the given offset +QChar CharTextBuffer::charAt(int offset) const +{ + Q_ASSERT(offset >= 0); + Q_ASSERT(offset < buf_.length()); + return buf_.at(offset); +} + +/// Returns the text part +/// @param pos the position of the given text +/// @param length the length of the text to get +/// @return returns a part of the text +QString CharTextBuffer::textPart(int pos, int length) const +{ + // do NOT use data here. Data moves the gap! + // QString str( buf_.data() + pos, length ); + // return str; + /// buf_.data() + + QString result = buf_.mid(pos, length); + return result; +} + +/// replaces the given text +/// @param offset the offset of the text to replace +/// @param length the length of the text to replace +/// @param buffer a pointer to a buffer with data +/// @param bufferLenth the length of the buffer +void CharTextBuffer::replaceText(int offset, int length, const QChar *buffer, + int bufferLength) +{ + + // make sure the length matches + length = qMin(this->length() - offset, length); + + // make sure the position is correct + if (offset > buf_.length()) + { + offset = buf_.length(); // Qt doesn't append if the position > length + length = 0; + } + + TextBufferChange change(this, offset, length, buffer, bufferLength); + + // emit textAboutToBeReplaced( offset, length, buffer, bufferLength ); + // emit linesAboutToBeReplaced( change.line, change.lineCount, + // change.newLineCount ); + + emit textAboutToBeChanged(change); + + // replace the text + QString oldText = buf_.mid(offset, length); + + buf_.replace(offset, length, buffer, bufferLength); + + // replace the line data and offsets + lineOffsetList_.applyChange(change); + + // emit linesReplaced( change.line, change.lineCount, change.newLineCount + // ); emit textReplaced( offset, length, buffer, bufferLength ); + emit textChanged(change, oldText); +} + +/// Returns the line position at the given offset +/// @param offset the offset to retreive the line from +/// @return the line from the given offset +int CharTextBuffer::lineFromOffset(int offset) +{ + // int result = lineFromOffsetSearch(offset); + int result = lineOffsetList_.findLineFromOffset(offset); + return result; +} + +/// This method returns the offset of the given line +/// @param lin the line to retrieve the offset from +/// @return the offset of the given line +int CharTextBuffer::offsetFromLine(int line) +{ + // const QList<int>& lofs = lineOffsets_; + if (line < 0) + return 0; // at the start + // if( line >= lofs.length() ) return length(); // at the end + // return lofs.at(line); + if (line >= lineOffsetList_.length()) + { + return length(); + } + return lineOffsetList_.at(line); +} + +/// Starts raw data appending to the buffer +void CharTextBuffer::rawAppendBegin() +{ + Q_ASSERT(rawAppendStart_ == -1); + Q_ASSERT(rawAppendLineStart_ == -1); + rawAppendStart_ = length(); + rawAppendLineStart_ = lineCount(); +} + +/// Appends a buffer of text to the document +/// @param data the data to append +/// @param dataLength the number of bytes availble by the data pointer +void CharTextBuffer::rawAppend(const QChar *data, int dataLength) +{ + buf_.append(data, dataLength); +} + +/// Append a single character to the buffer in raw mode +/// @param c the character to append +void CharTextBuffer::rawAppend(QChar c) +{ + buf_.append(c); +} + +/// Ends the 'raw' appending of data +void CharTextBuffer::rawAppendEnd() +{ + Q_ASSERT(rawAppendStart_ >= 0); + Q_ASSERT(rawAppendLineStart_ >= 0); + + // append all the newlines to the vector + /* + int oldLength = lineOffsetList_.length(); + for( int i=rawAppendStart_,len=length(); i<len; ++i ){ + if( charAt(i) == '\n' ) { lineOffsetList_.appendOffset( i+1 ); } + } + int linesAdded = lineOffsetList_.length() - oldLength; + */ + + // emit the about signal + TextBufferChange change(this, rawAppendStart_, 0, + buf_.data() + rawAppendStart_, + buf_.length() - rawAppendStart_); + + emit textAboutToBeChanged(change); + lineOffsetList_.applyChange(change); + emit textChanged(change, QString()); + + rawAppendLineStart_ = -1; + rawAppendStart_ = -1; +} + +/// This method returns the raw data pointer +/// WARNING calling this method moves the gap of the gapvector to the end. Which +/// could involve a lot of data moving +QChar *CharTextBuffer::rawDataPointer() +{ + return buf_.data(); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/chardocument/chartextbuffer.h b/lib/edbee-lib/edbee/models/chardocument/chartextbuffer.h new file mode 100644 index 00000000..5c383be5 --- /dev/null +++ b/lib/edbee-lib/edbee/models/chardocument/chartextbuffer.h @@ -0,0 +1,59 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include "edbee/models/textbuffer.h" +#include "edbee/util/gapvector.h" +#include "edbee/util/lineoffsetvector.h" + +namespace edbee +{ + +/// This textbuffer implementation uses QChars for storing the data. +class EDBEE_EXPORT CharTextBuffer : public TextBuffer +{ +public: + CharTextBuffer(QObject *parent = 0); + + virtual int length() const; + virtual QChar charAt(int offset) const; + virtual QString textPart(int offset, int length) const; + + virtual void replaceText(int offset, int length, const QChar *buffer, + int bufferLength); + + virtual int lineCount() { return lineOffsetList_.length(); } + + virtual int lineFromOffset(int offset); + virtual int offsetFromLine(int line); + + virtual void rawAppendBegin(); + virtual void rawAppend(QChar c); + virtual void rawAppend(const QChar *data, int dataLength); + virtual void rawAppendEnd(); + + virtual QChar *rawDataPointer(); + + /// TODO: Temporary debug method. REMOVE!! + LineOffsetVector &lineOffsetList() { return lineOffsetList_; } + +protected slots: + + void emitTextChanged(edbee::TextBufferChange *change, + QString oldText = QString()); + +private: + QCharGapVector buf_; ///< The textbuffer + LineOffsetVector lineOffsetList_; ///< The line offset vector + + int rawAppendStart_; ///< The start offset of raw appending. -1 means no + ///< appending is happening + int rawAppendLineStart_; ///< The line start +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/chardocument/chartextdocument.cpp b/lib/edbee-lib/edbee/models/chardocument/chartextdocument.cpp new file mode 100644 index 00000000..3cf1c14d --- /dev/null +++ b/lib/edbee-lib/edbee/models/chardocument/chartextdocument.cpp @@ -0,0 +1,171 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "chartextdocument.h" + +#include <QTextCodec> +#include <QApplication> +#include <QThread> + +#include "chartextbuffer.h" +#include "edbee/lexers/grammartextlexer.h" +#include "edbee/models/changes/textchange.h" +#include "edbee/models/textautocompleteprovider.h" +#include "edbee/models/textgrammar.h" +#include "edbee/models/textdocumentscopes.h" +#include "edbee/models/texteditorconfig.h" +#include "edbee/models/textlinedata.h" +#include "edbee/models/textundostack.h" +#include "edbee/edbee.h" +#include "edbee/util/lineending.h" +#include "edbee/util/textcodec.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// The main contstructor of the chartext document +CharTextDocument::CharTextDocument(QObject *object) + : TextDocument(object) + , config_(0) + , textBuffer_(0) + , textScopes_(0) + , textLexer_(0) + , textCodecRef_(0) + , lineEndingRef_(0) + , textUndoStack_(0) + , autoCompleteProviderList_(0) +{ + Q_ASSERT_GUI_THREAD; + + textBuffer_ = new CharTextBuffer(); + config_ = new TextEditorConfig(); + + textScopes_ = new TextDocumentScopes(this); + + textCodecRef_ = Edbee::instance()->codecManager()->codecForName("UTF-8"); + lineEndingRef_ = LineEnding::unixType(); + + // create the text scopes and lexer + textLexer_ = new GrammarTextLexer(scopes()); + + // create the undo stack + textUndoStack_ = new TextUndoStack(this); + + // create the autocomplete provider (with the global parent provider) + autoCompleteProviderList_ = new TextAutoCompleteProviderList( + Edbee::instance()->autoCompleteProviderList()); + + // simply forward the about to change signal + connect(textBuffer_, SIGNAL(textAboutToBeChanged(edbee::TextBufferChange)), + SIGNAL(textAboutToBeChanged(edbee::TextBufferChange)), + Qt::DirectConnection); + connect(textBuffer_, SIGNAL(textChanged(edbee::TextBufferChange, QString)), + SLOT(textBufferChanged(edbee::TextBufferChange, QString)), + Qt::DirectConnection); + + // forward the persisted state changes + connect(textUndoStack_, SIGNAL(persistedChanged(bool)), this, + SIGNAL(persistedChanged(bool))); + + connect(textScopes_, SIGNAL(lastScopedOffsetChanged(int, int)), this, + SIGNAL(lastScopedOffsetChanged(int, int))); +} + +/// The default constructor +CharTextDocument::~CharTextDocument() +{ + delete autoCompleteProviderList_; + delete textUndoStack_; + delete textLexer_; + delete textScopes_; + delete textBuffer_; + delete config_; +} + +/// Returns the active textbuffer +TextBuffer *CharTextDocument::buffer() const +{ + return textBuffer_; +} + +/// returns the language grammar +TextGrammar *CharTextDocument::languageGrammar() +{ + return textLexer_->grammar(); +} + +/// Sets the language grammar +void CharTextDocument::setLanguageGrammar(TextGrammar *grammar) +{ + TextGrammar *oldGrammar = languageGrammar(); + textLexer_->setGrammar(grammar); + if (oldGrammar != grammar) + { + emit languageGrammarChanged(); + } +} + +/// Returns the autocmoplete provider list +TextAutoCompleteProviderList *CharTextDocument::autoCompleteProviderList() +{ + return autoCompleteProviderList_; +} + +/// This method returns the configuration +TextEditorConfig *CharTextDocument::config() const +{ + return config_; +} + +// currently not implemented +// TextLineData* CharTextDocument::takeLineData(int line, int field) +//{ +// return textLineDataManager_->take( line, field ); +//} + +/// Gives a change to the undo stack without invoking the filter +/// @param change the change to execute +/// @param coalesceId the coalescing identifier +Change *CharTextDocument::giveChangeWithoutFilter(Change *change, + int coalesceId) +{ + return textUndoStack()->giveChange(change, coalesceId); +} + +/// This method replaces the given text via the undo-button +// void CharTextDocument::replaceTextWithoutFilter( int offset, int length, +// const QString& text ) +//{ +// SingleTextChange *textChange = new SingleTextChange( offset, length, +// text); textUndoStack()->giveAndExecuteChange( textChange, true ); +// } + +// the text is changed +void CharTextDocument::textBufferChanged(const TextBufferChange &change, + QString oldText) +{ + if (textLexer_) + { + textLexer_->textChanged(change); + } + + // execute the line change + if (!isUndoOrRedoRunning()) + { + Change *lineDataChange = lineDataManager()->createLinesReplacedChange( + change.line() + 1, change.lineCount(), change.newLineCount()); + if (lineDataChange) + { + executeAndGiveChange(lineDataChange, 0); + } + } + + // emit the textchanged singal + emit textChanged(change, oldText); // and notify the document listeners +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/chardocument/chartextdocument.h b/lib/edbee-lib/edbee/models/chardocument/chartextdocument.h new file mode 100644 index 00000000..e5462c19 --- /dev/null +++ b/lib/edbee-lib/edbee/models/chardocument/chartextdocument.h @@ -0,0 +1,99 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QObject> +#include <QHash> + +#include "edbee/models/textdocument.h" + +namespace edbee +{ + +class TextCodec; +class TextDocumentFilter; +class TextDocumentScopes; +class TextEditorConfig; +class TextLineDataManager; +class TextBufferChange; + +/// A plain textdocument. A document with simple character-buffer implementation +class EDBEE_EXPORT CharTextDocument : public TextDocument +{ + Q_OBJECT + +public: + CharTextDocument(QObject *object = 0); + virtual ~CharTextDocument(); + + /// This method should return the active textbuffer + virtual TextBuffer *buffer() const; + + /// Should return the document-scopes of this document + virtual TextDocumentScopes *scopes() { return textScopes_; } + + /// This method returns the current encoding + virtual TextCodec *encoding() { return textCodecRef_; } + + /// Sets the encoding + virtual void setEncoding(TextCodec *codec) + { + Q_ASSERT(codec); + textCodecRef_ = codec; + } + + /// This method should return the current line ending + virtual const edbee::LineEnding *lineEnding() { return lineEndingRef_; } + + /// Set the used line ending + virtual void setLineEnding(const edbee::LineEnding *lineEnding) + { + Q_ASSERT(lineEnding); + lineEndingRef_ = lineEnding; + } + + /// Should return the current document lexer + virtual TextLexer *textLexer() { return textLexer_; } + + /// This method should return the current language grammar + virtual TextGrammar *languageGrammar(); + virtual void setLanguageGrammar(TextGrammar *grammar); + + /// Returns the the autocomplete provider list + virtual TextAutoCompleteProviderList *autoCompleteProviderList(); + + /// returns the text undo stack + virtual TextUndoStack *textUndoStack() { return textUndoStack_; } + + virtual TextEditorConfig *config() const; + + virtual Change *giveChangeWithoutFilter(Change *change, int coalesceId); + +protected slots: + // virtual void textReplaced( int offset, int length, const QChar* data, + // int dataLength ); virtual void linesReplaced( int line, int lineCount, + // int newLineCount ); + virtual void textBufferChanged(const edbee::TextBufferChange &change, + QString oldText = QString()); + +private: + TextEditorConfig *config_; ///< The text editor configuration + TextBuffer *textBuffer_; ///< The textbuffers + + TextDocumentScopes *textScopes_; ///< The text document scopes + TextLexer *textLexer_; ///< The lexer used for finding the scopes + + TextCodec *textCodecRef_; ///< The used encoding + const edbee::LineEnding *lineEndingRef_; ///< The used line-ending + + TextUndoStack *textUndoStack_; ///< The text undo stack + TextAutoCompleteProviderList + *autoCompleteProviderList_; ///< The Auto Complete Provide list +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/dynamicvariables.cpp b/lib/edbee-lib/edbee/models/dynamicvariables.cpp new file mode 100644 index 00000000..c165baf9 --- /dev/null +++ b/lib/edbee-lib/edbee/models/dynamicvariables.cpp @@ -0,0 +1,160 @@ +/** + * Copyright 2011-2014 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "dynamicvariables.h" + +#include "edbee/models/textdocumentscopes.h" +#include "edbee/models/textdocument.h" +#include "edbee/models/textdocumentscopes.h" +#include "edbee/texteditorcontroller.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// empty virtual destructor +DynamicVariable::~DynamicVariable() {} + +//-------------------------------- + +/// Constructs a basic dynamic (read static :P ) variable +BasicDynamicVariable::BasicDynamicVariable(const QVariant &value) + : value_(value) +{ +} + +/// returns value of the variable +QVariant BasicDynamicVariable::value() const +{ + return value_; +} + +//-------------------------------- + +/// constructs a dynamic variable +/// @param value the value of the variable +/// @param selector (default=0) the selector to use. This class takes ownership +/// of the selector!! +ScopedDynamicVariable::ScopedDynamicVariable(const QVariant &value, + TextScopeSelector *selector) + : BasicDynamicVariable(value) + , selector_(selector) +{ +} + +/// destructs the variable +ScopedDynamicVariable::~ScopedDynamicVariable() +{ + delete selector_; +} + +/// returns the score for the location +double ScopedDynamicVariable::score(TextScopeList *scopes) const +{ + return selector()->calculateMatchScore(scopes); +} + +/// returns the active selector +TextScopeSelector *ScopedDynamicVariable::selector() const +{ + return selector_; +} + +//-------------------------------- + +/// default constructor +DynamicVariables::DynamicVariables() {} + +/// Destructs all variables +DynamicVariables::~DynamicVariables() +{ + qDeleteAll(variableMap_); + qDeleteAll(scopedVariableMap_); +} + +/// defines a dynamic variable and gives to the dynamic variables environment +/// @param name the name of the variable to set +/// @param value the value of the variable +/// @param scopes the scope selector +void DynamicVariables::setAndGiveScopedSelector(const QString &name, + const QVariant &value, + const QString &selector) +{ + /// Todo, perhaps we should detect identical scope selectors and replace the + /// original + variableNames_.insert(name); + scopedVariableMap_.insert( + name, new ScopedDynamicVariable(value, new TextScopeSelector(selector))); +} + +/// Sets the given static variable to the given value +/// @param name the name of the +void DynamicVariables::set(const QString &name, const QVariant &value) +{ + delete variableMap_.value(name); // delete the old one + variableNames_.insert(name); + variableMap_.insert(name, new BasicDynamicVariable(value)); +} + +/// Returns the number of variables available +/// @return the number of variable names. (there can be more values as +/// variables) +int DynamicVariables::size() const +{ + return variableNames_.size(); +} + +/// returns the number of variable-rules/entries available with the given name +/// @param name the name of the variable to retrieve the size for +/// @return the number of variables entires with the given name +int DynamicVariables::valueCount(const QString &name) const +{ + return scopedVariableMap_.count(name) + variableMap_.count(name); +} + +/// Finds the variable for the given condition +/// @param name the name of the variable to search +/// @param scopeList the scope list to find the variable for +DynamicVariable *DynamicVariables::find(const QString &name, + TextScopeList *scopelist) +{ + // qlog_info() << "name: " << name << "," << scopelist->toString(); + // the initial result is no variable found + DynamicVariable *result = variableMap_.value(name); + double resultScore = -0.01; + if (scopelist) + { + foreach (ScopedDynamicVariable *var, scopedVariableMap_.values(name)) + { + double score = var->score(scopelist); + // qlog_info() << "- " << var->value() << ": score: " << score << " > " + // << resultScore; + + // the variable is only found if the score is better + if (score > resultScore) + { + resultScore = score; + result = var; + } + } + } + return result; +} + +/// Returns the value at the given position +/// @param name the name of the variable +/// @param scopeList the scope list to find the variable for +QVariant DynamicVariables::value(const QString &name, TextScopeList *scopelist) +{ + DynamicVariable *var = find(name, scopelist); + if (var) + { + return var->value(); + } + return QVariant(); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/dynamicvariables.h b/lib/edbee-lib/edbee/models/dynamicvariables.h new file mode 100644 index 00000000..8930d624 --- /dev/null +++ b/lib/edbee-lib/edbee/models/dynamicvariables.h @@ -0,0 +1,88 @@ +/** + * Copyright 2011-2014 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QMultiMap> +#include <QSet> +#include <QString> +#include <QVariant> + +namespace edbee +{ + +class TextScopeList; +class TextScopeSelector; + +/// The abstract base class for a dynamic variable +class EDBEE_EXPORT DynamicVariable +{ +public: + virtual ~DynamicVariable(); + virtual QVariant value() const = 0; +}; + +//-------------------------------- + +/// A static dynamic variable :P +class EDBEE_EXPORT BasicDynamicVariable : public DynamicVariable +{ +public: + BasicDynamicVariable(const QVariant &value); + virtual QVariant value() const; + +private: + QVariant value_; ///< The value of this variable (when this scope is selected) +}; + +//-------------------------------- + +/// A class that specifies a dynamic variabele with a scope selector +class EDBEE_EXPORT ScopedDynamicVariable : public BasicDynamicVariable +{ +public: + ScopedDynamicVariable(const QVariant &value, TextScopeSelector *selector = 0); + virtual ~ScopedDynamicVariable(); + + virtual double score(TextScopeList *scopes) const; + TextScopeSelector *selector() const; + +private: + TextScopeSelector + *selector_; ///< The selector that matches this dynamic variable +}; + +//-------------------------------- + +/// This class is used for remembering/managing dynamic variables +/// This are a kind of environment variables that are dependent on the given +/// context +class EDBEE_EXPORT DynamicVariables +{ +public: + DynamicVariables(); + virtual ~DynamicVariables(); + + void setAndGiveScopedSelector(const QString &name, const QVariant &value, + const QString &selector); + void set(const QString &name, const QVariant &value); + + int size() const; + int valueCount(const QString &name) const; + + DynamicVariable *find(const QString &name, TextScopeList *scopelist); + QVariant value(const QString &name, TextScopeList *scopeList = 0); + +private: + QSet<QString> variableNames_; ///< A set with all unique variable names + QMap<QString, BasicDynamicVariable *> + variableMap_; ///< The static variable map + QMultiMap<QString, ScopedDynamicVariable *> + scopedVariableMap_; ///< A map with all scoped variables. +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textautocompleteprovider.cpp b/lib/edbee-lib/edbee/models/textautocompleteprovider.cpp new file mode 100644 index 00000000..54c3443d --- /dev/null +++ b/lib/edbee-lib/edbee/models/textautocompleteprovider.cpp @@ -0,0 +1,219 @@ +#include "textautocompleteprovider.h" + +#include "edbee/models/texteditorconfig.h" +#include "edbee/models/textdocument.h" +#include "edbee/models/textdocumentscopes.h" +#include "edbee/models/textgrammar.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// @param kind the kind of autocomplete items (Use a Langserver constant) +TextAutoCompleteItem::TextAutoCompleteItem(const QString &label, const int kind, + const QString &detail, + const QString &documentation) + : label_(label) + , kind_(kind) + , detail_(detail) + , documentation_(documentation) +{ +} + +/// returns the autocmomplete label +QString TextAutoCompleteItem::label() const +{ + return label_; +} + +int TextAutoCompleteItem::kind() const +{ + return kind_; +} + +QString TextAutoCompleteItem::detail() const +{ + return detail_; +} + +QString TextAutoCompleteItem::documentation() const +{ + return documentation_; +} + +/// Compares the given text-autocomplete item with the label +/// This method should return a match score, where a score of 0 means NO match +/*! \fn int TextAutoCompleteItem::matchLabelScore(TextDocument *document, const TextRange &range, const QString &word) + Returns a copy of the \a str string. The given string is converted + to Unicode using the fromUtf8() function. + \sa fromLatin1(), fromLocal8Bit(), fromUtf8(), QByteArray::fromStdString() +*/ +int TextAutoCompleteItem::matchLabelScore(TextDocument *doc, const TextRange &, + const QString &word) +{ + /// For now a simple prefix-prefix search. Later fuzzy search. + /// Inspiration: + /// - + /// https://www.quora.com/How-is-the-fuzzy-search-algorithm-in-Sublime-Text-designed-How-would-you-design-something-similar) + /// - https://github.com/renstrom/fuzzysearch + /// We probably need to calculate a score + if (word.length() < doc->config()->autocompleteMinimalCharacters()) + return 0; + if (label_ == word) + { + return 1; + } + else if (label_.toLower().startsWith(word.toLower())) + { + return 2; + } + else if (label_.toLower().contains(word.toLower())) + { + return 3; + } + else + { + return 0; + } +} + +// ----------------------------- + +/// Adds the given string to the list +StringTextAutoCompleteProvider::~StringTextAutoCompleteProvider() +{ + qDeleteAll(itemList_); +} + +/// Search auto-complete items in the list +QList<TextAutoCompleteItem *> +StringTextAutoCompleteProvider::findAutoCompleteItemsForRange( + TextDocument *document, const TextRange &range, const QString &word) +{ + QMultiMap<int, TextAutoCompleteItem *> items; + + foreach (TextAutoCompleteItem *item, itemList_) + { + int match = item->matchLabelScore(document, range, word); + if (match && match == 1 + && item->kind() == edbee::TextAutoCompleteKind::Keyword) + { + items.clear(); + return items.values(); + } + else if (match && item->kind() != edbee::TextAutoCompleteKind::Keyword) + { + items.insert(match, item); + } + } + + if (items.size() == 1 && items.contains(1)) + { + items.clear(); + return items.values(); + } + return items.values(); +} + +/// directly add a label +void StringTextAutoCompleteProvider::add(const QString &label, const int kind, + const QString &detail, + const QString &documentation) +{ + itemList_.push_back(new TextAutoCompleteItem( + label, kind, detail == "" && kind == 3 ? label + "()" : detail, + documentation)); +} + +/// gives the given autocomplete item +void StringTextAutoCompleteProvider::give(TextAutoCompleteItem *item) +{ + itemList_.push_back(item); +} + +// ------------------------------ + +TextAutoCompleteProviderList::TextAutoCompleteProviderList( + TextAutoCompleteProvider *parentProvider) + : parentProviderRef_(parentProvider) +{ +} + +TextAutoCompleteProviderList::~TextAutoCompleteProviderList() +{ + qDeleteAll(providerList_); +} + +/// builds an auto-complete list by querying all providers +QList<TextAutoCompleteItem *> +TextAutoCompleteProviderList::findAutoCompleteItemsForRange( + TextDocument *document, const TextRange &range, const QString &word) +{ + QList<TextAutoCompleteItem *> result; + foreach (TextAutoCompleteProvider *provider, providerList_) + { + result.append( + provider->findAutoCompleteItemsForRange(document, range, word)); + } + if (parentProviderRef_) + { + result.append(parentProviderRef_->findAutoCompleteItemsForRange( + document, range, word)); + } + return result; +} + +/// adds a provider +void TextAutoCompleteProviderList::giveProvider( + TextAutoCompleteProvider *provider) +{ + providerList_.push_back(provider); +} + +/// set the parent provider +void TextAutoCompleteProviderList::setParentProvider( + TextAutoCompleteProvider *provider) +{ + parentProviderRef_ = provider; +} + +// ----------------------------- +/* + + +/// retuns all auto complete items for the given list +QList<TextAutoCompleteItem *> +ScopeBasedTextAutoCompleteProvider::findAutoCompleteItemsForRange(TextDocument +*document, TextRange &range) +{ +// TextScopeList scopes = document->scopes()->scopesAtOffset(range.caret()); +// if( scopes.cont) + /// TODO: Not yet implemented + + return QList<TextAutoCompleteItem*>(); +} + +*/ + +// ----------------------------- +/* + +TextAutoCompleteManager::TextAutoCompleteManager() +{ +} + +TextAutoCompleteManager::~TextAutoCompleteProvider() +{ + qDeleteAll(providerList_); +} + +void +TextAutoCompleteManager::giveProvider(TextAutoCompleteManager::~TextAutoCompleteProvider +*provider) +{ + providerList_.append(provider); +} +*/ + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textautocompleteprovider.h b/lib/edbee-lib/edbee/models/textautocompleteprovider.h new file mode 100644 index 00000000..65b2a829 --- /dev/null +++ b/lib/edbee-lib/edbee/models/textautocompleteprovider.h @@ -0,0 +1,185 @@ +#pragma once + +#include "edbee/exports.h" + +#include <QList> +#include <QString> +#include <QMultiMap> +#include <QStandardItemModel> +#include <QSortFilterProxyModel> +#include <QStandardItem> + +namespace edbee +{ + +class TextDocument; +class TextRange; + +// We don't have lang-server support, but for future support, the constants of +// langserver are used +// https://microsoft.github.io/language-server-protocol/specifications/specification-3-14/#textDocument_completion +namespace TextAutoCompleteKind +{ +enum TextAutoCompleteKindEnum +{ + Text = 1, + Method = 2, + Function = 3, + Constructor = 4, + Field = 5, + Variable = 6, + Class = 7, + Interface = 8, + Module = 9, + Property = 10, + Unit = 11, + Value = 12, + Enum = 13, + Keyword = 14, + Snippet = 15, + Color = 16, + File = 17, + Reference = 18, + Folder = 19, + EnumMember = 20, + Constant = 21, + Struct = 22, + Event = 23, + Operator = 24, + TypeParameter = 25 +}; +} + +/// An autocomplete item that is being returned +/// Currently simply a string. +/// It is placed in a separate class for future extensions (LSP: +/// https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#textDocument_completion) +class EDBEE_EXPORT TextAutoCompleteItem +{ +public: + TextAutoCompleteItem(const QString &label, const int kind = 0, + const QString &detail = "", + const QString &documentation = ""); + QString label() const; + int kind() const; + QString detail() const; + QString documentation() const; + + int matchLabelScore(TextDocument *document, const TextRange &range, + const QString &word); + +protected: + QString label_; + int kind_; + QString detail_; + QString documentation_; +}; + +/// A base autocomplete provider +class EDBEE_EXPORT TextAutoCompleteProvider +{ +public: + virtual ~TextAutoCompleteProvider() {} + virtual QList<TextAutoCompleteItem *> + findAutoCompleteItemsForRange(TextDocument *document, const TextRange &range, + const QString &word) + = 0; +}; + +/// a fixed stringlist autocompleter +class EDBEE_EXPORT StringTextAutoCompleteProvider + : public TextAutoCompleteProvider +{ +public: + virtual ~StringTextAutoCompleteProvider(); + virtual QList<TextAutoCompleteItem *> + findAutoCompleteItemsForRange(TextDocument *document, const TextRange &range, + const QString &word); + + virtual void add(const QString &label, const int kind = 0, + const QString &detail = "", + const QString &documentation = ""); + virtual void give(TextAutoCompleteItem *item); + +protected: + QList<TextAutoCompleteItem *> itemList_; +}; + +/// The instance autocomplete provider, managers which autocompleters are +/// available for the given editor. +/// +/// The idea is the following +/// TextDocument -> TextAutoCompleteProvider +/// -> Static provider for the current editor +/// -> Dynamic document content autocompletion provider +/// -> Reference to Global autocompletion +/// -> .. add custom local providers.. +/// Edbee +/// -> TextAutoCompleteManager +/// -> plain text autocomplete provider global +/// -> Scope Autocompleter +/// -> .. add custom global providers .. +/// +class EDBEE_EXPORT TextAutoCompleteProviderList + : public TextAutoCompleteProvider +{ +public: + TextAutoCompleteProviderList(TextAutoCompleteProvider *parentProvider = 0); + virtual ~TextAutoCompleteProviderList(); + + virtual QList<TextAutoCompleteItem *> + findAutoCompleteItemsForRange(TextDocument *document, const TextRange &range, + const QString &word); + virtual void giveProvider(TextAutoCompleteProvider *provider); + virtual void setParentProvider(TextAutoCompleteProvider *provider); + +protected: + QList<TextAutoCompleteProvider *> + providerList_; ///< The autocomplete provider list + TextAutoCompleteProvider + *parentProviderRef_; ///< A reference to the global autocomplete provider +}; + +/* +/// a grammar based autocomplete list +class EDBEE_EXPORT ScopeBasedTextAutoCompleteProvider : public +TextAutoCompleteProvider +{ +public: + virtual QList<TextAutoCompleteItem*> findAutoCompleteItemsForRange( +TextDocument* document, TextRange& range ); + +protected: + /// TODO: Add a scope-based list with autocomplete listgs :S +}; + + +/// a texteditor widget specific provider +class EDBEE_EXPORT TextEditorSpecificTextAutoCompleteProvider : public +TextAutoCompleteProvider +{ +public: + virtual QList<TextAutoCompleteItem*> findAutoCompleteItemsForRange( +TextDocument* document, TextRange& range ); + +}; + + + + +/// This class is used to manage the automcomplete provider +class EDBEE_EXPORT TextAutoCompleteManager { +public: + TextAutoCompleteManager(); + virtual ~TextAutoCompleteProvider(); + + void giveProvider(TextAutoCompleteProvider* provider); + +protected: + + QList<TextAutoCompleteProvider*> providerList_; +}; + +*/ + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textbuffer.cpp b/lib/edbee-lib/edbee/models/textbuffer.cpp new file mode 100644 index 00000000..fb9d3244 --- /dev/null +++ b/lib/edbee-lib/edbee/models/textbuffer.cpp @@ -0,0 +1,318 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "textbuffer.h" + +#include "edbee/models/textrange.h" +#include "edbee/util/lineoffsetvector.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// Initializes the textbuffer change +/// @param buffer when buffer is 0 NO line calculation is done +TextBufferChangeData::TextBufferChangeData(TextBuffer *buffer, int off, int len, + const QChar *text, int textlen) + : offset_(off) + , length_(len) + , newText_(text) + , newTextLength_(textlen) + , newLineOffsets_() +{ + Q_ASSERT(buffer); + + // decide which lines + line_ = buffer->lineFromOffset(offset_); + int endLine = buffer->lineFromOffset(offset_ + length_); + lineCount_ = endLine - line_; + Q_ASSERT(lineCount_ >= 0); + + // find the newlines in the text + for (int i = 0; i < newTextLength_; ++i) + { + if (newText_[i] == '\n') + { + newLineOffsets_.append( + offset_ + i + + 1); // +1 because it points to the start of the next line + } + } +} + +/// Initializes the textbuffer change +/// @param buffer when buffer is 0 NO line calculation is done +TextBufferChangeData::TextBufferChangeData(LineOffsetVector *lineOffsets, + int off, int len, const QChar *text, + int textlen) + : offset_(off) + , length_(len) + , newText_(text) + , newTextLength_(textlen) + , newLineOffsets_() +{ + Q_ASSERT(lineOffsets); + + // decide which lines + line_ = lineOffsets->findLineFromOffset(offset_); + int endLine = lineOffsets->findLineFromOffset(offset_ + length_); + lineCount_ = endLine - line_; + Q_ASSERT(lineCount_ >= 0); + + // find the newlines in the text + for (int i = 0; i < newTextLength_; ++i) + { + if (newText_[i] == '\n') + { + newLineOffsets_.append( + offset_ + i + + 1); // +1 because it points to the start of the next line + } + } +} + +TextBufferChange::TextBufferChange() +{ + d_ = new TextBufferChangeData((TextBuffer *)0, 0, 0, 0, 0); +} + +TextBufferChange::TextBufferChange(TextBuffer *buffer, int off, int len, + const QChar *text, int textlen) +{ + d_ = new TextBufferChangeData(buffer, off, len, text, textlen); +} + +TextBufferChange::TextBufferChange(LineOffsetVector *lineOffsets, int off, + int len, const QChar *text, int textlen) +{ + d_ = new TextBufferChangeData(lineOffsets, off, len, text, textlen); +} + +TextBufferChange::TextBufferChange(const TextBufferChange &other) + : d_(other.d_) +{ +} + +//===================================================== + +/// The textbuffer constructor +TextBuffer::TextBuffer(QObject *parent) + : QObject(parent) +{ +} + +/// Replaces the given text +/// @param offset the offset to replace +/// @param length the of the text to replace +/// @param text the new text to insert +void TextBuffer::replaceText(int offset, int length, const QString &text) +{ + replaceText(offset, length, text.data(), text.length()); +} + +/// Returns the full text as a QString +QString TextBuffer::text() +{ + return textPart(0, length()); +} + +/// A convenient method for directly filling the textbuffer with the given +/// content +void TextBuffer::setText(const QString &text) +{ + replaceText(0, length(), text.data(), text.length()); +} + +/// this method translates the given position to a column number. +/// @param offset the character offset +/// @param line the line index this position is on. (Use this argument for +/// optimization if you already know this) +int TextBuffer::columnFromOffsetAndLine(int offset, int line) +{ + if (line < 0) + line = lineFromOffset(offset); + // const QList<int>& lofs = lineOffsets(); + if (line < lineCount()) + { + int col = offset - offsetFromLine(line); + if (col < 0) + return 0; + return qMin(lineLength(line), col); + } + else + { + return 0; + } +} + +/// Appends the given text to the textbuffer +/// @param text the text to appendf +void TextBuffer::appendText(const QString &text) +{ + replaceText(length(), 0, text.data(), text.length()); +} + +/// This method returns the offset from the give line and column +/// If the column exceed the number of column the caret is placed just before +/// the newline +int TextBuffer::offsetFromLineAndColumn(int line, int col) +{ + int offsetLine = offsetFromLine(line); + int offsetNextLine = offsetFromLine(line + 1); + int offset = offsetLine + col; + if (offset >= offsetNextLine && offset < length()) + { + --offset; + } + return offset; +} + +/// Returns the line at the given line position. This line INCLUDES the newline +/// character (if it's there) +/// @param line the line to return +QString TextBuffer::line(int line) +{ + int off = offsetFromLine(line); + int endOff = offsetFromLine(line + 1); + return textPart(off, endOff - off); // skip the return +} + +/// Returns the line without the newline character +QString TextBuffer::lineWithoutNewline(int line) +{ + int off = offsetFromLine(line); + int removeNewlineCount = 1; + if (line == lineCount() - 1) + { + removeNewlineCount = 0; + } + return textPart(off, offsetFromLine(line + 1) - off + - removeNewlineCount); // skip the return +} + +/// Returns the length of the given line. Also counting the trailing newline +/// character if present +/// @param line the line to retrieve the length for +/// @return the length of the given line +int TextBuffer::lineLength(int line) +{ + return offsetFromLine(line + 1) - offsetFromLine(line); +} + +/// Returns the length of the given line. Without counting a trailing newline +/// character +/// @param line the line to retrieve the length for +/// @return the length of the given line +int TextBuffer::lineLengthWithoutNewline(int line) +{ + int removeNewlineCount = 1; + if (line == lineCount() - 1) + { + removeNewlineCount = 0; + } + int lastOffset = offsetFromLine(line + 1) - removeNewlineCount; + return lastOffset - offsetFromLine(line); +} + +/// replace the texts +/// @param range the range to replace +/// @param text the text to insert at the given location +void TextBuffer::replaceText(const TextRange &range, const QString &text) +{ + return replaceText(range.min(), range.length(), text.data(), text.length()); +} + +/// See documentation at findCharPosWithinRange +/// @param offset the offset to start searching +/// @parm direction the direction (left < 0, or right > 0 ) +/// @param chars the chars to search +/// @param equals when setting to true if will search for the first given char. +/// When false it will stop when another char is found +int TextBuffer::findCharPos(int offset, int direction, const QString &chars, + bool equals) +{ + return findCharPosWithinRange(offset, direction, chars, equals, 0, length()); +} + +/// This method finds the find the first character position that equals the +/// given char +/// +/// @param offset the offset to search from. A negative offset means the CURRENT +/// character isn't used +/// @param direction the direction to search. If the direction is multiple. the +/// nth item is returned +/// @param chars the character direction +/// @param equals when setting to true if will search for the first given char. +/// When false it will stop when another char is found +/// @param beginRange the start of the range to search in +/// @param endRange the end of the range to search in (exclusive) +/// @return the offset of the first character +int TextBuffer::findCharPosWithinRange(int offset, int direction, + const QString &chars, bool equals, + int beginRange, int endRange) +{ + int charStep = direction < 0 ? -1 : 1; + int charNumber = qAbs(direction); + + while (beginRange <= offset && offset < endRange) + { + if (chars.contains(charAt(offset)) == equals) + { + if (--charNumber <= 0) + { + return offset; + } + } + offset += charStep; + } + return -1; +} + +/// See documentation at findCharPosWithinRange. +/// This method searches a char position within the given rang (from the given +/// ofset) +int TextBuffer::findCharPosOrClamp(int offset, int direction, + const QString &chars, bool equals) +{ + return findCharPosWithinRangeOrClamp(offset, direction, chars, equals, 0, + length()); +} + +/// See documentation at findCharPosWithinRange. +/// This method searches a char position within the given rang (from the given +/// ofset) +int TextBuffer::findCharPosWithinRangeOrClamp(int offset, int direction, + const QString &chars, bool equals, + int beginRange, int endRange) +{ + int pos = findCharPosWithinRange(offset, direction, chars, equals, beginRange, + endRange); + if (pos < 0) + { + if (direction < 0) + return beginRange; + if (direction > 0) + return endRange; + } + return pos; +} + +// This method converts the line offsets as a comma-seperated string (easy for +// debugging) +QString TextBuffer::lineOffsetsAsString() +{ + QString str; + for (int idx = 0, cnt = lineCount(); idx < cnt; ++idx) + { + int offset = offsetFromLine(idx); + if (!str.isEmpty()) + str.append(','); + str.append(QStringLiteral("%1").arg(offset)); + } + return str; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textbuffer.h b/lib/edbee-lib/edbee/models/textbuffer.h new file mode 100644 index 00000000..c74d8692 --- /dev/null +++ b/lib/edbee-lib/edbee/models/textbuffer.h @@ -0,0 +1,169 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QObject> +#include <QVector> +#include <QSharedData> +#include <QExplicitlySharedDataPointer> + +namespace edbee +{ + +class TextBuffer; +class TextBufferChange; +class TextRange; +class TextLineData; +class LineOffsetVector; + +class EDBEE_EXPORT TextBufferChangeData : public QSharedData +{ +public: + TextBufferChangeData(TextBuffer *buffer, int off, int len, const QChar *text, + int textlen); + TextBufferChangeData(LineOffsetVector *lineOffsets, int off, int len, + const QChar *text, int textlen); + + // text information + int offset_; ///< The offset in the buffer + int length_; ///< The number of chars to replaced + const QChar *newText_; ///< The reference to a new text + int newTextLength_; ///< The length of this text + + // line informationm + int line_; ///< The line number were the change occured + int lineCount_; ///< the number of lines that are involved. + QVector<int> newLineOffsets_; ///< A list of new line offset +}; + +/// This clas represents a text buffer change and is used to pass around between +/// events This is a shareddata object so the data can be thrown between +/// different threads (delayed emit-support)_ +/// TODO: Still problematic maybe the QChar* text pointer. It is possible that +/// this pointer is being freed. +class EDBEE_EXPORT TextBufferChange +{ +public: + TextBufferChange(); + TextBufferChange(TextBuffer *buffer, int off, int len, const QChar *text, + int textlen); + TextBufferChange(LineOffsetVector *lineOffsets, int off, int len, + const QChar *text, int textlen); + TextBufferChange(const TextBufferChange &other); + + int offset() const { return d_->offset_; } + int length() const { return d_->length_; } + const QChar *newText() const { return d_->newText_; } + int newTextLength() const { return d_->newTextLength_; } + int line() const { return d_->line_; } + int lineCount() const { return d_->lineCount_; } + inline int newLineCount() const { return d_->newLineOffsets_.size(); } + const QVector<int> &newLineOffsets() const { return d_->newLineOffsets_; } + +private: + QExplicitlySharedDataPointer<TextBufferChangeData> d_; +}; + +/// This class represents the textbuffer of the editor +class EDBEE_EXPORT TextBuffer : public QObject +{ + Q_OBJECT + +public: + TextBuffer(QObject *parent = 0); + + // Minimal abstract interface to implement + + /// should return the number of 'characters'. + virtual int length() const = 0; + + /// A method for returning a single char + virtual QChar charAt(int offset) const = 0; + + /// return the given text. + virtual QString textPart(int offset, int length) const = 0; + + /// this method should replace the given text + /// And fire a 'text-replaced' signal + virtual void replaceText(int offset, int length, const QChar *buffer, + int bufferLength) + = 0; + + /// this method should return an array with all line offsets. A line offset + /// pointsto the START of a line So it does NOT point to a newline character, + /// but it points to the first character AFTER the newline character + virtual int lineCount() = 0; // { return lineOffsets().length(); } + virtual int lineFromOffset(int offset) = 0; + virtual int offsetFromLine(int line) = 0; + + // raw loading methods + + /// This method starts raw appending + virtual void rawAppendBegin() = 0; + + /// this method should append the given character to the buffer + virtual void rawAppend(QChar c) = 0; + + /// This method should raw append the given character string + virtual void rawAppend(const QChar *data, int dataLength) = 0; + + /// the end raw append method should bring the document in a consistent state + /// and emit the correct "replaceText" signals + /// + /// WARNING the textAboutToBeReplaced signals are given but at that moment the + /// text is already replaced And the newlines are already added to the newline + /// list! + virtual void rawAppendEnd() = 0; + + /// This method returns the raw data buffer. + /// WARNING this method CAN be slow because when using a gapvector the gap is + /// moved to the end to make a full buffer Modifying the content of the data + /// will mess up the line-offset-vector and other dependent classes. For + /// reading it's ok :-) + virtual QChar *rawDataPointer() = 0; + + // easy functions + + /// Replace the given text. + virtual void replaceText(int offset, int length, const QString &text); + + QString text(); + void setText(const QString &text); + virtual int columnFromOffsetAndLine(int offset, int line = -1); + virtual void appendText(const QString &text); + virtual int offsetFromLineAndColumn(int line, int col); + virtual QString line(int line); + virtual QString lineWithoutNewline(int line); + + virtual int lineLength(int line); + virtual int lineLengthWithoutNewline(int line); + virtual void replaceText(const TextRange &range, const QString &text); + + virtual int findCharPos(int offset, int direction, const QString &chars, + bool equals); + virtual int findCharPosWithinRange(int offset, int direction, + const QString &chars, bool equals, + int beginRange, int endRange); + virtual int findCharPosOrClamp(int offset, int direction, + const QString &chars, bool equals); + virtual int findCharPosWithinRangeOrClamp(int offset, int direction, + const QString &chars, bool equals, + int beginRange, int endRange); + + virtual QString lineOffsetsAsString(); + +signals: + + void textAboutToBeChanged(edbee::TextBufferChange change); + void textChanged(edbee::TextBufferChange change, QString oldText = QString()); +}; + +} // namespace edbee + +// needs to be OUTSIDE the namespace!! +Q_DECLARE_METATYPE(edbee::TextBufferChange) diff --git a/lib/edbee-lib/edbee/models/textdocument.cpp b/lib/edbee-lib/edbee/models/textdocument.cpp new file mode 100644 index 00000000..cf81ae8f --- /dev/null +++ b/lib/edbee-lib/edbee/models/textdocument.cpp @@ -0,0 +1,492 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "textdocument.h" + +#include <QStringList> + +#include "edbee/models/changes/mergablechangegroup.h" +#include "edbee/models/changes/linedatachange.h" +#include "edbee/models/changes/selectionchange.h" +#include "edbee/models/changes/textchange.h" +#include "edbee/models/changes/textchangewithcaret.h" + +#include "edbee/models/textlinedata.h" +#include "edbee/models/textdocumentfilter.h" +#include "edbee/models/textrange.h" +#include "edbee/models/textundostack.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// Constructs the textdocument +TextDocument::TextDocument(QObject *obj) + : QObject(obj) + , documentFilter_(nullptr) + , documentFilterRef_(nullptr) + , textLineDataManager_(nullptr) +{ + textLineDataManager_ = new TextLineDataManager(); +} + +/// Destroys the textdocument +TextDocument::~TextDocument() +{ + delete textLineDataManager_; + delete documentFilter_; +} + +/// This method can be used to change the number of reserved fields by the +/// document Increasing the amount will result in a realoc Decreasting the +/// fieldcount reults in the lost of the 'old' fields At least the +/// 'PredefinedFieldCount' amont of fields are required This method EMPTIES the +/// undo-stack. So after this call all undo history is gone! +void TextDocument::setLineDataFieldsPerLine(int count) +{ + Q_ASSERT(count >= PredefinedFieldCount); + lineDataManager()->setFieldsPerLine(count); + textUndoStack()->clear(); +} + +void TextDocument::giveLineDataManager(TextLineDataManager *manager) +{ + delete textLineDataManager_; + textLineDataManager_ = manager; +} + +/// This method gives a given data item to a text line +void TextDocument::giveLineData(int line, int field, TextLineData *dataItem) +{ + Q_ASSERT(line < lineCount()); + LineDataChange *change = new LineDataChange(line, field); + change->giveLineData(dataItem); + executeAndGiveChange(change, true); +} + +/// Returns the line specific data at the given line +/// @param line the line number to retrieve the line data for +/// @param field the field to retrieve the data for +/// @return TextLineData the associated line data +TextLineData *TextDocument::getLineData(int line, int field) +{ + int len = lineDataManager()->length(); + Q_ASSERT(len == lineCount()); + Q_ASSERT(line < len); + return lineDataManager()->get(line, field); +} + +/// Starts an undo group +/// @param group the textchange group that groups the undo operations +void TextDocument::beginUndoGroup(ChangeGroup *group) +{ + if (!group) + { + group = new ChangeGroup(nullptr); + } + // if( documentFilter() ) { + // documentFilter()->filterBeginGroup( this, group ); + // } + textUndoStack()->beginUndoGroup(group); +} + +/// Ends the current undo group +/// @param coalesceId the coalesceId +/// @param flatten should the operation be flatten (flattens undo-group trees) +void TextDocument::endUndoGroup(int coalesceId, bool flatten) +{ + // if( documentFilter() ) { + // TextChangeGroup* group = textUndoStack()->currentGroup(); + // documentFilter()->filterEndGroup( this, group, coalesceId, flatten + // ); + // } + textUndoStack()->endUndoGroup(coalesceId, flatten); +} + +/// Ends the undo group and discards all recorded information +/// Warning it does NOT undo all made changes!!! +void TextDocument::endUndoGroupAndDiscard() +{ + textUndoStack()->endUndoGroupAndDiscard(); +} + +/// this method return true if the undo stack is enabled +bool TextDocument::isUndoCollectionEnabled() +{ + return textUndoStack()->isCollectionEnabled(); +} + +/// Enables or disables the collection of undo commands +void TextDocument::setUndoCollectionEnabled(bool enabled) +{ + textUndoStack()->setCollectionEnabled(enabled); +} + +/// This method should return true if the current change is the cause of an undo +/// operation +bool TextDocument::isUndoRunning() +{ + return textUndoStack()->isUndoRunning(); +} + +/// Checks if currently an undo operation is running +bool TextDocument::isRedoRunning() +{ + return textUndoStack()->isRedoRunning(); +} + +/// Is it an undo or redo (which means all commands area already available) +bool TextDocument::isUndoOrRedoRunning() +{ + return isUndoRunning() || isRedoRunning(); +} + +/// Checks if the document is in a persited state +bool TextDocument::isPersisted() +{ + return textUndoStack()->isPersisted(); +} + +/// Calc this method to mark current state as persisted +void TextDocument::setPersisted(bool enabled) +{ + textUndoStack()->setPersisted(enabled); +} + +/// Sets the document filter without tranfering the ownership +void TextDocument::setDocumentFilter(TextDocumentFilter *filter) +{ + delete documentFilter_; + documentFilter_ = 0; + documentFilterRef_ = filter; +} + +/// this method sets the document filter +/// You can give a 0 pointer to delte the old filter! +void TextDocument::giveDocumentFilter(TextDocumentFilter *filter) +{ + delete documentFilter_; + documentFilter_ = filter; + documentFilterRef_ = filter; +} + +/// This method returns the document filter +TextDocumentFilter *TextDocument::documentFilter() +{ + return documentFilterRef_; +} + +/// Start the changes +void TextDocument::beginChanges(TextEditorController *controller) +{ + beginUndoGroup(new MergableChangeGroup(controller)); +} + +/// Replaces the given rangeset +void TextDocument::replaceRangeSet(TextRangeSet &rangeSet, + const QString &textIn, bool stickySelection) +{ + return replaceRangeSet(rangeSet, QStringList(textIn), stickySelection); +} + +/// replaces the given rangeset +void TextDocument::replaceRangeSet(TextRangeSet &rangeSet, + const QStringList &textsIn, + bool stickySelection) +{ + + QStringList texts = textsIn; + if (documentFilter()) + { + documentFilter()->filterReplaceRangeSet(this, rangeSet, texts); + } + + rangeSet.beginChanges(); + int delta = 0; + int idx = 0, oldRangeCount = 0; + while (idx < (oldRangeCount = rangeSet.rangeCount())) + { + TextRange &range = rangeSet.range(idx); + QString text = texts.at(idx % texts.size()); // rotating text-fetching + + // qlog_info() << idx << ">> " << text << " : delta="<<delta<<", " << + // range.toString(); + range.setCaret(range.caret() + delta); + range.setAnchor(range.anchor() + delta); + // qlog_info() << " => " << range.toString(); + delta += (text.length() - range.length()); + + TextChangeWithCaret *change + = new TextChangeWithCaret(range.min(), range.length(), text, -1); + Change *effectiveChange = executeAndGiveChange(change, false); + TextChangeWithCaret *effectiveChangeWithCaret + = dynamic_cast<TextChangeWithCaret *>(effectiveChange); + + // when a new caret position is supplied (can only happen via a + // TextDocumentFilter) access it and change the caret to the given position + int caret = 0; + if (effectiveChangeWithCaret && effectiveChangeWithCaret->caret() >= 0) + { + caret = effectiveChangeWithCaret->caret(); + // Default caret location is change-independent: old location + length new + // text + } + else + { + caret = range.min() + text.length(); + } + + // sticky selection, keeps the selection around the text + if (stickySelection) + { + range.set(range.min(), caret); + } + else + { + range.setCaret(caret); + range.reset(); + } + + // next range + if (rangeSet.rangeCount() < oldRangeCount) + { + qlog_info() << "TEST TO SEE IF THIS REALLY HAPPENS!! I think it cannot " + "happen. (but I'm not sure)"; + Q_ASSERT(false); + + // else we stay at the same location + } + else + { + ++idx; + } + } + rangeSet.endChanges(); +} + +/// sets the selectioin for the current rangeset +/// The selection may never be empty +/// @param controller the controller to given the selection for +/// @param rangeSet the rangeset with the new selection +void TextDocument::giveSelection(TextEditorController *controller, + TextRangeSet *rangeSet) +{ + Q_ASSERT(rangeSet->rangeCount() > 0); + + SelectionChange *selChange = new SelectionChange(controller); + selChange->giveTextRangeSet(rangeSet); + executeAndGiveChange(selChange, 0); +} + +//// end the changes +void TextDocument::endChanges(int coalesceId) +{ + endUndoGroup(coalesceId, true); +} + +/// call this method to execute a change. The change is first passed to the +/// filter so the documentFilter can handle the processing of the change When +/// not filter is active the 'execute' method is called on the change +/// +/// WARNING, you should never Access the change pointer given to this method +/// It's possible the change gets deleted +/// +/// This method should return the effective text-change (or 0 if no text-change +/// has been stored) +Change *TextDocument::executeAndGiveChange(Change *change, int coalesceId) +{ + if (documentFilter()) + { + return documentFilter()->filterChange(this, change, coalesceId); + } + else + { + + beginUndoGroup(); // automatically group changes together (when changes + // happen on emission) + change->execute(this); + Change *result = giveChangeWithoutFilter(change, coalesceId); + Q_UNUSED(result) + endUndoGroup(coalesceId, true); + return textUndoStack()->last(); + // return result; + } +} + +/// Appends the given text to the document +/// @param text the text to append +/// @param coalesceId (default 0) the coalesceId to use. Whe using the same +/// number changes could be merged to one change. CoalesceId of 0 means no +/// merging +void TextDocument::append(const QString &text, int coalesceId) +{ + replace(this->length(), 0, text, coalesceId); +} + +/// Appends the given text +/// @param text the text to append +/// @param coalesceId (default 0) the coalesceId to use. Whe using the same +/// number changes could be merged to one change. CoalesceId of 0 means no +/// merging +void TextDocument::replace(int offset, int length, const QString &text, + int coalesceId) +{ + executeAndGiveChange(new TextChange(offset, length, text), coalesceId); +} + +/// Changes the compelte document text +/// @param text the new document text +void TextDocument::setText(const QString &text) +{ + replace(0, length(), text, 0); +} + +/// begins the raw append modes. In raw append mode data is directly streamed +/// to the textdocument-buffer. No undo-data is collected and no events are +/// fired +void TextDocument::rawAppendBegin() +{ + setUndoCollectionEnabled(false); // no undo's + buffer()->rawAppendBegin(); +} + +/// When then raw appending is done. The events are fired that the document has +/// been changed The undo-collection is enabled again +void TextDocument::rawAppendEnd() +{ + buffer()->rawAppendEnd(); + setUndoCollectionEnabled(true); +} + +/// Appends a single char in raw append mode +void TextDocument::rawAppend(QChar c) +{ + buffer()->rawAppend(c); +} + +/// Appends an array of characters +void TextDocument::rawAppend(const QChar *chars, int length) +{ + buffer()->rawAppend(chars, length); +} + +/// Returns the length of the document in characters +/// default implementation is to forward this call to the textbuffer +int TextDocument::length() +{ + return buffer()->length(); +} + +/// Returns the number of lines +int TextDocument::lineCount() +{ + return buffer()->lineCount(); +} + +/// Returns the character at the given position +QChar TextDocument::charAt(int idx) +{ + return buffer()->charAt(idx); +} + +/// returns the char at the given index if the index is valid +/// else the null character is returned +/// +/// @param idx the index to retrieve +/// @return the character at the given index or the null-character +QChar TextDocument::charAtOrNull(int idx) +{ + if (0 <= idx && idx < length()) + { + return charAt(idx); + } + return QChar(); +} + +/// Retrieves the character-offset of the given line +/// @param line the line number (0-based) to retrieve the offset for +/// @return the character offset +int TextDocument::offsetFromLine(int line) +{ + return buffer()->offsetFromLine(line); +} + +/// returns the line number which contains the given offset +/// @param offset the character offset +/// @return the line number (0 is the first line ) +int TextDocument::lineFromOffset(int offset) +{ + return buffer()->lineFromOffset(offset); +} + +/// return the column position for the given offset and line +/// @param offset the offset position +/// @param line the line number which contains this offset. (When -1 the line +/// number is calculated) +/// @return the column position of the given offset +int TextDocument::columnFromOffsetAndLine(int offset, int line) +{ + return buffer()->columnFromOffsetAndLine(offset, line); +} + +/// Returns the character offset of the given line and column +/// @param line the line number +/// @param column the column position +/// @return the character offset in the document +int TextDocument::offsetFromLineAndColumn(int line, int column) +{ + return buffer()->offsetFromLineAndColumn(line, column); +} + +/// Returns the length of the given line +/// @param line the line number +/// @return the line length +int TextDocument::lineLength(int line) +{ + return buffer()->lineLength(line); +} + +/// returns the length of the given lilne without the newline +/// @param line the line number +/// @return the length of the line excluding the newline character +int TextDocument::lineLengthWithoutNewline(int line) +{ + return buffer()->lineLengthWithoutNewline(line); +} + +/// Returns the document text as a QString +/// @return the complete document context +QString TextDocument::text() +{ + return buffer()->text(); +} + +/// Returns the given part of the text +/// @param offset the character offset in the document +/// @param length the length of the part in characters +/// @return the text at the given positions +QString TextDocument::textPart(int offset, int length) +{ + return buffer()->textPart(offset, length); +} + +/// Returns the given line without the trailing \n character +/// @param line the line number to retrieve the data for +/// @return the content at the given line +QString TextDocument::lineWithoutNewline(int line) +{ + return buffer()->lineWithoutNewline(line); +} + +//// Returns the contents at the given line inclusive the trailing \n character +/// @pparam line the line number to retrieve +/// @return the line at the given position +QString TextDocument::line(int line) +{ + return buffer()->line(line); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textdocument.h b/lib/edbee-lib/edbee/models/textdocument.h new file mode 100644 index 00000000..66852c53 --- /dev/null +++ b/lib/edbee-lib/edbee/models/textdocument.h @@ -0,0 +1,184 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QObject> +#include <QList> + +#include "edbee/models/textbuffer.h" + +namespace edbee +{ + +class TextGrammar; +class Change; +class ChangeGroup; +class TextAutoCompleteProviderList; +class TextCodec; +class TextDocumentFilter; +class TextDocumentScopes; +class TextEditorConfig; +class TextEditorController; +class LineEnding; +class TextLexer; +class TextLineData; +class TextLineDataManager; +class TextRangeSet; +class TextUndoStack; + +/// This is the base and abstract class of a text document +/// A TextDocument is the model part of the editor. +/// +/// It's the main owner of the following objects: +/// - A textbuffer, which holds the character data. Currently there's only a +/// CharTextBuffer, a gap-vectored buffer. +/// - An undostack, a stack which holds the undo-operations of the editor +/// - the textdocument scopes, these are the language-dependent scopes found in +/// the current document +/// - A textlexer, which is used for (re-)building the textdocument scopes. +/// +class EDBEE_EXPORT TextDocument : public QObject +{ + + Q_OBJECT + +public: + TextDocument(QObject *parent = 0); + virtual ~TextDocument(); + + /// This method should return the active textbuffer + /// Warning you should NEVER directly modify the textbuffer unless you're + /// absolutely sure what you're doing! + virtual TextBuffer *buffer() const = 0; + + /// This method can be used to change the number of reserved fields by the + /// document Increasing the amount will result in a realoc Decreasting the + /// fieldcount reults in the lost of the 'old' fields At least the + /// 'PredefinedFieldCount' amont of fields are required + virtual void setLineDataFieldsPerLine(int count); + + /// this method can be used to give a 'custom' line data item to a given line + virtual TextLineDataManager *lineDataManager() + { + return textLineDataManager_; + } + virtual void giveLineDataManager(TextLineDataManager *manager); + virtual void giveLineData(int line, int field, TextLineData *dataItem); + virtual TextLineData *getLineData(int line, int field); + // virtual TextLineData* takeLineData( int line, int field ) = 0; + + /// Should return the document-scopes of this document + virtual TextDocumentScopes *scopes() = 0; + + /// This method should return the current encoding + virtual TextCodec *encoding() = 0; + virtual void setEncoding(TextCodec *codec) = 0; + + /// This method should return the current line ending + virtual const LineEnding *lineEnding() = 0; + virtual void setLineEnding(const LineEnding *lineENding) = 0; + + /// Should return the current document lexer + virtual TextLexer *textLexer() = 0; + + /// This method should return the current language grammar + virtual TextGrammar *languageGrammar() = 0; + + /// Changes the language grammar. + /// This method should emit a grammarChanged signal (if the grammar is + /// changed) + virtual void setLanguageGrammar(TextGrammar *grammar) = 0; + + /// This method should return the autcompletion provider list + virtual TextAutoCompleteProviderList *autoCompleteProviderList() = 0; + + /// this method should return a reference to the undo stack + virtual TextUndoStack *textUndoStack() = 0; + virtual void beginUndoGroup(ChangeGroup *group = 0); + virtual void endUndoGroup(int coalesceId, bool flatten = false); + virtual void endUndoGroupAndDiscard(); + virtual bool isUndoCollectionEnabled(); + virtual void setUndoCollectionEnabled(bool enabled); + virtual bool isUndoRunning(); + virtual bool isRedoRunning(); + virtual bool isUndoOrRedoRunning(); + virtual bool isPersisted(); + virtual void setPersisted(bool enabled = true); + + /// this method should return the config + virtual TextEditorConfig *config() const = 0; + + virtual void setDocumentFilter(TextDocumentFilter *filter); + virtual void giveDocumentFilter(TextDocumentFilter *filter); + virtual TextDocumentFilter *documentFilter(); + + void beginChanges(TextEditorController *controller); + void replaceRangeSet(TextRangeSet &rangeSet, const QString &text, + bool stickySelection = false); + void replaceRangeSet(TextRangeSet &rangeSet, const QStringList &texts, + bool stickySelection = false); + void giveSelection(TextEditorController *controller, TextRangeSet *rangeSet); + void endChanges(int coalesceId); + + Change *executeAndGiveChange(Change *change, int coalesceId); + + // void giveChange( TextChange* change, bool merge ); + virtual Change *giveChangeWithoutFilter(Change *change, int coalesceId) = 0; + void append(const QString &text, int coalesceId = 0); + void replace(int offset, int length, const QString &text, int coalesceId = 0); + void setText(const QString &text); + + // raw access for filling the document + void rawAppendBegin(); + void rawAppendEnd(); + void rawAppend(QChar c); + void rawAppend(const QChar *chars, int length); + +public: + // Methods directly forwarded to the textbuffer + + int length(); + int lineCount(); + QChar charAt(int idx); + QChar charAtOrNull(int idx); + int offsetFromLine(int line); + int lineFromOffset(int offset); + int columnFromOffsetAndLine(int offset, int line = -1); + int offsetFromLineAndColumn(int line, int column); + int lineLength(int line); + int lineLengthWithoutNewline(int line); + QString text(); + QString textPart(int offset, int length); + QString lineWithoutNewline(int line); + QString line(int line); + +signals: + + void textAboutToBeChanged(edbee::TextBufferChange change); + void textChanged(edbee::TextBufferChange change, QString oldText = QString()); + + /// This signal is emitted if the persisted state is changed + void persistedChanged(bool persisted); + + /// This signal is emitted if the grammar has been changed + void languageGrammarChanged(); + + /// this signal is emitted if the scoped range has been changed + void lastScopedOffsetChanged(int previousOffset, int lastScopedOffset); + +private: + TextDocumentFilter + *documentFilter_; ///< The document filter if the filter is owned + TextDocumentFilter + *documentFilterRef_; ///< The reference to the document filter. + + TextLineDataManager + *textLineDataManager_; ///< A class for managing text line data items +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textdocumentfilter.cpp b/lib/edbee-lib/edbee/models/textdocumentfilter.cpp new file mode 100644 index 00000000..778430c8 --- /dev/null +++ b/lib/edbee-lib/edbee/models/textdocumentfilter.cpp @@ -0,0 +1,39 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "textdocumentfilter.h" +#include <QString> +#include <QStringList> +#include "edbee/models/textrange.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// The default virtual constructor +TextDocumentFilter::~TextDocumentFilter() {} + +/// A filter for single string replacements +void TextDocumentFilter::filterReplaceRangeSet(TextDocument *doc, + TextRangeSet &rangeSet, + QString &str) +{ + Q_UNUSED(doc); + Q_UNUSED(rangeSet); + Q_UNUSED(str); +} + +/// A filter for stringlist replacements {} +void TextDocumentFilter::filterReplaceRangeSet(TextDocument *doc, + TextRangeSet &rangeSet, + QStringList &str) +{ + Q_UNUSED(doc); + Q_UNUSED(rangeSet); + Q_UNUSED(str); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textdocumentfilter.h b/lib/edbee-lib/edbee/models/textdocumentfilter.h new file mode 100644 index 00000000..8ccbf735 --- /dev/null +++ b/lib/edbee-lib/edbee/models/textdocumentfilter.h @@ -0,0 +1,75 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +class QString; +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) +class QStringList; +#endif + +namespace edbee +{ + +class MultiTextChange; +class Change; +class ChangeGroup; +class TextDocument; +class TextRangeSet; + +class EDBEE_EXPORT TextDocumentFilter +{ +public: + virtual ~TextDocumentFilter(); + + /* + /// this method is called when a group is added to the undo-stack + virtual void filterBeginGroup( TextDocument* doc, TextChangeGroup* group ) + = 0; + + /// This method is called when group is ended + virtual void filterEndGroup( TextDocument* doc, TextChangeGroup* group, + int coalesceId, bool flatten ) = 0; + */ + + /// makes it possible to modify the range-set that's passed to the document + /// @param doc the textdocument + /// @param rangeSet the rangeSet that's replaced + /// @param str the string that's going to placed at the given ranges + virtual void filterReplaceRangeSet(TextDocument *doc, TextRangeSet &rangeSet, + QString &str); + + /// makes it possible to modify the range-set string that's passed to the + /// document + /// @param doc the textdocument + /// @param rangeSet the rangeSet that's replaced + /// @param str the stringsets that's going to placed at the given ranges + virtual void filterReplaceRangeSet(TextDocument *doc, TextRangeSet &rangeSet, + QStringList &str); + + /// This method is called for any other change + /// Just before this change is executed the changes are passed to this method + /// + /// You can do what you want with this text change. Just remember you are the + /// owner and if you do nothing. Nothing happens + /// + /// WARNING: When you do NOT use the changes object you should delete it!!! + /// + /// When done you can call doc->giveTextChangeWithoutFilter( changes ) for + /// applying the changes + /// + /// @param doc a reference to the document + /// @param changes the multi-text-change that's excuted + /// @param coalesceId the coalesceId + /// + /// @return this method should returnt the effictive change applied + virtual Change *filterChange(TextDocument *doc, Change *change, + int coalesceId) + = 0; +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textdocumentscopes.cpp b/lib/edbee-lib/edbee/models/textdocumentscopes.cpp new file mode 100644 index 00000000..fa5e8111 --- /dev/null +++ b/lib/edbee-lib/edbee/models/textdocumentscopes.cpp @@ -0,0 +1,1085 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "textdocumentscopes.h" + +#include <math.h> + +#include "edbee/models/textbuffer.h" +#include "edbee/models/textdocument.h" +#include "edbee/edbee.h" +#include "edbee/util/regexp.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// A scoped text range +/// @param anchor the start of the range +/// @param caret the caret position of the range +/// @param scope the text scope +ScopedTextRange::ScopedTextRange(int anchor, int caret, TextScope *scope) + : TextRange(anchor, caret) + , scopeRef_(scope) +{ + Q_ASSERT(scopeRef_); +} + +/// The default destructor +ScopedTextRange::~ScopedTextRange() {} + +/// sets the scope of this textrange +void ScopedTextRange::setScope(TextScope *scope) +{ + Q_ASSERT(scope); + scopeRef_ = scope; +} + +/// returns the scope +TextScope *ScopedTextRange::scope() const +{ + return scopeRef_; +} + +/// Converts the scoped textrange to a string +QString ScopedTextRange::toString() const +{ + return QStringLiteral("%1>%2:%3") + .arg(anchor()) + .arg(caret()) + .arg(scopeRef_->name()); +} + +//=========================================== + +/// Creates a scoped text range based on a scope textrange +MultiLineScopedTextRangeReference::MultiLineScopedTextRangeReference( + MultiLineScopedTextRange &range) + : ScopedTextRange(range.anchor(), range.caret(), range.scope()) + , multiScopeRef_(&range) +{ +} + +// the destructor +MultiLineScopedTextRangeReference::~MultiLineScopedTextRangeReference() {} + +/// Returns the reference the multilinescoped textrange +MultiLineScopedTextRange * +MultiLineScopedTextRangeReference::multiLineScopedTextRange() +{ + return multiScopeRef_; +} + +//=========================================== + +/// A scoped textrange lsit +ScopedTextRangeList::ScopedTextRangeList() + : ranges_() + , independent_(false) +{ +} + +/// The default destructor +ScopedTextRangeList::~ScopedTextRangeList() +{ + qDeleteAll(ranges_); + ranges_.clear(); +} + +/// Retursn the number of scoped textranges in the list +int ScopedTextRangeList::size() const +{ + return ranges_.size(); +} + +/// Returns the scoped textrange at the given list +ScopedTextRange *ScopedTextRangeList::at(int idx) +{ + Q_ASSERT(idx < ranges_.size()); + return ranges_.at(idx); +} + +/// give a rnage to the range set +/// @param range the scoped text range +void ScopedTextRangeList::giveRange(ScopedTextRange *range) +{ + ranges_.append(range); +} + +/// Prepends a range +/// @param range the range to prepend +void ScopedTextRangeList::giveAndPrependRange(ScopedTextRange *range) +{ + ranges_.prepend(range); +} + +/// Squeezes the ranges (reduces the memory usage) +void ScopedTextRangeList::squeeze() +{ + ranges_.squeeze(); +} + +/// set the independent flag. The independent flag means it's not dependent on +/// other lines +void ScopedTextRangeList::setIndependent(bool enable) +{ + independent_ = enable; + ; +} + +/// returns the independent flag +bool ScopedTextRangeList::isIndependent() const +{ + return independent_; +} + +/// Converts the scoped textrange list to a strubg +QString ScopedTextRangeList::toString() +{ + QString result; + result.append(independent_ ? "[-]" : "[M]"); + foreach (ScopedTextRange *scope, ranges_) + { + if (!result.isEmpty()) + { + result.append("| "); + } + result.append(scope->toString()); + } + return result; +} + +//=========================================== + +/// The multiline scoped textrange +/// @param anchor +MultiLineScopedTextRange::MultiLineScopedTextRange(int anchor, int caret, + TextScope *scope) + : ScopedTextRange(anchor, caret, scope) + , ruleRef_(0) + , endRegExp_(0) +{ +} + +/// The multi-line destructor +MultiLineScopedTextRange::~MultiLineScopedTextRange() +{ + delete endRegExp_; +} + +/// Sets the rule (we need the rule to perform end-of-line matching) +void MultiLineScopedTextRange::setGrammarRule(TextGrammarRule *rule) +{ + ruleRef_ = rule; +} + +/// Returns the active grammar rule +TextGrammarRule *MultiLineScopedTextRange::grammarRule() const +{ + return ruleRef_; +} + +/// Gives the end regular expression +void MultiLineScopedTextRange::giveEndRegExp(RegExp *regExp) +{ + endRegExp_ = regExp; +} + +/// returns the end-regular expression +RegExp *MultiLineScopedTextRange::endRegExp() +{ + return endRegExp_; +} + +/// This method compares selection ranges +bool MultiLineScopedTextRange::lessThan(MultiLineScopedTextRange *r1, + MultiLineScopedTextRange *r2) +{ + int diff = r1->min() - r2->min(); + if (diff == 0) + { + diff + = r2->length() + - r1->length(); // larger areas need to be placed before smaller areas + } + return (diff < 0); +} + +/// Returns a reference to the textdocument scopes +TextDocumentScopes *MultiLineScopedTextRangeSet::textDocumentScopes() +{ + return textDocumentScopesRef_; +} + +//=========================================== + +/// A textcope is an object that represents a scope name +/// You usually don't need to supply the scopeManager parameter. It's only +/// required on application startup +/// +/// @param fullScope the name of the scope +/// @param scopeManager the scopemanager to use (when 0 this defaults to the +/// global edbee scopemanager) +TextScope::TextScope(const QString &fullScope) + : scopeAtomCount_(0) + , scopeAtoms_(0) +{ + QStringList scopeElementNames = fullScope.split("."); + scopeAtomCount_ = scopeElementNames.length(); + + TextScopeManager *sm = Edbee::instance()->scopeManager(); + scopeAtoms_ = new TextScopeAtomId[scopeAtomCount_]; + for (int i = 0; i < scopeAtomCount_; ++i) + { + TextScopeAtomId id = sm->findOrRegisterScopeAtom(scopeElementNames.at(i)); + scopeAtoms_[i] = id; + } +} + +/// this method constructs a blank text scope. +TextScope::TextScope() + : scopeAtomCount_(0) + , scopeAtoms_(0) +{ +} + +// Destructs the textscope +TextScope::~TextScope() +{ + delete[] scopeAtoms_; +} + +/// This method returns the name of this scope +const QString TextScope::name() +{ + QString str; + TextScopeManager *sm = Edbee::instance()->scopeManager(); + for (int i = 0; i < scopeAtomCount_; ++i) + { + if (i) + { + str.append("."); + } + str.append(sm->atomName(scopeAtoms_[i])); + } + + return str; +} + +/// returns the number of atom items +int TextScope::atomCount() +{ + return scopeAtomCount_; +} + +/// This method returns the atom at the given index +TextScopeAtomId TextScope::atomAt(int idx) const +{ + Q_ASSERT(idx < scopeAtomCount_); + return scopeAtoms_[idx]; +} + +/// Checks if the current scope starts with the given scope +/// wild-card atoms will always match +/// @param scope the scope to check +bool TextScope::startsWith(TextScope *scope) +{ + if (scope->atomCount() > atomCount()) + { + return false; + } // match is never possible + TextScopeAtomId wildCard = Edbee::instance()->scopeManager()->wildcardId(); + for (int i = 0; i < scope->scopeAtomCount_; ++i) + { + TextScopeAtomId atomId = scopeAtoms_[i]; + TextScopeAtomId scopeAtomId = scope->scopeAtoms_[i]; + bool atomEqual = atomId == scopeAtomId || atomId == wildCard + || scopeAtomId == wildCard; + if (!atomEqual) + { + return false; + } + } + return true; +} + +/// This method returns the 'index' of the given full-scope. This is a kind of +/// substring search +/// +/// - wildcard atoms will always match +/// +/// @param scope the scope to search +/// @return -1 if not found else the index where the scope is found +int TextScope::rindexOf(TextScope *scope) +{ + int searchSize = scope->atomCount(); + int end = atomCount() - searchSize; + + TextScopeAtomId wildCard = Edbee::instance()->scopeManager()->wildcardId(); + + for (int idx = end; idx >= 0; --idx) + { + + // try to match the scopes + int i = 0; + for (; i < searchSize; ++i) + { + TextScopeAtomId atomId = scopeAtoms_[idx + i]; + TextScopeAtomId scopeAtomId = scope->scopeAtoms_[i]; + bool atomEqual = atomId == scopeAtomId || atomId == wildCard + || scopeAtomId == wildCard; + if (!atomEqual) + { + break; + } + } + // when at the end we've found it + if (i == searchSize) + { + return idx; + } + } + return -1; +} + +//============================================= + +/// A list of text scopes +TextScopeList::TextScopeList() {} + +/// The text scopelist with an initial size +TextScopeList::TextScopeList(int initialSize) +{ + reserve(initialSize); +} + +/// Fills the scopelist with a list of ranges +TextScopeList::TextScopeList(QVector<ScopedTextRange *> &ranges) +{ + reserve(ranges.size()); + foreach (ScopedTextRange *scopedRange, ranges) + { + append(scopedRange->scope()); + } +} + +/// This method returns the total number of atoms +int TextScopeList::atomCount() const +{ + int result = 0; + for (int i = 0, cnt = size(); i < cnt; ++i) + { + result += at(i)->atomCount(); + } + return result; +} + +/// Converts the scopelist to a string +QString TextScopeList::toString() +{ + QString result; + for (int i = 0; i < size(); ++i) + { + if (i) + { + result.append(" "); + } + result.append(at(i)->name()); + } + return result; +} + +//============================================= + +/// The textscope selector +/// @param selector the selector to select a scope +TextScopeSelector::TextScopeSelector(const QString &selector) +{ + QStringList selectorList = selector.split(","); + selectorList_.reserve(selectorList.size()); + foreach (QString sel, selectorList) + { + sel = sel.trimmed(); + selectorList_.append( + Edbee::instance()->scopeManager()->createTextScopeList(sel)); + } +} + +/// The destructor +TextScopeSelector::~TextScopeSelector() +{ + qDeleteAll(selectorList_); + selectorList_.clear(); +} + +/// This method calculates the matching score of the scope with this selector +/// Currently the scope-calculation is very 'basic'. Just enough to perform the +/// most basic form of matching +/// +/// The algorithm returns 1.0 on a full match... +/// +/// +/// @param scopeList the list of scopes +/// @return the matching score. -1 means no match found. >= 0 a match has been +/// found +double TextScopeSelector::calculateMatchScore(const TextScopeList *scopeList) +{ + double result = -1.0; + foreach (TextScopeList *selector, selectorList_) + { + result = qMax(result, calculateMatchScoreForSelector(selector, scopeList)); + } + return result; +} + +/// Converts the scope to a string +QString TextScopeSelector::toString() +{ + QString result; + for (int i = 0, cnt = selectorList_.size(); i < cnt; ++i) + { + if (i) + { + result.append(", "); + } + result.append(selectorList_.at(i)->toString()); + } + return result; +} + +/// This method calculates the matching score of the scope with this selector +/// Currently the scope-calculation is very 'basic'. Just enough to perform the +/// most basic form of matching +/// +/// The algorithm returns 1.0 on a full match... +/// +/// +/// @param scopeList the list of scopes +/// @return the matching score. -1 means no match found. >= 0 a match has been +/// found +double TextScopeSelector::calculateMatchScoreForSelector( + TextScopeList *selector, const TextScopeList *scopeList) +{ + double result = 0.0; + double power = 0.0; + + // this method checks if the scope matches + bool foundMatch = false; + int nextScopeIdx = scopeList->size() - 1; + for (int selectorIdx = selector->size() - 1; selectorIdx >= 0; --selectorIdx) + { + TextScope *selectorPath = selector->at(selectorIdx); + foundMatch = false; + + // find the given selector scope in the list + for (int scopeIdx = nextScopeIdx; scopeIdx >= 0; --scopeIdx) + { + TextScope *scope = scopeList->at(scopeIdx); + power += scope->atomCount(); + + // dit we found the scope + if (scope->startsWith(selectorPath)) + { + nextScopeIdx = scopeIdx - 1; + foundMatch = true; + for (int i = 0, iCnt = selectorPath->atomCount(); i < iCnt; ++i) + { + result += 1.0 / pow(2, power - i); + } + break; + } + } + + // no match found? + if (!foundMatch) + { + return -1; + } + } + return result; +} + +//============================================= + +/// The scopemanager constructor +TextScopeManager::TextScopeManager() +{ + reset(); +} + +/// The destructor of the scope manager +TextScopeManager::~TextScopeManager() +{ + foreach (TextScope *textScope, textScopeList_) + { + delete textScope; + } + textScopeList_.clear(); + textScopeRefMap_.clear(); +} + +/// This method clears and delets all scopes. WARNING this destroys all +/// registered text-scopes This method also registers the wildcard scope atom id +void TextScopeManager::reset() +{ + // delete and clear the scopemaps + if (!textScopeList_.isEmpty()) + { + foreach (TextScope *textScope, textScopeList_) + { + delete textScope; + } + textScopeList_.clear(); + textScopeRefMap_.clear(); + } + + // clear the atomlists + if (!atomNameList_.isEmpty()) + { + atomNameList_.clear(); + atomNameMap_.clear(); + } + + // insert some defaults + wildCardId_ = findOrRegisterScopeAtom("*"); // register the 'start' wildcard + + // create a blank textscope + TextScope *scope = new TextScope(); + textScopeList_.append(scope); + textScopeRefMap_.insert("", scope); +} + +/// returns the wildcard reference id +TextScopeAtomId TextScopeManager::wildcardId() +{ + return wildCardId_; +} + +/// This method registers the scope element +TextScopeAtomId TextScopeManager::findOrRegisterScopeAtom(const QString &atom) +{ + // element = element.toLower().trimmed(); + TextScopeAtomId id = atomNameMap_.value(atom, -1); + if (id >= 0) + { + return id; + } + atomNameList_.append(atom); + id = atomNameList_.size() - 1; + atomNameMap_.insert(atom, id); + return id; +} + +/// This method finds or creates a full-scope +TextScope *TextScopeManager::refTextScope(const QString &scopeString) +{ + TextScope *scope = textScopeRefMap_.value(scopeString, 0); + if (scope) + { + return scope; + } + scope = new TextScope(scopeString); + textScopeList_.append(scope); + textScopeRefMap_.insert(scopeString, scope); + return scope; +} + +/// Returns the empty scope +/// @return the blank textscope +TextScope *TextScopeManager::refEmptyScope() +{ + return refTextScope(""); +} + +/// This method creates a text-scope list from the given scope string +TextScopeList * +TextScopeManager::createTextScopeList(const QString &scopeListString) +{ + QStringList scopeParts = scopeListString.split(" "); + TextScopeList *list = new TextScopeList(scopeParts.size()); + for (int i = 0, cnt = scopeParts.size(); i < cnt; ++i) + { + list->append(refTextScope(scopeParts.at(i))); + } + return list; +} + +/// Returns the name of the given atom id +const QString &TextScopeManager::atomName(TextScopeAtomId id) +{ + Q_ASSERT(0 <= id && id < atomNameList_.length()); + return atomNameList_.at(id); +} + +//=========================================== + +/// A multilinescoped textrange set +MultiLineScopedTextRangeSet::MultiLineScopedTextRangeSet( + TextDocument *textDocument, TextDocumentScopes *textDocumentScopes) + : TextRangeSetBase(textDocument) + , textDocumentScopesRef_(textDocumentScopes) +{ +} + +/// the destructor of the multiline scoped rangeset +MultiLineScopedTextRangeSet::~MultiLineScopedTextRangeSet() +{ + reset(); +} + +/// Completely empties the scope list +void MultiLineScopedTextRangeSet::reset() +{ + qDeleteAll(scopedRangeList_); + scopedRangeList_.clear(); +} + +/// Returns the number of ranges +int MultiLineScopedTextRangeSet::rangeCount() const +{ + return scopedRangeList_.size(); +} + +/// returns the given textrange +TextRange &MultiLineScopedTextRangeSet::range(int idx) +{ + Q_ASSERT(0 <= idx && idx < rangeCount()); + return *(scopedRangeList_[idx]); +} + +/// returns the cont range +const TextRange &MultiLineScopedTextRangeSet::constRange(int idx) const +{ + Q_ASSERT(0 <= idx && idx < rangeCount()); + return *(scopedRangeList_[idx]); +} + +/// This method adds a range with the default scope +void MultiLineScopedTextRangeSet::addRange(int anchor, int caret) +{ + scopedRangeList_.append(new MultiLineScopedTextRange( + anchor, caret, Edbee::instance()->scopeManager()->refEmptyScope())); +} + +/// adds the given range +void MultiLineScopedTextRangeSet::addRange(const TextRange &range) +{ + addRange(range.anchor(), range.caret()); +} + +///' removes the given scope +void MultiLineScopedTextRangeSet::removeRange(int idx) +{ + delete scopedRangeList_[idx]; + scopedRangeList_.removeAt(idx); +} + +/// removes all scopes +void MultiLineScopedTextRangeSet::clear() +{ + qDeleteAll(scopedRangeList_); + scopedRangeList_.clear(); +} + +void MultiLineScopedTextRangeSet::toSingleRange() +{ + Q_ASSERT(false); ///< NOT IMPLEMENTED + // scopedRangeList_.remove(1, scopedRangeList_.size()-1); +} + +/// This method sorts all ranges +void MultiLineScopedTextRangeSet::sortRanges() +{ + std::sort(scopedRangeList_.begin(), scopedRangeList_.end(), + MultiLineScopedTextRange::lessThan); +} + +/// this method returns the scoped range +MultiLineScopedTextRange &MultiLineScopedTextRangeSet::scopedRange(int idx) +{ + Q_ASSERT(0 <= idx && idx < rangeCount()); + return *(scopedRangeList_[idx]); +} + +/// Adds a textrange with the given name +MultiLineScopedTextRange &MultiLineScopedTextRangeSet::addRange( + int anchor, int caret, const QString &name, TextGrammarRule *rule) +{ + MultiLineScopedTextRange *tr = new MultiLineScopedTextRange( + anchor, caret, Edbee::instance()->scopeManager()->refTextScope(name)); + tr->setGrammarRule(rule); + scopedRangeList_.append(tr); + return *tr; +} + +/// This method removes all ranges after a given offset. This means it will +/// remove all complete ranges after the given offset. Ranges that start before +/// the offset and end after the offset are 'invalidated' which means the end +/// offset is placed to the end of the document +void MultiLineScopedTextRangeSet::removeAndInvalidateRangesAfterOffset( + int offset) +{ + int len = textDocument()->length(); + beginChanges(); + for (int idx = rangeCount() - 1; idx >= 0; idx--) + { + TextRange &range = this->range(idx); + if (range.caret() >= offset && range.anchor() >= offset) + { + removeRange(idx); + } + else if (range.min() < offset && range.max() >= offset) + { + range.maxVar() = len; // move the marker to the end + } + } + endChangesWithoutProcessing(); // we only deleted the last range. Do the + // result is still sorted +} + +/// This method gives the scoped text range to this object +void MultiLineScopedTextRangeSet::giveScopedTextRange( + MultiLineScopedTextRange *textScope) +{ + scopedRangeList_.append(textScope); +} + +/// This method process the changes if required +void MultiLineScopedTextRangeSet::processChangesIfRequired(bool joinBorders) +{ + Q_UNUSED(joinBorders); + if (!changing_) + { + ++changing_; // prevent changing by functions below: + // mergeOverlappingRanges(joinBorders); + sortRanges(); + --changing_; + } +} + +/// convert the found ranges to strings +QString MultiLineScopedTextRangeSet::toString() +{ + QString result; + for (int i = 0, cnt = rangeCount(); i < cnt; ++i) + { + MultiLineScopedTextRange &range = scopedRange(i); + result.append(range.toString()); + result.append("|"); + } + return result; +} + +//=========================================== + +/// The constructor for storing/managing the textdocument scopes +/// @param textDocument the textdocument this scoping is for +TextDocumentScopes::TextDocumentScopes(TextDocument *textDocument) + : textDocumentRef_(textDocument) + , defaultScopedRange_( + 0, 0, Edbee::instance()->scopeManager()->refTextScope("text.plain")) + , scopedRanges_(textDocument, this) + , lastScopedOffset_(0) +{ + connect(textDocument, SIGNAL(languageGrammarChanged()), this, + SLOT(grammarChanged())); +} + +/// The destructor +TextDocumentScopes::~TextDocumentScopes() +{ + for (int i = 0, cnt = lineRangeList_.length(); i < cnt; ++i) + { + delete lineRangeList_.at(i); + } + lineRangeList_.clear(); +} + +/// returns the last scoped offset +int TextDocumentScopes::lastScopedOffset() +{ + return lastScopedOffset_; +} + +/// Sets the last scoped offset +/// @param offset the last scoped offset +void TextDocumentScopes::setLastScopedOffset(int offset) +{ + int previousOffset = lastScopedOffset_; + if (previousOffset != offset) + { + lastScopedOffset_ = offset; + emit lastScopedOffsetChanged(previousOffset, lastScopedOffset_); + } +} + +/// This method sets the default scope +/// @param the name of the scope +/// @param rule the rule that matched +void TextDocumentScopes::setDefaultScope(const QString &name, + TextGrammarRule *rule) +{ + defaultScopedRange_.setScope( + Edbee::instance()->scopeManager()->refTextScope(name)); + defaultScopedRange_.setGrammarRule(rule); +} + +/// This method sets the scoped line list +/// @param line the line +/// @param list the list with all scopes on the given line +void TextDocumentScopes::giveLineScopedRangeList(int line, + ScopedTextRangeList *list) +{ + int len = lineRangeList_.length(); + if (line >= len) + { + lineRangeList_.fill(len, 0, 0, line - len + 1); + } + delete lineRangeList_.at(line); // delete a possible old value + lineRangeList_.set(line, list); +} + +/// This method returns all scoped ranges on the given line +/// @param line the line to retrieve the scoped ranges for +/// @return the scoped textrange list +ScopedTextRangeList *TextDocumentScopes::scopedRangesAtLine(int line) +{ + if (line >= lineRangeList_.length() || line < 0) + { + return 0; + } + return lineRangeList_.at(line); +} + +/// Returns the number of scopes lines in the lineRangeList_ +int TextDocumentScopes::scopedLineCount() +{ + return lineRangeList_.length(); +} + +/// gives the multi-lined textrange to the scopedranges +void TextDocumentScopes::giveMultiLineScopedTextRange( + MultiLineScopedTextRange *range) +{ + scopedRanges_.giveScopedTextRange(range); +} + +/// This method invalidates all scopes after the given offset +/// @param offset the offset from which to remove the offset +void TextDocumentScopes::removeScopesAfterOffset(int offset) +{ + if (offset == 0) + { + scopedRanges_.clear(); + } + else + { + scopedRanges_.removeAndInvalidateRangesAfterOffset(offset); + } + if (offset < lastScopedOffset_) + { + setLastScopedOffset(offset); + } + + // delete/remove all line ranges (after this line) + int line = this->textDocument()->lineFromOffset(offset) + 1; + if (line < lineRangeList_.length()) + { + for (int i = line, cnt = lineRangeList_.length(); i < cnt; ++i) + { + delete lineRangeList_.at(i); + } + + lineRangeList_.replace(line, lineRangeList_.length() - line, 0, 0); + } +} + +/// This method retursn the default scoped textrange +/// Currently this is done very dirty, by retrieving the defaultscoped range the +/// begin and end is set tot he complete document a better solution would be a +/// subclass that always returns 0 for an anchor and the documentlength for the +/// caret +MultiLineScopedTextRange &TextDocumentScopes::defaultScopedRange() +{ + defaultScopedRange_.set( + 0, textDocument()->length()); // make sure this is always set like this + return defaultScopedRange_; +} + +/// This method returns all scope-ranges at the given offset-ranges +QVector<MultiLineScopedTextRange *> +TextDocumentScopes::multiLineScopedRangesBetweenOffsets(int offsetBegin, + int offsetEnd) +{ + QVector<MultiLineScopedTextRange *> result; + result.append(&defaultScopedRange_); + int minOffset = 0; + for (int i = 0, cnt = scopedRanges_.rangeCount(); + i < cnt && minOffset <= /** CHANGED 2013-01-22, was < */ offsetEnd; ++i) + { + MultiLineScopedTextRange &range = scopedRanges_.scopedRange(i); + minOffset = range.min(); + int maxOffset = range.max(); + if ((offsetBegin <= minOffset && minOffset < offsetEnd) + || (minOffset <= offsetBegin && offsetBegin < maxOffset)) + { + result.append(&range); + } + } + return result; +} + +/// returns all scopes between the given offsets +TextScopeList TextDocumentScopes::scopesAtOffset(int offset, bool includeEnd) +{ + TextScopeList result; + + // qlog_info() << ""; + // qlog_info() << "------------[ scopesAtOffset("<<offset<<") ] --------"; + // QVector<MultiLineScopedTextRange*> ranges = + // scopedRangesBetweenOffsets(offsetBegin, offsetEnd); + int line = textDocument()->lineFromOffset(offset); + int offsetInLine = offset - textDocument()->offsetFromLine(line); + ScopedTextRangeList *list = scopedRangesAtLine(line); + if (list) + { + // scopes.reserve( ranges.size() ); + for (int i = 0, cnt = list->size(); i < cnt; ++i) + { + ScopedTextRange *range = list->at(i); + // QString debug; + // debug.append( QStringLiteral("- %1.%5: + // %2<=%3<%4").arg(i).arg(range->min()).arg(offsetInLine).arg(range->max()).arg(range->scope()->name()) + // ); + if (range->min() <= offsetInLine) + { + if (offsetInLine < range->max() + || (includeEnd && offsetInLine <= range->max())) + { + // debug.append(" Ok" ); + result.append(range->scope()); + } + } + // qlog_info() << debug; + } + } + // qlog_info() << ""; + return result; +} + +/// This method returns all scoped ranges at the given offset +/// Hmmm this is almost exactly the same implementation as the scopesAtOffset +/// method !? (perhaps we should refactor this) +/// +/// Warning you MUST destroy (qDeleteAll) the list with scoped textranges +/// returned by this list +/// +/// @param offset he offset to retrieve the scoped ranges +/// @return the vector with text scopes. These scopes are document wide +QVector<ScopedTextRange *> +TextDocumentScopes::createScopedRangesAtOffsetList(int offset) +{ + QVector<ScopedTextRange *> result; + + // retrieve the line + int line = textDocument()->lineFromOffset(offset); + int lineOffset = textDocument()->offsetFromLine(line); + int offsetInLine = offset - lineOffset; + + ScopedTextRangeList *list = scopedRangesAtLine(line); + if (list) + { + // scopes.reserve( ranges.size() ); + for (int i = 0, cnt = list->size(); i < cnt; ++i) + { + ScopedTextRange *range = list->at(i); + if (range->min() <= offsetInLine && offsetInLine < range->max()) + { + + // it's a multi-line scope reference + MultiLineScopedTextRange *ms = range->multiLineScopedTextRange(); + if (ms) + { + result.append(new ScopedTextRange(ms->min(), ms->max(), ms->scope())); + + // it's a line scope + } + else + { + result.append(new ScopedTextRange(lineOffset + range->min(), + lineOffset + range->max(), + range->scope())); + } + } + } + } + return result; +} + +/// Converts the textdocument scoped to a string +QString TextDocumentScopes::toString() +{ + return scopedRanges_.toString(); +} + +/// Returns a string-list will all scopes. This list is mainly used for +/// debugging and testing +QStringList TextDocumentScopes::scopesAsStringList() +{ + QStringList result; + + // first add all multi-line scopes + for (int i = 0, cnt = scopedRanges_.rangeCount(); i < cnt; ++i) + { + MultiLineScopedTextRange &range = scopedRanges_.scopedRange(i); + result.append(range.toString()); + } + + result.append("**"); + + // next add all line based scoped + for (int i = 0, lineCnt = lineRangeList_.length(); i < lineCnt; ++i) + { + ScopedTextRangeList *list = lineRangeList_.at(i); + if (list != 0) + { + result.append(list->toString()); + } + else + { + result.append(QStringLiteral(" << null value @ %1>>").arg(i)); + } + } + + return result; +} + +/// add all dumped line scopes +void TextDocumentScopes::dumpScopedLineAddresses(const QString &text) +{ + qlog_info() << "dumpScopedLineAddresses(" << text + << "): " << lineRangeList_.length(); + for (int i = 0, cnt = lineRangeList_.length(); i < cnt; ++i) + { + qlog_info() << "-" << i << ":" + << QString::number((quintptr)lineRangeList_.at(i), 16); + } + qlog_info() << "."; +} + +/// returns the current textdocument scope +TextDocument *TextDocumentScopes::textDocument() +{ + return textDocumentRef_; +} + +/// the grammar has been changed +void TextDocumentScopes::grammarChanged() +{ + removeScopesAfterOffset(0); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textdocumentscopes.h b/lib/edbee-lib/edbee/models/textdocumentscopes.h new file mode 100644 index 00000000..cc746399 --- /dev/null +++ b/lib/edbee-lib/edbee/models/textdocumentscopes.h @@ -0,0 +1,387 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QHash> +#include <QObject> +#include <QStringList> +#include <QVector> + +#include "edbee/models/textrange.h" +#include "edbee/models/textlinedata.h" +#include "edbee/util/gapvector.h" + +namespace edbee +{ + +class MultiLineScopedTextRange; +class RegExp; +class ScopedTextRange; +class TextDocumentScopes; +class TextGrammarRule; +class TextScope; + +/// This type defines a single scope atom +typedef short TextScopeAtomId; + +/* + ScopeElement + FullScope = ScopeElement.ScopeElement.ScopeElement +*/ + +/// This class defines a full text-scope. A full textscope is textscope +/// with one ore more scoped-elements +class EDBEE_EXPORT TextScope +{ +public: + const QString name(); + int atomCount(); + TextScopeAtomId atomAt(int idx) const; + + bool startsWith(TextScope *scope); + int rindexOf(TextScope *scope); + +private: + TextScope(const QString &fullScope); + TextScope(); + ~TextScope(); + + char scopeAtomCount_; ///< the number of scope-atoms + TextScopeAtomId *scopeAtoms_; ///< the scope atoms + + friend class TextScopeManager; +}; + +//=========================================== + +/// A list of text-scopes. +/// on a certian location, usually more then one scope is available on a given +/// location +class EDBEE_EXPORT TextScopeList : public QVector<TextScope *> +{ +public: + TextScopeList(); + TextScopeList(int initialSize); + TextScopeList(QVector<ScopedTextRange *> &ranges); + + int atomCount() const; + + QString toString(); +}; + +//=========================================== + +/// +/// Our first version of scope-selector only support a list of scopes +/// Thus the Descendant (space) selector only +/// +/// TODO: Implement full scope selectors see text below +/// +/// Full Scope selectors: (FUTURE) +/// +/// , = grouping (multiple seperate selectors) +/// (space) = descendent (supported) +/// +/// - = exclude (unsupported) +/// | = or (unsupported) +/// & = and (unsupported) +/// () = unsupported +/// +/// Extra From the textmate author: +/// http://blog.macromates.com/2005/introduction-to-scopes/ +/// discuession on: +/// http://textmate.1073791.n5.nabble.com/formal-definition-of-scope-selector-syntax-td12109.html +/// +/// Update: Starting with 1.1b17 it's also possible +/// to AND, OR, and subtract scope selectors, +/// +/// e.g.: (a | b) & c - d +/// +/// would select the scope which is not matched by d, and matched by both c, and +/// a or b. +/// +/// OFFICIAL BNF: +/// atom: «string» | '*' +/// scope: «atom» ('.' «atom»)* +/// path: '^'? «scope» ('>'? «scope»)* '$'? +/// group: '(' «selector» ')' +/// filter: ("L:"|"R:"|"B:") («group» | «path») +/// expression: '-'? («filter» | «group» | «path») +/// composite: «expression» ([|&-] «expression»)* +/// selector: «composite» (',' «composite»)* +/// +class EDBEE_EXPORT TextScopeSelector +{ +public: + TextScopeSelector(const QString &selector); + virtual ~TextScopeSelector(); + + double calculateMatchScore(const TextScopeList *scopeList); + QString toString(); + +private: + double calculateMatchScoreForSelector(TextScopeList *selector, + const TextScopeList *scopeList); + +private: + QVector<TextScopeList *> selectorList_; +}; + +//=========================================== + +/// The scope manager is used to manage the scopes... +/// A scope consist out of several scope-parts: +/// +/// scope-part1.scope-part2.scope-part3 +/// +/// These text are converted to a list of numbers +/// 12.3.24 +/// +class EDBEE_EXPORT TextScopeManager +{ +public: + TextScopeManager(); + virtual ~TextScopeManager(); + +public: + void reset(); + + TextScopeAtomId wildcardId(); + + TextScopeAtomId findOrRegisterScopeAtom(const QString &atom); + TextScope *refTextScope(const QString &scopeString); + TextScope *refEmptyScope(); + + TextScopeList *createTextScopeList(const QString &scopeListString); + + const QString &atomName(TextScopeAtomId id); + +private: + TextScopeAtomId wildCardId_; ///< The atom id reserved for the wildcard '*' + + // scope atoms + QList<QString> atomNameList_; ///< All scope-atom names + QHash<QString, TextScopeAtomId> atomNameMap_; ///< the scope atom map + + // full scopes + QList<TextScope *> textScopeList_; ///< The list of full-scope + QHash<QString, TextScope *> textScopeRefMap_; ///< The full-scope map +}; + +//=========================================== + +/// A base scoped text range +class EDBEE_EXPORT ScopedTextRange : public TextRange +{ +public: + ScopedTextRange(int anchor, int caret, TextScope *scope); + // ScopedTextRange( const MultiLineScopedTextRange& range ); + virtual ~ScopedTextRange(); + + void setScope(TextScope *scope); + TextScope *scope() const; + QString toString() const; + + /// returns the multi-line scoped text range + virtual MultiLineScopedTextRange *multiLineScopedTextRange() { return 0; } + +private: + TextScope *scopeRef_; ///< The scope for this range +}; + +//=========================================== + +/// A line based ScopedText range, that referenes a multi-line text-reference +class EDBEE_EXPORT MultiLineScopedTextRangeReference : public ScopedTextRange +{ +public: + MultiLineScopedTextRangeReference(MultiLineScopedTextRange &range); + virtual ~MultiLineScopedTextRangeReference(); + + /// returns the multi-line scoped text range + virtual MultiLineScopedTextRange *multiLineScopedTextRange(); + +private: + MultiLineScopedTextRange + *multiScopeRef_; ///< the reference to the multi-scoped textrange that + ///< defined this scope +}; + +//=========================================== + +/// a list of textscopes +/// This class is used for single-line scopes +/// (Todo, this needs to be optimized) +class EDBEE_EXPORT ScopedTextRangeList +{ + Q_DISABLE_COPY(ScopedTextRangeList) +public: + explicit ScopedTextRangeList(); + virtual ~ScopedTextRangeList(); + + int size() const; + ScopedTextRange *at(int idx); + void giveRange(ScopedTextRange *at); + void giveAndPrependRange(ScopedTextRange *range); + + void squeeze(); + void setIndependent(bool enable = true); + bool isIndependent() const; + + QString toString(); + +private: + QVector<ScopedTextRange *> ranges_; ///< the textranges + bool independent_; ///< this boolean tells if the line contains a multi-lined + ///< scope start or end + + // int size_; /// The number of ranges + // ScopedTextRange* ranges_; /// The list of ranges +}; + +//=========================================== + +/// This class 'defines' a single document scope +class EDBEE_EXPORT MultiLineScopedTextRange : public ScopedTextRange +{ +public: + MultiLineScopedTextRange(int anchor, int caret, TextScope *scope); + virtual ~MultiLineScopedTextRange(); + + void setGrammarRule(TextGrammarRule *rule); + TextGrammarRule *grammarRule() const; + + void giveEndRegExp(RegExp *regExp); + RegExp *endRegExp(); + + static bool lessThan(MultiLineScopedTextRange *r1, + MultiLineScopedTextRange *r2); + +private: + TextGrammarRule *ruleRef_; ///< The grammar rule that found this range + RegExp *endRegExp_; ///< The end regexp +}; + +//=========================================== + +/// This is a set of scoped textranges. This set is used +/// to remember parsed language ranges +class EDBEE_EXPORT MultiLineScopedTextRangeSet : public TextRangeSetBase +{ +public: + MultiLineScopedTextRangeSet(TextDocument *textDocument, + TextDocumentScopes *textDocumentScopes); + virtual ~MultiLineScopedTextRangeSet(); + void reset(); + + // text range functionality + virtual int rangeCount() const; + virtual TextRange &range(int idx); + virtual const TextRange &constRange(int idx) const; + virtual void addRange(int anchor, int caret); + virtual void addRange(const TextRange &range); + + virtual void removeRange(int idx); + virtual void clear(); + virtual void toSingleRange(); + virtual void sortRanges(); + virtual MultiLineScopedTextRange &scopedRange(int idx); + virtual MultiLineScopedTextRange & + addRange(int anchor, int caret, const QString &name, TextGrammarRule *rule); + + void removeAndInvalidateRangesAfterOffset(int offset); + + // adds a text scope + void giveScopedTextRange(MultiLineScopedTextRange *textScope); + void processChangesIfRequired(bool joinBorders); + + QString toString(); + + TextDocumentScopes *textDocumentScopes(); + +private: + TextDocumentScopes + *textDocumentScopesRef_; ///< A reference to the text document scopes + QList<MultiLineScopedTextRange *> + scopedRangeList_; ///< A list of all scoped ranges +}; + +//=========================================== + +/// This class is used to 'contain' all document scope information +class EDBEE_EXPORT TextDocumentScopes : public QObject +{ + Q_OBJECT + +public: + TextDocumentScopes(TextDocument *textDocument); + virtual ~TextDocumentScopes(); + + int lastScopedOffset(); + void setLastScopedOffset(int offset); + + // scope management + void setDefaultScope(const QString &name, TextGrammarRule *rule); + + void giveLineScopedRangeList(int line, ScopedTextRangeList *list); + ScopedTextRangeList *scopedRangesAtLine(int line); + int scopedLineCount(); + + void giveMultiLineScopedTextRange(MultiLineScopedTextRange *range); + void removeScopesAfterOffset(int offset); + MultiLineScopedTextRange &defaultScopedRange(); + + QVector<MultiLineScopedTextRange *> + multiLineScopedRangesBetweenOffsets(int offsetBegin, int offsetEnd); + TextScopeList scopesAtOffset(int offset, bool includeEnd = false); + QVector<ScopedTextRange *> createScopedRangesAtOffsetList(int offset); + + QString toString(); + QStringList scopesAsStringList(); + + void dumpScopedLineAddresses(const QString &text = QString()); + + // getters + TextDocument *textDocument(); + +protected slots: + + void grammarChanged(); + +signals: + void lastScopedOffsetChanged(int previousOffset, int lastScopedOffset); + +private: + TextDocument *textDocumentRef_; ///< The default document reference + + // TextScope* defaultScope_; ///< The default scope + MultiLineScopedTextRange + defaultScopedRange_; ///< The default scoped text range + // QHash<QString,TextScope*> scopeMap_; ///< A list of all + // defined/used scopes (pointers to these scopes are smaller then full + // strings) + MultiLineScopedTextRangeSet + scopedRanges_; ///< A list with all (multi-line) ranges + GapVector<ScopedTextRangeList *> + lineRangeList_; ///< A list of all line scopes + + /// This special variable is used to 'remember' to which offset the document + /// has been scoped. This should speed up the syntax highlighting drasticly + /// because the parsing only needs to happen to the end of the 'visible' + /// document + /// + /// If you have an offset AFTER this offset the document has not been scoped + /// yet. This needs to happen. For all 'open' multi-line scopes with an + /// end-offset of (documentLength). + /// + /// The scopedToOffset_ should only mark the multi-line scopes. Single lines + /// scopes do NOT affect other regions of the document + int lastScopedOffset_; ///< How far has the text been fully scoped? +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/texteditorcommandmap.cpp b/lib/edbee-lib/edbee/models/texteditorcommandmap.cpp new file mode 100644 index 00000000..502125cc --- /dev/null +++ b/lib/edbee-lib/edbee/models/texteditorcommandmap.cpp @@ -0,0 +1,54 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "texteditorcommandmap.h" + +#include "edbee/data/factorycommandmap.h" +#include "edbee/texteditorcommand.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// Constructs the editor commandmap +/// This constructors also initializes the map with the default editor actions +/// @param parent a reference to the parent object +TextEditorCommandMap::TextEditorCommandMap(QObject *parent) + : QObject(parent) +{ +} + +/// Destructs the command map +TextEditorCommandMap::~TextEditorCommandMap() +{ + qDeleteAll(commandMap_); + commandMap_.clear(); +} + +/// This method fills this command map with the factory commands +void TextEditorCommandMap::loadFactoryCommandMap() +{ + FactoryCommandMap().fill(this); +} + +/// gives the command to this command map +/// @param key the unique identifier for this command +/// @param command the command to give +void TextEditorCommandMap::give(const QString &key, TextEditorCommand *command) +{ + delete commandMap_.value(key); + commandMap_.insert(key, command); +} + +/// Returns the command identified with the given key +/// @return the command assigned to this identifier or 0 if the command doesn't +/// exeist +TextEditorCommand *TextEditorCommandMap::get(const QString &key) +{ + return commandMap_.value(key); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/texteditorcommandmap.h b/lib/edbee-lib/edbee/models/texteditorcommandmap.h new file mode 100644 index 00000000..4e4f7754 --- /dev/null +++ b/lib/edbee-lib/edbee/models/texteditorcommandmap.h @@ -0,0 +1,37 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QObject> +#include <QMap> +#include <QString> + +namespace edbee +{ + +class TextEditorCommand; + +/// This is a texteditor map. This is used to map Command-Names to commands +/// This class is the owner of the the given commands +class EDBEE_EXPORT TextEditorCommandMap : public QObject +{ + Q_OBJECT +public: + explicit TextEditorCommandMap(QObject *parent = 0); + virtual ~TextEditorCommandMap(); + + void loadFactoryCommandMap(); + + void give(const QString &key, TextEditorCommand *command); + TextEditorCommand *get(const QString &key); + +private: + QMap<QString, TextEditorCommand *> commandMap_; ///< The command map +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/texteditorconfig.cpp b/lib/edbee-lib/edbee/models/texteditorconfig.cpp new file mode 100644 index 00000000..5e215b7e --- /dev/null +++ b/lib/edbee-lib/edbee/models/texteditorconfig.cpp @@ -0,0 +1,456 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "texteditorconfig.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// The default constructor +/// Fills this configuration object with some sane defaults +/// @param parent the parent references of this Qobject +TextEditorConfig::TextEditorConfig(QObject *parent) + : QObject(parent) + , changeInProgressLevel_(0) + , changeCount_(0) + , caretWidth_(2) + , caretBlinkingRate_(700) // 0 means no blinking (default = 700) + , indentSize_(4) + , useTabChar_(true) + , smartTab_(true) + , charGroups_() + , whitespaces_("\n\t ") + , whitespaceWithoutNewline_("\t ") + , extraLineSpacing_(0) + , useLineSeparator_(false) + , lineSeparatorPen_(QColor(230, 230, 230), 1.5, Qt::DashLine) + , undoGroupPerSpace_(true) + , showCaretOffset_(true) + , themeName_("Monokai") + , scrollPastEnd_(false) + , showWhitespaceMode_(HideWhitespaces) + , renderBidiContolCharacters_(true) + , autocompleteAutoShow_(true) + , autocompleteMinimalCharacters_(0) +{ + charGroups_.append(QStringLiteral("./\\()\"'-:,.;<>~!@#$%^&*|+=[]{}`~?")); +} + +/// empty constructor :) +TextEditorConfig::~TextEditorConfig() {} + +/// use this method to start a group of changes. +/// Default behaviour is to emit a configChanged signal if a setting is changed +/// When you call beginChanges this method will make sure the config surpresses +/// the signals and only a signal is fired after the last endChange. You can +/// nest multiple beginChanges, only the last endChanges fires a signal +void TextEditorConfig::beginChanges() +{ + ++changeInProgressLevel_; +} + +/// Ends the previous call of beginChanges. It will notify a change +/// when all items have been changes +void TextEditorConfig::endChanges() +{ + Q_ASSERT(changeInProgressLevel_ > 0); + --changeInProgressLevel_; + if (changeInProgressLevel_ == 0 && changeCount_ > 0) + { + notifyChange(); + } +} + +/// Returns the caret width in pixels +int TextEditorConfig::caretWidth() const +{ + return caretWidth_; +} + +/// Sets the caret render width in pixels +/// @param width the caret width in pixels +void TextEditorConfig::setCaretWidth(int width) +{ + if (caretWidth_ != width) + { + caretWidth_ = width; + notifyChange(); + } +} + +/// Returns the caret blinking rate (delay) (lower means faster ) +/// The blinking delay is in milliseconds +int TextEditorConfig::caretBlinkingRate() const +{ + return caretBlinkingRate_; +} + +/// Sets the caret blinking rate (delay) (lower means faster ) +/// @param rate The blinking delay is in milliseconds +void TextEditorConfig::setCaretBlinkRate(int rate) +{ + if (caretBlinkingRate_ != rate) + { + caretBlinkingRate_ = rate; + notifyChange(); + } +} + +/// Returns the indent size in the number of characters +int TextEditorConfig::indentSize() const +{ + return indentSize_; +} + +/// Sets the indentsize in characters +/// @param size the size of indentation in nr of characters +void TextEditorConfig::setIndentSize(int size) +{ + if (indentSize_ != size) + { + indentSize_ = size; + notifyChange(); + } +} + +/// Should the tab-character be used? +bool TextEditorConfig::useTabChar() const +{ + return useTabChar_; +} + +/// Should the tab-character be used? +/// @param enable enable or disable the use of tab characters +void TextEditorConfig::setUseTabChar(bool enable) +{ + if (useTabChar_ != enable) + { + useTabChar_ = enable; + notifyChange(); + } +} + +/// Returns the state of smarttab mode +/// Smarttab enables the automatic addition of indents when inserting a newline. +bool TextEditorConfig::smartTab() const +{ + return smartTab_; +} + +/// Sets the smarttab mode +/// @param enable should smarttab be enabled +void TextEditorConfig::setSmartTab(bool enable) +{ + if (smartTab_ != enable) + { + smartTab_ = enable; + notifyChange(); + } +} + +/// Returns the characters groups +/// Character groups are groups that considered the 'same' kind of characters. +/// For example skipping to the next word skips the characters of the same group +/// Currently spaces and word/id characters are hardcoded groups. +const QStringList &TextEditorConfig::charGroups() const +{ + return charGroups_; +} + +/// Sets the character groups +/// @see TextEditorConfig::charGroups +void TextEditorConfig::setCharGroups(const QStringList &items) +{ + if (charGroups_ != items) + { + charGroups_ = items; + notifyChange(); + } +} + +/// Returns all white-space characters +const QString &TextEditorConfig::whitespaces() const +{ + return whitespaces_; +} + +/// Sets the whitespace characters +void TextEditorConfig::setWhitespaces(const QString &value) +{ + if (whitespaces_ != value) + { + whitespaces_ = value; + notifyChange(); + } +} + +/// Retuns the whitespace character without newlines +const QString &TextEditorConfig::whitespaceWithoutNewline() const +{ + return whitespaceWithoutNewline_; +} + +/// Sets the characters that are considered whitespace. Excluding the newline +/// character +/// @param value the list of characters that are considered whitespace +/// characters +void TextEditorConfig::setWhitespaceWithoutNewline(const QString &value) +{ + if (whitespaceWithoutNewline_ != value) + { + whitespaceWithoutNewline_ = value; + notifyChange(); + } +} + +/// Returns the extra line spacing in pixels +int TextEditorConfig::extraLineSpacing() const +{ + return extraLineSpacing_; +} + +/// Sets the extra line spacing between lines in pixels +/// @param value the number of extra line-spacing between editor lines +void TextEditorConfig::setExtraLineSpacing(int value) +{ + if (extraLineSpacing_ != value) + { + extraLineSpacing_ = value; + notifyChange(); + } +} + +/// Should we use a line seperator pen +/// @see TextEditorConfig::lineSeparatorPen +bool TextEditorConfig::useLineSeparator() const +{ + return useLineSeparator_; +} + +/// Should we use a sline seperator? +/// @see TextEditorConfig::lineSeparatorPen +void TextEditorConfig::setUseLineSeparator(bool value) +{ + if (useLineSeparator_ != value) + { + useLineSeparator_ = value; + notifyChange(); + } +} + +/// The line sperator pen to use.When the setting useLineSeparator is set +/// this pen is used to draw lines between the text-lines +/// @see TextEditorConfig::useLineSeparator +const QPen &TextEditorConfig::lineSeparatorPen() const +{ + return lineSeparatorPen_; +} + +/// This method sets the line seperator pen that used to paint +/// line between the text-lines +/// @see TextEditorConfig::useLineSeparator +void TextEditorConfig::setLineSeperatorPen(const QPen &pen) +{ + if (lineSeparatorPen_ != pen) + { + lineSeparatorPen_ = pen; + notifyChange(); + } +} + +/// Should a space result in a new 'undo-group' +/// The default behaviour is that pressing a space character results in the +/// closing of an undo group. (This groups the entered characters into 1 undo +/// operation) +bool TextEditorConfig::undoGroupPerSpace() const +{ + return undoGroupPerSpace_; +} + +/// Sets the undo group per space value +/// @see TextEditorConfig::undoGroupPerSpace +void TextEditorConfig::setUndoGroupPerSpace(bool enable) +{ + if (undoGroupPerSpace_ != enable) + { + undoGroupPerSpace_ = enable; + notifyChange(); + } +} + +/// should the caret-offset be shown. The texteditor can signal a +/// statusbar text to a slot. This text can optionally contain the +/// current caret offset +bool TextEditorConfig::showCaretOffset() const +{ + return showCaretOffset_; +} + +/// Enables / disables the passing of the character offset +/// @see TextEditorConfig::showCaretOffset +void TextEditorConfig::setShowCaretOffset(bool enable) +{ + if (showCaretOffset_ != enable) + { + showCaretOffset_ = enable; + notifyChange(); + } +} + +/// returns the active theme name +/// (The theme name is the name without the file-extension of the file in the +/// theme directory) +QString TextEditorConfig::themeName() +{ + return themeName_; +} + +/// This method sets the active theme name +/// @param name the name of the active theme (this is the filename of the theme +/// without the extension) +void TextEditorConfig::setThemeName(const QString &name) +{ + if (themeName_ != name) + { + themeName_ = name; + notifyChange(); + } +} + +/// returns the current font to use +QFont TextEditorConfig::font() const +{ + return font_; +} + +/// Changes the font that's used by the editor +void TextEditorConfig::setFont(const QFont &font) +{ + if (font_ != font) + { + font_ = font; + notifyChange(); + } +} + +/// returns the scroll past end setting +/// @return +bool TextEditorConfig::scrollPastEnd() const +{ + return scrollPastEnd_; +} + +/// Sets the scroll past end option. +/// When enabled the last line of the document is scrollable to the top of the +/// window +/// @param enabled should scroll past end be enabled ? +void TextEditorConfig::setScrollPastEnd(bool enabled) +{ + if (scrollPastEnd_ != enabled) + { + scrollPastEnd_ = enabled; + notifyChange(); + } +} + +/// Shows the whitespacemode +int TextEditorConfig::showWhitespaceMode() const +{ + return showWhitespaceMode_; +} + +/// Sets the show the whitespace mode +/// @param mode the whitespace mode to set. Can be one of the enumeration +/// values. (Or another integer if you build your own renderer) +void TextEditorConfig::setShowWhitespaceMode(int mode) +{ + if (showWhitespaceMode_ != mode) + { + showWhitespaceMode_ = mode; + notifyChange(); + } +} + +/// Sets the show whitespace mode +/// @param str the whitespace mode "show" or "hide" for now. (When invalid hide +/// is used) +void TextEditorConfig::setShowWhitespaceMode(const QString &str) +{ + if (str == "show") + { + if (showWhitespaceMode_ != ShowWhitespaces) + { + showWhitespaceMode_ = ShowWhitespaces; + notifyChange(); + } + } + else + { + if (showWhitespaceMode_ != HideWhitespaces) + { + showWhitespaceMode_ = HideWhitespaces; + notifyChange(); + } + } +} + +bool TextEditorConfig::renderBidiContolCharacters() const +{ + return renderBidiContolCharacters_; +} + +/// Sets the render bidirectional control-character mode. +/// For showing possible security related characters: +/// https://www.trojansource.codes Default is Enabled! +void TextEditorConfig::setRenderBidiContolCharacters(bool enabled) +{ + renderBidiContolCharacters_ = enabled; +} + +/// Sets whether autocomplete comes up automatically, or only manually(manual +/// trigger isn't implemented yet) +/// @see TextEditorConfig::autocompleteAutoShow +void TextEditorConfig::setAutocompleteAutoShow(bool enable) +{ + if (autocompleteAutoShow_ != enable) + { + autocompleteAutoShow_ = enable; + notifyChange(); + } +} + +int TextEditorConfig::autocompleteMinimalCharacters() const +{ + return autocompleteMinimalCharacters_; +} + +void TextEditorConfig::setAutocompleteMinimalCharacters(int amount) +{ + autocompleteMinimalCharacters_ = amount; +} + +/// Show autocomplete automatically, or only manually(manual isn't implemented +/// yet) +bool TextEditorConfig::autocompleteAutoShow() const +{ + return autocompleteAutoShow_; +} + +/// This internal method is used to notify the listener that a change has +/// happend Thi smethod only emits a signal if there's no config group change +/// busy +void TextEditorConfig::notifyChange() +{ + ++changeCount_; + if (changeInProgressLevel_ == 0) + { + emit configChanged(); + changeCount_ = 0; + } +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/texteditorconfig.h b/lib/edbee-lib/edbee/models/texteditorconfig.h new file mode 100644 index 00000000..0064a0a6 --- /dev/null +++ b/lib/edbee-lib/edbee/models/texteditorconfig.h @@ -0,0 +1,139 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QFont> +#include <QObject> +#include <QPen> +#include <QString> +#include <QStringList> + +namespace edbee +{ + +/// General configuration settings of the text editor +class EDBEE_EXPORT TextEditorConfig : public QObject +{ + Q_OBJECT + +public: + /// an enumeration with the possible types of whitespace showing + enum ShowWhitespaceMode + { + HideWhitespaces = 0, ///< Don't show whitespaces + ShowWhitespaces = 1 ///< Alsways show the whitespace + /// TODO: In the future, only show when selected + }; + + TextEditorConfig(QObject *parent = 0); + virtual ~TextEditorConfig(); + + void beginChanges(); + void endChanges(); + + int caretWidth() const; + void setCaretWidth(int width); + + int caretBlinkingRate() const; + void setCaretBlinkRate(int rate); + + int indentSize() const; + void setIndentSize(int size); + + bool useTabChar() const; + void setUseTabChar(bool enable); + + bool smartTab() const; + void setSmartTab(bool enable); + + const QStringList &charGroups() const; + void setCharGroups(const QStringList &items); + + const QString &whitespaces() const; + void setWhitespaces(const QString &value); + + const QString &whitespaceWithoutNewline() const; + void setWhitespaceWithoutNewline(const QString &); + + int extraLineSpacing() const; + void setExtraLineSpacing(int value); + + bool useLineSeparator() const; + void setUseLineSeparator(bool value); + + const QPen &lineSeparatorPen() const; + void setLineSeperatorPen(const QPen &pen); + + bool undoGroupPerSpace() const; + void setUndoGroupPerSpace(bool enable); + + bool showCaretOffset() const; + void setShowCaretOffset(bool enable); + + QString themeName(); + void setThemeName(const QString &name); + + QFont font() const; + void setFont(const QFont &font); + + bool scrollPastEnd() const; + void setScrollPastEnd(bool enabled); + + int showWhitespaceMode() const; + void setShowWhitespaceMode(int mode); + void setShowWhitespaceMode(const QString &str); + + bool renderBidiContolCharacters() const; + void setRenderBidiContolCharacters(bool enabled); + + bool autocompleteAutoShow() const; + void setAutocompleteAutoShow(bool enable); + + int autocompleteMinimalCharacters() const; + void setAutocompleteMinimalCharacters(int amount); + +signals: + void configChanged(); + +protected: + void notifyChange(); + +private: + int changeInProgressLevel_; ///< The change in progress level + int changeCount_; ///< A flag that counts the number of changes + + int caretWidth_; ///< The caretWith in pixels + int caretBlinkingRate_; ///< The caret blinking rate + int indentSize_; ///< The ident-size in characters + bool useTabChar_; ///< Should the tab character be used? + bool smartTab_; ///< Is smarttab enabled? + + QStringList charGroups_; ///< Character groups + QString whitespaces_; ///< All whitespaces + QString whitespaceWithoutNewline_; ///< Whitespace characters without newline + int extraLineSpacing_; ///< The extra space to place between lines + bool useLineSeparator_; ///< Should we draw a line-seperator between lines? + QPen lineSeparatorPen_; ///< A line seperator pen + bool undoGroupPerSpace_; ///< An undogroup per space? + bool showCaretOffset_; ///< Show the caret offset? + QString themeName_; ///< The active theme name + QFont font_; ///< The font to used + + bool scrollPastEnd_; ///< Should the last line of the document be scrollable + ///< to the top of the window + int showWhitespaceMode_; ///< The current whitespace mode to make + bool renderBidiContolCharacters_; ///< Renders dangers control characters as + ///< red marks + + bool autocompleteAutoShow_; ///< Show autocomplete automatically, or only when + ///< manually triggered + int autocompleteMinimalCharacters_; ///< How manu characters need to be + ///< entered before autocomplete kicks in +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/texteditorkeymap.cpp b/lib/edbee-lib/edbee/models/texteditorkeymap.cpp new file mode 100644 index 00000000..b87b40fb --- /dev/null +++ b/lib/edbee-lib/edbee/models/texteditorkeymap.cpp @@ -0,0 +1,437 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "texteditorkeymap.h" + +#include <QDir> +#include <QKeySequence> + +#include "edbee/data/factorykeymap.h" +#include "edbee/io/keymapparser.h" +#include "edbee/models/change.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/models/textdocument.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// Constructs the texteditor key sequence +TextEditorKey::TextEditorKey(const QKeySequence &seq) + : sequence_(seq) +{ +} + +/// Clones the text editor key +TextEditorKey *TextEditorKey::clone() const +{ + return new TextEditorKey(sequence_); +} + +/// returns the keysequence +const QKeySequence &TextEditorKey::sequence() +{ + return sequence_; +} + +//---------------------------------------------------- + +TextEditorKeyMap::TextEditorKeyMap(TextEditorKeyMap *parentKeyMap) + : parentRef_(parentKeyMap) +{ +} + +/// the copy constructor +// TextEditorKeyMap::TextEditorKeyMap(const TextEditorKeyMap& keyMap) +//{ +// QMap<QKeySequence,QString>::const_iterator i = +// keyMap.actionMap_.constBegin(); while (i != keyMap.actionMap_.constEnd()) +// { +// set( i.key(), i.value() ); +// } +// maxSequenceLength_ = keyMap.maxSequenceLength_; +// } + +/// empty the keymap +TextEditorKeyMap::~TextEditorKeyMap() +{ + qDeleteAll(keyMap_); +} + +/// copies the given keys to the other keymap +/// @param keyMap the keymap to copy the keys from +void TextEditorKeyMap::copyKeysTo(TextEditorKeyMap *keyMap) +{ + for (QMultiHash<QString, TextEditorKey *>::const_iterator itr + = keyMap_.constBegin(); + itr != keyMap_.constEnd(); ++itr) + { + keyMap->keyMap_.insert(itr.key(), itr.value()->clone()); + } +} + +/// Returns the last inserted keysequence for the given command +/// It also tries to search the parent keymap if it's available +/// @param name the name of the given command +/// @return the keysequence or 0 if not found +TextEditorKey *TextEditorKeyMap::get(const QString &name) const +{ + QMultiHash<QString, TextEditorKey *>::const_iterator itr = keyMap_.find(name); + if (itr != keyMap_.end()) + { + return itr.value(); + } + if (parentRef_) + { + return parentRef_->get(name); + } + return nullptr; +} + +/// Returns the key sequence for the given name +/// @param name the name of the key sequence +/// @return a QKeySequence +QKeySequence TextEditorKeyMap::getSequence(const QString &name) const +{ + TextEditorKey *key = get(name); + if (!key) + { + return QKeySequence(); + } + return key->sequence(); +} + +/// Returns a list of all keysequences for the given command +/// This method will also search the parents for the given keysequences +QList<TextEditorKey *> TextEditorKeyMap::getAll(const QString &name) const +{ + QList<TextEditorKey *> result = keyMap_.values(name); + // also add the references of the parent + if (parentRef_) + { + QList<TextEditorKey *> parentResult = parentRef_->getAll(name); + foreach (TextEditorKey *seq, parentResult) + { + if (!result.contains(seq)) + { + result.append(seq); + } + } + } + return result; +} + +/// Tests if the keymap has the given action +/// It will also search the parent key map +bool TextEditorKeyMap::has(const QString &name) const +{ + bool result = !(keyMap_.find(name) == keyMap_.end()); + if (!result && parentRef_) + { + result = parentRef_->has(name); + } + return result; +} + +/// Adds the given key sequence to the keymap +/// @param command the name of the editor command +/// @param sequence the keysequence +void TextEditorKeyMap::add(const QString &command, TextEditorKey *sequence) +{ + keyMap_.insert(command, sequence); +} + +/// Adds the given key sequence to the keymap +/// @param name the name of the editor command +/// @param sequence the keysequence +void TextEditorKeyMap::add(const QString &command, const QKeySequence &seq) +{ + keyMap_.insert(command, new TextEditorKey(seq)); +} + +/// Adds a command - key sequence with a string +/// If first tries to match the string with the standardkey-texts +/// If this doesn't result in a sequence it assumes it's a keydefinition used by +/// QKeySequence +/// @param command the command name +/// @param seq the key sequence definition +bool TextEditorKeyMap::add(const QString &command, const QString &seq) +{ + // when the given keys-string is a 'standard-key' name we use the standard key + QKeySequence::StandardKey standardKey + = TextEditorKeyMap::standardKeyFromString(seq); + if (standardKey != QKeySequence::UnknownKey) + { + foreach (QKeySequence sequence, QKeySequence::keyBindings(standardKey)) + { + add(command, new TextEditorKey(QKeySequence(sequence))); + } + return true; + } + + // When it's not a standard key we try a textual key sequence + QKeySequence normalKey = QKeySequence(seq); + if (normalKey != QKeySequence::UnknownKey) + { + add(command, new TextEditorKey(normalKey)); + return true; + } + + // well this didn't go well + return false; +} + +// void TextEditorKeyMap::set(const QString& name, const +// QKeySequence::StandardKey key) +//{ +// keyMap_.insertMulti(name, QKeySequence(key)); +// } + +/// replace the given command with the given key sequence +/// all other keysequences (on this level) are ignored +void TextEditorKeyMap::replace(const QString &name, TextEditorKey *sequence) +{ + qDeleteAll(keyMap_.values(name)); + keyMap_.insert(name, sequence); +} + +/// Searches for the given command with a keysequence +/// Warning when one keysequence is the prefix of the other keysequence it is +/// possible only the partial or full match is return (depending on the order) +/// +/// @param sequence the pressed key-sequence +/// @param match the sequence match: (NoMatch, PartialMatch, ExactMatch) +/// @return the (partial) matched command or a empty string if not found +QString TextEditorKeyMap::findBySequence(QKeySequence sequence, + QKeySequence::SequenceMatch &match) +{ + // find the current map + QMultiHash<QString, TextEditorKey *>::iterator itr = keyMap_.begin(); + while (itr != keyMap_.end()) + { + match = sequence.matches(itr.value()->sequence()); + if (match != QKeySequence::NoMatch) + { + return itr.key(); + } + ++itr; + } + if (parentRef_) + return parentRef_->findBySequence(sequence, match); + match = QKeySequence::NoMatch; + return ""; +} + +/// This method joins 2 key-sequences to 1 sequence (if possible) +/// if seq1 + se2 length > 4 seq2 is returned +QKeySequence TextEditorKeyMap::joinKeySequences(const QKeySequence seq1, + const QKeySequence seq2) +{ + if (seq1.count() + seq2.count() > 4) + { + return seq2; + } + int idx = 0; + int keys[] = {0, 0, 0, 0}; + for (int i = 0; i < seq1.count(); ++i) + { +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) + keys[idx++] = seq1[i]; +#else + keys[idx++] = seq1[i].toCombined(); +#endif + } + for (int i = 0; i < seq2.count(); ++i) + { +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) + keys[idx++] = seq2[i]; +#else + keys[idx++] = seq2[i].toCombined(); +#endif + } + return QKeySequence(keys[0], keys[1], keys[2], keys[3]); +} + +/// a map of all standard keys +static QHash<QString, QKeySequence::StandardKey> stringToStandardKey; + +/// converts a string to a standard key +/// if the standard key isn't found it returns 'QKeySequence::UnknownKey ' +QKeySequence::StandardKey +TextEditorKeyMap::standardKeyFromString(const QString &str) +{ + QHash<QString, QKeySequence::StandardKey> &h = stringToStandardKey; + if (h.isEmpty()) + { + h.insert("add_tab", QKeySequence::AddTab); + h.insert("back", QKeySequence::Back); + h.insert("bold", QKeySequence::Bold); + h.insert("close", QKeySequence::Close); + h.insert("copy", QKeySequence::Copy); + h.insert("cut", QKeySequence::Cut); + h.insert("delete", QKeySequence::Delete); + h.insert("delete_end_of_line", QKeySequence::DeleteEndOfLine); + h.insert("delete_end_of_word", QKeySequence::DeleteEndOfWord); + h.insert("delete_start_of_word", QKeySequence::DeleteStartOfWord); + h.insert("find", QKeySequence::Find); + h.insert("find_next", QKeySequence::FindNext); + h.insert("find_previous", QKeySequence::FindPrevious); + h.insert("forward", QKeySequence::Forward); + h.insert("help_contents", QKeySequence::HelpContents); + h.insert("insert_line_separator", QKeySequence::InsertLineSeparator); + h.insert("insert_paragraph_separator", + QKeySequence::InsertParagraphSeparator); + h.insert("italic", QKeySequence::Italic); + h.insert("move_to_end_of_block", QKeySequence::MoveToEndOfBlock); + h.insert("move_to_end_of_document", QKeySequence::MoveToEndOfDocument); + h.insert("move_to_end_of_line", QKeySequence::MoveToEndOfLine); + h.insert("move_to_next_char", QKeySequence::MoveToNextChar); + h.insert("move_to_next_line", QKeySequence::MoveToNextLine); + h.insert("move_to_next_page", QKeySequence::MoveToNextPage); + h.insert("move_to_next_word", QKeySequence::MoveToNextWord); + h.insert("move_to_previous_char", QKeySequence::MoveToPreviousChar); + h.insert("move_to_previous_line", QKeySequence::MoveToPreviousLine); + h.insert("move_to_previous_page", QKeySequence::MoveToPreviousPage); + h.insert("move_to_previous_word", QKeySequence::MoveToPreviousWord); + h.insert("move_to_start_of_block", QKeySequence::MoveToStartOfBlock); + h.insert("move_to_start_of_document", QKeySequence::MoveToStartOfDocument); + h.insert("move_to_start_of_line", QKeySequence::MoveToStartOfLine); + h.insert("new", QKeySequence::New); + h.insert("next_child", QKeySequence::NextChild); + h.insert("open", QKeySequence::Open); + h.insert("paste", QKeySequence::Paste); + h.insert("preferences", QKeySequence::Preferences); + h.insert("previous_child", QKeySequence::PreviousChild); + h.insert("print", QKeySequence::Print); + h.insert("quit", QKeySequence::Quit); + h.insert("redo", QKeySequence::Redo); + h.insert("refresh", QKeySequence::Refresh); + h.insert("replace", QKeySequence::Replace); + h.insert("save_as", QKeySequence::SaveAs); + h.insert("save", QKeySequence::Save); + h.insert("select_all", QKeySequence::SelectAll); + h.insert("select_end_of_block", QKeySequence::SelectEndOfBlock); + h.insert("select_end_of_document", QKeySequence::SelectEndOfDocument); + h.insert("select_end_of_line", QKeySequence::SelectEndOfLine); + h.insert("select_next_char", QKeySequence::SelectNextChar); + h.insert("select_next_line", QKeySequence::SelectNextLine); + h.insert("select_next_page", QKeySequence::SelectNextPage); + h.insert("select_next_word", QKeySequence::SelectNextWord); + h.insert("select_previous_char", QKeySequence::SelectPreviousChar); + h.insert("select_previous_line", QKeySequence::SelectPreviousLine); + h.insert("select_previous_page", QKeySequence::SelectPreviousPage); + h.insert("select_previous_word", QKeySequence::SelectPreviousWord); + h.insert("select_start_of_block", QKeySequence::SelectStartOfBlock); + h.insert("select_start_of_document", QKeySequence::SelectStartOfDocument); + h.insert("select_start_of_line", QKeySequence::SelectStartOfLine); + h.insert("underline", QKeySequence::Underline); + h.insert("undo", QKeySequence::Undo); + h.insert("unknown_key", QKeySequence::UnknownKey); + h.insert("whats_this", QKeySequence::WhatsThis); + h.insert("zoom_in", QKeySequence::ZoomIn); + h.insert("zoom_out", QKeySequence::ZoomOut); + h.insert("full_screen", QKeySequence::FullScreen); + } + return h.value(str, QKeySequence::UnknownKey); +} + +/// returns all added actions +QString TextEditorKeyMap::toString() const +{ + QString str; + for (QMultiHash<QString, TextEditorKey *>::const_iterator itr + = keyMap_.constBegin(); + itr != keyMap_.constEnd(); ++itr) + { + if (!str.isEmpty()) + str.append(","); + str.append(QStringLiteral("%1:%2").arg(itr.key()).arg( + itr.value()->sequence().toString())); + } + return str; +} + +//---------------------------------------------------- + +/// destructs all keymaps +TextKeyMapManager::TextKeyMapManager() +{ + keyMapHash_.insert("", new TextEditorKeyMap()); +} + +/// The textkeymap manager destructor +TextKeyMapManager::~TextKeyMapManager() +{ + qDeleteAll(keyMapHash_); +} + +/// This method loads all keymaps. +/// +void TextKeyMapManager::loadAllKeyMaps(const QString &path) +{ + QDir dir(path); + QStringList filters("*.json"); + foreach (QFileInfo fileInfo, + dir.entryInfoList(filters, QDir::Files, QDir::Name)) + { + loadKeyMap(fileInfo.absoluteFilePath()); + } +} + +/// This method loads a single keymap +void TextKeyMapManager::loadKeyMap(const QString &file) +{ + // parse the given file + QFileInfo fileInfo(file); + QString name = fileInfo.baseName(); + if (name == "default") + { + name = ""; + } + + // parse the given keymap file + KeyMapParser parser; + if (!parser.parse(file, findOrCreate(name))) + { + qlog_warn() << QObject::tr("Error parsing %1: %2 ") + .arg(file) + .arg(parser.errorMessage()); + + // when there's an error parsing the defaultkeymap, fallback to the factory + if (name == "") + { + qlog_warn() + << "Error loading default keymap: fallback to the factory keymap!"; + loadFactoryKeyMap(); + } + } +} + +/// This method loads the internal factory keymap +void TextKeyMapManager::loadFactoryKeyMap() +{ + FactoryKeyMap().fill(findOrCreate("")); +} + +/// Returns the given text-editor keymap +TextEditorKeyMap *TextKeyMapManager::get(const QString &name) +{ + return keyMapHash_.value(name); +} + +/// finds or creates the given keymap +TextEditorKeyMap *TextKeyMapManager::findOrCreate(const QString &name) +{ + TextEditorKeyMap *keyMap = keyMapHash_.value(name); + if (!keyMap) + { + keyMap = new TextEditorKeyMap(); + keyMapHash_.insert(name, keyMap); + } + return keyMap; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/texteditorkeymap.h b/lib/edbee-lib/edbee/models/texteditorkeymap.h new file mode 100644 index 00000000..00315965 --- /dev/null +++ b/lib/edbee-lib/edbee/models/texteditorkeymap.h @@ -0,0 +1,98 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QKeySequence> +#include <QHash> +#include <QMultiHash> +#include <QStringList> + +namespace edbee +{ + +class TextEditorCommand; +class TextEditorController; + +/// A contexted keysequence +/// This contains a keysequence and optionally a given context +class EDBEE_EXPORT TextEditorKey +{ +public: + TextEditorKey(const QKeySequence &seq); + TextEditorKey *clone() const; + + const QKeySequence &sequence(); + +private: + QKeySequence sequence_; ///< The key sequence +}; + +//------------------------------------------------------------ + +/// A text editor key map +/// This key map, maps key-sequences to action-names. +class EDBEE_EXPORT TextEditorKeyMap +{ +public: + TextEditorKeyMap(TextEditorKeyMap *parentKeyMap = 0); + virtual ~TextEditorKeyMap(); + + void copyKeysTo(TextEditorKeyMap *keyMap); + + TextEditorKey *get(const QString &name) const; + QKeySequence getSequence(const QString &name) const; + QList<TextEditorKey *> getAll(const QString &name) const; + bool has(const QString &name) const; + + void add(const QString &command, TextEditorKey *sequence); + void add(const QString &command, const QKeySequence &seq); + bool add(const QString &command, const QString &seq); + // void set( const QString& name, const QKeySequence::StandardKey key ); + void replace(const QString &name, TextEditorKey *sequence); + + QString findBySequence(QKeySequence sequence, + QKeySequence::SequenceMatch &match); + + static QKeySequence joinKeySequences(const QKeySequence seq1, + const QKeySequence seq2); + static QKeySequence::StandardKey standardKeyFromString(const QString &str); + + QString toString() const; + + TextEditorKeyMap *parentMap() { return parentRef_; } + +private: + TextEditorKeyMap *parentRef_; ///< a reference to a parent keymap + QMultiHash<QString, TextEditorKey *> + keyMap_; ///< a map to convert a name to a +}; + +//------------------------------------------------------------------- + +/// There can be different keymaps for different file-types/ +/// The keymap manager manages all the available keymaps +/// There's ALWAYS a keymap with the name "" +class EDBEE_EXPORT TextKeyMapManager +{ +public: + TextKeyMapManager(); + virtual ~TextKeyMapManager(); + + void loadAllKeyMaps(const QString &path); + void loadKeyMap(const QString &file); + void loadFactoryKeyMap(); + + TextEditorKeyMap *get(const QString &name = QString()); + TextEditorKeyMap *findOrCreate(const QString &name); + +private: + QHash<QString, TextEditorKeyMap *> + keyMapHash_; ///< All loaded keymaps identified by name +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textgrammar.cpp b/lib/edbee-lib/edbee/models/textgrammar.cpp new file mode 100644 index 00000000..e12ce8ac --- /dev/null +++ b/lib/edbee-lib/edbee/models/textgrammar.cpp @@ -0,0 +1,422 @@ +/** + * Copyright 2011-2020 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "textgrammar.h" + +#include <QDir> + +#include "edbee/io/tmlanguageparser.h" +#include "edbee/util/regexp.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// The text grammar rule constructor +/// @param grammar the grammar this rule belongs to +/// @param instruction the type of instruction this is +TextGrammarRule::TextGrammarRule(TextGrammar *grammar, Instruction instruction) + : grammarRef_(grammar) + , instruction_(instruction) + , matchRegExp_(nullptr) + , endRegExpString_() +{ +} + +/// The tex text grammar rule +TextGrammarRule::~TextGrammarRule() +{ + qDeleteAll(ruleList_); + ruleList_.clear(); + delete matchRegExp_; +} + +/// Creates a main grammar rule +/// @param grammar the grammar this main rule belongs to +/// @param scopeName the name of the scope +/// @return the main grammar rule +TextGrammarRule *TextGrammarRule::createMainRule(TextGrammar *grammar, + const QString &scopeName) +{ + TextGrammarRule *rule = new TextGrammarRule(grammar, MainRule); + rule->setScopeName(scopeName); + return rule; +} + +/// Creates a grammar rule list +/// @param grammar the grammar this rule list belongs to +/// @return the TextGrammarRule that include the rule list +TextGrammarRule *TextGrammarRule::createRuleList(TextGrammar *grammar) +{ + TextGrammarRule *rule = new TextGrammarRule(grammar, RuleList); + return rule; +} + +/// Creates an include rule +/// @param grammar the grammar this rules belongs to +/// @param includeName the name to include +/// @return an include grammar rule +TextGrammarRule *TextGrammarRule::createIncludeRule(TextGrammar *grammar, + const QString &includeName) +{ + TextGrammarRule *rule = new TextGrammarRule(grammar, IncludeCall); + rule->setIncludeName(includeName); + return rule; +} + +/// Creates an single line regexp +/// @param grammar the grammar this rule belongs to +/// @param scopeName the scopename of this rule +/// @param regExp the regular expression used for this rule +/// @return the created grammar rule +TextGrammarRule *TextGrammarRule::createSingleLineRegExp( + TextGrammar *grammar, const QString &scopeName, const QString ®Exp) +{ + TextGrammarRule *rule = new TextGrammarRule(grammar, SingleLineRegExp); + rule->setScopeName(scopeName); + rule->giveMatchRegExp(TextGrammarRule::createRegExp(regExp)); + return rule; +} + +/// Creates a multiline regexp +/// @param scopeName the name of the scope +/// @param contentScopeName the scope name of the content +/// @param beginRegExp the start regexp to use +/// @param endRegExp the end regular expression to use +/// @return TextGrammarRule the multiple grammar rule +TextGrammarRule *TextGrammarRule::createMultiLineRegExp( + TextGrammar *grammar, const QString &scopeName, + const QString &contentScopeName, const QString &beginRegExp, + const QString &endRegExp) +{ + TextGrammarRule *rule = new TextGrammarRule(grammar, MultiLineRegExp); + rule->setScopeName(scopeName); + rule->setContentScopeName(contentScopeName); + rule->giveMatchRegExp(TextGrammarRule::createRegExp(beginRegExp)); + rule->setEndRegExpString(endRegExp); + return rule; +} + +/// returns the child rule at the given index +/// @param idx the index of the grammar rule +TextGrammarRule *TextGrammarRule::rule(int idx) const +{ + Q_ASSERT(0 <= idx && idx < ruleCount()); + return ruleList_.at(idx); +} + +/// Gives the rulle to the rule-list of the grammar rule +/// @param the rule to give (ownership is transfered to this object) +void TextGrammarRule::giveRule(TextGrammarRule *rule) +{ + ruleList_.append(rule); +} + +/// Gives the main regular expression +/// @param regExp the regular expression to give +void TextGrammarRule::giveMatchRegExp(RegExp *regExp) +{ + matchRegExp_ = regExp; +} + +/// Sets the ends regular expression(only for multi-line regexp rules +/// @param str the end regular expression +void TextGrammarRule::setEndRegExpString(const QString &str) +{ + endRegExpString_ = str; +} + +/// convers the curent object toString (for debugging purposes) +/// @param includePatters should the patterns be included +QString TextGrammarRule::toString(bool includePatterns) +{ + QString r; + switch (instruction_) + { + case MainRule: + r.append("MainRule"); + break; + case RuleList: + r.append("RuleList"); + break; + case SingleLineRegExp: + r.append("SingleLineRegExp"); + break; + case MultiLineRegExp: + r.append("MultiLineRegExp"); + break; + case IncludeCall: + r.append("IncludeCall"); + break; + case Parser: + r.append("Parser"); + break; + default: + r.append("Unkown"); + } + + r.append(":").append(scopeName_); + if (instruction_ == IncludeCall) + { + r.append(" "); + r.append(includeName()); + } + + if (includePatterns && matchRegExp_) + { + r.append(", begin: ").append(matchRegExp_->pattern()); + } + if (includePatterns && !endRegExpString_.isEmpty()) + { + r.append(", end: ").append(endRegExpString_); + } + r.append(QStringLiteral(", %1 subrules").arg(ruleCount())); + r.append(QStringLiteral(", %1 captures").arg(matchCaptures().size())); + return r; +} + +/// parses the given string as a regexp +/// @param regexp the regular expression string to create a regexp from +/// @return the RegExp object +RegExp *TextGrammarRule::createRegExp(const QString ®exp) +{ + RegExp *result = new RegExp( + regexp, + RegExp::EngineOniguruma); //, Qt::CaseSensitive, QRegExp::RegExp2 ); + if (!result->isValid()) + { + qlog_warn() << "Error in regexp: " << result->errorString() << "\n" + << regexp; + } + return result; +} + +//========================== + +/// The default texgrammar constructor +/// @param name the name of the textgrammar +/// @param displayName th name to display +TextGrammar::TextGrammar(const QString &name, const QString &displayName) + : name_(name) + , displayName_(displayName) + , mainRule_(0) +{ +} + +/// The textgrammar destructor +TextGrammar::~TextGrammar() +{ + qDeleteAll(repository_); + repository_.clear(); + delete mainRule_; +} + +/// Gives the main rule the grammmar +void TextGrammar::giveMainRule(TextGrammarRule *mainRule) +{ + Q_ASSERT(!mainRule_); + mainRule_ = mainRule; +} + +/// return the name of the textgrammar +QString TextGrammar::name() const +{ + return name_; +} + +/// Returns the displayname of this grammar +QString TextGrammar::displayName() const +{ + return displayName_; +} + +/// Returns the main grammar rule for this textgrammar +TextGrammarRule *TextGrammar::mainRule() const +{ + return mainRule_; +} + +/// Returns all file extensions that are used by this grammar +/// @return a stringlist with all extension (without the '.') +QStringList TextGrammar::fileExtensions() const +{ + return fileExtensions_; +} + +/// This method adds the given grammar rule to the repos +void TextGrammar::giveToRepos(const QString &name, TextGrammarRule *rule) +{ + repository_.insert(name, rule); +} + +/// Finds the grammar rule from the respos +/// @param name the name of the rule +/// @param defValue the grammar rule to return if not found +/// @return the found grammar rule (or the defValue if not found) +TextGrammarRule *TextGrammar::findFromRepos(const QString &name, + TextGrammarRule *defValue) +{ + return repository_.value(name, defValue); +} + +/// Adds a file extension +/// @param ext the extension to add. +void TextGrammar::addFileExtension(const QString &ext) +{ + fileExtensions_.append(ext); +} + +//========================== + +/// The text grammar manager constructor +TextGrammarManager::TextGrammarManager() + : defaultGrammarRef_(0) +{ + + // always make sure there's a default grammar + defaultGrammarRef_ = new TextGrammar("text.plain", "Plain Text"); + defaultGrammarRef_->giveMainRule( + TextGrammarRule::createMainRule(defaultGrammarRef_, "text.plain")); + giveGrammar(defaultGrammarRef_); +} + +/// The detstructor (deletes all grammars) +TextGrammarManager::~TextGrammarManager() +{ + qDeleteAll(grammarMap_); + grammarMap_.clear(); +} + +/// This method reads the given grammar file and adds it to the grammar manager. +/// The grammar manager stays the owner of the grammar file +/// +/// @param filename the direct filename to read +/// @return the TextGrammar file. When an error happend, the errorMessage is set +TextGrammar *TextGrammarManager::readGrammarFile(const QString &file) +{ + lastErrorMessage_.clear(); + TextGrammar *grammar = nullptr; + QString lastErrorMessage; + + TmLanguageParser parser; + grammar = parser.parse(file); + if (grammar) + { + giveGrammar(grammar); + } + else + { + QFileInfo fileInfo(file); + lastErrorMessage_ = QObject::tr("Error reading file %1:%2") + .arg(fileInfo.absoluteFilePath()) + .arg(parser.lastErrorMessage()); + qlog_warn() << lastErrorMessage_; + } + return grammar; +} + +/// reads all grammar files in the given path +/// @param path the path to read all grammar files from +void TextGrammarManager::readAllGrammarFilesInPath(const QString &path) +{ + // qlog_info() << "readAllGrammarFilesInPath(" << path << ")"; + QDir dir(path); + QStringList filters = {"*.tmLanguage", "*.tmLanguage.json"}; + foreach (QFileInfo fileInfo, + dir.entryInfoList(filters, QDir::Files, QDir::Name)) + { + // qlog_info() << "- parse" << fileInfo.baseName() << "."; + readGrammarFile(fileInfo.absoluteFilePath()); + } +} + +/// This method returns the given language grammar +TextGrammar *TextGrammarManager::get(const QString &name) +{ + return grammarMap_.value(name, 0); +} + +/// This method gives a language grammar to the document +/// @param grammar the grammar to give +void TextGrammarManager::giveGrammar(TextGrammar *grammar) +{ + const QString name = grammar->name(); + + // when the grammar already exists delete it + if (grammarMap_.contains(name)) + { + TextGrammar *oldGrammar = grammarMap_.take(name); + + // when the old grammar was the default, replace the default (feels pretty + // dirty) + if (defaultGrammarRef_ == oldGrammar) + { + defaultGrammarRef_ = grammar; + } + + // clearup the old one + delete oldGrammar; + } + grammarMap_.insert(name, grammar); +} + +/// This method returns all grammar names +QList<QString> TextGrammarManager::grammarNames() +{ + return grammarMap_.keys(); +} + +/// This method returns the values +QList<TextGrammar *> TextGrammarManager::grammars() +{ + return grammarMap_.values(); +} + +/// This method is used to compare the grammarnames of textgrammars +/// @param g1 the first grammar +/// @param g2 the second grammar to compare +static bool grammarsDisplayNameSorterLessThen(const TextGrammar *g1, + const TextGrammar *g2) +{ + return g1->displayName().toLower() < g2->displayName().toLower(); +} + +/// This utility function returns all grammars sorted on displayname +/// Warning, this method sorts the grammars so calling this method multiple +/// times is not what you want to do +/// @return the list of grammars sorted on displayname +QList<TextGrammar *> TextGrammarManager::grammarsSortedByDisplayName() +{ + QList<TextGrammar *> results = grammarMap_.values(); + std::sort(results.begin(), results.end(), grammarsDisplayNameSorterLessThen); + return results; +} + +/// this method detects the grammar with a given filename +/// @param fileName the filename to detect the grammar +/// @return the defaultGrammar if no grammar was found +TextGrammar * +TextGrammarManager::detectGrammarWithFilename(const QString &fileName) +{ + foreach (TextGrammar *grammar, grammarMap_.values()) + { + foreach (QString ext, grammar->fileExtensions()) + { + if (fileName.endsWith(QStringLiteral(".%1").arg(ext))) + return grammar; + } + } + return this->defaultGrammar(); +} + +/// returns the grammar manager +/// @return the last error message +QString TextGrammarManager::lastErrorMessage() const +{ + return lastErrorMessage_; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textgrammar.h b/lib/edbee-lib/edbee/models/textgrammar.h new file mode 100644 index 00000000..930c804a --- /dev/null +++ b/lib/edbee-lib/edbee/models/textgrammar.h @@ -0,0 +1,204 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QHash> +#include <QList> +#include <QMap> +#include <QString> +#include <QStringList> + +class QFile; + +namespace edbee +{ + +class RegExp; +class TextGrammar; +class Edbee; + +/// defines a single grammar rule +class EDBEE_EXPORT TextGrammarRule +{ +public: + /// the instructions + enum Instruction + { + MainRule, ///< The main rule has no regexp matches + RuleList, ///< A list of rules (no regexp) + SingleLineRegExp, ///< A single line regexp + MultiLineRegExp, ///< A multi-line regexp (begin end) + IncludeCall, ///< Includes another scope + Parser ///< A full parser (not yet supported, by added as idea for the + ///< future). But could be marked by multiple regexps + }; + + TextGrammarRule(TextGrammar *grammar, Instruction instruction); + ~TextGrammarRule(); + + static TextGrammarRule *createMainRule(TextGrammar *grammar, + const QString &scopeName); + static TextGrammarRule *createRuleList(TextGrammar *grammar); + static TextGrammarRule *createSingleLineRegExp(TextGrammar *grammar, + const QString &scopeName, + const QString ®Exp); + static TextGrammarRule *createMultiLineRegExp(TextGrammar *grammar, + const QString &scopeName, + const QString &contentScopeName, + const QString &beginRegExp, + const QString &endRegExp); + static TextGrammarRule *createIncludeRule(TextGrammar *grammar, + const QString &includeName); + + inline bool isMainRule() { return instruction_ == MainRule; } + inline bool isRuleList() { return instruction_ == RuleList; } + inline bool isMultiLineRegExp() { return instruction_ == MultiLineRegExp; } + inline bool isSingleLineRegExp() { return instruction_ == SingleLineRegExp; } + inline bool isIncludeCall() { return instruction_ == IncludeCall; } + + int ruleCount() const { return ruleList_.size(); } + TextGrammarRule *rule(int idx) const; + void giveRule(TextGrammarRule *rule); + + void giveMatchRegExp(RegExp *regExp); + void setEndRegExpString(const QString &str); + + Instruction instruction() const { return instruction_; } + void setInstruction(Instruction ins) { instruction_ = ins; } + QString scopeName() const { return scopeName_; } + void setScopeName(const QString &scopeName) { scopeName_ = scopeName; } + RegExp *matchRegExp() const { return matchRegExp_; } + QString endRegExpString() const { return endRegExpString_; } + const QMap<int, QString> &matchCaptures() { return matchCaptures_; } + const QMap<int, QString> &endCaptures() { return endCaptures_; } + QString contentScopeName() const { return contentScopeName_; } + void setContentScopeName(const QString &name) { contentScopeName_ = name; } + + /// the include name is stored in the content-scopename + QString includeName() { return contentScopeName_; } + void setIncludeName(const QString &name) { contentScopeName_ = name; } + + void setCapture(int idx, const QString &name) + { + matchCaptures_.insert(idx, name); + } + void setEndCapture(int idx, const QString &name) + { + endCaptures_.insert(idx, name); + } + + QString toString(bool includePatterns = true); + + // An itetor class for iterating over the ruleset (todo template this) + class Iterator + { + public: + Iterator(const TextGrammarRule *rule) + : index_(0) + , ruleRef_(rule) + { + } + bool hasNext() { return index_ < ruleRef_->ruleCount(); } + TextGrammarRule *next() { return ruleRef_->rule(index_++); } + + private: + int index_; + const TextGrammarRule *ruleRef_; + }; + + Iterator *createIterator() { return new Iterator(this); } + + TextGrammar *grammar() { return grammarRef_; } + +private: + static RegExp *createRegExp(const QString ®exp); + +private: + TextGrammar *grammarRef_; ///< The grammar this rule belongs toe + Instruction instruction_; ///< THe instruction to execute + QString scopeName_; ///< the scope name of this grammar + + RegExp *matchRegExp_; ///< The begin-matcher (or simple matcher) + // RegExp* endRegExp_; ///< The end regular expression + // matcher + QString endRegExpString_; ///< The end regexp is a string + + QMap<int, QString> matchCaptures_; ///< all captures that need to be performed + QMap<int, QString> + endCaptures_; ///< all end captures that need to be performed + + QString contentScopeName_; ///< The content scopename + + QList<TextGrammarRule *> ruleList_; ///< Sub-rules to execute +}; + +//================================ + +/// This class defines a single language grammar +class EDBEE_EXPORT TextGrammar +{ +public: + TextGrammar(const QString &name, const QString &displayName); + ~TextGrammar(); + + void giveMainRule(TextGrammarRule *mainRule); + + QString name() const; + QString displayName() const; + TextGrammarRule *mainRule() const; + QStringList fileExtensions() const; + + void giveToRepos(const QString &name, TextGrammarRule *rule); + TextGrammarRule *findFromRepos(const QString &name, + TextGrammarRule *defValue = 0); + void addFileExtension(const QString &ext); + +private: + QString name_; ///< the display name of this + QString displayName_; ///< the name to display + TextGrammarRule *mainRule_; ///< the 'main' rule of this grammar + QMap<QString, TextGrammarRule *> + repository_; ///< A map with all named grammar rules + QStringList fileExtensions_; ///< A list with all file-extensions +}; + +//================================ + +/// This class is used to manage all 'grammers' used by the lexers +class EDBEE_EXPORT TextGrammarManager +{ +protected: + TextGrammarManager(); + virtual ~TextGrammarManager(); + +public: + TextGrammar *readGrammarFile(const QString &file); + void readAllGrammarFilesInPath(const QString &path); + + TextGrammar *get(const QString &name); + void giveGrammar(TextGrammar *grammar); + + QList<QString> grammarNames(); + QList<TextGrammar *> grammars(); + QList<TextGrammar *> grammarsSortedByDisplayName(); + + TextGrammar *defaultGrammar() { return defaultGrammarRef_; } + TextGrammar *detectGrammarWithFilename(const QString &fileName); + + QString lastErrorMessage() const; + +private: + TextGrammar *defaultGrammarRef_; ///< A reference to the default grammar + QMap<QString, TextGrammar *> + grammarMap_; ///< A map with all grammar definitions + QString lastErrorMessage_; ///< Returns the error message + + friend class Edbee; +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textlexer.cpp b/lib/edbee-lib/edbee/models/textlexer.cpp new file mode 100644 index 00000000..9aa14bce --- /dev/null +++ b/lib/edbee-lib/edbee/models/textlexer.cpp @@ -0,0 +1,37 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "textlexer.h" + +#include "edbee/models/textgrammar.h" +#include "edbee/models/textdocumentscopes.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +TextLexer::TextLexer(TextDocumentScopes *scopes) + : textDocumentScopesRef_(scopes) + , grammarRef_(0) +{ +} + +void TextLexer::setGrammar(TextGrammar *grammar) +{ + Q_ASSERT(grammar); + grammarRef_ = grammar; + textScopes()->setDefaultScope(grammarRef_->mainRule()->scopeName(), + grammarRef_->mainRule()); + textScopes()->removeScopesAfterOffset(0); // invalidate the complete scopes +} + +/// This method returns the text document +TextDocument *TextLexer::textDocument() +{ + return textDocumentScopesRef_->textDocument(); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textlexer.h b/lib/edbee-lib/edbee/models/textlexer.h new file mode 100644 index 00000000..c3b30d83 --- /dev/null +++ b/lib/edbee-lib/edbee/models/textlexer.h @@ -0,0 +1,51 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include "edbee/models/textbuffer.h" + +namespace edbee +{ + +class TextGrammar; +class TextDocument; +class TextDocumentScopes; + +/// This is a single lexer +class EDBEE_EXPORT TextLexer +{ +public: + TextLexer(TextDocumentScopes *scopes); + virtual ~TextLexer() {} + + /// This method is called to notify the lexer some data has been changed + // virtual void textReplaced( int offset, int length, int newLength ) = 0; + virtual void textChanged(const edbee::TextBufferChange &change) = 0; + + /// This method is called to notify the lexer the grammar has been changed + void setGrammar(TextGrammar *grammar); + inline TextGrammar *grammar() { return grammarRef_; } + + /// This method is called when the given range needs to be lexed + /// WARNING, this method must be VERY optimized and should 'remember' the + /// lexing states between calls. To invalidate the scopes/lexing state the + /// textReplaced method can be used + /// + /// @param beginOffset the first offset + /// @param endOffset the last offset to + virtual void lexRange(int beginOffset, int endOffset) = 0; + + TextDocumentScopes *textScopes() { return textDocumentScopesRef_; } + TextDocument *textDocument(); + +private: + TextDocumentScopes *textDocumentScopesRef_; ///< A Text document refs + TextGrammar *grammarRef_; ///< The reference to the active grammar +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textlinedata.cpp b/lib/edbee-lib/edbee/models/textlinedata.cpp new file mode 100644 index 00000000..0a4051c1 --- /dev/null +++ b/lib/edbee-lib/edbee/models/textlinedata.cpp @@ -0,0 +1,331 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "textlinedata.h" + +#include "edbee/models/changes/linedatalistchange.h" +#include "edbee/models/textlinedata.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +//------- + +/// construct the text line data item +TextLineDataList::TextLineDataList() + : lineDataList_(0) +{ +} + +TextLineDataList::~TextLineDataList() +{ + if (lineDataList_) + { + // Q_ASSERT(false); /// YOU MUST call destroy before the + // destructor! + qlog_warn() + << "** Warning TextLineDataList requires manual destruction! ** "; + } +} + +/// destroys the data items +void TextLineDataList::destroy(TextLineDataManager *manager) +{ + if (lineDataList_) + { + + for (int i = 0, cnt = manager->fieldsPerLine(); i < cnt; ++i) + { + delete lineDataList_[i]; + lineDataList_[i] = 0; + } + } + delete[] lineDataList_; + lineDataList_ = 0; +} + +/// this method gives a given dat item to the given field position +void TextLineDataList::give(TextLineDataManager *manager, int field, + TextLineData *dataItem) +{ + Q_ASSERT(field < manager->fieldsPerLine()); + if (!lineDataList_) + { + lineDataList_ = new TextLineData *[manager->fieldsPerLine()](); + } + delete lineDataList_[field]; // delete the old item + lineDataList_[field] = dataItem; +} + +/// This method returns the given data item and transfers the ownership. The +/// item in the list is set to 0 +/// @param manager the manager to use +/// @param field the field index to retrieve +/// @return the TextLineData item in the given field or 0 +TextLineData *TextLineDataList::take(TextLineDataManager *manager, int field) +{ + Q_ASSERT(field < manager->fieldsPerLine()); + Q_UNUSED(manager); + if (!lineDataList_) + { + return 0; + } + TextLineData *dataItem = lineDataList_[field]; + lineDataList_[field] = 0; + return dataItem; +} + +/// This method returns the given data item / +/// @param manager the manager to use +/// @param field the field index to retrieve +/// @return the TextLineData item in the given field or 0 +TextLineData *TextLineDataList::at(TextLineDataManager *manager, int field) +{ + Q_ASSERT(field < manager->fieldsPerLine()); + Q_UNUSED(manager); + if (!lineDataList_) + { + return 0; + } + return lineDataList_[field]; +} + +/// This method reallocates the number of fields +void TextLineDataList::realloc(TextLineDataManager *manager, + int oldFieldsPerLine, int newFieldsPerLine) +{ + // qlog_info() << "realloc:" << oldFieldsPerLine << " >> " << + // newFieldsPerLine; + TextLineData **oldData = lineDataList_; + + // copy the data + if (oldData) + { + lineDataList_ = new TextLineData *[manager->fieldsPerLine()](); + int copyCount = qMin(oldFieldsPerLine, newFieldsPerLine); + for (int i = 0; i < copyCount; ++i) + { + lineDataList_[i] = oldData[i]; + oldData[i] = 0; + } + + for (int i = copyCount; i < oldFieldsPerLine; ++i) + { + delete oldData[i]; + oldData[i] = 0; + } + delete[] oldData; + } +} + +//------- + +TextLineDataManager::TextLineDataManager(int fieldsPerLine) + : fieldsPerLine_(fieldsPerLine) + , textLineDataList_(2) +{ + textLineDataList_.setGrowSize(2); + // add a 0 element + textLineDataList_.fill(0, 0, 0, 1); +} + +TextLineDataManager::~TextLineDataManager() +{ + clear(); +} + +/// this method clears all field items +void TextLineDataManager::clear() +{ + for (int i = 0, cnt = textLineDataList_.length(); i < cnt; ++i) + { + TextLineDataList *list = textLineDataList_.at(i); + if (list) + { + list->destroy(this); + delete list; + // textLineDataList_.set(i,0); + } + } + textLineDataList_.clear(); + textLineDataList_.fill(0, 0, 0, 1); +} + +/// this method gives the given data at the given line and field +void TextLineDataManager::give(int line, int field, TextLineData *dataItem) +{ + Q_ASSERT(field < fieldsPerLine_); + TextLineDataList *list = textLineDataList_.at(line); + if (!list) + { + textLineDataList_.set(line, list = new TextLineDataList()); + } + list->give(this, field, dataItem); + emit lineDataChanged(line, 1, 1); +} + +TextLineData *TextLineDataManager::take(int line, int field) +{ + Q_ASSERT(field < fieldsPerLine_); + TextLineDataList *list = textLineDataList_.at(line); + if (list) + { + return list->take(this, field); + } + return 0; +} + +TextLineData *TextLineDataManager::get(int line, int field) +{ + Q_ASSERT(field < fieldsPerLine_); + TextLineDataList *list = textLineDataList_.at(line); + if (list) + { + return list->at(this, field); + } + return 0; +} + +/// This method is called to notify that some lines have been replaced +// void TextLineDataManager::linesReplaced(int lineStart, int lineCount, int +// newLineCount) +//{ +// Q_ASSERT(false); +///// TODO: use linedatalist-textchange for storing undo/redo operations +// qlog_info() << "TODO: We need to support destroy line data operation!"; + +/* WE MUST MAKE THIS A TEXT CHANGE !! + // remove all items + for( int i=lineStart,end=lineStart+lineCount; i<end; ++i ){ + TextLineDataList* list = textLineDataList_.at(i); + + LineDataTextChange* linesRemoves + + if( list ) { list->destroy(this); } + delete list; + } + +// // remove all items +// for( int i=lineStart,end=lineStart+lineCount; i<end; ++i ){ +// TextLineDataList* list = textLineDataList_.at(i); +// if( list ) { list->destroy(this); } +// delete list; +// } +// +// // replace all old items with 0 values +// textLineDataList_.fill( lineStart, lineCount, 0, newLineCount ); +*/ +//} + +// void TextLineDataManager::dumpGapvector() +//{ +// qlog_info() << "GAPVECTOR: ["<<textLineDataList_.gapBegin() << +// ","<<textLineDataList_.gapEnd()<<">"; for( int i=0; i < +// textLineDataList_.capacity(); ++i ) { +// TextLineDataList* item = textLineDataList_.rawAt(i); +// qlog_info() << "-" << i << ":" << +// QStringLiteral("%1").arg((quintptr)item); +// } +// qlog_info()<<"- done"; + +//} + +/// This method can be used to change the number of reserved fields by the +/// document Increasing the amount will result in a realoc Decreasting the +/// fieldcount reults in the lost of the 'old' fields At least the +/// 'PredefinedFieldCount' amont of fields are required +void TextLineDataManager::setFieldsPerLine(int count) +{ + Q_ASSERT(count >= PredefinedFieldCount); + for (int i = 0, cnt = textLineDataList_.length(); i < cnt; ++i) + { + TextLineDataList *list = textLineDataList_.at(i); + if (list) + { + list->realloc(this, fieldsPerLine_, count); + } + } + fieldsPerLine_ = count; +} + +/// This method creates a new lines replace change +Change *TextLineDataManager::createLinesReplacedChange(int lineStart, + int lineCount, + int newLineCount) +{ + // no changes + if (lineCount == 0 && lineCount == newLineCount) + { + return 0; + } + + LineDataListChange *change + = new LineDataListChange(this, lineStart, lineCount, newLineCount); + return change; +} + +/// This method takes the given list (and repalces it with a 0 value) +TextLineDataList *TextLineDataManager::takeList(int line) +{ + TextLineDataList *list = textLineDataList_[line]; + textLineDataList_[line] = 0; + return list; +} + +/// This method gives a list to the given line +/// emits a lineDataChanged signal +void TextLineDataManager::giveList(int line, TextLineDataList *newList) +{ + // delete the old list if required + TextLineDataList *list = textLineDataList_[line]; + if (list) + { + list->destroy(this); + delete list; + } + textLineDataList_[line] = newList; + emit lineDataChanged(line, 1, 1); +} + +/// replace the given area with no-data +/// emits a lineDataChanged signal +void TextLineDataManager::fillWithEmpty(int line, int length, int newLength) +{ + + destroyRange(line, length); + textLineDataList_.fill(line, length, 0, newLength); + // qlog_info() << "- TextLineDataManager::fillWithEmpty( line: " << line << ", + // length " << length << " newLength: " << newLength << ") len:" << + // this->textLineDataList_.length(); + emit lineDataChanged(line, length, newLength); +} + +/// Replace the given items with +/// emits a lineDataChanged signal +void TextLineDataManager::replace(int line, int length, + TextLineDataList **items, int newLength) +{ + destroyRange(line, length); + textLineDataList_.replace(line, length, items, newLength); + emit lineDataChanged(line, length, newLength); +} + +/// destroys all items in the given range +void TextLineDataManager::destroyRange(int line, int length) +{ + for (int i = 0; i < length; i++) + { + TextLineDataList *list = takeList(line + i); + if (list) + { + list->destroy(this); + delete list; + } + } +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textlinedata.h b/lib/edbee-lib/edbee/models/textlinedata.h new file mode 100644 index 00000000..ef1b14d0 --- /dev/null +++ b/lib/edbee-lib/edbee/models/textlinedata.h @@ -0,0 +1,132 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QObject> + +#include "edbee/util/gapvector.h" + +namespace edbee +{ + +enum TextLineDataPredefinedFields +{ + LineTextScopesField = 0, + // LineDataMarkers, /// Bookmarks etc + PredefinedFieldCount = 1 +}; + +class Change; +class TextLineDataManager; + +/// A text line item reference +class EDBEE_EXPORT TextLineData{ + public : TextLineData(){} virtual ~TextLineData(){} + // bool undoable() = 0; +}; + +/// a simple class to store a QString in a line +template<typename T> +class EDBEE_EXPORT BasicTextLineData : public TextLineData +{ +public: + BasicTextLineData(const T &val) + : value_(val) + { + } + T value() { return value_; } + void setValue(const T &value) { value_ = value; } + +private: + T value_; +}; + +typedef BasicTextLineData<QString> QStringTextLineData; + +//------- + +/// the line data items +class EDBEE_EXPORT TextLineDataList +{ +public: + TextLineDataList(); + virtual ~TextLineDataList(); + virtual void destroy(TextLineDataManager *manager); + + void give(TextLineDataManager *manager, int field, TextLineData *dataItem); + TextLineData *take(TextLineDataManager *manager, int field); + TextLineData *at(TextLineDataManager *manager, int field); + + void realloc(TextLineDataManager *manager, int oldFieldPerLine, + int newFieldsPerLine); + +private: + TextLineData **lineDataList_; ///< The text line data items +}; + +//------- + +/// This manager manages all line definitions +class EDBEE_EXPORT TextLineDataManager : public QObject +{ + Q_OBJECT + +public: + TextLineDataManager(int fieldsPerLine = PredefinedFieldCount); + virtual ~TextLineDataManager(); + + void clear(); + + void give(int line, int field, TextLineData *dataItem); + TextLineData *take(int line, int field); + TextLineData *get(int line, int field); + + /// returns the number of items per line + int fieldsPerLine() { return fieldsPerLine_; } + void setFieldsPerLine(int count); + + /// returns the number of items + int length() const { return textLineDataList_.length(); } + /// returns the textline data list item + TextLineDataList *at(int idx) const { return textLineDataList_.at(idx); } + + // internal functions + Change *createLinesReplacedChange(int lineStart, int lineCount, + int newLineCount); + TextLineDataList *takeList(int line); + void giveList(int line, TextLineDataList *list); + + void fillWithEmpty(int line, int length, int newLength); + void replace(int line, int length, TextLineDataList **items, int newLength); + + /// internal method for direct accesss + GapVector<TextLineDataList *> *textLineDataList() + { + return &textLineDataList_; + } + +protected: + void destroyRange(int line, int length); + +public slots: + + // void linesReplaced( int lineStart, int lineCount, int newLineCount ); + // void dumpGapvector(); +signals: + + void lineDataChanged( + int line, int length, + int newLength); ///< This signal is emitted if line-data is changed + +private: + int fieldsPerLine_; ///< The number of items per line + GapVector<TextLineDataList *> textLineDataList_; ///< The textline data list + // NoGapVector<TextLineDataList*> textLineDataList_; +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textrange.cpp b/lib/edbee-lib/edbee/models/textrange.cpp new file mode 100644 index 00000000..f9278981 --- /dev/null +++ b/lib/edbee-lib/edbee/models/textrange.cpp @@ -0,0 +1,1349 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include <QStringList> + +#include "textdocument.h" +#include "textrange.h" +#include "texteditorconfig.h" +#include "edbee/debug.h" + +namespace edbee +{ + +/// This method compares selection ranges +bool TextRange::lessThan(TextRange &r1, TextRange &r2) +{ + return r1.min() < r2.min(); +} + +/// Makes sure the caret isn't in-between a unicode boundary +/// refs #19 - Dirty hack to improve caret-movement by skipping non-BMP +/// characters +void TextRange::fixCaretForUnicode(TextDocument *doc, int direction) +{ + if (caret_ >= doc->length()) + return; + + // unicode-emoji hack (Really really dirty!!) + int code = doc->charAt(caret_).unicode(); + // qlog_info() << "fixCaretForUnicode: >> " << caret_ << " : " << code << "(" + // << direction << ")"; + if (0xDC00 <= code && code <= 0xDFFF) + { + if (direction > 0) + { + setCaretBounded(doc, caret_ + 1); + } + else + { + setCaretBounded(doc, caret_ - 1); + } + } +} + +/// Sets the anchor to the given location, and forces the anchor to say between +/// the document bounds +/// @param doc document to set the anchor for +/// @param anchor the anchor location to set +void TextRange::setAnchorBounded(TextDocument *doc, int anchor) +{ + setAnchor(qBound(0, anchor, doc->length())); +} + +/// Sets the caret to the given location, and forces the caret to say between +/// the document bounds +/// @param doc the document (used for checking the document bounds) +/// @param caret the caret position to set +void TextRange::setCaretBounded(TextDocument *doc, int caret) +{ + setCaret(qBound(0, caret, doc->length())); +} + +/// Changes the length by modifying the max-variable +void TextRange::setLength(int newLength) +{ + int &vMin = minVar(); + int &vMax = maxVar(); + vMax = vMin + newLength; +} + +/// This method converts a text-selection range to a string helpfull with +/// debuggin +QString TextRange::toString() const +{ + return QStringLiteral("%1>%2").arg(anchor_).arg(caret_); +} + +/// Moves the caret the given amount +/// @param doc the document to move the caret for +/// @param amount the amount to move +void TextRange::moveCaret(TextDocument *doc, int amount) +{ + setCaretBounded(doc, caret_ + amount); + fixCaretForUnicode(doc, amount); +} + +/// move the caret or deselect the given amount +/// @param doc the document to move the caret in +/// @param amount the amount to move +void TextRange::moveCaretOrDeselect(TextDocument *doc, int amount) +{ + // when there's a selection clear it (move the caret to the right side + if (hasSelection()) + { + if (amount < 0) + { + setCaret(min()); + } + else + { + setCaret(max()); + } + setAnchor(caret()); + + // just moves the caret + } + else + { + setCaretBounded(doc, caret_ + amount); + } + fixCaretForUnicode(doc, amount); +} + +/// This method charactes after the given char group +/// When moving to the left the cursor is placed AFTER the last character +/// @param doc the text document +/// @param var the initial position +/// @param amount the amount to move +int TextRange::moveWhileChar(TextDocument *doc, int pos, int amount, + const QString &chars) +{ + int docLength = doc->length(); + if (amount < 0) + { + --pos; // first move left + while (pos >= 0 && chars.indexOf(doc->charAt(pos)) >= 0) + { + --pos; + } + ++pos; + } + else + { + while (pos < docLength && chars.indexOf(doc->charAt(pos)) >= 0) + { + ++pos; + } + } + return pos; +} + +/// This method charactes until the given chargroup is found +/// When moving to the LEFT the cursor is placed AFTER the found character +int TextRange::moveUntilChar(TextDocument *doc, int pos, int amount, + const QString &chars) +{ + int docLength = doc->length(); + if (amount < 0) + { + --pos; + while (pos >= 0 && chars.indexOf(doc->charAt(pos)) < 0) + { + --pos; + } + ++pos; + } + else + { + while (pos < docLength && chars.indexOf(doc->charAt(pos)) < 0) + { + ++pos; + } + } + return pos; +} + +/// moves the caret while a character is moving +void TextRange::moveCaretWhileChar(TextDocument *doc, int amount, + const QString &chars) +{ + caret_ = moveWhileChar(doc, caret_, amount, chars); +} + +void TextRange::moveCaretUntilChar(TextDocument *doc, int amount, + const QString &chars) +{ + caret_ = moveUntilChar(doc, caret_, amount, chars); +} + +void TextRange::moveAnchortWhileChar(TextDocument *doc, int amount, + const QString &chars) +{ + anchor_ = moveWhileChar(doc, anchor_, amount, chars); +} + +void TextRange::moveAnchorUntilChar(TextDocument *doc, int amount, + const QString &chars) +{ + anchor_ = moveWhileChar(doc, anchor_, amount, chars); +} + +/// This method moves the caret to/from the given seperator +void TextRange::moveCaretByCharGroup(TextDocument *doc, int amount, + const QString &whitespace, + const QStringList &characterGroups) +{ + int count = qAbs(amount); + + for (int i = 0; i < count; ++i) + { + + // first 'skip' the whitespaces + int oldCaret = caret_; + moveCaretWhileChar(doc, amount, whitespace); + + // find the character group + QChar chr; + if (amount < 0) + { + if (caret_ == 0) + return; + chr = doc->charAt(caret_ - 1); + } + else + { + if (caret_ == doc->length()) + return; + chr = doc->charAt(caret_); + } + + // newline is a special operation :( + if (chr == '\n') + { + if (caret_ == oldCaret) + { + caret_ += amount < 0 ? -1 : 1; + } + } + else + { + + // while the character is found + bool found = false; + for (int i = 0, cnt = characterGroups.length(); i < cnt; ++i) + { + const QString &group = characterGroups.at(i); + if (group.indexOf(chr) >= 0) + { + moveCaretWhileChar(doc, amount, group); + found = true; + break; + } + } + + // all other characters are valid + if (!found) + { + QString str = characterGroups.join(""); + str.append(whitespace); + str.append('\n'); + moveCaretUntilChar(doc, amount, str); + } + } + } +} + +/// This moves the caret to a line boundary +/// @param doc the document this range operates on +/// @param amount the direction to move to +/// @par am whitespace the characters that need to be interpreted as +/// whitespace +void TextRange::moveCaretToLineBoundary(TextDocument *doc, int amount, + const QString &whitespace) +{ + TextBuffer *buf = doc->buffer(); + int caret = caret_; + int line = doc->lineFromOffset(caret); + int offsetNextLine = doc->offsetFromLine(line + 1); + if (amount < 0) + { + int lineStart = doc->offsetFromLine(line); + + // find the first word + int wordStart = buf->findCharPosWithinRangeOrClamp( + lineStart, 1, whitespace, false, lineStart, offsetNextLine); + if (caret > wordStart || lineStart == caret) + { + caret = wordStart; + } + else + { + caret = lineStart; + } + } + else + { + + caret = offsetNextLine; + if (line != doc->lineCount() - 1) + { + --caret; + } + } + setCaretBounded(doc, caret); +} + +/// Moves the caret to a word boundary (used for word dragging selections) +void TextRange::moveCaretToWordBoundaryAtOffset(TextDocument *doc, + int newOffset) +{ + TextEditorConfig *config = doc->config(); + + // left direction + if (newOffset < anchor()) + { + setAnchor(max()); + setCaret(newOffset); + moveCaretByCharGroup(doc, -1, config->whitespaces(), config->charGroups()); + // right direction + } + else + { + setCaret(newOffset); + moveCaretByCharGroup(doc, 1, config->whitespaces(), config->charGroups()); + } +} + +/// Moves the caret to a word boundary (used for word dragging selections) +void TextRange::moveCaretToLineBoundaryAtOffset(TextDocument *doc, + int newOffset) +{ + int firstLine = doc->lineFromOffset(min()); + int lastLine = doc->lineFromOffset(max()); + + // changed offset + setCaret(newOffset); + + int newLine = doc->lineFromOffset(newOffset); + + // left direction + if (newLine < lastLine) + { + this->caret_ = doc->offsetFromLine(newLine); + this->anchor_ = doc->offsetFromLine(lastLine); + // right direction + } + else if (newLine > firstLine) + { + this->anchor_ = doc->offsetFromLine(firstLine); + this->caret_ = doc->offsetFromLine(newLine + 1); + } +} + +/// Expands the selection range so it only consists of full lines +/// amount specifies the amount (and the direction) of the expansions +/// -1 means expand lines to top (and add extra lines) +/// 1 means expand lines at the bottom (and add extras lines) +/// 0 is a special case, it moves the caret to the start of the current line and +/// expands to the end of the line. It does not add lines +void TextRange::expandToFullLine(TextDocument *doc, int amount) +{ + int minOffset = min(); + int maxOffset = max(); + + // select the current line (everse caret + if (amount == 0) + { + minOffset = doc->offsetFromLine(doc->lineFromOffset(minOffset)); + maxOffset = doc->offsetFromLine(doc->lineFromOffset(maxOffset) + 1); + caret_ = minOffset; + anchor_ = maxOffset; + } + else if (amount > 0) + { + minOffset = doc->offsetFromLine(doc->lineFromOffset(minOffset)); + maxOffset = doc->offsetFromLine(doc->lineFromOffset(maxOffset) + amount); + + caret_ = maxOffset; + anchor_ = minOffset; + } + else + { + + int minLine = doc->lineFromOffset(minOffset); + int minLineStartOffset = doc->offsetFromLine(minLine); + + // only select line above if the full line isn't selected yet + if (minOffset == minLineStartOffset) + { + if (minOffset > 0) + { + --minOffset; + } + } + ++amount; + minOffset = doc->offsetFromLine(doc->lineFromOffset(minOffset) + amount); + + // select to eol if required + int maxLine = doc->lineFromOffset(maxOffset); + int maxLineStartOffset = doc->offsetFromLine(maxLine); + if (maxLineStartOffset != maxOffset) + { + maxOffset = doc->offsetFromLine(doc->lineFromOffset(maxOffset) + 1); + } + + caret_ = minOffset; + anchor_ = maxOffset; + } +} + +/// This method deselects the last character if it's a newline. +void TextRange::deselectTrailingNewLine(TextDocument *doc) +{ + if (caret_ != anchor_ && doc->charAtOrNull(max() - 1) == '\n') + { + --maxVar(); + } +} + +/// Internal method, for finding a character group with the given character +static QString findCharGroup(QChar c, const QString &whitespace, + const QStringList &characterGroups) +{ + QString foundGroup; + if (whitespace.indexOf(c) >= 0) + { + foundGroup = whitespace; + } + else + { + for (int i = 0, cnt = characterGroups.length(); i < cnt; ++i) + { + if (characterGroups.at(i).indexOf(c) >= 0) + { + foundGroup = characterGroups.at(i); + break; + } + } + } + return foundGroup; +} + +/// Expands the selection to a words +void TextRange::expandToWord(TextDocument *doc, const QString &whitespace, + const QStringList &characterGroups) +{ + int &min = minVar(); + int &max = maxVar(); + + // first check which character is under the caret to find the character grouop + if (min > 0) + { + QString group + = findCharGroup(doc->charAt(min - 1), whitespace, characterGroups); + if (group.isEmpty()) + { + group = characterGroups.join("").append(whitespace); // the 'else' group + min = moveUntilChar(doc, min, -1, group); + } + else + { + min = moveWhileChar(doc, min, -1, group); + } + } + + if (max < doc->length()) + { + QString group + = findCharGroup(doc->charAt(max), whitespace, characterGroups); + if (group.isEmpty()) + { + group = characterGroups.join("").append(whitespace); // the 'else' group + max = moveUntilChar(doc, max, 1, group); + } + else + { + max = moveWhileChar(doc, max, 1, group); + } + } +} + +void TextRange::expandToIncludeRange(TextRange &range) +{ + int &min = minVar(); + int &max = maxVar(); + min = qMin(min, range.min()); + max = qMax(max, range.max()); +} + +/// Sets the bounds +void TextRange::forceBounds(TextDocument *doc) +{ + setAnchorBounded(doc, anchor_); + setCaretBounded(doc, caret_); +} + +/// This method checks if the two ranges are equal +/// @param range the range to compare it to +bool TextRange::equals(const TextRange &range) +{ + return range.caret_ == caret_ && range.anchor_ == anchor_; +} + +/// Checks if two ranges touch eachother. Touching means that the start and end +/// of two ranges are onto eachother Possible situations ( [ = anchor, > = +/// caret, ( = don't care ) +/// (A)(B) or (B)(A) +bool TextRange::touches(TextRange &range) +{ + int min1 = min(); + int max1 = max(); + int min2 = range.min(); + int max2 = range.max(); + return (max1 == min2 || max2 == min1); +} + +/// checks if the given position is in this textrange +bool TextRange::contains(int pos) +{ + return min() <= pos && pos < max(); +} + +//========================================================================= + +TextRangeSetBase::TextRangeSetBase(TextDocument *doc) + : textDocumentRef_(doc) + , changing_(0) +{ +} + +/// this method returns the last range +TextRange &TextRangeSetBase::lastRange() +{ + return range(rangeCount() - 1); +} + +/// the first range +TextRange &TextRangeSetBase::firstRange() +{ + return range(0); +} + +/// This method returns the range index at the given offset +/// @param offset the offset to check +/// @return the offset index or -1 if not found +int TextRangeSetBase::rangeIndexAtOffset(int offset) +{ + // find the range of this offset + for (int i = 0, cnt = rangeCount(); i < cnt; ++i) + { + TextRange &found = this->range(i); + int minOffset = found.min(); + int maxOffset = found.max(); + if (minOffset <= offset && offset <= maxOffset) + { + return i; + } + } + return -1; +} + +/// returns the range indices that are being overlapped by the given offsetBegin +/// and offsetEnd +/// @param offsetBegin the offset to search +/// @param offsetEnd the end-offset to search +/// @param firstIndex(out) The first index found (-1 if not found) +/// @param lastIndex(out) The last index found (-1 if not found) +/// @return true if the range is found +bool TextRangeSetBase::rangesBetweenOffsets(int offsetBegin, int offsetEnd, + int &firstIndex, int &lastIndex) +{ + firstIndex = -1; + lastIndex = -1; + /// Todo optimize with a binairy search + for (int i = 0, cnt = rangeCount(); i < cnt; ++i) + { + TextRange &range = this->range(i); + int minOffset = range.min(); + int maxOffset = range.max(); + + if ((offsetBegin <= minOffset && minOffset <= offsetEnd) + || (minOffset <= offsetBegin && offsetBegin <= maxOffset)) + { + if (firstIndex < 0) + firstIndex = i; + lastIndex = i; + } + } + return firstIndex >= 0; +} + +/// returns the range indices that are being overlapped by the given offsetBegin +/// and offsetEnd +/// @param offsetBegin the offset to search +/// @param offsetEnd the end-offset to search +/// @param firstIndex(out) The first index found (-1 if not found) +/// @param lastIndex(out) The last index found (-1 if not found) +/// @return true if the range is found +bool TextRangeSetBase::rangesBetweenOffsetsExlusiveEnd(int offsetBegin, + int offsetEnd, + int &firstIndex, + int &lastIndex) +{ + firstIndex = -1; + lastIndex = -1; + /// Todo optimize with a binairy search + for (int i = 0, cnt = rangeCount(); i < cnt; ++i) + { + TextRange &range = this->range(i); + int minOffset = range.min(); + int maxOffset = range.max(); + + if ((offsetBegin <= minOffset && minOffset < offsetEnd) + || (minOffset <= offsetBegin && offsetBegin < maxOffset)) + { + if (firstIndex < 0) + firstIndex = i; + lastIndex = i; + } + } + return firstIndex >= 0; +} + +/// Returns the range indices that are being used on the given line +bool TextRangeSetBase::rangesAtLine(int line, int &firstIndex, int &lastIndex) +{ + TextDocument *doc = textDocument(); + int offsetBegin = doc->offsetFromLine(line); + int offsetEnd = doc->offsetFromLine(line + 1) - 1; + return rangesBetweenOffsets(offsetBegin, offsetEnd, firstIndex, lastIndex); +} + +/// Returns the range indices that are being used on the given line (Excluding +/// the last offset) +bool TextRangeSetBase::rangesAtLineExclusiveEnd(int line, int &firstIndex, + int &lastIndex) +{ + TextDocument *doc = textDocument(); + int offsetBegin = doc->offsetFromLine(line); + int offsetEnd = doc->offsetFromLine(line + 1) - 1; + return rangesBetweenOffsetsExlusiveEnd(offsetBegin, offsetEnd, firstIndex, + lastIndex); +} + +/// This method checks if there's a selection available +/// A selection is an range with a different anchor then it's caret +bool TextRangeSetBase::hasSelection() +{ + for (int i = 0, cnt = rangeCount(); i < cnt; ++i) + { + if (range(i).hasSelection()) + return true; + } + return false; +} + +/// This method checks if two selections are equal +bool TextRangeSetBase::equals(TextRangeSetBase &sel) +{ + if (sel.rangeCount() != rangeCount()) + return false; + for (int i = rangeCount() - 1; i >= 0; --i) + { + if (!range(i).equals(sel.range(i))) + return false; + } + return true; +} + +/// Replaces all ranges with the supplied ranges +void TextRangeSetBase::replaceAll(const TextRangeSetBase &base) +{ + clear(); + for (int i = 0, cnt = base.rangeCount(); i < cnt; ++i) + { + addRange(base.constRange(i)); + } +} + +/// This method returns all selected text +/// For every filled selection range a line is returned +QString TextRangeSetBase::getSelectedText() +{ + TextDocument *doc = textDocument(); + QString buffer; + for (int i = 0, cnt = rangeCount(); i < cnt; ++i) + { + TextRange &range = this->range(i); + if (range.hasSelection()) + { + buffer.append(doc->textPart(range.min(), range.length())); + buffer.append("\n"); + } + } + if (!buffer.isEmpty()) + { + buffer.remove(buffer.length() - 1, 1); // remove the last(newline character) + } + return buffer; +} + +/// Returns ALL lines that are touched by the selection. This means +/// Full lines are always returned +QString TextRangeSetBase::getSelectedTextExpandedToFullLines() +{ + TextDocument *doc = textDocument(); + QString buffer; + int lastLine = -1; + for (int i = 0, cnt = rangeCount(); i < cnt; ++i) + { + TextRange &range = this->range(i); + int min = range.min(); + int max = range.max(); + int line = doc->lineFromOffset(min); + int maxLine = doc->lineFromOffset(max); + + // skip the current line if it's the same as last one + if (line == lastLine) + { + ++line; + } + while (line <= maxLine) + { + buffer.append(doc->lineWithoutNewline(line)); + buffer.append("\n"); + ++line; + } + lastLine = line; + } + return buffer; +} + +/// This method converts the selection ranges as a string, in the format: +/// anchor>caret,anchor>caret +QString TextRangeSetBase::rangesAsString() const +{ + QString str; + for (int i = 0, cnt = rangeCount(); i < cnt; ++i) + { + const TextRange &range = constRange(i); + if (!str.isEmpty()) + str.append(","); + str.append(range.toString()); + } + return str; +} + +/// This method resets all anchors to the positions of the carets +void TextRangeSetBase::resetAnchors() +{ + for (int i = 0, cnt = rangeCount(); i < cnt; ++i) + { + TextRange &range = this->range(i); + range.reset(); + } +} + +/// This method moves all carets to the anchor positions +void TextRangeSetBase::clearSelection() +{ + for (int i = 0, cnt = rangeCount(); i < cnt; ++i) + { + TextRange &range = this->range(i); + range.clearSelection(); + } +} + +/// This method starts the changes +void TextRangeSetBase::beginChanges() +{ + Q_ASSERT(changing_ < 10); // 10 times nesting is a LOT!! + ++changing_; +} + +void TextRangeSetBase::endChanges() +{ + Q_ASSERT(changing_ > 0); + --changing_; + processChangesIfRequired(); +} + +/// Ends the changes without processing. +/// WARNING, you should ONLY call this method if the operation you performed +/// kept the rangeset in a valid state. This (at least) means the ranges need to +/// be sorted +void TextRangeSetBase::endChangesWithoutProcessing() +{ + Q_ASSERT(changing_ > 0); + --changing_; +} + +/// Checks if the current rangeset is in a changing state +bool TextRangeSetBase::changing() const +{ + return changing_ != 0; +} + +/// An union operation +/// This method adds all text selection-items. +/// Merges all ranges +void TextRangeSetBase::addTextRanges(const TextRangeSetBase &sel) +{ + for (int i = 0, cnt = sel.rangeCount(); i < cnt; ++i) + { + addRange(sel.constRange(i)); + } + processChangesIfRequired(true); +} + +/// The difference operation +/// This method substracts the text-selection from the current selection +void TextRangeSetBase::substractTextRanges(const TextRangeSetBase &sel) +{ + ++changing_; + for (int i = 0, cnt = sel.rangeCount(); i < cnt; ++i) + { + const TextRange &r = sel.constRange(i); + substractRange(r.min(), r.max()); + } + --changing_; + processChangesIfRequired(); +} + +/// This method substracts a single range from the ranges list +void TextRangeSetBase::substractRange(int minB, int maxB) +{ + beginChanges(); + for (int i = rangeCount() - 1; i >= 0; --i) + { + TextRange &rangeItem = range(i); + int &minA = rangeItem.minVar(); + int &maxA = rangeItem.maxVar(); + + // A: [ ] + // B: [XXXXX] + // = [ ] [ ] + if ((minA < minB && minB < maxA) && (minA < maxB && maxB < maxA)) + { + /// TODO Add support for copyrange + addRange(maxB, maxA); + maxA = minB; + } + // A: [ ] + // B: [XXXXXXXXXXXXX] + // =: (leeg) + else if ((minB <= minA && minA <= maxB) && (minB <= maxA && maxA <= maxB)) + { + removeRange(i); + } + + // A: [ ] + // B: [XXXXXX] + // =: [ ] + else if (minA < minB && minB < maxA) + { + maxA = minB; + } + // A: [ ] + // B: [XXXXXX] + // =: [ ] + else if (minA < maxB && maxB < maxA) + { + minA = maxB; + } + } + endChanges(); +} + +/// Expands the selection so it selects full lines +void TextRangeSetBase::expandToFullLines(int amount) +{ + for (int i = 0, cnt = rangeCount(); i < cnt; ++i) + { + range(i).expandToFullLine(textDocument(), amount); + } + processChangesIfRequired(); +} + +/// Expands the selection to full words +void TextRangeSetBase::expandToWords(const QString &whitespace, + const QStringList &characterGroups) +{ + for (int i = 0, cnt = rangeCount(); i < cnt; ++i) + { + range(i).expandToWord(textDocument(), whitespace, characterGroups); + } + processChangesIfRequired(); +} + +/// Selects the word at the given offset +/// @param offset the offset of the word to select +void TextRangeSetBase::selectWordAt(int offset, const QString &whitespace, + const QStringList &characterGroups) +{ + TextRange newRange(offset, offset); + newRange.expandToWord(textDocument(), whitespace, characterGroups); + addRange(newRange); + processChangesIfRequired(); +} + +/// Toggles a word selection at the given location +/// The idea is the following, double-click an empty place to select the word at +/// the given location Double click an existing selection to remove the +/// selection (and caret) +void TextRangeSetBase::toggleWordSelectionAt(int offset, + const QString &whitespace, + const QStringList &characterGroups) +{ + int idx = rangeIndexAtOffset(offset); + + // range found + if (idx >= 0) + { + TextRange &found = this->range(idx); + + // found a range with selection + if (found.hasSelection()) + { + + // when multiple range, just remove the range + if (rangeCount() > 1) + { + removeRange(idx); + return; + + // when this is the last range, just place the caret + } + else + { + found.set(offset, offset); + return; + } + } + } + // default operation is select word at + selectWordAt(offset, whitespace, characterGroups); +} + +/// This method moves the carets by character +void TextRangeSetBase::moveCarets(int amount) +{ + for (int i = 0, cnt = rangeCount(); i < cnt; ++i) + { + range(i).moveCaret(textDocument(), amount); + } + processChangesIfRequired(); +} + +/// This method moves the carets or deslects the given character +void TextRangeSetBase::moveCaretsOrDeselect(int amount) +{ + for (int i = 0, cnt = rangeCount(); i < cnt; ++i) + { + range(i).moveCaretOrDeselect(textDocument(), amount); + } + processChangesIfRequired(); +} + +/// This method moves the carets +void TextRangeSetBase::moveCaretsByCharGroup(int amount, + const QString &whitespace, + const QStringList &characterGroups) +{ + for (int rangeIdx = rangeCount() - 1; rangeIdx >= 0; --rangeIdx) + { + range(rangeIdx).moveCaretByCharGroup(textDocument(), amount, whitespace, + characterGroups); + } + processChangesIfRequired(); +} + +/// Moves all carets to the given line boundary (line-boundary automatically +/// switches between column 0 and first non-whitespace character) +/// @param direction the direction < 0 to the start of the line (or first char) +/// > 0 to the end of the line +/// @param whitespace the characters to see as whitespace +void TextRangeSetBase::moveCaretsToLineBoundary(int direction, + const QString &whitespace) +{ + // process all carets + for (int rangeIdx = rangeCount() - 1; rangeIdx >= 0; --rangeIdx) + { + range(rangeIdx).moveCaretToLineBoundary(textDocument(), direction, + whitespace); + } + processChangesIfRequired(); +} + +/// This method merges overlapping ranges +/// @param joinBorders if joinborders is set, borders next to eachother are also +/// interpretted as overlap. (inclusive/exclusive switch) +void TextRangeSetBase::mergeOverlappingRanges(bool joinBorders) +{ + // check the ranges + beginChanges(); + for (int i = rangeCount() - 1; i >= 0; --i) + { + TextRange &range1 = range(i); + int min1 = range1.min(); + int max1 = range1.max(); + + // check overlap with all other ranges + for (int j = i - 1; j >= 0; --j) + { + TextRange &range2 = range(j); + int min2 = range2.min(); + int max2 = range2.max(); + + // Overlappping possibilities: + // 1: [ ] + // 2 [XXX] + // = (delete 1) + if (min1 <= min2 && max2 <= max1) + { + removeRange(j); + --i; + continue; + } + + // Overlappping possibilities: + // 1: [ ] + // 2 [XXXXXXX] + // = (delete 1) + if (min2 <= min1 && max1 <= max2) + { + removeRange(i); + // selectionRanges_.remove(i); + break; + } + + // Overlappping possibilities: + // 1: [ ] + // 2 [XXXXXX] + // = [ min2, max1] (update range 2, delete range 1 ) + if ((min2 < min1 && min1 < max2 && max2 < max1) + || (joinBorders && min2 <= min1 && min1 <= max2 && max2 <= max1)) + { + range2.maxVar() = max1; + // selectionRanges_.remove(i); + removeRange(i); + break; + } + + // Overlappping possibilities: + // 1: [ ] + // 2 [XXXXXXX] + // = [ min1, max2] (update range 2, delete range 1 ) + if ((min1 < min2 && min2 < max1 && max1 < max2) + || (joinBorders && min1 <= min2 && min2 <= max1 && max1 <= max2)) + { + range2.minVar() = min1; + // selectionRanges_.remove(i); + removeRange(i); + break; + } + } + } + endChanges(); +} + +/// This method sets the first range item +/// @param anchor the anchor of the selection +/// @param caret the caret position +/// @param index the default range index (default 0) +void TextRangeSetBase::setRange(int anchor, int caret, int index) +{ + range(index).set(anchor, caret); +} + +/// Sets the range at the given index. +/// Make sure the given index exists!! +/// @param the range to use +/// @param index the index of the range to change (when not given index 0 is +/// assumed) +void TextRangeSetBase::setRange(const TextRange &range, int index) +{ + setRange(range.anchor(), range.caret(), index); +} + +/// This method process the changes if required +void TextRangeSetBase::processChangesIfRequired(bool joinBorders) +{ + if (!changing_) + { + ++changing_; // prevent changing by functions below: + mergeOverlappingRanges(joinBorders); + sortRanges(); + --changing_; + } +} + +/// Returns the associated textdocument +/// @return the associated text document +TextDocument *TextRangeSetBase::textDocument() const +{ + return textDocumentRef_; +} + +/// This method adds (or removes) the given spatial length at the given +/// location. +/// +/// It adjusts all locations, anchors with the given locations. It automatically +/// moves carets, 'removes' selection etc. +/// +/// @param pos the position to add the spatial length to +/// @param length the length of the text that's changed +/// @param newLength the new length of the text +/// @param sticky, when sticky the caret/anchor is sticky and isn't moved if the +/// change happens at the same location +void TextRangeSetBase::changeSpatial(int pos, int length, int newLength, + bool sticky, bool performDelete) +{ + int stickyDelta = sticky ? 0 : -1; + + // change the ranges + int endPos = pos + length; + int delta = newLength - length; + int newEndPos = endPos + delta; + beginChanges(); + for (int i = rangeCount() - 1; i >= 0; --i) + { + + TextRange &range = this->range(i); + + int &min = range.minVar(); + int &max = range.maxVar(); + + // cut 'off' the endpos + if (pos <= min && min < endPos) + { + min = endPos; + // when the range becomes invalid simply remove it + if (min > max) + { + if (performDelete) + { + removeRange(i); + continue; + } + else + { + range.set(pos, pos); + continue; + } + } + } + + // anchor + if (pos < min && min < endPos) + { + min = newEndPos; + } + else if (min > (pos + stickyDelta)) + { + min += delta; + } + + // caret + if (pos < max && max < endPos) + { + max = newEndPos; + } + else if (max > (pos + stickyDelta)) + { + max += delta; + } + + range.set(min, max); + } + endChanges(); +} + +// ===================================== + +/// Constructs a textrange set +/// @param doc the document for this rangeset +TextRangeSet::TextRangeSet(TextDocument *doc) + : TextRangeSetBase(doc) +{ +} + +/// the copy constructor for copying a selection +/// @param sel the ranges to copy +TextRangeSet::TextRangeSet(const TextRangeSet &sel) + : TextRangeSetBase(sel.textDocument()) +{ + selectionRanges_ = sel.selectionRanges_; +} + +// An operation to copy the selection with a pointer +TextRangeSet::TextRangeSet(const TextRangeSet *sel) + : TextRangeSetBase(sel->textDocument()) +{ + selectionRanges_ = sel->selectionRanges_; +} + +/// copy the value from the rangeset +TextRangeSet &TextRangeSet::operator=(const TextRangeSet &sel) +{ + textDocumentRef_ = sel.textDocumentRef_; + selectionRanges_ = sel.selectionRanges_; + return *this; +} + +///// This method clones the text selection +TextRangeSet *TextRangeSet::clone() const +{ + return new TextRangeSet(*this); +} + +/// returns the selection range +TextRange &TextRangeSet::range(int idx) +{ + Q_ASSERT(idx >= 0); + Q_ASSERT(idx < selectionRanges_.size()); + return selectionRanges_[idx]; +} + +/// Returns a const reference from the +const TextRange &TextRangeSet::constRange(int idx) const +{ + Q_ASSERT(idx >= 0); + Q_ASSERT(idx < selectionRanges_.size()); + return selectionRanges_.at(idx); +} + +/// Adds a text range +void TextRangeSet::addRange(int anchor, int caret) +{ + selectionRanges_.append(TextRange(anchor, caret)); + processChangesIfRequired(); +} + +/// adds a range +void TextRangeSet::addRange(const TextRange &range) +{ + addRange(range.anchor(), range.caret()); +} + +/// this method removes the range +void TextRangeSet::removeRange(int idx) +{ + selectionRanges_.remove(idx); + processChangesIfRequired(); +} + +/// This method removes ALL carets except the 'global' selection +void TextRangeSet::clear() +{ + // selectionRanges_.remove(1,selectionRanges_.size()-1); + // selectionRanges_[0].reset(); + selectionRanges_.clear(); +} + +/// Converts the range to a single range selection +void TextRangeSet::toSingleRange() +{ + selectionRanges_.remove(1, selectionRanges_.size() - 1); +} + +/// Sorts the ranges +void TextRangeSet::sortRanges() +{ + std::sort(selectionRanges_.begin(), selectionRanges_.end(), + TextRange::lessThan); +} + +// ===================================== + +/// Constructs the dynamic textrange set with a document +/// @param doc the document to use +/// @param stickyMode is the stickymode enabled +/// @param parent the parent owner +DynamicTextRangeSet::DynamicTextRangeSet(TextDocument *doc, bool stickyMode, + bool deleteMode, QObject *parent) + : QObject(parent) + , TextRangeSet(doc) + , stickyMode_(stickyMode) + , deleteMode_(deleteMode) +{ + connect(textDocument(), &TextDocument::textChanged, this, + &DynamicTextRangeSet::textChanged); +} + +/// Constructs the dynamic textrange set with an existing rangeset +/// @param sel the text range to copy +/// @param stickyMode is the stickymode enabled +/// @param parent the parent owner +DynamicTextRangeSet::DynamicTextRangeSet(const TextRangeSet &sel, + bool stickyMode, bool deleteMode, + QObject *parent) + : QObject(parent) + , TextRangeSet(sel) + , stickyMode_(stickyMode) + , deleteMode_(deleteMode) +{ + connect(textDocument(), &TextDocument::textChanged, this, + &DynamicTextRangeSet::textChanged); +} + +/// constructs the dynamic rangeset +/// @param sel the text range to copy +/// @param stickyMode is the stickymode enabled +/// @param parent the parent owner +DynamicTextRangeSet::DynamicTextRangeSet(const TextRangeSet *sel, + bool stickyMode, bool deleteMode, + QObject *parent) + : QObject(parent) + , TextRangeSet(sel) + , stickyMode_(stickyMode) + , deleteMode_(deleteMode) +{ + connect(textDocument(), &TextDocument::textChanged, this, + &DynamicTextRangeSet::textChanged); +} + +/// destructs the reviever +DynamicTextRangeSet::~DynamicTextRangeSet() +{ + disconnect(); +} + +/// Is the stickymode enabled +/// @param mode the mode that is sticky +void DynamicTextRangeSet::setStickyMode(bool mode) +{ + stickyMode_ = mode; +} + +/// returns the current stickymode +bool DynamicTextRangeSet::stickyMode() const +{ + return stickyMode_; +} + +/// Sets the delete mode +void DynamicTextRangeSet::setDeleteMode(bool mode) +{ + deleteMode_ = mode; +} + +/// Returns the current delete mode +bool DynamicTextRangeSet::deleteMode() const +{ + return deleteMode_; +} + +/// This method is notified if a change happens to the textbuffer +void DynamicTextRangeSet::textChanged(edbee::TextBufferChange change, + QString oldText) +{ + Q_UNUSED(oldText) + changeSpatial(change.offset(), change.length(), change.newTextLength(), + stickyMode_, deleteMode_); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textrange.h b/lib/edbee-lib/edbee/models/textrange.h new file mode 100644 index 00000000..c56b8698 --- /dev/null +++ b/lib/edbee-lib/edbee/models/textrange.h @@ -0,0 +1,287 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QObject> +#include <QVector> + +#include "edbee/models/textbuffer.h" + +namespace edbee +{ + +class TextDocument; + +/// A single text region +/// A region constists of an anchor and a caret: +/// The anchor defines the 'start' of the range. Then caret the end. +/// +/// Some definitions: +/// - caret == anchor => length=0 +/// +/// samples ( [ = anchor, > = caret ) +/// a[>bcdef (anchor=1, caret=1) => "" +/// a[b>cdef (anchor=1, caret=2) => "b" +/// a<b]cdef (anchor=2, caret=1) => "b" +/// +class EDBEE_EXPORT TextRange +{ +public: + TextRange(int anchor = 0, int caret = 0) + : anchor_(anchor) + , caret_(caret) + { + } + + inline int anchor() const { return anchor_; } + inline int caret() const { return caret_; } + + /// returns the minimal value + inline int min() const { return qMin(caret_, anchor_); } + inline int max() const { return qMax(caret_, anchor_); } + + /// returns the minimal variable reference + inline int &minVar() { return caret_ < anchor_ ? caret_ : anchor_; } + inline int &maxVar() { return caret_ < anchor_ ? anchor_ : caret_; } + + inline int length() const { return qAbs(caret_ - anchor_); } + + void fixCaretForUnicode(TextDocument *doc, int direction); + + void setAnchor(int anchor) { anchor_ = anchor; } + void setAnchorBounded(TextDocument *doc, int anchor); + void setCaret(int caret) { caret_ = caret; } + void setCaretBounded(TextDocument *doc, int caret); + void setLength(int newLength); + + void set(int anchor, int caret) + { + anchor_ = anchor; + caret_ = caret; + } + + void reset() { anchor_ = caret_; } + bool hasSelection() const { return anchor_ != caret_; } + bool isEmpty() const { return anchor_ == caret_; } + void clearSelection() { caret_ = anchor_; } + + QString toString() const; + + void moveCaret(TextDocument *doc, int amount); + void moveCaretOrDeselect(TextDocument *doc, int amount); + int moveWhileChar(TextDocument *doc, int pos, int amount, + const QString &chars); + int moveUntilChar(TextDocument *doc, int pos, int amount, + const QString &chars); + void moveCaretWhileChar(TextDocument *doc, int amount, const QString &chars); + void moveCaretUntilChar(TextDocument *doc, int amount, const QString &chars); + void moveAnchortWhileChar(TextDocument *doc, int amount, + const QString &chars); + void moveAnchorUntilChar(TextDocument *doc, int amount, const QString &chars); + void moveCaretByCharGroup(TextDocument *doc, int amount, + const QString &whitespace, + const QStringList &characterGroups); + void moveCaretToLineBoundary(TextDocument *doc, int amount, + const QString &whitespace); + void moveCaretToWordBoundaryAtOffset(TextDocument *doc, int offset); + void moveCaretToLineBoundaryAtOffset(TextDocument *doc, int offset); + + void expandToFullLine(TextDocument *doc, int amount); + void deselectTrailingNewLine(TextDocument *doc); + void expandToWord(TextDocument *doc, const QString &whitespace, + const QStringList &characterGroups); + void expandToIncludeRange(TextRange &range); + + void forceBounds(TextDocument *doc); + + bool equals(const TextRange &range); + bool touches(TextRange &range); + bool contains(int pos); + + static bool lessThan(TextRange &r1, TextRange &r2); + +private: + int anchor_; ///< The position of the anchor + int caret_; ///< The position of the caret +}; + +//====================================================================== + +/// This abstract class represents a set of textranges +/// The ranges are kept ordered and will not contain overlapping regions. +/// +/// Every method automatically orders and merges overlapping ranges. +/// Except when the changing_ flag is != 0. The sorting and merging only happens +/// when changing is 0. This way it possible to add/update muliple rages without +/// the direct performance hit of sorting and merging. +class EDBEE_EXPORT TextRangeSetBase +{ +public: + TextRangeSetBase(TextDocument *doc); + virtual ~TextRangeSetBase() {} + // TextRangeSet(const TextRangeSet& sel); + + // pure virtual methods + // virtual TextRangeSetBase* clone() const = 0; + // TextRangeSet & operator=( const TextRangeSet& sel ); + + virtual int rangeCount() const = 0; + virtual TextRange &range(int idx) = 0; + virtual const TextRange &constRange(int idx) const = 0; + virtual void addRange(int anchor, int caret) = 0; + virtual void addRange(const TextRange &range) = 0; + virtual void removeRange(int idx) = 0; + virtual void clear() = 0; + virtual void toSingleRange() = 0; + virtual void sortRanges() = 0; + + TextRange &lastRange(); + TextRange &firstRange(); + + int rangeIndexAtOffset(int offset); + bool rangesBetweenOffsets(int offsetBegin, int offsetEnd, int &firstIndex, + int &lastIndex); + bool rangesBetweenOffsetsExlusiveEnd(int offsetBegin, int offsetEnd, + int &firstIndex, int &lastIndex); + bool rangesAtLine(int line, int &firstIndex, int &lastIndex); + bool rangesAtLineExclusiveEnd(int line, int &firstIndex, int &lastIndex); + bool hasSelection(); + bool equals(TextRangeSetBase &sel); + void replaceAll(const TextRangeSetBase &base); + + QString getSelectedText(); + QString getSelectedTextExpandedToFullLines(); + + QString rangesAsString() const; + + // changing + void beginChanges(); + void endChanges(); + void endChangesWithoutProcessing(); + bool changing() const; + + void resetAnchors(); + void clearSelection(); + + void addTextRanges(const TextRangeSetBase &sel); + void substractTextRanges(const TextRangeSetBase &sel); + void substractRange(int min, int max); + + // selection + void expandToFullLines(int amount); + void expandToWords(const QString &whitespace, + const QStringList &characterGroups); + void selectWordAt(int offset, const QString &whitespace, + const QStringList &characterGroups); + void toggleWordSelectionAt(int offset, const QString &whitespace, + const QStringList &characterGroups); + + // movement + void moveCarets(int amount); + void moveCaretsOrDeselect(int amount); + void moveCaretsByCharGroup(int amount, const QString &whitespace, + const QStringList &charGroups); + void moveCaretsToLineBoundary(int direction, const QString &whitespace); + // void moveCaretsByLine( int amount ); //< Impossible to do without view + // when having a flexible font, guess that's why it wasn't implemented + + // changing + // void growSelectionAtBegin( int amount ); + void changeSpatial(int pos, int length, int newLength, bool sticky = false, + bool performDelete = false); + + void setRange(int anchor, int caret, int index = 0); + void setRange(const TextRange &range, int index = 0); + + virtual void processChangesIfRequired(bool joinBorders = false); + + // getters + TextDocument *textDocument() const; + // TextBuffer* textBuffer() const { return textBufferRef_; } + + void mergeOverlappingRanges(bool joinBorders); + +protected: + TextDocument *textDocumentRef_; ///< The reference to the textbuffer + int changing_; ///< A (integer) boolean for handling changes between + ///< beginChagnes and endChanges +}; + +//====================================================================== + +/// The basic textrange class. A simple class of textrange with a simple vector +/// implementation +class EDBEE_EXPORT TextRangeSet : public TextRangeSetBase +{ +public: + TextRangeSet(TextDocument *doc); + TextRangeSet(const TextRangeSet &sel); + TextRangeSet(const TextRangeSet *sel); + virtual ~TextRangeSet() {} + + TextRangeSet &operator=(const TextRangeSet &sel); + TextRangeSet *clone() const; + + virtual int rangeCount() const { return selectionRanges_.size(); } + virtual TextRange &range(int idx); + virtual const TextRange &constRange(int idx) const; + virtual void addRange(int anchor, int caret); + virtual void addRange(const TextRange &range); + virtual void removeRange(int idx); + virtual void clear(); + virtual void toSingleRange(); + virtual void sortRanges(); + +private: + QVector<TextRange> + selectionRanges_; ///< A list of selection ranges. After endChanges this + ///< array is sorted and non-overlapping! +}; + +//====================================================================== + +/// A smart QObject implemenation of a TextRangeSet which listens to changes +/// in the document. When a change happens it's changes the spatial of the +/// ranges +/// +/// The stickymode is used to change the behavior of the changes the the +/// textChange event. To put it simple, you should enable stickymode if this +/// selection is the one you are using to modify the document +/// +/// The delete mode is used to tell the rangeset if 'deleted' ranges need to be +/// deleted or simply need to be moved +class EDBEE_EXPORT DynamicTextRangeSet : public QObject, public TextRangeSet +{ + Q_OBJECT + +public: + DynamicTextRangeSet(TextDocument *doc, bool stickyMode = false, + bool deleteMode = false, QObject *parent = 0); + DynamicTextRangeSet(const TextRangeSet &sel, bool stickyMode = false, + bool deleteMode = false, QObject *parent = 0); + DynamicTextRangeSet(const TextRangeSet *sel, bool stickyMode = false, + bool deleteMode = false, QObject *parent = 0); + virtual ~DynamicTextRangeSet(); + + void setStickyMode(bool mode); + bool stickyMode() const; + + void setDeleteMode(bool mode); + bool deleteMode() const; + +public slots: + void textChanged(edbee::TextBufferChange change, QString oldText = QString()); + +private: + bool stickyMode_; ///< Sticky mode means if this rangeset is the current + ///< selection (This requires a different approach) + bool deleteMode_; ///< When delete mode is enabled ranges are deleted. If it's + ///< false ranges are moved to the left +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textsearcher.cpp b/lib/edbee-lib/edbee/models/textsearcher.cpp new file mode 100644 index 00000000..6916efb9 --- /dev/null +++ b/lib/edbee-lib/edbee/models/textsearcher.cpp @@ -0,0 +1,405 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "textsearcher.h" + +#include "edbee/models/texteditorconfig.h" +#include "edbee/models/textrange.h" +#include "edbee/models/textbuffer.h" +#include "edbee/models/textdocument.h" +#include "edbee/texteditorwidget.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/util/regexp.h" +#include "edbee/views/textselection.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +TextSearcher::TextSearcher(QObject *parent) + : QObject(parent) + , searchTerm_() + , syntax_(SyntaxPlainString) + , caseSensitive_(false) + , wrapAround_(true) + , reverse_(false) + , regExp_(nullptr) +{ +} + +/// destroys the textsearcher +TextSearcher::~TextSearcher() +{ + delete regExp_; +} + +/// Returns the current active searchterm +QString TextSearcher::searchTerm() const +{ + return searchTerm_; +} + +/// Sets the current search term +void TextSearcher::setSearchTerm(const QString &term) +{ + searchTerm_ = term; + setDirty(); +} + +/// Returns the syntax type of the current search operation +TextSearcher::SyntaxType TextSearcher::syntax() const +{ + return syntax_; +} + +/// Sets the syntax mode of the searcher +/// @parm syntax the SyntaxType to use (SyntaxPlainString, SyntaxRegExp) +void TextSearcher::setSyntax(TextSearcher::SyntaxType syntax) +{ + syntax_ = syntax; + setDirty(); +} + +/// Returns the case sensitivity of the textsearcher +bool TextSearcher::isCaseSensitive() const +{ + return caseSensitive_; +} + +/// sets the case sensitivity of the search operation +void TextSearcher::setCaseSensitive(bool sensitive) +{ + caseSensitive_ = sensitive; + setDirty(); +} + +/// Should the search wrap around the contents of the document +bool TextSearcher::isWrapAroundEnabled() const +{ + return wrapAround_; +} + +/// For changing the wrap around mode of the TextSearcher +void TextSearcher::setWrapAround(bool on) +{ + wrapAround_ = on; + setDirty(); +} + +/// Checks the reverse mode +bool TextSearcher::isReverse() const +{ + return reverse_; +} + +/// Sets the search reverse mode. +void TextSearcher::setReverse(bool on) +{ + reverse_ = on; +} + +/// Finds the next matching textrange +/// This method does not alter the textrange selection. It only returns the +/// range of the next match +/// @param selection the text-selection to use +/// @return the textRange with the found text. TextRange::isEmpty() can be +/// called to check if nothing has been found +TextRange TextSearcher::findNextRange(TextRangeSet *selection) +{ + TextDocument *document = selection->textDocument(); + QChar *buffer = document->buffer()->rawDataPointer(); + + if (!regExp_) + { + regExp_ = createRegExp(); + } + + int caretPos = 0; + if (selection->rangeCount() > 0) + { + if (isReverse()) + { + caretPos = selection->firstRange().min(); + } + else + { + caretPos = selection->lastRange().max(); + } + } + + int idx = 0; + if (isReverse()) + { + idx = regExp_->lastIndexIn(buffer, 0, caretPos); + } + else + { + idx = regExp_->indexIn(buffer, caretPos, document->length()); + } + + // wrapped around? Let's try it from the beginning + if (idx < 0 && isWrapAroundEnabled()) + { + if (isReverse()) + { + idx = regExp_->lastIndexIn(buffer, 0, document->length()); + } + else + { + idx = regExp_->indexIn(buffer, 0, document->length()); + } + } + if (idx >= 0) + { + int len = regExp_->len(0); + return TextRange(idx, idx + len); + } + return TextRange(); +} + +/// Finds the next item based on the given caret position in the selection +/// @param selection the selection to use for searching +/// @return true if the next selection has been foudn +bool TextSearcher::findNext(TextRangeSet *selection) +{ + TextRange range = findNextRange(selection); + if (!range.isEmpty()) + { + selection->clear(); + selection->addRange(range.anchor(), range.caret()); + return true; + } + return false; +} + +/// Finds the previous item based on the given caret position in the selection +/// @param selection the selection to use and alter +/// @return true if the previous item has been found false if not found +bool TextSearcher::findPrev(TextRangeSet *selection) +{ + reverse_ = !reverse_; + bool result = findNext(selection); + reverse_ = !reverse_; + return result; +} + +/// Selects the next item that matches the given critaria (Adds an extra +/// selection range ) +/// @param widget the widget to search in +/// @param selection the selection to use +/// @return true if the next item has been found false if it hasn't been. +bool TextSearcher::selectNext(TextRangeSet *selection) +{ + TextRange range = findNextRange(selection); + if (!range.isEmpty()) + { + + // edge case, when currently ony 1 caret is available and doesn't have a + // selection we need to remove this range + if (selection->rangeCount() == 1 && selection->range(0).isEmpty()) + { + selection->removeRange(0); + } + selection->addRange(range.anchor(), range.caret()); + return true; + } + return false; +} + +/// Selects the previous item based on the given caret position in the selection +/// @param selection the selection to use +/// @return true if the selection has been found false if it hasn't been found +bool TextSearcher::selectPrev(TextRangeSet *selection) +{ + reverse_ = !reverse_; + bool result = selectNext(selection); + reverse_ = !reverse_; + return result; +} + +/// Select all matching items in the document +/// @param selection the selection to search for +/// @return true if one ore more items are selected false if not found +bool TextSearcher::selectAll(TextRangeSet *selection) +{ + TextRange oldRange = selection->range(0); + + markAll(selection); + + // no selection, we MUST place a caret + if (selection->rangeCount() == 0) + { + selection->addRange(oldRange.caret(), oldRange.caret()); + return false; + } + return true; +} + +/// Put all found items in the ranges +/// @param rangeset the rangeset to search for +void TextSearcher::markAll(TextRangeSet *rangeset) +{ + // clear the selection and add all matches + bool oldReverse = reverse_; // we must NOT reverse find + bool oldWrapAround = wrapAround_; + reverse_ = false; + wrapAround_ = false; + rangeset->clear(); + rangeset->beginChanges(); + TextRange range = findNextRange(rangeset); + while (!range.isEmpty()) + { + rangeset->addRange(range.anchor(), range.caret()); + range = findNextRange(rangeset); + } + rangeset->endChanges(); + wrapAround_ = oldWrapAround; + reverse_ = oldReverse; +} + +/// Finds the next item based on the given caret position in the selection +/// @param widget the widget to find the next item +bool TextSearcher::findNext(TextEditorWidget *widget) +{ + std::unique_ptr<TextRangeSet> newRangeSet( + new TextRangeSet(widget->textSelection())); + if (findNext(newRangeSet.get())) + { + widget->controller()->changeAndGiveTextSelection(newRangeSet.release()); + return true; + } + return false; +} + +/// Finds the previous item based on the given caret position in the selection +/// @param widget the widget to search in +bool TextSearcher::findPrev(TextEditorWidget *widget) +{ + std::unique_ptr<TextRangeSet> newRangeSet( + new TextRangeSet(widget->textSelection())); + if (findPrev(newRangeSet.get())) + { + widget->controller()->changeAndGiveTextSelection(newRangeSet.release()); + return true; + } + return false; +} + +/// Selects the next item that matches the given critaria (Adds an extra +/// selection range ) +/// @param widget the widget to search in +bool TextSearcher::selectNext(TextEditorWidget *widget) +{ + std::unique_ptr<TextRangeSet> newRangeSet( + new TextRangeSet(widget->textSelection())); + if (selectNext(newRangeSet.get())) + { + widget->controller()->changeAndGiveTextSelection(newRangeSet.release()); + return true; + } + return false; +} + +/// Selects the previous item based on the given caret position in the selection +/// @param widget the widget to to search in +bool TextSearcher::selectPrev(TextEditorWidget *widget) +{ + std::unique_ptr<TextRangeSet> newRangeSet( + new TextRangeSet(widget->textSelection())); + if (selectPrev(newRangeSet.get())) + { + widget->controller()->changeAndGiveTextSelection(newRangeSet.release()); + return true; + } + return false; +} + +/// Selects all matches of the current item +/// @param widget the widget to search in +/// @param selection the selection to change +bool TextSearcher::selectAll(TextEditorWidget *widget) +{ + std::unique_ptr<TextRangeSet> newRangeSet( + new TextRangeSet(widget->textSelection())); + if (selectAll(newRangeSet.get())) + { + widget->controller()->changeAndGiveTextSelection(newRangeSet.release()); + return true; + } + return false; +} + +/// A smart selection: when there's no selection the current word is used and +/// selected. The next word will be selected, if all is specified all words are +/// selected +/// @param widget the widget to select +/// @param selectAllTexts if true then all occurences are selected +void TextSearcher::selectUnderExpand(TextEditorWidget *widget, + bool selectAllTexts) +{ + std::unique_ptr<TextRangeSet> newRangeSet( + new TextRangeSet(widget->textSelection())); + bool runSelect = true; // should the select be called + + // when no selection is used select it + if (!newRangeSet->hasSelection() || newRangeSet->rangeCount() == 1) + { + TextRange &range = newRangeSet->lastRange(); + TextDocument *doc = widget->textDocument(); + + // make sure there's a selection + if (!newRangeSet->hasSelection()) + { + if (range.isEmpty()) + { + range.expandToWord(doc, doc->config()->whitespaces(), + doc->config()->charGroups()); + runSelect + = selectAllTexts; // only run select when we need to select all + } + } + // next set the search term to the given word + setSearchTerm(doc->textPart(range.min(), range.length())); + } + + // next select the next word + if (runSelect) + { + if (selectAllTexts) + { + selectAll(newRangeSet.get()); + } + else + { + selectNext(newRangeSet.get()); + } + } + + // set the new rangeset + widget->controller()->changeAndGiveTextSelection(newRangeSet.release()); +} + +/// Marks the regexp as dirty (and deletes it) +void TextSearcher::setDirty() +{ + delete regExp_; + regExp_ = nullptr; +} + +/// Creates a regular expression for the current selected options +/// @return the new regular expression +RegExp *TextSearcher::createRegExp() +{ + RegExp::Syntax regExpSyntax = RegExp::SyntaxFixedString; + if (syntax() == SyntaxRegExp) + regExpSyntax = RegExp::SyntaxDefault; + + RegExp *regExp = new RegExp(searchTerm(), caseSensitive_, regExpSyntax, + RegExp::EngineOniguruma); + return regExp; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textsearcher.h b/lib/edbee-lib/edbee/models/textsearcher.h new file mode 100644 index 00000000..8bcb2f0e --- /dev/null +++ b/lib/edbee-lib/edbee/models/textsearcher.h @@ -0,0 +1,86 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QObject> + +#include "edbee/models/textrange.h" + +namespace edbee +{ + +class RegExp; +class TextDocument; +class TextEditorWidget; + +/// The text searcher is a class to remember the current search operation +/// It remembers the current searchTerm that is used for searching +/// The textsearcher component has got several option. Like case sensitivity +/// regular expressions etc. +class EDBEE_EXPORT TextSearcher : public QObject +{ + Q_OBJECT +public: + enum SyntaxType + { + SyntaxPlainString, + SyntaxRegExp + }; + + explicit TextSearcher(QObject *parent = 0); + virtual ~TextSearcher(); + + QString searchTerm() const; + void setSearchTerm(const QString &term); + + SyntaxType syntax() const; + void setSyntax(SyntaxType syntax); + + bool isCaseSensitive() const; + void setCaseSensitive(bool sensitive); + + bool isWrapAroundEnabled() const; + void setWrapAround(bool on); + + bool isReverse() const; + void setReverse(bool on); + + TextRange findNextRange(TextRangeSet *selection); + + bool findNext(TextRangeSet *selection); + bool findPrev(TextRangeSet *selection); + bool selectNext(TextRangeSet *selection); + bool selectPrev(TextRangeSet *selection); + bool selectAll(TextRangeSet *selection); + void markAll(TextRangeSet *rangeset); + +public slots: + + bool findNext(TextEditorWidget *widget); + bool findPrev(TextEditorWidget *widget); + bool selectNext(TextEditorWidget *widget); + bool selectPrev(TextEditorWidget *widget); + bool selectAll(TextEditorWidget *widget); + + void selectUnderExpand(TextEditorWidget *widget, bool selectAllTexts); + +protected: + void setDirty(); + RegExp *createRegExp(); + +private: + QString searchTerm_; ///< The current search term + SyntaxType syntax_; ///< The syntax-type + bool caseSensitive_; ///< case sensitive? + bool wrapAround_; ///< should the search wrap around? + bool reverse_; ///< search in the reverse direction + + RegExp *regExp_; ///< The current regexp +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textundostack.cpp b/lib/edbee-lib/edbee/models/textundostack.cpp new file mode 100644 index 00000000..f9c81fa3 --- /dev/null +++ b/lib/edbee-lib/edbee/models/textundostack.cpp @@ -0,0 +1,817 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "textundostack.h" + +#include "edbee/models/change.h" +#include "edbee/texteditorcommand.h" +#include "edbee/models/textdocument.h" + +#include "edbee/debug.h" + +// #define DUMP_UNDO_STACK + +namespace edbee +{ + +/// Constructs the main undostack +TextUndoStack::TextUndoStack(TextDocument *doc, QObject *parent) + : QObject(parent) + , documentRef_(doc) + , changeList_() + , changeIndex_(0) + , controllerIndexMap_() + , persistedIndex_(0) // defaults to 0 because a blank/new document is + // perstisted (doesn't need to be saved) + , undoGroupStack_() + , lastCoalesceIdStack_() + , collectionEnabled_(true) + , undoRunning_(false) + , redoRunning_(false) +{ + lastCoalesceIdStack_.push(0); +} + +/// the undo stack items +TextUndoStack::~TextUndoStack() +{ + disconnect(); // disconnect so no signals are emitted + clearHistoryLists(); + controllerIndexMap_.clear(); +} + +/// deletes all created objects +void TextUndoStack::clearHistoryLists() +{ + qDeleteAll(changeList_); + changeList_.clear(); + qDeleteAll(undoGroupStack_); + undoGroupStack_.clear(); + lastCoalesceIdStack_.clear(); +} + +/// clears both stacks +void TextUndoStack::clear() +{ + clearHistoryLists(); + lastCoalesceIdStack_.push(0); // always 1 item + + // point all the indices to BLANK + changeIndex_ = 0; + setPersistedIndex( + -1); // clearing the undo-stack must result in a non-saved state + QMapIterator<TextEditorController *, int> itr(controllerIndexMap_); + while (itr.hasNext()) + { + itr.next(); + controllerIndexMap_.insert(itr.key(), 0); + } +} + +/// Registers acontroller for it's own view pointer +void TextUndoStack::registerContoller(TextEditorController *controller) +{ + controllerIndexMap_.insert(controller, changeIndex_); +} + +/// Unregisters the given controller +void TextUndoStack::unregisterController(TextEditorController *controller) +{ + controllerIndexMap_.remove(controller); +} + +/// Checks if the given controller is registered +bool TextUndoStack::isControllerRegistered(TextEditorController *controller) +{ + return controllerIndexMap_.contains(controller); +} + +/// Starts an undo group (or increase nest-level-counter) +void TextUndoStack::beginUndoGroup(ChangeGroup *group) +{ + // if( !group ) { group = new TextChangeGroup(controller); } + undoGroupStack_.append(group); + lastCoalesceIdStack_.append(0); + emit undoGroupStarted(group); +} + +/// This method returns the current active group +/// @return the current undo stack item or 0 +ChangeGroup *TextUndoStack::currentGroup() +{ + if (undoGroupStack_.isEmpty()) + { + return 0; + } + return undoGroupStack_.last(); +} + +/// Ends the undogroup +/// @param coalesceId the coalesceId to use +/// @param flatten should the textchange groups be flattened +void TextUndoStack::endUndoGroup(int coalesceId, bool flatten) +{ + Q_ASSERT(!undoGroupStack_.isEmpty()); + if (undoGroupStack_.isEmpty()) + return; + ChangeGroup *group = undoGroupStack_.pop(); + lastCoalesceIdStack_.pop(); + + if (group) + { + group->groupClosed(); // close the group + + // flatten the group? + if (flatten) + { + group->flatten(); + } + // multiple-changes or not discardable + if (!group->isDiscardable() || group->size() > 1) + { + Change *newChange = giveChange(group, coalesceId); + bool merged = newChange && newChange != group; + emit undoGroupEnded(coalesceId, merged, ActionEnd); + + // a single change (don't give the group, just the single change) + } + else if (group->size() == 1) + { + Change *change = group->takeLast(); + Change *newChange = giveChange(change, coalesceId); + bool merged = newChange && newChange != change; + delete group; + emit undoGroupEnded(coalesceId, merged, ActionUngrouped); + // empty group, can be optimized away + } + else + { + delete group; + emit undoGroupEnded(coalesceId, false, ActionFullDiscard); + } + } +} + +/// Ends the undo-group and discards all content +void TextUndoStack::endUndoGroupAndDiscard() +{ + Q_ASSERT(!undoGroupStack_.isEmpty()); + if (undoGroupStack_.isEmpty()) + return; + ChangeGroup *group = undoGroupStack_.pop(); + lastCoalesceIdStack_.pop(); + + if (group) + { + group->groupClosed(); // close the group + delete group; + emit undoGroupEnded(0, false, ActionFullDiscard); + } +} + +/// returns the number of stacked undo-groups +int TextUndoStack::undoGroupLevel() +{ + return undoGroupStack_.size(); +} + +/// returns the last coalesceId at the given level +int TextUndoStack::lastCoalesceIdAtCurrentLevel() +{ + return lastCoalesceIdStack_[lastCoalesceIdStack_.size() - 1]; +} + +/// Sets the last coalesceId at the current level +void TextUndoStack::setLastCoalesceIdAtCurrentLevel(int id) +{ + lastCoalesceIdStack_[lastCoalesceIdStack_.size() - 1] = id; +} + +/// Resets all coalsceIds +void TextUndoStack::resetAllLastCoalesceIds() +{ + for (int i = 0, cnt = lastCoalesceIdStack_.size(); i < cnt; ++i) + { + lastCoalesceIdStack_[i] = 0; + } +} + +/// This method gives the command and tries to coalesce the command if possible +/// Warning when a change is MERGED, the original change is deleted!!! And the +/// original pointer is invalid!!!! +/// +/// @param change the change that's added +/// @param coalesceId the coalseceId to use for this text change. +//// +/// @return the merged Change +/// The return value is 0, if the change was discared +/// The return value == change if the change was appended to the stack +/// The return value != change if the change was merged (previous stack +/// item is returned) +Change *TextUndoStack::giveChange(Change *change, int coalesceId) +{ + // when undo-collection is disabled. don't record the change + if (!collectionEnabled_) + { + delete change; + return 0; + } + + ChangeGroup *group = undoGroupStack_.isEmpty() ? 0 : undoGroupStack_.top(); + + int lastCoalesceId = lastCoalesceIdAtCurrentLevel(); + bool merge = lastCoalesceId && lastCoalesceIdStack_.top() == coalesceId + && coalesceId != CoalesceId_None; + + setLastCoalesceIdAtCurrentLevel(coalesceId); + if (coalesceId == CoalesceId_ForceMerge) + { + merge = true; + } + + // still an undogroup active ? + //---------------------------- + if (group) + { + // TextEditorController* controller = change->controllerContext(); + // try to merge the operation + if (merge) + { + Change *lastChange = group->last(); + if (lastChange && lastChange->giveAndMerge(documentRef_, change)) + { + return lastChange; + } + } + + group->giveChange(document(), change); + // TODO: giveChange to a group can also merge a change. This can have + // implications + // on the change. At the moment I simply return the group. I doubt this is + // correct for the moment it's the best solution for this problem + return group; + + // normal operation + //----------------- + } + else + { + // get the optional controller context + TextEditorController *controller = change->controllerContext(); + clearRedo(controller); + + // try to merge the operation + if (merge) + { + Change *lastChange = this->findUndoChange(controller); + if (lastChange && lastChange->giveAndMerge(documentRef_, change)) + { + // emit changeMerged( lastChange, change ); + dumpStackInternal(); + return lastChange; + } + } + + // execut the operation + changeList_.append(change); + + // increase the pointers + // controller-only change, only update the controller pointer + if (controller) + { + controllerIndexMap_[controller] = changeList_.size(); + + // model-change update the model-pointer and ALL controller pointers + } + else + { + setChangeIndex(changeList_.size()); + QMap<TextEditorController *, int>::iterator i; + for (i = controllerIndexMap_.begin(); i != controllerIndexMap_.end(); ++i) + { + i.value() = changeIndex_; + } + } + emit changeAdded(change); + } + dumpStackInternal(); + return change; +} + +/// Should check if a undo operation can be performed. +/// When no controller is given a document-undo is checkd +/// else a view specific soft undo is tested +bool TextUndoStack::canUndo(TextEditorController *controller) +{ + return findUndoChange(controller) != 0; +} + +/// Should check if a redo operation can be performed. +/// When no controller is given a document-redo is checkd +/// else a view specific soft redo is tested +bool TextUndoStack::canRedo(TextEditorController *controller) +{ + return findRedoChange(controller) != 0; +} + +/// performs an undo operation +/// @param controller this method is called +void TextUndoStack::undo(TextEditorController *controller, bool controllerOnly) +{ + Q_ASSERT(!undoRunning_); + undoRunning_ = true; + resetAllLastCoalesceIds(); + + Change *changeToUndo = this->findUndoChange(controller); + // only for the current controller + if (changeToUndo && changeToUndo->controllerContext()) + { + Q_ASSERT(changeToUndo->controllerContext() == controller); + undoControllerChange(controller); + + // else we need to undo ALL other controller changes + } + else if (!controllerOnly) + { + undoDocumentChange(); + } + dumpStackInternal(); + + undoRunning_ = false; +} + +/// performs the redo operation for the given controller +/// @param controller the controller to execute the redo for +/// @param controllerOnly undo controller undo's only? +void TextUndoStack::redo(TextEditorController *controller, bool controllerOnly) +{ + Q_ASSERT(!redoRunning_); + redoRunning_ = true; + resetAllLastCoalesceIds(); + + Change *changeToRedo = findRedoChange(controller); + if (changeToRedo && changeToRedo->controllerContext()) + { + Q_ASSERT(changeToRedo->controllerContext() == controller); + redoControllerChange(controller); + } + else if (!controllerOnly) + { + redoDocumentChange(); + } + dumpStackInternal(); + redoRunning_ = false; +} + +/// returns the number of changes on the stack +int TextUndoStack::size() +{ + return changeList_.size(); +} + +/// returns the change at the given index +Change *TextUndoStack::at(int idx) +{ + return changeList_.at(idx); +} + +/// This method return the index that's active for the given controller +/// The currentIndex points directly AFTER the last placed item on the stack +int TextUndoStack::currentIndex(TextEditorController *controller) +{ + if (controller) + { + Q_ASSERT(controllerIndexMap_.contains(controller)); + return controllerIndexMap_.value(controller); + } + else + { + return changeIndex_; + } +} + +/// This method returns the current redo change. This maybe the change for the +/// given context or the document change depending on what comes first +/// @param controller the controller this change is for +/// @return the new text change (0 if there aren't any redo items availabe for +/// the given context). When a controller is given the document change is ALSO +/// returned +Change *TextUndoStack::findRedoChange(TextEditorController *controller) +{ + int redoIndex = findRedoIndex(currentIndex(controller), controller); + if (redoIndex < changeList_.size()) + { + return at(redoIndex); + } + return 0; +} + +/// This method returns the last index for a given controller +/// The lastIndex points to the index on the stack +/// @return the index on the stack or -1 if the item isn't on the undo-stack +int TextUndoStack::lastIndex(TextEditorController *controller) +{ + return currentIndex(controller) - 1; +} + +/// Returns last textchange on the undo stack +/// @param controller the controller +/// @return the last change (with optional the controller context) 0 if no last +/// change +Change *TextUndoStack::last(TextEditorController *controller) +{ + int idx = lastIndex(controller); + if (idx < 0) + { + return 0; + } + return at(idx); +} + +/// The number of doc-'undo' items on the stack +int TextUndoStack::sizeInDocChanges() +{ + int count = 0; + foreach (Change *change, changeList_) + { + if (change->isDocumentChange()) + { + ++count; + } + } + return count; +} + +/// This method returns the current doc change index +int TextUndoStack::currentIndexInDocChanges() +{ + int index = 0; + for (int i = 0; i < changeIndex_; ++i) + { + if (changeList_.at(i)->isDocumentChange()) + { + ++index; + } + } + return index; +} + +/// This method returns the last change (TOS) for the given controller +Change *TextUndoStack::findUndoChange(TextEditorController *controller) +{ + int undoIndex = this->findUndoIndex(currentIndex(controller), controller); + if (undoIndex >= 0) + { + return changeList_.at(undoIndex); + } + return 0; +} + +/// Marks the current documentIndex as persisted +void TextUndoStack::setPersisted(bool enabled) +{ + setPersistedIndex(enabled ? currentIndex() : -1); +} + +/// returns true if the undo-stack is on a persisted index +bool TextUndoStack::isPersisted() +{ + int curIdx = currentIndex(); + if (persistedIndex_ == curIdx) + { + return true; + } + if (persistedIndex_ < 0) + { + return false; + } + + // check if all changes are non-persistable + int startIdx = qMax(0, qMin(curIdx, persistedIndex_)); + int endIdx = qMin(qMax(curIdx, persistedIndex_), changeList_.size()); + + for (int idx = startIdx; idx < endIdx; ++idx) + { + Change *change = changeList_.at(idx); + + // only check document changes + if (change->isDocumentChange()) + { + if (change->isPersistenceRequired()) + { + return false; + } + } + } + return true; +} + +/// This method returns the current persisted index +int TextUndoStack::persistedIndex() +{ + return persistedIndex_; +} + +/// makes a dump of the current stack +QString TextUndoStack::dumpStack() +{ + QString result; + result += "\n"; + result += "UndoStack\n"; + result += "=====================\n"; + + bool end = true; + for (int i = changeList_.size(); i >= 0; --i) + { + QString str; + QString changeName; + QString controllerName; + QString pointers; + + /// build the stack overview + if (end) + { + changeName = "^^^^^^^^^^^^^^^^^"; + } + else + { + Change *change = at(i); + TextEditorController *controller = change->controllerContext(); + changeName = change->toString(); + if (controller) + { + controllerName = QString::number((quintptr)controller, 16); + } + } + + // next append the pointers + QMap<TextEditorController *, int>::iterator itr; + for (itr = controllerIndexMap_.begin(); itr != controllerIndexMap_.end(); + ++itr) + { + if (itr.value() == i) + { + pointers.append(QStringLiteral("<=(%1) ").arg( + QString::number((quintptr)itr.key(), 16))); + } + } + if (changeIndex_ == i) + { + pointers.append(QStringLiteral("<=(DOC) ")); + } + if (persistedIndex_ == i) + { + pointers.append(QStringLiteral("<=(P) ")); + } + + result += QStringLiteral("-|%1:%2| %3\n") + .arg(changeName, -30) + .arg(controllerName, 10) + .arg(pointers); + end = false; + } + return result; +} + +/// Dumps the internal stack +void TextUndoStack::dumpStackInternal() +{ +#ifdef DUMP_UNDO_STACK + qDebug().noquote() << this->dumpStack(); +#endif +} + +/// This method finds the next redo-item +/// @param index the index to search it from +/// @param controller the controller context +/// @return the next change index. Or changeList_.size() if there's no next +/// change +int TextUndoStack::findRedoIndex(int index, TextEditorController *controller) +{ + if (index < changeList_.size()) + { + int size = changeList_.size(); + for (; index < size; ++index) + { + Change *change = at(index); + TextEditorController *context = change->controllerContext(); + if (context == 0 || context == controller) + { + return index; + } + } + } + return changeList_.size(); +} + +/// This method finds the index of the given stackitem from the given index +/// @param index the previous index +/// @param controller the controller context +/// @return the previous index -1, if there's no previous index +int TextUndoStack::findUndoIndex(int index, TextEditorController *controller) +{ + if (index > 0) + { + for (--index; index >= 0; --index) + { + Change *change = at(index); + TextEditorController *context = change->controllerContext(); + if (context == 0 || context == controller) + { + return index; + } + } + } + return -1; +} + +/// Clears all redo's for the given controller +void TextUndoStack::clearRedo(TextEditorController *controller) +{ + // view specific undo + if (controller) + { + int idx = changeIndex_; + if (controllerIndexMap_.contains(controller)) + { + idx = this->controllerIndexMap_.value(controller); + } + else + { + Q_ASSERT(false + && "The current controller isn't registered with the " + "undostack!"); // warning view isn't registered! + } + + // remove all items from the stack AFTER the given index + for (int i = changeList_.size() - 1; i >= idx; --i) + { + if (changeList_.at(i)->controllerContext() == controller) + { + delete changeList_.takeAt(i); + } + } + } + else + { + if (currentIndex(0) < persistedIndex()) + { + setPersistedIndex(-1); + } + + // find the next redo-document operation + int redoIndex = findRedoIndex(currentIndex(0), 0); + for (int i = changeList_.size() - 1; i >= redoIndex; --i) + { + delete changeList_.takeAt(i); + } + + // remove all items from the stack AFTER the given index + // for( int i=changeList_.size()-1; i >= changeIndex_; --i ) { + // delete changeList_.takeAt(i); + // } + } +} + +/// This method undos the given controller change. This method does NOT undo +/// document changes +/// @param controller the controller to undo the change form +/// @return true if a change has been undone. +bool TextUndoStack::undoControllerChange(TextEditorController *controller) +{ + Q_ASSERT(controller); + int changeIdx = controllerIndexMap_.value(controller) + - 1; // -1, because the index is directly AFTER the item + Change *changeToUndo = findUndoChange(controller); + + if (changeToUndo && changeToUndo->controllerContext()) + { + Q_ASSERT(changeToUndo->controllerContext() == controller); + changeToUndo->revert(documentRef_); + controllerIndexMap_[controller] = findUndoIndex(changeIdx, controller) + 1; + emit undoExecuted(changeToUndo); + return true; + } + return false; +} + +/// Performs an document-change undo. +void TextUndoStack::undoDocumentChange() +{ + // first make sure ALL controller-changes are back to the document + // change-level + QMap<TextEditorController *, int>::iterator itr; + for (itr = controllerIndexMap_.begin(); itr != controllerIndexMap_.end(); + ++itr) + { + TextEditorController *controller = itr.key(); + while (undoControllerChange(controller)) + { + }; // undo all controller operations + } + + // next perform an undo of the document operations + Change *change = findUndoChange(); + if (change) + { + Q_ASSERT(change->controllerContext() == 0); + change->revert(documentRef_); + + // next move the pointers to first 'related' change + for (itr = controllerIndexMap_.begin(); itr != controllerIndexMap_.end(); + ++itr) + { + TextEditorController *controller = itr.key(); + controllerIndexMap_[controller] + = findUndoIndex(changeIndex_ - 1, controller) + + 1; // +1 because the pointer points AFTER the found index + } + + // and finally move the document pointer + setChangeIndex(findUndoIndex(changeIndex_ - 1) + + 1); // +1 because the pointer points AFTER the found index + emit undoExecuted(change); + } +} + +/// undo's the given controller change +bool TextUndoStack::redoControllerChange(TextEditorController *controller) +{ + Q_ASSERT(controller); + int changeIdx = findRedoIndex(currentIndex(controller), controller); + Change *changeToRedo = findRedoChange(controller); + if (changeToRedo && changeToRedo->controllerContext()) + { + Q_ASSERT(changeToRedo->controllerContext() == controller); + changeToRedo->execute(documentRef_); + + // move the pointer to the next + controllerIndexMap_[controller] = changeIdx + 1; + emit redoExecuted(changeToRedo); + } + return false; +} + +/// redo a document change +void TextUndoStack::redoDocumentChange() +{ + // first find the redo operation + int redoIndex = findRedoIndex(currentIndex(0), 0); + Change *redo = findRedoChange(0); + if (redo) + { + ++redoIndex; + } + + // first move all controller redo-operation to the given redo found redo + // location + QMap<TextEditorController *, int>::iterator itr; + for (itr = controllerIndexMap_.begin(); itr != controllerIndexMap_.end(); + ++itr) + { + TextEditorController *controller = itr.key(); + while (redoControllerChange(controller)) + { + }; // undo all controller operations + itr.value() = redoIndex; // move the position after the DOC operation + } + + // is there a document redo? execute it + if (redo) + { + redo->execute(documentRef_); + setChangeIndex(redoIndex); + emit redoExecuted(redo); + } +} + +/// Sets the persisted in dex and fires a signal +void TextUndoStack::setPersistedIndex(int index) +{ + bool oldPersisted = isPersisted(); + persistedIndex_ = index; + bool persisted = isPersisted(); + if (oldPersisted != persisted) + { + emit persistedChanged(persisted); + } +} + +/// When setting the change-index we sometimes must emit a persisted change +void TextUndoStack::setChangeIndex(int index) +{ + if (index != changeIndex_) + { + bool oldPersisted = isPersisted(); + changeIndex_ = index; + bool persisted = isPersisted(); + if (oldPersisted != persisted) + { + emit persistedChanged(persisted); + } + } +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/models/textundostack.h b/lib/edbee-lib/edbee/models/textundostack.h new file mode 100644 index 00000000..7337710f --- /dev/null +++ b/lib/edbee-lib/edbee/models/textundostack.h @@ -0,0 +1,177 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QObject> +#include <QMap> +#include <QStack> + +namespace edbee +{ + +class Change; +class TextDocument; +class TextEditorController; +class ChangeGroup; + +/// This is the undo stack for the texteditor. This stack is SHARED by all views +/// of the document The stack also stores view-specific commands of all views +/// +/// Every view has got it's own pointer on the stack. This pointer points at the +/// index AFTER the last item on the stack that's used for this view. +/// +/// When a view-performs a view-specific undo (soft-undo) it's own pointer is +/// stepped back. Only view-specific commands are undone When a view performs a +/// document undo. ALL view-pointers a are undone to the point of the document +/// undo. +/// +/// ~~~~ +/// +/// 7 | | <= controllerIndexMap_(v1) +/// +-------+ +/// 6 | v1 | <= controllerIndexMap_(v2) +/// +-------+ +/// 5 | v2 | +/// +-------+ +/// 4 | v1 | <= changeIndex_ +/// +-------+ +/// 3 | DOC | +/// +-------+ +/// 2 | v1 | +/// +-------+ +/// 1 | DOC | +/// +-------+ +/// 0 | v2 | +/// +-------+ +/// +/// ~~~~ + +class EDBEE_EXPORT TextUndoStack : public QObject +{ + Q_OBJECT + +public: + /// This enumeration is signaled to the listeners to notify what happend when + /// ending an undo group + enum EndUndoGroupAction + { + ActionUngrouped, ///< The group has been ungrouped, the single change has + ///< been added to the stack + ActionFullDiscard, ///< The group contained nothing usefull, nothing is + ///< added to the stack + ActionEnd ///< A normal group end + + }; + +public: + explicit TextUndoStack(TextDocument *doc, QObject *parent = 0); + virtual ~TextUndoStack(); + void clear(); + + void registerContoller(TextEditorController *controller); + void unregisterController(TextEditorController *controller); + bool isControllerRegistered(TextEditorController *controller); + + void beginUndoGroup(ChangeGroup *group); + ChangeGroup *currentGroup(); + void endUndoGroup(int coalesceId, bool flatten); + void endUndoGroupAndDiscard(); + int undoGroupLevel(); + + int lastCoalesceIdAtCurrentLevel(); + void setLastCoalesceIdAtCurrentLevel(int id); + void resetAllLastCoalesceIds(); + + Change *giveChange(Change *change, int coalesceId); + + bool canUndo(TextEditorController *controller = 0); + bool canRedo(TextEditorController *controller = 0); + + void undo(TextEditorController *controller = 0, bool controllerOnly = false); + void redo(TextEditorController *controller = 0, bool controllerOnly = false); + + bool isCollectionEnabled() { return collectionEnabled_; } + void setCollectionEnabled(bool enabled) { collectionEnabled_ = enabled; } + + bool isUndoRunning() { return undoRunning_; } + bool isRedoRunning() { return redoRunning_; } + + int size(); + Change *at(int idx); + int currentIndex(TextEditorController *controller = 0); + int lastIndex(TextEditorController *controller = 0); + Change *last(TextEditorController *controller = 0); + + int sizeInDocChanges(); + int currentIndexInDocChanges(); + + Change *findRedoChange(TextEditorController *controller = 0); + Change *findUndoChange(TextEditorController *controller = 0); + + void setPersisted(bool enabled); + bool isPersisted(); + int persistedIndex(); + + TextDocument *document() { return documentRef_; } + + QString dumpStack(); + void dumpStackInternal(); + +protected: + int findRedoIndex(int index, TextEditorController *controller = 0); + int findUndoIndex(int index, TextEditorController *controller = 0); + void clearRedo(TextEditorController *controller); + bool undoControllerChange(TextEditorController *controller); + void undoDocumentChange(); + bool redoControllerChange(TextEditorController *controller); + void redoDocumentChange(); + + void setPersistedIndex(int index); + void setChangeIndex(int index); + +signals: + + void undoGroupStarted(edbee::ChangeGroup *group); + + /// This signal is fired when the group is ended. Warning, when the group is + /// merged the group pointer will be 0!! + void undoGroupEnded(int coalesceId, bool merged, int action); + void changeAdded(edbee::Change *change); + // void changeMerged( edbee::TextChange* oldChange, edbee::TextChange* + // change ); + void undoExecuted(edbee::Change *change); + void redoExecuted(edbee::Change *change); + + /// This signal is emitted if the persisted state is changed + void persistedChanged(bool persisted); + +private: + void clearHistoryLists(); + + TextDocument *documentRef_; ///< A reference to the textdocument + + QList<Change *> changeList_; ///< The list of stack commands + int changeIndex_; ///< The current command index (TextDocument/Global) + QMap<TextEditorController *, int> + controllerIndexMap_; ///< The current controller pointers (View specific) + int persistedIndex_; ///< The current persisted index. A persisted-index of + ///< -1, means it never is persisted + + QStack<ChangeGroup *> undoGroupStack_; ///< A stack of all undo items + QStack<int> lastCoalesceIdStack_; ///< The last coalesceId + + // int undoGroupLevel_; ///< The undo group + // level TextChangeGroup* undoGroup_; ///< The + // current undo group + bool collectionEnabled_; ///< Is the undo-stack enabled? + + bool undoRunning_; ///< This flag is set if undo is running + bool redoRunning_; ///< This flag is set if a redo is running +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/texteditorcommand.cpp b/lib/edbee-lib/edbee/texteditorcommand.cpp new file mode 100644 index 00000000..c9e441cf --- /dev/null +++ b/lib/edbee-lib/edbee/texteditorcommand.cpp @@ -0,0 +1,24 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "texteditorcommand.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// The default constructor +TextEditorCommand::TextEditorCommand() {} + +/// A blank virtual destructor +TextEditorCommand::~TextEditorCommand() {} + +bool TextEditorCommand::readonly() +{ + return false; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/texteditorcommand.h b/lib/edbee-lib/edbee/texteditorcommand.h new file mode 100644 index 00000000..fd5ff9ef --- /dev/null +++ b/lib/edbee-lib/edbee/texteditorcommand.h @@ -0,0 +1,72 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QString> + +namespace edbee +{ + +class TextEditorController; + +/// Predefined coalesce/command ids +/// +/// Coalescing is the merging of several undoable operations. +/// Only commands with the same ID will be merged +/// +/// Every commands has got 16 bits to add subtype information (and generate +/// another unique-number this way) +enum CoalesceId +{ + CoalesceId_ForceMerge = -1, ///< FORCE coalescing + CoalesceId_None = 0, ///< NO coalescing + + CoalesceId_Selection + = 1 << 16, ///< Selection coalescing (we use 2 bytes for sub-types) + + CoalesceId_TextChanges = 2 << 16, ///< A textchange + CoalesceId_AppendChar = 3 << 16, ///< Appending of a character + + CoalesceId_Remove = 4 << 16, ///< Removing of text + + CoalesceId_InsertNewLine = 6 << 16, + CoalesceId_Indent = 7 << 16, + CoalesceId_CutLine = 8 << 16, + CoalesceId_Paste = 9 << 16, + CoalesceId_Duplicate = 10 << 16, + CoalesceId_MoveLine = 11 << 16, + + CoalesceId_UserDefined = 100 << 16 +}; + +/// This is the abstract base class for a textcommand +/// +/// A textcommand is an object/class that's used for executing an operation +/// Though the name is 'command' these commands are NOT used on the undo stack. +/// The undostack makes use of TextChange objects! +/// +/// These commands can be placed in the TextEditorCommandMap with a given name +/// By linking this command-name in the Keymap you can register keyboard +/// operations this way +class EDBEE_EXPORT TextEditorCommand +{ +public: + TextEditorCommand(); + virtual ~TextEditorCommand(); + + /// This method should execute the given command + virtual void execute(TextEditorController *controller) = 0; + + /// should return the description of the command + virtual QString toString() = 0; + + /// Tis method should return true if it's executable in readonly mode + virtual bool readonly(); +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/texteditorcontroller.cpp b/lib/edbee-lib/edbee/texteditorcontroller.cpp new file mode 100644 index 00000000..635b0522 --- /dev/null +++ b/lib/edbee-lib/edbee/texteditorcontroller.cpp @@ -0,0 +1,808 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "texteditorcontroller.h" + +#include <QApplication> +#include <QAction> +#include <QAccessibleTextUpdateEvent> +#include <QThread> + +#include "edbee/commands/selectioncommand.h" +#include "edbee/models/changes/selectionchange.h" +#include "edbee/models/chardocument/chartextdocument.h" +#include "edbee/models/textbuffer.h" +#include "edbee/models/change.h" +#include "edbee/models/textdocument.h" +#include "edbee/models/textdocumentscopes.h" +#include "edbee/models/texteditorcommandmap.h" +#include "edbee/models/texteditorconfig.h" +#include "edbee/models/texteditorkeymap.h" +#include "edbee/models/textrange.h" +#include "edbee/models/textsearcher.h" +#include "edbee/models/textundostack.h" +#include "edbee/texteditorcommand.h" +#include "edbee/edbee.h" +#include "edbee/texteditorwidget.h" +#include "edbee/views/accessibletexteditorwidget.h" +#include "edbee/views/components/texteditorcomponent.h" +#include "edbee/views/components/textmargincomponent.h" +#include "edbee/views/textrenderer.h" +#include "edbee/views/textcaretcache.h" +#include "edbee/views/textselection.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// The constructor +/// @param widget the widget this controller is associated with +/// @paarm parent the QObject parent of the controller +TextEditorController::TextEditorController(TextEditorWidget *widget, + QObject *parent) + : QObject(parent) + , widgetRef_(widget) + , textDocument_(nullptr) + , textDocumentRef_(nullptr) + , textSelection_(nullptr) + , keyMap_(nullptr) + , keyMapRef_(nullptr) + , commandMap_(nullptr) + , commandMapRef_(nullptr) + , textRenderer_(nullptr) + , textCaretCache_(nullptr) + , textSearcher_(nullptr) + , autoScrollToCaret_(AutoScrollAlways) + , borderedTextRanges_(nullptr) +{ + + // create the keymap + keyMapRef_ = Edbee::instance()->defaultKeyMap(); + commandMapRef_ = Edbee::instance()->defaultCommandMap(); + + // create the text renderer + textRenderer_ = new TextRenderer(this); + + // create a text document (this should happen AFTER the creation of the + // renderer) + giveTextDocument(new CharTextDocument()); + + // Now all objects have been created we can init them + textRenderer_->init(); + textRenderer_->setThemeByName(textDocument()->config()->themeName()); +} + +/// Destroys the controller and associated objects +TextEditorController::~TextEditorController() +{ + delete borderedTextRanges_; + delete textSearcher_; + delete textRenderer_; + delete textCaretCache_; + delete textSelection_; + delete textDocument_; + delete commandMap_; + delete keyMap_; +} + +/// This method is called to reset the caret timer and update the ui +void TextEditorController::notifyStateChange() +{ + if (widgetRef_) + { + widgetRef_->resetCaretTime(); + + // scrolling is only required when focused (When scrolling without focus the + // sync-editor goes wacko :P ) + if (autoScrollToCaret_ == AutoScrollAlways + || (autoScrollToCaret_ == AutoScrollWhenFocus && hasFocus())) + { + scrollOffsetVisible(textSelection()->range(0).caret()); + } + + widgetRef_->updateComponents(); + } +} + +/// sets the document and transfers the ownership of the textdocument to this +/// class +/// @param doc the new document for this controller +void TextEditorController::giveTextDocument(TextDocument *doc) +{ + if (doc != textDocument_) + { + setTextDocument(doc); + textDocument_ + = doc; // this is all that's required for getting the ownership + } +} + +/// Set the text document +/// @param doc the document for this controller +void TextEditorController::setTextDocument(TextDocument *doc) +{ + Q_ASSERT_GUI_THREAD; + + if (doc != textDocumentRef_) + { + // disconnect the old document + TextDocument *oldDocumentRef = textDocument(); + if (oldDocumentRef) + { + oldDocumentRef->textUndoStack()->unregisterController(this); + disconnect(oldDocumentRef, + SIGNAL(textChanged(edbee::TextBufferChange, QString)), this, + SLOT(onTextChanged(edbee::TextBufferChange, QString))); + disconnect(textDocumentRef_->lineDataManager(), + SIGNAL(lineDataChanged(int, int, int)), this, + SLOT(onLineDataChanged(int, int, int))); + } + + // delete some old and dependent objects + delete textCaretCache_; + delete textSelection_; + + // create the document + textDocumentRef_ = doc; + textCaretCache_ = new TextCaretCache( + textDocumentRef_, textRenderer_); // warning the cache needs to be + // created BEFORE the selection!!! + textSelection_ = new TextSelection(this); + textSelection_->addRange(0, 0); // add at least one cursor :-) + + delete borderedTextRanges_; + borderedTextRanges_ = new DynamicTextRangeSet(textDocument()); + + textDocumentRef_->textUndoStack()->registerContoller(this); + + connect(textDocumentRef_, + SIGNAL(textChanged(edbee::TextBufferChange, QString)), this, + SLOT(onTextChanged(edbee::TextBufferChange, QString))); + connect(textDocumentRef_->lineDataManager(), + SIGNAL(lineDataChanged(int, int, int)), this, + SLOT(onLineDataChanged(int, int, int))); + + // force an repaint when the grammar is changed + connect(textDocumentRef_, &TextDocument::languageGrammarChanged, this, + &TextEditorController::update); + + // connect the configuration changes to the controller + connect(textDocumentRef_->config(), &TextEditorConfig::configChanged, this, + &TextEditorController::updateAfterConfigChange); + + // create the new document + emit textDocumentChanged(oldDocumentRef, textDocumentRef_); + + // delete the old stuff + delete textDocument_; + textDocument_ = nullptr; + } +} + +/// Changes the autoScrollToCaret setting +/// @param autoScroll the new autoscroll to caret setting. This can be one of +/// the following values: +/// - AutoScrollAlways => Always scroll the view so the caret is visible +// - AutoScrollWhenFocus => Only scroll the view when the editor has got the +// focus +// - AutoScrollNever => Never perform automatic scrolling +void TextEditorController::setAutoScrollToCaret( + TextEditorController::AutoScrollToCaret autoScroll) +{ + autoScrollToCaret_ = autoScroll; +} + +/// Returns the autoScrollToCaret setting +TextEditorController::AutoScrollToCaret +TextEditorController::autoScrollToCaret() const +{ + return autoScrollToCaret_; +} + +/// This method return true if the text-editor has focus +bool TextEditorController::hasFocus() +{ + return widget()->hasFocus(); +} + +/// This method creates an editor action that is +/// @param command the command that needs to be executed. +/// @param text description of the command +/// @param icon the optional icon of the command +/// @param owner the QObject owner of this action +/// @return the newly created QAction +QAction *TextEditorController::createUnconnectedAction(const QString &command, + const QString &text, + const QIcon &icon, + QObject *owner) +{ + // create the action + QAction *action = new QAction(icon, text, owner); + + // set the key if there's an assigned keyboard command + TextEditorKey *key = keyMap()->get(command); + if (keyMap()->get(command)) + { + action->setShortcut(key->sequence()); + } + + // set the data + action->setData(command); + return action; +} + +/// Creates a QAction object that performs the given editor action +/// The shortcut of the given editor-command is retrieved from the keymap +/// @param command the command that needs to be executed. +/// @param text description of the command +/// @param icon the optional icon of the command +/// @param owner the QObject owner of this action +/// @return the newly created QAction +QAction *TextEditorController::createAction(const QString &command, + const QString &text, + const QIcon &icon, QObject *owner) +{ + // create the action + QAction *action = createUnconnectedAction(command, text, icon, owner); + /// connect the signal to executeCommand + connect(action, SIGNAL(triggered()), SLOT(executeCommand())); + return action; +} + +/// Returns a reference to the textdocument +TextDocument *TextEditorController::textDocument() const +{ + return textDocumentRef_; +} + +/// Returns the textselection +TextSelection *TextEditorController::textSelection() const +{ + return textSelection_; +} + +/// Returns the current text renderer +TextRenderer *TextEditorController::textRenderer() const +{ + return textRenderer_; +} + +/// returns the bordered textranges +/// These are textranges that are rendered with a border, but aren't truly +/// selected +TextRangeSet *TextEditorController::borderedTextRanges() const +{ + return borderedTextRanges_; +} + +/// sets the keymap. It will replace (and if owned, delete) the previous keymap +/// @param keyMap the new keyMap to use +void TextEditorController::setKeyMap(TextEditorKeyMap *keyMap) +{ + delete keyMap_; + keyMap_ = nullptr; + keyMapRef_ = keyMap; +} + +/// gives a keymap to the editor. The ownership is transferred to this +/// controller +/// @param keyMap the new keymap to give to the controller +void TextEditorController::giveKeyMap(TextEditorKeyMap *keyMap) +{ + delete keyMap_; + keyMap_ = keyMap; + keyMapRef_ = keyMap; +} + +/// Returns the current keymap +TextEditorKeyMap *TextEditorController::keyMap() const +{ + return keyMapRef_; +} + +/// set a commandmap +/// the ownership is NOT transferred to this object. The old owned command-map +/// is deleted +/// @parm commandMap the new commandMap of this object +void TextEditorController::setCommandMap(TextEditorCommandMap *commandMap) +{ + delete commandMap_; + commandMap_ = nullptr; + commandMapRef_ = commandMap; +} + +/// gives a commandmap to the editor +/// The old associated command map is deleted +/// @param commandMap the new commandMap +void TextEditorController::giveCommandMap(TextEditorCommandMap *commandMap) +{ + delete commandMap_; + commandMap_ = commandMap; + commandMapRef_ = commandMap; +} + +/// Returns the current commandmap +TextEditorCommandMap *TextEditorController::commandMap() const +{ + return commandMapRef_; +} + +/// Returns the active widget +TextEditorWidget *TextEditorController::widget() const +{ + return widgetRef_; +} + +/// Returns the textCaretCache +TextCaretCache *TextEditorController::textCaretCache() const +{ + return textCaretCache_; +} + +/// Gives the text-searcher to this document +/// @param searcher the new textsearcher for this document (The old one is +/// deleted) +void TextEditorController::giveTextSearcher(TextSearcher *searcher) +{ + delete textSearcher_; + textSearcher_ = searcher; +} + +/// Returns the associated text searcher object +/// @return the textsearcher object +TextSearcher *TextEditorController::textSearcher() +{ + if (!textSearcher_) + { + textSearcher_ = new TextSearcher(); + } + return textSearcher_; +} + +/// this method returns the dynamic variables object for this controller +/// The current implementation simply returns the application-wide environment +/// variables +DynamicVariables *TextEditorController::dynamicVariables() const +{ + return Edbee::instance()->environmentVariables(); +} + +//========================================================================================== +// Slots +//========================================================================================== + +/// This slot is placed if a piece of text is replaced +void TextEditorController::onTextChanged(edbee::TextBufferChange change, + QString oldText) +{ + /// update the selection + // textSelection()->changeSpatial( change.offset(), change.length(), + // change.newTextLength() ); + + /// TODO: improve this: + if (widgetRef_) + { + widget()->updateGeometryComponents(); + notifyStateChange(); + + AccessibleTextEditorWidget::notifyTextChangeEvent(widget(), &change, + oldText); + } +} + +/// the old selection has been changed +/// @param oldRangeSet the old range set of the change +void TextEditorController::onSelectionChanged(TextRangeSet *oldRangeSet) +{ + Q_UNUSED(oldRangeSet) + + /// TODO: improve this: + if (widgetRef_) + { + notifyStateChange(); + } +} + +/// The line-data is changed, we need to repaint the selected lines +/// @param line the line number that had a data change +/// @param length the number of lines changed +/// @param newLength the new number of lines +void TextEditorController::onLineDataChanged(int line, int length, + int newLength) +{ + if (this->widgetRef_) + { + widgetRef_->updateLine(line, qMax(length, newLength)); + } +} + +/// This method is used to update the component when the configuration has been +/// changed. This is a temporary solution, perhaps we should make TextConfig +/// signal changes A lot of changes don't require an updates, but some do +void TextEditorController::updateAfterConfigChange() +{ + textRenderer()->setThemeByName(textDocument()->config()->themeName()); + + // we need to figure out a better way to do this + QFont font = textDocument()->config()->font(); + widget()->setFont(font); + widget()->textEditorComponent()->setFont(font); + widget()->textMarginComponent()->setFont(font); + widget()->fullUpdate(); +} + +/// This method updates the status text. This is the text as displayed in the +/// lower status bar +/// @param extraText the extra text to show in the status bar +void TextEditorController::updateStatusText(const QString &extraText) +{ + QString text; + TextDocument *doc = textDocument(); + + if (!doc->textUndoStack()->isPersisted()) + { + text.append("[*] "); + } + + // add the ranges + if (textSelection_->rangeCount() > 1) + { + text.append(QObject::tr("%1 ranges").arg(textSelection_->rangeCount())); + } + else + { + TextRange &range = textSelection_->range(0); + int caret = range.caret(); + int line = doc->lineFromOffset(caret); + int col = doc->columnFromOffsetAndLine(caret, line) + 1; + text.append(QObject::tr("Line %1, Column %2").arg(line + 1).arg(col)); + + if (textDocument()->config()->showCaretOffset()) + { + text.append(QObject::tr(", Offset %1").arg(caret)); + } + + if (range.length() > 0) + { + text.append(QObject::tr(" | %1 chars selected").arg(range.length())); + + // add the current scopes + } + else + { + text.append(QObject::tr(" | scope: ")); + + QString str; + QVector<TextScope *> scopes + = textDocument()->scopes()->scopesAtOffset(caret); + for (int i = 0, cnt = scopes.size(); i < cnt; ++i) + { + TextScope *scope = scopes[i]; + str.append(scope->name()); + str.append(" "); + } + text.append(str); + text.append(QObject::tr(" (%1)").arg( + textDocument()->scopes()->lastScopedOffset())); + } + } + + // add the extra text + if (!extraText.isEmpty()) + { + text.append(" | "); + text.append(extraText); + } + emit updateStatusTextSignal(text); +} + +/// updates the main widget +void TextEditorController::update() +{ + if (widgetRef_) + { + widgetRef_->fullUpdate(); + } +} + +/// Asserts the view shows the given position +void TextEditorController::scrollPositionVisible(int xPos, int yPos) +{ + emit widgetRef_->scrollPositionVisible(xPos, yPos); +} + +/// Assets the view shows the given offset +void TextEditorController::scrollOffsetVisible(int offset) +{ + TextRenderer *renderer = textRenderer(); + int xPos = renderer->xPosForOffset(offset); + int yPos = renderer->yPosForOffset(offset); + scrollPositionVisible(xPos, yPos); +} + +/// This method makes sure caret 1 is visible +void TextEditorController::scrollCaretVisible() +{ + scrollOffsetVisible(textSelection()->range(0).caret()); +} + +/// This method adds a text change on the stack that simply stores the current +/// text-selection +/// @param coalsceId the coalescing identifier for merging/coalescing undo +/// operations +void TextEditorController::storeSelection(int coalesceId) +{ + SelectionChange *change = new SelectionChange(this); + change->giveTextRangeSet(new TextRangeSet(*textSelection())); + textDocument()->executeAndGiveChange(change, coalesceId); +} + +/// This method executes the command +void TextEditorController::executeCommand(edbee::TextEditorCommand *textCommand) +{ + // Only readonly commands can be executed in readonly mode + if (readonly() && !textCommand->readonly()) + { + updateStatusText("Cannot edit a readonly document!"); + return; + } + + emit commandToBeExecuted(textCommand); + textCommand->execute(this); + emit commandExecuted(textCommand); + + // TODO: move this to a nicer place!! + updateStatusText(textCommand->toString()); +} + +/// Executes a command with the given name +/// +/// When the name hasn't been supplied. This function assumes the command is +/// triggered by a QAction and it will retrieve the command-name from the +/// QAction data method +/// +/// @param name of the command to execute +void TextEditorController::executeCommand(const QString &name) +{ + // check if an empty command name has been supplied + QString commandName = name; + if (commandName.isEmpty()) + { + + // when the command name is blank try to get the data of the QAction + // command + QAction *action = qobject_cast<QAction *>(sender()); + if (!action) + { + qlog_warn() << "executeCommand was triggered without argument and " + "without QAction data attribute!"; + return; + } + commandName = action->data().toString(); + } + + // try to retrieve the command + TextEditorCommand *command = commandMap()->get(commandName); + if (command) + { + executeCommand(command); + } +} + +/// Return the readonly state. +bool TextEditorController::readonly() const +{ + return widget()->readonly(); +} + +/// Sets the readonly state +void TextEditorController::setReadonly(bool value) +{ + widget()->setReadonly(value); +} + +/// replaces the given text (single ranges) +/// @param offset the character offset in the document +/// @param length the number of characters to replace +/// @param text the text to replace +/// @param coalesceId the identifier for grouping undo operations +void TextEditorController::replace(int offset, int length, const QString &text, + int coalesceId, bool stickySelection) +{ + // SelectionTextChange* change = new SelectionTextChange(this); + TextRangeSet ranges(textDocument()); + ranges.addRange(offset, offset + length); + replaceRangeSet(ranges, text, coalesceId, stickySelection); +} + +/// This method replaces the selection with the given text +/// @param text the text to replace the selection with +/// @param coalesceId the identifier for grouping undo operations +void TextEditorController::replaceSelection(const QString &text, int coalesceId, + bool stickySelection) +{ + replaceRangeSet(*dynamic_cast<TextRangeSet *>(textSelection()), text, + coalesceId, stickySelection); +} + +/// This method replaces the given selection with the given texts +/// @param texts the list of texts that need to be replaced +/// @param coalesceID the identifier for grouping undo operation +void TextEditorController::replaceSelection(const QStringList &texts, + int coalesceId, + bool stickySelection) +{ + replaceRangeSet(*dynamic_cast<TextRangeSet *>(textSelection()), texts, + coalesceId, stickySelection); +} + +/// Replaces the given rangeset with the given text +/// @param rangeset the ranges to replace +/// @param text the text to replace the selection with +/// @param coalesceId the identifier for grouping undo operations +void TextEditorController::replaceRangeSet(edbee::TextRangeSet &rangeSet, + const QString &text, int coalesceId, + bool stickySelection) +{ + if (readonly()) + return; + + textDocument()->beginChanges(this); + textDocument()->replaceRangeSet(rangeSet, text, stickySelection); + textDocument()->endChanges(coalesceId); + notifyStateChange(); +} + +/// Replaces the given ranges with the given texts. Different text per range is +/// possible +/// @param rangeSet the rangeset to fill +/// @param text the texts to fill the given ranges with. +/// @param coalesceId the identifier for grouping undo operations +void TextEditorController::replaceRangeSet(edbee::TextRangeSet &rangeSet, + const QStringList &texts, + int coalesceId, bool stickySelection) +{ + if (readonly()) + return; + + textDocument()->beginChanges(this); + textDocument()->replaceRangeSet(rangeSet, texts, stickySelection); + textDocument()->endChanges(coalesceId); + notifyStateChange(); +} + +/// This method creates a command that moves the caret to the given line/column +/// position A negative number means that we're counting from the end This +/// method assumes line 0 is the first line! +/// +/// For example: +/// moveCaretTo( 2, 1 ) => Moves the caret to the 3rd line and 2nd column +/// moveCaretTo( -1, -2 ) => Moves the caret to the character before the +/// last character +/// +/// The rangeIndex is used to specify which range to move.. (Defaults to -1 +/// which changes to a single range) +void TextEditorController::moveCaretTo(int line, int col, bool keepAnchors, + int rangeIndex) +{ + if (line < 0) + { + line = textDocument()->lineCount() + line; + if (line < 0) + { + line = 0; + } + } + int offset = textDocument()->offsetFromLine(line); + int lineLength = textDocument()->lineLength(line); + if (col < 0) + { + col = lineLength + col; + } + + int minusNewLineChar = textDocument()->lineCount() - 1 == line ? 0 : 1; + offset += qBound(0, col, qMax(lineLength - minusNewLineChar, 0)); + + // textDocument()->offsetFromLineAndColumn(line,col) + + return moveCaretToOffset(offset, keepAnchors, rangeIndex); +} + +/// Moves the caret to the given offset +/// @param offset the offset to move the caret to +/// @param keepAnchors should the anchors stay at the current position +/// (extending the selection range) The rangeIndex is used to specify which +/// range to move.. (Defaults to -1 which changes to a single range) +void TextEditorController::moveCaretToOffset(int offset, bool keepAnchors, + int rangeIndex) +{ + // SelectionCommand* command = new SelectionCommand( + // SelectionCommand::MoveCaretToExactOffset, offset, keepAnchors ); + SelectionCommand command(SelectionCommand::MoveCaretToExactOffset, offset, + keepAnchors, rangeIndex); + return executeCommand(&command); +} + +/// Move the caret and the anchor to the given offset +/// @param caret the caret location +/// @param anchor the anchor location +/// The rangeIndex is used to specify which range to move.. (Defaults to -1 +/// which changes to a single range) +void TextEditorController::moveCaretAndAnchorToOffset(int caret, int anchor, + int rangeIndex) +{ + SelectionCommand command(SelectionCommand::MoveCaretToExactOffset, caret, + true, rangeIndex); + command.setAnchor(anchor); + return executeCommand(&command); +} + +/// Adds a new caret to the selection +/// @param line the line number +/// @param col the column +void TextEditorController::addCaretAt(int line, int col) +{ + return addCaretAtOffset(textDocument()->offsetFromLineAndColumn(line, col)); +} + +/// Adds a carert at the given offset +/// @param offset the character offset to add the caret +void TextEditorController::addCaretAtOffset(int offset) +{ + SelectionCommand command(SelectionCommand::AddCaretAtOffset, offset); + return executeCommand(&command); +} + +/// This method changes the text selection +void TextEditorController::changeAndGiveTextSelection( + edbee::TextRangeSet *rangeSet, int coalesceId) +{ + SelectionChange *change = new SelectionChange(this); + change->giveTextRangeSet(rangeSet); + textDocument()->executeAndGiveChange(change, coalesceId); +} + +/// This method performs an undo operation. By supplying soft only +/// controller based operations are undone. When supplying false a Document +/// operation is being undone +void TextEditorController::undo(bool soft) +{ + textDocument()->textUndoStack()->undo(soft ? this : nullptr, soft); +} + +/// This method performs an redo operation. By supplying soft only controller +/// based operations are redone. When supplying false a Document operation is +/// being redone +/// @param soft perform a soft undo? +void TextEditorController::redo(bool soft) +{ + textDocument()->textUndoStack()->redo(soft ? this : nullptr, soft); +} + +/// Starts an undo group +/// @param group the undogroup to use (defaults to a MergableChangeGroup) +void TextEditorController::beginUndoGroup(edbee::ChangeGroup *group) +{ + if (!group) + { + group = new ChangeGroup(this); + } + textDocument()->beginUndoGroup(group); +} + +/// Ends the undo-group. +/// @param coalesceId is used to decide if merging of groups is required. +/// a value of 0 means NO merging (default) +/// and id > 0 means if the previous command had the same id, +/// the command is merged +/// @param flatten when an undogroup is ended and flatten is set to true ALL +/// sub-undo-groups are merged to this group (default=false) +void TextEditorController::endUndoGroup(int coalesceId, bool flatten) +{ + textDocument()->endUndoGroup(coalesceId, flatten); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/texteditorcontroller.h b/lib/edbee-lib/edbee/texteditorcontroller.h new file mode 100644 index 00000000..e3e78080 --- /dev/null +++ b/lib/edbee-lib/edbee/texteditorcontroller.h @@ -0,0 +1,195 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QObject> +#include <QIcon> + +#include "edbee/models/textbuffer.h" + +class QAction; + +namespace edbee +{ + +class ChangeGroup; +class DynamicVariables; +class TextBufferChange; +class TextCaretCache; +class TextCommand; +class TextDocument; +class TextEditorCommand; +class TextEditorKeyMap; +class TextEditorCommandMap; +class TextEditorComponent; +class TextEditorWidget; +class TextRenderer; +class TextRangeSet; +class TextSearcher; +class TextSelection; +class UndoableTextCommand; + +/// The texteditor works via the controller. The controller is the central +/// point/mediator which maps/controls all messages between the different editor +/// components +class EDBEE_EXPORT TextEditorController : public QObject +{ + Q_OBJECT +public: + enum AutoScrollToCaret + { + AutoScrollAlways, + AutoScrollWhenFocus, + AutoScrollNever + }; + + explicit TextEditorController(TextEditorWidget *widget = 0, + QObject *parent = 0); + virtual ~TextEditorController(); + + // public method + void notifyStateChange(); + + void giveTextDocument(TextDocument *doc); + void setTextDocument(TextDocument *doc); + + void setAutoScrollToCaret(AutoScrollToCaret autoScroll); + virtual AutoScrollToCaret autoScrollToCaret() const; + + bool hasFocus(); + QAction *createUnconnectedAction(const QString &command, const QString &text, + const QIcon &icon = QIcon(), + QObject *owner = 0); + QAction *createAction(const QString &command, const QString &text, + const QIcon &icon = QIcon(), QObject *owner = 0); + + // getters + // TextBuffer* textBuffer() const; + TextDocument *textDocument() const; + TextSelection *textSelection() const; + TextRenderer *textRenderer() const; + TextRangeSet *borderedTextRanges() const; + + void setKeyMap(TextEditorKeyMap *keyMap); + void giveKeyMap(TextEditorKeyMap *keyMap); + TextEditorKeyMap *keyMap() const; + void setCommandMap(TextEditorCommandMap *commandMap); + void giveCommandMap(TextEditorCommandMap *commandMap); + TextEditorCommandMap *commandMap() const; + TextEditorWidget *widget() const; + TextCaretCache *textCaretCache() const; + void giveTextSearcher(TextSearcher *searcher); + TextSearcher *textSearcher(); + DynamicVariables *dynamicVariables() const; + +signals: + + /// This signal is fired if the statusbar needs updating + void updateStatusTextSignal(const QString &text); + + /// This signal is fired if the textdocument changes. + void textDocumentChanged(edbee::TextDocument *oldDocument, + edbee::TextDocument *newDocument); + + /// this method is executed when a command is going to be executed + void commandToBeExecuted(edbee::TextEditorCommand *command); + void commandExecuted(edbee::TextEditorCommand *command); + + void backspacePressed(); + +public slots: + + void onTextChanged(edbee::TextBufferChange change, + QString oldText = QString()); + void onSelectionChanged(edbee::TextRangeSet *oldRangeSet); + void onLineDataChanged(int line, int length, int newLength); + + void updateAfterConfigChange(); + +public slots: + + // updates the status text + virtual void updateStatusText(const QString &extraText = QString()); + + virtual void update(); + + // scrolling + virtual void scrollPositionVisible(int xPos, int yPos); + virtual void scrollOffsetVisible(int offset); + virtual void scrollCaretVisible(); + + virtual void storeSelection(int coalesceId = 0); + + // replace the given selection + virtual void replace(int offset, int length, const QString &text, + int coalesceId, bool stickySelection = false); + virtual void replaceSelection(const QString &text, int coalesceId = 0, + bool stickySelection = false); + virtual void replaceSelection(const QStringList &texts, int coalesceId = 0, + bool stickySelection = false); + virtual void replaceRangeSet(edbee::TextRangeSet &rangeSet, + const QString &text, int coalesceId = 0, + bool stickySelection = false); + virtual void replaceRangeSet(edbee::TextRangeSet &rangeSet, + const QStringList &texts, int coalesceId = 0, + bool stickySelection = false); + + // caret movements + virtual void moveCaretTo(int line, int col, bool keepAnchors, + int rangeIndex = -1); + virtual void moveCaretToOffset(int offset, bool keepAnchors, + int rangeIndex = -1); + virtual void moveCaretAndAnchorToOffset(int caret, int anchor, + int rangeIndex = -1); + virtual void addCaretAt(int line, int col); + virtual void addCaretAtOffset(int offset); + virtual void changeAndGiveTextSelection(edbee::TextRangeSet *rangeSet, + int coalesceId = 0); + + // perform an undo + virtual void undo(bool soft = false); + virtual void redo(bool soft = false); + + // command execution + virtual void beginUndoGroup(edbee::ChangeGroup *group = 0); + virtual void endUndoGroup(int coalesceId = 0, bool flatten = false); + + // low level command execution + virtual void executeCommand(edbee::TextEditorCommand *textCommand); + virtual void executeCommand(const QString &name = QString()); + +public: + // returns the readonly state + virtual bool readonly() const; + virtual void setReadonly(bool value); + +private: + TextEditorWidget *widgetRef_; ///< A reference to the text editor widget + TextDocument *textDocument_; ///< The text document (only filled when owned) + TextDocument *textDocumentRef_; ///< The reference to the text-document + + TextSelection *textSelection_; ///< The text selection + + TextEditorKeyMap *keyMap_; ///< The ownership of the keymap + TextEditorKeyMap *keyMapRef_; ///< A reference to the keymap + TextEditorCommandMap *commandMap_; ///< the ownership + TextEditorCommandMap *commandMapRef_; ///< A reference to the command + TextRenderer *textRenderer_; ///< The text renderer + TextCaretCache *textCaretCache_; ///< The text-caret cache. (For remembering + ///< the x-position of the current carets) + + TextSearcher *textSearcher_; ///< The text-searcher + + AutoScrollToCaret autoScrollToCaret_; ///< This flags tells the editor to + ///< automatically scroll to the caret + + // extra highlight text + TextRangeSet *borderedTextRanges_; ///< Extra marked text ranges +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/texteditorwidget.cpp b/lib/edbee-lib/edbee/texteditorwidget.cpp new file mode 100644 index 00000000..54639f87 --- /dev/null +++ b/lib/edbee-lib/edbee/texteditorwidget.cpp @@ -0,0 +1,374 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "texteditorwidget.h" + +#include <QApplication> +#include <QGraphicsBlurEffect> +#include <QGraphicsDropShadowEffect> +#include <QLabel> +#include <QMouseEvent> +#include <QPainter> +#include <QPaintEvent> +#include <QPropertyAnimation> +#include <QScrollArea> +#include <QScrollBar> +#include <QStyle> +#include <QStyleOptionFocusRect> +#include <QTextEdit> +#include <QTimer> +#include <QVBoxLayout> + +#include "edbee/commands/selectioncommand.h" +#include "edbee/edbee.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/models/change.h" +#include "edbee/models/textdocument.h" +#include "edbee/models/texteditorconfig.h" +#include "edbee/models/texteditorcommandmap.h" +#include "edbee/models/texteditorkeymap.h" +#include "edbee/models/textundostack.h" +#include "edbee/views/components/texteditorautocompletecomponent.h" +#include "edbee/views/components/texteditorcomponent.h" +#include "edbee/views/components/textmargincomponent.h" +#include "edbee/views/texteditorscrollarea.h" +#include "edbee/views/textrenderer.h" +#include "edbee/views/textselection.h" +#include "edbee/views/texttheme.h" + +#include "edbee/debug.h" + +// #define DEBUG_DRAW_RENDER_CLIPPING_RECTANGLE 1 + +namespace edbee +{ + +/// The default TextEditor widget constructor +TextEditorWidget::TextEditorWidget(QWidget *parent) + : QWidget(parent) + , controller_(nullptr) + , scrollAreaRef_(nullptr) + , editCompRef_(nullptr) + , autoCompleteCompRef_(nullptr) + , autoScrollMargin_(50) + , readonly_(false) +{ + // auto initialize edbee if this hasn't been done already + Edbee::instance()->autoInit(); + + // create the controller + controller_ = new TextEditorController(this); + + // setup the ui + scrollAreaRef_ = new class TextEditorScrollArea(this); + scrollAreaRef_->setWidgetResizable(true); + + editCompRef_ = new TextEditorComponent(controller_, scrollAreaRef_); + marginCompRef_ = new TextMarginComponent(this, scrollAreaRef_); + + scrollAreaRef_->setWidget(editCompRef_); + scrollAreaRef_->setLeftWidget(marginCompRef_); + // scrollAreaRef_->setLeftWidget( new QLabel("Left",this) + // );//marginCompRef_ ); scrollAreaRef_->setTopWidget( new + // QLabel("Top",this)); scrollAreaRef_->setRightWidget( new + // QLabel("Right",this)); scrollAreaRef_->setBottomWidget( new + // QLabel("Bottom",this)); + + QVBoxLayout *layout = new QVBoxLayout(this); + layout->addWidget(scrollAreaRef_); + layout->setContentsMargins(0, 0, 0, 0); + + setLayout(layout); + setFocusProxy(editCompRef_); + + /// TODO: Check if this works.. It could be possible the layout screws this + /// If I add this before the setLayout everything hangs :S ... + autoCompleteCompRef_ = new TextEditorAutoCompleteComponent( + controller_, editCompRef_, marginCompRef_); + + marginCompRef_->init(); + connectHorizontalScrollBar(); + connectVerticalScrollBar(); + connect(this, SIGNAL(horizontalScrollBarChanged(QScrollBar *)), + SLOT(connectHorizontalScrollBar())); + connect(this, SIGNAL(verticalScrollBarChanged(QScrollBar *)), + SLOT(connectVerticalScrollBar())); + connect(editCompRef_, SIGNAL(textKeyPressed()), autoCompleteCompRef_, + SLOT(textKeyPressed())); + connect(controller_, SIGNAL(backspacePressed()), autoCompleteCompRef_, + SLOT(backspacePressed())); + + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + + editCompRef_->installEventFilter( + this); // receive events for the ability to emit focus events +} + +/// The editor constructor +TextEditorWidget::~TextEditorWidget() +{ + // we need to perform manual deletion to force the deletion order + delete autoCompleteCompRef_; + delete marginCompRef_; + delete editCompRef_; + delete controller_; +} + +/// This method makes sure the given position is visible +/// @param xposIn the position in text-editor 'coordinates' +/// @param yPosIn the position in text-editor 'coordinates' +void TextEditorWidget::scrollPositionVisible(int xPosIn, int yPosIn) +{ + scrollAreaRef_->ensureVisible(xPosIn, yPosIn, autoScrollMargin_, + autoScrollMargin_); +} + +/// returns the controller for this editor +/// @return the active TextEditorController +TextEditorController *TextEditorWidget::controller() const +{ + return controller_; +} + +/// this method scrolls the top position to the given line +/// @param line the line to scroll to +void TextEditorWidget::scrollTopToLine(int line) +{ + int yPos = line * textRenderer()->lineHeight(); + scrollAreaRef_->verticalScrollBar()->setValue(qMax(0, yPos)); + // scrollAreaRef_->ensureVisible( 0, qMax(0,yPos) ); +} + +/// Returns the configuration object for this widget +TextEditorConfig *TextEditorWidget::config() const +{ + return textDocument()->config(); +} + +/// Return the associated commandmap +TextEditorCommandMap *TextEditorWidget::commandMap() const +{ + return controller_->commandMap(); +} + +/// return the associated keymap +TextEditorKeyMap *TextEditorWidget::keyMap() const +{ + return controller_->keyMap(); +} + +/// Returns the textdocument for this widget +TextDocument *TextEditorWidget::textDocument() const +{ + return controller_->textDocument(); +} + +/// Returns the text-renderer +TextRenderer *TextEditorWidget::textRenderer() const +{ + return controller_->textRenderer(); +} + +/// Return the textselection +TextSelection *TextEditorWidget::textSelection() const +{ + return controller_->textSelection(); +} + +/// Returns the editor component-part of the editor +TextEditorComponent *TextEditorWidget::textEditorComponent() const +{ + return editCompRef_; +} + +/// Returns the active margin component +TextMarginComponent *TextEditorWidget::textMarginComponent() const +{ + return marginCompRef_; +} + +/// Returns the active scroll area +TextEditorScrollArea *TextEditorWidget::textScrollArea() const +{ + return scrollAreaRef_; +} + +/// This method resets the caret time +void TextEditorWidget::resetCaretTime() +{ + editCompRef_->resetCaretTime(); +} + +/// This method performs a full update. Which means it calibrates the scrollbars +/// invalidates all caches, redraws the screen and updates the scrollbars +void TextEditorWidget::fullUpdate() +{ + editCompRef_->fullUpdate(); + marginCompRef_->fullUpdate(); +} + +/// Return the horizontal scrollbar +QScrollBar *TextEditorWidget::horizontalScrollBar() const +{ + return scrollAreaRef_->horizontalScrollBar(); +} + +/// returns the vertical scrollbar +QScrollBar *TextEditorWidget::verticalScrollBar() const +{ + return scrollAreaRef_->verticalScrollBar(); +} + +/// Use this method to change a scrollbar. By using this method listeners of the +/// scrollbar well be informed the scrollbar has been changed +/// @param scrollBar the scrollbar to use +void TextEditorWidget::setVerticalScrollBar(QScrollBar *scrollBar) +{ + scrollAreaRef_->setVerticalScrollBar(scrollBar); + emit verticalScrollBarChanged(scrollBar); +} + +/// Use this method to change the horizontal scrollbar. By using this method +/// listeners of the scrollbar well be informed the scrollbar has been changed +/// @param scrollBar the scrollbar to use +void TextEditorWidget::setHorizontalScrollBar(QScrollBar *scrollBar) +{ + scrollAreaRef_->setHorizontalScrollBar(scrollBar); + emit horizontalScrollBarChanged(scrollBar); +} + +/// Returns the auto scroll margin +int TextEditorWidget::autoScrollMargin() const +{ + return autoScrollMargin_; +} + +/// Sets the auto scrollmargin +void TextEditorWidget::setAutoScrollMargin(int amount) +{ + autoScrollMargin_ = amount; +} + +void TextEditorWidget::setPlaceholderText(const QString &text) +{ + this->textRenderer()->placeholderTextDocument()->setText(text); +} + +/// Return the readonly status +bool TextEditorWidget::readonly() const +{ + return readonly_; +} + +/// Set the readonly status +void TextEditorWidget::setReadonly(bool value) +{ + readonly_ = value; +} + +/// This method is called when a resize happens +/// @param event the event of the editor widget +void TextEditorWidget::resizeEvent(QResizeEvent *event) +{ + QWidget::resizeEvent(event); + updateRendererViewport(); +} + +/// a basic event-filter for receiving focus-events of the editor +/// @param obj the object to filter the events for +/// @param event the event to filter +bool TextEditorWidget::eventFilter(QObject *obj, QEvent *event) +{ + if (obj == editCompRef_) + { + if (event->type() == QEvent::FocusIn) + { + emit focusIn(this); + } + if (event->type() == QEvent::FocusOut) + { + emit focusOut(this); + } + } + return false; +} + +//================================================================================= +// protected slots +//================================================================================= + +/// Connects the vertical scrollbar so it updates the rendering viewport +void TextEditorWidget::connectVerticalScrollBar() +{ + connect(verticalScrollBar(), SIGNAL(valueChanged(int)), + SLOT(updateRendererViewport())); +} + +/// Connects the horizontal scrollbar so it updates the rendering viewport +void TextEditorWidget::connectHorizontalScrollBar() +{ + connect(horizontalScrollBar(), SIGNAL(valueChanged(int)), + SLOT(updateRendererViewport())); +} + +//================================================================================= +// public slots +//================================================================================= + +/// updates the given line so it will be repainted +/// @Param offset the offset of the line that needs repainting +void TextEditorWidget::updateLineAtOffset(int offset) +{ + editCompRef_->updateLineAtOffset(offset); + marginCompRef_->updateLineAtOffset(offset); +} + +/// updates the character before and at the given offset +/// @param offset the offset of the area to repaint. +/// @param width the width of the area to update (default is 8 pixels) +void TextEditorWidget::updateAreaAroundOffset(int offset, int width) +{ + editCompRef_->updateAreaAroundOffset(offset, width); + marginCompRef_->updateLineAtOffset(offset); +} + +/// This method repaints the given lines +/// @param line the line that updates the given line +/// @param length the number of lines to update. (default is 1 line) +void TextEditorWidget::updateLine(int line, int length) +{ + editCompRef_->updateLine(line, length); + marginCompRef_->updateLine(line, length); +} + +/// Calls update on all components +void TextEditorWidget::updateComponents() +{ + editCompRef_->update(); + marginCompRef_->update(); +} + +/// Updates the geometry for all components +void TextEditorWidget::updateGeometryComponents() +{ + // force size change (ugly) + textEditorComponent()->updateGeometry(); + + // when a geometry change is required recalculate all widgets + if (textMarginComponent()->isGeometryChangeRequired()) + { + scrollAreaRef_->layoutMarginWidgets(); + } +} + +/// Updates the renderer viewport. +void TextEditorWidget::updateRendererViewport() +{ + QRect rect(horizontalScrollBar()->value(), this->verticalScrollBar()->value(), + scrollAreaRef_->viewport()->width(), scrollAreaRef_->height()); + controller()->textRenderer()->setViewport(rect); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/texteditorwidget.h b/lib/edbee-lib/edbee/texteditorwidget.h new file mode 100644 index 00000000..9673e270 --- /dev/null +++ b/lib/edbee-lib/edbee/texteditorwidget.h @@ -0,0 +1,112 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +// #include <QAbstractScrollArea> +#include <QStringList> +#include <QWidget> + +class QResizeEvent; +class QScrollBar; + +namespace edbee +{ + +class TextDocument; +class TextEditorAutoCompleteComponent; +class TextEditorCommandMap; +class TextEditorComponent; +class TextEditorConfig; +class TextEditorController; +class TextEditorKeyMap; +class TextEditorScrollArea; +class TextMarginComponent; +class TextRenderer; +class TextSelection; + +/// This is the general edbee widget +/// The core functionality of this widget is divided in several separate +/// components. (TextEditorComponent: the main editor, TextMarginComponent: the +/// sidebar with line numbers) +class EDBEE_EXPORT TextEditorWidget : public QWidget +{ + Q_OBJECT +public: + explicit TextEditorWidget(QWidget *parent = 0); + virtual ~TextEditorWidget(); + + void scrollPositionVisible(int xPosIn, int yPosIn); + + // a whole bunch of getters + TextEditorController *controller() const; + TextEditorConfig *config() const; + TextEditorCommandMap *commandMap() const; + TextEditorKeyMap *keyMap() const; + TextDocument *textDocument() const; + TextRenderer *textRenderer() const; + TextSelection *textSelection() const; + TextEditorComponent *textEditorComponent() const; + TextMarginComponent *textMarginComponent() const; + TextEditorScrollArea *textScrollArea() const; + + void resetCaretTime(); + void fullUpdate(); + + QScrollBar *horizontalScrollBar() const; + QScrollBar *verticalScrollBar() const; + void setVerticalScrollBar(QScrollBar *scrollBar); + void setHorizontalScrollBar(QScrollBar *scrollBar); + int autoScrollMargin() const; + void setAutoScrollMargin(int amount = 50); + void setPlaceholderText(const QString &text); + + virtual bool readonly() const; + void setReadonly(bool readonly); + +protected: + virtual void resizeEvent(QResizeEvent *event); + bool eventFilter(QObject *obj, QEvent *event); + +signals: + void focusIn(QWidget *event); + void focusOut(QWidget *event); + + void verticalScrollBarChanged(QScrollBar *newScrollBar); + void horizontalScrollBarChanged(QScrollBar *newScrollBar); + +protected slots: + + void connectVerticalScrollBar(); + void connectHorizontalScrollBar(); + +public slots: + + void scrollTopToLine(int line); + virtual void updateLineAtOffset(int offset); + virtual void updateAreaAroundOffset(int offset, int width = 8); + virtual void updateLine(int line, int length = 1); + virtual void updateComponents(); + + virtual void updateGeometryComponents(); + + virtual void updateRendererViewport(); + +private: + TextEditorController *controller_; ///< This method returns the controller + + TextEditorScrollArea *scrollAreaRef_; ///< The scrollarea of the widget + TextEditorComponent *editCompRef_; ///< The editor ref + TextMarginComponent *marginCompRef_; ///< The margin components + TextEditorAutoCompleteComponent + *autoCompleteCompRef_; ///< The autocomplete list widget + + int autoScrollMargin_; ///< Customize the autoscroll margin + bool readonly_; ///< Readonly mode +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/cascadingqvariantmap.cpp b/lib/edbee-lib/edbee/util/cascadingqvariantmap.cpp new file mode 100644 index 00000000..72f2cdd6 --- /dev/null +++ b/lib/edbee-lib/edbee/util/cascadingqvariantmap.cpp @@ -0,0 +1,106 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "cascadingqvariantmap.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +CascadingQVariantMap::CascadingQVariantMap(edbee::CascadingQVariantMap *parent) + : parentRef_(parent) +{ +} + +/// This helper method deletes all containing parents recursively +/// Tough this doesnt' feel quite correct (it uses references to parent) it +/// makes managing the map a bit easier. +void CascadingQVariantMap::deleteParents() +{ + if (parentRef_) + { + parentRef_->deleteParents(); + delete parentRef_; + } +} + +/// Sets the variant mapt to the given map +void CascadingQVariantMap::setQVariantMap(const QVariantMap &map) +{ + map_ = map; +} + +/// This method finds the 'root variant map +CascadingQVariantMap *CascadingQVariantMap::root() +{ + CascadingQVariantMap *result = this; + while (result->parent()) + { + result = result->parent(); + } + return result; +} + +/// Returns the parent of this map +CascadingQVariantMap *CascadingQVariantMap::parent() const +{ + return parentRef_; +} + +/// Insert the given value at the current cascading level +/// @param key the name of the key to set +/// @param value the value to set +void CascadingQVariantMap::insert(const QString &key, const QVariant &value) +{ + map_.insert(key, value); +} + +/// Returns the value of the given key. If the map at this level doesn't have +/// this key, it cascades to a higher-level. If it doesn't find the key if will +/// fallback to the defValue supplied +/// @param key the name of the item to retrieve +/// @param defValue the default value when the item isn't found +const QVariant CascadingQVariantMap::value(const QString &key, + const QVariant &defValue) const +{ + if (map_.contains(key)) + { + return map_.value(key, defValue); + } + if (parentRef_) + { + return parentRef_->value(key, defValue); + } + return defValue; +} + +/// Method to quickly fetch a string item +const QString CascadingQVariantMap::stringValue(const QString &key, + const QString &defValue) const +{ + return value(key, defValue).toString(); +} + +/// Method to quickly fetch int items +int CascadingQVariantMap::intValue(const QString &key, int defValue) const +{ + return value(key, defValue).toInt(); +} + +/// Returns a double value +double CascadingQVariantMap::doubleValue(const QString &key, + double defValue) const +{ + return value(key, defValue).toDouble(); +} + +/// Returns the default boolean value +bool CascadingQVariantMap::boolValue(const QString &key, bool defValue) const +{ + return value(key, defValue).toBool(); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/cascadingqvariantmap.h b/lib/edbee-lib/edbee/util/cascadingqvariantmap.h new file mode 100644 index 00000000..c2949736 --- /dev/null +++ b/lib/edbee-lib/edbee/util/cascadingqvariantmap.h @@ -0,0 +1,44 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QVariantMap> + +namespace edbee +{ + +/// A cascading map is a Hierarchical QVariantMap. +/// +/// When retrieving an item, it fist tries to find the item at this level, if it +/// does't find the item it tries the parent item +class EDBEE_EXPORT CascadingQVariantMap +{ +public: + explicit CascadingQVariantMap(CascadingQVariantMap *parent = 0); + void deleteParents(); + + void setQVariantMap(const QVariantMap &map); + + CascadingQVariantMap *root(); + CascadingQVariantMap *parent() const; + void insert(const QString &key, const QVariant &value); + + const QVariant value(const QString &key, + const QVariant &defValue = QVariant()) const; + const QString stringValue(const QString &key, + const QString &defValue = QString()) const; + int intValue(const QString &key, int defValue = 0) const; + double doubleValue(const QString &key, double defValue = 0.0) const; + bool boolValue(const QString &key, bool defValue = false) const; + +private: + CascadingQVariantMap *parentRef_; ///< The parentmap + QVariantMap map_; ///< The cascading map with options +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/gapvector.h b/lib/edbee-lib/edbee/util/gapvector.h new file mode 100644 index 00000000..9d53118e --- /dev/null +++ b/lib/edbee-lib/edbee/util/gapvector.h @@ -0,0 +1,764 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QChar> +#include <QString> + +// #define GAP_VECTOR_CLEAR_GAP + +namespace edbee +{ + +/// This class is used to define a gap vector. A Gapvector is split in 2 parts. +/// where the gap is moved to the insertation/changing point. So reducing the +/// movement of fields +template<typename T> +class EDBEE_EXPORT GapVector +{ +public: + GapVector(int capacity = 16) + : items_(nullptr) + , capacity_(0) + , gapBegin_(0) + , gapEnd_(0) + { + items_ = new T[capacity]; + capacity_ = capacity; + gapBegin_ = 0; + gapEnd_ = capacity; + growSize_ = 16; + } + + ~GapVector() { delete[] items_; } + + /// returns the used length of the data + inline int length() const { return capacity_ - gapEnd_ + gapBegin_; } + inline int gapSize() const { return gapEnd_ - gapBegin_; } + inline int gapBegin() const { return gapBegin_; } + inline int gapEnd() const { return gapEnd_; } + inline int capacity() const { return capacity_; } + + /// clears the data + void clear() + { + delete[] items_; + capacity_ = 16; + items_ = new T[capacity_]; + gapBegin_ = 0; + gapEnd_ = capacity_; + growSize_ = 16; + } + +protected: + /// this method replaces the given text with the given data. + /// because the length of the source and target is the same in this method + /// no gap-moving is required + /// @param offset the target to move the data to + /// @param length the number of items to replace + /// @param data the data pointer with the source data + void replace(int offset, int length, const T *data) + { + // qlog_info() << "** replace: " << offset << "," << length << ": + // gapBegin:" << gapBegin(); + // copy the first part + if (offset < gapBegin()) + { + int len = qMin(gapBegin_ - offset, length); // issue 141, added -offset + // qlog_info() << "** A) len:"<<len; + memcpy(items_ + offset, data, sizeof(T) * len); + data += len; // increase the pointer + offset += len; + length -= len; + } + + if (0 < length) + { + // qlog_info() << "** B) + // offset:"<<offset+",gapSize:"<<gapSize()<<",length:"<<length; + memcpy(items_ + offset + gapSize(), data, sizeof(T) * length); + } + } + + /// this method replaces the given text with the given data. + /// because the length of the source and target is the same in this method + /// no gap-moving is required + /// @param offset the target to move the data to + /// @param length the number of items to replace + /// @param data the data pointer with the source data + void fill(int offset, int length, const T &data) + { + + // copy the first part + if (offset < gapBegin()) + { + int len = qMin(gapBegin_ - offset, length); + for (int i = 0; i < len; ++i) + { + items_[offset + i] = data; + } + offset += len; + length -= len; + } + + if (0 < length) + { + offset += gapSize(); + for (int i = 0; i < length; ++i) + { + items_[offset + i] = data; + } + } + } + +public: + /// this method replaces the given items + /// @param offset the offset of the items to replace + /// @param lenth the number of items to replace + /// @param data an array with new items + /// @param newLength the number of items in the new array + void replace(int offset, int length, const T *data, int newLength) + { + int currentLength = this->length(); + Q_ASSERT(0 <= offset && ((offset + length) <= currentLength)); + Q_UNUSED(currentLength); + // Q_ASSERT(data && "You probably mean fill :)" ); + + // if( debug ) { + // qlog_info() << "REPLACE: " << offset << length << newLength; + // } + int gapSize = this->gapSize(); + + // Is it a 'delete' or 'insert' or 'replace' operation + + // a replace operation (do not perform gap moving) + if (length == newLength) + { + replace(offset, length, data); + + // insert operation + } + else if (length < newLength) + { + int gapSizeRequired = newLength - length; + ensureGapSize(gapSizeRequired); + moveGapTo(offset + length); + memcpy(items_ + offset, data, sizeof(T) * newLength); + gapBegin_ = offset + newLength; + + // delete operation + } + else + { + moveGapTo(offset); + memcpy(items_ + offset, data, sizeof(T) * newLength); + gapBegin_ = offset + newLength; + gapEnd_ = offset + gapSize + length; + } + + Q_ASSERT(gapBegin_ <= gapEnd_); + Q_ASSERT(this->gapSize() <= capacity_); + Q_ASSERT(this->length() <= capacity_); + } + + /// this method replaces the given items with a single data item + /// @param offset the offset of the items to replace + /// @param lenth the number of items to replace + /// @param newLength the number of times to repeat data + void fill(int offset, int length, const T &data, int newLength) + { + int currentLength = this->length(); + Q_ASSERT(0 <= offset && ((offset + length) <= currentLength)); + Q_UNUSED(currentLength); + + int gapSize = this->gapSize(); + + // Is it a 'delete' or 'insert' or 'replace' operation + + // a replace operation (do not perform gap moving) + if (length == newLength) + { + fill(offset, length, data); + + // insert operation + } + else if (length < newLength) + { + int gapSizeRequired = newLength - length; + ensureGapSize(gapSizeRequired); + moveGapTo(offset + length); + for (int i = 0; i < newLength; ++i) + { + items_[offset + i] = data; + } + gapBegin_ = offset + newLength; + + // delete operation + } + else + { + moveGapTo(offset); + for (int i = 0; i < newLength; ++i) + { + items_[offset + i] = data; + } + gapBegin_ = offset + newLength; + gapEnd_ = offset + gapSize + length; + } + + Q_ASSERT(gapBegin_ <= gapEnd_); + Q_ASSERT(this->gapSize() <= capacity_); + Q_ASSERT(this->length() <= capacity_); + } + + /// convenient append method + void append(T t) { replace(length(), 0, &t, 1); } + + /// another append method + void append(const T *t, int length) { replace(this->length(), 0, t, length); } + + /// This method returns the item at the given index + T at(int offset) const + { + Q_ASSERT(0 <= offset && offset < length()); + if (offset < gapBegin_) + { + return items_[offset]; + } + else + { + return items_[gapEnd_ + offset - gapBegin_]; + } + } + + /// This method sets an item at the given index + void set(int offset, const T &value) + { + Q_ASSERT(0 <= offset && offset < length()); + if (offset < gapBegin_) + { + items_[offset] = value; + } + else + { + items_[gapEnd_ + offset - gapBegin_] = value; + } + } + + /// This method return an index + T &operator[](int offset) + { + Q_ASSERT(0 <= offset && offset < length()); + if (offset < gapBegin_) + { + return items_[offset]; + } + else + { + return items_[gapEnd_ + offset - gapBegin_]; + } + } + + /// This method returns the 'raw' element at the given location + /// This method does NOT take in account the gap + T &rawAt(int index) + { + Q_ASSERT(index < capacity_); + return items_[index]; + } + + /// This method copies the given range to the data pointer + void copyRange(QChar *data, int offset, int length) const + { + + // AB__CD" + // qlog_info() << "copyRange" << offset << length; + if (!length) + { + return; + } + Q_ASSERT(0 <= offset && offset < this->length()); + Q_ASSERT((offset + length) <= this->length()); + + // copy the first part + if (offset < gapBegin()) + { + int len = qMin(gapBegin_ - offset, length); + // qlog_info() << " - 1: memcpy: offset=" << offset << ", len=" << len << + // items_[offset]; + memcpy(data, items_ + offset, sizeof(T) * len); + data += len; // increase the pointer + offset += len; + length -= len; + } + + if (length > 0) + { + // qlog_info() << " - 2: memcpy: offset="<<offset << "gapSize=" << + // gapSize()<< ", length=" << length << items_[offset + gapSize()]; + memcpy(data, items_ + offset + gapSize(), sizeof(T) * length); + } + } + + /// This method returns a direct pointer to the 0-terminated buffer + /// This pointer is only valid as long as the buffer doesn't change + /// WARNING, this method MOVES the gap! Which means this method should NOT be + /// used for a lot of operations + T *data() + { + ensureGapSize(1); + moveGapTo(length()); + items_[length()] = QChar(); // a \0 character + return items_; + } + + //// moves the gap to the given position + //// Warning when the gap is moved after the length the gap shrinks + void moveGapTo(int offset) + { + Q_ASSERT(offset <= capacity_); + Q_ASSERT(offset <= length()); + if (offset != gapBegin_) + { + // qlog_info() << "BEGIN moveGapTo: offset=" << offset << "/ gapBegin_"; + // // << gapBegin_ << getUnitTestString(); + int gapSize = this->gapSize(); + + // move the the data right after the gap + if (offset < gapBegin_) + { + // qlog_info() << "- move" << offset << "," << gapBegin_ << + // "(charcount:" << (gapBegin_ - offset)<<")"; + memmove(items_ + offset + gapSize, items_ + offset, + sizeof(T) + * (gapBegin_ - offset)); // memmove( target, source, size ) + } + else + { + // qlog_info() << "- move2: gapBegin_" << gapBegin_ << ", gapEnd_" << + // gapEnd_ << ", capacity_" << capacity_ << ", gapSize" << gapSize << + // "(charcount:"<<(offset - gapBegin_)<<")"; + memmove(items_ + gapBegin_, items_ + gapEnd_, + sizeof(T) + * (offset - gapBegin_)); // memmove( target, source, size ) + } + gapBegin_ = offset; + gapEnd_ = gapBegin_ + gapSize; // qMin( gapBegin_ + gapSize, capacity_ ); + } + Q_ASSERT(gapBegin_ <= gapEnd_); + +#ifdef GAP_VECTOR_CLEAR_GAP + memset(items_ + gapBegin_, 0, sizeof(T) * (gapEnd_ - gapBegin_)); +#endif + } + + /// this method makes sure there's enough room for the insertation + void ensureGapSize(int requiredSize) + { + if (gapSize() < requiredSize) + { + while (growSize_ < capacity_ / 6) + { + growSize_ *= 2; + } + resize(capacity_ + requiredSize + growSize_ - gapSize()); + } + } + + /// resizes the array of data + void resize(int newSize) + { + if (capacity_ >= newSize) + return; + int lengte = length(); + Q_ASSERT(lengte <= capacity_); + /// TODO: optimize, so data is moved only once + /// in other words, gap movement is not required over here!! + /// this can be done with 2 memcopies + // qlog_info() << "BEGIN resize: capacity =" << capacity_<< " => " << + // newSize; + + moveGapTo(lengte); + T *newChars = new T[newSize]; + + if (capacity_ > 0) + { + memmove(newChars, items_, sizeof(T) * lengte); + delete[] items_; + } + items_ = newChars; + capacity_ = newSize; + gapEnd_ = newSize; + + // DEBUG gapsize +#ifdef GAP_VECTOR_CLEAR_GAP + memset(items_ + gapBegin_, 0, sizeof(T) * (gapEnd_ - gapBegin_)); +#endif + + // qlog_info() << "END resize"; + } + + /// sets the growsize. The growsize if the amount to reserve extra + void setGrowSize(int size) { growSize_ = size; } + + /// returns the growsize + int growSize() { return growSize_; } + + /// Converts the 'gap-buffer' to a unit-test debugging string + QString getUnitTestString(QChar gapChar = '_') const + { + QString s; + int gapBegin = this->gapBegin(); + int gapEnd = this->gapEnd(); + int capacity = this->capacity(); + + for (int i = 0; i < gapBegin; ++i) + { + if (items_[i].isNull()) + { + s.append("@"); + } + else + { + s.append(items_[i]); + } + } + s.append("["); + for (int i = gapBegin; i < gapEnd; ++i) + { + s.append(gapChar); + } + s.append(">"); + for (int i = gapEnd; i < capacity; ++i) + { + if (items_[i].isNull()) + { + s.append("@"); + } + else + { + s.append(items_[i]); + } + } + + return s; + } + + /// Converts the 'gap-buffer' to a unit-test debugging string + QString getUnitTestString2() const + { + QString s; + int gapBegin = this->gapBegin(); + int gapEnd = this->gapEnd(); + int capacity = this->capacity(); + + for (int i = 0; i < capacity; i++) + { + if (i) + { + s.append(","); + } + if (gapEnd == i) + s.append(">"); + s.append(QStringLiteral("%1").arg("X")); + if (gapBegin == i) + s.append("["); + } + return s; + } + +protected: + T *items_; ///< The item data + int capacity_; ///< The number of reserved bytes + int gapBegin_; ///< The start of the gap + int gapEnd_; ///< The end of the gap + int growSize_; ///< The size to grow extra +}; + +/// The character vecor to use +class EDBEE_EXPORT QCharGapVector : public GapVector<QChar> +{ +public: + QCharGapVector(int size = 16) + : GapVector<QChar>(size) + { + } + + /// initializes the vector with a given string + QCharGapVector(const QString &data, int gapSize) + : GapVector<QChar>(data.length() + gapSize) + { + memcpy(items_, data.constData(), sizeof(QChar) * data.length()); + gapBegin_ = data.length(); + gapEnd_ = capacity_; + } + + /// Initializes the gapvector + void init(const QString &data, int gapSize) + { + delete items_; + capacity_ = data.length() + gapSize; + items_ = new QChar[capacity_]; + memcpy(items_, data.constData(), sizeof(QChar) * data.length()); + gapBegin_ = data.length(); + gapEnd_ = capacity_; + growSize_ = 16; + } + + /// a convenient string replace function + void replaceString(int offset, int length, const QString &data) + { + + // qlog_info() << "replace(" << offset << length << data << ") : " << + // getUnitTestString().replace("\n","|"); + + replace(offset, length, data.constData(), data.length()); + + // qlog_info() << " ==> " << getUnitTestString().replace("\n","|"); + } + + /// a convenient method to retrieve a QString part + QString mid(int offset, int length) const + { + Q_ASSERT(length >= 0); + + // QString str( length, QChar() ); + // this->copyRange( str.data(), offset, length ); + + QChar *data = new QChar[length]; + copyRange(data, offset, length); + QString str(data, length); + delete[] data; + + // qlog_info() << "mid(" << offset << "," << length << ") => " << + // str.replace("\n","|") << " // " << + // getUnitTestString().replace("\n","|"); + return str; + } +}; + +/// A special GapVector class that isn't a gapvector. It forwards it's request +/// to a normal vector class (for debugging purposes) that isn't a gapv This +/// class is only used for debugging issuess with the gapvector +template<typename T> +class EDBEE_EXPORT NoGapVector +{ +public: + NoGapVector(int capacity = 16) { Q_UNUSED(capacity); } + + ~NoGapVector() {} + + /// returns the used length of the data + inline int length() const { return items_.size(); } + inline int gapSize() const { return 0; } + inline int gapBegin() const { return 0; } + inline int gapEnd() const { return 0; } + inline int capacity() const { return items_.capacity(); } + + /// clears the data + void clear() { items_.clear(); } + +public: + /// this method replaces the given items + /// @param offset the offset of the items to replace + /// @param lenth the number of items to replace + /// @param data an array with new items + /// @param newLength the number of items in the new array + void replace(int offset, int length, const T *data, int newLength) + { + items_.remove(offset, length); + for (int i = 0; i < newLength; i++) + { + items_.insert(offset + i, data[i]); + } + } + + /// this method replaces the given items with a single data item + /// @param offset the offset of the items to replace + /// @param lenth the number of items to replace + /// @param newLength the number of times to repeat data + void fill(int offset, int length, const T &data, int newLength) + { + items_.remove(offset, length); + for (int i = 0; i < newLength; i++) + { + items_.insert(offset + i, data); + } + } + + /// convenient append method + void append(T t) { items_.append(t); } + + /// another append method + void append(const T *t, int length) + { + for (int i = 0; i < length; i++) + { + items_.append(t[i]); + } + } + + /// This method returns the item at the given index + T at(int offset) const { return items_.at(offset); } + + /// This method sets an item at the given index + void set(int offset, const T &value) { items_.replace(offset, value); } + + /// This method return an index + T &operator[](int offset) { return items_[offset]; } + + /* + /// This method copies the given range to the data pointer + void copyRange( QChar* data, int offset, int length ) const { + + //AB__CD" + //qlog_info() << "copyRange" << offset << length; + if( !length ) { return; } + Q_ASSERT( 0 <= offset && offset < this->length() ); + Q_ASSERT( (offset+length) <= this->length() ); + + // copy the first part + if( offset < gapBegin() ) { + int len = qMin( gapBegin_-offset, length ); + //qlog_info() << " - 1: memcpy: offset=" << offset << ", len=" << len << + items_[offset]; memcpy( data, items_ + offset, sizeof(T)*len ); data += + len; // increase the pointer offset += len; length -= len; + } + + if( length > 0 ) { + //qlog_info() << " - 2: memcpy: offset="<<offset << "gapSize=" << + gapSize()<< ", length=" << length << items_[offset + gapSize()]; memcpy( data, + items_ + offset + gapSize(), sizeof(T)*length ); + } + } + */ + + /// This method returns a direct pointer to the 0-terminated buffer + /// This pointer is only valid as long as the buffer doesn't change + /// WARNING, this method MOVES the gap! Which means this method should NOT be + /// used for a lot of operations + /* + T* data() { + ensureGapSize(1); + moveGapTo( length() ); + items_[length()] = QChar(); // a \0 character + return items_; + } + */ + + //// moves the gap to the given position + //// Warning when the gap is moved after the length the gap shrinks + /* + void moveGapTo( int offset ) { + Q_ASSERT( offset <= capacity_); + Q_ASSERT( offset <= length() ); + if( offset != gapBegin_ ) { + //qlog_info() << "BEGIN moveGapTo: offset=" << offset << "/ gapBegin_"; // << + gapBegin_ << getUnitTestString(); int gapSize = this->gapSize(); + + // move the the data right after the gap + if (offset < gapBegin_ ) { + //qlog_info() << "- move" << offset << "," << gapBegin_ << "(charcount:" << + (gapBegin_ - offset)<<")"; memmove( items_ + offset + gapSize, items_ + + offset, sizeof(T) * (gapBegin_ - offset)); // memmove( target, source, size + ) + + } else { + //qlog_info() << "- move2: gapBegin_" << gapBegin_ << ", gapEnd_" << gapEnd_ + << ", capacity_" << capacity_ << ", gapSize" << gapSize << + "(charcount:"<<(offset - gapBegin_)<<")"; memmove( items_ + gapBegin_, items_ + + gapEnd_, sizeof(T) * (offset - gapBegin_ )); // memmove( target, source, + size ) + } + gapBegin_ = offset; + gapEnd_ = gapBegin_ + gapSize; //qMin( gapBegin_ + gapSize, + capacity_ ); + } + Q_ASSERT( gapBegin_ <= gapEnd_ ); + + } + + + /// this method makes sure there's enough room for the insertation + void ensureGapSize( int requiredSize ) { + if( gapSize() < requiredSize ) { + while( growSize_ < capacity_ / 6) { growSize_ *= 2; } + resize(capacity_ + requiredSize + growSize_ - gapSize() ); + } + } + + + /// resizes the array of data + void resize(int newSize) + { + if( capacity_ >= newSize) return; + int lengte = length(); + Q_ASSERT( lengte <= capacity_); + /// TODO: optimize, so data is moved only once + /// in other words, gap movement is not required over here!! + /// this can be done with 2 memcopies + //qlog_info() << "BEGIN resize: capacity =" << capacity_<< " => " << newSize; + + + moveGapTo( lengte ); + T *newChars = new T[ newSize ]; + + if( capacity_ > 0 ) { + memmove( newChars, items_, sizeof(T)*lengte ); + delete[] items_; + } + items_ = newChars; + capacity_ = newSize; + gapEnd_ = newSize; + //qlog_info() << "END resize"; + } + + + /// sets the growsize. The growsize if the amount to reserve extra + void setGrowSize( int size ) { growSize_=size; } + + /// returns the growsize + int growSize() { return growSize_; } + + + /// Converts the 'gap-buffer' to a unit-test debugging string + QString getUnitTestString( QChar gapChar = '_' ) const { + QString s; + int gapBegin = this->gapBegin(); + int gapEnd = this->gapEnd(); + int capacity = this->capacity(); + + for( int i=0; i<gapBegin; ++i ) { + if( items_[i].isNull() ) { + s.append("@"); + } else { + s.append( items_[i] ); + } + } + s.append( "[" ); + for( int i=gapBegin; i<gapEnd; ++i ) { + s.append( gapChar ); + } + s.append( ">" ); + for( int i=gapEnd; i<capacity; ++i ) { + if( items_[i].isNull() ) { + s.append("@"); + } else { + s.append( items_[i] ); + } + } + + return s; + } + */ + +protected: + QVector<T> items_; +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/lineending.cpp b/lib/edbee-lib/edbee/util/lineending.cpp new file mode 100644 index 00000000..059042c9 --- /dev/null +++ b/lib/edbee-lib/edbee/util/lineending.cpp @@ -0,0 +1,122 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include <QString> +#include "lineending.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// This method returns the line endings +/// @param type the type to retrieve +LineEnding *LineEnding::types() +{ + static LineEnding types[] = { + LineEnding(LineEnding::UnixType, "\n", "\\n", "Unix"), + LineEnding(LineEnding::WindowsType, "\r\n", "\\r\\n", "Windows"), + LineEnding(LineEnding::MacClassicType, "\r", "\\r", "Mac Classic"), + }; + return types; +} + +/// This methode returns the line ending from the given type +LineEnding *LineEnding::get(int idx) +{ + Q_ASSERT(0 <= idx && idx < TypeCount); + return types() + idx; +} + +/// Returns the unix line ending type +LineEnding *LineEnding::unixType() +{ + return get(UnixType); +} + +// returns the windows line ending type +LineEnding *LineEnding::windowsType() +{ + return get(WindowsType); +} + +/// Returns the Mac class line ending type +LineEnding *LineEnding::macClassicType() +{ + return get(MacClassicType); +} + +/// Constructs a line ending type +/// @param type the type enum constant +/// @param chars the chars used for the line ending +/// @param escaped an escaped variant of the characters +/// @param name the name of the line ending +LineEnding::LineEnding(LineEnding::Type type, const char *chars, + const char *escaped, const char *name) + : type_(type) + , charsRef_(chars) + , escapedCharsRef_(escaped) + , nameRef_(name) +{ +} + +LineEnding::~LineEnding() {} + +/// This method detects the, line endings of a QString. +/// A byte array is tricky because the encoding could be multi-byte +/// +/// @param str the string to find the line-endings. +/// @param unknown the type to return when the ending is not nown. (defaults to +/// 0) +/// @return the found type or the unkown parameter if not found +/// +LineEnding *LineEnding::detect(const QString &str, LineEnding *unkown) +{ + const int endLoopWhenCountReaches = 3; + int macClassicCount = 0; + int unixCount = 0; + int winCount = 0; + + for (int i = 0, cnt = str.length(); i < cnt; i++) + { + + // retrieve the characters + QChar c1 = str.at(i); + QChar c2 = (i + 1 < cnt) ? str.at(i + 1) : QChar(0); + + // detect the line-ending + if (c1 == '\r') + { + if (c2 == '\n') + { + ++winCount; + ++i; + if (winCount >= endLoopWhenCountReaches) + break; + } + else + { + ++macClassicCount; + if (macClassicCount >= endLoopWhenCountReaches) + break; + } + } + else if (c1 == '\n') + { + ++unixCount; + if (unixCount >= endLoopWhenCountReaches) + break; + } + } + if (macClassicCount > unixCount && macClassicCount > winCount) + return get(LineEnding::MacClassicType); + if (winCount > unixCount) + return get(LineEnding::WindowsType); + if (unixCount > 0) + return get(LineEnding::UnixType); + return unkown; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/lineending.h b/lib/edbee-lib/edbee/util/lineending.h new file mode 100644 index 00000000..4cf7c947 --- /dev/null +++ b/lib/edbee-lib/edbee/util/lineending.h @@ -0,0 +1,63 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +namespace edbee +{ + +/// A special class to perform line-ending detection +class EDBEE_EXPORT LineEnding +{ +public: + enum Type + { + UnixType = 0, + WindowsType = 1, + MacClassicType = 2, + TypeCount + }; + +protected: + explicit LineEnding(LineEnding::Type ending, const char *chars, + const char *escaped_chars, const char *name); + virtual ~LineEnding(); + +public: + static LineEnding *types(); + static int typeCount() { return TypeCount; } + static LineEnding *get(int idx); + + static LineEnding *unixType(); + static LineEnding *windowsType(); + static LineEnding *macClassicType(); + + static LineEnding *detect(const QString &str, LineEnding *unkownEnding = 0); + + /// This method returns the type + virtual LineEnding::Type type() const { return type_; } + + /// This method returns the chars + virtual const char *chars() const { return charsRef_; } + + /// This method returns the escaped chars + virtual const char *escapedChars() const { return escapedCharsRef_; } + + /// This method returns the name of the line ending + virtual const char *name() const { return nameRef_; } + + // virtual LineEnding detectLineEnding + // virtual static QString lineEndingChars( LineEnding::Type endingType ); + +private: + LineEnding::Type type_; ///< The type of the line ending + const char *charsRef_; ///< The characters reference + const char *escapedCharsRef_; ///< The textual display of the chars + const char *nameRef_; ///< The name of these line ending +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/lineoffsetvector.cpp b/lib/edbee-lib/edbee/util/lineoffsetvector.cpp new file mode 100644 index 00000000..84992759 --- /dev/null +++ b/lib/edbee-lib/edbee/util/lineoffsetvector.cpp @@ -0,0 +1,336 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "lineoffsetvector.h" + +#include "edbee/models/textbuffer.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +LineOffsetVector::LineOffsetVector() + : offsetList_(16) + , offsetDelta_(0) + , offsetDeltaIndex_(0) +{ + int v = 0; + offsetList_.replace(0, 0, &v, 1); +} + +void LineOffsetVector::applyChange(TextBufferChange change) +{ + // qlog_info() << "== [ applyChange ] ================="; + + int line = change.line() + 1; // line 0 may NEVER be replaced! + + // repace the lines + moveDeltaToIndex(line); + + // QString offsets; + // for( int i=0; i<change.newLineOffsets().size(); ++i ) { + // if( i ) { offsets.append(","); } + // offsets.append( + // QStringLiteral("%1").arg(change.newLineOffsets().at(i))); + // //qlog_info() << "-- " << i << ":" << change.newLineOffsets().at(i); + // } + + // qlog_info() << "- before: " << toUnitTestString() ; + // qlog_info() << "- offsetList_.replace(" << change.line() << "," << + // change.lineCount() << ": " << offsets << ")"; + offsetList_.replace(line, change.lineCount(), + change.newLineOffsets().constData(), + change.newLineCount()); + // qlog_info() << "- after: " << toUnitTestString(); + + // Add the delta to all the lines + int endLine = line + change.newLineCount(); + + if (offsetDeltaIndex_ < endLine) + { + offsetDeltaIndex_ = endLine; + } + + Q_ASSERT(offsetDeltaIndex_ >= 0); + Q_ASSERT(offsetDeltaIndex_ <= this->length()); + + // qlog_info() <<"- offsetDeltaindex:" << offsetDeltaIndex_; + + changeOffsetDelta(endLine, change.newTextLength() - change.length()); + // qlog_info() << "end: " << toUnitTestString(); + // Q_ASSERT(this->length() !=5 ); +} + +/* +/// This method is should be called when text is replaced. This method +/// updates all elements of the split vector and calculates all offsets +/// @param offset the offset to change +/// @param length the number of chars that are replaced +/// @param text the new text +void LineOffsetVector::textReplaced(int offset, int length, const QChar *newData +, int newDataLength) +{ + LineChange change; + prepareChange(offset,length, newData, newDataLength, &change); + applyChange( &change ); + +} +*/ + +/// this method returns the line offset at the given line offset +int LineOffsetVector::at(int idx) const +{ + Q_ASSERT(idx < length()); + if (idx >= offsetDeltaIndex_) + { + return offsetList_.at(idx) + offsetDelta_; + } + return offsetList_.at(idx); +} + +int LineOffsetVector::length() const +{ + return offsetList_.length(); +} + +/// this method searches the line from the given offset +int LineOffsetVector::findLineFromOffset(int offset) +{ + + if (offset == 0) + return 0; + int offsetListLength = offsetList_.length(); + int offsetAtDelta = 0; + if (offsetDeltaIndex_ < offsetListLength) + { + offsetAtDelta = offsetList_.at(offsetDeltaIndex_) + offsetDelta_; + } + else + { + offsetAtDelta = offsetList_.at(offsetListLength - 1); + } + + // only binary search the left part + int line = 0; + if (offset < offsetAtDelta) + { + line = searchOffsetIgnoringOffsetDelta(offset, 0, offsetDeltaIndex_); + + // binary search the right part + } + else + { + line = searchOffsetIgnoringOffsetDelta(offset - offsetDelta_, + offsetDeltaIndex_, offsetListLength); + } + return line; +} + +/// This method appends an offset to the end of the list +/// It simply applies the current offsetDelta because it will always be AFTER +/// the current offsetDelta +void LineOffsetVector::appendOffset(int offset) +{ + this->offsetList_.append(offset - offsetDelta_); +} + +/// This method returns the offset to string +QString LineOffsetVector::toUnitTestString() +{ + QString s; + for (int i = 0, cnt = offsetDeltaIndex_; i < cnt; ++i) + { + if (i != 0) + { + s.append(","); + } + s.append(QStringLiteral("%1").arg(offsetList_[i])); + } + s.append(QStringLiteral("[%1>").arg(offsetDelta_)); + for (int i = offsetDeltaIndex_, cnt = offsetList_.length(); i < cnt; ++i) + { + if (i != offsetDeltaIndex_) + { + s.append(","); + } + s.append(QStringLiteral("%1").arg(offsetList_[i])); + } + return s; +} + +/// initializes the construct for unit testing +/// @param offsetDelta the offsetDelta to use +/// @param offsetDeltaIndex the offsetDeltaIndex to use +/// @param a list of integer offsets. Close the list with -1 !!! +void LineOffsetVector::initForUnitTesting(int offsetDelta, int offsetDeltaIndex, + ...) +{ + offsetDelta_ = offsetDelta; + offsetDeltaIndex_ = offsetDeltaIndex; + offsetList_.clear(); + + va_list offsets; + va_start(offsets, offsetDeltaIndex); + int val = va_arg(offsets, int); + while (val >= 0) + { + offsetList_.append(val); + val = va_arg(offsets, int); + } + va_end(offsets); +} + +/// This method returns the line from the start position. This method uses +/// a binary search. Warning this method uses RAW values from the offsetList it +/// does NOT take in account the offsetDelta +int LineOffsetVector::searchOffsetIgnoringOffsetDelta(int offset, int org_start, + int org_end) +{ + // const QList<int>& starts = lineOffsets_; + // This search happens in binary below + // + // for( int i=0; i < starts.length(); ++i ) { + // if( starts[i] > offset ) return i-1; + // } + // return starts.length() - 1; + + // int org_start = 0; + // int org_end = starts.length(); + + int begin = org_start; + int end = org_end - 1; + + if (begin == end) + return begin; + + int half = end; + int r = 0; + while (begin <= end) + { + + // BINAIRY SEARCH: + half = begin + ((end - begin) >> 1); + + // compre the value + r = offsetList_.at(half) - offset; + if (r == 0) + { + return half; + } + if (r < 0) + { + begin = half + 1; + } + else + { + end = half - 1; + } + } + + if (r > 0) + { + return half - 1; + } + else + { + if (half == org_end) + return org_end - 1; + return half; + } +} + +/// This method moves the delta to the given index +void LineOffsetVector::moveDeltaToIndex(int index) +{ + if (offsetDelta_) + { + + // move to the right + if (offsetDeltaIndex_ < index) + { + for (int i = offsetDeltaIndex_; i < index; ++i) + { + offsetList_[i] += offsetDelta_; // apply the delta + } + // move to the left + } + else if (index < offsetDeltaIndex_) + { + + // In this situation there are 2 solution. + // (1) Make the delta 0 or (2) apply the 'negative index' to the items on + // the left + int length = offsetList_.length(); + int delta0cost = length - offsetDeltaIndex_; + int negativeDeltaCost = offsetDeltaIndex_ - index; + + // prefer delta 0 + if (delta0cost <= negativeDeltaCost) + { + for (int i = offsetDeltaIndex_; i < length; ++i) + { + offsetList_[i] += offsetDelta_; + } + offsetDelta_ = 0; + // else apply the negative delta + } + else + { + for (int i = index; i < offsetDeltaIndex_; ++i) + { + offsetList_[i] -= offsetDelta_; + } + } + } + } + offsetDeltaIndex_ = index; +} + +/// This method moves the offset delta to the given location +void LineOffsetVector::changeOffsetDelta(int index, int delta) +{ + // there are 3 situations. + // (1) The delta is at the exact location of the previous delta + if (index == offsetDeltaIndex_) + { + offsetDeltaIndex_ = index; + offsetDelta_ += delta; + + // (2) The new index is BEFORE the old index. + } + else if (index < offsetDeltaIndex_) + { + + // apply the 'negative' offset to the given location + for (int i = index; i < offsetDeltaIndex_; ++i) + { + offsetList_[i] -= (offsetDelta_ + delta); + } + offsetDeltaIndex_ = index; + offsetDelta_ += delta; + + // (3) the index is after the old index. + } + else if (offsetDeltaIndex_ < index) + { + + // apply the old offsetsDelta to the indices before + for (int i = offsetDeltaIndex_; i < index; ++i) + { + offsetList_[i] += offsetDelta_; + } + offsetDeltaIndex_ = index; + offsetDelta_ += delta; + } + + // set the delta to 0 when at the end of the line + if (offsetDeltaIndex_ == length()) + { + offsetDelta_ = 0; + } +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/lineoffsetvector.h b/lib/edbee-lib/edbee/util/lineoffsetvector.h new file mode 100644 index 00000000..4be4d103 --- /dev/null +++ b/lib/edbee-lib/edbee/util/lineoffsetvector.h @@ -0,0 +1,76 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QVector> + +#include "gapvector.h" + +namespace edbee +{ + +class TextBufferChange; + +/// This class implements the vector for storing the line numbers at certain +/// offsets/ The class allows the 'gap' position to contain a delta offset. +/// Which means that +/// +/// all offsets after the gap are increased with the offsetDelta when searched. +/// Inserting/deleting text this way usually only results in the changine of the +/// offset delta. Which means speeeed +/// +/// The line offset pointed at by each index is the first character in the given +/// line. +class EDBEE_EXPORT LineOffsetVector +{ +public: + /// a structure to describe the line change that happend + // struct LineChange { + // int line; ///< the first line that's going to be + // replaced int lineCount; ///< the number of lines that + // are replaced int newLineCount; ///< the number of lines + // added/removed int offsetDelta; ///< the change in offset + // QVector<int> newOffsets; ///< the new offsets + // }; + + LineOffsetVector(); + + void applyChange(TextBufferChange change); + + int at(int idx) const; + int length() const; + + int findLineFromOffset(int offset); + + int offsetDelta() { return offsetDelta_; } + int offsetDeltaIndex() { return offsetDeltaIndex_; } + + void appendOffset(int offset); + + /// TODO: temporary method (remove) + GapVector<int> offsetList() { return offsetList_; } + +protected: + int searchOffsetIgnoringOffsetDelta(int offset, int org_start, int org_end); + + void moveDeltaToIndex(int index); + void changeOffsetDelta(int index, int delta); + +public: + QString toUnitTestString(); + void initForUnitTesting(int offsetDelta, int offsetDeltaIndex, ...); + +private: + GapVector<int> offsetList_; ///< All offsets + int offsetDelta_; ///< The offset delta at the given offset index + int offsetDeltaIndex_; ///< The index that contains the offset delta + + friend class LineOffsetVectorTest; +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/logging.h b/lib/edbee-lib/edbee/util/logging.h new file mode 100644 index 00000000..92f6dc02 --- /dev/null +++ b/lib/edbee-lib/edbee/util/logging.h @@ -0,0 +1,76 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include <QFileInfo> +#include "vendor/qslog/QsLog.h" + +#define qlog_trace() \ + if (QsLogging::Logger::instance().loggingLevel() > QsLogging::TraceLevel) \ + { \ + } \ + else \ + QsLogging::Logger::Helper(QsLogging::TraceLevel).stream() \ + << QFileInfo(__FILE__).fileName() << '@' << __LINE__ +#define qlog_debug() \ + if (QsLogging::Logger::instance().loggingLevel() > QsLogging::DebugLevel) \ + { \ + } \ + else \ + QsLogging::Logger::Helper(QsLogging::DebugLevel).stream() \ + << QFileInfo(__FILE__).fileName() << '@' << __LINE__ +#define qlog_info() \ + if (QsLogging::Logger::instance().loggingLevel() > QsLogging::InfoLevel) \ + { \ + } \ + else \ + QsLogging::Logger::Helper(QsLogging::InfoLevel).stream() \ + << QFileInfo(__FILE__).fileName() << '@' << __LINE__ +#define qlog_warn() \ + if (QsLogging::Logger::instance().loggingLevel() > QsLogging::WarnLevel) \ + { \ + } \ + else \ + QsLogging::Logger::Helper(QsLogging::WarnLevel).stream() \ + << QFileInfo(__FILE__).fileName() << '@' << __LINE__ +#define qlog_error() \ + if (QsLogging::Logger::instance().loggingLevel() > QsLogging::ErrorLevel) \ + { \ + } \ + else \ + QsLogging::Logger::Helper(QsLogging::ErrorLevel).stream() \ + << QFileInfo(__FILE__).fileName() << '@' << __LINE__ +#define qlog_fatal() \ + QsLogging::Logger::Helper(QsLogging::FatalLevel).stream() \ + << QFileInfo(__FILE__).fileName() << '@' << __LINE__ + +/* +#define qlog_trace() \ + if( QsLogging::Logger::instance().loggingLevel() > QsLogging::TraceLevel ){} +\ else QsLogging::Logger::Helper(QsLogging::TraceLevel).stream() << __FILE__ << +'@' << __LINE__ +#define qlog_debug() \ + if( QsLogging::Logger::instance().loggingLevel() > QsLogging::DebugLevel ){} +\ else QsLogging::Logger::Helper(QsLogging::DebugLevel).stream() << __FILE__ << +'@' << __LINE__ +#define qlog_info() \ + if( QsLogging::Logger::instance().loggingLevel() > QsLogging::InfoLevel ){} +\ else QsLogging::Logger::Helper(QsLogging::InfoLevel).stream() << __FILE__ << +'@' << __LINE__ +#define qlog_warn() \ + if( QsLogging::Logger::instance().loggingLevel() > QsLogging::WarnLevel ){} +\ else QsLogging::Logger::Helper(QsLogging::WarnLevel).stream() << __FILE__ << +'@' << __LINE__ +#define qlog_error() \ + if( QsLogging::Logger::instance().loggingLevel() > QsLogging::ErrorLevel ){} +\ else QsLogging::Logger::Helper(QsLogging::ErrorLevel).stream() << __FILE__ << +'@' << __LINE__ +#define qlog_fatal() \ + QsLogging::Logger::Helper(QsLogging::FatalLevel).stream() << __FILE__ << '@' +<< __LINE__ +*/ + +#define qlog() QsLogging::Logger::Helper(QsLogging::InfoLevel).stream() diff --git a/lib/edbee-lib/edbee/util/mem/debug_allocs.cpp b/lib/edbee-lib/edbee/util/mem/debug_allocs.cpp new file mode 100644 index 00000000..b0861160 --- /dev/null +++ b/lib/edbee-lib/edbee/util/mem/debug_allocs.cpp @@ -0,0 +1,165 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include <QString> +#include <QMutex> + +#include <stdlib.h> +#include <stdio.h> +#include <cstdlib> + +#include "debug_allocs.h" + +namespace edbee +{ + +/// The global memory leak object +static DebugAllocationList allocationList; + +/// returns the allocation list instance +DebugAllocationList *DebugAllocationList::instance() +{ + return &allocationList; +} + +/// cnostructs the allocation list +DebugAllocationList::DebugAllocationList() + : allocationList_() + , mutex_(0) + , running_(false) + , started_(false) +{ +#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0)) + mutex_ = new EdbeeRecursiveMutex(QMutex::Recursive); +#else + mutex_ = new EdbeeRecursiveMutex(); +#endif + start(false); + checkDelete_ = false; +} + +/// The allocation list destructor +DebugAllocationList::~DebugAllocationList() +{ + stop(); // check last memory leak + // delete mutex_; // < do not delete keep memory leak :S. When deleting this + // mutex app shutdown crashes + mutex_ = 0; + clear(); +} + +/// clears the debugging allocation list +void DebugAllocationList::clear() +{ + // iterate over the map's (key,val) pairs as usual + for (std::map<void *, DebugAllocation *>::iterator iter + = allocationList_.begin(); + iter != allocationList_.end(); ++iter) + { + std::free(iter->second); + } + + allocationList_.clear(); +} + +/// Returns the mutex for thread-safety +EdbeeRecursiveMutex *DebugAllocationList::mutex() +{ + return mutex_; +} + +/// Starts the monitoring of allocations +/// @param checkDelete should the delete operation be checked? +void DebugAllocationList::start(bool checkDelete) +{ + clear(); + checkDelete_ = checkDelete; + running_ = true; + started_ = true; +} + +/// Stops the monitoring of allocations +int DebugAllocationList::stop() +{ + started_ = false; + running_ = false; + checkDelete_ = false; + int res = 0; + + for (std::map<void *, DebugAllocation *>::iterator iter + = allocationList_.begin(); + iter != allocationList_.end(); ++iter) + { + DebugAllocation *info = iter->second; + if (info && info->pointer) + { + printf("Memory leak %p(%u) %s:%d\n", info->pointer, + (unsigned int)info->size, info->file, info->line); + res++; + } + } + + if (!res) + { + // printf("memory ok :-D\n"); + } + + return res; +} + +/// Finds the given pointer int the allocation list +/// @param p the pointer to search +/// @return the allocation object +DebugAllocation *DebugAllocationList::find(void *p) +{ + std::map<void *, DebugAllocation *>::iterator itr = allocationList_.find(p); + if (itr != allocationList_.end()) + return itr->second; + return 0; +} + +/// Adds the given pointer to the allocation list +/// @param p pointer +/// @param size the size of the pointer +/// @param file the source file of the allocation +/// @param line the line number of the allocation +DebugAllocation *DebugAllocationList::add(void *p, size_t size, char *file, + int line) +{ + DebugAllocation *info + = (DebugAllocation *)std::malloc(sizeof(DebugAllocation)); + info->clear(); + info->pointer = p; + info->size = size; + info->file = file; + info->line = line; + allocationList_[p] = info; + return info; +} + +/// removes the given pointer from the allocation list +/// @param p the pointer +bool DebugAllocationList::del(void *p) +{ + std::map<void *, DebugAllocation *>::iterator iter = allocationList_.find(p); + + if (iter != allocationList_.end()) + { + DebugAllocation *mi = iter->second; // take(p); + allocationList_.erase(iter); + if (!mi) + return false; + std::free(mi); + } + return true; +} + +/// returns the state of checkdelete +bool DebugAllocationList::checkDelete() +{ + return checkDelete_; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/mem/debug_allocs.h b/lib/edbee-lib/edbee/util/mem/debug_allocs.h new file mode 100644 index 00000000..1ba23032 --- /dev/null +++ b/lib/edbee-lib/edbee/util/mem/debug_allocs.h @@ -0,0 +1,94 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +/// Cross Platform Memory Leak Detection. +/// Original source from: http://www.gilgil.net by Gilbert Lee. All rights +/// reserved Altered to use QT API +#pragma once + +#include "edbee/exports.h" + +#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0)) +# define EdbeeRecursiveMutex QMutex +#else +# define EdbeeRecursiveMutex QRecursiveMutex +#endif + +class EdbeeRecursiveMutex; + +// #if !defined(__APPLE__) +// #include <malloc> +// #endif +#include <cstring> // for size_t +#include <map> + +namespace edbee +{ + +/// This structure is used to 'remember' what is allocated at which place +struct DebugAllocation +{ + void *pointer; + std::size_t size; + char *file; + int line; + // MemoryLeakInfo() : p(0), size(0), file(0), line(0) {} + // MemoryLeakInfo( void *p1, std::size_t size1, char *file1, int line1) : + // p(p1), size(size1), file(file1), line(line1) {} + void clear() + { + pointer = 0; + size = 0; + file = 0; + line = 0; + } +}; + +/// This class is used to remember all memory leakds +class EDBEE_EXPORT DebugAllocationList +{ +public: + DebugAllocationList(); + virtual ~DebugAllocationList(); + + void clear(); + size_t size() { return allocationList_.size(); } + inline bool isRunning() { return running_; } + + void pause(bool val) + { + if (started_) + { + running_ = !val; + } + } + + EdbeeRecursiveMutex *mutex(); + +public: + void start(bool checkDelete); + int stop(); + + DebugAllocation *find(void *p); + DebugAllocation *add(void *p, size_t size, char *file, int line); + bool del(void *p); + + bool checkDelete(); + +public: + static DebugAllocationList *instance(); + +private: + std::map<void *, DebugAllocation *> allocationList_; ///< The allocation + bool checkDelete_; ///< Should we check for invalid deletes? + EdbeeRecursiveMutex *mutex_; ///< The current mutext + bool running_; ///< A we 'recording' + bool started_; ///< Paused? + + friend void *debug_malloc(size_t size, const char *file, const int line); + friend void debug_free(void *p, const char *file, const int line); +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/mem/debug_new.cpp b/lib/edbee-lib/edbee/util/mem/debug_new.cpp new file mode 100644 index 00000000..b5b398f7 --- /dev/null +++ b/lib/edbee-lib/edbee/util/mem/debug_new.cpp @@ -0,0 +1,135 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include <QMutexLocker> +#include <QMutex> + +#include "debug_allocs.h" + +#include <stdlib.h> +#include <stdio.h> + +#ifdef HAVE_MALLOC_H +# include <malloc.h> +#endif + +#if defined(EDBEE_DEBUG) +# define debug_new_log // printf + +/// Logs a malloc operation +/// @param size the size of reseved bytes +/// @param file the file of the malloc +/// @param line the line number of the allocation +void *debug_malloc(size_t size, const char *file, const int line) +{ + edbee::DebugAllocationList *allocList + = edbee::DebugAllocationList::instance(); + QMutexLocker lock(allocList->mutex()); + + void *p = ::malloc(size); + if (allocList->isRunning()) + { + edbee::DebugAllocation *info = allocList->find(p); + if (info != nullptr) + { + printf("already exist %p %s %d\n", p, file, line); + printf("existing info : %p(%u) %s:%d\n", info->pointer, + static_cast<unsigned int>(info->size), info->file, info->line); + ::free(p); + return nullptr; + } + info = allocList->add(p, size, const_cast<char *>(file), + static_cast<int>(line)); + if (info == nullptr) + { + printf("can not add %p(%u) %s:%d\n", p, static_cast<unsigned int>(size), + file, line); + ::free(p); + return nullptr; + } + } + return p; +} + +/// frees the given pointer +/// @param p the pointer to free +/// @param file the file which call originated from +/// @param line the linenumber of the delete +void debug_free(void *p, const char *file, const int line) +{ + edbee::DebugAllocationList *allocList + = edbee::DebugAllocationList::instance(); + QMutexLocker lock(allocList->mutex()); + + if (allocList->isRunning()) + { + if (!allocList->del(p)) + { + // TODO: This doesn't work very good. It sees to many free that are NOT + // allocated by us + if (allocList->checkDelete()) + { + printf("can not del %p %s:%d\n", p, file, line); + } + } + } + ::free(p); +} + +/// the new operator +void *operator new(size_t size, const char *file, const int line) +{ + void *p = debug_malloc(size, file, line); + return p; +} + +/// th delete operator +void operator delete(void *p, const char *file, const int line) +{ + operator delete(p); + debug_free(p, file, line); +} + +/// the delete operator +void operator delete(void *p) throw() +{ + return debug_free(p, "unknown", 0); +} + +/// the new array operator +void *operator new[](size_t size, const char *file, const int line) +{ + void *p = debug_malloc(size, file, line); + return p; +} + +/// the delete array operator +void operator delete[](void *p, const char *file, const int line) +{ + // delete[] p; << This is strange!! + return debug_free(p, file, line); +} + +/// the delete array operator +void operator delete[](void *p) throw() +{ + return debug_free(p, "unknown", 0); +} +#endif + +namespace edbee +{ + +/// pauses the memoryleak detection +void pause_memleak_detection(bool value) +{ +#ifdef EDBEE_DEBUG_NEW_ACTIVE + DebugAllocationList::instance()->pause(value); +#else + Q_UNUSED(value) +#endif +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/mem/debug_new.h b/lib/edbee-lib/edbee/util/mem/debug_new.h new file mode 100644 index 00000000..8e12446d --- /dev/null +++ b/lib/edbee-lib/edbee/util/mem/debug_new.h @@ -0,0 +1,37 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include <stdlib.h> +#include <stdio.h> +// #ifdef HAVE_MALLOC_H +// #include <malloc.h> +// #endif +// #include "memoryleak.h" + +// #if defined(QT_DEBUG) && !defined(__MINGW32__) && defined(EDBEE_DEBUG) +#if defined(EDBEE_DEBUG) +# define EDBEE_DEBUG_NEW_ACTIVE + +void *debug_malloc(size_t size, const char *file, const int line); +void debug_free(void *p, const char *file, const int line); +void *operator new(size_t size, const char *file, const int line); +void operator delete(void *p, const char *file, const int line); +void operator delete(void *p) throw(); +void *operator new[](size_t size, const char *file, const int line); +void operator delete[](void *p, const char *file, const int line); +void operator delete[](void *p) throw(); + +# define debug_new new (__FILE__, __LINE__) +# define new new (__FILE__, __LINE__) +# define malloc(A) debug_malloc((A), __FILE__, __LINE__) +# define free(A) debug_free((A), __FILE__, __LINE__) +#endif + +namespace edbee +{ +void pause_memleak_detection(bool value); +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/rangelineiterator.cpp b/lib/edbee-lib/edbee/util/rangelineiterator.cpp new file mode 100644 index 00000000..ca5f4603 --- /dev/null +++ b/lib/edbee-lib/edbee/util/rangelineiterator.cpp @@ -0,0 +1,50 @@ +/** + * Copyright 2011-2014 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "rangelineiterator.h" + +#include "edbee/models/textdocument.h" +#include "edbee/models/textrange.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// Constructs the range line iterator +/// @param doc the textdocument this iterator is used for +/// @param range the range to iterate over the lines +RangeLineIterator::RangeLineIterator(TextDocument *doc, const TextRange &range) +{ + curLine_ = doc->lineFromOffset(range.min()); + endLine_ = doc->lineFromOffset(range.max()); +} + +/// Constructs a line iterator by supplying two offsets +/// @param doc the textdocument for this iterator +/// @param startOffset the start offset for iterating +/// @param endOffset the endOffset for iterating +RangeLineIterator::RangeLineIterator(TextDocument *doc, int startOffset, + int endOffset) +{ + curLine_ = doc->lineFromOffset(startOffset); + endLine_ = doc->lineFromOffset(endOffset); +} + +/// Checks if there's a next line number available +bool RangeLineIterator::hasNext() const +{ + return curLine_ <= endLine_; +} + +/// returns the next line number +int RangeLineIterator::next() +{ + int result = curLine_; + ++curLine_; + return result; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/rangelineiterator.h b/lib/edbee-lib/edbee/util/rangelineiterator.h new file mode 100644 index 00000000..2a26115f --- /dev/null +++ b/lib/edbee-lib/edbee/util/rangelineiterator.h @@ -0,0 +1,45 @@ +/** + * Copyright 2011-2014 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +namespace edbee +{ + +class TextDocument; +class TextRange; + +/// Implements a line iterator for a single range +/// It iterates over all affected lines that are inside the given textrange +/// +/// Warning you should not change the document in such way that the linecount +/// changes Doing this will result in incorrect behavior of this iterator +/// +/// Usage sample: +/// @code{.cpp} +/// +/// RangeLineIterator itr( &controller->textSelection().range(0) ) +/// while( itr.hasNext() ) { +/// qDebug() << "Line: " << itr.next(); +/// } +/// +/// @endcode +class EDBEE_EXPORT RangeLineIterator +{ +public: + RangeLineIterator(TextDocument *doc, const TextRange &range); + RangeLineIterator(TextDocument *doc, int start, int end); + + bool hasNext() const; + int next(); + +private: + int curLine_; ///< The current line number + int endLine_; ///< The last line +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/rangesetlineiterator.cpp b/lib/edbee-lib/edbee/util/rangesetlineiterator.cpp new file mode 100644 index 00000000..b8859689 --- /dev/null +++ b/lib/edbee-lib/edbee/util/rangesetlineiterator.cpp @@ -0,0 +1,79 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "rangesetlineiterator.h" + +#include "edbee/models/textdocument.h" +#include "edbee/models/textrange.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// Constructs the rangeset line iterator +RangeSetLineIterator::RangeSetLineIterator(TextRangeSet *rangeSet) + : rangeSetRef_(rangeSet) + , rangeIndex_(0) + , rangeEndLine_(-1) + , curLine_(-1) +{ + findNextLine(); +} + +/// Checks if there's a next line number available +bool RangeSetLineIterator::hasNext() const +{ + return curLine_ >= 0; +} + +/// returns the next line number +int RangeSetLineIterator::next() +{ + int result = curLine_; + findNextLine(); + return result; +} + +/// finds the next line number +void RangeSetLineIterator::findNextLine() +{ + // current line isn't at the end of the current range + if (curLine_ < rangeEndLine_) + { + ++curLine_; + + // the curLine_ is finished with the current range + } + else + { + + // when the rangeset is finishedd + while (rangeIndex_ < rangeSetRef_->rangeCount()) + { + TextRange &range = rangeSetRef_->range(rangeIndex_); + ++rangeIndex_; + + // get the start/end lines + int startLine = rangeSetRef_->textDocument()->lineFromOffset(range.min()); + int endLine = rangeSetRef_->textDocument()->lineFromOffset(range.max()); + if (startLine == curLine_) + { + ++startLine; + } + + // still in range? + if (startLine <= endLine) + { + curLine_ = startLine; + rangeEndLine_ = endLine; + return; + } + } + curLine_ = -1; // done + } +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/rangesetlineiterator.h b/lib/edbee-lib/edbee/util/rangesetlineiterator.h new file mode 100644 index 00000000..023e14a0 --- /dev/null +++ b/lib/edbee-lib/edbee/util/rangesetlineiterator.h @@ -0,0 +1,46 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +namespace edbee +{ + +class TextRangeSet; + +/// a rangeset line iterator. For iterating over ALL distinct lines +/// used in a rangeset. +/// +/// Usage sample: +/// @code{.cpp} +/// +/// RangeSetLineIterator itr( controller->textSelection() ) +/// while( itr.hasNext() ) { +/// qDebug() << "Line: " << itr.next(); +/// } +/// +/// @endcode +class EDBEE_EXPORT RangeSetLineIterator +{ +public: + RangeSetLineIterator(TextRangeSet *rangeSet); + + bool hasNext() const; + int next(); + +private: + void findNextLine(); + +private: + TextRangeSet *rangeSetRef_; ///< a reference to the range sets + int rangeIndex_; ///< the current range index + int rangeEndLine_; ///< the last line of the current range + int curLine_; ///< The current line number (this value is -1 if there's no + ///< current line) +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/regexp.cpp b/lib/edbee-lib/edbee/util/regexp.cpp new file mode 100644 index 00000000..1b616b63 --- /dev/null +++ b/lib/edbee-lib/edbee/util/regexp.cpp @@ -0,0 +1,523 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include <QRegExp> + +// This is required for windows, to prevent linkage errors (somehow the sources +// of oniguruma assumes we're linking with a dll) + +#ifdef __clang__ +# pragma clang diagnostic push +#else +# pragma GCC diagnostic push +#endif +#ifdef _MSC_VER +# pragma warning(push) +#endif + +#define ONIG_EXTERN extern +#include "onigmo.h" + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +#ifdef __clang__ +# pragma clang diagnostic pop +#else +# pragma GCC diagnostic pop +#endif + +#include "regexp.h" +#include "edbee/debug.h" + +namespace edbee +{ + +/// The onig regexp-engine +class OnigRegExpEngine : public RegExpEngine +{ +private: + regex_t *reg_; ///< The regExp pattern + OnigErrorInfo einfo_; ///< The error information + bool valid_; ///< Is the reg-exp valid? + QString error_; ///< The current error as a qstring + OnigRegion *region_; ///< The current found region + QString pattern_; ///< The original regexp-pattern + QString line_; ///< The current line + const QChar *lineRef_; ///< A reference to the given line + + /// clears the error message + void clearError() { error_.clear(); } + + /// fills the error with the given code. It retrives the onig_error_code if + /// requried + /// @param code the ONIG error code + void fillError(int code) + { + if (code == ONIG_NORMAL) + { + error_.clear(); + } + else + { + unsigned char s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str(s, code, &einfo_); + error_ = QString::fromLatin1((char *)s); + } + } + + /// deletes the current regon + void deleteRegion() + { + if (region_) + { + onig_region_free(region_, 1); + } // 1:free self, 0:free contents only); + region_ = 0; + } + +public: + /// Constructs the OnigRegExp engine + /// @param pattern the regular expression pattern + /// @param caseSensitive is the regexp case senstitive + /// @param syntax the syntax to use + OnigRegExpEngine(const QString &pattern, bool caseSensitive, + RegExp::Syntax syntax) + : reg_(0) + , region_(0) + , pattern_(pattern) + , lineRef_(0) + { + const QChar *patternChars = pattern.constData(); + + const OnigSyntaxType *onigSyntax = &OnigSyntaxRuby; // ONIG_SYNTAX_DEFAULT + if (syntax == RegExp::SyntaxFixedString) + { + onigSyntax = &OnigSyntaxASIS; + } + + OnigOptionType onigOptions = ONIG_OPTION_NONE | ONIG_OPTION_CAPTURE_GROUP; + if (!caseSensitive) + { + onigOptions = onigOptions | ONIG_OPTION_IGNORECASE; + } + + int result + = onig_new(®_, (OnigUChar *)patternChars, + (OnigUChar *)(patternChars + pattern.length()), onigOptions, + ONIG_ENCODING_UTF16_LE, onigSyntax, &einfo_); + valid_ = result == ONIG_NORMAL; + fillError(result); + } + + /// destructs the regular expression engine + virtual ~OnigRegExpEngine() + { + deleteRegion(); + onig_free(reg_); + } + + /// returns the pattern used + virtual QString pattern() { return pattern_; } + + /// returns true if the supplied regular expression was valid + virtual bool isValid() { return valid_; } + + /// returns the error message + virtual QString error() { return error_; } + + /// returns the index of the given QChar array in the given text + /// @param charPtr the pointer to the string data + /// @param offset the offset to start searching + /// @param length the length of the string data + /// @param reverse should the search be reversed? + int indexIn(const QChar *charPtr, int offset, int length, bool reverse) + { + // invalid reg-exp don't use it! + if (!valid_) + { + return -2; + } + + // delete old regenion an make a new one + deleteRegion(); + region_ = onig_region_new(); + + lineRef_ = charPtr; + OnigUChar *stringStart = (OnigUChar *)charPtr; + OnigUChar *stringEnd = (OnigUChar *)(charPtr + length); + OnigUChar *stringOffset = (OnigUChar *)(charPtr + offset); + OnigUChar *stringRange = (OnigUChar *)stringEnd; + if (reverse) + { + stringOffset = stringEnd; //==stringStart ? stringEnd : stringEnd-1; + stringRange = (OnigUChar *)(charPtr + offset); + } + + clearError(); + + int result = onig_search(reg_, stringStart, stringEnd, stringOffset, + stringRange, region_, ONIG_OPTION_NONE); + if (result >= 0) + { + Q_ASSERT(result % 2 == 0); + return result >> 1; + } + else if (result == ONIG_MISMATCH) + { + return -1; + } + else + { // error + fillError(result); + return -2; + } + } + + /// returns the position of the given match or returns an error code + /// @param str the string to the search in + /// @param offset the offset in the string to start the search + /// @return the position of the given match (-1 if not found, -2 on error) + virtual int indexIn(const QString &str, int offset) + { + line_ = str; + int length = line_.length(); // very scary, calling line_.length() + // invalidates the line_.data() pointer :S + lineRef_ = line_.data(); + + return indexIn(lineRef_, offset, length, false); + } + + /// returns the position of the given match or returns an error code + /// @param str the pointer to the line + /// @param offset the offset to start searching + /// @param length the total length of the str pointer + /// @return the position of the given match (-1 if not found, -2 on error) + virtual int indexIn(const QChar *charPtr, int offset, int length) + { + return indexIn(charPtr, offset, length, false); + } + + /// returns the last index of the given string + /// @param str the string to search in + /// @param offset the offset of the start of the search + /// @return the index of the match (-1 if not found, -2 on error) + virtual int lastIndexIn(const QString &str, int offset) + { + line_ = str; + int length = line_.length(); // very scary, calling line_.length() + // invalidates the line_.data() pointer :S + lineRef_ = line_.data(); + return lastIndexIn(lineRef_, offset, length); + } + + /// returns the last index of the given string + /// @param str the string to search in + /// @param offset the offset of the start of the search + /// @param length the length of the supplied string data + /// @return the index of the match (-1 if not found, -2 on error) + virtual int lastIndexIn(const QChar *str, int offset, int length) + { + if (offset < 0) + { + offset = length + offset; + if (offset < 0) + offset = 0; + } + return indexIn(str, offset, length, true); + } + + /// returns the offset of the given match + /// @param nth the given match + virtual int pos(int nth) const + { + if (!region_) + { + return -1; + } // no region + if (nth < region_->num_regs) + { + int result = region_->beg[nth]; + if (result < 0) + { + return -1; + } + + if (result % 2 != 0) + { + qlog_warn() << "*** ERROR ***:" << nth; + qlog_warn() << "line :" << line_; + qlog_warn() << "pattern:" << pattern_; + qlog_warn() << ""; + for (int i = 0; i < region_->num_regs; i++) + { + qlog_info() << QStringLiteral(" - %1: (%2,%3)") + .arg(i) + .arg(region_->beg[i]) + .arg(region_->end[i]); + } + // fprintf(stderr, + Q_ASSERT(result % 2 == 0); + } + return result >> 1; + } + return -1; + } + + /// returns the length of the nth match + /// @param nth the match number + virtual int len(int nth) const + { + if (!region_) + { + return -1; + } // no region + if (nth < region_->num_regs) + { + int result + = region_->end[nth] + - region_->beg[nth]; // end is the first character AFTER the match + Q_ASSERT(result % 2 == 0); + return result >> 1; + } + return -1; + } + + /// returns the capture at the given index + /// @param nth the position of the match + /// @return the match ath the given position + virtual QString cap(int nth = 0) const + { + int p = pos(nth); + int l = len(nth); + if (p < 0 || l < 0) + return QString(); + return QString(lineRef_ + p, l); + } +}; + +//==================================================================================================================== + +/// The Qt regexp-engine +/// A pretty dumb wrapper around the QRegExp Class +class QtRegExpEngine : public RegExpEngine +{ + QRegExp *reg_; ///< The Qt QRegExp objet + +public: + /// constructs the QRegExp engine + /// @param pattern the pattern to match + /// @param caseSensitive is the match case sensitive + /// @param syntax the used syntadx + QtRegExpEngine(const QString &pattern, bool caseSensitive, + RegExp::Syntax syntax) + : reg_(0) + { + QRegExp::PatternSyntax regExpSyntax = QRegExp::RegExp2; + if (syntax == RegExp::SyntaxFixedString) + { + regExpSyntax = QRegExp::FixedString; + } + + reg_ = new QRegExp(pattern, + caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive, + regExpSyntax); + } + + /// destructs the QtRegExpEngine + virtual ~QtRegExpEngine() { delete reg_; } + + /// Returns the supplied pattern + virtual QString pattern() { return reg_->pattern(); } + + /// Returns true if the given regular expression was valid + virtual bool isValid() { return reg_->isValid(); } + + /// returns the error message + virtual QString error() { return reg_->errorString(); } + + /// returns the index of the regexp in the given string + /// @param str the string to search in + /// @param offset the start offset of the search + /// @return the index of the given match or < 0 if no match was found + virtual int indexIn(const QString &str, int offset) + { + return reg_->indexIn(str, offset); + } + + /// Warning index in with char pointers creates a string from the string + /// @param str the pointer to the given string + /// @param offset the offset to start searching + /// @param length the length of the given string + /// @return the index of the given match or < 0 if no match was found + virtual int indexIn(const QChar *str, int offset, int length) + { + QString realString(str + offset, length); + return reg_->indexIn(realString, offset); + } + + /// Returns the last match of this regexp in the given string + /// @param str the string to search in + /// @param offset the offset to start searching from + /// @return the matched index or < 0 if not found + virtual int lastIndexIn(const QString &str, int offset) + { + return reg_->lastIndexIn(str, offset); + } + + /// Returns the last match of this regexp in the given string + /// @param str the string to search in + /// @param offset the offset to start searching from + /// @param length the length of the given string + /// @return the matched index or < 0 if not found + virtual int lastIndexIn(const QChar *str, int offset, int length) + { + QString realString(str + offset, length); + return reg_->lastIndexIn(realString, offset); + } + + /// returns the position of the nth group match + /// @param nth the group number to return + /// @return the position of the nth match + virtual int pos(int nth = 0) const { return reg_->pos(nth); } + + /// returns the length of the nth group match + /// @param nth the group number to return + /// @return the length of the nth match + virtual int len(int nth = 0) const { return reg_->cap(nth).length(); } + + /// returns the nth group + /// @param nth the group number to return + /// @return the content of the given match + virtual QString cap(int nth = 0) const { return reg_->cap(nth); } +}; + +//==================================================================================================================== + +/// Constructs the regular expression matcher +/// @param pattern the pattern of the regular expression +/// @param caseSensitive should the match be case sensitive +/// @param syntax the syntax of th given regular expression +/// (SyntaxDefault(default) or SyntaxFixedString) +/// @param engine the engine to use (EngineOniguruma(default) or EngineQRegExp) +RegExp::RegExp(const QString &pattern, bool caseSensitive, Syntax syntax, + Engine engine) + : d_(0) +{ + switch (engine) + { + case EngineQRegExp: + d_ = new QtRegExpEngine(pattern, caseSensitive, syntax); + break; + case EngineOniguruma: + d_ = new OnigRegExpEngine(pattern, caseSensitive, syntax); + break; + default: + Q_ASSERT(false); + qlog_warn() << "Invalid engine supplied to RegExp. Falling back to " + "EngineOniguruma"; + d_ = new OnigRegExpEngine(pattern, caseSensitive, syntax); + break; + } +} + +/// destructs the regular expression object +RegExp::~RegExp() +{ + delete d_; +} + +/// escapes a string with every regexp special character escaped +/// we currently always use QRegExp::escape.. For the future we added an engine +/// parameter which is currently ignored +QString RegExp::escape(const QString &str, RegExp::Engine engine) +{ + Q_UNUSED(engine); + return QRegExp::escape(str); +} + +/// returns true if the supplied regular expression was valid +bool RegExp::isValid() const +{ + return d_->isValid(); +} + +/// returns the error message of the regular expression +QString RegExp::errorString() const +{ + return d_->error(); +} + +/// returns th supplied pattern +QString RegExp::pattern() const +{ + return d_->pattern(); +} + +/// Attempts to find a match in str from position offset (0 by default). If +/// offset is -1, the search starts at the last character; if -2, at the next to +/// last character; etc. Returns the position of the first match, or -1 if there +/// was no match. The caretMode parameter can be used to instruct whether ^ +/// should match at index 0 or at offset. You might prefer to use +/// QString::indexOf(), QString::contains(), or even QStringList::filter(). To +/// replace matches use QString::replace(). +int RegExp::indexIn(const QString &str, int offset) // const +{ + return d_->indexIn(str, offset); +} + +/// Searchers for the regular expression in the given string +/// @param str the string to search in +/// @param offset the offset to start searching +/// @param length the length of the supplied string +/// @return the found index of the regular expression +int RegExp::indexIn(const QChar *str, int offset, int length) +{ + return d_->indexIn(str, offset, length); +} + +/// Searcher for the last match of the regular expression in the given string +/// @param str the string to search in +/// @param offset the offset to start searching +/// @return the found index of the regular expression +int RegExp::lastIndexIn(const QString &str, int offset) +{ + return d_->lastIndexIn(str, offset); +} + +/// Searchers for the last match of the regular expression in the given string +/// @param str the string to search in +/// @param offset the offset to start searching +/// @param length the length of the supplied string +/// @return the found index of the regular expression +int RegExp::lastIndexIn(const QChar *str, int offset, int length) +{ + return d_->lastIndexIn(str, offset, length); +} + +/// Returns the position of the nth captured text in the searched string. If nth +/// is 0 (the default), pos() returns the position of the whole match. For +/// zero-length matches, pos() always returns -1. (For example, if cap(4) would +/// return an empty string, pos(4) returns -1.) This is a feature of the +/// implementation. +int RegExp::pos(int nth) const +{ + return d_->pos(nth); +} + +/// The length of nth element +int RegExp::len(int nth) const +{ + return d_->len(nth); +} + +/// This method returns the given matched length +QString RegExp::cap(int nth) const +{ + return d_->cap(nth); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/regexp.h b/lib/edbee-lib/edbee/util/regexp.h new file mode 100644 index 00000000..826c77bb --- /dev/null +++ b/lib/edbee-lib/edbee/util/regexp.h @@ -0,0 +1,93 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QString> + +namespace edbee +{ + +/// The minimal engine we currently require for handling regexpt. +/// It may grow in the future +class EDBEE_EXPORT RegExpEngine +{ +public: + virtual ~RegExpEngine() {} + virtual QString pattern() = 0; + virtual bool isValid() = 0; + virtual QString error() = 0; + virtual int indexIn(const QString &str, int offset) = 0; + virtual int indexIn(const QChar *str, int offset, int length) = 0; + virtual int lastIndexIn(const QString &str, int offset) = 0; + virtual int lastIndexIn(const QChar *str, int offset, int length) = 0; + + virtual int pos(int nth = 0) const = 0; + virtual int len(int nth = 0) const = 0; + virtual QString cap(int nth = 0) const = 0; +}; + +/// A class for matching QStrings with the Oniguruma API +/// We need this Regular Expression library to be able to support tmLanguages +/// fully I tried to make this class as close as possible to the QRegExp library +class EDBEE_EXPORT RegExp +{ +public: + enum Engine + { + EngineOniguruma = 1, + EngineQRegExp = 2 + // QRegExp::RegExp 0 A rich Perl-like pattern matching + // syntax. This is the default. QRegExp::RegExp2 3 Like + // RegExp, but with greedy quantifiers. (Introduced in Qt 4.2.) + // QRegExp::Wildcard 1 This provides a simple pattern matching + // syntax similar to that used by shells (command interpreters) for + // "file globbing". See QRegExp wildcard matching. + // QRegExp::WildcardUnix 4 This is similar to Wildcard but + // with the behavior of a Unix shell. The wildcard characters can be + // escaped with the character "\". QRegExp::FixedString 2 + // The pattern is a fixed string. This is equivalent to using the + // RegExp pattern on a string in which all metacharacters are escaped + // using escape(). QRegExp::W3CXmlSchema11 5 The pattern is a + // regular expression as defined by the W3C XML Schema 1.1 + // specification. + }; + + enum Syntax + { + SyntaxDefault, /// The default syntax + SyntaxFixedString /// A plain fixed string + }; + + RegExp(const QString &pattern, bool caseSensitive = true, + Syntax syntax = SyntaxDefault, Engine engine = EngineOniguruma); + virtual ~RegExp(); + + static QString escape(const QString &str, Engine engine = EngineOniguruma); + + bool isValid() const; + QString errorString() const; + QString pattern() const; + + int indexIn(const QString &str, int offset = 0); // const; + int indexIn(const QChar *str, int offset, int length); + int lastIndexIn(const QString &str, int offset = -1); + int lastIndexIn(const QChar *str, int offset, int length); + int pos(int nth = 0) const; + int len(int nth = 0) const; + QString cap(int nth = 0) const; + + /// matched length is equal to pos-0-length + int matchedLength() { return len(0); } + + // int cap( int nth = 0 ) const; + +private: + RegExpEngine *d_; ///< The private data member +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/simpleprofiler.cpp b/lib/edbee-lib/edbee/util/simpleprofiler.cpp new file mode 100644 index 00000000..fadffe0f --- /dev/null +++ b/lib/edbee-lib/edbee/util/simpleprofiler.cpp @@ -0,0 +1,148 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "simpleprofiler.h" +#include <QDateTime> +#include "edbee/debug.h" + +namespace edbee +{ + +/// This method returns the profile instance +SimpleProfiler *SimpleProfiler::instance() +{ + static SimpleProfiler profiler; + return &profiler; +} + +/// the constructor for a profile stat issue +SimpleProfiler::ProfilerItem::ProfilerItem(const char *filename, int line, + const char *function, + const char *name) + : filename_(filename) + , line_(line) + , function_(function) + , name_(name) + , callCount_(0) + , duration_(0) + , childDuration_(0) +{ +} + +SimpleProfiler::SimpleProfiler() {} + +/// destroy the stuff +SimpleProfiler::~SimpleProfiler() +{ + qDeleteAll(statsMap_); + statsMap_.clear(); + stack_.clear(); +} + +/// begin the profiling +void SimpleProfiler::begin(const char *file, int line, const char *function, + const char *name) +{ + // build the key + QString key = QStringLiteral("%1:%2").arg(file).arg(line); + + // fetch or create the item + ProfilerItem *item = statsMap_.value(key, 0); + if (!item) + { + item = new ProfilerItem(file, line, function, name); + statsMap_.insert(key, item); + } + + ProfileStackItem stackItem = {item, QDateTime::currentMSecsSinceEpoch()}; + stack_.push(stackItem); +} + +/// ends profiling +void SimpleProfiler::end() +{ + Q_ASSERT(stack_.size() > 0); + ProfileStackItem stackItem = stack_.pop(); + stackItem.item->incCallCount(); + int duration = QDateTime::currentMSecsSinceEpoch() - stackItem.startTime; + stackItem.item->addDuration(duration); + if (!stack_.isEmpty()) + { + stack_.top().item->addChildDuration(duration); + } +} + +static bool sortByDuration(const SimpleProfiler::ProfilerItem *a, + const SimpleProfiler::ProfilerItem *b) +{ + return b->durationWithoutChilds() < a->durationWithoutChilds(); +} + +/// This method dumps the results to the output +void SimpleProfiler::dumpResults() +{ + QList<ProfilerItem *> items = statsMap_.values(); + if (items.length() > 0) + { + std::sort(items.begin(), items.end(), sortByDuration); + + qlog_info() << ""; + qlog_info() << "Profiler Results"; + qlog_info() << "================"; + + qint64 totalDuration = 0; + int totalCallCount = 0; + int totalDurationWitoutChilds = 0; + foreach (ProfilerItem *item, items) + { + totalDuration += item->duration(); + totalCallCount += item->callCount(); + totalDurationWitoutChilds += item->durationWithoutChilds(); + } + + foreach (ProfilerItem *item, items) + { + double durationPercentage + = totalDuration > 0 ? 100.0 * item->duration() / totalDuration : 100; + double callCountPercentage + = totalCallCount > 0 ? 100.0 * item->callCount() / totalCallCount + : 100; + double durationWithoutChildsPercenage + = totalDurationWitoutChilds > 0 + ? 100.0 * item->durationWithoutChilds() + / totalDurationWitoutChilds + : 100; + + QString line = QStringLiteral("%1x(%2%) %3ms(%4%) %5ms(%6%) | %7:%8 %9") + .arg(item->callCount(), 8) + .arg(callCountPercentage, 6, 'f', 2) + .arg(item->duration(), 6) + .arg(durationPercentage, 6, 'f', 2) + .arg(item->durationWithoutChilds(), 6) + .arg(durationWithoutChildsPercenage, 6, 'f', 2) + .arg(item->filename()) + .arg(item->line()) + .arg(item->name()); + qlog_info() << line; + } + + qlog_info() << ""; + qlog_info() << "Total Duration: " << totalDuration << "ms"; + qlog_info() << "Total Calls : " << totalCallCount; + qlog_info() << "Total Items : " << items.size() << "ms"; + + if (!stack_.isEmpty()) + { + qlog() << "** WARNING: The stack isn't empty!! ** "; + foreach (ProfileStackItem stackItem, stack_) + { + qlog() << " * " << stackItem.item->function() << ":" + << stackItem.item->line(); + } + } + } +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/simpleprofiler.h b/lib/edbee-lib/edbee/util/simpleprofiler.h new file mode 100644 index 00000000..42d0ea6e --- /dev/null +++ b/lib/edbee-lib/edbee/util/simpleprofiler.h @@ -0,0 +1,99 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +// #include "config.h" + +#include <QString> +#include <QStack> +#include <QMap> + +namespace edbee +{ + +#ifdef CONFIG_PROFILE + +# define PROF_BEGIN \ + SimpleProfiler::instance()->begin(__FILE__, __LINE__, __func__, 0); + +# define PROF_END SimpleProfiler::instance()->end(); + +# define PROF_BEGIN_NAMED(name) \ + SimpleProfiler::instance()->begin(__FILE__, __LINE__, __func__, name); + +#else +# define PROF_BEGIN +# define PROF_END +# define PROF_BEGIN_NAMED(name) +#endif + +/// __FILE__ / __LINE__ / __FUNCTION__ (or __func__ ) + +/// A simple profiler class that can be used to profile certain parts of the +/// code. I've introduced this class as a poor-mans profiler. Because currently +/// valgrand and other profilers don't seem to run smoothly on my mac. They +/// crash .. +class EDBEE_EXPORT SimpleProfiler +{ + +public: + static SimpleProfiler *instance(); + + /// the class to 'record a singlel item + class ProfilerItem + { + public: + ProfilerItem(const char *filename, int line, const char *function, + const char *name); + const char *filename() const { return filename_; } + int line() const { return line_; } + const char *function() const { return function_; } + const char *name() const { return name_; } + int callCount() const { return callCount_; } + qint64 duration() const { return duration_; } + qint64 childDuration() const { return childDuration_; } + qint64 durationWithoutChilds() const { return duration_ - childDuration_; } + + void incCallCount() { ++callCount_; } + void addDuration(qint64 duration) { duration_ += duration; } + void addChildDuration(qint64 duration) { childDuration_ += duration; } + + protected: + const char *filename_; ///< The filename + int line_; ///< The line + const char *function_; ///< The function/method name + const char *name_; ///< The custom name + + int callCount_; ///< The total number of calls + qint64 duration_; ///< The total duration + qint64 + childDuration_; ///< Duration of child-items (items called by this item) + }; + + /// The current stats items + struct ProfileStackItem + { + ProfilerItem *item; + qint64 startTime; + }; + + SimpleProfiler(); + virtual ~SimpleProfiler(); + + void begin(const char *file, int line, const char *function, + const char *name); + void end(); + + void dumpResults(); + +protected: + QMap<QString, ProfilerItem *> statsMap_; ///< The statistics + QStack<ProfileStackItem> stack_; ///< The current items being processed +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/test.cpp b/lib/edbee-lib/edbee/util/test.cpp new file mode 100644 index 00000000..f0bf64ba --- /dev/null +++ b/lib/edbee-lib/edbee/util/test.cpp @@ -0,0 +1,503 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include <QMetaObject> +#include <QMetaMethod> +#include <QDebug> + +#include "edbee/util/test.h" + +namespace edbee +{ +namespace test +{ + +//============================================================================= +// TestResult +//============================================================================= + +/// A single test result +/// @param testCase the testCase +/// @param methodName the called method name +/// @param description the description of this test +/// @param file the file of the test +/// @param lineNUmber the line numbrer of the test +TestResult::TestResult(TestCase *testCase, const QString &methodName, + const QString &description, const char *file, + int lineNumber) + : testCaseRef_(testCase) + , methodName_(methodName) + , description_(description) + , fileNameRef_(file) + , lineNumber_(lineNumber) + , compareStatement_(false) + , actualStatementRef_("") + , expectedStatementRef_("") + , actualValue_("") + , expectedValue_("") + , status_(Passed) +{ +} + +/// Sets the result and the state of the test +/// @param result the result status +/// @param statement the executed statement +void TestResult::setBooleanResult(bool result, const char *statement) +{ + status_ = result ? Passed : Failed; + actualStatementRef_ = statement; +} + +/// Sets a compare result +/// @param result the compare result +/// @param actualValue the actual value set +/// @param expectedValue the expected value of this operation +/// @param actualStatement the executed statement +/// @param actualValue the actual value of the compare +void TestResult::setCompareResult(bool result, const QString &actualValue, + const QString &expectedValue, + const char *actualStatement, + const char *expectedStatement) +{ + status_ = result ? Passed : Failed; + compareStatement_ = true; + actualValue_ = actualValue; + expectedValue_ = expectedValue; + actualStatementRef_ = actualStatement; + expectedStatementRef_ = expectedStatement; +} + +/// A skip test result +void TestResult::setSkip() +{ + status_ = Skipped; +} + +//============================================================================= +// TestCase +//============================================================================= + +/// Constructs the testcase +TestCase::TestCase() + : engineRef_(0) +{ +} + +/// this method returns the outputhandler +/// @return the output handler +OutputHandler *TestCase::out() +{ + Q_ASSERT(engine()); + return engine()->outputHandler(); +} + +/// The test true implementation +/// @param condition the condition to test +/// @param statement the statement of the operation +/// @param description the description of this test item +/// @param file the source file +/// @param line the line number +void TestCase::testTrueImpl(bool condition, const char *statement, + const QString &description, const char *file, + int line) +{ + TestResult *testResult + = new TestResult(engine()->currentTest(), engine()->currentMethodName(), + description, file, line); + testResult->setBooleanResult(condition, statement); + engine()->giveTestResult(testResult); +} + +/// The test equal implementation +/// @param result the result of the compare +/// @param actual the actual result +/// @param expected the expected result +/// @param actualStatement the statement of the operation +/// @param exptectedStatement the expected statement +/// @param description the description of this test item +/// @param file the source file +/// @param line the line number +void TestCase::testEqualImpl(bool result, const QString &actual, + const QString &expected, + const char *actualStatement, + const char *expectedStatement, + const QString &description, const char *file, + int line) +{ + TestResult *testResult + = new TestResult(engine()->currentTest(), engine()->currentMethodName(), + description, file, line); + testResult->setCompareResult(result, actual, expected, actualStatement, + expectedStatement); + engine()->giveTestResult(testResult); +} + +/// Implements the skip test operation +/// @param description the description of the test +/// @param file the source file +/// @param line the line number +void TestCase::testSkipImpl(const QString &description, const char *file, + int line) +{ + TestResult *testResult + = new TestResult(engine()->currentTest(), engine()->currentMethodName(), + description, file, line); + testResult->setSkip(); + engine()->giveTestResult(testResult); +} + +/// this method returns the current testcase +TestCase *TestCase::currentTest() +{ + return engine()->currentTest(); +} + +// returns the current method name +QString TestCase::currentMethodName() +{ + return engine()->currentMethodName(); +} + +/// Gives the testresult to the engine +void TestCase::giveTestResultToEngine(TestResult *result) +{ + engine()->giveTestResult(result); +} + +//============================================================================= +// QDebug output handler +//============================================================================= + +/// The output handler constructor of this test +OutputHandler::OutputHandler() {} + +/// the descructor of this output handler +OutputHandler::~OutputHandler() {} + +/// This method is called if the test run is started +/// @param engine the test engine +void OutputHandler::startTestRun(TestEngine *engine) +{ + Q_UNUSED(engine); + qDebug() << "**************** Start edbee tests **************"; +} + +/// This method is called if the test run is completed +/// @param engine the test engine +void OutputHandler::endTestRun(TestEngine *engine) +{ + int passedCount = 0; + int failedCount = 0; + int skippedCount = 0; + foreach (TestResult *result, engine->testResultList()) + { + switch (result->status()) + { + case TestResult::Passed: + ++passedCount; + break; + case TestResult::Failed: + ++failedCount; + break; + case TestResult::Skipped: + ++skippedCount; + break; + default: + Q_ASSERT_X(false, "TestResult Status", "Unkown status returned!"); + } + } + + qDebug() << " ** completed: " << passedCount << " passed, " << failedCount + << " failures, " << skippedCount << " skipped"; + if (failedCount > 0) + { + qDebug() << " ___ _ _ _ ___ __ "; + qDebug() << "| __|/ \\ | || | | __|| \\ "; + qDebug() << "| _|| o || || |_ | _| | o )"; + qDebug() << "|_| |_n_||_||___||___||__/ "; + qDebug() << ""; + } +} + +/// This method is called if a testcase is started +/// @param engine the test engine +void OutputHandler::startTestCase(TestEngine *engine) +{ + qDebug() << "class" << engine->currentClassName() << " ================"; +} + +/// This method is called if a testcase is ended +/// @param engine the test engine +void OutputHandler::endTestCase(TestEngine *engine) +{ + Q_UNUSED(engine); + qDebug() << ""; +} + +/// This method is called if a test method is started +/// @param engine the test engine +void OutputHandler::startTestMethod(TestEngine *engine) +{ + buffer_.append("- "); + buffer_.append(engine->currentMethodName()); + buffer_.append(" "); +} + +/// This method is called if a test method is ended +/// @param engine the test engine +void OutputHandler::endTestMethod(TestEngine *engine) +{ + Q_UNUSED(engine); + + // write the result + qDebug() << "" + << (const char *)QStringLiteral("%1%2%3") + .arg(buffer_) + .arg(failBuffer_) + .arg(outBuffer_) + .toLatin1(); + // qDebug() << + // QStringLiteral("%1%2%3\n").arg(buffer_).arg(failBuffer_).arg(outBuffer_); + + buffer_.clear(); + failBuffer_.clear(); + outBuffer_.clear(); +} + +/// This method is called if a test result is added +/// @param engine the test engine +/// @param testResul tthe testresult of this operation +void OutputHandler::testResultAdded(TestEngine *engine, TestResult *testResult) +{ + Q_UNUSED(engine); + switch (testResult->status()) + { + case TestResult::Passed: + buffer_.append("."); + break; + + case TestResult::Skipped: + buffer_.append("SKIPPED"); + break; + + case TestResult::Failed: + buffer_.append("*"); + + // compare statement + if (testResult->compareStatement()) + { + failBuffer_.append("\n"); + failBuffer_.append(" [FAILURE] ") + .append(testResult->actualStatement()) + .append(" == ") + .append(testResult->expectedStatement()) + .append("\n"); + if (!testResult->description().isEmpty()) + failBuffer_.append(" ") + .append(testResult->description()) + .append("\n"); + failBuffer_.append(" expected: [") + .append(testResult->expectedValue()) + .append("]\n"); + failBuffer_.append(" actual : [") + .append(testResult->actualValue()) + .append("]\n"); + failBuffer_.append(" ") + .append(testResult->fileName()) + .append(":") + .append(QStringLiteral("%1").arg( + testResult->lineNumber())); //.append("\n"); + } + else + { + failBuffer_.append("\n"); + failBuffer_.append(" [FAILURE] ") + .append(testResult->statement()) + .append("\n"); + if (!testResult->description().isEmpty()) + failBuffer_.append(" ") + .append(testResult->description()) + .append("\n"); + failBuffer_.append(" ") + .append(testResult->fileName()) + .append(":") + .append(QStringLiteral("%1").arg( + testResult->lineNumber())); //.append("\n"); + } + break; + } +} + +//============================================================================= +// Test Engine +//============================================================================= + +/// The test engine constructor +TestEngine::TestEngine() + : outputHandlerRef_(0) + , currentTestRef_(0) +{ + static OutputHandler outputHandler; // default to a qdebug outputhandler + outputHandlerRef_ = &outputHandler; +} + +/// destructs the testengine +TestEngine::~TestEngine() +{ + qDeleteAll(testResultList_); + testResultList_.clear(); +} + +/// this method returns true if the given object is found +/// @param object the testcase object +bool TestEngine::hasTest(TestCase *object) +{ + if (testRefList_.contains(object)) + return true; + foreach (TestCase *test, testRefList_) + { + // todo: waarom zouden we niet meerdere instanties kunnen hebben? + if (test->objectName() == object->objectName()) + return true; + } + return false; +} + +/// this metohd adds a test +/// @param object the testcase to add +void TestEngine::addTest(TestCase *object) +{ + if (!hasTest(object)) + testRefList_.append(object); +} + +/// This method runs all tests +/// @return at the moment 0 +int TestEngine::runAll() +{ + startRun(); + + int ret = 0; + foreach (TestCase *test, testRefList_) + { + ret += run(test); + } + + endRun(); + + return ret; +} + +/// This class executes all tests on the given test object (all private Slots) +/// @param object hte object that needs to be run +/// @return at the moment 0 +int TestEngine::run(TestCase *test) +{ + // start a test + currentTestRef_ = test; + currentTestRef_->setEngine(this); + + // retrieve the meta object and invoke all private slots + const QMetaObject *metaObject = test->metaObject(); + + // retrieve all methods + int initTestCaseIndex = metaObject->indexOfSlot("initTestCase()"); + int initTestIndex = metaObject->indexOfSlot("init()"); + int cleanTestCaseIndex = metaObject->indexOfSlot("cleanTestCase()"); + int cleanTestIndex = metaObject->indexOfSlot("clean()"); + + // next log the class + outputHandler()->startTestCase(this); + + // initTestCase() will be called before the first testfunction is executed. + if (initTestCaseIndex >= 0) + metaObject->invokeMethod(test, "initTestCase"); + + // this method invokes all private slots + for (int methodIdx = 0, methodCount = metaObject->methodCount(); + methodIdx < methodCount; ++methodIdx) + { + + // invoke the method + const QMetaMethod method = metaObject->method(methodIdx); + if (method.access() == QMetaMethod::Private + && method.methodType() == QMetaMethod::Slot) + { + + currentMethodName_ = QString(method.methodSignature()); + if (currentMethodName_.startsWith('_')) + continue; // skip underscore names + + if (currentMethodName_.compare("init()") == 0 + || currentMethodName_.compare("clean()") == 0 + || currentMethodName_.compare("initTestCase()") == 0 + || currentMethodName_.compare("cleanupTestCase()") == 0) + continue; + + outputHandler()->startTestMethod(this); + + // invoke the test (init) test (clean) + if (initTestIndex >= 0) + metaObject->invokeMethod(test, "init"); + method.invoke(test); + if (cleanTestIndex >= 0) + metaObject->invokeMethod(test, "clean"); + + outputHandler()->endTestMethod(this); + currentMethodName_.clear(); + } + } + + // cleanupTestCase() will be called after the last testfunction was executed. + if (cleanTestCaseIndex >= 0) + metaObject->invokeMethod(test, "cleanupTestCase"); + + // close it + outputHandler()->endTestCase(this); + + currentTestRef_->setEngine(0); + currentTestRef_ = 0; + + return 0; +} + +/// This method runs the given test +/// @param name the name of this test +int TestEngine::run(const QString &name) +{ + foreach (TestCase *test, testRefList_) + { + if (test->objectName() == name) + { + return this->run(test); + } + } + return 0; +} + +/// should be called before the first run when manually running single unit +/// tests When using runAll you should not call this method +void TestEngine::startRun() +{ + outputHandler()->startTestRun(this); +} + +/// This method should be called when your done with running single test +/// When using runAll you should not call this method +void TestEngine::endRun() +{ + outputHandler()->endTestRun(this); +} + +/// Appends the test result +/// @param testResult the result of the tests to add to the list of results +void TestEngine::giveTestResult(TestResult *testResult) +{ + testResultList_.append(testResult); + outputHandler()->testResultAdded(this, testResult); +} + +} // namespace test +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/test.h b/lib/edbee-lib/edbee/util/test.h new file mode 100644 index 00000000..672b53de --- /dev/null +++ b/lib/edbee-lib/edbee/util/test.h @@ -0,0 +1,333 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QObject> +#include <QString> +#include <QSharedPointer> +#include <QTextStream> + +/** @TODO: Replace these tests with the standard Qt testing framework */ + +//============================================================================= +// MACROS +//============================================================================= + +#define TEST_CONCATENATE_DETAIL(x, y) x##y +#define TEST_CONCATENATE(x, y) TEST_CONCATENATE_DETAIL(x, y) +#define TEST_MAKE_UNIQUE(x) TEST_CONCATENATE(x, __COUNTER__) + +#define DECLARE_TEST(className) \ + static edbee::test::Test<className> TEST_MAKE_UNIQUE(t)(#className) +#define DECLARE_NAMED_TEST(name, className) \ + static edbee::test::Test<className> TEST_MAKE_UNIQUE(name)(#className) + +namespace edbee +{ +namespace test +{ + +class OutputHandler; +class TestEngine; +class TestCase; + +//============================================================================= +// Test Results +//============================================================================= + +template<class T> +QString toQString(const T &obj) +{ + return QStringLiteral("%1").arg(obj); +} + +/// This method represents a test result +class EDBEE_EXPORT TestResult +{ +public: + enum Status + { + Passed, + Failed, + Skipped + }; + + explicit TestResult(TestCase *testCase, const QString &methodName, + const QString &description, const char *file, + int lineNumber); + virtual ~TestResult() {} + + virtual void setBooleanResult(bool result, const char *statement); + // virtual void setCompareResult( const QString& actualValue, const QString& + // expectedValue, const char* actualStatement, const char* expectedStatement + // ); + + virtual void setCompareResult(bool result, const QString &actualValue, + const QString &expectedValue, + const char *actualStatement, + const char *expectedStatement); + + // template <class T> + // void setCompareResult( const T& actualValue, const T& expectedValue, + // const char* actualStatement, const char* expectedStatement ) + // { + // setCompareResult( actualValue == expectedValue, + // toQString(actualValue), toQString(expectedValue), actualStatement, + // expectedStatement ); + // } + + virtual void setSkip(); + + virtual TestCase *testCae() { return testCaseRef_; } + virtual QString methodName() { return methodName_; } + virtual QString description() { return description_; } + virtual const char *fileName() { return fileNameRef_; } + virtual int lineNumber() { return lineNumber_; } + + virtual bool compareStatement() { return compareStatement_; } + virtual const char *actualStatement() { return actualStatementRef_; } + virtual const char *statement() { return actualStatementRef_; } + virtual const char *expectedStatement() { return expectedStatementRef_; } + virtual QString actualValue() { return actualValue_; } + virtual QString expectedValue() { return expectedValue_; } + + virtual Status status() { return status_; } + +private: + // method / line defionition + TestCase *testCaseRef_; ///< A reference to the test object + QString methodName_; ///< The method name + QString description_; ///< The message + const char *fileNameRef_; ///< The filename + int lineNumber_; ///< The line number + + // code definition + bool compareStatement_; ///< A compare statement with an expected and actual + const char *actualStatementRef_; ///< The actual statement + const char *expectedStatementRef_; ///< The expected statement + QString actualValue_; ///< The actual value + QString expectedValue_; ///< The expected value + + // the result + Status status_; ///< The test status +}; + +//============================================================================= +// Test Unit Class +//============================================================================= + +#define GET_3TH_ARG(arg1, arg2, arg3, ...) arg3 +#define GET_4TH_ARG(arg1, arg2, arg3, arg4, ...) arg4 + +#define testTrue_1(statement) \ + testTrueImpl((statement) ? true : false, #statement, "", __FILE__, __LINE__) +#define testTrue_2(statement, message) \ + testTrueImpl((statement) ? true : false, #statement, (message), __FILE__, \ + __LINE__) +#define testTrue_MACRO_CHOOSER(...) \ + GET_3TH_ARG(__VA_ARGS__, testTrue_2, testTrue_1, ) +#define testTrue(...) testTrue_MACRO_CHOOSER(__VA_ARGS__)(__VA_ARGS__) + +#define testFalse(statement) testTrue(!statement) + +#define testEqual_1(actual, expected) \ + do \ + { \ + QString actualStr = edbee::test::toQString(actual); \ + QString expectedStr = edbee::test::toQString(expected); \ + testEqualImpl((actualStr) == (expectedStr), actualStr, expectedStr, \ + #actual, #expected, "", __FILE__, __LINE__); \ + } while (false) + +#define testEqual_2(actual, expected, message) \ + do \ + QString actualStr = edbee::test::toQString(actual); \ + QString expectedStr = edbee::test::toQString(expected); \ + testEqualImpl((actualStr) == (expectedStr), actualStr, expectedStr, #actual, \ + #expected, (message), __FILE__, __LINE__); \ + } \ + while (false) + +#define testEqual_MACRO_CHOOSER(...) \ + GET_4TH_ARG(__VA_ARGS__, testEqual_2, testEqual_1, ) +#define testEqual(...) testEqual_MACRO_CHOOSER(__VA_ARGS__)(__VA_ARGS__) + +#define testSkip(msg) testSkipImpl(msg, __FILE__, __LINE__) + +/// I really really hate the QTestLib output on my Mac. It's a very ugly +/// xwindows console result. +/// +/// This extemely simple testing support class makes it possible for met to +/// output the test results to a WebKit window. Where I can added clickable divs +/// etc. to show test result details +/// +/// The basic conventions for these tests are the sames as those of QTest. The +/// main difference is the usage of exta output/compare info output messsages + +/// A simple unit test. Every private slot is called for a test +/// +class EDBEE_EXPORT TestCase : public QObject +{ + Q_OBJECT +public: + explicit TestCase(); + + /// This method returns the current engine + virtual TestEngine *engine() { return engineRef_; } + virtual void setEngine(TestEngine *engine) { engineRef_ = engine; } + + virtual OutputHandler *out(); + + virtual void testTrueImpl(bool condition, const char *statement, + const QString &description, const char *file, + int line); + + virtual void + testEqualImpl(bool result, const QString &actual, const QString &expected, + const char *actualStatement, const char *expectedStatement, + const QString &description, const char *file, int line); + + virtual void testSkipImpl(const QString &description, const char *file, + int line); + + virtual TestCase *currentTest(); // usually returns this :P + virtual QString currentMethodName(); + virtual void giveTestResultToEngine(TestResult *result); + +signals: + +public slots: + +private slots: + +private: + TestEngine *engineRef_; ///< This method returns the reference to the engine +}; + +//============================================================================= +// Output Handling +//============================================================================= + +/// This is the basic outputhandler. +/// The basic outputhandler simply executes a qDebug with the given information +class EDBEE_EXPORT OutputHandler +{ +public: + explicit OutputHandler(); + virtual ~OutputHandler(); + + // writes down the start of a multiple test run + virtual void startTestRun(TestEngine *engine); + virtual void endTestRun(TestEngine *engine); + + // writes down the 'category' of the test + virtual void startTestCase(TestEngine *engine); + virtual void endTestCase(TestEngine *engine); + + // method output of the test case + virtual void startTestMethod(TestEngine *engine); + virtual void endTestMethod(TestEngine *engine); + + virtual void testResultAdded(TestEngine *engine, TestResult *testResult); + +private: + QString buffer_; + QString failBuffer_; + QString outBuffer_; + + // this method notifies that a value is wrong + // void writeSuccess( TestCase & testCase, const char *methodName ); + + // fails with the given messages + // void fail( const QString & message, const QString & details = "" ) ; +}; + +//============================================================================= +// Test Engine +//============================================================================= + +/// This is the main test engine +class EDBEE_EXPORT TestEngine : public QObject +{ + Q_OBJECT +public: + explicit TestEngine(); + virtual ~TestEngine(); + + virtual bool hasTest(TestCase *object); + virtual void addTest(TestCase *object); + virtual int runAll(); + virtual int run(TestCase *object); + virtual int run(const QString &name); + virtual void startRun(); + virtual void endRun(); + + virtual OutputHandler *outputHandler() { return outputHandlerRef_; } + virtual void setOutputHandler(OutputHandler *handler) + { + outputHandlerRef_ = handler; + } + + /// This method returns the current test + virtual TestCase *currentTest() { return currentTestRef_; } + + /// This method returns the current class name + virtual const char *currentClassName() + { + return currentTestRef_->metaObject()->className(); + } + + /// This method returns the current method name + virtual QString currentMethodName() { return currentMethodName_; } + + virtual void giveTestResult(TestResult *testResult); + + /// This method returns a list of test results + virtual QList<TestResult *> testResultList() { return testResultList_; } + +private: + QList<TestCase *> testRefList_; ///< All registered test libs + OutputHandler *outputHandlerRef_; ///< The output handler + + // the current state + TestCase *currentTestRef_; ///< the current test + QString currentMethodName_; ///< The current method name + // const char* currentMethodNameRef_; ///< A reference to the current + // method + + // test results + QList<TestResult *> testResultList_; ///< the test results +}; + +//============================================================================= +// Appending Tests via a Macro +//============================================================================= + +// this method returns the test engine +inline TestEngine &engine() +{ + static TestEngine engine; + return engine; +} + +template<class T> +class EDBEE_EXPORT Test +{ +public: + QSharedPointer<T> child; + + Test(const QString &name) + : child(new T) + { + child->setObjectName(name); + engine().addTest(child.data()); + } +}; + +} +} // edbee::test diff --git a/lib/edbee-lib/edbee/util/textcodec.cpp b/lib/edbee-lib/edbee/util/textcodec.cpp new file mode 100644 index 00000000..ac0c3643 --- /dev/null +++ b/lib/edbee-lib/edbee/util/textcodec.cpp @@ -0,0 +1,111 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include <QTextCodec> +#include <QApplication> + +#include "textcodec.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// The codecmanager constructs +/// This method registeres all codecs available in Qt +TextCodecManager::TextCodecManager() +{ + // append all special encodings + QList<QByteArray> encList; + encList << "UTF-8" << "UTF-16" << "UTF-16BE" << "UTF-16LE" << "UTF-32" + << "UTF-32BE" << "UTF-32LE"; + foreach (QByteArray enc, encList) + { + QTextCodec *codec = QTextCodec::codecForName(enc); + giveTextCodec( + new TextCodec(QString(codec->name()), codec, QTextCodec::IgnoreHeader)); + giveTextCodec( + new TextCodec(QStringLiteral("%1 with BOM").arg(QString(codec->name())), + codec, QTextCodec::DefaultConversion)); + } + + // append the items + QList<QByteArray> names = QTextCodec::availableCodecs(); + std::sort(names.begin(), names.end()); + foreach (QByteArray name, names) + { + QTextCodec *codec = QTextCodec::codecForName(name); + if (!codecRefMap_.contains(codec->name())) + { + TextCodec *textCodec + = new TextCodec(name, codec, QTextCodec::DefaultConversion); + giveTextCodec(textCodec); + } + } +} + +/// Cleansup the codec list +TextCodecManager::~TextCodecManager() +{ + qDeleteAll(codecList_); +} + +/// Registers the given codec. The ownership of this codec is transfered to the +/// codec manager +/// @param codec the codec to register. +void TextCodecManager::giveTextCodec(TextCodec *codec) +{ + codecList_.append(codec); + codecRefMap_.insert(codec->name(), codec); +} + +/// Returns the list with all codecs +QList<TextCodec *> TextCodecManager::codecList() +{ + return codecList_; +} + +/// Returns the given codec for the given name +/// @param name the name of the codec to search +/// @return the found codec or 0 if not found +TextCodec *TextCodecManager::codecForName(const QString &name) +{ + return codecRefMap_.value(name); +} + +//---------------------------------------------------------- + +/// The default constructs for a textcodec +/// @param name the name of the codec +/// @param codec the Qt codec to reference +/// @param the QTextCodec conversion flags (is used for creating codecs with and +/// without BOM) +TextCodec::TextCodec(const QString &name, const QTextCodec *codec, + QTextCodec::ConversionFlags flags) + : name_(name) + , codecRef_(codec) + , flags_(flags) +{ +} + +/// Returns the QTextCodec reference +const QTextCodec *TextCodec::codec() +{ + return codecRef_; +} + +/// Creates a QTextEncoder +QTextEncoder *TextCodec::makeEncoder() +{ + return codec()->makeEncoder(flags_); +} + +/// Creates a QTextDecodec +QTextDecoder *TextCodec::makeDecoder() +{ + return codec()->makeDecoder(flags_); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/textcodec.h b/lib/edbee-lib/edbee/util/textcodec.h new file mode 100644 index 00000000..54eb04e1 --- /dev/null +++ b/lib/edbee-lib/edbee/util/textcodec.h @@ -0,0 +1,58 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QObject> +#include <QList> +#include <QHash> +#include <QTextEncoder> + +namespace edbee +{ + +class TextCodec; + +/// The codec manager is used for managing codecs +/// You shouldnt' instantiatie this class, it's better to access the +/// codec manager instantiated via the edbee::Edbee +class EDBEE_EXPORT TextCodecManager +{ +public: + TextCodecManager(); + ~TextCodecManager(); + +public: + void giveTextCodec(TextCodec *codec); + QList<TextCodec *> codecList(); + TextCodec *codecForName(const QString &name); + +private: + QList<TextCodec *> codecList_; + QHash<QString, TextCodec *> codecRefMap_; +}; + +/// This class represents a single text codec +/// The codec has a name and contains methods to create encoders and decoders +class EDBEE_EXPORT TextCodec +{ +public: + TextCodec(const QString &name, const QTextCodec *codec, + QTextCodec::ConversionFlags flags); + const QTextCodec *codec(); + QTextEncoder *makeEncoder(); + QTextDecoder *makeDecoder(); + + QString name() { return name_; } + +private: + QString name_; ///< The name of this codec + const QTextCodec *codecRef_; ///< The QT Codec + QTextCodec::ConversionFlags flags_; ///< Special conversion flags +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/textcodecdetector.cpp b/lib/edbee-lib/edbee/util/textcodecdetector.cpp new file mode 100644 index 00000000..8a8ae05f --- /dev/null +++ b/lib/edbee-lib/edbee/util/textcodecdetector.cpp @@ -0,0 +1,292 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "textcodecdetector.h" + +#include <QTextCodec> +#include <QByteArray> + +#include "textcodec.h" +#include "edbee/edbee.h" +#include "edbee/debug.h" + +namespace edbee +{ + +static TextCodec *globalPreferedCodecRef_ = 0; ///< The globally prefered codec + +static inline TextCodecManager *codecManager() +{ + return Edbee::instance()->codecManager(); +} + +/// return the static global prefered codec +TextCodec *TextCodecDetector::globalPreferedCodec() +{ + if (!globalPreferedCodecRef_) + { + globalPreferedCodecRef_ = codecManager()->codecForName("UTF-8"); + Q_ASSERT(globalPreferedCodecRef_); + } + return globalPreferedCodecRef_; +} + +void TextCodecDetector::setGlobalPreferedCodec(TextCodec *codec) +{ + globalPreferedCodecRef_ = codec; +} + +TextCodecDetector::TextCodecDetector(const QByteArray *buffer, + TextCodec *preferedCodec) + : bufferRef_(buffer->constData()) + , bufferLength_(buffer->size()) + , preferedCodecRef_(0) + , fallbackCodecRef_(0) +{ + setPreferedCodec(preferedCodec); + setFallbackCodec(0); +} + +TextCodecDetector::TextCodecDetector(const char *buffer, int length, + TextCodec *preferedCodec) + : bufferRef_(buffer) + , bufferLength_(length) + , preferedCodecRef_(0) + , fallbackCodecRef_(0) +{ + setPreferedCodec(preferedCodec); + setFallbackCodec(0); +} + +TextCodecDetector::~TextCodecDetector() {} + +/// This method returns the prefered codec +void TextCodecDetector::setPreferedCodec(TextCodec *codec) +{ + if (codec) + { + preferedCodecRef_ = codec; + } + else + { + /// prefer UTF-8 + preferedCodecRef_ = globalPreferedCodec(); + } +} + +/// Sets the fallback text codec +/// @param codec the codec to use. When you use 0 the system codec is used +void TextCodecDetector::setFallbackCodec(TextCodec *codec) +{ + if (codec) + { + fallbackCodecRef_ = codec; + } + else + { + /// prefer System + fallbackCodecRef_ = Edbee::instance()->codecManager()->codecForName( + "ISO-8859-1"); // QTextCodec::codecForLocale(); // is identical to: + // QTextCodec::codecForName(“System”) + Q_ASSERT(fallbackCodecRef_); + } +} + +/// Detects the encoding of the provided buffer. +/// If Byte Order Markers are encountered at the beginning of the buffer, we +/// immidiately return the charset implied by this BOM. Otherwise, the file +/// would not be a human +/// readable text file. +/// +/// If there is no BOM, this method tries to discern whether the file is UTF-8 +/// or not. If it is not UTF-8, we assume the encoding is the default system +/// encoding (of course, it might be any 8-bit charset, but usually, an 8-bit +/// charset is the default one) +/// +/// It is possible to discern UTF-8 thanks to the pattern of characters with a +/// multi-byte sequence +/// +/// @code +/// UCS-4 range (hex.) UTF-8 octet sequence (binary) +/// 0000 0000-0000 007F 0xxxxxxx +/// 0000 0080-0000 07FF 110xxxxx 10xxxxxx +/// 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx +/// 0001 0000-001F FFFF 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx +/// 0020 0000-03FF FFFF 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx +/// 0400 0000-7FFF FFFF 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx +/// 10xxxxxx +/// @endcode +/// +/// With UTF-8, 0xFE and 0xFF never appear. +/// +/// @return the QTextCodec that is 'detected' +TextCodec *TextCodecDetector::detectCodec() +{ + // if the file has a Byte Order Marker, we can assume the file is in UTF-xx + // otherwise, the file would not be human readable + if (hasUTF8Bom(bufferRef_, bufferLength_)) + return codecManager()->codecForName("UTF-8 with BOM"); + if (hasUTF16LEBom(bufferRef_, bufferLength_)) + return codecManager()->codecForName("UTF-16LE with BOM"); + if (hasUTF16BEBom(bufferRef_, bufferLength_)) + return codecManager()->codecForName("UTF-16BE with BOM"); + if (hasUTF32LEBom(bufferRef_, bufferLength_)) + return codecManager()->codecForName("UTF-32LE with BOM"); + if (hasUTF32BEBom(bufferRef_, bufferLength_)) + return codecManager()->codecForName("UTF-32BE with BOM"); + + // if a byte has its most significant bit set, the file is in UTF-8 or in the + // default encoding otherwise, the file is in US-ASCII + bool highOrderBit = false; + + // if the file is in UTF-8, high order bytes must have a certain value, in + // order to be valid if it's not the case, we can assume the encoding is the + // default encoding of the system + bool validU8Char = true; + + // TODO the buffer is not read up to the end, but up to length - 6 + int length = bufferLength_; + int i = 0; + while (i < length - 6) + { + char b0 = bufferRef_[i]; + char b1 = bufferRef_[i + 1]; + char b2 = bufferRef_[i + 2]; + char b3 = bufferRef_[i + 3]; + char b4 = bufferRef_[i + 4]; + char b5 = bufferRef_[i + 5]; + if (b0 < 0) + { + // a high order bit was encountered, thus the encoding is not US-ASCII + // it may be either an 8-bit encoding or UTF-8 + highOrderBit = true; + + // a two-bytes sequence was encoutered + if (isTwoBytesSequence(b0)) + { + // there must be one continuation byte of the form 10xxxxxx, + // otherwise the following characteris is not a valid UTF-8 construct + if (!isContinuationChar(b1)) + validU8Char = false; + else + i++; + } + // a three-bytes sequence was encoutered + else if (isThreeBytesSequence(b0)) + { + // there must be two continuation bytes of the form 10xxxxxx, + // otherwise the following characteris is not a valid UTF-8 construct + if (!(isContinuationChar(b1) && isContinuationChar(b2))) + validU8Char = false; + else + i += 2; + } + // a four-bytes sequence was encoutered + else if (isFourBytesSequence(b0)) + { + // there must be three continuation bytes of the form 10xxxxxx, + // otherwise the following characteris is not a valid UTF-8 construct + if (!(isContinuationChar(b1) && isContinuationChar(b2) + && isContinuationChar(b3))) + validU8Char = false; + else + i += 3; + } + // a five-bytes sequence was encoutered + else if (isFiveBytesSequence(b0)) + { + // there must be four continuation bytes of the form 10xxxxxx, + // otherwise the following characteris is not a valid UTF-8 construct + if (!(isContinuationChar(b1) && isContinuationChar(b2) + && isContinuationChar(b3) && isContinuationChar(b4))) + validU8Char = false; + else + i += 4; + } + // a six-bytes sequence was encoutered + else if (isSixBytesSequence(b0)) + { + // there must be five continuation bytes of the form 10xxxxxx, + // otherwise the following characteris is not a valid UTF-8 construct + if (!(isContinuationChar(b1) && isContinuationChar(b2) + && isContinuationChar(b3) && isContinuationChar(b4) + && isContinuationChar(b5))) + validU8Char = false; + else + i += 5; + } + else + validU8Char = false; + } + if (!validU8Char) + break; + i++; + } + + // if no byte with an high order bit set, the encoding is US-ASCII + // (it might have been UTF-7, but this encoding is usually internally used + // only by mail systems) + if (!highOrderBit) + { + return preferedCodec(); + // return fallbackCodec(); /// This could be US-ASCII + } + + // if no invalid UTF-8 were encountered, we can assume the encoding is UTF-8, + // otherwise the file would not be human readable + if (validU8Char) + { + // return QTextCodec::codecForName("UTF-8"); + return preferedCodec(); // we sort of assume prefered codec is UTF-8 :P + } + + // finally, if it's not UTF-8 nor US-ASCII, let's assume the encoding is the + // default encoding + return fallbackCodec(); +} + +/// Has a Byte Order Marker for UTF-8 +bool TextCodecDetector::hasUTF8Bom(const char *bom, int length) +{ + if (length < 3) + return false; + return (bom[0] == -17 && bom[1] == -69 && bom[2] == -65); +} + +/// Has a Byte Order Marker for UTF-16 Low Endian +/// (ucs-2le, ucs-4le, and ucs-16le). +bool TextCodecDetector::hasUTF16LEBom(const char *bom, int length) +{ + if (length < 2) + return false; + return (bom[0] == -1 && bom[1] == -2); +} + +/// Has a Byte Order Marker for UTF-16 Big Endian +/// (utf-16 and ucs-2). +bool TextCodecDetector::hasUTF16BEBom(const char *bom, int length) +{ + if (length < 2) + return false; + return (bom[0] == -2 && bom[1] == -1); +} + +/// Has a Byte Order Marker for UTF-32 Low Endian +bool TextCodecDetector::hasUTF32LEBom(const char *bom, int length) +{ + if (length < 4) + return false; + return (bom[0] == -1 && bom[1] == -2 && bom[2] == 0 && bom[3] == 0); +} + +/// Has a Byte Order Marker for UTF-32 Big Endian +bool TextCodecDetector::hasUTF32BEBom(const char *bom, int length) +{ + if (length < 4) + return false; + return (bom[0] == 0 && bom[1] == 0 && bom[2] == -2 && bom[3] == -1); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/textcodecdetector.h b/lib/edbee-lib/edbee/util/textcodecdetector.h new file mode 100644 index 00000000..0f3b8a80 --- /dev/null +++ b/lib/edbee-lib/edbee/util/textcodecdetector.h @@ -0,0 +1,113 @@ +/** + * Copyright 2011-2012 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +class QByteArray; + +namespace edbee +{ + +class TextCodec; + +/// This class is used to detect the encoding of a given string. +/// The detector is based on the Java code of Guillaume LAFORGE +/// +/// Utility class to guess the encoding of a given byte array. +/// The guess is unfortunately not 100% sure. Especially for 8-bit charsets. +/// It's not possible to know which 8-bit charset is used. Except through +/// statistical analysis. we will then infer that the charset encountered is the +/// same as the default standard charset. +/// +/// On the other hand, unicode files encoded in UTF-16 (low or big endian) or +/// UTF-8 files with a Byte Order Marker are easy to find. For UTF-8 files with +/// no BOM, if the buffer is wide enough, it's easy to guess. +/// +/// A byte buffer of 4KB or 8KB is sufficient to be able to guess the encoding. +/// +/// TextCodecDetector detector( QByteArray) ; +/// TextCodec encoding = detector.guessEncoding( QByteArray arr, QTextCode +/// fallback ); +class EDBEE_EXPORT TextCodecDetector +{ + +public: + static TextCodec *globalPreferedCodec(); + static void setGlobalPreferedCodec(TextCodec *codec); + + explicit TextCodecDetector(const QByteArray *buffer = 0, + TextCodec *preferedCodec = 0); + explicit TextCodecDetector(const char *buffer, int length = 0, + TextCodec *preferedCodec = 0); + virtual ~TextCodecDetector(); + + virtual TextCodec *detectCodec(); + + /// Sets the buffer reference + virtual void setBuffer(const char *buf, int length) + { + bufferRef_ = buf; + bufferLength_ = length; + } + + /// Returns the buffer reference + virtual const char *buffer() const { return bufferRef_; } + + /// Returns the buffer length + virtual int bufferLength() { return bufferLength_; } + + virtual void setPreferedCodec(TextCodec *codec = 0); + virtual TextCodec *preferedCodec() { return preferedCodecRef_; } + + virtual void setFallbackCodec(TextCodec *codec = 0); + virtual TextCodec *fallbackCodec() const { return fallbackCodecRef_; } + +protected: + /// If the byte has the form 10xxxxx, then it's a continuation byte of a + /// multiple byte character; + virtual bool isContinuationChar(char b) { return /*-128 <= b && */ b <= -65; } + + /// If the byte has the form 110xxxx, then it's the first byte of a two-bytes + /// sequence character. + virtual bool isTwoBytesSequence(char b) { return -64 <= b && b <= -33; } + + /// If the byte has the form 1110xxx, then it's the first byte of a + /// three-bytes sequence character. + virtual bool isThreeBytesSequence(char b) { return -32 <= b && b <= -17; } + + /// If the byte has the form 11110xx, then it's the first byte of a four-bytes + /// sequence character. + virtual bool isFourBytesSequence(char b) { return -16 <= b && b <= -9; } + + /// If the byte has the form 11110xx, then it's the first byte of a five-bytes + /// sequence character. + virtual bool isFiveBytesSequence(char b) { return -8 <= b && b <= -5; } + + // If the byte has the form 1110xxx, then it's the first byte of a six-bytes + // sequence character. + virtual bool isSixBytesSequence(char b) { return -4 <= b && b <= -3; } + +public: + static bool hasUTF8Bom(const char *buffer, int length); + static bool hasUTF16LEBom(const char *buffer, int length); + static bool hasUTF16BEBom(const char *buffer, int length); + static bool hasUTF32LEBom(const char *buffer, int length); + static bool hasUTF32BEBom(const char *buffer, int length); + +private: + // const QByteArray *bufferRef_; ///< A reference to the current buffer of + // data + const char *bufferRef_; ///< A reference to the buffer + int bufferLength_; ///< The size of the buffer + + TextCodec *preferedCodecRef_; ///< The prefered codec to use + TextCodec *fallbackCodecRef_; ///< The default codec to return. This is the + ///< codec to use if there's a problem detecting + ///< the codec or returning the prefered codec +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/util.cpp b/lib/edbee-lib/edbee/util/util.cpp new file mode 100644 index 00000000..7a2957ca --- /dev/null +++ b/lib/edbee-lib/edbee/util/util.cpp @@ -0,0 +1,84 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "util.h" + +#include <QString> + +#include "edbee/debug.h" + +namespace edbee +{ + +/// Converst all tabs to sapces of the given string, using the current +/// tab/indent settings It converts "\t" to spaces. +/// +/// @param str the string where to convert the tabs to space +/// @param tabSize the size of a single tab. This needs to be at least 1 +/// @return A string with all tabs converted to spaces +QString Util::convertTabsToSpaces(const QString &str, int tabSize) +{ + Q_ASSERT(tabSize > 0); + + QString result; + result.reserve(str.length()); + + // append all characters to the result + for (int i = 0, cnt = str.size(); i < cnt; ++i) + { + QChar c = str.at(i); + + // when a tab character is used it is converted to the correct column + if (c == '\t') + { + int amount = tabSize - result.length() % tabSize; + result.append(QStringLiteral(" ").repeated(amount)); + } + else + { + result.append(c); + } + } + return result; +} + +/// This method returns all tab-column offsets of the given string +/// @param str the string to convert +/// @param tabSize the tab size to use for conversion +/// @return a vector with the character-offset in the given string that contains +/// the given tab-column +QList<int> Util::tabColumnOffsets(const QString &str, int tabSize) +{ + // build the resut (column 0 is always available) + QList<int> offsets; + offsets.push_back(0); + + int column = 0; + + // iterate over all characters + for (int offset = 0, cnt = str.size(); offset < cnt; ++offset) + { + QChar c = str.at(offset); + + // when a tab character is found, we need to jump to the next column + if (c == '\t') + { + int amount = tabSize - column % tabSize; + column += amount; + } + else + { + ++column; + } + // when we've reached another tab-column, we add the column + if (column % tabSize == 0) + { + offsets.push_back(offset + 1); + } + } + return offsets; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/util/util.h b/lib/edbee-lib/edbee/util/util.h new file mode 100644 index 00000000..7aa801f6 --- /dev/null +++ b/lib/edbee-lib/edbee/util/util.h @@ -0,0 +1,68 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QList> + +class QString; + +namespace edbee +{ + +/// A global utiltity class. +/// The purpose of this class is to put 'global' function that don't quite fit +/// on other places +/// +/// You can use this class like this: Util().converTabsToSpaces() +class EDBEE_EXPORT Util +{ +public: + QString convertTabsToSpaces(const QString &str, int tabSize); + QList<int> tabColumnOffsets(const QString &str, int tabSize); + + /// This method calculates 2 intersections between 2 ranges. + /// @param exclusive if it is exclusive then an overlap will not be included. + /// In other words: + /// - Inclusive: end < begin + /// - Exclusive: end <= begin + /// @param resultBegin a pointer to the variable receiving the result + /// @param resultEnd a pointer to the variable receiving the result + /// @return false => no overlap, true => overlap + template<typename T> + bool intersection(T begin1, T end1, T begin2, T end2, bool exclusive = false, + T *resultBegin = 0, T *resultEnd = 0) + { + if (exclusive) + { + if (end1 <= begin2) + return false; + if (end2 <= begin1) + return false; + } + else + { + if (end1 < begin2) + return false; + if (end2 < begin1) + return false; + } + + // assign the result + if (resultBegin) + { + *resultBegin = qMax(begin1, begin2); + } + if (resultEnd) + { + *resultEnd = qMin(end1, end2); + } + return true; + } +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/accessibletexteditorwidget.cpp b/lib/edbee-lib/edbee/views/accessibletexteditorwidget.cpp new file mode 100644 index 00000000..811c7d89 --- /dev/null +++ b/lib/edbee-lib/edbee/views/accessibletexteditorwidget.cpp @@ -0,0 +1,631 @@ +#include "accessibletexteditorwidget.h" + +#include <QWidget> +#include <QAccessibleInterface> + +#include "edbee/models/changes/textchange.h" +#include "edbee/models/textdocument.h" +#include "edbee/models/textrange.h" +#include "edbee/texteditorwidget.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/views/textselection.h" +#include "edbee/views/textrenderer.h" +#include "edbee/views/components/texteditorcomponent.h" + +#include "edbee/debug.h" + +/// The direct usage of the TextEditorWidget doesn't work. +/// This works for Windows Reader and Mac OS X Speaker, but doesn't seem to work +/// for NVDA The TexteditorComponent is the component that has the true focus +#define VIA_EDITOR_COMPONENT + +/// QT Acessibility has an issue with reporting blank lines between elements +/// lines. defining 'WINDOWS_EMPTY_LINE_READING_ERROR_FIX' adds a \r before a +/// newline. Which is a workaround for this issue. (It does some offset-length +/// and string magic when this is enabled) +#if defined(Q_OS_WIN32) +# define WINDOWS_END_LINE_READ_ERROR_FIX +# define WINDOWS_LAST_LINE_ERROR_FIX +# define WINDOWS_EMPTY_LINE_FIX "\r\n" +#endif + +namespace edbee +{ + +/// Workaround for the strang line-reading on windows +/// It virtually replaces every <newline> with <space><newline> +static int D2V(TextEditorWidget *widget, int offset) +{ +#ifdef WINDOWS_END_LINE_READ_ERROR_FIX + int line = widget->textDocument()->lineFromOffset(offset); + return offset + line; +#else + Q_UNUSED(widget) + return offset; +#endif +} + +/// Converts the virtual-offset to the document-offset +static int V2D(TextEditorWidget *widget, int vOffset) +{ +#ifdef WINDOWS_END_LINE_READ_ERROR_FIX + TextDocument *doc = widget->textDocument(); + int displacement = 0; + for (int i = 0, cnt = doc->lineCount(); i < cnt; ++i) + { + int lineVOffset = doc->offsetFromLine(i) + i; + + if (vOffset < lineVOffset) + { + return vOffset - displacement; // remove the newline count + } + displacement = i; + } + return vOffset - displacement; +#else + Q_UNUSED(widget) + return vOffset; +#endif +} + +/// returns the virtual length of the textdocument +static int VLEN(TextEditorWidget *widget) +{ +#if !defined(WINDOWS_END_LINE_READ_ERROR_FIX) + return widget->textDocument()->length(); +#elif defined(WINDOWS_LAST_LINE_ERROR_FIX) + return widget->textDocument()->length() + widget->textDocument()->lineCount(); +#else + return widget->textDocument()->length() + widget->textDocument()->lineCount() + - 1; +#endif +} + +/// Converts the given text to a virtual text +/// It prepends every newline with a space +static const QString VTEXT(QString str) +{ +#ifdef WINDOWS_END_LINE_READ_ERROR_FIX + QString result = str.replace(QString("\n"), QString(WINDOWS_EMPTY_LINE_FIX)); + return result; +#else + return str; +#endif +} + +/// Converts the given text to a virtual text +/// It prepends every newline with a space +static const QString VTEXT(TextDocument *doc) +{ +#if !defined(WINDOWS_END_LINE_READ_ERROR_FIX) + return doc->text(); +#elif defined(WINDOWS_LAST_LINE_ERROR_FIX) + QString result = VTEXT(doc->text()); + return result + WINDOWS_EMPTY_LINE_FIX; +#else + return VTEXT(doc->text()); +#endif +} + +/// Return a part of text, translating the virtual characters +/// It prepends every newline with a space +/// It assumes an extra space + newline is placed at the end of the document +static const QString VTEXT_PART(TextDocument *doc, int offset, int length) +{ +#if !defined(WINDOWS_END_LINE_READ_ERROR_FIX) + if (length < 0) + { + return QString(); + } + + return doc->textPart(offset, qMin(length, doc->length() - offset)); +#else + int docLength = doc->length(); +# if defined(WINDOWS_LAST_LINE_ERROR_FIX) + int endOffset = qMin(offset + length, docLength + 2); +# endif // WINDOWS_LAST_LINE_ERROR_FIX - First use + // qDebug() << "VTEXT_PART: " << offset << ", " << length << " :: docLength: " + // << docLength << ", endOffset: " << endOffset; + + QString txt; + if (offset < docLength) + { + int len = offset + length > docLength ? docLength - offset : length; + // qDebug() << " - A offset:" << offset <<", len: " << len; + txt = VTEXT(doc->textPart(offset, len)); + } + +# if defined(WINDOWS_LAST_LINE_ERROR_FIX) + // qDebug() << " - B endOffset: " << endOffset << " >= " << docLength; + if (endOffset >= docLength) + { + txt.append(WINDOWS_EMPTY_LINE_FIX); + } +# endif // WINDOWS_LAST_LINE_ERROR_FIX - Second use + // qDebug() << " => " << txt; + return txt; +#endif // WINDOWS_END_LINE_READ_ERROR_FIX +} + +AccessibleTextEditorWidget::AccessibleTextEditorWidget(TextEditorWidget *widget) +#ifdef VIA_EDITOR_COMPONENT + : QAccessibleWidget(widget->textEditorComponent(), QAccessible::EditableText) +#else + : QAccessibleWidget(widget, QAccessible::EditableText) +#endif + , textWidgetRef_(widget) +{ +} + +AccessibleTextEditorWidget::~AccessibleTextEditorWidget() {} + +/// Construct the AccessibleTextEditor interface for the given widget +QAccessibleInterface * +AccessibleTextEditorWidget::factory(const QString &className, QObject *object) +{ + // edbee::TextMarginComponent, edbee::TextEditorScrollArea, + // edbee::TextEditorComponent +#ifdef VIA_EDITOR_COMPONENT + if (className == QLatin1String("edbee::TextEditorComponent") && object + && object->isWidgetType()) + { + return new AccessibleTextEditorWidget( + static_cast<edbee::TextEditorComponent *>(object) + ->controller() + ->widget()); + } +#else + if (className == QLatin1String("edbee::TextEditorWidget") && object + && object->isWidgetType()) + { + return new AccessibleTextEditorWidget( + static_cast<edbee::TextEditorWidget *>(object)); + } + +#endif + + return nullptr; +} + +/// Returns the widget that should be used for accessibility events +QWidget * +AccessibleTextEditorWidget::eventWidgetForTextEditor(TextEditorWidget *widget) +{ +#ifdef VIA_EDITOR_COMPONENT + return widget->textEditorComponent(); +#else + return widget; +#endif +} + +/// Notifies a text-selection change event +void AccessibleTextEditorWidget::notifyTextSelectionEvent( + TextEditorWidget *widget, TextSelection *selection) +{ + QWidget *eventWidget = eventWidgetForTextEditor(widget); + for (int i = 0, cnt = selection->rangeCount(); i < cnt; ++i) + { + TextRange range = selection->range(i); + + QAccessibleTextSelectionEvent ev(eventWidget, D2V(widget, range.min()), + D2V(widget, range.max())); + ev.setCursorPosition(D2V(widget, range.caret())); + + // qDebug() << " !!updateAccessibility: + // QAccessibleTextSelectionEvent: " << range.min()<< ", " << + // range.max() << ", " << range.caret(); + + QAccessible::updateAccessibility(&ev); + + // also send a caret event for range 0 without a selection + if (i == 0 && !range.hasSelection()) + { + const QAccessibleTextInterface *ti + = QAccessible::queryAccessibleInterface(eventWidget)->textInterface(); + QAccessibleTextCursorEvent event(eventWidget, ti->cursorPosition()); + QAccessible::updateAccessibility(&event); + } + } +} + +/// Notifies a text change event happens +void AccessibleTextEditorWidget::notifyTextChangeEvent(TextEditorWidget *widget, + TextBufferChange *change, + QString oldDocText) +{ + QWidget *eventWidget = eventWidgetForTextEditor(widget); + + QString oldText = VTEXT(oldDocText); + QString newText = VTEXT(QString(change->newText())); + + QAccessibleTextUpdateEvent ev(eventWidget, D2V(widget, change->offset()), + oldText, newText); + // TODO: When a caret is included, (Inherited change, use this caret position) + + // qDebug() << "-- change: length: " << change->length() + // << ", newTextLength: " << change->newTextLength() + // << ", offset :" << change->offset() + // << ", newText: " << QString(change->newText()) + // << ", CONTENT: " << widget->textDocument()->text(); + // qDebug() << "!! updateAccessibility: QAccessibleTextUpdateEvent: " << + // change->offset()<< ", oldText: " << oldText << ", newText: " << newText; + + QAccessible::updateAccessibility(&ev); +} + +void *AccessibleTextEditorWidget::interface_cast(QAccessible::InterfaceType t) +{ + if (t == QAccessible::TextInterface) + { + return static_cast<QAccessibleTextInterface *>(this); + } + return QAccessibleWidget::interface_cast(t); +} + +QAccessible::State AccessibleTextEditorWidget::state() const +{ + QAccessible::State s = QAccessibleWidget::state(); + s.selectableText = true; + s.multiLine = true; + s.focusable = true; + s.readOnly = false; + s.editable = true; + + return s; +} + +/// Returns a selection. The size of the selection is returned in startOffset +/// and endOffset. If there is no selection both startOffset and endOffset are +/// nullptr. +/// +/// The accessibility APIs support multiple selections. For most widgets though, +/// only one selection is supported with selectionIndex equal to 0. +void AccessibleTextEditorWidget::selection(int selectionIndex, int *startOffset, + int *endOffset) const +{ + if (selectionIndex >= textSelection()->rangeCount()) + { + *startOffset = 0; + *endOffset = 0; + } + + TextRange &range = textSelection()->range(selectionIndex); + *startOffset = D2V(textWidget(), range.min()); + *endOffset = D2V(textWidget(), range.max()); + // qDebug() << " selection >> " << selectionIndex << ", " << range.min() << " + // =>" << *startOffset << ", " << range.max() << " => " << *endOffset; +} + +/// Returns the number of selections in this text. +int AccessibleTextEditorWidget::selectionCount() const +{ + if (!textSelection()->hasSelection()) + return 0; // no selection (only caret) + return textSelection()->rangeCount(); +} + +/// Select the text from startOffset to endOffset. The startOffset is the first +/// character that will be selected. The endOffset is the first character that +/// will not be selected. +/// +/// When the object supports multiple selections (e.g. in a word processor), +/// this adds a new selection, otherwise it replaces the previous selection. +/// +/// The selection will be endOffset - startOffset characters long. +void AccessibleTextEditorWidget::addSelection(int startOffset, int endOffset) +{ + TextSelection selection = *textSelection(); + selection.addRange(V2D(textWidget(), startOffset), + V2D(textWidget(), endOffset)); + controller()->changeAndGiveTextSelection(&selection); +} + +/// Clears the selection with index selectionIndex. +void AccessibleTextEditorWidget::removeSelection(int selectionIndex) +{ + TextSelection selection = *textSelection(); + selection.removeRange(selectionIndex); + controller()->changeAndGiveTextSelection(&selection); +} + +/// Set the selection selectionIndex to the range from startOffset to endOffset. +void AccessibleTextEditorWidget::setSelection(int selectionIndex, + int startOffset, int endOffset) +{ + TextSelection selection = *textSelection(); + selection.setRange(V2D(textWidget(), startOffset), + V2D(textWidget(), endOffset), selectionIndex); + controller()->changeAndGiveTextSelection(&selection); +} + +/// Returns the current cursor position. +int AccessibleTextEditorWidget::cursorPosition() const +{ + int caret = D2V(textWidget(), textSelection()->range(0).caret()); + return caret; +} + +/// Move the cursor position +void AccessibleTextEditorWidget::setCursorPosition(int position) +{ + // qDebug() << "AccessibleTextEditorWidget::setCursorPosition: " << position + // << " => <" << V2D(textWidget(), position); + controller()->moveCaretToOffset(V2D(textWidget(), position), false); +} + +QString AccessibleTextEditorWidget::text(QAccessible::Text t) const +{ + if (t != QAccessible::Value) + { + return QAccessibleWidget::text(t); + } + return VTEXT(textWidget()->textDocument()); +} + +/// Returns the text from startOffset to endOffset. The startOffset is the first +/// character that will be returned. The endOffset is the first character that +/// will not be returned. +QString AccessibleTextEditorWidget::text(int vStartOffset, int vEndOffset) const +{ + int startOffset = V2D(textWidget(), vStartOffset); + int endOffset = V2D(textWidget(), vEndOffset); + + // qDebug() << "text: " << VTEXT_PART(textWidget()->textDocument(), + // startOffset, endOffset - startOffset); qDebug() << " - vStartOffset " + // << vStartOffset << ", vEndOffset " << vEndOffset ; qDebug() << " - + // startOffset " << startOffset << ", endOffset: " << endOffset << ", len: " + // << endOffset-startOffset << " (docLength: " << + // textWidget()->textDocument()->length() <<")"; + return VTEXT_PART(textWidget()->textDocument(), startOffset, + endOffset - startOffset); +} + +/// Returns the length of the text (total size including spaces). +int AccessibleTextEditorWidget::characterCount() const +{ + // qDebug() << " characterCount >> " << VLEN(textWidget()); + return VLEN(textWidget()); +} + +/// Returns the position and size of the character at position offset in screen +/// coordinates. +QRect AccessibleTextEditorWidget::characterRect(int vOffset) const +{ + TextEditorComponent *comp = textWidget()->textEditorComponent(); + int offset = V2D(textWidget(), vOffset); + + // workaround for newline char rect (is at the wrong location) + // Very dirty workaround, it's dependent on the selection +#ifdef WINDOWS_END_LINE_READ_ERROR_FIX + if (offset > 0 && offset <= textDocument()->length()) + { + TextRange &range = textSelection()->range(0); + if (range.hasSelection()) + { + if (offset == range.max() || textDocument()->charAt(offset) == '\n') + { + offset -= 1; + } + } + } + +#endif + + int xPos = this->renderer()->xPosForOffset(offset); + int yPos = this->renderer()->yPosForOffset(offset); + QPoint point(xPos, yPos); + QPoint pointScreen = comp->mapToGlobal(point); + + // qDebug() << " characterRect >>" << vOffset << " => " << offset << ": " << + // pointScreen; + return QRect(pointScreen.x(), pointScreen.y(), renderer()->emWidth(), + renderer()->lineHeight()); +} + +/// Returns the offset of the character at the point in screen coordinates. +int AccessibleTextEditorWidget::offsetAtPoint(const QPoint &point) const +{ + int line = renderer()->rawLineIndexForYpos(point.y()); + int col = renderer()->columnIndexForXpos(line, point.x()); + // qDebug() << " offsetAtPoint >>" << point << ": " << line << ", " << col; + + return D2V(textWidget(), textDocument()->offsetFromLineAndColumn(line, col)); +} + +/// Ensures that the text between startIndex and endIndex is visible. +void AccessibleTextEditorWidget::scrollToSubstring(int startIndex, int endIndex) +{ + Q_UNUSED(endIndex) + // qDebug() << " scrollToSubstring >>" << startIndex << ", " << endIndex; + controller()->scrollOffsetVisible(V2D(textWidget(), startIndex)); +} + +/// Returns the text attributes at the position offset. +/// In addition the range of the attributes is returned in startOffset and +/// endOffset. +QString AccessibleTextEditorWidget::attributes(int offset, int *startOffset, + int *endOffset) const +{ + Q_UNUSED(offset) + Q_UNUSED(startOffset) + Q_UNUSED(endOffset) + // qDebug() << " attributes >>" << offset << ", " << *startOffset << ", " << + // *endOffset; + return QString(); +} + +/// Returns the text item of type boundaryType that is right after offset offset +/// and sets startOffset and endOffset values to the start and end positions of +/// that item; returns an empty string if there is no such an item. Sets +/// startOffset and endOffset values to -1 on error. +/// +/// This default implementation is provided for small text edits. A word +/// processor or text editor should provide their own efficient implementations. +/// This function makes no distinction between paragraphs and lines. +/// +/// Note: this function can not take the cursor position into account. By +/// convention an offset of -2 means that this function should use the cursor +/// position as offset. Thus an offset of -2 must be converted to the cursor +/// position before calling this function. An offset of -1 is used for the text +/// length and custom implementations of this function have to return the result +/// as if the length was passed in as offset. +QString AccessibleTextEditorWidget::textAfterOffset( + int vOffset, QAccessible::TextBoundaryType boundaryType, int *startOffset, + int *endOffset) const +{ + if (boundaryType == QAccessible::LineBoundary && vOffset >= 0) + { + int offset = V2D(textWidget(), vOffset); + + int line = textDocument()->lineFromOffset(offset); + // qDebug() << " => " << textDocument()->line(line); + int start = textDocument()->offsetFromLine(line); + int end = textDocument()->offsetFromLine(line + 1); + + QString str = VTEXT_PART(textDocument(), start, end - start); + *startOffset = D2V(textWidget(), start); + *endOffset = *startOffset + str.length(); // D2V(textWidget(), end); + + // qDebug() << "textAfterOffset: vOffset: " << vOffset << " => " << + // offset + // << ", startOffset: " << *startOffset << " (start: " << + // start << ")" + // << ", endOffset: " << *endOffset << " (end: " << end << + // ")" + // << " => " << str; + return str; + } + + QString str = QAccessibleTextInterface::textAfterOffset( + vOffset, boundaryType, startOffset, endOffset); + // qDebug() << "?? textAfterOffset: vOffset: " << vOffset << ", + // boundaryType: " << boundaryType << " => " << str << " (" << *startOffset + // << ", " << *endOffset <<")"; + return str; +} + +/// Returns the text item of type boundaryType at offset offset and sets +/// startOffset and endOffset values to the start and end positions of that +/// item; returns an empty string if there is no such an item. Sets startOffset +/// and endOffset values to -1 on error. +/// +/// This default implementation is provided for small text edits. A word +/// processor or text editor should provide their own efficient implementations. +/// This function makes no distinction between paragraphs and lines. +/// +/// Note: this function can not take the cursor position into account. By +/// convention an offset of -2 means that this function should use the cursor +/// position as offset. Thus an offset of -2 must be converted to the cursor +/// position before calling this function. An offset of -1 is used for the text +/// length and custom implementations of this function have to return the result +/// as if the length was passed in as offset. +QString AccessibleTextEditorWidget::textAtOffset( + int vOffset, QAccessible::TextBoundaryType boundaryType, int *startOffset, + int *endOffset) const +{ + // QAccessible::CharBoundary 0 Use individual characters as boundary. + // QAccessible::WordBoundary 1 Use words as boundaries. + // QAccessible::SentenceBoundary 2 Use sentences as boundary. + // QAccessible::ParagraphBoundary 3 Use paragraphs as boundary. + // QAccessible::LineBoundary 4 Use newlines as boundary. + // QAccessible::NoBoundary 5 No boundary (use the whole text). + + if (boundaryType == QAccessible::LineBoundary && vOffset >= 0) + { + int offset = V2D(textWidget(), vOffset); + int line = textDocument()->lineFromOffset(offset); + + int start = textDocument()->offsetFromLine(line); + int end = textDocument()->offsetFromLine(line + 1); + + QString str = VTEXT_PART(textDocument(), start, end - start); + *startOffset = D2V(textWidget(), start); + *endOffset = (*startOffset) + str.length(); // D2V(textWidget(), end); + + // qDebug() << "textAtOffset: vOffset: " << vOffset << " => " << + // offset + // << ", startOffset: " << *startOffset << " (start: " << + // start << ")" + // << ", endOffset: " << *endOffset << " (end: " << end << + // ")" + // << " => " << str << " (" << str.length() << ")"; + return str; + } + + QString str = QAccessibleTextInterface::textAtOffset(vOffset, boundaryType, + startOffset, endOffset); + // qDebug() << "?? textAtOffset: offset: " << vOffset << ", boundaryType: " + // << boundaryType << " => " << str << " (" << *startOffset << ", " << + // *endOffset <<")"; + return str; +} + +/// Returns the text item of type boundaryType that is close to offset offset +/// and sets startOffset and endOffset values to the start and end positions of +/// that item; returns an empty string if there is no such an item. Sets +/// startOffset and endOffset values to -1 on error. +/// +/// This default implementation is provided for small text edits. A word +/// processor or text editor should provide their +/// own efficient implementations. This function makes no distinction between +/// paragraphs and lines. +/// +/// Note: this function can not take the cursor position into account. By +/// convention an offset of -2 means that this function should use the cursor +/// position as offset. Thus an offset of -2 must be converted to the cursor +/// position before calling this function. An offset of -1 is used for the text +/// length and custom implementations of this function have to return the result +/// as if the length was passed in as offset. +QString AccessibleTextEditorWidget::textBeforeOffset( + int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, + int *endOffset) const +{ + // qDebug() << "?? textBeforeOffset: offset: " << offset << ", boundaryType: " + // << boundaryType; + return QAccessibleTextInterface::textBeforeOffset(offset, boundaryType, + startOffset, endOffset); +} + +QAccessibleInterface *AccessibleTextEditorWidget::focusChild() const +{ + QAccessibleInterface *child = QAccessibleWidget::focusChild(); + return child; +} + +/// Returns the rectangle for the editor widget +/// It returns the location of the textWidget (even when the TextComponent has +/// got focus) +QRect AccessibleTextEditorWidget::rect() const +{ + QRect widgetRect = textWidget()->rect(); + QRect focusRect(textWidget()->mapToGlobal(widgetRect.topLeft()), + widgetRect.size()); + return focusRect; +} + +TextDocument *AccessibleTextEditorWidget::textDocument() const +{ + return textWidget()->textDocument(); +} + +TextSelection *AccessibleTextEditorWidget::textSelection() const +{ + return textWidget()->textSelection(); +} + +TextEditorController *AccessibleTextEditorWidget::controller() const +{ + return textWidget()->controller(); +} + +TextRenderer *AccessibleTextEditorWidget::renderer() const +{ + return textWidget()->textRenderer(); +} + +TextEditorWidget *AccessibleTextEditorWidget::textWidget() const +{ + return textWidgetRef_; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/accessibletexteditorwidget.h b/lib/edbee-lib/edbee/views/accessibletexteditorwidget.h new file mode 100644 index 00000000..89b086c2 --- /dev/null +++ b/lib/edbee-lib/edbee/views/accessibletexteditorwidget.h @@ -0,0 +1,86 @@ +#pragma once + +#include "edbee/exports.h" + +#include <QAccessibleTextInterface> +#include <QAccessibleWidget> +#include <QAccessibleTextInterface> +#include <QAccessibleEditableTextInterface> + +namespace edbee +{ + +class TextBufferChange; +class TextDocument; +class TextEditorController; +class TextEditorWidget; +class TextRenderer; +class TextSelection; + +class EDBEE_EXPORT AccessibleTextEditorWidget : public QAccessibleWidget, + public QAccessibleTextInterface +{ +public: + explicit AccessibleTextEditorWidget(TextEditorWidget *widget); + virtual ~AccessibleTextEditorWidget(); + +public: + static QAccessibleInterface *factory(const QString &className, + QObject *object); + static QWidget *eventWidgetForTextEditor(TextEditorWidget *widget); + + static void notifyTextSelectionEvent(TextEditorWidget *widget, + TextSelection *selection); + static void notifyTextChangeEvent(TextEditorWidget *widget, + TextBufferChange *change, QString oldText); + + void *interface_cast(QAccessible::InterfaceType t) override; + QAccessible::State state() const override; + + // QAccessibleTextInterface interface +public: + virtual void selection(int selectionIndex, int *startOffset, + int *endOffset) const override; + virtual int selectionCount() const override; + virtual void addSelection(int startOffset, int endOffset) override; + virtual void removeSelection(int selectionIndex) override; + virtual void setSelection(int selectionIndex, int startOffset, + int endOffset) override; + virtual int cursorPosition() const override; + virtual void setCursorPosition(int position) override; + virtual QString text(QAccessible::Text t) const override; + virtual QString text(int startOffset, int endOffset) const override; + virtual int characterCount() const override; + virtual QRect characterRect(int offset) const override; + virtual int offsetAtPoint(const QPoint &point) const override; + virtual void scrollToSubstring(int startIndex, int endIndex) override; + virtual QString attributes(int offset, int *startOffset, + int *endOffset) const override; + + virtual QString textAfterOffset(int offset, + QAccessible::TextBoundaryType boundaryType, + int *startOffset, + int *endOffset) const override; + virtual QString textAtOffset(int offset, + QAccessible::TextBoundaryType boundaryType, + int *startOffset, int *endOffset) const override; + virtual QString textBeforeOffset(int offset, + QAccessible::TextBoundaryType boundaryType, + int *startOffset, + int *endOffset) const override; + + virtual QAccessibleInterface *focusChild() const override; + virtual QRect rect() const override; + +protected: + TextDocument *textDocument() const; + TextSelection *textSelection() const; + TextEditorController *controller() const; + TextRenderer *renderer() const; + TextEditorWidget *textWidget() const; + +private: + TextEditorWidget *textWidgetRef_; +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/components/texteditorautocompletecomponent.cpp b/lib/edbee-lib/edbee/views/components/texteditorautocompletecomponent.cpp new file mode 100644 index 00000000..772d0f23 --- /dev/null +++ b/lib/edbee-lib/edbee/views/components/texteditorautocompletecomponent.cpp @@ -0,0 +1,690 @@ +#include "texteditorautocompletecomponent.h" + +#include <QApplication> +#include <QKeyEvent> +#include <QLayout> +#include <QHBoxLayout> +#include <QWidgetAction> +#include <QListWidget> +#include <QListWidgetItem> +#include <QTextEdit> +#include <QtGui> +#include <QTime> + +#include "edbee/edbee.h" +#include "edbee/models/textautocompleteprovider.h" +#include "edbee/models/textdocument.h" +#include "edbee/models/texteditorconfig.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/views/components/texteditorcomponent.h" +#include "edbee/views/components/textmargincomponent.h" +#include "edbee/views/textrenderer.h" +#include "edbee/views/textselection.h" +#include "edbee/views/texttheme.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +TextEditorAutoCompleteComponent::TextEditorAutoCompleteComponent( + TextEditorController *controller, TextEditorComponent *parent, + TextMarginComponent *margin) + : QWidget(parent) + , controllerRef_(controller) + , menuRef_(nullptr) + , editorComponentRef_(parent) + , marginComponentRef_(margin) + , eventBeingFiltered_(false) + , canceled_(false) + , infoTipRef_(nullptr) +{ + /// initialize the widget + QBoxLayout *layout = new QBoxLayout(QBoxLayout::TopToBottom); + layout->setSpacing(0); + layout->setContentsMargins(0, 0, 0, 0); + + this->setFocusPolicy(Qt::NoFocus); + this->setAttribute(Qt::WA_ShowWithoutActivating); + + menuRef_ = new QMenu(this); + menuRef_->setFocusPolicy(Qt::NoFocus); + menuRef_->setAttribute(Qt::WA_ShowWithoutActivating); + + listWidgetRef_ = new QListWidget(menuRef_); + listWidgetRef_->setFocusPolicy(Qt::NoFocus); + listWidgetRef_->setAttribute(Qt::WA_ShowWithoutActivating); + + listWidgetRef_->installEventFilter(this); + + menuRef_->installEventFilter(this); + menuRef_->setStyleSheet("QMenu { border: 1px solid black; }"); + listWidgetRef_->setObjectName("listWidgetRef"); + setLayout(layout); + resize(0, 0); + + QWidgetAction *wAction = new QWidgetAction(menuRef_); + wAction->setDefaultWidget(listWidgetRef_); + menuRef_->addAction(wAction); + + listWidgetRef_->setFocus(); + + infoTipRef_ = new FakeToolTip(controllerRef_, this); + + QPalette p = listWidgetRef_->palette(); + p.setColor(QPalette::Highlight, + p.color(QPalette::Highlight)); // prevents the non-focus gray color + p.setColor(QPalette::HighlightedText, p.color(QPalette::HighlightedText)); + p.setColor(QPalette::Base, QColor(37, 37, 38)); + p.setColor(QPalette::Text, Qt::white); + + listWidgetRef_->setAttribute(Qt::WA_NoMousePropagation, true); // do not wheel + listWidgetRef_->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); + listWidgetRef_->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + listWidgetRef_->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); + + AutoCompleteDelegate *acDel = new AutoCompleteDelegate(controllerRef_, this); + listWidgetRef_->setItemDelegate(acDel); + + // make clicking in the list word + listWidgetRef_->setMouseTracking(true); + connect(listWidgetRef_, SIGNAL(itemClicked(QListWidgetItem *)), this, + SLOT(listItemClicked(QListWidgetItem *))); + connect(listWidgetRef_, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, + SLOT(listItemDoubleClicked(QListWidgetItem *))); + connect(listWidgetRef_, + SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), + this, SLOT(showInfoTip())); +} + +/// Returns the current text editor controller +TextEditorController *TextEditorAutoCompleteComponent::controller() const +{ + return controllerRef_; +} + +QSize TextEditorAutoCompleteComponent::sizeHint() const +{ + if (!listWidgetRef_) + return QSize(); + + return QSize(850, (qMin(listWidgetRef_->count(), 10) * 15) + 5); +} + +/// This method check if the autocomplete should be shown +/// this method ALSO sets the word that's display +bool TextEditorAutoCompleteComponent::shouldDisplayAutoComplete( + TextRange &range, QString &word) +{ + // when it's a selection (which shouldn't be posssible, but still check it) + if (range.hasSelection()) + return false; + + // when the character AFTER the current is a identifier we should NOT open it + TextDocument *doc = controller()->textDocument(); + QChar nextChar = doc->charAtOrNull(range.caret()); + if (nextChar.isLetterOrNumber()) + return false; + + // expand the given range to word + TextRange wordRange = range; + wordRange.expandToWord(doc, doc->config()->whitespaces(), + doc->config()->charGroups()); + wordRange.maxVar() = range.max(); // next go past the right caret! + word = doc->textPart(wordRange.min(), wordRange.length()) + .trimmed(); // workaround for space select bug! #61 + + if (word.isEmpty()) + { + canceled_ = false; + return false; + } + + // canceled state, hides the autocomplete + if (canceled_) + { + return false; + } + + // else we can should + return true; +} + +void TextEditorAutoCompleteComponent::showInfoTip() +{ + if (!listWidgetRef_->isVisible()) + return; + + const QModelIndex ¤t = listWidgetRef_->currentIndex(); + if (!current.isValid()) + return; + + QString infoTip = current.data(Qt::UserRole).toString(); + if (infoTip.isEmpty()) + { + // infoTip = "No tooltip data found!"; + } + + if (infoTipRef_.isNull()) + { + infoTipRef_ = new FakeToolTip(controllerRef_, this); + } + + infoTipRef_->setText(infoTip); + + const QFont font = controller()->textDocument()->config()->font(); + infoTipRef_->tipText->setDefaultFont(font); + + QFontMetrics fm(font); + int maxWidth = 0; + + // for( QListWidgetItem *item : listWidgetRef_->findItems("*", + // Qt::MatchWildcard)) { + for (int i = 0; i < listWidgetRef_->count(); i++) + { + QListWidgetItem *item = listWidgetRef_->item(i); + QString sLabel = item->data(Qt::DisplayRole).toString(); + QString sDetail = item->data(Qt::UserRole).toString(); + QString sType = ""; + int widthMod = 4; + if (listWidgetRef_->count() > 10) + { + widthMod = listWidgetRef_->verticalScrollBar()->width(); + sLabel = sLabel + " "; + } + if (sDetail.contains(" = ")) + { + sType = QString("%1").arg(sDetail.split(" = ").value(0)); + int width + = fm.horizontalAdvance(QString("%1 %2").arg(sLabel).arg(sType)) + + widthMod; + maxWidth = qMax(width, maxWidth); + } + else + { + int width = fm.horizontalAdvance(QString("%1").arg(sLabel)) + widthMod; + maxWidth = qMax(width, maxWidth); + } + } + + int spacing = 0; + menuRef_->resize( + QSize(maxWidth + spacing + 2, + (qMin(listWidgetRef_->count(), 10) * fm.height()) + 6)); + listWidgetRef_->resize( + QSize(maxWidth + spacing, + (qMin(listWidgetRef_->count(), 10) * fm.height() + 4))); + // menuRef_->resize(QSize(maxWidth + spacing + 2, ( + // qMin(listWidgetRef_->count(), 10) * fm.height() ) )); + // listWidgetRef_->resize(QSize(maxWidth + spacing, ( + // qMin(listWidgetRef_->count(), 10) * fm.height() ))); + + QRect r = listWidgetRef_->visualItemRect(listWidgetRef_->currentItem()); + int xOffset; + if (listWidgetRef_->count() > 10) + xOffset = 22 + 1; + else + xOffset = 5 + 1; + + // fetch the current selection + TextRange range = controller()->textSelection()->range(0); + + QSize tipSize + = infoTipRef_->tipText->documentLayout()->documentSize().toSize(); + + infoTipRef_->resize(tipSize.width(), tipSize.height() - 4); + + // position the list + positionWidgetForCaretOffset(qMax(0, range.caret() - currentWord_.length())); + + QPoint newLoc( + listWidgetRef_->parentWidget()->mapToGlobal(r.topRight()).x() + xOffset, + listWidgetRef_->parentWidget()->mapToGlobal(r.topRight()).y() + 1); + + QRect screen = QApplication::primaryScreen()->availableGeometry(); + + if (newLoc.x() + infoTipRef_->width() > screen.x() + screen.width() + && (menuRef_->x() - infoTipRef_->width() - 1) >= 0) + { + newLoc.setX(menuRef_->x() - infoTipRef_->width() - 1); + } + + if (!infoTip.isEmpty()) + { + infoTipRef_->repaint(); + infoTipRef_->move(newLoc); + infoTipRef_->show(); + infoTipRef_->raise(); + } +} + +void TextEditorAutoCompleteComponent::hideInfoTip() +{ + if (!infoTipRef_.isNull()) + infoTipRef_->hide(); +} + +/// Fills the autocomplete list +bool TextEditorAutoCompleteComponent::fillAutoCompleteList( + TextDocument *document, const TextRange &range, const QString &word) +{ + listWidgetRef_->clear(); + QList<TextAutoCompleteItem *> items + = document->autoCompleteProviderList()->findAutoCompleteItemsForRange( + document, range, word); + if (items.length() > 0) + { + foreach (TextAutoCompleteItem *item, items) + { + QListWidgetItem *wItem = new QListWidgetItem(); + wItem->setData(Qt::DisplayRole, item->label()); + wItem->setData(Qt::DecorationRole, item->kind()); + wItem->setData(Qt::UserRole, item->detail()); + wItem->setData(Qt::WhatsThisRole, item->documentation()); + listWidgetRef_->addItem(wItem); + } + listWidgetRef_->setCurrentIndex(listWidgetRef_->model()->index(0, 0)); + } + else + { + hide(); + } + + QFont font = controller()->textDocument()->config()->font(); + QFontMetrics fm(font); + + setFixedHeight((qMin(listWidgetRef_->count(), 10) * fm.height()) + 4); + + if (items.length() > 10) + { + listWidgetRef_->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); + } + else + { + listWidgetRef_->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + } + + return items.length() > 0; +} + +/// positions the widget so it's visible. +void TextEditorAutoCompleteComponent::positionWidgetForCaretOffset(int offset) +{ + // find the caret position + TextRenderer *renderer = controller()->textRenderer(); + int y = renderer->yPosForOffset(offset) + - controller() + ->textRenderer() + ->viewportY(); // offset the y position based on how far + // scrolled down the editor is + int x = renderer->xPosForOffset(offset) + - controller()->textRenderer()->viewportX() + + marginComponentRef_->widthHint() + - 3; // adjusts x position based on scrollbars, line-number, and + // position in line + QPoint newLoc + = editorComponentRef_->parentWidget()->parentWidget()->mapToGlobal( + QPoint(x, y)); + + // We want to constrain the list to only show within the available screen + // space +#if QT_VERSION >= 0x050a00 + QScreen *pScreen = qApp->screenAt(newLoc); + /* From the Qt documentation: + * "The available geometry is the geometry excluding window manager reserved + * areas such as task bars and system menus. + * + * Note, on X11 this will return the true available geometry only on systems + * with one monitor and if window manager has set _NET_WORKAREA atom. In all + * other cases this is equal to geometry(). This is a limitation in X11 + * window manager specification." + */ + if (!pScreen) + { + // newLoc is off-screen so cannot be shown + return; + } + QRect screen = pScreen->availableGeometry(); +#else + QRect screen = qApp->desktop()->availableGeometry( + editorComponentRef_->parentWidget()->parentWidget()); +#endif + + newLoc.setX(qMax( + screen.left(), + newLoc.x())); // constrain the origin of the list to the leftmost pixel + newLoc.setY(qMax( + screen.top(), + newLoc.y())); // constrain the origin of the list to the topmost pixel + newLoc.setX(qMin(screen.x() + screen.width() - menuRef_->width(), + newLoc.x())); // ensure that the entire width of the list can + // be shown to the right + if (newLoc.y() + menuRef_->height() > screen.bottom()) + { // if the list could go below the bottom, draw above + newLoc.setY(qMin(newLoc.y(), screen.bottom()) + - menuRef_->height()); // positions the list above the word + } + else + { + newLoc.setY( + newLoc.y() + + renderer->lineHeight()); // places it below the line, as normal + } + menuRef_->move(newLoc.x(), newLoc.y()); +} + +/// intercepts hide() calls to inform the tooltip to hide as well +void TextEditorAutoCompleteComponent::hideEvent(QHideEvent *event) +{ + infoTipRef_->hide(); + event->isAccepted(); +} + +/// we need to intercept keypresses if the widget is visible +bool TextEditorAutoCompleteComponent::eventFilter(QObject *obj, QEvent *event) +{ + if (event->type() == QEvent::Close && obj == menuRef_) + { + hide(); + hideInfoTip(); + return QObject::eventFilter(obj, event); + } + if (obj == listWidgetRef_ && event->type() == QEvent::KeyPress) + { + QKeyEvent *key = static_cast<QKeyEvent *>(event); + + // text keys are allowed + if (!key->text().isEmpty()) + { + QChar nextChar = key->text().at(0); + if (nextChar.isLetterOrNumber()) + { + QApplication::sendEvent(editorComponentRef_, event); + return true; + } + } + + // escape key + switch (key->key()) + { + case Qt::Key_Escape: + menuRef_->close(); + canceled_ = true; + return true; // stop event + + case Qt::Key_Enter: + case Qt::Key_Return: + case Qt::Key_Tab: + if (listWidgetRef_->currentItem() + && currentWord_ == listWidgetRef_->currentItem()->text()) + { // sends normal enter/return/tab if you've typed a full word + menuRef_->close(); + QApplication::sendEvent(editorComponentRef_, event); + return true; + } + else if (listWidgetRef_->currentItem()) + { + insertCurrentSelectedListItem(); + menuRef_->close(); + return true; + } + break; + + case Qt::Key_Backspace: + QApplication::sendEvent(editorComponentRef_, event); + return true; + + case Qt::Key_Shift: // ignore shift, don't hide + QApplication::sendEvent(editorComponentRef_, event); + return true; + + // forward special keys to list + case Qt::Key_Up: + case Qt::Key_Down: + case Qt::Key_PageDown: + case Qt::Key_PageUp: + return false; + } + + // default operation is to hide and continue the event + menuRef_->close(); + QApplication::sendEvent(editorComponentRef_, event); + return true; + } + return QObject::eventFilter(obj, event); +} + +/// inserts the currently selected list item +void TextEditorAutoCompleteComponent::insertCurrentSelectedListItem() +{ + TextSelection *sel = controller()->textSelection(); + sel->moveCarets(-currentWord_.length()); + if (listWidgetRef_->currentItem()) + { + controller()->replaceSelection(listWidgetRef_->currentItem()->text()); + } +} + +void TextEditorAutoCompleteComponent::updateList() +{ + // fetch the current selection + TextDocument *doc = controller()->textDocument(); + TextRange range = controller()->textSelection()->range(0); + + if (!doc->config()->autocompleteAutoShow()) + { + return; + } + + // when the character after + if (!shouldDisplayAutoComplete(range, currentWord_)) + { + if (isVisible()) + { + menuRef_->close(); + } + return; + } + + // fills the autocomplete list with the curent word + if (fillAutoCompleteList(doc, range, currentWord_)) + { + menuRef_->popup(menuRef_->pos()); + + editorComponentRef_->setFocus(); + + // position the widget + showInfoTip(); + } + else + { + menuRef_->close(); + } +} + +/// this event is called when a key pressed +void TextEditorAutoCompleteComponent::textKeyPressed() +{ + updateList(); +} + +/// processes backspaces +void TextEditorAutoCompleteComponent::backspacePressed() +{ + updateList(); +} + +void TextEditorAutoCompleteComponent::listItemClicked(QListWidgetItem *item) +{ + item->setSelected(true); + showInfoTip(); +} + +void TextEditorAutoCompleteComponent::listItemDoubleClicked(QListWidgetItem *) +{ + insertCurrentSelectedListItem(); + menuRef_->close(); +} + +void TextEditorAutoCompleteComponent::selectItemOnHover(QModelIndex modelIndex) +{ + listWidgetRef_->selectionModel()->select(modelIndex, + QItemSelectionModel::SelectCurrent); +} + +AutoCompleteDelegate::AutoCompleteDelegate(TextEditorController *controller, + QObject *parent) + : QAbstractItemDelegate(parent) +{ + pixelSize = 12; + controllerRef_ = controller; +} + +TextEditorController *AutoCompleteDelegate::controller() const +{ + return controllerRef_; +} + +void AutoCompleteDelegate::paint(QPainter *painter, + const QStyleOptionViewItem &option, + const QModelIndex &index) const +{ + TextRenderer *renderer = controller()->textRenderer(); + TextTheme *themeRef_ = renderer->theme(); + + painter->setPen(themeRef_->caretColor()); + + QFont font = controller()->textDocument()->config()->font(); + QFontMetrics fm(font); + + if (option.state & QStyle::State_Selected) + painter->fillRect(option.rect, renderer->theme()->selectionColor()); + else + painter->fillRect(option.rect, renderer->theme()->backgroundColor()); + painter->save(); + + painter->setRenderHint(QPainter::Antialiasing, true); + painter->setPen(themeRef_->foregroundColor()); + + QString sLabel = index.data(Qt::DisplayRole).toString(); + QString sDetail = index.data(Qt::UserRole).toString(); + QString sDocumentation = index.data(Qt::WhatsThisRole).toString(); + QString sType = "void"; + + if (sDetail.contains(" = ")) + { + sType = sDetail.split(" = ").value(0); + } + + QRect typeRect = option.rect; + QRect hyphenRect = option.rect; + QRect nameRect = option.rect; + QPen typePen = QPen(themeRef_->findHighlightForegroundColor()); + QPen namePen = QPen(themeRef_->foregroundColor()); + + hyphenRect.setX(hyphenRect.x() + fm.horizontalAdvance(sLabel)); + typeRect.setX(nameRect.x() + nameRect.width() - fm.horizontalAdvance(sType) + - 1); + painter->setFont(font); + painter->drawText(nameRect, sLabel); + + if (sType != "void") + { + painter->drawText(typeRect, sType); + } + painter->restore(); +} + +QSize AutoCompleteDelegate::sizeHint(const QStyleOptionViewItem &, + const QModelIndex &) const +{ + const QFont font = controller()->textDocument()->config()->font(); + QFontMetrics fm(font); + return QSize(100, (fm.height())); +} + +FakeToolTip::FakeToolTip(TextEditorController *controller, QWidget *parent) + : QWidget(parent, Qt::ToolTip | Qt::WindowStaysOnTopHint) +{ + setFocusPolicy(Qt::NoFocus); + // setAttribute(Qt::WA_DeleteOnClose); + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + + tipText = new QTextDocument(this); + + tipText->setHtml(""); + + controllerRef_ = controller; + + // Set the window and button text to the tooltip text color, since this + // widget draws the background as a tooltip. + QPalette p = palette(); + const QColor toolTipTextColor + = p.color(QPalette::Inactive, QPalette::ToolTipText); + p.setColor(QPalette::Inactive, QPalette::WindowText, toolTipTextColor); + p.setColor(QPalette::Inactive, QPalette::ButtonText, toolTipTextColor); + setPalette(p); + + setWindowOpacity( + style()->styleHint(QStyle::SH_ToolTipLabel_Opacity, nullptr, this) + / 255.0); +} + +void FakeToolTip::setText(const QString text) +{ + TextRenderer *renderer = controller()->textRenderer(); + TextTheme *themeRef_ = renderer->theme(); + tipText->setDefaultStyleSheet( + "p {color:" + themeRef_->foregroundColor().name() + "}"); + tipText->setHtml(QString("<p>%1</p>").arg(text)); +} + +TextEditorController *FakeToolTip::controller() +{ + return controllerRef_; +} + +void FakeToolTip::paintEvent(QPaintEvent *) +{ + QStyle *style = this->style(); + QPainter *p = new QPainter(this); + QStyleOptionFrame *opt = new QStyleOptionFrame(); + QRect labelRect; + TextRenderer *renderer = controller()->textRenderer(); + TextTheme *themeRef_ = renderer->theme(); + + opt->initFrom(this); + style->drawPrimitive(QStyle::PE_PanelTipLabel, opt, p); + + tipText->setDefaultFont(controller()->textDocument()->config()->font()); + + labelRect = this->rect(); + + labelRect.setX(labelRect.x() + 2); + labelRect.setY(labelRect.y() + 2); + labelRect.setWidth(labelRect.width() - 2); + labelRect.setHeight(labelRect.height() - 2); + + p->fillRect(labelRect, themeRef_->backgroundColor()); + + p->translate(-2, -2); + + p->setPen(themeRef_->foregroundColor()); + labelRect.setWidth(labelRect.width() + 1); + labelRect.setHeight(labelRect.height() + 1); + + tipText->drawContents(p, labelRect); + + p->end(); + delete p; + delete opt; +} + +void FakeToolTip::resizeEvent(QResizeEvent *) +{ + QStyleHintReturnMask frameMask; + QStyleOption option; + option.initFrom(this); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/components/texteditorautocompletecomponent.h b/lib/edbee-lib/edbee/views/components/texteditorautocompletecomponent.h new file mode 100644 index 00000000..33f993a5 --- /dev/null +++ b/lib/edbee-lib/edbee/views/components/texteditorautocompletecomponent.h @@ -0,0 +1,126 @@ +#pragma once + +#include "edbee/exports.h" + +#include <QModelIndex> +#include <QWidget> +#include <QLabel> +#include <QAbstractItemDelegate> +#include <QPainter> +#include <QScrollBar> +#include <QStylePainter> +#include <QPointer> +#include <QMenu> +#include <QTextDocument> + +class QListWidget; +class QListWidgetItem; + +namespace edbee +{ + +class TextDocument; +class TextEditorController; +class TextEditorComponent; +class TextMarginComponent; +class TextEditorWidget; +class TextRange; + +class FakeToolTip : public QWidget +{ + Q_OBJECT + +public: + explicit FakeToolTip(TextEditorController *controller, QWidget *parent = 0); + void setText(const QString text); + QTextDocument *tipText; + TextEditorController *controller(); + +private: + TextEditorController *controllerRef_; ///< A reference to the controller + +protected: + void paintEvent(QPaintEvent *e); + void resizeEvent(QResizeEvent *e); +}; + +// inspiration: +// http://doc.qt.io/qt-5/qtwidgets-tools-customcompleter-example.html + +/// An autocomplete list +/// Which receives it's autocomplete list from the document +class EDBEE_EXPORT TextEditorAutoCompleteComponent : public QWidget +{ + Q_OBJECT +public: + explicit TextEditorAutoCompleteComponent(TextEditorController *controller, + TextEditorComponent *parent, + TextMarginComponent *margin); + + TextEditorController *controller() const; + + QSize sizeHint() const; + +protected: + bool shouldDisplayAutoComplete(TextRange &range, QString &word); + void hideInfoTip(); + bool fillAutoCompleteList(TextDocument *document, const TextRange &range, + const QString &word); + + void positionWidgetForCaretOffset(int offset); + bool eventFilter(QObject *obj, QEvent *event); + + void hideEvent(QHideEvent *event); + // void focusOutEvent(QFocusEvent *event); + // void moveEvent(QMoveEvent *event); + + void insertCurrentSelectedListItem(); +signals: + +public slots: + void updateList(); + void backspacePressed(); + void textKeyPressed(); + void listItemClicked(QListWidgetItem *item); + void listItemDoubleClicked(QListWidgetItem *item); + void selectItemOnHover(QModelIndex modelIndex); + void showInfoTip(); + +private: + TextEditorController *controllerRef_; ///< A reference to the controller + QMenu *menuRef_; + QListWidget *listWidgetRef_; ///< The current autocomplete words + TextEditorComponent + *editorComponentRef_; ///< Reference to the editor component + TextMarginComponent + *marginComponentRef_; ///< Reference to the editor's margin + bool eventBeingFiltered_; ///< Prevent endless double filter when forwarding + ///< event to list item + QString currentWord_; ///< The current word beïng entered + bool canceled_; ///< Has the autocomplete been canceled + QPointer<FakeToolTip> infoTipRef_; +}; + +class AutoCompleteDelegate : public QAbstractItemDelegate +{ + Q_OBJECT + +public: + AutoCompleteDelegate(TextEditorController *controller, QObject *parent = 0); + + TextEditorController *controller() const; + + void paint(QPainter *painter, const QStyleOptionViewItem &option, + const QModelIndex &index) const override; + + QSize sizeHint(const QStyleOptionViewItem &option, + const QModelIndex &index) const override; + +public slots: + +private: + TextEditorController *controllerRef_; ///< A reference to the controller + int pixelSize; +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/components/texteditorcomponent.cpp b/lib/edbee-lib/edbee/views/components/texteditorcomponent.cpp new file mode 100644 index 00000000..190431f9 --- /dev/null +++ b/lib/edbee-lib/edbee/views/components/texteditorcomponent.cpp @@ -0,0 +1,743 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "texteditorcomponent.h" + +#include <QAccessibleEvent> +#include <QApplication> +#include <QClipboard> +#include <QDateTime> +#include <QMenu> +#include <QPainter> +#include <QPaintEvent> +#include <QPalette> +#include <QTimer> + +#include "edbee/commands/selectioncommand.h" +#include "edbee/models/textdocument.h" +#include "edbee/models/texteditorcommandmap.h" +#include "edbee/models/texteditorconfig.h" +#include "edbee/models/texteditorkeymap.h" +#include "edbee/models/textundostack.h" +#include "edbee/texteditorcommand.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/texteditorwidget.h" +#include "edbee/views/components/texteditorrenderer.h" +#include "edbee/views/texteditorscrollarea.h" +#include "edbee/views/textrenderer.h" +#include "edbee/views/textselection.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +const qint64 TRIPLE_CLICK_DELAY_IN_MS = 250; // 0.25 seconds + +/// The default texteditor compenent constructor +/// @param controller the active controller for this editor +/// @param parent the parent QObject +TextEditorComponent::TextEditorComponent(TextEditorController *controller, + QWidget *parent) + : QWidget(parent) + , caretTimer_(nullptr) + , controllerRef_(controller) + , textEditorRenderer_(nullptr) + , clickCount_(0) + , clickRange_() + , lastClickEvent_(0) +{ + textEditorRenderer_ = new TextEditorRenderer(controller->textRenderer()); + + // setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + + // disabled autofilling of backgrounds + setAutoFillBackground(false); + + // editCompRef_->setAutoFillBackground(false); + // setAutoFillBackground(true); + // setAttribute(Qt::WA_StaticContents); + setAttribute(Qt::WA_OpaquePaintEvent); // make sure not everything is redrawn + setAttribute(Qt::WA_NoSystemBackground); + + // setAttribute( Qt::WA_MacShowFocusRect); // show a mac focus rect + + setFocusPolicy(Qt::WheelFocus); + + // setFocusPolicy(Qt::ClickFocus); (since 2013-02-16, can be removed + // tab still works :) ) + setAttribute(Qt::WA_KeyCompression); + setAttribute(Qt::WA_InputMethodEnabled); + + // set the cursor type + setCursor(Qt::IBeamCursor); + + // set the timer for the carets + caretTimer_ = new QTimer(); + connect(caretTimer_, SIGNAL(timeout()), SLOT(repaintCarets())); + if (config()->caretBlinkingRate() > 0) + { + caretTimer_->start(config()->caretBlinkingRate() >> 1); + } +} + +/// The destructor of the the component +TextEditorComponent::~TextEditorComponent() +{ + delete caretTimer_; + delete textEditorRenderer_; +} + +/// Returns the active commandmap +TextEditorCommandMap *TextEditorComponent::commandMap() +{ + return controllerRef_->commandMap(); +} + +/// Returns the active configuration +TextEditorConfig *TextEditorComponent::config() const +{ + return textDocument()->config(); +} + +/// Returns the active textdocument +TextDocument *TextEditorComponent::textDocument() const +{ + return controllerRef_->textDocument(); +} + +/// Returns the current keymap +TextEditorKeyMap *TextEditorComponent::keyMap() +{ + return controllerRef_->keyMap(); +} + +/// Returns the active texteditor controller +TextEditorController *TextEditorComponent::controller() +{ + return controllerRef_; +} + +/// Returns the texselection range +TextSelection *TextEditorComponent::textSelection() +{ + return controllerRef_->textSelection(); +} + +void TextEditorComponent::giveTextEditorRenderer(TextEditorRenderer *renderer) +{ + delete textEditorRenderer_; + textEditorRenderer_ = renderer; +} + +/// returns the size hint. This is the total size of the editor-area +QSize TextEditorComponent::sizeHint() const +{ + TextRenderer *ren = textRenderer(); + int height = ren->totalHeight(); + + // when scroll past end is enabled we need to be able to scroll past the last + // line + if (config()->scrollPastEnd()) + { + int viewPortHeight + = controllerRef_->widget()->textScrollArea()->size().height(); + height += viewPortHeight; + height -= textRenderer()->lineHeight() + * 2; // *2 because we have an extra blank line at the end + } + + // added 1 extra emWidth so there's at least 1 character spacing at the end + return QSize(ren->totalWidth() + ren->emWidth(), height); +} + +/// This method resets the caret timer +/// The caret time is used for blinking carets +/// When resetting the timer the caret is displayed directly +void TextEditorComponent::resetCaretTime() +{ + // restart the timer + if (caretTimer_->isActive()) + { + caretTimer_->start(); + textRenderer()->resetCaretTime(); + } +} + +/// A slow and full update of the control +void TextEditorComponent::fullUpdate() +{ + // qlog_info() << "**** fullUpdate!!! **** "; + controller()->textRenderer()->invalidateCaches(); + updateGeometry(); + update(); +} + +/// paint the editor +/// @param paintEvent the paint event that occured +void TextEditorComponent::paintEvent(QPaintEvent *paintEvent) +{ + QWidget::paintEvent(paintEvent); + QPainter p(this); + + // retrieve the scrollbar-offsets + const QRect &clipRect = paintEvent->rect(); + + int offsetX = 0; // horizontalScrollBar()->value(); + int offsetY = 0; // verticalScrollBar()->value(); + QRect translatedRect(clipRect.x() + offsetX, clipRect.y() + offsetY, + clipRect.width(), clipRect.height()); + + // qlog_info() << "CLIPRECT..... " << translatedRect; + + // render the editor + // textRenderer()->render( p, translatedRect ); + textRenderer()->renderBegin(translatedRect); + textEditorRenderer_->render(&p); + textRenderer()->renderEnd(translatedRect); + +#if DEBUG_DRAW_RENDER_CLIPPING_RECTANGLE + // draw the untralated clipping rectangle + + // draw a clipping rectangle + p.setClipping(false); + p.setPen(QColor(0, 200, 0)); + QRect clipDrawRect(clipRect); + clipDrawRect.adjust(0, 0, -1, -1); + p.drawRect(clipDrawRect); + p.setClipping(true); +#endif + + // QStyleOptionFocusRect option; + // option.init(this); + // option.backgroundColor = palette().color(QPalette::Window); + // style()->drawPrimitive(QStyle::PE_FrameFocusRect, &option, &p,this); +} + +void TextEditorComponent::moveEvent(QMoveEvent *moveEvent) +{ + Q_UNUSED(moveEvent) +} + +void TextEditorComponent::hideEvent(QHideEvent *hideEvent) +{ + Q_UNUSED(hideEvent) +} + +/// This method is used to FORCE the interception of tab events +/// @param event the event filter +bool TextEditorComponent::event(QEvent *event) +{ + // keypress event + if (event->type() == QEvent::KeyPress) + { + QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event); + if (keyEvent) + { + int key = keyEvent->key(); + if (key == Qt::Key_Tab || key == Qt::Key_Backtab) + { + keyPressEvent(keyEvent); + keyEvent->accept(); + return true; + } + } + } + return QWidget::event(event); +} + +/// handle keypresses +void TextEditorComponent::keyPressEvent(QKeyEvent *event) +{ + int key = event->key(); + + // unkown key return or control key + if (key == Qt::Key_unknown) + { + return; + } + if (key == Qt::Key_Control || key == Qt::Key_Shift || key == Qt::Key_Alt + || key == Qt::Key_Meta) + { + return; + } + // convert the key to a string + Qt::KeyboardModifiers modifiers = event->modifiers(); + if (modifiers & Qt::ShiftModifier) + key += Qt::SHIFT; + if (modifiers & Qt::ControlModifier) + key += Qt::CTRL; + if (modifiers & Qt::AltModifier) + key += Qt::ALT; + if (modifiers & Qt::MetaModifier) + key += Qt::META; + // if(modifiers & Qt::KeypadModifier) key += Qt::KeypadModifier; + + // grow the current sequence + QKeySequence::SequenceMatch match; + QKeySequence keySequence + = TextEditorKeyMap::joinKeySequences(lastKeySequence_, QKeySequence(key)); + QString command = keyMap()->findBySequence(keySequence, match); + + // when a sequence was busy and we didn't find a match, eat the key :P + // this is different from other editors like sublime, but I think it's more + // natural to ignore the key if a sequence of keys is detected + if (match == QKeySequence::NoMatch && !lastKeySequence_.isEmpty()) + { + lastKeySequence_ = QKeySequence(); + // qlog_info() << "[[[ eat the last key ]]"; + return; + } + + // a partial match + if (match == QKeySequence::PartialMatch) + { + lastKeySequence_ = keySequence; + // qlog_info() << "[[[ match in progress for " << command << "]]"; + return; + } + + // we've found the command + if (match == QKeySequence::ExactMatch) + { + // qlog_info() << "[[[ found command:" << command << "]]"; + controller()->executeCommand(command); + + lastKeySequence_ = QKeySequence(); + return; + } + + // not partial, not found, clear the mark + lastKeySequence_ = QKeySequence(); + + // else replace the selection if there's a text + QString text = event->text(); + bool specialKey = (modifiers & (Qt::MetaModifier | Qt::ControlModifier)) + && ((modifiers != (Qt::AltModifier | Qt::ControlModifier)) + || (!text.isEmpty() && text.at(0).isUpper())); + if (!text.isEmpty() && !specialKey) + { + // last character is used for "undo-group after" space support + if (this->config()->undoGroupPerSpace()) + { + if (text.compare(" ") == 0 && lastCharacter_.compare(" ") != 0) + { + textDocument()->textUndoStack()->resetAllLastCoalesceIds(); + } + } + + lastCharacter_ = text; + controller()->replaceSelection(text, CoalesceId_AppendChar); + controller()->updateStatusText(); + emit textKeyPressed(); + } + else + { + QWidget::keyPressEvent(event); + } +} + +/// the key release event +void TextEditorComponent::keyReleaseEvent(QKeyEvent *event) +{ + QWidget::keyReleaseEvent(event); +} + +/// input method event +// When receiving an input method event, the text widget has to performs the +// following steps: +// 1. If the widget has selected text, the selected text should get removed. +/// +// 2. Remove the text starting at replacementStart() with length +// replacementLength() and replace it by the commitString(). +// If replacementLength() is 0, replacementStart() gives the insertion +// position for the commitString(). +// . When doing replacement the area of the preedit string is ignored, thus a +// replacement starting at -1 with a length of 2 will remove the +// last character before the preedit string and the first character +// afterwards, and insert the commit string directly before the preedit +// string. +// . If the widget implements undo/redo, this operation gets added to the undo +// stack. +// +// 3 If there is no current preedit string, insert the preeditString() at the +// current cursor position; otherwise +// replace the previous preeditString with the one received from this event. +// If the widget implements undo/redo, the preeditString() should not +// influence the undo/redo stack in any way. The widget should examine the +// list of attributes to apply to the preedit string. It has to understand +// at least the TextFormat and Cursor attributes and render them as +// specified. + +void TextEditorComponent::inputMethodEvent(QInputMethodEvent *m) +{ + /// TODO: https://doc.qt.io/qt-5/qinputmethodevent.html + /// Analyize how to implement this. The preeditString should NOT alter the + /// undo-buffer + + // replace the selection with an empty text (only if there's content to + // replace) + if (textSelection()->hasSelection() + && (!m->preeditString().isEmpty() || !m->commitString().isEmpty())) + { + controller()->replaceSelection("", false); + } + + /* + /// TODO: Honer the arguments + QString str; + foreach( QInputMethodEvent::Attribute attr, m->attributes() ) { + str.append( + QStringLiteral("[%1,%2-%3,%4]").arg(attr.type).arg(attr.start).arg(attr.length).arg(attr.value.toString()) + ); + } + // qlog_info() << "inputMethodEvent: commitStr=" << m->commitString() << ", + preEditStr=" << m->preeditString() << ", start=" << m->replacementStart() << + ", length" << m->replacementStart() << " | " << str; + */ + + if (!m->preeditString().isEmpty()) + { + controller()->replaceSelection(m->preeditString(), false, true); + } + else + { + controller()->replaceSelection(m->commitString(), false); + } + + m->accept(); +} + +/// currently unused ?! +QVariant TextEditorComponent::inputMethodQuery(Qt::InputMethodQuery p) const +{ + Q_UNUSED(p); + return QVariant(); +} + +/// registers a click event and modifies the clickcount and last-click moment +void TextEditorComponent::registerClickEvent() +{ + qint64 currentClickEvent = QDateTime::currentMSecsSinceEpoch(); + if (currentClickEvent - lastClickEvent_ <= TRIPLE_CLICK_DELAY_IN_MS) + { + clickCount_ += 1; + } + else + { + clickCount_ = 1; + } + + // qlog_info() << "clickcount: " << clickCount_; + lastClickEvent_ = currentClickEvent; +} + +/// A mouse press happens +/// +/// The normal operation is to move the caret to the character under the given +/// mouse position. When shift is pressed, the selection is extended to the +/// given position +/// +/// If the controller modifier is used a new caret is added to character at the +/// given position +/// +/// @param event the mouse event +void TextEditorComponent::mousePressEvent(QMouseEvent *event) +{ + if (event->button() == Qt::LeftButton || event->button() == Qt::MiddleButton) + { + TextRenderer *renderer = textRenderer(); + + // int x = renderer->widgetXToXpos( event->x() + + // horizontalScrollBar()->value() ); int y = renderer->widgetYToYpos( + // event->y() + verticalScrollBar()->value() ); + int x = event->pos().x(); + int y = event->pos().y(); + + int line = renderer->rawLineIndexForYpos(y); + int col = renderer->columnIndexForXpos(line, x); + + if (event->button() == Qt::LeftButton) + { + registerClickEvent(); + + if (clickCount_ >= 2) + { + SelectionCommand toggleWordSelectionAtCommand( + SelectionCommand::SelectFullLine, 0); + controller()->executeCommand(&toggleWordSelectionAtCommand); + clickRange_ = textSelection()->range(0); + return; + } + + if (event->modifiers() & Qt::ControlModifier) + { + controller()->addCaretAt(line, col); + } + else + { + controller()->moveCaretTo(line, col, + event->modifiers() & Qt::ShiftModifier); + } + } + if (QApplication::clipboard()->supportsSelection() + && event->button() == Qt::MiddleButton) + { // X11 / linux support middle button paste + controller()->moveCaretTo( + line, col, + false); // clear actual selection and put cursor under mouse + controller()->replaceSelection( + QApplication::clipboard()->text(QClipboard::Selection), + CoalesceId_Paste); + controller()->updateStatusText(); + } + } + QWidget::mousePressEvent(event); +} + +/// A mouse release happens +/// +/// Only used to copy selection to selection clipboard for X11 / linux systems +/// +/// @param event the mouse event +void TextEditorComponent::mouseReleaseEvent(QMouseEvent *event) +{ + if (QApplication::clipboard()->supportsSelection() + && event->button() == Qt::LeftButton) + { + if (controller()->textSelection()->rangeCount() == 1) + { + QString selection; + selection = controller()->textSelection()->getSelectedText(); + if (!selection.isEmpty()) + { + QApplication::clipboard()->setText(selection, QClipboard::Selection); + } + } + } + QWidget::mouseReleaseEvent(event); +} + +/// A mouse double click happens +/// @param event the mouse double click that occured +void TextEditorComponent::mouseDoubleClickEvent(QMouseEvent *event) +{ + if (event->button() == Qt::LeftButton) + { + registerClickEvent(); + if (clickCount_ > 2) + { + return; + } + + if (event->modifiers() & Qt::ControlModifier) + { + // get the location of the double +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + auto eventPos = event->pos(); +#else + auto eventPos = event->position().toPoint(); +#endif + int line = textRenderer()->rawLineIndexForYpos(eventPos.y()); + int col = textRenderer()->columnIndexForXpos(line, eventPos.x()); + + // add the word there + SelectionCommand toggleWordSelectionAtCommand( + SelectionCommand::ToggleWordSelectionAt, + textDocument()->offsetFromLineAndColumn(line, col)); + controller()->executeCommand(&toggleWordSelectionAtCommand); + } + else + { + static SelectionCommand selectWord(SelectionCommand::SelectWord); + controller()->executeCommand(&selectWord); + clickRange_ = textSelection()->range(0); + } + return; + } + QWidget::mouseDoubleClickEvent(event); +} + +/// A mouse move event +/// @param event the mouse event +void TextEditorComponent::mouseMoveEvent(QMouseEvent *event) +{ + if (event->buttons() & Qt::LeftButton) + { + TextRenderer *renderer = textRenderer(); + +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + auto eventPos = event->pos(); +#else + auto eventPos = event->position().toPoint(); +#endif + int line = renderer->rawLineIndexForYpos(eventPos.y()); + int col = 0; + if (line >= 0) + { + col = renderer->columnIndexForXpos(line, eventPos.x()); + } + if (line < 0) + { + line = 0; + } + + if (clickCount_ == 2) + { + TextRange range = textSelection()->range(0); + + int newOffset = textDocument()->offsetFromLineAndColumn(line, col); + range.moveCaretToWordBoundaryAtOffset(textDocument(), newOffset); + range.minVar() = qMin(clickRange_.min(), range.min()); + range.maxVar() = qMax(clickRange_.max(), range.max()); + + controller()->moveCaretAndAnchorToOffset(range.caret(), range.anchor()); + return; + } + else if (clickCount_ == 3) + { + TextRange range = textSelection()->range(0); // copy range + + int clickLine = textDocument()->lineFromOffset(clickRange_.min()); + if (line < clickLine) + { + range.set(textDocument()->offsetFromLine(line), clickRange_.max()); + } + else + { + range.set(clickRange_.min(), textDocument()->offsetFromLine(line + 1)); + } + + controller()->moveCaretAndAnchorToOffset(range.caret(), range.anchor()); + return; + } + + if (event->modifiers() & Qt::ControlModifier) + { + controller()->moveCaretTo( + line, col, true, controller()->textSelection()->rangeCount() - 1); + } + else + { + controller()->moveCaretTo(line, col, true); + } + } + QWidget::mouseMoveEvent(event); +} + +/// A focus in event occured +void TextEditorComponent::focusInEvent(QFocusEvent *event) +{ + Q_UNUSED(event) +} + +/// The focus is lost, we must STOP coalescing of undo-events! +void TextEditorComponent::focusOutEvent(QFocusEvent *event) +{ + Q_UNUSED(event) + // no merging for new changes!! + textDocument()->textUndoStack()->resetAllLastCoalesceIds(); +} + +/// The default context menu is requested +/// Add the default menu actions +void TextEditorComponent::contextMenuEvent(QContextMenuEvent *event) +{ + Q_UNUSED(event) + + QMenu *menu = new QMenu(); + menu->addAction(controller()->createAction("cut", tr("Cut"))); + menu->addAction(controller()->createAction("copy", tr("Copy"))); + menu->addAction(controller()->createAction("paste", tr("Paste"))); + menu->addSeparator(); + menu->addAction(controller()->createAction("sel_all", tr("Select All"))); + + // contextmenu can always be placed under the current cursosr + menu->exec(QCursor::pos()); + qDeleteAll(menu->actions()); + delete menu; +} + +/// This method repaints 'all' carets +void TextEditorComponent::repaintCarets() +{ + if (!textRenderer()->isCaretVisible()) + textRenderer()->setCaretVisible(true); + + // invalidate all 'caret' ranges + TextSelection *ranges = controllerRef_->textSelection(); + int rangeCount = ranges->rangeCount(); + if (rangeCount < 10) + { // just a number :P + for (int i = 0; i < rangeCount; ++i) + { + updateAreaAroundOffset(ranges->range(i).caret()); + } + } + else + { + update(); + } +} + +/// updates the given line so it will be repainted +void TextEditorComponent::updateLineAtOffset(int offset) +{ + TextRenderer *renderer = textRenderer(); + int yPos = renderer->yPosForOffset(offset) + - textEditorRenderer_->extraPixelsToUpdateAroundLines(); + + // the text-only line: + // viewport()->update( renderer->viewportX(), yPos - renderer->viewportY(), + // renderer->viewportWidth(), renderer->lineHeight() ); + + // the full line inclusive sidebars + // viewport()->update( renderer->totalViewportX(), yPos - + // renderer->totalViewportY(), renderer->totalViewportWidth(), + // renderer->lineHeight() ); + update(0, yPos - renderer->viewportY(), renderer->viewportWidth(), + renderer->lineHeight() + + textEditorRenderer_->extraPixelsToUpdateAroundLines() * 2); +} + +/// updates the character before and at the given offset +void TextEditorComponent::updateAreaAroundOffset(int offset, int width) +{ + TextRenderer *ren = textRenderer(); + update(ren->xPosForOffset(offset) - width / 2, + ren->yPosForOffset(offset) + - textEditorRenderer_->extraPixelsToUpdateAroundLines(), + width, + ren->lineHeight() + + textEditorRenderer_->extraPixelsToUpdateAroundLines() * 2); + /* + int yPos = renderer->yPosToWidgetY( renderer->yPosForOffset( offset ) ); + int xPos = renderer->xPosToWidgetX( renderer->xPosForOffset( offset ) - + width/2 ); viewport()->update( xPos - renderer->totalViewportX(), yPos - + renderer->totalViewportY(), width, renderer->lineHeight() ); + */ +} + +/// This method invalidates the given lines +/// @param line the first line to update +/// @param length the number of lines to update +void TextEditorComponent::updateLine(int line, int length) +{ + TextRenderer *ren = textRenderer(); + int startY = ren->yPosForLine(line) + - textEditorRenderer_->extraPixelsToUpdateAroundLines(); + int endY = ren->yPosForLine(line + length) + + textEditorRenderer_->extraPixelsToUpdateAroundLines(); + update(0, startY, width(), endY); +} + +/// Returns the current textrenderer +TextRenderer *TextEditorComponent::textRenderer() const +{ + return controllerRef_->textRenderer(); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/components/texteditorcomponent.h b/lib/edbee-lib/edbee/views/components/texteditorcomponent.h new file mode 100644 index 00000000..db1ce930 --- /dev/null +++ b/lib/edbee-lib/edbee/views/components/texteditorcomponent.h @@ -0,0 +1,99 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include "edbee/models/textrange.h" + +#include <QSize> +#include <QWidget> + +namespace edbee +{ + +class TextRange; +class TextDocument; +class TextEditorCommandMap; +class TextEditorConfig; +class TextEditorController; +class TextEditorRenderer; +class TextEditorKeyMap; +class TextRenderer; +class TextSelection; + +/// This is the main texteditor-component (which is the true editor) +/// This is the QWidget that recieves the keypresses, mouse presses etc. +class EDBEE_EXPORT TextEditorComponent : public QWidget +{ + Q_OBJECT +public: + explicit TextEditorComponent(TextEditorController *controller, + QWidget *parent = 0); + virtual ~TextEditorComponent(); + + TextEditorCommandMap *commandMap(); + TextEditorConfig *config() const; + TextDocument *textDocument() const; + TextEditorKeyMap *keyMap(); + TextEditorController *controller(); + TextSelection *textSelection(); + + TextEditorRenderer *textEditorRenderer() { return textEditorRenderer_; } + void giveTextEditorRenderer(TextEditorRenderer *renderer); + + void resetCaretTime(); + void fullUpdate(); + + virtual QSize sizeHint() const; + +protected: + virtual void paintEvent(QPaintEvent *paintEvent); + virtual void moveEvent(QMoveEvent *moveEvent); + virtual void hideEvent(QHideEvent *hideEvent); + virtual bool event(QEvent *event); + virtual void keyPressEvent(QKeyEvent *event); + virtual void keyReleaseEvent(QKeyEvent *event); + void inputMethodEvent(QInputMethodEvent *m); + QVariant inputMethodQuery(Qt::InputMethodQuery p) const; + void registerClickEvent(); + virtual void mousePressEvent(QMouseEvent *event); + virtual void mouseReleaseEvent(QMouseEvent *event); + virtual void mouseDoubleClickEvent(QMouseEvent *event); + virtual void mouseMoveEvent(QMouseEvent *event); + virtual void focusInEvent(QFocusEvent *event); + virtual void focusOutEvent(QFocusEvent *event); + virtual void contextMenuEvent(QContextMenuEvent *event); + +public slots: + + void repaintCarets(); + virtual void updateLineAtOffset(int offset); + virtual void updateAreaAroundOffset(int offset, int width = 8); + virtual void updateLine(int line, int length); + +signals: + void textKeyPressed(); + +private: + TextRenderer *textRenderer() const; + + QTimer *caretTimer_; ///< A timer for updating the carets + + QKeySequence lastKeySequence_; ///< the last key sequence + QString lastCharacter_; ///< The last added character. (for undo-group per + ///< space support) + + TextEditorController *controllerRef_; ///< A reference to the controller + TextEditorRenderer *textEditorRenderer_; /// A text-editor renderer + + int clickCount_; ///< The number of clicks + TextRange clickRange_; ///< The initial click range (to keep the first + ///< word/line selected) + qint64 lastClickEvent_; ///< Last click event time +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/components/texteditorrenderer.cpp b/lib/edbee-lib/edbee/views/components/texteditorrenderer.cpp new file mode 100644 index 00000000..6ae8b274 --- /dev/null +++ b/lib/edbee-lib/edbee/views/components/texteditorrenderer.cpp @@ -0,0 +1,280 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "texteditorrenderer.h" + +#include <QPainter> +#include <QPainterPath> +#include <QTextLayout> + +#include "edbee/models/textdocument.h" +#include "edbee/models/texteditorconfig.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/views/texttheme.h" +#include "edbee/views/textselection.h" +#include "edbee/views/textrenderer.h" +#include "edbee/views/textlayout.h" +#include "edbee/util/simpleprofiler.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +static const int ShadowWidth = 5; + +TextEditorRenderer::TextEditorRenderer(TextRenderer *renderer) + : rendererRef_(renderer) + , themeRef_(0) + , shadowGradient_(0) +{ + shadowGradient_ = new QLinearGradient(0, 0, ShadowWidth, 0); + shadowGradient_->setColorAt(0, QColor(0x00, 0x00, 0x00, 0x00)); + shadowGradient_->setColorAt(1, QColor(0x00, 0x00, 0x00, 0x00)); +} + +TextEditorRenderer::~TextEditorRenderer() +{ + delete shadowGradient_; +} + +int TextEditorRenderer::preferedWidth() +{ + return renderer()->totalWidth(); +} + +void TextEditorRenderer::render(QPainter *painter) +{ + int startLine = renderer()->startLine(); + int endLine = renderer()->endLine(); + + // TextDocument* doc = renderer()->textDocument(); + themeRef_ = renderer()->theme(); + painter->setBackground(themeRef_->backgroundColor()); + painter->setPen(themeRef_->foregroundColor()); + painter->fillRect(*renderer()->clipRect(), themeRef_->backgroundColor()); + + // process the items + for (int line = startLine; line <= endLine; ++line) + { + renderLineBackground(painter, line); + renderLineSelection(painter, line); + renderLineSeparator(painter, line); + renderLineText(painter, line); + renderLineBorderedRanges(painter, line); + } + + renderCarets(painter); + // renderShade( painter, *renderer()->clipRect() ); /// TODO, deze + // renderShade moet misschien in de viewport render-code gebreuren +} + +void TextEditorRenderer::renderLineBackground(QPainter *painter, int line) +{ + Q_UNUSED(line); + Q_UNUSED(painter); +} + +void TextEditorRenderer::renderLineSelection(QPainter *painter, int line) +{ + // PROF_BEGIN_NAMED("render-selection") + TextDocument *doc = renderer()->textDocument(); + TextSelection *sel = renderer()->textSelection(); + int lineHeight = renderer()->lineHeight(); + + int firstRangeIdx = 0; + int lastRangeIdx = 0; + /// TODO: iprove ranges at line by calling rangesForOffsets first for only the + /// visible offsets! + if (sel->rangesAtLine(line, firstRangeIdx, lastRangeIdx)) + { + + TextLayout *textLayout = renderer()->textLayoutForLine(line); + QRectF rect = textLayout->boundingRect(); + + int lastLineColumn = doc->lineLength(line); + + // draw all 'ranges' on this line + for (int rangeIdx = firstRangeIdx; rangeIdx <= lastRangeIdx; ++rangeIdx) + { + TextRange &range = sel->range(rangeIdx); + int startColumn = doc->columnFromOffsetAndLine(range.min(), line); + int endColumn = doc->columnFromOffsetAndLine(range.max(), line); + + int startX = textLayout->cursorToX(startColumn); + int endX = textLayout->cursorToX(endColumn); + + if (range.length() > 0 && endColumn + 1 >= lastLineColumn) + endX += 3; + + painter->fillRect( + startX, line * lineHeight + rect.top(), endX - startX, rect.height(), + themeRef_->selectionColor()); // QColor::fromRgb(0xDD, 0x88, 0xEE) ); + } + } + // PROF_END +} + +void TextEditorRenderer::renderLineBorderedRanges(QPainter *painter, int line) +{ + // PROF_BEGIN_NAMED("render-selection") + TextDocument *doc = renderer()->textDocument(); + TextRangeSet *sel = renderer()->controller()->borderedTextRanges(); + int lineHeight = renderer()->lineHeight(); + + QPen pen(themeRef_->foregroundColor(), 0.5); + // QPen pen(themeRef_->findHighlightForegroundColor(), 0.5); + // QBrush brush(themeRef_->findHighlightBackgroundColor()); + painter->setRenderHint(QPainter::Antialiasing); + + int firstRangeIdx = 0; + int lastRangeIdx = 0; + /// TODO: improve ranges at line by calling rangesForOffsets first for only + /// the visible offsets! + if (sel->rangesAtLine(line, firstRangeIdx, lastRangeIdx)) + { + + TextLayout *textLayout = renderer()->textLayoutForLine(line); + QRectF rect = textLayout->boundingRect(); + + int lastLineColumn = doc->lineLength(line); + + // draw all 'ranges' on this line + for (int rangeIdx = firstRangeIdx; rangeIdx <= lastRangeIdx; ++rangeIdx) + { + TextRange &range = sel->range(rangeIdx); + int startColumn = doc->columnFromOffsetAndLine(range.min(), line); + int endColumn = doc->columnFromOffsetAndLine(range.max(), line); + + qreal startX = textLayout->cursorToX(startColumn); + qreal endX = textLayout->cursorToX(endColumn); + + if (range.length() > 0 && endColumn + 1 >= lastLineColumn) + endX += 3; + + QPainterPath path; + path.addRoundedRect(startX, line * lineHeight + rect.top(), endX - startX, + rect.height(), 5, 5); + // painter->fillPath(path, brush); + painter->strokePath(path, pen); + } + } + // PROF_END +} + +void TextEditorRenderer::renderLineSeparator(QPainter *painter, int line) +{ + // PROF_BEGIN_NAMED("render-selection") + TextEditorConfig *config = renderer()->config(); + int lineHeight = renderer()->lineHeight(); + // int viewportX = renderer()->viewportX(); + // int viewportWidth = renderer()->vie\wportWidth(); + QRect visibleRect(renderer()->viewport()); + + if (config->useLineSeparator()) + { + const QPen &pen = config->lineSeparatorPen(); + painter->setPen(pen); + int y = (line + 1) * lineHeight; // - pen.width(); + // p.drawLine( viewportX(), y, viewportWidth(), y ); + painter->drawLine( + visibleRect.left(), y, visibleRect.right(), + y); // draw from 0 to allow correct rendering of dotted lines + } + // PROF_END +} + +void TextEditorRenderer::renderLineText(QPainter *painter, int line) +{ + // PROF_BEGIN_NAMED("render-line-text") + TextLayout *textLayout = renderer()->textLayoutForLine(line); + + // draw the text layout + QPoint lineStartPos(0, line * renderer()->lineHeight()); + // PROF_BEGIN_NAMED("fetch-formats") + // QVector<QTextLayout::FormatRange>& formats = + // renderer()->themeStyler()->getLineFormatRanges( line ); + QVector<QTextLayout::FormatRange> formats; + // PROF_END + + // painter->setClipping(false); + // painter->setPen( QPen( QColor( 0,0,200), 2 )); + // QRect clipDrawRect( renderer()->translatedClipRect() ); + // clipDrawRect.adjust(2,2,-2,-2); + // painter->drawRect( clipDrawRect ); + // painter->setClipping(true); + + // PROF_BEGIN_NAMED("draw-texts") + painter->setPen(themeRef_->foregroundColor()); + textLayout->draw(painter, lineStartPos, formats, *renderer()->clipRect()); + // PROF_END + + // PROF_END +} + +// This method renders all carets +void TextEditorRenderer::renderCarets(QPainter *painter) +{ + // PROF_BEGIN_NAMED("render-carets") + + if (renderer()->shouldRenderCaret()) + { + TextDocument *doc = renderer()->textDocument(); + TextRangeSet *sel = renderer()->textSelection(); + painter->setPen(themeRef_->caretColor()); + + int startLine = renderer()->startLine(); + int endLine = renderer()->endLine(); + int caretWidth = renderer()->config()->caretWidth(); + + for (int line = startLine; line <= endLine; ++line) + { + + QPoint lineStartPos(0, renderer()->yPosForLine(line)); + + TextLayout *textLayout = renderer()->textLayoutForLine(line); + for (int caret = 0, rangeCount = sel->rangeCount(); caret < rangeCount; + ++caret) + { + + TextRange &range = sel->range(caret); + int caretLine = doc->lineFromOffset(range.caret()); + if (caretLine == line) + { + int caretCol = doc->columnFromOffsetAndLine(range.caret(), caretLine); + textLayout->drawCursor(painter, lineStartPos, caretCol, caretWidth); + } + } + } + } + // PROF_END +} + +void TextEditorRenderer::renderShade(QPainter *painter, const QRect &rect) +{ + // render a shade + if (renderer()->viewportX()) + { + int shadowStart = renderer()->viewportX(); + painter->setPen(Qt::NoPen); + QBrush oldBrush = painter->brush(); + painter->setBrushOrigin(shadowStart, rect.y()); + painter->setBrush(*shadowGradient_); + + QRect shadowRect(shadowStart, rect.y(), ShadowWidth, rect.height()); + painter->drawRect(shadowRect.intersected(*renderer()->clipRect())); + + painter->setBrush(oldBrush); + } +} + +/// should return the extra pixels to update when updating a line +/// This way it is possible to render margins around the lines +int TextEditorRenderer::extraPixelsToUpdateAroundLines() +{ + return 0; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/components/texteditorrenderer.h b/lib/edbee-lib/edbee/views/components/texteditorrenderer.h new file mode 100644 index 00000000..15934e16 --- /dev/null +++ b/lib/edbee-lib/edbee/views/components/texteditorrenderer.h @@ -0,0 +1,46 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +class QLinearGradient; +class QPainter; +class QRect; + +namespace edbee +{ + +class TextRenderer; +class TextTheme; + +class EDBEE_EXPORT TextEditorRenderer +{ +public: + TextEditorRenderer(TextRenderer *renderer); + virtual ~TextEditorRenderer(); + + virtual int preferedWidth(); + virtual void render(QPainter *painter); + virtual void renderLineBackground(QPainter *painter, int line); + virtual void renderLineSelection(QPainter *painter, int line); + virtual void renderLineBorderedRanges(QPainter *painter, int line); + virtual void renderLineSeparator(QPainter *painter, int line); + virtual void renderLineText(QPainter *painter, int line); + virtual void renderCarets(QPainter *painter); + virtual void renderShade(QPainter *painter, const QRect &rect); + + virtual int extraPixelsToUpdateAroundLines(); + + TextRenderer *renderer() { return rendererRef_; } + +private: + TextRenderer *rendererRef_; ///< the renderere reference + TextTheme *themeRef_; ///< A theem reference used while rendering + QLinearGradient *shadowGradient_; ///< The shadow gradient to draw +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/components/textmargincomponent.cpp b/lib/edbee-lib/edbee/views/components/textmargincomponent.cpp new file mode 100644 index 00000000..994f97ec --- /dev/null +++ b/lib/edbee-lib/edbee/views/components/textmargincomponent.cpp @@ -0,0 +1,454 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "textmargincomponent.h" + +#include <QApplication> +#include <QLinearGradient> +#include <QPainter> +#include <QScrollBar> +#include <QWheelEvent> + +#include "edbee/models/texteditorconfig.h" +#include "edbee/models/textbuffer.h" +#include "edbee/models/textdocument.h" +#include "edbee/views/components/texteditorcomponent.h" +#include "edbee/views/texteditorscrollarea.h" +#include "edbee/views/textrenderer.h" +#include "edbee/views/texttheme.h" +#include "edbee/views/textselection.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/texteditorwidget.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +static const int LineNumberRightPadding = 10; +static const int MarginPaddingRight = 5; + +/// The default constructor +TextMarginComponentDelegate::TextMarginComponentDelegate() + : marginComponentRef_(nullptr) + , startLine_(0) +{ +} + +/// The default text (of course) is the line-number +QString TextMarginComponentDelegate::lineText(int line) +{ + return QStringLiteral("%1").arg(line + 1); +} + +/// The extra space required before the line-number +/// The default implemenation returns 0 +int TextMarginComponentDelegate::widthBeforeLineNumber() +{ + return 5; +} + +/// Custom rendering before the line-numbers etc are drawn +void TextMarginComponentDelegate::renderBefore(QPainter *painter, int startLine, + int endLine, int width) +{ + Q_UNUSED(painter) + Q_UNUSED(startLine) + Q_UNUSED(endLine) + Q_UNUSED(width) +} + +/// The delegate can berform custom rendering on a given line +void TextMarginComponentDelegate::renderAfter(QPainter *painter, int startLine, + int endLine, int width) +{ + Q_UNUSED(painter) + Q_UNUSED(startLine) + Q_UNUSED(endLine) + Q_UNUSED(width) +} + +/// Make this method return true to enable mouse tracking +bool TextMarginComponentDelegate::requiresMouseTracking() +{ + return true; +} + +/// This method is called when the mouse is moved over a certain line +/// To use it you MUST manually call setMouseTracking() on the +/// TextMarginComponent +void TextMarginComponentDelegate::mouseMoveEvent(int line, QMouseEvent *event) +{ + Q_UNUSED(line) + Q_UNUSED(event) + if (event->buttons() & Qt::LeftButton) + { + if (line >= 0) + { + TextEditorController *controller + = marginComponent()->editorWidget()->controller(); + if (line < startLine_) + { + controller->moveCaretTo(startLine_ + 1, 0, false); + controller->moveCaretTo(line, 0, true); + } + else + { + controller->moveCaretTo(line + 1, 0, true); + } + } + } +} + +void TextMarginComponentDelegate::mousePressEvent(int line, QMouseEvent *event) +{ + Q_UNUSED(event) + if (line >= 0) + { + TextEditorController *controller + = marginComponent()->editorWidget()->controller(); + controller->moveCaretTo(line, 0, false); + controller->moveCaretTo(line + 1, 0, true); + startLine_ = line; + } +} + +void TextMarginComponentDelegate::leaveEvent(QEvent *event) +{ + Q_UNUSED(event) +} + +//============================= + +/// Constructs the textmarginc compnonent. +/// @param editor the editor this component is connceted to +/// @param parent the parent widget +TextMarginComponent::TextMarginComponent(TextEditorWidget *editor, + QWidget *parent) + : QWidget(parent) + , top_(0) + , width_(-1) + , lastLineCount_(-1) + , marginFont_(nullptr) + , editorRef_(editor) + , delegate_(nullptr) + , delegateRef_(nullptr) +{ + this->setFocusPolicy(Qt::NoFocus); + this->setAutoFillBackground(false); + this->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); +} + +/// The margin component destructor +TextMarginComponent::~TextMarginComponent() +{ + delete delegate_; + delete marginFont_; +} + +/// initalizes this component +void TextMarginComponent::init() +{ + giveDelegate(new TextMarginComponentDelegate()); + updateMarginFont(); + connect(editorRef_->textRenderer(), SIGNAL(themeChanged(TextTheme *)), + SLOT(updateFont())); + connect(editorRef_->config(), SIGNAL(configChanged()), SLOT(updateFont())); + connectScrollBar(); +} + +/// Updates the margin font +void TextMarginComponent::updateMarginFont() +{ + delete marginFont_; + if (renderer()->textWidget()) + { + const QFont &font = editorWidget()->font(); + marginFont_ = new QFont(editorWidget()->font().family()); + if (font.pointSizeF() > 0) + marginFont_->setPointSizeF(font.pointSizeF()); + if (font.pixelSize() > 0) + marginFont_->setPixelSize(font.pixelSize()); + } + else + { + marginFont_ = new QFont(QFont().family(), 10); // fallback for test-suite + } +} + +/// Returns the required width for this control +int TextMarginComponent::widthHint() const +{ + TextDocument *doc = renderer()->textDocument(); + int lineCount = doc->lineCount(); + if (lastLineCount_ != lineCount) + { + lastLineCount_ = lineCount; + + // count the number of characters required + int decimals = 0; + int decimalValue = 1; + do + { + ++decimals; + decimalValue *= 10; + } while (decimalValue <= lineCount); + + // we at least reserve space for 2 decimals + decimals = qMax(decimals, 2); + + width_ = qMax(renderer()->nrWidth(), 10) * (decimals) + + LineNumberRightPadding + MarginPaddingRight; + width_ += delegate()->widthBeforeLineNumber(); + } + return width_; +} + +/// This method returns the size hint +QSize TextMarginComponent::sizeHint() const +{ + // QSize size = QWidget::sizeHint(); + return QSize(widthHint(), 78); + // return QSize(widthHint(), renderer()->totalHeight() ); +} + +/// This emthod is called when the text is changed +bool TextMarginComponent::isGeometryChangeRequired() +{ + return this->widthHint() != this->width(); +} + +/// A slow and full update of the control +void TextMarginComponent::fullUpdate() +{ + updateGeometry(); + update(); +} + +/// Returns the renderer +TextRenderer *TextMarginComponent::renderer() const +{ + return editorWidget()->textRenderer(); +} + +/// This method sets the delegate +void TextMarginComponent::setDelegate(TextMarginComponentDelegate *delegate) +{ + delete delegate_; + delegate_ = nullptr; + if (delegate == nullptr) + { + delegate = new TextMarginComponentDelegate(); + } + delegateRef_ = delegate; + + // perform some updates + delegateRef_->setMarginCompenent(this); + setMouseTracking(delegateRef_->requiresMouseTracking()); +} + +void TextMarginComponent::giveDelegate(TextMarginComponentDelegate *delegate) +{ + setDelegate(delegate); + delegate_ = delegate; +} + +void TextMarginComponent::paintEvent(QPaintEvent *event) +{ + QWidget::paintEvent(event); + + QPainter painter(this); + + painter.translate(0, -top_); + + QRect paintRect = event->rect(); + // QRect translatedRect( clipRect.x()+offsetX, clipRect.y()+offsetY, + // clipRect.width(), clipRect.height() ); + paintRect.adjust(0, top_, 0, top_); + renderer()->renderBegin(paintRect); + + int startLine = renderer()->startLine(); + int endLine = renderer()->endLine(); + const QSize &size = this->size(); + + QRect totalRect(0, 0, size.width(), size.height() + top_); + QRect rect(totalRect.intersected(*renderer()->clipRect())); + + // qlog_info()<< "** top:"<<top_<<", total:"<<totalRect<<", paintRect: + // "<<paintRect<<" => rect: " << rect; + + // fill the backgound + painter.fillRect(rect, renderer()->theme()->backgroundColor()); + + delegate()->renderBefore(&painter, startLine, endLine, size.width()); + renderCaretMarkers(&painter, startLine, endLine, size.width()); + renderLineNumber(&painter, startLine, endLine, size.width()); + delegate()->renderAfter(&painter, startLine, endLine, size.width()); + + renderer()->renderEnd(paintRect); + painter.translate(0, top_); +} + +/// Renders the caret markers in the sidebar +/// @param painter the Qt Painting context +/// @param startLine the first line to render +/// @param endLine the last line to render +/// @param width the width for rendering +void TextMarginComponent::renderCaretMarkers(QPainter *painter, int startLine, + int endLine, int width) +{ + TextDocument *doc = renderer()->textDocument(); + TextSelection *sel = renderer()->textSelection(); + QColor lineColor = renderer()->theme()->lineHighlightColor(); + int lineHeight = renderer()->lineHeight(); + + QRect marginRect(0, 0, width - MarginPaddingRight, lineHeight); + for (int i = 0, cnt = sel->rangeCount(); i < cnt; ++i) + { + + TextRange &range = sel->range(i); + int line = doc->lineFromOffset(range.caret()); + if (startLine <= line) + { + if (line > endLine) + { + break; + } + int y = renderer()->yPosForLine(line); + marginRect.moveTop(y); + painter->fillRect(marginRect, lineColor); + } + } +} + +/// Renders the line number in the sidebar +/// @param painter the Qt Painting context +/// @param startLine the first line to render +/// @param endLine the last line to render +/// @param width the width for rendering +void TextMarginComponent::renderLineNumber(QPainter *painter, int startLine, + int endLine, int width) +{ + painter->setFont(*marginFont_); + QColor selectedPenColor = renderer()->theme()->foregroundColor(); + QColor penColor(selectedPenColor); + penColor.setAlphaF(0.5); + + int lineHeight = renderer()->lineHeight(); + int textWidth = width - LineNumberRightPadding - MarginPaddingRight + - delegate()->widthBeforeLineNumber(); + + for (int line = startLine; line <= endLine; ++line) + { + int y = renderer()->yPosForLine(line); + + // highlight the selected lines + int firstIndex = 0, lastIndex = 0; + if (renderer()->textSelection()->rangesAtLineExclusiveEnd(line, firstIndex, + lastIndex)) + { + painter->setPen(selectedPenColor); + } + else + { + painter->setPen(penColor); + } + + painter->drawText(delegate()->widthBeforeLineNumber(), y + 2, textWidth, + lineHeight, Qt::AlignRight, delegate()->lineText(line)); + } +} + +/// Can be used to track mouse events +/// This method sends the the mouse movement events to the delegate +void TextMarginComponent::mouseMoveEvent(QMouseEvent *event) +{ +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + int y = event->pos().y() + top_; +#else + int y = event->position().toPoint().y() + top_; +#endif + int line = renderer()->lineIndexForYpos(y); + delegate()->mouseMoveEvent(line, event); + QWidget::mouseMoveEvent(event); +} + +/// Can be used to track mouse events +/// This method sends the the mouse movement events to the delegate +void TextMarginComponent::mousePressEvent(QMouseEvent *event) +{ +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + int y = event->pos().y() + top_; +#else + int y = event->position().toPoint().y() + top_; +#endif + int line = renderer()->lineIndexForYpos(y); + delegate()->mousePressEvent(line, event); + QWidget::mousePressEvent(event); + + if (!editorWidget()->textEditorComponent()->hasFocus()) + { + editorWidget()->textEditorComponent()->setFocus(); + } +} + +/// A double click +void TextMarginComponent::mouseDoubleClickEvent(QMouseEvent *) {} + +/// The mouse leave +void TextMarginComponent::leaveEvent(QEvent *event) +{ + delegate()->leaveEvent(event); +} + +/// forward the mouse wheel event to the scrollbar so you can use the mouse +/// wheel on this component +void TextMarginComponent::wheelEvent(QWheelEvent *event) +{ + // if( event->orientation() == Qt::Vertical) { + if (event->angleDelta().y() != 0) + { + QApplication::sendEvent(editorRef_->textScrollArea()->verticalScrollBar(), + event); + } +} + +/// updates the given line so it will be repainted +void TextMarginComponent::updateLineAtOffset(int offset) +{ + int yPos = renderer()->yPosForOffset(offset) - top_; + + update(0, yPos, width(), renderer()->lineHeight()); +} + +/// This method repaints the given lines +void TextMarginComponent::updateLine(int line, int length) +{ + TextRenderer *ren = renderer(); + int startY = ren->yPosForLine(line) - top_; + int endY = ren->yPosForLine(line + length) - top_; + + update(0, startY, width(), endY - startY); +} + +void TextMarginComponent::topChanged(int value) +{ + top_ = value; + update(); +} + +/// You must reconnect the scrollbars when scrollbars are changed +void TextMarginComponent::connectScrollBar() +{ + connect(editorRef_->verticalScrollBar(), SIGNAL(valueChanged(int)), this, + SLOT(topChanged(int))); +} + +void TextMarginComponent::updateFont() +{ + updateMarginFont(); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/components/textmargincomponent.h b/lib/edbee-lib/edbee/views/components/textmargincomponent.h new file mode 100644 index 00000000..0ee1a6ab --- /dev/null +++ b/lib/edbee-lib/edbee/views/components/textmargincomponent.h @@ -0,0 +1,119 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QWidget> + +class QEvent; +class QFont; +class QLinearGradient; +class QMouseEvent; +class QPainter; + +namespace edbee +{ + +class TextEditorWidget; +class TextMarginComponent; +class TextRenderer; +class TextTheme; + +/// The textmargin component delegate +/// You can override the methods in the class for adding functionality to the +/// text-margin component +class EDBEE_EXPORT TextMarginComponentDelegate +{ +public: + TextMarginComponentDelegate(); + virtual ~TextMarginComponentDelegate() {} + + virtual QString lineText(int line); + + virtual int widthBeforeLineNumber(); + virtual void renderBefore(QPainter *painter, int startLine, int endLine, + int width); + virtual void renderAfter(QPainter *painter, int startLine, int endLine, + int width); + + virtual bool requiresMouseTracking(); + virtual void mouseMoveEvent(int line, QMouseEvent *event); + virtual void mousePressEvent(int line, QMouseEvent *event); + virtual void leaveEvent(QEvent *event); + + TextMarginComponent *marginComponent() { return marginComponentRef_; } + void setMarginCompenent(TextMarginComponent *comp) + { + marginComponentRef_ = comp; + } + +private: + TextMarginComponent + *marginComponentRef_; ///< A reference to the margincomponent + int startLine_; ///< The line which starts the selection +}; + +/// The margin/line-number component +/// This class is used for rendering line-numbers etc +class EDBEE_EXPORT TextMarginComponent : public QWidget +{ + Q_OBJECT + +public: + TextMarginComponent(TextEditorWidget *editorWidget, QWidget *parent); + virtual ~TextMarginComponent(); + + void init(); + void updateMarginFont(); + + int widthHint() const; + virtual QSize sizeHint() const; + bool isGeometryChangeRequired(); + + void fullUpdate(); + TextEditorWidget *editorWidget() const { return editorRef_; } + TextRenderer *renderer() const; + + TextMarginComponentDelegate *delegate() const { return delegateRef_; } + void setDelegate(TextMarginComponentDelegate *delegate); + void giveDelegate(TextMarginComponentDelegate *delegate); + +protected: + virtual void paintEvent(QPaintEvent *event); + virtual void renderCaretMarkers(QPainter *painter, int startLine, int endLine, + int width); + virtual void renderLineNumber(QPainter *painter, int startLine, int endLine, + int width); + + virtual void mouseMoveEvent(QMouseEvent *event); + virtual void mousePressEvent(QMouseEvent *event); + virtual void mouseDoubleClickEvent(QMouseEvent *); + virtual void leaveEvent(QEvent *event); + virtual void wheelEvent(QWheelEvent *event); + +public: + virtual void updateLineAtOffset(int offset); + virtual void updateLine(int line, int length); + +protected slots: + + virtual void topChanged(int value); + virtual void connectScrollBar(); + virtual void updateFont(); + +private: + /// the width of the sidebar + int top_; ///< The first pixel that needs to been shown + mutable int width_; + mutable int lastLineCount_; + QFont *marginFont_; ///< the font used for the margin + TextEditorWidget *editorRef_; ///< The text-editor widget + TextMarginComponentDelegate *delegate_; ///< The 'owned' text delegate + TextMarginComponentDelegate *delegateRef_; ///< The delegate reference +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/textcaretcache.cpp b/lib/edbee-lib/edbee/views/textcaretcache.cpp new file mode 100644 index 00000000..c77f2090 --- /dev/null +++ b/lib/edbee-lib/edbee/views/textcaretcache.cpp @@ -0,0 +1,119 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "textcaretcache.h" + +#include "edbee/models/textbuffer.h" +#include "edbee/models/textdocument.h" +#include "edbee/views/textrenderer.h" +#include "edbee/models/textrange.h" + +#include "edbee/debug.h" + +// #define STRICT_CHECK_ON_CACHE + +namespace edbee +{ + +/// The text document cache +TextCaretCache::TextCaretCache(TextDocument *doc, TextRenderer *renderer) + : textDocumentRef_(doc) + , textRendererRef_(renderer) +{ +} + +void TextCaretCache::clear() +{ + // qlog_info() << "[CACHE:clear]"; + xPosCache_.clear(); +} + +void TextCaretCache::fill(TextRangeSet &selection) +{ + clear(); + // qlog_info() << "[CACHE:fill]"; + for (int i = 0, cnt = selection.rangeCount(); i < cnt; ++i) + { + TextRange &range = selection.range(i); + add(range.caret()); + if (range.hasSelection()) + { + add(range.anchor()); + } + } + // dump(); +} + +/// This method replaces all cached content with the one given +void TextCaretCache::replaceAll(TextCaretCache &cache) +{ + // qlog_info() << "[CACHE:replaceAll]"; + xPosCache_ = cache.xPosCache_; + // dump(); +} + +int TextCaretCache::xpos(int offset) +{ +// qlog_info() << "xpos-cache: " << this->xPosCache_.size(); +// qlog_info() << "[CACHE:xpos]" << offset << " >> " << +// xPosCache_.contains(offset); +#ifdef STRICT_CHECK_ON_CACHE + Q_ASSERT(xPosCache_.contains(offset)); +#endif + + // when not in debug-mode fallback to calculating the position! + if (!xPosCache_.contains(offset)) + { + add(offset); + } + return xPosCache_.value(offset); +} + +/// Adds an xposition for the given offset +void TextCaretCache::add(int offset, int xpos) +{ + // qlog_info() << "[CACHE:add]" << offset<< " => " << xpos; + xPosCache_.insert(offset, xpos); +} + +/// Adds the given offset by calculating the position +void TextCaretCache::add(int offset) +{ + int line = textDocumentRef_->lineFromOffset(offset); + int col = textDocumentRef_->columnFromOffsetAndLine(offset, line); + int xpos = textRendererRef_->xPosForColumn(line, col); + add(offset, xpos); +} + +/// This method should be called if the caret moves +void TextCaretCache::caretMovedFromOldOffsetToNewOffset(int oldOffset, + int newOffset) +{ + // qlog_info() << "[CACHE:move]" << oldOffset<< " => " << newOffset << " << + // " << xPosCache_.contains(oldOffset); + Q_ASSERT(xPosCache_.contains(oldOffset)); + int xpos = xPosCache_.take(oldOffset); + xPosCache_.insert(newOffset, xpos); + + // qlog_info() << " CACHE: move " << oldOffset << " to " << newOffset << " + // => " << xpos; +} + +/// This method checks if the cache is filled +bool TextCaretCache::isFilled() +{ + return !xPosCache_.isEmpty(); +} + +void TextCaretCache::dump() +{ + qlog_info() << "DUMP CARET CACHE:" << xPosCache_.size(); + foreach (int key, xPosCache_.keys()) + { + qlog_info() << " - " << key << ": " << xPosCache_.value(key); + } +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/textcaretcache.h b/lib/edbee-lib/edbee/views/textcaretcache.h new file mode 100644 index 00000000..0373a80c --- /dev/null +++ b/lib/edbee-lib/edbee/views/textcaretcache.h @@ -0,0 +1,46 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QHash> + +namespace edbee +{ + +class TextDocument; +class TextRenderer; +class TextRangeSet; + +/// A special cache. For remembering the x-coordinates of the carets +class EDBEE_EXPORT TextCaretCache +{ +public: + TextCaretCache(TextDocument *doc, TextRenderer *renderer); + + void clear(); + void fill(TextRangeSet &selection); + void replaceAll(TextCaretCache &cache); + + int xpos(int offset); + void add(int offset, int xpos); + void add(int offset); + + void caretMovedFromOldOffsetToNewOffset(int oldOffset, int newOffset); + + bool isFilled(); + + void dump(); + +private: + TextDocument *textDocumentRef_; ///< A reference to the current buffer + TextRenderer *textRendererRef_; ///< A reference to the renderer + // QVector<int> xPosCache_; ///< The xpos cache for the carets + QHash<int, int> xPosCache_; ///< The x-pos cache +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/texteditorscrollarea.cpp b/lib/edbee-lib/edbee/views/texteditorscrollarea.cpp new file mode 100644 index 00000000..f22c4dc6 --- /dev/null +++ b/lib/edbee-lib/edbee/views/texteditorscrollarea.cpp @@ -0,0 +1,223 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include <QLinearGradient> +#include <QPainter> +#include <QPaintEvent> +#include <QScrollBar> +#include <QWidget> + +#include "texteditorscrollarea.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +static const int ShadowSize = 0; + +/// A special class to draw a shadow over the widget +class PrivateShadowWidget : public QWidget +{ + TextEditorScrollArea *scrollAreaRef_; + QLinearGradient *leftShadow_; ///< The shadow gradients to draw + QLinearGradient *topShadow_; ///< The shadow gradients to draw + QLinearGradient *rightShadow_; ///< The shadow gradients to draw + QLinearGradient *bottomShadow_; ///< The shadow gradients to draw + +public: + PrivateShadowWidget(TextEditorScrollArea *parent) + : QWidget(parent) + , scrollAreaRef_(parent) + , leftShadow_(0) + , topShadow_(0) + , rightShadow_(0) + , bottomShadow_(0) + { + QColor black = QColor(0x00, 0x00, 0x00, 0x99); + QColor trans = QColor(0x00, 0x00, 0x00, 0x00); + + leftShadow_ = new QLinearGradient(0, 0, ShadowSize, 0); + leftShadow_->setColorAt(0, black); + leftShadow_->setColorAt(1, trans); + + topShadow_ = new QLinearGradient(0, 0, 0, ShadowSize); + topShadow_->setColorAt(0, black); + topShadow_->setColorAt(1, trans); + + rightShadow_ = new QLinearGradient(0, 0, ShadowSize, 0); + rightShadow_->setColorAt(0, trans); + rightShadow_->setColorAt(1, black); + + bottomShadow_ = new QLinearGradient(0, 0, 0, ShadowSize); + bottomShadow_->setColorAt(0, trans); + bottomShadow_->setColorAt(1, black); + + setAttribute(Qt::WA_TransparentForMouseEvents); + setAttribute(Qt::WA_TranslucentBackground); + } + ~PrivateShadowWidget() + { + delete leftShadow_; + delete topShadow_; + delete rightShadow_; + delete bottomShadow_; + } + +protected: + void paintEvent(QPaintEvent *event) + { + QPainter painter(this); + QBrush oldBrush = painter.brush(); + renderShade(event, &painter); + painter.setBrush(oldBrush); + } + + void renderShade(QPaintEvent *event, QPainter *painter) + { + painter->setPen(Qt::NoPen); + + int scrollX = scrollAreaRef_->horizontalScrollBar()->value(); + int minX = scrollAreaRef_->horizontalScrollBar()->minimum(); + int maxX = scrollAreaRef_->horizontalScrollBar()->maximum(); + + int scrollY = scrollAreaRef_->verticalScrollBar()->value(); + int minY = scrollAreaRef_->verticalScrollBar()->minimum(); + int maxY = scrollAreaRef_->verticalScrollBar()->maximum(); + + // render shadow at the left side + if (scrollX != minX) + { + painter->setBrush(*leftShadow_); + QRect shadowRect(0, 0, ShadowSize, height()); + painter->setBrushOrigin(shadowRect.topLeft()); + painter->drawRect(shadowRect.intersected(event->rect())); + } + + // render shadow top + if (scrollX != maxX) + { + painter->setBrush(*rightShadow_); + QRect shadowRect(width() - ShadowSize, 0, ShadowSize, height()); + painter->setBrushOrigin(shadowRect.topLeft()); + painter->drawRect(shadowRect.intersected(event->rect())); + } + // render shadow at the left side + if (scrollY != minY) + { + painter->setBrush(*topShadow_); + QRect shadowRect(0, 0, width(), ShadowSize); + painter->setBrushOrigin(shadowRect.topLeft()); + painter->drawRect(shadowRect.intersected(event->rect())); + } + + // render shadow bottom + if (scrollY != maxY) + { + painter->setBrush(*bottomShadow_); + QRect shadowRect(0, height() - ShadowSize, width(), ShadowSize); + painter->setBrushOrigin(shadowRect.topLeft()); + painter->drawRect(shadowRect.intersected(event->rect())); + } + } +}; + +TextEditorScrollArea::TextEditorScrollArea(QWidget *parent) + : QScrollArea(parent) + , leftWidgetRef_(0) + , topWidgetRef_(0) + , rightWidgetRef_(0) + , bottomWidgetRef_(0) + , shadowWidgetRef_(0) +{ + shadowWidgetRef_ = new PrivateShadowWidget(this); + setFrameShape(QFrame::NoFrame); + setFocusPolicy(Qt::NoFocus); +} + +TextEditorScrollArea::~TextEditorScrollArea() {} + +void TextEditorScrollArea::setLeftWidget(QWidget *widget) +{ + leftWidgetRef_ = widget; +} + +void TextEditorScrollArea::setTopWidget(QWidget *widget) +{ + topWidgetRef_ = widget; +} + +void TextEditorScrollArea::setRightWidget(QWidget *widget) +{ + rightWidgetRef_ = widget; +} + +void TextEditorScrollArea::setBottomWidget(QWidget *widget) +{ + bottomWidgetRef_ = widget; +} + +/// this method layouts the margin-widgets +void TextEditorScrollArea::layoutMarginWidgets() +{ + int left = leftWidgetRef_ ? leftWidgetRef_->sizeHint().width() : 0; + int top = topWidgetRef_ ? topWidgetRef_->sizeHint().height() : 0; + int right = rightWidgetRef_ ? rightWidgetRef_->sizeHint().width() : 0; + int bottom = bottomWidgetRef_ ? bottomWidgetRef_->sizeHint().height() : 0; + + // set the margins + // int pixelFix = -1; // removes the dirty little gray line between the + // components + setViewportMargins(left, top, right, bottom); + + // overlay the shadow over the viewport + if (shadowWidgetRef_) + { + this->shadowWidgetRef_->setGeometry(viewport()->geometry()); + } + + // set the widget + if (leftWidgetRef_) + { + QRect rect(0, top, left, + qMin(leftWidgetRef_->maximumHeight(), viewport()->height() + 1)); + leftWidgetRef_->setGeometry(rect); + } + + if (topWidgetRef_) + { + QRect rect(0, 0, qMin(topWidgetRef_->maximumWidth(), width()) + 1, top + 1); + topWidgetRef_->setGeometry(rect); + } + + if (rightWidgetRef_) + { + QRect rect(viewport()->width() + left, top, right + 1, + qMin(rightWidgetRef_->maximumHeight(), viewport()->height()) + + 1); + rightWidgetRef_->setGeometry(rect); + } + + if (bottomWidgetRef_) + { + QRect rect(0, viewport()->height() + top, + qMin(bottomWidgetRef_->maximumWidth(), viewport()->width()) + 1, + bottom + 1); + bottomWidgetRef_->setGeometry(rect); + } +} + +void TextEditorScrollArea::enableShadowWidget(bool enabled) +{ + shadowWidgetRef_->setVisible(enabled); +} + +void TextEditorScrollArea::resizeEvent(QResizeEvent *event) +{ + QScrollArea::resizeEvent(event); + layoutMarginWidgets(); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/texteditorscrollarea.h b/lib/edbee-lib/edbee/views/texteditorscrollarea.h new file mode 100644 index 00000000..6553a673 --- /dev/null +++ b/lib/edbee-lib/edbee/views/texteditorscrollarea.h @@ -0,0 +1,49 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QScrollArea> + +class QLinearGradient; +class QPainter; + +namespace edbee +{ + +class PrivateShadowWidget; + +/// A special scrollarea that makes it possible to add components to the margins +/// of it +class EDBEE_EXPORT TextEditorScrollArea : public QScrollArea +{ + Q_OBJECT +public: + explicit TextEditorScrollArea(QWidget *parent = 0); + virtual ~TextEditorScrollArea(); + + void setLeftWidget(QWidget *widget); + void setTopWidget(QWidget *widget); + void setRightWidget(QWidget *widget); + void setBottomWidget(QWidget *widget); + +public: + void layoutMarginWidgets(); + void enableShadowWidget(bool enabled); + +protected: + virtual void resizeEvent(QResizeEvent *event); + +private: + QWidget *leftWidgetRef_; ///< The left widget + QWidget *topWidgetRef_; ///< The top widget + QWidget *rightWidgetRef_; ///< The right widget + QWidget *bottomWidgetRef_; ///< The bottom widget + PrivateShadowWidget *shadowWidgetRef_; ///< The private shadow widget +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/textlayout.cpp b/lib/edbee-lib/edbee/views/textlayout.cpp new file mode 100644 index 00000000..6392b19e --- /dev/null +++ b/lib/edbee-lib/edbee/views/textlayout.cpp @@ -0,0 +1,192 @@ +#include "textlayout.h" + +#include <QTextLayout> + +#include "edbee/debug.h" + +namespace edbee +{ + +//================================================= + +TextLayout::TextLayout(TextDocument *document) + : qtextLayout_(new QTextLayout()) + , textDocumentRef_(document) + , singleCharRanges_(nullptr) +{ +} + +TextLayout::~TextLayout() +{ + delete singleCharRanges_; + delete qtextLayout_; +} + +void TextLayout::setCacheEnabled(bool enable) +{ + qtextLayout_->setCacheEnabled(enable); +} + +QTextLayout *TextLayout::qTextLayout() const +{ + return qtextLayout_; +} + +QRectF TextLayout::boundingRect() const +{ + return qtextLayout_->boundingRect(); +} + +void TextLayout::buildLayout() +{ + qtextLayout_->beginLayout(); + qtextLine_ = qtextLayout_->createLine(); + qtextLayout_->endLayout(); +} + +/// Converts the document cursorPosition to a virtual cursorposition +int TextLayout::toVirtualCursorPosition(int cursorPos) const +{ + int delta = 0; + // convert cursor to a valid location + TextRangeSet *ranges = singleCharRanges(); + if (ranges) + { + for (int i = 0, cnt = ranges->rangeCount(); i < cnt; i++) + { + TextRange &range = ranges->range(i); + if (cursorPos + delta > range.min()) + { + delta += range.length() - 1; + } + } + } + return cursorPos + delta; +} + +/// Converts the virtual cursorPosition to a docuemnt cursorposition +int TextLayout::fromVirtualCursorPosition(int cursor) const +{ + // when the cursor falls in a single-character range. + // Set the cursor to the start of this range + int delta = 0; + + TextRangeSet *ranges = singleCharRanges(); + if (ranges) + { + for (int i = 0, cnt = ranges->rangeCount(); i < cnt; i++) + { + TextRange &range = ranges->range(i); + if (range.min() <= cursor && cursor < range.max()) + { + delta += cursor - range.min(); + } + else if (range.max() <= cursor) + { + delta += range.length() - 1; + } + } + } + return cursor - delta; +} + +void TextLayout::draw(QPainter *p, const QPointF &pos, + const QVector<QTextLayout::FormatRange> &selections, + const QRectF &clip) const +{ + qtextLayout_->draw(p, pos, selections, clip); +} + +void TextLayout::drawCursor(QPainter *painter, const QPointF &position, + int cursorPosition, int width) const +{ + int virtualCursorPosition = toVirtualCursorPosition(cursorPosition); + qtextLayout_->drawCursor(painter, position, virtualCursorPosition, width); +} + +void TextLayout::setFormats(const QVector<QTextLayout::FormatRange> &formats) +{ + qtextLayout_->setFormats(formats); +} + +void TextLayout::setText(const QString &string) +{ + qtextLayout_->setText(string); +} + +void TextLayout::useSingleCharRanges() +{ + if (!singleCharRanges_) + { + singleCharRanges_ = new TextRangeSet(textDocumentRef_); + } +} + +TextRangeSet *TextLayout::singleCharRanges() const +{ + return singleCharRanges_; +} + +void TextLayout::addSingleCharRange(int index, int length) +{ + useSingleCharRanges(); + singleCharRanges()->addRange(index, index + length); +} + +qreal TextLayout::cursorToX(int cursorPos, QTextLine::Edge edge) const +{ + int virtualCursorPos = toVirtualCursorPosition(cursorPos); + + qreal x = qtextLine_.cursorToX(virtualCursorPos, edge); + return x; +} + +int TextLayout::xToCursor(qreal x, QTextLine::CursorPosition cpos) const +{ + int virtualCursor = qtextLine_.xToCursor(x, cpos); + return fromVirtualCursorPosition(virtualCursor); +} + +//================================================= + +TextLayoutBuilder::TextLayoutBuilder( + TextLayout *textLayout, QString &baseString, + QVector<QTextLayout::FormatRange> &baseFormatRanges) + : textLayoutRef_(textLayout) + , baseString_(baseString) + , baseFormatRanges_(baseFormatRanges) +{ +} + +void TextLayoutBuilder::replace(int index, int length, + const QString replacement, + QTextCharFormat format) +{ + baseString_.replace(index, length, replacement); + textLayoutRef_->addSingleCharRange( + index, + replacement.length()); /// TODO: Should we store the original length!?!?!? + + // change existing format ranges: + int delta = replacement.length() - length; + if (delta != 0) + { + for (int i = 0, cnt = baseFormatRanges_.length(); i < cnt; i++) + { + QTextLayout::FormatRange &formatRange = baseFormatRanges_[i]; + if (formatRange.start >= index) + { + formatRange.start += delta; + } + } + } + + // append the text format + QTextLayout::FormatRange formatRange; + formatRange.format = format; + formatRange.start = index; + formatRange.length = replacement.length(); + baseFormatRanges_.append(formatRange); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/textlayout.h b/lib/edbee-lib/edbee/views/textlayout.h new file mode 100644 index 00000000..bf609690 --- /dev/null +++ b/lib/edbee-lib/edbee/views/textlayout.h @@ -0,0 +1,91 @@ +#pragma once + +#include "edbee/exports.h" + +#include <QRectF> +#include <QTextLine> +#include <QTextLayout> + +#include "edbee/models/textrange.h" + +class QTextLayout; + +namespace edbee +{ + +class TextLayout; + +/// A virtual textlayout +/// +/// This class wraps the QTextLayout used for rendering. +/// Modifying all cursor/positioning related methods, supporting single-cursor +/// items, while rendering multiple QTextLayout characters +/// +/// Note: this is very Edbee specific. Every TextLayout has got a single line! +class TextLayout +{ +public: + TextLayout(TextDocument *document); + virtual ~TextLayout(); + + void setCacheEnabled(bool enable); + QTextLayout *qTextLayout() const; + QRectF boundingRect() const; + + void buildLayout(); + + int toVirtualCursorPosition(int cursor) const; + int fromVirtualCursorPosition(int cursor) const; + + void draw(QPainter *p, const QPointF &pos, + const QVector<QTextLayout::FormatRange> &selections + = QVector<QTextLayout::FormatRange>(), + const QRectF &clip = QRectF()) const; + void drawCursor(QPainter *painter, const QPointF &position, + int cursorPosition, int width) const; + + void setFormats(const QVector<QTextLayout::FormatRange> &formats); + void setText(const QString &string); + + void useSingleCharRanges(); + TextRangeSet *singleCharRanges() const; + void addSingleCharRange(int index, int length); + + /// These calculations manipulate the cursor position. .. + /// We assume the SOURCE character is 1... (TODO: store the orginal number of + /// replace characters) + qreal cursorToX(int cursorPos, + QTextLine::Edge edge = QTextLine::Leading) const; + int xToCursor(qreal x, QTextLine::CursorPosition cpos + = QTextLine::CursorBetweenCharacters) const; + +protected: + QTextLayout *qtextLayout_; + TextDocument *textDocumentRef_; + TextRangeSet *singleCharRanges_; ///< A list textRanges_ used by TextLayout. + ///< Every range in this list is treatet as a + ///< single character for cusor-movement etc + QTextLine qtextLine_; +}; + +//================================================= + +class TextLayoutBuilder +{ +public: + TextLayoutBuilder(TextLayout *textLayout, QString &baseString, + QVector<QTextLayout::FormatRange> &baseFormatRanges); + + void replace(int index, int length, const QString replacement, + QTextCharFormat format); + +protected: + TextLayout *textLayoutRef_; ///< A reference to the textlayout + QString &baseString_; ///< A reference to the base-string. (This string is + ///< modified!) + QVector<QTextLayout::FormatRange> + &baseFormatRanges_; ///< A reference to the baseFormat range (This list is + ///< modified!) +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/textrenderer.cpp b/lib/edbee-lib/edbee/views/textrenderer.cpp new file mode 100644 index 00000000..c8372602 --- /dev/null +++ b/lib/edbee-lib/edbee/views/textrenderer.cpp @@ -0,0 +1,714 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "textrenderer.h" + +#include <QBrush> +#include <QDateTime> +#include <QRect> +#include <QPainter> +#include <QStringList> +#include <QTextLayout> + +#include "edbee/util/simpleprofiler.h" + +#include "edbee/models/chardocument/chartextdocument.h" +#include "edbee/models/textdocument.h" +#include "edbee/models/texteditorconfig.h" +#include "edbee/models/textlexer.h" +#include "edbee/views/textlayout.h" +#include "edbee/views/textselection.h" +#include "edbee/views/texttheme.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/texteditorwidget.h" + +#include "edbee/debug.h" + +/// Using control picutres makes it possible to show the control characters +/// (rquires a special font) +// #define USE_CONTROL_PICTURES + +namespace edbee +{ + +/// The default textrenderer constructor +TextRenderer::TextRenderer(TextEditorController *controller) + : QObject(nullptr) + , controllerRef_(controller) + , caretTime_(0) + , caretBlinkRate_(0) + , totalWidthCache_(0) + , textThemeStyler_(nullptr) + , clipRectRef_(nullptr) + , startOffset_(0) + , endOffset_(0) + , startLine_(0) + , endLine_(0) + , placeHolderDocument_(0) +{ + connect( + controller, + SIGNAL(textDocumentChanged(edbee::TextDocument *, edbee::TextDocument *)), + this, + SLOT(textDocumentChanged(edbee::TextDocument *, edbee::TextDocument *))); + textThemeStyler_ = new TextThemeStyler(controller); + placeHolderDocument_ = new CharTextDocument(); +} + +/// the destructor +TextRenderer::~TextRenderer() +{ + delete placeHolderDocument_; + delete textThemeStyler_; + cachedTextLayoutList_.clear(); + // qDeleteAll(cachedTextLayoutList_); +} + +/// The init method is called if all objects required for editing have been +/// created! +void TextRenderer::init() +{ + caretBlinkRate_ = config()->caretBlinkingRate(); + resetCaretTime(); +} + +/// This method resets all caching information +void TextRenderer::reset() +{ + totalWidthCache_ = 0; + cachedTextLayoutList_.clear(); +} + +/// This method returns the (maximum) line-height in pixels +int TextRenderer::lineHeight() +{ + + /// TODO: cache the height :-) + QFontMetrics fm = textWidget()->fontMetrics(); + return fm.ascent() + fm.descent() + fm.leading() + + config()->extraLineSpacing(); // (the 1 is for the base line). +} + +/// This method converts the give y position to a line index +/// Warning this returns a RAW line index, which means it can be an invalid line +/// @param y the y position +int TextRenderer::rawLineIndexForYpos(int y) +{ + return y / lineHeight(); +} + +/// This method returns a valid line index for the given y-pos +/// If the y-position isn't on a line it returns a value < 0 +int TextRenderer::lineIndexForYpos(int y) +{ + int line = rawLineIndexForYpos(y); + if (line >= textDocument()->lineCount()) + return -1; + return line; +} + +/// Returns the total width of the editor. This method is NOT the real with +/// This method takes the maximum line length and multiplies it with the widest +/// character. +int TextRenderer::totalWidth() +{ + if (!totalWidthCache_) + { + for (int line = 0, cnt = textDocument()->lineCount(); line < cnt; ++line) + { + TextLayout *layout = textLayoutForLine(line); + totalWidthCache_ = qMax(qRound(layout->boundingRect().right() + 0.5), + totalWidthCache_); + } + } + return totalWidthCache_; + + /* maxWidth returns 0 on Mac + if( !totalWidthCache_ ) { + TextDocument* doc =textDocument(); + int maxChars = 0; + for( int line=0,cnt=doc->lineCount(); line<cnt; ++line ) { + maxChars = qMax( doc->lineLength(line), maxChars ); + } + + QFontMetrics fm = QtextWidget()->fontMetrics(); + qlog_info() << "FontMetrics: " << fm.averageCharWidth(); + qlog_info() << "Maximum width:" << maxChars << " * " << fm.maxWidth() << " + :: " << (fm.maxWidth() * maxChars); ttoalWidthCache_ = fm.maxWidth() * + maxChars; + } + return totalWidthCache_; + */ +} + +/// This method returns the total height +int TextRenderer::totalHeight() +{ + return textDocument()->lineCount() * lineHeight() + lineHeight(); +} + +/// This method returns width of the M cahracter +int TextRenderer::emWidth() +{ + return textWidget()->fontMetrics().horizontalAdvance('M'); +} + +/// The M-width isn't good enough for calculating the width of numbers. +/// Often the M is to wide. That why we have a nr width which takes the 8 for +/// the width +int TextRenderer::nrWidth() +{ + return textWidget()->fontMetrics().horizontalAdvance('8'); +} + +/// This method returns the number of lines +int TextRenderer::viewHeightInLines() +{ + int result = viewportHeight() / lineHeight() - 1; + return result; +} + +/// This method returns the first visible line +int TextRenderer::firstVisibleLine() +{ + return viewportY() / lineHeight(); +} + +/// This method returns the (closet) valid column for the given x-position +int TextRenderer::columnIndexForXpos(int line, int x) +{ + TextLayout *layout = textLayoutForLine(line); + if (!layout) + return 0; + + // x -= sideBarLeftWidth(); + + return layout->xToCursor(x); +} + +/// This method returns the x position for the given column +int TextRenderer::xPosForColumn(int line, int column) +{ + TextLayout *layout = textLayoutForLine(line); + qreal x = 0; // sideBarLeftWidth(); + if (layout) + { + x += layout->cursorToX(column); + } + return qRound(x); +} + +/// This method returns the x-coordinate for the given offset +int TextRenderer::xPosForOffset(int offset) +{ + int line = textDocument()->lineFromOffset(offset); + int x = 0; + if (line >= 0) + { + int lineStartOffset = textDocument()->offsetFromLine(line); + int col = offset - lineStartOffset; + x += xPosForColumn(line, col); + } + return x; +} + +/// This method returns the y position for the given line +int TextRenderer::yPosForLine(int line) +{ + return line * lineHeight(); +} + +/// This method returns the offset position for the given line +int TextRenderer::yPosForOffset(int offset) +{ + int line = textDocument()->lineFromOffset(offset); + return yPosForLine(line); +} + +/// This method returns the textlayout for the given line +TextLayout *TextRenderer::textLayoutForLine(int line) +{ + Q_ASSERT(line >= 0); + /// FIXME: Invalide TextLayout cache when required!!! + if (controller()->textDocument()->length() == 0) + { + return textLayoutForLineForPlaceholder(line); + } + else + { + return textLayoutForLineNormal(line); + } +} + +// Sample from: +// https://github.com/microsoft/vscode/pull/136347/commits/d2c24cc1d1161193c46ac44364a053c082657d69 +static bool isControlCharacter(QChar charCode) +{ + if (charCode < QChar(32)) + { + // TAB + return (charCode != '\t'); + } + if (charCode == QChar(127)) + { + // DEL + return true; + } + + if ((charCode >= QChar(0x202A) && charCode <= QChar(0x202E)) + || (charCode >= QChar(0x2066) && charCode <= QChar(0x2069)) + || (charCode >= QChar(0x200E) && charCode <= QChar(0x200F)) + || charCode == QChar(0x061C)) + { + // Unicode Directional Formatting Characters + // LRE U+202A LEFT-TO-RIGHT EMBEDDING + // RLE U+202B RIGHT-TO-LEFT EMBEDDING + // PDF U+202C POP DIRECTIONAL FORMATTING + // LRO U+202D LEFT-TO-RIGHT OVERRIDE + // RLO U+202E RIGHT-TO-LEFT OVERRIDE + // LRI U+2066 LEFT‑TO‑RIGHT ISOLATE + // RLI U+2067 RIGHT‑TO‑LEFT ISOLATE + // FSI U+2068 FIRST STRONG ISOLATE + // PDI U+2069 POP DIRECTIONAL ISOLATE + // LRM U+200E LEFT-TO-RIGHT MARK + // RLM U+200F RIGHT-TO-LEFT MARK + // ALM U+061C ARABIC LETTER MARK + return true; + } + return false; +} + +TextLayout *TextRenderer::textLayoutForLineForPlaceholder(int line) +{ + Q_ASSERT(line >= 0); + /// FIXME: Invalide TextLayout cache when required!!! + + TextDocument *doc = textDocument(); + if (line >= doc->lineCount()) + return nullptr; + + TextLayout *textLayout = cachedTextLayoutList_.object(line); + if (!textLayout) + { + textLayout = new TextLayout(textDocument()); + textLayout->setCacheEnabled(true); + int tabWidth + = controllerRef_->widget()->fontMetrics().horizontalAdvance('M'); + + QTextOption option; + option.setTabStopDistance(config()->indentSize() * tabWidth); + if (config()->showWhitespaceMode() == TextEditorConfig::ShowWhitespaces) + { + option.setFlags( + QTextOption::ShowTabsAndSpaces); /// TODO: Make an option to show + /// spaces and tabs + } + + textLayout->qTextLayout()->setFont(textWidget()->font()); + textLayout->qTextLayout()->setTextOption(option); + + // add extra format (no format) + QTextCharFormat format; + + QColor color = themeStyler()->theme()->foregroundColor(); + color.setAlpha(180); + format.setForeground(color); + + QString text = doc->lineWithoutNewline(line); + + QVector<QTextLayout::FormatRange> formatRanges; + QTextLayout::FormatRange formatRange; + formatRange.start = 0; + formatRange.length = text.length(); + formatRange.format = format; + formatRanges.append(formatRange); + textLayout->setFormats(formatRanges); + + textLayout->setText(text); + textLayout->buildLayout(); + + // update the width cache + totalWidthCache_ = qMax(totalWidthCache_, + qRound(textLayout->boundingRect().width() + 0.5)); + + // add to the cache + cachedTextLayoutList_.insert(line, textLayout); + // qlog_info() << "Cache Line: " << line; + } + return textLayout; +} + +TextLayout *TextRenderer::textLayoutForLineNormal(int line) +{ + Q_ASSERT(line >= 0); + /// FIXME: Invalide TextLayout cache when required!!! + + TextDocument *doc = textDocument(); + if (line >= doc->lineCount()) + return nullptr; + + TextLayout *textLayout = cachedTextLayoutList_.object(line); + if (!textLayout) + { + textLayout = new TextLayout(textDocument()); + textLayout->setCacheEnabled(true); + int tabWidth + = controllerRef_->widget()->fontMetrics().horizontalAdvance('M'); + + QTextOption option; + option.setTabStopDistance(config()->indentSize() * tabWidth); + + if (config()->showWhitespaceMode() == TextEditorConfig::ShowWhitespaces) + { + option.setFlags( + QTextOption::ShowTabsAndSpaces); /// TODO: Make an option to show + /// spaces and tabs + } + + textLayout->qTextLayout()->setFont(textWidget()->font()); + // qlog_info() << "font: " << textWidget()->font().pointSizeF(); + textLayout->qTextLayout()->setTextOption(option); + + // add extra format + QString text = doc->lineWithoutNewline(line); + QVector<QTextLayout::FormatRange> formatRanges + = themeStyler()->getLineFormatRanges(line); + + TextLayoutBuilder textLayoutBuilder(textLayout, text, formatRanges); + + if (config()->renderBidiContolCharacters()) + { + + QTextCharFormat textFormat; + textFormat.setBackground(Qt::red); // QBrush(QColor::red())); + textFormat.setForeground(Qt::white); // QBrush(QColor::red())); + + for (int i = 0; i < text.size(); ++i) + { + QChar c = text.at(i); + if (isControlCharacter(c)) + { + + QString str = QString("[U+%1]").arg(QString::number(c.unicode(), 16)); + // QString newString = "⚠️"; + // text.replace(i, 1, str); + + /* ORIGINAL first solution + // Better replacement for control character: + http://unicode.org/charts/PDF/U2400.pdf + // This fixes the strange caret behaviour + //QString newString(0x2426); // Arabiq question mark + QString newString(0x2425); // YMBOL FOR DELETE FORM TWO + text.replace(i, 1, newString); + + QTextLayout::FormatRange formatRange; + formatRange.format = textFormat; + formatRange.start = i; + formatRange.length = newString.length(); + formatRange.format.setToolTip(str); + formatRanges.append(formatRange); + */ + textLayoutBuilder.replace(i, 1, str, textFormat); + } + } + } + textLayout->setFormats(formatRanges); + +#ifdef USE_CONTROL_PICTURES + for (int i = 0; i < text.size(); ++i) + { + QChar c = text.at(i); + if (c == 32) + { + c = 0x2423; + text.replace(i, 1, c); + } + else if (c == '\t') + { + c = 0x21E5; + text.replace(i, 1, c); + } + else if (c == '\n') + { + c = 0x23CE; + text.replace(i, 1, c); + } + if (c < 32 && c != 8) + { + c = QChar(0x2400 + + c.unicode()); // add the Control Pictures range (see: + // http://unicode.org/charts/PDF/U2400.pdf ) + text.replace(i, 1, c); + } + } +#endif + + textLayout->setText(text); + textLayout->buildLayout(); + + // update the width cache + totalWidthCache_ = qMax(totalWidthCache_, + qRound(textLayout->boundingRect().width() + 0.5)); + + // add to the cache + cachedTextLayoutList_.insert(line, textLayout); + + // qlog_info() << "Cache Line: " << line; + } + return textLayout; +} + +/// This method starts rendering +void TextRenderer::renderBegin(const QRect &rect) +{ + + // PROF_BEGIN + TextDocument *doc = textDocument(); + + clipRectRef_ = ▭ + + int y = rect.y(); + + // the first line to render + int calculatedEndLine = rawLineIndexForYpos(y + rect.height()) + + 1; // add 1 line extra (for half visible lines) + + // assign the 'work' variables + int lineCount = doc->lineCount(); + startLine_ = qBound(0, rawLineIndexForYpos(y), lineCount - 1); + endLine_ = qBound(0, calculatedEndLine, lineCount - 1); + + Q_ASSERT(startLine_ <= endLine_); + + // qlog_info() << ">> render startLine" << startLine_ << " t/m endLine=" << + // endLine_ << " ==> " << ( endLine_ - startLine_ ) << " + // y="<<y<<",height="<<rect.height()<<"-------------------" ; + startOffset_ = doc->offsetFromLine(startLine_); + endOffset_ = doc->offsetFromLine(endLine_ + 1); + + // Make sure the cache-data is filled + // PROF_BEGIN_NAMED("layouts") + for (int line = startLine_; line <= endLine_; ++line) + { + textLayoutForLine(line); // make sure the cache is filled + } + // PROF_END + + /// TODO: move this lexing stuff to the controller + // prepare the style + if (textDocument()->textLexer()) + { + // PROF_BEGIN_NAMED("lexer") + textDocument()->textLexer()->lexRange(startOffset_, endOffset_); + // PROF_END + } +} + +/// This method starts rendering +void TextRenderer::renderEnd(const QRect &rect) +{ + Q_UNUSED(rect) +} + +/// This method returns the document +TextDocument *TextRenderer::textDocument() +{ + if (controllerRef_->textDocument()->length() == 0) + { + // return placeholder textdocument + return placeHolderDocument_; + } + return controllerRef_->textDocument(); +} + +TextDocument *TextRenderer::placeholderTextDocument() +{ + return placeHolderDocument_; +} + +/// This method returns the textselection +TextSelection *TextRenderer::textSelection() +{ + return controllerRef_->textSelection(); +} + +/// Returns the editor configuration +TextEditorConfig *TextRenderer::config() +{ + return textDocument()->config(); +} + +/// returns a reference to the given controller +TextEditorController *TextRenderer::controller() +{ + return controllerRef_; +} + +/// This method returns the widget +TextEditorWidget *TextRenderer::textWidget() +{ + return controllerRef_->widget(); +} + +/// Sets the current viewport of the renderer +void TextRenderer::setViewport(const QRect &viewport) +{ + viewport_ = viewport; +} + +/// sets the caret time on 0 +void TextRenderer::resetCaretTime() +{ + if (caretTime_ >= 0) + { + caretTime_ = QDateTime::currentMSecsSinceEpoch(); + } +} + +/// this method returns true if the caret is visible +bool TextRenderer::shouldRenderCaret() +{ + if (caretTime_ < 0) + { + return false; + } + if (!caretBlinkRate_) + { + return true; + } + qint64 time = QDateTime::currentMSecsSinceEpoch() - caretTime_; + return (time % caretBlinkRate_) < (caretBlinkRate_ >> 1); +} + +/// Returns true if the caret is visible +bool TextRenderer::isCaretVisible() +{ + return caretTime_ >= 0; +} + +/// sets the carets to visible or invisible +void TextRenderer::setCaretVisible(bool visible) +{ + caretTime_ = visible ? QDateTime::currentMSecsSinceEpoch() : -1; +} + +/// returns the current theme name +QString TextRenderer::themeName() const +{ + return textThemeStyler_->themeName(); +} + +/// Returns the active theme +TextTheme *TextRenderer::theme() +{ + return textThemeStyler_->theme(); +} + +/// Selects the active theme name +void TextRenderer::setThemeByName(const QString &name) +{ + textThemeStyler_->setThemeByName(name); + invalidateCaches(); + emit themeChanged(textThemeStyler_->theme()); +} + +/// sets the theme +/// @param theme the them to set +void TextRenderer::setTheme(TextTheme *theme) +{ + textThemeStyler_->setTheme(theme); + invalidateCaches(); + emit themeChanged(theme); +} + +/// The text-document has been changed +void TextRenderer::textDocumentChanged(edbee::TextDocument *oldDocument, + edbee::TextDocument *newDocument) +{ + // disconnect an old document (if required) + if (oldDocument) + { + disconnect(oldDocument, nullptr, this, nullptr); + } + reset(); + + // connect with the new dpcument + connect(newDocument, SIGNAL(textChanged(edbee::TextBufferChange, QString)), + this, SLOT(textChanged(edbee::TextBufferChange, QString))); + connect(newDocument, SIGNAL(lastScopedOffsetChanged(int, int)), this, + SLOT(lastScopedOffsetChanged(int, int))); +} + +/// The text is replaced +void TextRenderer::textChanged(edbee::TextBufferChange change, QString oldText) +{ + Q_UNUSED(oldText) + int lineCount = qMax(change.lineCount(), change.newLineCount()) + 1; + + // Unfortunately when the line-count is changed we need to invalidate all + // because we cannot move the cached layouts easy in the layout list + if (change.lineCount() - change.newLineCount()) + { + cachedTextLayoutList_.clear(); + } + else + { + + // invalidate all if there are to many lines + if (lineCount > cachedTextLayoutList_.size() / 2) + { + cachedTextLayoutList_.clear(); + } + else + { + for (int i = 0, cnt = lineCount; i < cnt; ++i) + { + cachedTextLayoutList_.remove(change.line() + i); + } + } + } +} + +/// The scoped to offset has been changed +void TextRenderer::lastScopedOffsetChanged(int previousOffset, int newOffset) +{ + // qlog_info() << "** + // lastScopedOffsetChanged("<<previousOffset<<","<<newOffset<<") **"; + Q_UNUSED(newOffset) + int lastValidLine = textDocument()->lineFromOffset(previousOffset); + invalidateTextLayoutCaches(lastValidLine); + // textWidget()->fullUpdate(); +} + +/// Invalidates the QTextLayout caches +void TextRenderer::invalidateTextLayoutCaches(int fromLine) +{ + // qlog_info() << "** invalidateTextLayoutCache("<<fromLine<<") **"; + if (fromLine) + { + QList<int> keys = cachedTextLayoutList_.keys(); + foreach (int key, keys) + { + if (key >= fromLine) + { + cachedTextLayoutList_.remove(key); + } + } + } + else + { + cachedTextLayoutList_.clear(); + } +} + +/// call this method to invalidate all caches! +void TextRenderer::invalidateCaches() +{ + // qlog_info() << "** invalidateCaches() **"; + totalWidthCache_ = 0; + cachedTextLayoutList_.clear(); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/textrenderer.h b/lib/edbee-lib/edbee/views/textrenderer.h new file mode 100644 index 00000000..57de65a3 --- /dev/null +++ b/lib/edbee-lib/edbee/views/textrenderer.h @@ -0,0 +1,173 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QCache> +#include <QObject> +#include <QHash> +#include <QRect> + +#include "edbee/models/textbuffer.h" + +class QPainter; +class QRect; + +namespace edbee +{ + +class AbstractComponent; +class TextDocument; +class TextEditorConfig; +class TextEditorController; +class TextEditorWidget; +class TextRangeSet; +class TextSelection; +class TextTheme; +class TextThemeStyler; +class TextLayout; + +/// A class for rendering the text +/// TODO: Currently this class is also used for positioning text. This probably +/// should be moved in a class of its own +class EDBEE_EXPORT TextRenderer : public QObject +{ + Q_OBJECT + +public: + TextRenderer(TextEditorController *controller); + virtual ~TextRenderer(); + virtual void init(); + virtual void reset(); + + // calculation functions + int lineHeight(); + int rawLineIndexForYpos(int y); + int lineIndexForYpos(int y); + int totalWidth(); + int totalHeight(); + int emWidth(); + int nrWidth(); + int viewHeightInLines(); + int firstVisibleLine(); + + int columnIndexForXpos(int line, int x); + int xPosForColumn(int line, int column); + int xPosForOffset(int offset); + int yPosForLine(int line); + int yPosForOffset(int offset); + + // Document access functions (Document vs Placeholder text) + int lineCount(); + QString getLine(int index); + + // caching + TextLayout *textLayoutForLine(int line); + TextLayout *textLayoutForLineForPlaceholder(int line); + TextLayout *textLayoutForLineNormal(int line); + + // rendering + void renderBegin(const QRect &rect); + void renderEnd(const QRect &rect); + + // getters / setters + TextDocument *textDocument(); + TextDocument *placeholderTextDocument(); + TextSelection *textSelection(); + TextEditorConfig *config(); + TextEditorController *controller(); + TextEditorWidget *textWidget(); + + void setViewport(const QRect &viewport); + + void resetCaretTime(); + bool shouldRenderCaret(); + bool isCaretVisible(); + void setCaretVisible(bool visible); + + QRect viewport() { return viewport_; } + int viewportX() { return viewport_.x(); } + int viewportY() { return viewport_.y(); } + int viewportWidth() { return viewport_.width(); } + int viewportHeight() { return viewport_.height(); } + + // theme support + TextThemeStyler *themeStyler() { return textThemeStyler_; } + + QString themeName() const; + TextTheme *theme(); + void setThemeByName(const QString &name); + void setTheme(TextTheme *theme); + + // temporary getters only valid while rendering!! + const QRect *clipRect() + { + return clipRectRef_; + } ///< This method is valid only while rendering! + int startOffset() + { + return startOffset_; + } ///< This method is valid only while rendering! + int endOffset() + { + return endOffset_; + } ///< This method is valid only while rendering! + int startLine() + { + return startLine_; + } ///< This method is valid only while rendering! + int endLine() + { + return endLine_; + } ///< This method is valid only while rendering! + +private: + void updateWidthCacheForRange(int offset, int length); + +protected slots: + + void textDocumentChanged(edbee::TextDocument *oldDocument, + edbee::TextDocument *newDocument); + void textChanged(edbee::TextBufferChange change, QString oldText = QString()); + + void lastScopedOffsetChanged(int previousOffset, int newOffset); + +public slots: + + void invalidateTextLayoutCaches(int fromLine = 0); + void invalidateCaches(); + +signals: + void themeChanged(TextTheme *theme); + +private: + TextEditorController + *controllerRef_; ///< A reference to the widget it is rendering + qint64 caretTime_; ///< The current time of the caret. -1 means that the caret + ///< is disabled + qint64 caretBlinkRate_; ///< The caret blink rate + + QCache<int, TextLayout> + cachedTextLayoutList_; ///< A list of cached text layouts + + QRect viewport_; ///< The current (total) viewport. (This is updated from the + ///< window) + int totalWidthCache_; ///< The total width cache + + TextThemeStyler *textThemeStyler_; ///< The current theme styler + + // temporary variables only valid the int the current context + const QRect *clipRectRef_; ///< A reference to the clipping rectangle + int startOffset_; ///< The start offset that needs rendering + int endOffset_; ///< The end opffset that needs rendering + int startLine_; ///< The first line that needs rendering + int endLine_; ///< The last line that needs rendering + + TextDocument *placeHolderDocument_; +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/textselection.cpp b/lib/edbee-lib/edbee/views/textselection.cpp new file mode 100644 index 00000000..10009012 --- /dev/null +++ b/lib/edbee-lib/edbee/views/textselection.cpp @@ -0,0 +1,191 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "textselection.h" + +#include "edbee/models/textbuffer.h" +#include "edbee/models/textdocument.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/views/textrenderer.h" +#include "edbee/views/textcaretcache.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +/// Constructs the textextselection object +/// @param controller the controller this selection is for +TextSelection::TextSelection(TextEditorController *controller) + : TextRangeSet(controller->textDocument()) + , textControllerRef_(controller) +{ +} + +/// A copy constructor for copying a text-selection +TextSelection::TextSelection(const TextSelection &selection) + : TextRangeSet(selection) + , textControllerRef_(selection.textControllerRef_) +{ +} + +/// The text selection destructor +TextSelection::~TextSelection() {} + +/// This method is for moving the carets up or down +/// This method can be executed on (this) when a 0 pointer is given. +/// When another rangeSet is given this code is execute on that rangeset! (FIXME +/// need a cleaner API for this) +/// +/// @param controller the controller for this operation +/// @param rangeSet the rangeset to apply this operation on +/// @param amount the number of lines to move +void TextSelection::moveCaretsByLine(TextEditorController *controller, + TextRangeSet *rangeSet, int amount) +{ + TextDocument *doc = controller->textDocument(); + TextRenderer *renderer = controller->textRenderer(); + + TextCaretCache *cache = controller->textCaretCache(); + if (!cache->isFilled()) + { + cache->fill(*rangeSet); + } + + // next move all lines + TextCaretCache newCache(doc, renderer); + for (int rangeIdx = rangeSet->rangeCount() - 1; rangeIdx >= 0; --rangeIdx) + { + TextRange &range = rangeSet->range(rangeIdx); + + int caret = range.caret(); + int xpos = cache->xpos(caret); // the (original) caret x-position + + // change the line + int line = doc->lineFromOffset(caret) + amount; + if (line < 0) + { + line = 0; + } + // if( line >= doc->lineCount() ) { line = doc->lineCount()-1; } + + // calculate the correct column + int col = renderer->columnIndexForXpos(line, xpos); + int offset = doc->offsetFromLine(line); + int offsetNextLine = doc->offsetFromLine(line + 1); + int newLinesToRemove = line + 1 < doc->lineCount() ? 1 : 0; + range.setCaretBounded( + doc, qMin(offset + col, offsetNextLine - newLinesToRemove)); + + // cache->caretMovedFromOldOffsetToNewOffset( caret, range.caret() ); + // // when having multiple caret this doesn't work ! + newCache.add(range.caret(), xpos); + } + cache->replaceAll(newCache); + + // rangeSet->processChangesIfRequiredKeepCaretCache(); + rangeSet->processChangesIfRequired(); +} + +/// Moves the carets by page +/// +/// @param controller the controller for this operation +/// @param rangeSet the rangeset to apply this operation +/// @param amount the number of pages +void TextSelection::moveCaretsByPage(TextEditorController *controller, + TextRangeSet *rangeSet, int amount) +{ + TextRenderer *renderer = controller->textRenderer(); + TextDocument *doc = controller->textDocument(); + int linesPerPage = renderer->viewHeightInLines(); + for (int rangeIdx = rangeSet->rangeCount() - 1; rangeIdx >= 0; --rangeIdx) + { + TextRange &range = rangeSet->range(rangeIdx); + int line = doc->lineFromOffset(range.caret()); + line += linesPerPage * amount; + int offset = doc->offsetFromLine(line); + range.setCaretBounded(doc, offset); + } + rangeSet->processChangesIfRequired(); + // processChangesIfRequiredKeepCaretCache(); +} + +/// This method adds the ranges by line +void TextSelection::addRangesByLine(TextEditorController *controller, + TextRangeSet *rangeSet, int amount) +{ + TextDocument *doc = controller->textDocument(); + TextRenderer *renderer = controller->textRenderer(); + + // qlog_info() << "=========== change ========== "; + + TextCaretCache *cache = controller->textCaretCache(); + // cache->dump(); + + if (!cache->isFilled()) + { + cache->fill(*rangeSet); + // cache->dump(); + } + + // next move all lines + rangeSet->beginChanges(); // prevent the clearing of the range cache + for (int rangeIdx = rangeSet->rangeCount() - 1; rangeIdx >= 0; --rangeIdx) + { + TextRange &range = rangeSet->range(rangeIdx); + + int offset = amount > 0 ? range.max() : range.min(); + int xpos = cache->xpos(offset); // the (original) caret x-position + + // change the line + int line = doc->lineFromOffset(offset) + amount; + if (line >= 0) + { + + // calculate the correct column + int col = renderer->columnIndexForXpos(line, xpos); + int lineOffset = doc->offsetFromLine(line); + int offsetNextLine = doc->offsetFromLine(line + 1); + int newLinesToRemove = line + 1 < doc->lineCount() ? 1 : 0; + + offset = qMin(lineOffset + col, offsetNextLine - newLinesToRemove); + if (offset >= 0 && offset <= doc->length()) + { + rangeSet->addRange(offset, offset); + cache->add(offset, xpos); // add the original xpos + } + } + } + // cache->dump(); + rangeSet->endChanges(); + + rangeSet->processChangesIfRequired(); + // processChangesIfRequiredKeepCaretCache(); +} + +/// Returns the controller for this selection +TextEditorController *TextSelection::textEditorController() const +{ + return textControllerRef_; +} + +/// This method process the changes if required +void TextSelection::processChangesIfRequired(bool joinBorders) +{ + TextRangeSet::processChangesIfRequired(joinBorders); + if (!changing()) + { + textEditorController()->textCaretCache()->clear(); + } +} + +/// This method process the changes if required +void TextSelection::processChangesIfRequiredKeepCaretCache(bool joinBorders) +{ + Q_UNUSED(joinBorders); + // TextRangeSet::processChangesIfRequiredKeepCaretCache(joinBorders); +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/textselection.h b/lib/edbee-lib/edbee/views/textselection.h new file mode 100644 index 00000000..e2b1b13e --- /dev/null +++ b/lib/edbee-lib/edbee/views/textselection.h @@ -0,0 +1,55 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include "edbee/models/textrange.h" + +namespace edbee +{ + +class TextEditorController; + +/// The class textselection is a RangeSet that is used +/// by the view of the document +/// +/// The textselection is placed in the view directory because it closely +/// relates to the view of the textdocument +/// +/// For instance moving line/up and line/down isn an operation that isn't +/// possible on the document side. Because we support variable font widts.. Also +/// 'remembering' the caret screen-x and -y positions isn't relevant for a +/// docuemnt. That is stuff that needs to be placed in the view side +class EDBEE_EXPORT TextSelection : public TextRangeSet +{ +public: + TextSelection(TextEditorController *controller); + TextSelection(const TextSelection &selection); + virtual ~TextSelection(); + + static void moveCaretsByLine(TextEditorController *controller, + TextRangeSet *rangeSet, int amount); + static void moveCaretsByPage(TextEditorController *controller, + TextRangeSet *rangeSet, int amount); + static void addRangesByLine(TextEditorController *controller, + TextRangeSet *rangeSet, int amount); + + virtual + + // getters + TextEditorController * + textEditorController() const; + +protected: + virtual void processChangesIfRequired(bool joinBorders = false); + virtual void processChangesIfRequiredKeepCaretCache(bool joinBorders = false); + +private: + TextEditorController *textControllerRef_; ///< A reference to the controller +}; + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/texttheme.cpp b/lib/edbee-lib/edbee/views/texttheme.cpp new file mode 100644 index 00000000..fde97464 --- /dev/null +++ b/lib/edbee-lib/edbee/views/texttheme.cpp @@ -0,0 +1,504 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#include "texttheme.h" + +#include <QApplication> +#include <QDateTime> +#include <QDir> +#include <QPalette> +#include <QStack> +#include <QVector> + +#include "edbee/io/tmthemeparser.h" +#include "edbee/models/textbuffer.h" +#include "edbee/models/textdocument.h" +#include "edbee/models/textdocumentscopes.h" +#include "edbee/texteditorcontroller.h" +#include "edbee/edbee.h" + +#include "edbee/debug.h" + +namespace edbee +{ + +TextThemeRule::TextThemeRule(const QString &name, const QString &selector, + QColor foreground, QColor background, bool bold, + bool italic, bool underline) + : name_(name) + , scopeSelector_(0) + , foregroundColor_(foreground) + , backgroundColor_(background) + , bold_(bold) + , italic_(italic) + , underline_(underline) +{ + scopeSelector_ = new TextScopeSelector(selector); +} + +TextThemeRule::~TextThemeRule() +{ + delete scopeSelector_; +} + +/// This method checks if the given scopelist matches the scope selector +bool TextThemeRule::matchesScopeList(const TextScopeList *scopes) +{ + return (scopeSelector_->calculateMatchScore(scopes) >= 0); +} + +void TextThemeRule::fillFormat(QTextCharFormat *format) +{ + if (foregroundColor_.isValid()) + { + format->setForeground(foregroundColor_); + } + if (backgroundColor_.isValid()) + { + format->setBackground(backgroundColor_); + } + if (bold_) + { + format->setFontWeight(QFont::Bold); + } // QFont::Black + if (italic_) + { + format->setFontItalic(true); + } + if (underline_) + { + format->setFontUnderline(true); + } +} + +//================================================= + +TextTheme::TextTheme() + : name_("Default Theme") + , uuid_("") + , backgroundColor_(0xffeeeeee) + , caretColor_(0xff000000) + , foregroundColor_(0xff222222) + , lineHighlightColor_(0xff999999) + , selectionColor_(0xff9999ff) + +// thTheme settings +// , backgroundColor_(0xff272822) +// , caretColor_(0xffF8F8F0) +// , foregroundColor_(0xffF8F8F2) +// , invisiblesColor_(0xff3B3A32) +// , lineHighlightColor_(0xff3E3D32) +// , selectionColor_(0xff49483E) +// , findHighlightBackgroundColor_(0xffFFE792) +// , findHighlightForegroundColor_(0xff000000) +// , selectionBorderColor_(0xff222218) +// , activeGuideColor_(0x9D550FB0) +// , bracketForegroundColor_(0xF8F8F2A5) +// , bracketOptions_("underline") +// , bracketContentsForegroundColor_(0xF8F8F2A5) +// , bracketContentsOptions_("underline") +// , tagsOptions_("stippled_underline") + +{ + QPalette pal = QApplication::palette(); + backgroundColor_ = pal.color(QPalette::Window); + foregroundColor_ = pal.color(QPalette::WindowText); + selectionColor_ = pal.color(QPalette::Highlight); + // giveThemeRule( new TextThemeRule("Comment","comment", QColor("#75715E") + // )); giveThemeRule( new TextThemeRule("String","string", + // QColor("#E6DB74") )); +} + +TextTheme::~TextTheme() +{ + qDeleteAll(themeRules_); +} + +/// The text theme +void TextTheme::giveThemeRule(TextThemeRule *rule) +{ + themeRules_.append(rule); +} + +void TextTheme::fillFormatForTextScopeList(const TextScopeList *scopeList, + QTextCharFormat *format) +{ + // format->setForeground( foregroundColor() ); + // format->setBackground( backgroundColor() ); + + foreach (TextThemeRule *rule, themeRules_) + { + if (rule->matchesScopeList(scopeList)) + { + rule->fillFormat(format); + } + } +} + +//================================================= + +/// Constructs the theme styler +/// @param controller the controller to use this styler for +TextThemeStyler::TextThemeStyler(TextEditorController *controller) + : controllerRef_(controller) + , themeName_() + , themeRef_(0) +{ + connect( + controller, + SIGNAL(textDocumentChanged(edbee::TextDocument *, edbee::TextDocument *)), + SLOT(textDocumentChanged(edbee::TextDocument *, edbee::TextDocument *))); + connect(Edbee::instance()->themeManager(), + SIGNAL(themePointerChanged(QString, TextTheme *, TextTheme *)), + SLOT(themePointerChanged(QString, TextTheme *, TextTheme *))); + themeRef_ = Edbee::instance()->themeManager()->fallbackTheme(); +} + +/// The current destructor +TextThemeStyler::~TextThemeStyler() {} + +/// This method returns a reference to the given line format. +/// WARNING this reference is ONLY valid very shortly.. Another call to this +/// method can invalidates the previous result!!! +/// +/// @param lineIdx the line index +/// @return the array of ranges +QVector<QTextLayout::FormatRange> +TextThemeStyler::getLineFormatRanges(int lineIdx) +{ + TextDocumentScopes *scopes = controller()->textDocument()->scopes(); + + // check if the range is in the case. When it is, use it + QVector<QTextLayout::FormatRange> formatRangeList; + + // get all textranges on the given line + ScopedTextRangeList *scopedRanges = scopes->scopedRangesAtLine(lineIdx); + if (scopedRanges == 0 || scopedRanges->size() == 0) + { + return formatRangeList; + } + + // build format ranges from these (nested) scope ranges + // + // [ source.c ] + // [ string.c ] [keyword] + // [ escape. ] + // = + // [ ][xx][#########][xxxx][ ][kkkkkkk][ ] + // + QStack<ScopedTextRange *> activeRanges; + activeRanges.append(scopedRanges->at(0)); + + int lastOffset = 0; // lineStartOffset; + for (int i = 1, cnt = scopedRanges->size(); i < cnt; ++i) + { + ScopedTextRange *range = scopedRanges->at(i); + int min = range->min(); // find the minimum position + + // unwind the stack if required + while (activeRanges.size() > 1) + { + ScopedTextRange *activeRange = activeRanges.last(); + int activeRangeMax = activeRange->max(); + + // when the 'min' is behind the end of the textrange on the stack we need + // to pop the stack + if (activeRangeMax <= min) + { + appendFormatRange(formatRangeList, lastOffset, activeRangeMax - 1, + activeRanges); + activeRanges.pop(); + lastOffset = activeRangeMax; + Q_ASSERT(!activeRanges.empty()); + } + else + { + break; + } + } + + // add a new 'range' if a new one is started and there's a 'gap' + if (lastOffset < min) + { + appendFormatRange(formatRangeList, lastOffset, min - 1, activeRanges); + lastOffset = min; + } + + // push the new range to the stack + activeRanges.push_back(range); + } + + // next we must unwind the stack + while (!activeRanges.isEmpty()) + { + ScopedTextRange *activeRange = activeRanges.last(); + int activeRangeMax = activeRange->max(); + if (lastOffset < activeRange->max()) + { + appendFormatRange(formatRangeList, lastOffset, activeRangeMax - 1, + activeRanges); + lastOffset = activeRange->max(); + } + activeRanges.pop(); + } + + return formatRangeList; +} + +/// Sets the active theme name +/// @param themeName +void TextThemeStyler::setThemeByName(const QString &themeName) +{ + // set the theme with the given name + themeName_ = themeName; + themeRef_ = Edbee::instance()->themeManager()->theme(themeName_); + + // when no theme is found, fallback to the fallback theme + if (!themeRef_) + { + qlog_warn() << "Theme not set:" << themeName_; + themeName_ = ""; + themeRef_ = Edbee::instance()->themeManager()->fallbackTheme(); + } +} + +/// returns the current active theme name +/// This method returns "" for the fallback theme +/// It returns a NullString if the theme is specified manually (without the +/// thememanager) +QString TextThemeStyler::themeName() const +{ + return themeName_; +} + +/// Sets the active theme +/// When supplying 0 this theme applies the fallback theme +void TextThemeStyler::setTheme(TextTheme *theme) +{ + themeName_ = QString(); + themeRef_ = theme; + if (!themeRef_) + { + themeName_ = ""; + themeRef_ = Edbee::instance()->themeManager()->fallbackTheme(); + } +} + +/// returns the active theme +TextTheme *TextThemeStyler::theme() const +{ + return themeRef_; +} + +/// This method returns the character format for the given text scope +QTextCharFormat +TextThemeStyler::getTextScopeFormat(QVector<ScopedTextRange *> &activeRanges) +{ + // ScopedTextRange* range = activeRanges.last(); + QTextCharFormat format; + + TextScopeList scopeList(activeRanges); + theme()->fillFormatForTextScopeList(&scopeList, &format); + return format; +} + +/// helper function to create a format range +void TextThemeStyler::appendFormatRange( + QVector<QTextLayout::FormatRange> &rangeList, int start, int end, + QVector<ScopedTextRange *> &activeRanges) +{ + // only append a format if the lexer style is different then default + if (activeRanges.size() > 1) + { + QTextLayout::FormatRange formatRange; + formatRange.start = start; + formatRange.length = end - start + 1; + formatRange.format = getTextScopeFormat(activeRanges); + rangeList.append(formatRange); + } +} + +void TextThemeStyler::textDocumentChanged(edbee::TextDocument *oldDocument, + edbee::TextDocument *newDocument) +{ + Q_UNUSED(newDocument); + Q_UNUSED(oldDocument); +} + +/// invalidates all layouts +void TextThemeStyler::invalidateLayouts() +{ + // formateRangeListCache_.clear(); +} + +void TextThemeStyler::themePointerChanged(const QString &name, + TextTheme *oldTheme, + TextTheme *newTheme) +{ + if (name == themeName_) + { + themeRef_ = newTheme; + } + else + { + if (oldTheme == themeRef_) + { + Q_ASSERT(false + && "The old theme is deleted but it's not the same theme name. " + "This shouldn't happen"); + // If it happens a solution is to set the fallback theme + } + } +} + +//================================================= + +/// Constructs the theme manager +/// And intialises a fallback theme +TextThemeManager::TextThemeManager() + : fallbackTheme_(0) +{ + fallbackTheme_ = new TextTheme(); + fallbackTheme_->setForegroundColor(0xFF000000); + fallbackTheme_->setBackgroundColor(0xFFFFFFFF); +} + +/// destructs the theme maanger +TextThemeManager::~TextThemeManager() +{ + clear(); + delete fallbackTheme_; +} + +/// clears all items +void TextThemeManager::clear() +{ + qDeleteAll(themeMap_); + themeMap_.clear(); + themeNames_.clear(); +} + +/// This method loads all theme names from the given theme path (*.tmTheme +/// files) +/// @param the new themePath. if the themepath is blank, the themes of the +/// current path are reloaded +void TextThemeManager::listAllThemes(const QString &themePath) +{ + if (!themePath.isEmpty()) + { + themePath_ = themePath; + } + if (!themePath_.isEmpty()) + { + clear(); + QDir dir(themePath_); + QFileInfoList fileInfoList + = dir.entryInfoList(QStringList("*.tmTheme"), QDir::Files, QDir::Name); + foreach (QFileInfo fi, fileInfoList) + { + themeNames_.append(fi.baseName()); + } + } +} + +/// Returns the theme name at the given index +/// @param idx the index of the theme to retrieve +QString TextThemeManager::themeName(int idx) +{ + return themeNames_.at(idx); +} + +/// This method loads the given theme file. +/// The theme manager stays owner of the given theme +/// @param filename the filename of the theme to load +/// @param name the name of the theme (if the name isn't given the basenaem of +/// the fileName is used (excluding the .tmTheme extension) +/// @return the loaded theme or 0 if the theme couldn' be loaded +TextTheme *TextThemeManager::readThemeFile(const QString &fileName, + const QString &nameIn) +{ + lastErrorMessage_.clear(); + + // check if the file exists + QFile file(fileName); + if (file.exists() && file.open(QIODevice::ReadOnly)) + { + + // parse the theme + TmThemeParser parser; + TextTheme *theme = parser.readContent(&file); + if (theme) + { + + // when the name if blank extract it from the filename + QString name = nameIn; + if (name.isEmpty()) + { + name = QFileInfo(fileName).completeBaseName(); + } + + setTheme(name, theme); + } + else + { + lastErrorMessage_ = QObject::tr("Error parsing theme %1:%2") + .arg(file.fileName()) + .arg(parser.lastErrorMessage()); + } + file.close(); + return theme; + } + else + { + lastErrorMessage_ + = QObject::tr("Error theme not found %1.").arg(file.fileName()); + return 0; + } +} + +/// This method gets or loads the theme. +/// (The auto loading feature only works if the themepath is supplied) +/// +/// @param the name of the theme to load +/// @return the theme with the given name +TextTheme *TextThemeManager::theme(const QString &name) +{ + if (name.isEmpty()) + { + return 0; + } + TextTheme *theme = themeMap_.value(name); + if (!theme && !themePath_.isEmpty()) + { + QString filename + = QStringLiteral("%1/%2.tmTheme").arg(themePath_).arg(name); + theme = readThemeFile(filename); + if (!theme) + { + qlog_warn() << this->lastErrorMessage(); + + // add the theme to the map + theme = new TextTheme(); + themeMap_.insert(name, theme); + } + } + return theme; +} + +/// this method returns the last error message +QString TextThemeManager::lastErrorMessage() const +{ + return lastErrorMessage_; +} + +void TextThemeManager::setTheme(const QString &name, TextTheme *theme) +{ + TextTheme *oldTheme = themeMap_.value(name); + themeMap_.insert(name, theme); + emit themePointerChanged(name, oldTheme, theme); + delete oldTheme; +} + +} // namespace edbee diff --git a/lib/edbee-lib/edbee/views/texttheme.h b/lib/edbee-lib/edbee/views/texttheme.h new file mode 100644 index 00000000..358aba44 --- /dev/null +++ b/lib/edbee-lib/edbee/views/texttheme.h @@ -0,0 +1,285 @@ +/** + * Copyright 2011-2013 - Reliable Bits Software by Blommers IT. All Rights + * Reserved. Author Rick Blommers + */ + +#pragma once + +#include "edbee/exports.h" + +#include <QCache> +#include <QTextLayout> +#include <QTextCharFormat> + +class QTextFormat; + +namespace edbee +{ + +class MultiLineScopedTextRange; +class ScopedTextRange; +class TextBufferChange; +class TextDocument; +class TextEditorController; +class Edbee; +class TextScopeList; +class TextScopeSelector; + +/// The styles available in tmTheme files +// class TextStyle +//{ +// bool bold_, italic_, underline_; +// QColor foreground_; +// QColor background_; +// }; + +//================================================= + +class EDBEE_EXPORT TextThemeRule +{ +public: + TextThemeRule(const QString &name, const QString &selector, + QColor foreground = QColor(), QColor background = QColor(), + bool bold = false, bool italic = false, bool underline = false); + virtual ~TextThemeRule(); + bool matchesScopeList(const TextScopeList *scopes); + void fillFormat(QTextCharFormat *format); + + QString name() { return name_; } + TextScopeSelector *scopeSelector() { return scopeSelector_; } + QColor foregroundColor() { return foregroundColor_; } + QColor backgroundColor() { return backgroundColor_; } + bool bold() { return bold_; } + bool italic() { return italic_; } + bool underline() { return underline_; } + +private: + QString name_; ///< The human name of the setting + TextScopeSelector *scopeSelector_; ///< The scope selector + // QString comment_; ///< The comment for this theme + + QColor foregroundColor_; ///< The foreground-color + QColor backgroundColor_; ///< The background-color + bool bold_; + bool italic_; + bool underline_; +}; + +//================================================= + +/// This class defines a single theme +class EDBEE_EXPORT TextTheme : public QObject +{ +public: + TextTheme(); + virtual ~TextTheme(); + + const QList<TextThemeRule *> &rules() { return themeRules_; } + void giveThemeRule(TextThemeRule *rule); + + void fillFormatForTextScopeList(const TextScopeList *scopeList, + QTextCharFormat *format); + + QString name() { return name_; } + void setName(const QString &name) { name_ = name; } + QString uuid() { return uuid_; } + void setUuid(const QString &uuid) { uuid_ = uuid; } + + QColor backgroundColor() { return backgroundColor_; } + void setBackgroundColor(const QColor &color) { backgroundColor_ = color; } + QColor caretColor() { return caretColor_; } + void setCaretColor(const QColor &color) { caretColor_ = color; } + QColor foregroundColor() { return foregroundColor_; } + void setForegroundColor(const QColor &color) { foregroundColor_ = color; } + QColor invisiblesColor() { return invisiblesColor_; } + void setInvisiblesColor(const QColor &color) { invisiblesColor_ = color; } + QColor lineHighlightColor() { return lineHighlightColor_; } + void setLineHighlightColor(const QColor &color) + { + lineHighlightColor_ = color; + } + QColor selectionColor() { return selectionColor_; } + void setSelectionColor(const QColor &color) { selectionColor_ = color; } + QColor findHighlightBackgroundColor() + { + return findHighlightBackgroundColor_; + } + void setFindHighlightBackgroundColor(const QColor &color) + { + findHighlightBackgroundColor_ = color; + } + QColor findHighlightForegroundColor() + { + return findHighlightForegroundColor_; + } + void setFindHighlightForegroundColor(const QColor &color) + { + findHighlightForegroundColor_ = color; + } + QColor selectionBorderColor() { return selectionBorderColor_; } + void setSelectionBorderColor(const QColor &color) + { + selectionBorderColor_ = color; + } + QColor activeGuideColor() { return activeGuideColor_; } + void setActiveGuideColor(const QColor &color) { activeGuideColor_ = color; } + + QColor bracketForegroundColor() { return bracketForegroundColor_; } + void setBracketForegroundColor(const QColor &color) + { + bracketForegroundColor_ = color; + } + QString bracketOptions() { return bracketOptions_; } + void setBracketOptions(const QString &str) { bracketOptions_ = str; } + + QColor bracketContentsForegroundColor() + { + return bracketContentsForegroundColor_; + } + void setBracketContentsForegroundColor(const QColor &color) + { + bracketContentsForegroundColor_ = color; + } + QString bracketContentsOptions() { return bracketContentsOptions_; } + void setBracketContentsOptions(const QString &str) + { + bracketContentsOptions_ = str; + } + + QString tagsOptions() { return tagsOptions_; } + void setTagsOptions(const QString &str) { tagsOptions_ = str; } + +private: + QString name_; ///< The name of the theme + QString uuid_; ///< The uuid + + // thTheme settings + QColor backgroundColor_; ///< The default background color + ///< <key>background</key> <string>#272822</string> + QColor caretColor_; ///< The default caret color <key>caret</key> + ///< <string>#F8F8F0</string> + QColor foregroundColor_; ///< The default foreground color + ///< <key>foreground</key> <string>#F8F8F2</string> + QColor invisiblesColor_; ///< The invisible color <key>invisibles</key> + ///< <string>#3B3A32</string> + QColor lineHighlightColor_; ///< The highlight color <key>lineHighlight</key> + ///< <string>#3E3D32</string> + QColor selectionColor_; ///< The selection color <key>selection</key> + ///< <string>#49483E</string> + QColor findHighlightBackgroundColor_; ///< The find-highlight color + ///< <key>findHighlight</key> + ///< <string>#FFE792</string> + QColor findHighlightForegroundColor_; ///< The find-highlight color + ///< <key>findHighlightForeground</key> + ///< <string>#000000</string> + QColor selectionBorderColor_; ///< The selection border color + ///< <key>selectionBorder</key> + ///< <string>#222218</string> + QColor activeGuideColor_; ///< The active guide color <key>activeGuide</key> + ///< <string>#9D550FB0</string> + + QColor bracketForegroundColor_; ///< The bracket foreground color + ///< <key>bracketsForeground</key> + ///< <string>#F8F8F2A5</string> + QString bracketOptions_; ///< The bracket options <key>bracketsOptions</key> + ///< <string>underline</string> + + QColor bracketContentsForegroundColor_; ///< The content foreground color + ///< <key>bracketContentsForeground</key> + ///< <string>#F8F8F2A5</string> + QString bracketContentsOptions_; ///< The bracket options + ///< <key>bracketContentsOptions</key> + ///< <string>underline</string> + + QString tagsOptions_; ///< The tags options <key>tagsOptions</key> + ///< <string>stippled_underline</string> + + // The selectos + QList<TextThemeRule *> themeRules_; ///< the scope selector +}; + +//================================ + +/// This class is used to return the style formats for rendering the texts +class EDBEE_EXPORT TextThemeStyler : public QObject +{ + Q_OBJECT + +public: + TextThemeStyler(TextEditorController *controller); + virtual ~TextThemeStyler(); + + QVector<QTextLayout::FormatRange> getLineFormatRanges(int lineIdx); + + TextEditorController *controller() { return controllerRef_; } + + // void giveTextTheme( TextTheme* theme ); + void setThemeByName(const QString &themeName); + QString themeName() const; + + void setTheme(TextTheme *theme); + TextTheme *theme() const; + +private: + QTextCharFormat getTextScopeFormat(QVector<ScopedTextRange *> &activeRanges); + void appendFormatRange(QVector<QTextLayout::FormatRange> &rangeList, + int start, int end, + QVector<edbee::ScopedTextRange *> &activeRanges); + +private slots: + + void textDocumentChanged(edbee::TextDocument *oldDocument, + edbee::TextDocument *newDocument); + void invalidateLayouts(); + void themePointerChanged(const QString &name, TextTheme *oldTheme, + TextTheme *newTheme); + +private: + TextEditorController *controllerRef_; ///< A reference to the controller + QString themeName_; ///< The name of the active theme (when a 'custom' theme + ///< active) + TextTheme *themeRef_; ///< The active theme +}; + +//================================ + +/// This class is used to manage load 'themes'. +/// This method loads only loads a theme if requested. +/// It will list all available theme when +class EDBEE_EXPORT TextThemeManager : public QObject +{ + Q_OBJECT + +protected: + TextThemeManager(); + virtual ~TextThemeManager(); + +public: + void clear(); + + TextTheme *readThemeFile(const QString &fileName, + const QString &name = QString()); + void listAllThemes(const QString &themePath = QString()); + int themeCount() { return themeNames_.size(); } + QString themeName(int idx); + TextTheme *theme(const QString &name); + TextTheme *fallbackTheme() const { return fallbackTheme_; } + QString lastErrorMessage() const; + void setTheme(const QString &name, TextTheme *theme); + +signals: + void themePointerChanged(const QString &name, TextTheme *oldTheme, + TextTheme *newTheme); + +private: + QString themePath_; ///< The theme path + QStringList themeNames_; ///< All themes + QHash<QString, TextTheme *> themeMap_; ///< A map with all (loaded) themes + TextTheme *fallbackTheme_; ///< The fallback theme (this can be used if no + ///< themes are found) + QString lastErrorMessage_; ///< The last error message + + friend class Edbee; +}; + +} // namespace edbee diff --git a/lib/edbee-lib/images/doc-logo.png b/lib/edbee-lib/images/doc-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..9824b468192c8b4a373d6139e94cb92aee32c539 GIT binary patch literal 8498 zcmV-2A<f>2P)<h;3K|Lk000e1NJLTq005l;003kN1^@s6oVzjy00009a7bBm000XU z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+<Lqi~Na&Km7Y-Iodc-oy)XH-+^7Crag z^g>IBfRsybQWXdwQbLP>6p<z>Aqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uh<iVD~V z<RPMtgQJLw%KPDaqifc@_vX$1wbwr9tn;0-&j-K=43<bUQ8j=JsX`tR;Dg7+#^K~H zK!FM*Z~zbpvt%K2{UZSY_<lS*D<Z%Lz5oGu(+dayz)hRLFdT>f59&ghTmgWD0l;*T zI7<kC6aYYajzXpYKt=(8otP$50H6c_V9R4-;{Z@C0AMG7=F<Rxo%or10RUT+Ar%3j zkpLhQWr#!oXgdI`&sK^>09Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-<?i z0%4j!F2Z@488U%158(66005wo6%pWr^Zj_v4zAA5HjcIqUoGmt2LB>rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_<lS*MWK+n+1cgf z<k(8YLR(?VSAG6x!e78w{cQPuJpA|d;J)G{fihizM+Erb!p!tcr5w+a34~(Y=8s4G zw+sLL9n&JjNn*KJDiq^U5^;`1nvC-@r6P$!k}1U{(*I=Q-z@tBKHoI}uxdU5dyy@u zU1J0GOD7Ombim^G008p4Z^6_k2m^p<gW=D2|L;HjN1!DDfM!XOaR2~bL?kX$%CkSm z2mk;?pn)o|K^yeJ7%adB9Ki+L!3+FgHiSYX#KJ-lLJDMn9CBbOtb#%)hRv`YDqt_v zKpix|QD}yfa1JiQRk#j4a1Z)n2%f<xynzV>LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_Ifq<Ex{*7`05XF7hP+2Hl!3BQJ=6@fL%FCo z8iYoo3(#bAF`ADSpqtQgv>H8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ<AYmRsNLWl*PS{AOARHt#5!wki2?K;t z!Y3k=s7tgax)J%r7-BLphge7~Bi0g+6E6^Zh(p9TBoc{3GAFr^0!gu?RMHaCM$&Fl zBk3%un>0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 z<uv66WtcKSRim0x-Ke2d5jBrmLam{;Qm;{ms1r1GnmNsb7D-E`t)i9F8fX`2_i3-_ zbh;7Ul^#x)&{xvS=|||7=mYe33=M`AgU5(xC>fg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vF<Q0r40Q)j6=sE4X&sBct1q<&fbi3VB2Ov6t@q*0);U*o*SAPZv|vv@2aYYnT0 zb%8a+Cb7-ge0D0knEf5Qi#@8Tp*ce{N;6lpQuCB%KL_KOarm5cP6_8Ir<e17iry6O zDdH&`rZh~sF=bq9s+O0QSgS~@QL9Jmy*94xr=6y~MY~!1fet~(N+(<=M`w@D1)b+p z*;C!83a1uLJv#NSE~;y#8=<>IcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a<fJbF^|4I#xQ~n$Dc= zKYhjYmgz5NSkDm8*fZm{6U!;YX`NG>(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-k<Mujg;0Lz*3buG=3$G&ehepthlN*$KaOySSQ^nWmo<0M+(UEUMEXRQ zMBbZcF;6+KElM>iKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BK<z=<L*0kfKU@CX*zeqbYQT4(^U>T#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot<a{81DF0~rvGr5Xr~8u`lav1h z1DNytV>2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z000(UNkl<Zc-ripd3==BxyQe=Pxgg`KoTHOc0v>d*%T!#vI&YCiq#Ktz4a<pTbDx7 zf>lrp<!WgaDNuW5tu1O5ON$_2v9uLI1!{tVk+38oA(N0~CYhOY|2QX;$z+nuOol*` z_xJg{pG@X`=Uu<=Ip=xK^PHm-LZC@gYf7)(0!<opnl$J%Y0{w6q(P@ilLnn84LVJl z8b}Bc(sCJSA#fHb2Q~rSF7sQR2)qfL2MU4b08>X~sjWgc4-h`fJD2%0dDG81|5$^r z?LfE9&jY*wbiYiWM;uV%=bZlm7&;nsZM98T<LA3dpz1O_S2J)M5bI}MHQ?3^iMF9X zHUi@1)UMM3_W)l5i-0|Tw%MpkJk5}3BZkBr;NQSuU>UGQJ-}Ci_)C0lS-{8YeAWO- z%4k>$d<h%?9_*+rwPol4jH>$b2C)kG4w!I>&go%Q>J|Xg{H!;r^G1WNZ9?Zy{Z;8F zfTvsWxKY6G)Nwy)11=m5x-csN_&@=$4zRSs@ph==Z3bfKfa>Vb)mCGh6$l%As^M@d z9{5llXA|wr;j2Lxykdb}3Wzr^!u}1)k{0SXv2<W*(A6m&_)3BCT$uO$g4*vfAcGDr z4Z8Ze7U_r;!1OTfbE?{(8yJr!4LUzstRTq+y0ma#NnWMrG7UEky2ca%{8NGQdJFfp zLha`(1)wGkx<)mLy3Y2|A@1W!qyt(2_iLzW&;_FH3YhI7{(hbM{XtcFYSN$!s<ay$ zLMdlgzkNW%OoJ{^8G-%OIdg;2O7**Mk-ZR_H0T1>4;4HWK<^+d)-&pND>TGHhpwY0 z=KL9%TM>y2una^~y<9EZG{jng&URMPc^ed;5Ln3gpS|29ngOAebRp?)>hD#^aHyu# z#mmLAgUd54zD+f%JEHWeeFie@=~uuhAcgwj<2q!zV4_+8PHNb+OuA63N}W#E)~>Y& za3hcnj8K4C6j;HiT7mcvWZuJvK#qnI0XMtaJ9N>&3}7~Jo%$aDgTa7Kr^D%VVm6yu zym&F`>FFdTC1EhgCSGZ2DMdv^ELpOIGiT0VFc>fzjW`?*UkLXAzX#q2Y#MYO(~yV( z9s`c!m1nBc=|ommmU!lwXT-sS2gSU3^8_FwA|ga?Zm#gBva&Lfl9D0-F>~fjaqQSJ zv3m7tF=fgW5g8fjo5y-W9rt3y)tQjK!DOHlV7*B9&Z_pGtd3_22D*;wr@NK92oM1X zqtPg4&YUT>Z{IFzYHB<{tzEm;v(1JL8~j4Ickf=I*Xso!7A{;^Z(UAKj+j4xzUb1W zi!Xd%19yi|b^B|3jsw;zD?1mNbaWgUys#BH+Cirl9w$=O27f|k*nOjplZ(u1`#<Gc zvRv-a#i<irhK$<X1iS(KT(zyD!VFt7b$O(oB|AG??BBoNFHk#o?(}T8c=2Mt+pJ!_ z+Oy57Rjd4NbN1|6v2fu+5gi@v3*TFW9!8Z3>{Kt%a$quY1cL;%&ylKB{hMl2K0#=s z1x!aKGVKQzAY%_x)N#5i=${Avg-o5CemO!Hi_Gslrryp~z*E4Zz%$4^(0>E}0e%*y zs%S89#QT9KCnt+FYt{&t%Ox7qi4!M0Rpjj1v;A(fV8H^<KDTe*E}GKe!-vJhi4*;m zdc%Xfp4rM+d0v%5&1tAAkv>93N(ZWC%4(k-V5xhXx}MkYlXG&Zpc|=R`ir{Jja4rO z^+vs`V99O)a5qrbJtY7!a^y&nlanKwlXrV<)TmLy>2x;O=AL`*5rD8*EaHnVzG!xz zZns-J_uO;BXf%3*cb>qbi|<v}Gd_f>_?PPb_Y7eB-vFN}t3DWYQohP}ecOAN0=g;4 z1mk%@Uc_DMZJQeca9QfNo(FvU?YE24(ozwK>~_1z%*+&k=-$1%xNzY@gKZ{Em>>WV z6B8rOo;@o9)%x}8h1qQO2CoDd)y(ybRKQ)=f|qcasw$gme?6jJ_Rb+5!-7miT74;@ z8v>kG?uk$|T;1$jgM8yY_Xh5cJMIwG)zu;xjT<*k03tRvRumN#)m!IqI7C)fmH<RT zLPEeWdxK{(nY_WvX`=em1AkY|ke2EL8V^e7kBpMJriI7ostk=8mjXJoa+E&a!i$)q zET&!oZokSKxZ%Txi;|KO5v-<6nIZsTwOYlIBS-43D=#k>si~;~5CaDe6jfDKLGS<N zmtXd6<85r@dL9CHhsmfKpxRyo{j7US^}vKfv(&RUwl;K6QP+>zQvF8Vl;$)VaMeD@ z*w|Qc;J^V9itfMvegO!*UN83U-CJ*6X=$m5i;EM0$jr<XcDp^KW88AfExzDQ^0^+P zG6ZIZ(VAbS?x(kUD{D9-Ovf-N$M~#ZplfM|e~fDQz7(d5cviUzhBmX^qj(K-_T-aK za@AE=h2{v;%iXx$ZYnA&>aDZcY&f0H;JodAv}DN=;^N}Gzw&MOUZtF}+rtRmTJ>^9 z`S>vZt*X~>$fXR5o4tE`0<m~nS|y%T{-kiIP?`PrHnB}l<+B1HEiH`)9}IoeEpM1= z0rLl4VqzjDQ)nYb3>Ywg`|i8X`>S!(k8GI+96}E47%qK|9G&zUpSJU!F#AW}RR-O# z)_~5a9{%6Md=VSfjcTl$XT0}YHEr57l9Ixc1z1>ESnq%D{^gjM7*DAfQsZaVEKi@V zy0&pXZLrV6d>^Y-RXWDYf7<sVKz9n+-#oN6pc@4A1NMgbBEC>i^=#s}9!;D$F>D8R zyBi;gwYa#rK}i^lh71`(zkdCEE&ke<x3jVYQNGP^EGUmas`{L$zAp;naX=<2ol!ss zTv~;y9?ETTB+Ss2Da&iHa&-DTu5=bzEWQu2MQSQ?ro6lyr_+hi7}_nfTCHSdWpVWA z(b})ly<YqT<hUrsgl|Y*r)nSXQvb&xy9&3eQZQU$LT**H{<Srr>#W=*KR`y(hT~=l z)i~{={6PK`9qP_qE*E;ez8+kGhG_ZzuC@&r4203q^-f*q_16i!tzO`84K=3o@(p^L zsmN}~sxZQ>Q<m~KtpS~0d8UVi`OVR(Ms;ItoC~4s^uU1wJpTCO^zGZ16)RSF0PwC- zo2p)YwQ18PR;*aT?Afz<?6JoJYy6x#<@<sGIFtc(44H><v2<G9+rI(lxP)p6bY<$z z`EQ`K70)@Z_JhOWAU8LcL4yW0`=i%if1TsUkCTy+!I?8>=+mc91LGkwvVPyX$z<{v z4@E^qR99DHu~@L%?JQlo6tme(VPPRPH8sszww0BY<mA)~FwXb+JQV+<#)nHb1@|?` z9*avReG4DHgTV7f!=-v{$d5n%IG`Wp=jU_NO*iqz8*g}k^L3N>TEQtPDVWVNn8I$i zdrCsP-A-|FF^@d*2uqhP4ak*p=+GhZ^76dD`qJz39%Kmp#Y~i{R>z#eC00u=^02BB z#<ub~f9PGsZr!?-l9G~Uf0US*=(qZ;si|r7HwJ?NtJUg(v#hMlQvxO?CI;m~*|>2d zE|&|hDs`9F>i3kDIr1XkyUpr(#kN)G%8?%Q$*p|OCy=32vbfF5W9{0t&HkuYuU-w{ zbT}Lo6cl(s>eQ)z0Iu0=COJ9T16^sUY(+#xMbV>24~mP613KZ{+*~$n*x>u(c$ajg zsy+AkMZR|*DVNEdwhA4{@aC?xEFLZty@J>DM$4Bk_jX12)v#g1C@n2*)YoP(7<{cu zEEWqXDJimUs;=hz`SYH2g9i`h<jKIY5f?35<N;Rc*M2tp1=0r@j_Pj|jSpkC1Q~H0 zj(ODX0VcLKbmx&nXN7CNhTa4gRJafLZS6mWg@ruy&_mem_C|kj?X}l3aNxjtnOs5$ zPnGKpn76uj@9x>wyQG{nX;Ood(VteYUd`sso4vnUkN-Z_LS$t1uYvEi;2uT-FDt*C zKkZP4#5!6w8D1u`&%Hc&$5_jwOiakI^o1=1&Wen*2y|?b2Jv*WXU`T6hojMGkD8hq z;dZ<0MUf;VBnUwC=+VP(5a+YcKI_^4nl)?cMF=++yZ6Bd9|)_}8fZM7cZqihNDJW} znp8FYP5|5OM0Pob;up+7I_{qeg{5!>ab_yB|MnI@_d3BxSqxTIbim*>7P>Ti`0#p} zVzt_|X_IH)FTC(Vz~M~qz4x96XzC(|1I?BAU)6TKA;?<dV`R@jTmaiAD)9CYT&UA{ zb#A{1wEzoexcZH%k@~|R!Lc9{mA@pk@aZdj!J9mJvN(PEbWqUEm@&ieHb;*h^^{ig z=g$uaxRonc`i80(Q@?{h5Z$M)>rLgu^VbwIs29E#(iaJCk`{}qB2TKeUXLbfp|Q%3 z_%-nTmeiWzPRtpm;CYwk2c<C}<FGzgE`yfjZVvLTYJ2wVDc*kj?SP?s_~D2BZc|xV zDSG$rEdVih?%XE#m!F?6X3d)A8?gBmas<y%l!{D0%t1!z{$3eTuc*)a)VkM@!55+G zYGjJ&F=bh=Q6R5G&MtXSEzeLlrpsjm9ja(wuHJ}ufgd4fBpjlum%EVh`~O4+6n;NU zPSHeVT)6Sd=)e2!yBma|`-ASq7hh}?rhD(bR{-MXn{W2J-e$9j6)RSFGRvqRnw}hn zYl~Ag$$T&9=Bv^(ob!;S19u>&KUk@r(>ztuHd}&T4$0PCkqN+mQ0;~T$b{Vw)J>br z#hI^bmU6y&9=_FT6?5jy5ubkgX@eBR&Ye38Ky2BvrBUc!d+jv=h%sZv)H6hiii*UF z6)QwWMusnJM+h#-s9orC8&<-E44aN1e1QS}G|+6eeE86h=Zj^pt`h^ZuB-=x$z&4Q z+1X;%s#PK<Cr6Z*mx}=d1_+?ZoYuU&JYlg|MF0N%MP6Q>*tTt(m^*i_NJ>ifSCu|W z3nF1U0(7l4K3$DkE~aL7Nljm~>^JKYrrtb(XuxE)u>6_X3?CN3hr1ov%4*oPYZtqA z?ZRTQ(yw1%zWeSwOePci_U)sfpn&-Jcp@Vsak*TaJ9iG7&Bn=-Cy9@bBRBULSy@A{ z+3NgtG0{3|oH*@v@qlU<InZ>`{dAXuX7?X7*s<qOt|$>goV*~!X}b{Pr`{zN%{K`l zdW*ax-Nf%+O%`|E79}DhbiO5&XE7K|!ep`tqtW7bz0rv1-^U>CyDM7!epRyg;*)gI zHO259;UAl&-Lljk#-|&X(X03So44(-_UWI&g>o<$pv+dm)ax?YxVnN7V`8CNfK>-I zg2M+LZ2DsbJNHy^<Uci3+1=Fj#VgZV4;Bk#^e{50znP&!tn}?|B6Fab^sYv%aXPT- z`PbemMrWVe>vS;|udca{3SA&->%+hHjE#%`?JH~6dw>Jb>!I{~DfY?|Qj(&f!VN~9 zj7c`@$Q%*Dk`WO+U+$)`z{NMmYdCLnqt}BFveDVOvw_qu1`^^7SfX|4B6X^fAixD~ zyFhOie6r7u(?u4t|M^3$?ri_iz4XM>Kkqqa>~PAwdI0qXC@(Leq{P9PDdl8zw~(G{ zBt6X_|E3!0mTn-etC6HmdPZGm1*^Wki6evrtVWh!!sf>9^&;!_K&6{qA6IhQJ@ewf z{A~AIIY$rAL`HIGYO0oO!`17gp(95BW$TW;==J(~)uY7%UmiNl)G<S;cKC1C8x1<5 zqID!E8c0hukd|tsTbdV`X-2xF7>JM46Jgb1u<F31lVG}}XEFa9JHxYWytDf&3eKG7 z&MDd7R#se?sGO`?_1X?gy8n4#-eW{X>pj(K-5UXJx2Qi(x{sVLfz2kc+1z}6qM>1J zGD38;p5!D6Wj9qqrl%W8Pc<;0pP4OxDkiDx)pSnjO8-7-{ABTxj73jA`YT#L#!$0f zTS5K4*Qa0AvEnL`Um-+ZS^ed-U5I}i%@dJPQH@%uEnO^TX#xLa@e86v2$5eQmutt4 z@352AwfD(O##}%CMr&fC6@Lj_!VU2W@kB&kJTHc$T40TcVDj{vsjdc>3oKT6;_1cc z_4=oPc&$kDueJ(Z=D@5h^s2qz@QnkrC6e@RJud1=jGHu#{+a!$u9pAXt6=!((Ttrq zxi@g9hFAN7F1kzC?l@ikSGwI08D*qbpS~CMB<`Lw7o)Kbe79Q~G1G6m6XZC)dJVDm zV@Qaqstf4!jkPTx!VJCo4kk4PZkZlS-bp8?&p0VM=jOc4MMZ_6B~8;CCQRan@i$WC zGtQFT4%d#INJ6KiYt9#+>kk~&Fl!&s6?~nOgRu#(O|=WIym|!h#h7{N`FNtDja1m& zl-k^!D{*nQz(xLP7pG1+IeFSi{wXJC3S68!=cd%=qOwvnW&HBMyvMLup~7dp0hbFp zr=&1&@D-MQyLXP(pld(S?fC0^Z!dW8M?cnC%x3(hu2xsW)z=KA!ja0(k8Di8HIb+& z9Z|7H(z+YD!T{)X(iU|J+|`1LN+F>vc5$}AN&aaU`KMf*JS9uXvjr|bKU~dCx8BLP zNjFki;lGrPih_OvGugL$XFm<G_5<DSLkIq~?bYSWr!DyTPtob2rrOJ>P(#Ob>l#J& z<U3iv=_RJmOu+31;qorO<Y%2uE-}%1Vq*1l%P@k$s`ewhy|Cz5^wYB(%Zug7XP!l; zYut!2>L5No0m3)Ts%A)BCVF_;a|;j6f8+^@3QDn9AU;MeQIX(u3O+ylEfwX3yuTfC z|5J@VPLIK)!(h;1(943Z78JJ|TrPpDM&PmwTorCy7u>ij1Xy(J`RfH<{AC4;UU-Sj zEBetywxbu$0VT+2C0!fRcfiEeD}VX)+gmo=JL>xE`0w?RwOMg-5nmoW;5hR6X9pb) z$9iDWv(J}KTlhpgu`zn$;`BsC=+Ikr7>ufG%MG|xsphVAbb>xg&o_r1-0}Sarq6ni zIX}3cii+lebIX3Y3mRe#)n2CFOhG0Eby1aT2{KXV1QMfbfZb*@5pl5wk~`^1?P?@V z1p#zRGtw>9NNQID$w{ieHByH@O3(45)l9kdB%Qj=VB<SmFq<tjG5iTS9hlAVUw7Tf z`&<9;3No9%Lr9zNwV~!CN4soP7K@JfIN9Htu7Ut|>?$Y!Oavc&`cJO7axkT360F8# zGQqi`bBr50n4-e7bC8qpY0&v@*be7=ZA|M3u8-A?oLuk8A;U(9PmY`r=T&5~Z+~y? zViQ9A^!Z;1WG-nk9Y`H{zSrgqr=KAQXKoI-{nVdi<l)q`ZjRSCY!wAHLKF)jPE|?( zPhJq>RFx3rLWp;F?H6(J2?9BdB^q=ZbhWw)coiA<CRBs}JTjqp9Wn{rpOH0Ir_+5k zVd@O=ySLsKhx2VBuS`OB<aC*MY2_NxDY>&i4w7Tkpwpo9rx`#6at^Hs0vk-GcB=L- zI;V7Xj=FxFxGsC5=-j2NK#uFXfM#ZZ?UBtycVrXsWOdn$`J7@3gchzvvy&-E=b zp}d3+s*aMF6OJ}s?JyL<s)o8TJ~Rb+(>t=<s!G%nq&4VTO@#_LorZ!2U2CaCEiMfO z4Z7A+xpJFm&}q=MnktpmY1B~ApldBvAjjPm8Vao^T|090YSKzNO`0_5G-=Rj(xB6% gNrO&Pd)5CB0PR!02^g#2LI3~&07*qoM6N<$f+J~lLjV8( literal 0 HcmV?d00001 diff --git a/lib/edbee-lib/vendor/onig/.editorconfig b/lib/edbee-lib/vendor/onig/.editorconfig new file mode 100644 index 00000000..abeeae28 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/.editorconfig @@ -0,0 +1,42 @@ +; see: http://editorconfig.org/ + +root = true + +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[**.[ch]] +indent_style = tab +indent_size = 2 +tab_width = 8 + +[st.[ch]] +indent_style = tab +indent_size = 4 +tab_width = 8 + +[**.py] +indent_style = space +indent_size = 4 + +[**.rb] +indent_style = space +indent_size = 2 + +[**.yml] +indent_style = space +indent_size = 2 + +[HISTORY] +indent_style = space + +[doc/*] +indent_style = space + +[win32/*] +end_of_line = crlf + +[win32/*.py] +end_of_line = lf diff --git a/lib/edbee-lib/vendor/onig/.gitignore b/lib/edbee-lib/vendor/onig/.gitignore new file mode 100644 index 00000000..085b4a14 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/.gitignore @@ -0,0 +1,75 @@ +# ignore dot-files, binary files and backup files +.* +*.o +*.lo +*.so +*.a +*.la +*.obj +*.def +*.dll +*.exe +*.exp +*.lib +*.pdb +*.pyc +*.bak +*.BAK +*~ +*.swp +*.orig +*.rej +*.RES +*.res + +# gcov files +*.gcda +*.gcno +*.gcov + +# don't want to ignore +!.gitignore +!.editorconfig +!.travis.yml + +# working dirs +.deps +.libs +/build*/ + +# autotools generated files +/autom4te.cache +/config.h +/config.log +/config.status +/libtool +/onigmo-config +/onigmo.pc +/Makefile +/sample/Makefile +/stamp-h1 + +# generated executable files +/enc/mktable +/sample/crnl +/sample/encode +/sample/listcap +/sample/names +/sample/posix +/sample/scan +/sample/simple +/sample/sql +/sample/syntax +/testc +/testcu +/testp + +# tag files +tags +TAGS + +# GNU global files +GPATH +GRTAGS +GSYMS +GTAGS diff --git a/lib/edbee-lib/vendor/onig/.travis.yml b/lib/edbee-lib/vendor/onig/.travis.yml new file mode 100644 index 00000000..601962ad --- /dev/null +++ b/lib/edbee-lib/vendor/onig/.travis.yml @@ -0,0 +1,33 @@ +language: c + +branches: + except: + - ruby-2.x + +compiler: + - gcc + - clang + +env: + - CFLAGS=--coverage CONFOPT= + +sudo: false + +addons: + apt: + packages: + - lcov + #- python3 + +before_install: + - gem install lcoveralls + +before_script: + - ./configure $CONFOPT && make + +script: + - make test + +after_success: + - lcov -c -d .libs -o coverage.info + - lcoveralls --retry-count 5 coverage.info diff --git a/lib/edbee-lib/vendor/onig/AUTHORS b/lib/edbee-lib/vendor/onig/AUTHORS new file mode 100644 index 00000000..c6a707a3 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/AUTHORS @@ -0,0 +1,2 @@ +kentkt AT csc DOT jp (K.Takata) +sndgk393 AT ybb DOT ne DOT jp (K.Kosako) diff --git a/lib/edbee-lib/vendor/onig/CMakeLists.txt b/lib/edbee-lib/vendor/onig/CMakeLists.txt new file mode 100644 index 00000000..866508fc --- /dev/null +++ b/lib/edbee-lib/vendor/onig/CMakeLists.txt @@ -0,0 +1,86 @@ +IF(NOT WIN32) + EXECUTE_PROCESS( + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/configure + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) +ENDIF(NOT WIN32) + +SET(ONIG_INCLUDE_DIRS + ${CMAKE_CURRENT_SOURCE_DIR}/ + ${CMAKE_CURRENT_SOURCE_DIR}/enc/unicode + PARENT_SCOPE +) + +SET(ONIG_SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/regcomp.c + ${CMAKE_CURRENT_SOURCE_DIR}/regenc.c + ${CMAKE_CURRENT_SOURCE_DIR}/regerror.c + ${CMAKE_CURRENT_SOURCE_DIR}/regexec.c + ${CMAKE_CURRENT_SOURCE_DIR}/regext.c + ${CMAKE_CURRENT_SOURCE_DIR}/reggnu.c + ${CMAKE_CURRENT_SOURCE_DIR}/regparse.c + ${CMAKE_CURRENT_SOURCE_DIR}/regposerr.c + ${CMAKE_CURRENT_SOURCE_DIR}/regposix.c + ${CMAKE_CURRENT_SOURCE_DIR}/regsyntax.c + ${CMAKE_CURRENT_SOURCE_DIR}/regtrav.c + ${CMAKE_CURRENT_SOURCE_DIR}/regversion.c + ${CMAKE_CURRENT_SOURCE_DIR}/st.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/ascii.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/big5.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/cp949.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/emacs_mule.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/euc_jp.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/euc_kr.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/euc_tw.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/gb18030.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/gbk.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/iso_8859.h + ${CMAKE_CURRENT_SOURCE_DIR}/enc/iso_8859_1.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/iso_8859_10.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/iso_8859_11.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/iso_8859_13.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/iso_8859_14.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/iso_8859_15.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/iso_8859_16.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/iso_8859_2.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/iso_8859_3.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/iso_8859_4.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/iso_8859_5.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/iso_8859_6.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/iso_8859_7.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/iso_8859_8.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/iso_8859_9.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/koi8_r.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/koi8_u.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/shift_jis.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/unicode.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/us_ascii.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/utf_16be.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/utf_16le.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/utf_32be.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/utf_32le.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/utf_8.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/windows_1250.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/windows_1251.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/windows_1252.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/windows_1253.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/windows_1254.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/windows_1257.c + ${CMAKE_CURRENT_SOURCE_DIR}/enc/windows_31j.c + PARENT_SCOPE +) + +SET(ONIG_HEADERS + ${CMAKE_CURRENT_SOURCE_DIR}/config.h + ${CMAKE_CURRENT_SOURCE_DIR}/enc/unicode/casefold.h + ${CMAKE_CURRENT_SOURCE_DIR}/onigmo.h + ${CMAKE_CURRENT_SOURCE_DIR}/onigmognu.h + ${CMAKE_CURRENT_SOURCE_DIR}/onigmoposix.h + ${CMAKE_CURRENT_SOURCE_DIR}/regenc.h + ${CMAKE_CURRENT_SOURCE_DIR}/regint.h + ${CMAKE_CURRENT_SOURCE_DIR}/regparse.h + ${CMAKE_CURRENT_SOURCE_DIR}/st.h + ${CMAKE_CURRENT_SOURCE_DIR}/win32/config.h + ${CMAKE_CURRENT_SOURCE_DIR}/config-onig-edbee.h + PARENT_SCOPE +) diff --git a/lib/edbee-lib/vendor/onig/COPYING b/lib/edbee-lib/vendor/onig/COPYING new file mode 100644 index 00000000..de0e7908 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/COPYING @@ -0,0 +1,87 @@ +Onigmo (Oniguruma-mod) LICENSE +------------------------------ + +/*- + * Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011-2014 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + + +Oniguruma LICENSE +----------------- + +/*- + * Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + + +Ruby BSDL +--------- +Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/lib/edbee-lib/vendor/onig/HISTORY b/lib/edbee-lib/vendor/onig/HISTORY new file mode 100644 index 00000000..ecec4b9c --- /dev/null +++ b/lib/edbee-lib/vendor/onig/HISTORY @@ -0,0 +1,2673 @@ +History of Onigmo (Oniguruma-mod) + +2017/05/15: Version 6.1.2 + +2017/05/15: [dist] Update LTVERSION to "6:3:0". +2017/05/01: [bug] Import Ruby r58468 + Fix macro expansion bug. +2017/04/05: [doc] Improve document about absence operator (Issue #87) +2017/04/03: [impl] Import the latest enc-unicode.rb from Ruby r58070. + (Includes Ruby r58065, r58066, r58069 and r58070.) +2017/03/14: [bug] Import Ruby r57816 + Fix UTF-32 valid_encoding?. +2017/02/20: [bug] Import Ruby r57660 + Initialize return values. + https://bugs.ruby-lang.org/issues/13234 + https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-6181 +2017/01/31: [API] Fix missing const on onig_new_without_alloc. (Issue #85) + +2017/01/29: Version 6.1.1 + +2017/01/29: [dist] Update LTVERSION to "6:2:0". +2017/01/29: [bug] Fix that (?~\S+) might cause infinite loop. + Reported at: http://sakura.qp.land.to/?BugReport%2F211 + +2017/01/16: Version 6.1.0 + +2017/01/16: [dist] Update LTVERSION to "6:1:0". +2016/12/26: [impl] Import Ruby r57143, r57175, r57134, r57138 and r57190. +2016/12/23: [new] (special thanks to Tanaka Akira) + Support absent operator (Issue #82) +2016/12/22: [bug] (thanks iology) + mac: Fix loading library (PR #84) +2016/12/14: [impl] Don't parse (?@...) if USE_CAPTURE_HISTORY is not defined +2016/12/13: [bug] Fix out-of-bounds read in set_bm_skip() (Issue #81) +2016/12/12: [bug] Fix backward search with .* (Issue #69) +2016/12/12: [dist] (thanks Masahiro Ide) + Ignore /sample/scan (PR #80) +2016/12/11: [impl] (thanks NARUSE, Yui) + suppress warning: sign compare (PR #79) +2016/12/11: [bug] (thanks NARUSE, Yui) + CRuby enc/*.c needs other way to detect (PR #78) + +2016/12/10: Version 6.0.0 + +2016/12/08: [bug] (thanks Masahiro Ide) + Define PRIdPTRDIFF at regint.h if not defined yet (PR #77) +2016/12/07: [impl] Better fix for wrong capture in recursive call. (Issue #48) +2016/12/06: [impl] Import Ruby r56991 and r56992 + Import the latest st.c. +2016/12/04: [impl] Import Ruby r56976 + Remove special processing for U+03B9/U+03BC/U+A64B. +2016/12/04: [impl] Import Ruby r56975 + Reorder codepoints in some entries of CaseUnfold_11_Table. +2016/12/04: [bug] Fix wrong capture in recursive call. (Issue #48) +2016/12/01: [spec] \X matches \x0D\x0A also on non-Unicode encodings. +2016/12/01: [impl] Import Ruby r56952 + Use offsetof macro and shrink table size. +2016/12/01: [impl] Import Ruby r56951 + Constify CaseMappingSpecials. +2016/12/01: [new] Import Ruby r56949 + Regexp supports Unicode 9.0.0's \X. (Issue #46) +2016/12/01: [bug] Import Ruby r56924 + Fix uppercasing for U+A64B. +2016/11/30: [bug] Partial fix for wrong capture in recursive call. (Issue #48) +2016/11/28: [impl] Import the latest version of st.c from Ruby. (Issue #70) + Import Ruby r56793 with some modifications. +2016/11/28: [API] Add onig_{get,set}_parse_depth_limit(). +2016/11/28: [bug] Fix stack overflow when parsing deeply nested capture + groups. (Issue #68) +2016/11/26: [bug] Fix multiple name groups in Perl syntax. (Issue #74) +2016/11/18: [impl] Enable multiprocess build on VC2010+. +2016/11/17: [bug] Fix wrong optimization for gpos. (Issue #53) +2016/11/15: [impl] Drop support for old compilers which don't have string.h. +2016/11/15: [impl] Add ONIG_DEBUG_MEMLEAK for MSVC. +2016/11/14: [API] Add onig_initialize() for compatibility to Oniguruma 6.0. +2016/11/11: [doc] Clarify the behavior of multiple defined names. +2016/11/11: [API] Add onig_scan(). + Imported from oniguruma. +2016/11/09: [impl] Disable OP_PUSH_OR_JUMP_EXACT1. +2016/11/07: [API] Remove onigenc_set_default_caseconv_table(). +2016/11/07: [impl] Remove all THREAD_* macros. + Imported from oniguruma. +2016/11/07: [impl] Remove USE_RECOMPILE_API and state member of regex. + Imported from oniguruma. +2016/11/04: [spec] Drop support for very old compilers (Issue #72) + ANSI C89 is required now. +2016/11/03: [dist] Add lcov and lcov-clear targets to Makefile. +2016/11/03: [bug] Restore option when fetch_token fails. + Found by Coverity Scan. +2016/11/03: [bug] Check return value of add_code_range0() + Found by Coverity Scan. +2016/11/03: [spec] Check redundant double repeat with number. E.g.: /.{1,}{1,}/ + Hint by Coverity Scan. +2016/11/02: [impl] Support ONIG_DEBUG_STATISTICS on Win32. +2016/11/02: [bug] Fix illegal memory access with (?(700000)) (Issue #65) +2016/11/01: [bug] Fix that warnings are not shown properly on UTF-16/32. +2016/10/31: [bug] Fix out of memory /'\/g\\\xff\xff\xff\xff&))/. + Imported from oniguruma. +2016/10/29: [bug] Fix use after free for regexp /()(?\!(?'a')\1)/. + Imported from oniguruma. +2016/10/26: [new] Support \uHHHH in Ruby syntax. +2016/10/26: [new] Support \o{OOO} in Perl syntax. +2016/10/24: [test] Add minimal tests for backward search and onig_match() + (Issue #26) +2016/10/22: [bug] Fix infinite loop of backreference and group (Issue #65) + Imported from oniguruma. +2016/10/21: [impl] Import Ruby r56433 + Implement non-ASCII case conversion for Windows-1254. +2016/10/20: [API] Add const. +2016/10/19: [impl] (thanks ksss) + Suppress warnings [-Wpointer-sign] (PR #64) +2016/10/18: [bug] Fix ignore case in look-behind (Issue #18) + Imported from oniguruma. +2016/10/15: [dist] Win32: Rewrite makefiles + * Use separate build directories for x86/x64. (Issue #67) + * Add "test", "utest" and "pytest" targets. + * Change include directory. +2016/10/15: [spec] Support XPosixPunct (Issue #42) + Behavior of /[[:punct:]]/ in Unicode is changed now. +2016/10/11: [bug] Import Ruby r55562 + Don't optimize out group 0. +2016/10/10: [dist] Update LTVERSION to "6:0:0". +2016/10/10: [API] Rename oniguruma and onig to onigmo. (Issue #66) + E.g.: + * oniguruma.h -> onigmo.h + * libonig.{a,so} -> libonigmo.{a,so} + * onig.dll -> onigmo.dll + Now Onigmo will not conflict with Oniguruma. +2016/10/08: [impl] Merge ruby-2.x branch. + Now the source codes of Onigmo library and its embedded + version in Ruby are merged. Ruby specific parts are + surrounded by "#ifdef RUBY ... #endif". + Note that Ruby specific version of onig_compile() is now + renamed to onig_compile_ruby(). +2016/10/08: [impl] Import the latest files from Ruby r55740. +2016/10/08: [impl] Import Ruby r51710 + Constify property_name_to_ctype arguments. +2016/10/08: [new] Import the latest enc/* files from Ruby r56090. This + includes the following: + * Update to Unicode 9.0.0. + * Support case mapping. (by Martin Dürst) +2016/10/07: [impl] Import Ruby r56333 + Make the shown address look relative. +2016/10/06: [impl] Import Ruby r53610 +2016/10/06: [impl] Import Ruby r55155 +2016/10/06: [impl] Import Ruby r55203 +2016/10/06: [bug] Import Ruby r56332 + Fix showing opcode. +2016/10/06: [bug] Import Ruby r53543 + Fix UNALIGNED_WORD_ACCESS. +2016/10/06: [bug] Import Ruby r55163 + Raise error if given octal escaped character is too big. +2016/10/06: [bug] Import Ruby r54954 + Fix memory leak. +2016/10/06: [bug] Import Ruby r55157 + Fix debug conditionals. +2016/10/06: [bug] Import Ruby r55154 + Return error code immediately if compile_length_tree raised + error. +2016/10/06: [impl] Import Ruby r55202 + Make compilers optimize harder. +2016/10/06: [impl] Import Ruby r54741 + Constify oplabels. +2016/10/06: [bug] Import Ruby r53248, r53251 + Fix build with token threaded VM. +2016/10/06: [bug] Import Ruby r52999 + Get rid of breaking strict aliasing. +2016/10/06: [impl] Import Ruby r52757 + Remove trailing spaces. +2016/10/03: [dist] Update config.guess and config.sub. (PR #57, Issue #61) +2016/10/03: [impl] (thanks Kouhei Sutou) + Support --enable-mutlithread for MinGW build. (PR #54) +2016/10/03: [tune] (thanks KeenS) + Implement Token Threaded VM. (Issue #51, PR #52) +2015/09/13: [impl] (thanks Kouhei Sutou) + Add "const" to not changed strings. (PR #50) +2015/09/13: [impl] (thanks Kouhei Sutou) + Remove needless prototype declaration. (PR #49) +2015/09/13: [dist] (thanks Sebastian Godelet) + Add build_nmake script for building with nmake. (PR #47) +2015/09/13: [dist] (thanks Kazuho Oku) + Fix build error on systems using BSD make. (PR #55) +2015/05/11: [impl] Import Ruby r50392 + Reject values larger than UTF-8 max codepoints. +2015/05/11: [impl] Import Ruby r49025 + Get rid of usage of uninitialized variable. +2015/05/11: [impl] Import Ruby r49021 + Fix printf format conversion specifiers. +2015/01/21: [dist] Merge Oniguruma 5.9.6 +2014/11/04: [bug] Import Ruby r47996 + Avoid undefined behaviors found by gcc -fsanitize=undefined. +2014/09/26: [dist] (thanks Kouhei Sutou) + Add -no-undefine link flag (PR #45) +2014/09/23: [impl] Import the latest st.[ch] from Ruby r47675 +2014/09/20: [bug] Fix possible memory leaks. +2014/09/17: [impl] Merge Ruby r47602 + Shrink PosixBracketEntryType. +2014/09/17: [impl] Merge Ruby r47601 + Remove unused variable. + +2014/09/11: Version 5.15.0 + +2014/09/11: [dist] update LTVERSION to "5:3:0". +2014/09/01: [bug] "ab" =~ /(?!^a).*b/ doesn't match (Issue #44) + https://bugs.ruby-lang.org/issues/9728 +2014/08/08: [bug] Character properties ignore the ignore case flag (Issue #41) +2014/08/08: [bug] Regex matching errors when using \W character class and /i + option (Issue #4) + https://bugs.ruby-lang.org/issues/4044 +2014/08/05: [impl] Reduce the size of some structures +2014/07/31: [bug] /(?i)\u0149\u0149/ =~ "\u0149\u0149" doesn't match + (Issue #40) + +2014/07/27: Version 5.14.2 + +2014/07/27: [dist] update LTVERSION to "5:2:0". +2014/07/25: [impl] Show byte offset of byte codes when debugging +2014/07/24: [impl] Merge Ruby r46915 + UNALIGNED_WORD_ACCESS on ppc64 +2014/07/19: [impl] Merge Ruby r30943 + Show encoding of compiling regexp. +2014/07/19: [impl] Merge Ruby r17765 partly +2014/07/18: [impl] Use numberof macro +2014/07/18: [impl] Merge Ruby's props.h which uses gperf. + Merge Ruby r46039, r46051 and r46052 +2014/07/16: [impl] Drop support for Borland C++ +2014/07/15: [bug] /[a-c#]+\W/ =~ "def#" fails when encoding is UTF-16/32 +2014/07/09: [impl] Merge Ruby's casefold.h which uses gperf. + Merge Ruby r46056-46057, r46266-46273 and r46317 + +2014/07/01: Version 5.14.1 + +2014/07/01: [dist] update LTVERSION to "5:1:0". (Issue #37) +2014/07/01: [dist] testpy.py: support error tests. + + E.g.: + $ LD_LIBRARY_PATH=.libs python + >>> import testpy + >>> testpy.n("[", "", err=-103) + OK(E): 'premature end of char-class' (/[/ '') + +2014/07/01: [dist] some files was missing from Makefile.am. + +2014/07/01: Version 5.14.0 + +2014/06/30: [bug] SEGV may occur in onig_error_code_to_str() +2014/06/30: [bug] onig.py: onig_error_code_to_str() didn't work on 64-bit OS +2014/06/25: [bug] /\x{1ffc}/i =~ "\x1ff3" didn't match +2014/06/24: [new] Enable Coveralls + See: https://coveralls.io/r/k-takata/Onigmo +2014/06/22: [new] Support for Unicode 7.0. (Issue #12) +2014/06/20: [new] Add a new definition USE_UNICODE_AGE_PROPERTIES. + If undefine this, age properties (e.g. \p{Age=6.3}) are + disabled. Disabling this reduces the size of Unicode data. +2014/06/19: [new] Enable Travis CI (Issue #36) + See: https://travis-ci.org/k-takata/Onigmo +2014/04/18: [bug] fix warning about alloca() with MinGW (Issue #35) +2014/04/17: [spec] add checking the number of capture groups (Issue #24) + Now the maximum number of capture groups is explicitly + limited to ONIG_MAX_CAPTURE_GROUP_NUM (32767). + Also add a new error code: ONIGERR_TOO_MANY_CAPTURE_GROUPS. +2014/04/17: [bug] double free may occur +2014/04/15: [dist] testpy.py: change 'region' to a local variable + Now, it becomes easy to execute a test manually from the + python's interactive shell. + + E.g.: + $ LD_LIBRARY_PATH=.libs python + >>> import testpy + >>> testpy.x2(r"a+b+", "aab", 0, 3) + OK: /a+b+/ 'aab' + +2014/04/12: [new] (thanks mattn) + Fix build on mingw (PR #33) +2014/04/12: [new] improve multithread support + Add the default multithread implementations for Win32 and + Unix. Add --enable-multithread option in configure. +2014/04/12: [bug] deadlock occurs when recursive lock is not allowed +2014/04/12: [bug] fix: segmentation fault occurs when many groups are used + (Issue #24) + see: https://bugs.ruby-lang.org/issues/8716 +2014/01/22: [new] (thanks Allan Odgaard) + Add option to indicate search range is not begin/end of + string (PR #27) +2014/01/22: [bug] fix: Backwards search not respecting range (Issue #22) +2014/01/21: [dist] Merge Oniguruma 5.9.5 +2013/07/29: [new] (thanks Allan Odgaard) + Add 'ifndef ... endif' guard around thread locking macros + (PR #23) + +2013/07/03: Version 5.13.5 + +2013/07/03: [dist] update LTVERSION to "5:0:5". +2013/07/02: [bug] (thanks Akinori MUSHA and Ippei Obayashi) + Fix a renumbering bug in condition regexp with a named + capture. + see: https://bugs.ruby-lang.org/issues/8583 +2013/05/30: [dist] Merge Oniguruma 5.9.3 and 5.9.4. + Also change the version of autotools. + (automake 1.11.1, autoconf 2.65, libtool 2.2.6b) +2013/05/29: [spec] (thanks Akinori MUSHA) + Allow ENCLOSE_OPTION in look-behind. +2013/04/10: [bug] fix problem with optimization of \z. + see: http://bugs.ruby-lang.org/issues/8210 + +2013/03/17: Version 5.13.4 + +2013/03/17: [dist] update LTVERSION to "5:0:4". +2013/03/10: [bug] fix lookbehind assertion fails with /m mode enabled. + see: http://bugs.ruby-lang.org/issues/8023 +2013/03/05: [bug] fix \Z matches where it shouldn't. + see: http://bugs.ruby-lang.org/issues/8001 +2013/03/02: [dist] add .editorconfig (see: http://editorconfig.org/) +2013/03/01: [bug] fix character class with ASCII flag. + see: http://bugs.ruby-lang.org/issues/7972 +2013/02/27: [bug] fix case-insensitive group. + see: http://bugs.ruby-lang.org/issues/7974 + +2012/11/03: Version 5.13.3 + +2012/11/03: [dist] update LTVERSION to "5:0:1". +2012/10/18: [dist] Win32: add batch-mode inference rules. +2012/10/17: [bug] merge Ruby r37175. + should match with a hyphen after a range in a character + class. +2012/09/02: [impl] merge Ruby r36440. + remove "found" indirect flag to suppress warnings by + gcc 4.7. +2012/07/11: [dist] tool/enc-unicode.rb: suppress warning of Hash#index on + Ruby 1.9. +2012/07/10: [dist] testpy.py: return the result of test. +2012/07/10: [dist] testpy.py: simplify the method of setting output encoding. +2012/07/03: [dist] testpy.py: error messages are not displayed. +2012/06/16: [impl] merge Ruby r36072 partially. + regparse.c (is_onechar_cclass): restructured to clarify + that c is used if found == 1. +2012/06/16: [dist] merge Ruby r36070. + tool/enc-unicode.rb: add comment why it uses Hash#index. +2012/05/22: [impl] merge Ruby r35724. + enc/sjis.c (code_to_mbclen): return + ONIGERR_INVALID_CODE_POINT_VALUE if the code is invalid. +2012/05/11: [dist] update .gitignore. +2012/04/30: [dist] configure.in: add 'foreign' option in AM_INIT_AUTOMAKE. +2012/04/18: [dist] fix samples to support x64. + NOTE: This is a preliminary fix. It is needed that + additional support for the LLP64 data model such as + Visual C++ x64. +2012/04/14: [dist] update Makefile.{am,in}. + Add new files. + Enable making test[cu].c from test*.rb. +2012/04/14: [dist] update tests. (testc.c, testu.c, etc.) + +2012/03/29: Version 5.13.2 + +2012/03/24: [impl] suppress warnings. +2012/03/24: [impl] remove unnecessary casts. +2012/03/23: [impl] merge Ruby r35107. + suppress warnings. +2012/03/21: [bug] memory leak occurs when char class contains only one char. +2012/03/21: [impl] use actual type to get the size. + see: http://bugs.ruby-lang.org/issues/6144 +2012/03/15: [impl] check the return code of add_ctype_to_cc(). + see: http://bugs.ruby-lang.org/issues/6145 +2012/03/15: [impl] fix error message. +2012/03/15: [bug] broken conditional expressions are allowed. + see: http://bugs.ruby-lang.org/issues/6143 +2012/03/15: [impl] merge Ruby r35027. + adjust style. +2012/03/06: [impl] merge Ruby r34905. + Remove unused variables. +2012/02/29: [bug] unexpected match occurs when a char class contains no char. +2012/02/25: [impl] CaseFolding.py: fix regexp. +2012/02/25: [impl] define the sizes of case folding tables in casefold.h. +2012/02/24: [dist] fix samples to support x64. + NOTE: This is a preliminary fix. +2012/02/23: [impl] merge Ruby r34730. + don't use // comment. +2012/02/20: [impl] merge Ruby r34684, r34688 and r34692. + fix-up warnings. +2012/02/17: [dist] (thanks NARUSE, Yui) + tool/enc-unicode.rb: Don't use \h to work with Ruby 1.8. +2012/02/14: [spec] relative group reference in back reference with nest level + is allowed. + +2012/02/05: Version 5.13.1 + +2012/02/04: [spec] allow \b and \B in look-behind. +2012/02/01: [new] support for Unicode 6.1. + +2012/01/20: Version 5.13.0 + +2012/01/20: [dist] update LTVERSION to "5:0:0". +2012/01/17: [bug] memory leak occurs when xrealloc fails. +2012/01/15: [bug] Calling function "add_code_range" without checking return + value. +2012/01/12: [bug] testpy.py: error messages are not displayed when Python 2.x + is used. +2012/01/11: [bug] memory leak occurs when history_tree_add_child fails. +2012/01/11: [bug] (thanks Masashi Tsuji) + OnigCaptureTreeNode memory leak. +2012/01/09: [spec] ONIG_OPTION_ASCII_RANGE should be enabled in + ONIG_SYNTAX_JAVA. +2012/01/09: [new] support for Ruby 1.9.3 compatible \b, \B and POSIX brackets. + add ONIG_OPTION_WORD_BOUND_ALL_RANGE and + ONIG_OPTION_POSIX_BRACKET_ALL_RANGE. + remove ONIG_SYN_POSIX_BRACKET_ALWAYS_ALL_RANGE. +2011/12/31: [bug] /^ss$/i doesn't match "\x{DF}". +2011/12/30: [new] add ONIG_SYN_POSIX_BRACKET_ALWAYS_ALL_RANGE option. +2011/12/29: [bug] (thanks Nobuyoshi Nakada) + C standard requires va_end() to be placed before return. + quote macro expansions. + +2011/12/28: Version 5.12.1 + +2011/12/24: [new] merge Ruby r23714, r28980 and r34050. + add onig_memsize() and onig_region_memsize(). +2011/12/24: [new] support for Python 3.x. (onig.py and testpy.py) +2011/12/14: [bug] testpy.py doesn't work on Ubuntu. + +2011/12/12: Version 5.12.0 + +2011/12/12: [dist] update LTVERSION to "4:0:0". +2011/12/11: [impl] use ONIGENC_IS_UNICODE to check if the encoding is Unicode + encoding. +2011/12/10: [new] support for Unicode 6.0. + new scripts, ages, blocks (\p{In_XXX}) and case foldings. + tool/enc-unicode.rb is imported from Ruby 1.9.3. +2011/12/10: [spec] \p{Print} shouldn't include newlines. + \p{Print} = \p{Graph} + \p{Space_Separator} +2011/12/10: [bug] \p{NEWLINE} should not be allowed. +2011/12/05: [new] support for PyPy 1.7. (onig.py and testpy.py) +2011/12/01: [bug] /a{2}/i doesn't match 'AA'. +2011/11/21: [impl] use ONIG_LAST_CODE_POINT instead of ~((OnigCodePoint )0). +2011/11/17: [bug] code ranges are not merged properly. +2011/11/17: [bug] /[\x{0}-X]/i doesn't match properly when UTF-16/32 is used. + +2011/10/16: Version 5.11.4 + +2011/10/16: [dist] update LTVERSION to "3:0:2". +2011/10/15: [tune] optimize Sunday's quick search. +2011/10/07: [API] add ONIG_OPTION_DOTALL option as an alias of + ONIG_OPTION_MULTILINE. +2011/10/04: [impl] add Sunday's quick search. + add config USE_SUNDAY_QUICK_SEARCH. +2011/10/04: [impl] add case-insensitive Boyer-Moore-Horspool search. +2011/10/03: [spec] check minimum digits of hexadecimal numbers. + \uHHHH should be exactly four digits. +2011/10/03: [API] rename ONIG_SYN_OP2_QMARK_BAR_BRANCH_RESET to + ONIG_SYN_OP2_QMARK_VBAR_BRANCH_RESET. + +2011/09/18: Version 5.11.3 + +2011/09/18: [dist] update LTVERSION to "3:0:1". +2011/09/18: [spec] \R matches \x85, \x2028 and \x2029 in Unicode encodings. +2011/09/18: [new] add ONIG_OPTION_NEWLINE_CRLF. +2011/09/18: [tune] optimize \x{}. +2011/09/17: [tune] expand a{n,m} to 'a...a' + a{0,m-n}. +2011/09/12: [bug] /.*\Z/ doesn't match properly. + +2011/09/10: Version 5.11.2 + +2011/09/09: [bug] merge Ruby r24546. + fix the first character bigger than sb_out was dropped. +2011/09/09: [bug] merge Ruby r19864. + CCV_SB is only for single byte. +2011/09/09: [bug] merge Ruby r24550. + fix memory leaks. + +2011/09/08: Version 5.11.1 + +2011/09/08: [impl] merge some part of Ruby r29928. (update debug log.) +2011/09/08: [impl] merge Ruby r32544. + Power PC does not allow unaligned word access. +2011/09/07: [bug] \g<0> doesn't work when USE_PERL_SUBEXP_CALL isn't defined. +2011/09/07: [tune] optimize character class. +2011/09/06: [tune] optimize (?a). +2011/09/06: [tune] optimize \R. + +2011/09/03: Version 5.11.0 + +2011/09/03: [dist] update LTVERSION to "3:0:0". +2011/09/01: [new] add OnigPosition. +2011/09/01: [new] (thanks h-tom) + support for x64. +2011/09/01: [new] add ONIG_SYNTAX_PYTHON (onig.py). +2011/08/30: [dist] check _MSC_VER instead of _NMAKE_VER when LTCG is used. +2011/08/25: [tune] reduce conditional branches. + use ONIGENC_IS_IN_RANGE macro to check the code range. +2011/08/18: [dist] add a resource script for onig.dll (win32/onig.rc). + +2011/08/09: Version 5.10.6 + +2011/08/09: [dist] a .def file can be used to export APIs. +2011/08/08: [dist] update win32/Makefile to support LTCG optimization. +2011/08/07: [new] add new test scripts: testpy.py and onig.py +2011/08/07: [new] add a new syntax: ONIG_SYNTAX_PYTHON + +2011/08/03: Version 5.10.5 + +2011/08/03: [dist] update win32/Makefile. +2011/08/03: [dist] update tests to support ONIG_OPTION_ASCII_RANGE option. +2011/07/30: [new] EUC-JP: support for JIS X 0212 (Supplemental Kanji). +2011/07/30: [impl] not to use ONIG_ENCODING_SJIS inside ONIG_ENCODING_CP932. +2011/07/29: [new] Add support for EUC-JIS-2004. + (This feature is not enabled by default.) +2011/07/29: [impl] EUC-JP: check the length more strictly. +2011/07/29: [dist] translate Japanese comments to English. +2011/07/29: [bug] \p{Katakana} doesn't match JIS X 0201 Katakana when EUC-JP + is used. +2011/07/28: [dist] change the encoding of Japanese documents to UTF-8. +2011/07/26: [bug] [^x]*x causes invalid pointer access. +2011/07/19: [spec] allow (?au) in Ruby syntax mode. +2011/07/16: [new] add \g<0> and \g<+n>. + +2011/07/11: Version 5.10.4 + +2011/07/11: [dist] update autotools. + use automake 1.10.3, autoconf 2.68 and libtool 2.4. +2011/07/11: [impl] add typedefs of intptr_t/uintptr_t for old VC++ compilers. +2011/07/11: [impl] include stdint.h and stddef.h for intptr_t/uintptr_t. +2011/07/04: [tune] implicit-anchor optimization +2011/07/04: [bug] onig_search_gpos() may return wrong OnigRegion. +2011/07/04: [bug] fix typo in debug log. +2011/07/04: [tune] enable optimization for .* except look-behind. +2011/07/04: [bug] Revert "enable optimization for .* except look-behind" + +2011/07/03: Version 5.10.3 + +2011/07/01: [tune] implicit-anchor optimization +2011/06/30: [bug] Revert "[tune] implicit-anchor optimization" +2011/06/30: [bug] (?a) doesn't work properly + +2011/06/29: Version 5.10.2 + +2011/06/29: [tune] implicit-anchor optimization +2011/06/28: [impl] remove duplicated debug log. +2011/06/28: [bug] (?a) doesn't work for \d, \h and \s. +2011/06/28: [bug] should not backtrack in \X. + +2011/06/24: Version 5.10.1 + +2011/06/24: [new] add (?(cond)yes) and (?(cond)yes|no). +2011/06/24: [bug] double free in \R and \X. +2011/06/24: [tune] enable optimization for .* except look-behind. +2011/06/21: [spec] number is not allowed in (?&name) and (?P>name). + +2011/06/18: Version 5.10.0 + +2011/06/18: [impl] export onig_new_without_alloc() API. +2011/06/15: [spec] change Ruby syntax options. + add \K, \R and \X. +2011/06/15: [spec] change Perl syntax options. + Rename ONIG_SYNTAX_PERL to ONIG_SYNTAX_PERL58. + Rename ONIG_SYNTAX_PERL_NG to ONIG_SYNTAX_PERL58_NG. + Add ONIG_SYNTAX_PERL as Perl 5.10+ compatible syntax. +2011/06/14: [new] add (?R), (?0) and (?+n). +2011/06/14: [new] add new character properties in EUC-JP: + Han, Latin, Greek and Cyrillic. +2011/06/14: [new] add new encoding: CP932. +2011/06/14: [new] add new character properties in Shift_JIS: + Han, Latin, Greek and Cyrillic. +2011/06/13: [bug] (?-n) doesn't work +2011/06/13: [new] add ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME_CALL +2011/06/13: [impl] remove unused ONIG_SYN_CAPTURE_LEFT_MOST_NAMED_GROUP flag. +2011/06/13: [bug] (?a) doesn't work with Unicode encodings. +2011/06/12: [new] add EUC-JP case folding. +2011/06/12: [new] add Shift_JIS case folding. +2011/06/12: [spec] add ONIG_OPTION_ASCII_RANGE option to OnigSyntaxRuby. +2011/06/12: [new] add Python/PCRE compatible named group: + (?P<name>...), (?P=name) and (?P>name). +2011/06/11: [new] add \g{n}, \g{-n} and \g{name}. +2011/06/10: [bug] char class may cause memory leak + http://redmine.ruby-lang.org/issues/show/4061 + New URL: http://bugs.ruby-lang.org/issues/4061 +2011/06/10: [bug] invalid backref number/name + http://redmine.ruby-lang.org/issues/show/2759 + New URL: http://bugs.ruby-lang.org/issues/2759 +2011/06/10: [bug] /(?<=a).*b/ =~ "aab" doesn't match + http://redmine.ruby-lang.org/issues/show/3568 + New URL: http://bugs.ruby-lang.org/issues/3568 +2011/06/10: [bug] Case Sensitivity in Regular Expressions with Lookbehind + http://redmine.ruby-lang.org/issues/show/4088 + New URL: http://bugs.ruby-lang.org/issues/4088 +2011/06/10: [spec] allow any target for quantifiers. + add USE_NO_INVALID_QUANTIFIER. +2011/06/10: [new] add Perl 5.14 compatible character set modifier: + (?adlu) and (?^alu). +2011/06/10: [new] add (?&name), (?n) and (?-n). + add USE_PERL_SUBEXP_CALL. +2011/06/10: [new] add \R, \X and \K. +2011/06/10: [spec] allow negative look behind in look behind. +2011/06/10: [new] add: onig_search_gpos(). + +2011/06/10: fork from Oniguruma 5.9.2. + + +====================================================================== +History of Oniguruma + +2014/12/12: Version 5.9.6 + +2013/11/27: [impl] add onigenc_end_unicode(). (thanks Takenori Imoto) +2013/11/27: [impl] add onig_add_end_call(). (thanks Takenori Imoto) + +2013/10/21: Version 5.9.5 + +2013/10/21: [impl] escape warnings for -Wall. (regparse.c) +2013/10/21: [bug] fixes an issue on Windows x64. (thanks Anatoliy Belsky) + The issue was discovered in PHP, see https://bugs.php.net/64769. +2013/10/21: [impl] remove unused variable. (regcomp.c) + +2013/04/04: Version 5.9.4 + +2013/04/04: [dev] remove Makefile.in from git repository. +2013/04/04: [dist] add oniguruma.pc.in file. (for pkg-config) + (thanks Giulio Paci) + +2012/10/26: Version 5.9.3 + +2012/10/15: remove warnings "test: =: unary operator expected" in ./configure. + (thanks t_okazaki) +2012/10/15: fix print_tree ENCLOSE_OPTION bug. (thanks Suraj N. Kurapati) + +2010/01/09: Version 5.9.2 + +2010/01/05: [bug] fix utf16be_code_to_mbc() and utf16le_code_to_mbc(). +2008/09/16: [bug] fix memory leaks in parse_exp(). +2008/08/01: [bug] fix memory leaks. +2008/06/17: [bug] invalid type of argument was used + in onig_st_lookup_strend(). +2008/06/16: [bug] invalid CaseFoldMap entry in ISO-8859-5. 0xdf -> 0xde +2008/02/19: [new] add: onig_reg_init(). +2008/02/19: [new] add: onig_free_body(). +2008/02/19: [new] add: onig_new_without_alloc(). +2008/02/19: [API] rename onig_alloc_init() to onig_reg_init(), + and argument type changed. +2008/01/31: [impl] move UTF16_IS_SURROGATE_XXX() to regenc.h. +2008/01/30: [bug] (thanks akr) + fix euctw_islead(). +2008/01/23: [bug] update enc/koi8.c. + +2007/12/22: Version 5.9.1 + +2007/12/21: [impl] add sprint_byte(). +2007/11/28: [bug] (thanks Andy Armstrong) + don't overwrite error code in fetch_name(). +2007/11/12: [bug] utf8 mbc length of code 0xfe, 0xff are not 1, +2007/10/23: [spec] onig_enc_len() takes three arguments. (not used) +2007/10/15: [impl] (thanks Rui Hirokawa) + add check HAVE_STDARG_H. +2007/09/07: [API] rename enc_len() to onig_enc_len() in oniguruma.h. +2007/09/04: [API] remove ONIGENC_ERR_XXXXX. +2007/09/03: [API] add error ONIGERR_INVALID_CODE_POINT_VALUE. +2007/09/03: [impl] change error message to "invaid code point value" + for ONIGERR_INVALID_WIDE_CHAR_VALUE. +2007/09/03: [bug] xxx_code_to_mbclen() should return + ONIGERR_INVALID_WIDE_CHAR_VALUE for invalid code point. + ex. /[\x{7fffffff}]/ for ASCII encoding. +2007/08/28: [impl] remove "warning: no previous declaration ...". +2007/08/21: [impl] remove warnings in enc/mktable.c. +2007/08/20: [impl] remove "warning: unused parameter" +2007/08/20: [impl] remove "warning: comparison between signed and unsigned". +2007/08/06: [impl] remove clear_not_flag_cclass(). +2007/08/03: [bug] fix the case of undefined USE_NAMED_GROUP. +2007/08/02: [spec] add backref by number. +2007/08/01: [API] add OnigCtype. +2007/07/27: [spec] add USE_CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS. +2007/07/24: [impl] define PLATFORM_UNALIGNED_WORD_ACCESS. +2007/07/23: [dist] fix doc/FAQ.ja. + +2007/07/14: Version 5.9.0 + +2007/07/13: [bug] add check into onig_reduce_nested_quantifier(). +2007/06/26: [spec] (thanks K.Takata) + ONIG_OPTION_SINGLELINE: '$' -> '\Z' (as Perl) +2007/06/26: [dist] (thanks K.Takata) + fix documents API and API.ja. +2007/06/19: [impl] remove IS_NOT_NULL() check before onig_node_free(). +2007/06/18: [bug] (thanks KUBO Takehiro) + WORD_ALIGNMENT_SIZE must be sizeof(OnigCodePoint). +2007/06/18: [impl] rename CClassNode flags. +2007/06/18: [bug] initialization miss. +2007/06/13: [impl] change node type reference NXXXX. +2007/06/11: [impl] add node type bit. +2007/06/11: [spec] allow anchor in enclosed repeater. /(\z)*/ +2007/06/11: [impl] rename node types. +2007/06/08: [impl] remove OP_SET_OPTION_PUSH and OP_SET_OPTION from match_at(). +2007/06/07: [impl] use xvsnprintf(). +2007/06/06: [tune] don't set qn->next_head_exact for string first byte is zero. +2007/06/06: [impl] remove unused variables. + +2007/06/04: Version 5.8.0 + +2007/06/04: [impl] add #ifndef vsnprintf into regint.h. +2007/05/31: [dist] add configure option '--enable-crnl-as-line-terminator'. +2007/05/30: [dist] add sample/crnl.c. +2007/05/30: [bug] should check USE_CRNL_AS_LINE_TERMINATOR case + in onig_search(). +2007/05/29: [impl] move USE_CRNL_AS_LINE_TERMINATOR into regenc.h. +2007/05/29: [impl] should check USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE + in forward_search_range() and backward_search_range(). + +2007/04/27: Version 5.7.0 + +2007/04/20: [spec] add config USE_MATCH_RANGE_IS_COMPLETE_RANGE. +2007/04/20: [impl] refactoring in match_at(). + +2007/04/12: Version 5.6.1 + +2007/04/12: [bug] must not use UChar in oniguruma.h. +2007/04/09: [impl] change STATE_CHECK_BUFF_MAX_SIZE value from 0x8000 + to 0x4000. [ruby-core:10883] + +2007/04/04: Version 5.6.0 (mourning for Hideo Takamatsu) + +2007/04/03: [spec] add new notation (?'name'), \k'name', \g'name'. +2007/04/03: [impl] remove unused variable. +2007/03/26: [impl] add 'void' to function declarations. + +2007/03/06: Version 5.5.3 + +2007/03/06: [bug] add #include <malloc.h> for bcc32. + (In bcc32, alloca() is declared in malloc.h.) +2007/03/02: [bug] invalid optimization for semi-end-buf in onig_search(). + ex. /\n\Z/.match("aaaaaaaaaa\n") +2007/03/02: [impl] move range > start check position in end_buf process. + +2007/01/09: Version 5.5.2 + +2007/01/09: [impl] rename USE_EXTERNAL_LOWER_CASE_CONV_TABLE. +2007/01/05: [tune] select_opt_exact_info() didn't work for empty info. + ex. /.a/ make MAP info instead of EXACT info. +2006/12/28: [impl] add print_enc_string() for ONIG_DEBUG mode. + +2006/12/22: Version 5.5.1 + +2006/12/22: [impl] rename ADD_PAD_TO_SHORT_BYTE_STRING + . to USE_PAD_TO_SHORT_BYTE_CHAR. +2006/12/21: [spec] should check too short multibyte char in parse_exp(). + add ADD_PAD_TO_SHORT_BYTE_STRING. + ex. /\x00/ in UTF16 should be error. + +2006/12/06: Version 5.5.0 + +2006/12/05: [bug] should add unfold-1 codes from folded code into + onigenc_unicode_get_case_fold_codes_by_str(). + (ex. "S" -> "s" -> 0x017f) +2006/12/05: [new] add flag ONIGENC_CASE_FOLD_TURKISH_AZERI and + USE_UNICODE_CASE_FOLD_TURKISH_AZERI. (disabled in default) +2006/12/04: [spec] remove ONIGENC_CASE_FOLD_FULL. +2006/11/30: [impl] remove unnecessary check in xxx_mbc_case_fold(). + +2006/11/29: Version 5.4.0 + +2006/11/28: [spec] INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR is enabled in + default case fold status. +2006/11/28: [spec] rename ONIGENC_CASE_FOLD_MULTI_CHAR to + INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR. +2006/11/28: [impl] remove USE_UNICODE_CASE_FOLD_MULTI_CHAR. +2006/11/28: [impl] remove Fold[123]Table and add FoldTable. +2006/11/27: [impl] change tool/unicode_fc.rb to see CaseFolding.txt. +2006/11/24: [bug] should call callback for to[j] <-> to[k] in + onigenc_unicode_apply_all_case_fold(). + +2006/11/22: Version 5.3.0 + +2006/11/22: [dist] add index_ja.html. +2006/11/22: [impl] undef ONIG_ESCAPE_UCHAR_COLLISION in regint.h and regenc.h. +2006/11/21: [bug] invalid array access. +2006/11/21: [impl] escape UChar collision from config.h. +2006/11/20: [new] add Hiragana/Katakana properties into Shift_JIS. +2006/11/20: [impl] fix CR_Katakana[] values in EUC-JP. +2006/11/17: [impl] declare strend hash table functions in regint.h. +2006/11/17: [impl] move property list functions to regenc.c. +2006/11/17: [new] add Hiragana/Katakana properties into EUC-JP. +2006/11/15: [impl] remove NOT_RUBY from AM_CFLAGS. + +2006/11/14: Version 5.2.0 + +2006/11/14: [impl] remove program codes for Ruby. +2006/11/14: [impl] reduce program codes for Ruby. +2006/11/10: [bug] 0x24, 0x2b, 0x3c, 0x3d, 0x3e, 0x5e, 0x60, 0x7c, 0x7e + should be [:punct:]. +2006/11/09: [new] (thanks Byte) + add new character encoding CP1251. +2006/11/08: [impl] rename QUALIFIER -> QUANTIFIER. + +2006/11/07: Version 5.1.0 + +2006/11/07: [dist] remove test.rb, testconv.rb and testconvu.rb. +2006/11/07: [bug] get_case_fold_codes_by_str() should handle 'Ss' and 'sS' + combination for ess-tsett. +2006/11/07: [impl] apply_all_case_fold() doesn't need to return all + case character combination for multi-character folding. + (ONIGENC_CASE_FOLD_MULTI_CHAR) +2006/11/07: [bug] (thanks Byte) + add { 0xa3, 0xb3 } to CaseFoldMap[] for KOI8-R. +2006/11/06: [spec] change ONIG_OPTION_FIND_LONGEST to search all of + the string range. + add USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE. +2006/11/02: [impl] re-implement expand_case_fold_string() for + ONIGENC_CASE_FOLD_MULTI_CHAR. +2006/10/30: [impl] add NSTR_DONT_GET_OPTINFO flag. +2006/10/30: [impl] (thanks K.Takata) + add THREAD_SYSTEM_INIT and THREAD_SYSTEM_END. +2006/10/30: [bug] (thanks Wolfgang Nadasi-Donner) + invalid offset value was used in STATE_CHECK_BUFF_INIT(). +2006/10/27: [tune] speed up ONIGENC_MBC_CASE_FOLD() for UTF-16, UTF-32. + (ASCII code check) +2006/10/27: [tune] (thanks Kornelius Kalnbach) + String#scan for long string needs long time compare with + old Ruby + by initialization time for combination explosion check + ex. ("test " * 100_000).scan(/\w*\s?/) + change STATE_CHECK_BUFF_MAX_SIZE from 0x8000000 to 0x8000. + reduce initialization area of state_check_buff. +2006/10/25: [impl] add DISABLE_CASE_FOLD_MULTI_CHAR(). + +2006/10/23: Version 5.0.1 + +2006/10/23: [bug] should fold string in expand_case_fold_string(). +2006/10/23: [bug] (thanks Km) + too many case fold/unfold expansion problem. + don't expand and set ambig flag to the string node. + (except ONIGENC_CASE_FOLD_MULTI_CHAR). +2006/10/23: [bug] (thanks K.Takata) + invalid \p{Alnum}, \p{ASCII}, [:alnum:], [:ascii:]. + fix OnigEncAsciiCtypeTable[] etc... +2006/10/23: [spec] (thanks K.Takata) + add [:word:] POSIX bracket. +2006/10/23: [bug] (thanks K.Takata) + \p{Word} doesn't work. +2006/10/20: [impl] don't expand for AMBIG_FLAG string in + expand_case_fold_string(). + +2006/10/19: Version 5.0.0 + +2006/10/18: [bug] ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM should be 13. +2006/10/18: [impl] remove unused functions. +2006/10/18: [dist] update documents. +2006/10/18: [API] move OnigMetaCharTableType to OnigSyntaxType. +2006/10/18: [dev] add too/unicode_fc.rb, unicode_pc.rb. +2006/10/18: [dist] remove MANIFEST-RUBY from distribution. +2006/10/18: [bug] return duplicated code in + onigenc_unicode_get_case_fold_codes_by_str(). +2006/10/18 [API] remove ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS. +2006/10/18: [dev] add tool/19. +2006/10/18: [dist] remove target 19 from Makefile.am. +2006/10/17: [dist] add enc/unicode.c to target 19 of win32/Makefile. +2006/10/17: [impl] change type for escape VC++ warning. +2006/10/17: [API] rename ONIGENC_CASE_FOLD_NONE to ONIGENC_CASE_FOLD_MIN. +2006/10/17: [dist] remove INSTALL-RUBY from distribution. +2006/10/17: [dist] update LTVERSION to "2:0:0". +2006/10/17: [impl] remove warnings for [make CFLAGS="-g -O2 -Wall"] + in the case USE_UNICODE_PROPERTIES and + USE_UNICODE_CASE_FOLD_MULTI_CHAR are undefined. +2006/10/17: [impl] remove warnings for [make CFLAGS="-g -O2 -Wall"]. +2006/10/17: [impl] re-implement onigenc_unicode_apply_all_case_fold(). + multi-char by case folded char-class is treated as + caseless-string (ambig flag on). + enable OP_EXACT1_IC and OP_EXACTN_IC. +2006/10/16: [bug] unfold expand for 1->2, 1->3 folding in + onigenc_unicode_apply_all_case_fold(). + add CaseFoldExpand_12[], CaseFoldExpand_13[]. +2006/10/16: [bug] (thanks Akinori Musha) + first argument of rb_warn() should be format string. +2006/10/16: [impl] add msa.state_check_buff_size initialization + in onig_search(). +2006/10/16: [spec] re-implement Unicode Caseless Match codes. +2006/10/10: [bug] should call onig_st_free_table() in + onig_free_shared_cclass_table(). +2006/10/10: [impl] remove OnigCompCaseFoldCodes. +2006/10/10: [impl] remove onigenc_ascii_is_mbc_ambiguous() and + onigenc_mbn_is_mbc_ambiguous(). +2006/10/10: [API] remove is_mbc_ambiguous() member from OnigEncodingType. +2006/10/10: [API] rename onig_set_default_ambig_flag() to + onig_set_default_case_fold_flag(), + onig_get_default_ambig_flag() to + onig_get_default_case_fold_flag(), + onig_get_ambig_flag() to onig_get_case_fold_flag(). +2006/10/10: [API] rename ambig_flag to case_fold_flag. +2006/10/10: [API] rename OnigAmbigType to OnigCaseFoldType. +2006/10/10: [impl] rename ONIGENC_IS_CODE_SB_WORD() to IS_CODE_SB_WORD() + and move to regint.h. +2006/10/10: [impl] remove OP_WORD_SB and OP_WORD_MB. +2006/10/10: [impl] remove OP_EXACT1_IC and OP_EXACTN_IC from match_at(). +2006/10/10: [impl] should free new_str in expand_case_fold_string(). +2006/10/06: [dist] add test entries to sample/encode.c. +2006/10/06: [impl] re-implement caseless match (case-fold). +2006/10/06: [impl] expand string node by case fold variations. + add expand_case_fold_string(). +2006/10/05: [spec] rename OnigCompAmbigCodeItem to OnigCaseFoldCodeItem. +2006/10/05: [spec] add apply_all_case_fold() and get_case_fold_codes_by_str() + to OnigEncodingType. +2006/10/05: [spec] remove ambig_flag, get_all_pair_ambig_codes() and + get_all_comp_ambig_codes() member from OnigEncodingType. +2006/10/03: [impl] rename mbc_to_normalize() to mbc_case_fold(). +2006/10/03: [spec] rename ONIGENC_AMBIGUOUS_MATCH_XXX + to ONIGENC_CASE_FOLD_XXX. + rename ONIGENC_CASE_FOLD_COMPOUND + to ONIGENC_CASE_FOLD_MULTI_CHAR. +2006/10/02: [impl] remove all ONIG_RUBY_M17N part. +2006/09/29: [impl] initialize state_check_buff_size in STATE_CHECK_BUFF_INIT(). + make valgrind happy. +2006/09/22: [impl] remove parse time ctype values (CTYPE_WORD etc...) +2006/09/22: [ruby] enable USE_BACKREF_AT_LEVEL for Ruby mode. +2006/09/22: [spec] (thanks Allan Odgaard) + allow upper case letter as the first character + of group name. + fetch_name() and fetch_name_with_level() +2006/09/21: [impl] convert to ascii for parameter string in + onig_error_code_to_str(). + add enc member into OnigErrorInfo. +2006/09/21: [dist] update documents for Unicode Property. +2006/09/21: [new] add Unicode Properties. (enc/unicode.c) + Any, Assigned, C, Cc, L, Lm, Arabic, Greek etc... +2006/09/21: [impl] add USE_UNICODE_PROPERTIES into regenc.h. +2006/09/21: [impl] remove USE_UNICODE_FULL_RANGE_CTYPE. +2006/09/20: [impl] change ONIGENC_CTYPE_XXXX to sequencial values. + add BIT_CTYPE_XXXX bit flags to regenc.h. + update XXXX_CtypeTable[] for BIT_CTYPE_ALNUM. +2006/09/19: [memo] move from CVS to Subversion (1.3.2). +2006/09/19: [impl] (thanks KOYAMA Tetsuji) + HAVE_STDARG_PROTOTYPES was not defined in Mac OS X + by Xcode 2.4(gcc 4.0.1) problem. [php-dev 1312] etc... +2006/09/15: [bug] (thanks Allan Odgaard) + out of range access in bm_search_notrev(). + (p < s) +2006/09/13: [impl] add ONIGENC_CTYPE_ENC_EXT flag. +2006/09/13: [spec] remove 'Is' prefix check for property name + from fetch_char_property_to_ctype(). +2006/09/13: [API] add property_name_to_ctype member to OnigEncodingType. +2006/09/12: [spec][ruby] add ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY and + ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT to OnigSyntaxRuby. + +2006/09/08: Version 4.4.2 + +2006/09/08: [test] success in ruby 1.9.0 (2006-08-22) [i686-linux]. +2006/09/08: [bug] (thanks K.Takata) + out of range access in bm_search_notrev(). +2006/09/04: [spec] (thanks K.Takata) + allow look-behind in negative look-behind. + ex. /(?<!(?<=a)b|c)d/ + +2006/08/29: Version 4.4.1 + +2006/08/29: [test] success in ruby 1.9.0 (2006-08-22) [i686-linux]. +2006/08/29: [dist] (thanks Seiji Masugata) + add configure option --enable-combination-explosion-check + +2006/08/25: Version 4.4.0 + +2006/08/25: [test] success in ruby 1.9.0 (2006-08-22) [i686-linux]. +2006/08/25: [impl] add_state_check_num() should be enclosed in + ifdef USE_COMBINATION_EXPLOSION_CHECK. +2006/08/23: [spec] config USE_COMBINATION_EXPLOSION_CHECK is enabled + in Ruby mode only. +2006/08/22: [impl] remove last line comma in enum OpCode. +2006/08/22: [impl] remove OP_STATE_CHECK_ANYCHAR_STAR_PEEK_NEXT and + OP_STATE_CHECK_ANYCHAR_ML_STAR_PEEK_NEXT. +2006/08/22: [impl] remove OP_BACKREF3. + +2006/08/21: Version 4.3.1 + +2006/08/21: [test] success in ruby 1.9.0 (2006-07-28) [i686-linux]. +2006/08/21: [impl] change stack type values + and re-define STK_MASK_TO_VOID_TARGET etc... +2006/08/21: [impl] set repeat_range[].upper to 0x7fffffff as infinite. +2006/08/21: [impl] add STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE. +2006/08/21: [impl] reduce (?:a*){n,m}, (?:a+){n,m} => (?:a*){n,n}, (?:a+){n,n} +2006/09/21: [impl] reduce (a*){n,m}, (a+){n,m} => (a*){n,n}, (a+){n,n} + if backreference is not used. +2006/08/17: [bug] should check scan_env.num_call > 0 for backrefed pattern + in combination explosion check. + +2006/08/17: Version 4.3.0 + +2006/08/17: [test] success in ruby 1.9.0 (2006-07-28) [i686-linux]. +2006/08/17: [new] add config USE_COMBINATION_EXPLOSION_CHECK. + check /(.+)*/, /(\s*foo\s*)*/ etc... + [API] add num_comb_exp_check member in regex_t. + [dist] change LTVERSION value to "1:0:0" in configure.in. +2006/08/15: [bug] OP_REPEAT_INC process in match_at(). + should check repeat-count >= range-upper and + range-upper may be infinite. + +2006/08/11: Version 4.2.3 + +2006/08/11: [test] success in ruby 1.9.0 (2006-07-28) [i686-linux]. +2006/08/10: [impl] remove double call in set_qualifier(). +2006/08/10: [impl] remove by_number member in QualifierNode. +2006/08/09: [impl] remove a comma at the end of enum ReduceType + for escape warning on Mac OS X. +2006/08/07: [impl] remove warning in regcomp.c. +2006/08/07: [spec] move definition of USE_BACKREF_AT_LEVEL into NOT_RUBY. + +2006/08/03: Version 4.2.2 + +2006/08/03: [test] success in ruby 1.9.0 (2006-07-28) [i686-linux]. +2006/08/03: [bug] (thanks Hiroyuki Yamamoto) + segmentation fault in regexec(). (POSIX API) +2006/08/02: [bug] combination of \G in look-ahead/look-behind and other + anchors(\A, \z, \Z) cause invalid result. + ex. /(?!\G)a\z/.match("ba") + start arg. of MATCH_ARG_INIT() should be original + arg. of onig_search(). + +2006/07/31: Version 4.2.1 + +2006/07/31: [test] success in ruby 1.9.0 (2006-07-28) [i686-linux]. +2006/07/31: [bug] (thanks Kimura Minoru) + re-implement bm_search_notrev(). +2006/07/31: [impl] bm_search_notrev() refactoring. +2006/07/31: [bug] (thanks Kimura Minoru) + fix incomplete multibyte string in exact info. +2006/07/31: [impl] (thanks Seiji Masugata) + remove cast in va_init_list() for Intel C Compiler. + +2006/07/18: Version 4.2.0 + +2006/07/18: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux]. +2006/07/18: [new] (thanks Wolfgang Nadasi-Donner) + add back reference with nest level. + \k<name+n>, \k<name-n> +2006/07/11: [impl] change long to unsigned long for ONIG_OPTION_XXX + and ONIG_SYN_XXX number literals. + +2006/07/03: Version 4.1.2 + +2006/07/03: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux]. +2006/07/03: [spec] (thanks Wolfgang Nadasi-Donner) + allow \G in look-behind. + add ANCHOR_BEGIN_POSITION flag in setup_tree(). +2006/06/12: [impl] (thanks matz) + fix cast from char* to const char* + in onig_snprintf_with_pattern(). + fix cast from char* to const char* + for PopularQStr[] and ReduceQStr[]. + +2006/05/22: Version 4.1.1 + +2006/05/22: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux]. +2006/05/22: [impl] add position string argument to STACK_BASE_CHECK(). +2006/05/22: [bug] (thanks NARUSE, Yui) + add STK_NULL_CHECK_END to IS_TO_VOID_TARGET(). + ex. core dump in + /(?<pare>\(([^\(\)]++|\g<pare>)*+\))/.match('((a))') + +2006/05/15: Version 4.1.0 + +2006/05/15: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux]. +2006/05/15: [impl] thread atomic changes for onig_end() and + onig_free_node_list(). +2006/05/15: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux]. +2005/05/15: [dist] update API, API.ja, FAQ, FAQ.ja. +2006/05/15: [spec] remove onig_recompile(), onig_recompile_deluxe() + and re_recompile_pattern(). + add config USE_RECOMPILE_API. +2006/05/15: [impl] improved thread safe implementation of onig_search() + and onig_match(). + +2006/05/11: Version 4.0.4 + +2006/05/11: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux]. +2006/05/11: [bug] (thanks Yuji Kaneda) + dead-lock in onig_end(). +2006/05/11: [dist] update index.html. + +2006/05/08: Version 4.0.3 + +2006/05/08: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux]. +2006/05/08: [bug] (thanks Allan Odgaard) + Segmentation fault in backward search. + ex. /^\t.*$/ +2006/04/18: [dist] update index.html. +2006/04/05: [dist] update index.html. +2006/03/24: [dist] update doc/RE, doc/RE.ja. + +2006/03/23: Version 4.0.2 + +2006/03/22: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux]. +2006/03/22: [impl] add both of ONIG_OPTION_DONT_CAPTURE_GROUP + and ONIG_OPTION_CAPTURE_GROUP check. +2006/03/22: [spec] add error code ONIGERR_INVALID_COMBINATION_OF_OPTIONS. +2006/03/22: [impl] remove USE_NAMED_GROUP condition from + ONIG_OPTION_DONT_CAPTURE_GROUP check in parse_effect(). +2006/03/22: [new] add API onig_noname_group_capture_is_active(). +2006/03/01: [spec] rename regex object type from regex_t to OnigRegexType. + add typedef OnigRegexType regex_t + unless ONIG_ESCAPE_REGEX_T_COLLISION is defined. +2006/02/27: [spec] change ONIG_MAX_MULTI_BYTE_RANGES_NUM from 1000 + to 10000. (for docdiff program) +2006/02/17: [dist] change COPYING year 2005 -> 2006. + +2006/02/07: Version 4.0.1 + +2006/02/07: [test] success in ruby 1.9.0 (2005-11-28) [i686-linux]. +2006/02/07: [bug] memory leaks in onig_free_shared_cclass_table(). +2006/02/03: [ruby] add -m 0644 option to install command in "make 19". +2006/02/03: [impl] rename ANCHOR_ANYCHAR_STAR_PL to ANCHOR_ANYCHAR_STAR_ML. + change from IS_POSIXLINE() to IS_MULTILINE() + for ANCHOR_ANYCHAR_START/_ML decision + in optimize_node_left(). +2006/01/26: [dist] update index.html for Oniguruma 2.5.3. +2006/01/25: [dist] update URL in index.html. + +2006/01/24: Version 4.0.0 + +2006/01/24: [test] success in ruby 1.9.0 (2005-11-28) [i386-cygwin]. +2006/01/24: [test] success in ruby 1.9.0 (2005-11-28) [i686-linux]. +2006/01/24: [dist] remove warnings from sample/encode.c. +2006/01/24: [dist] change install description in README(.ja). +2006/01/24: [dist] remove re.c.XXX.patch from distribution and CVS. +2006/01/24: [dist] --- support shared library --- + use GNU libtool/automake. + change configure.in and add Makefile.am, sample/Makefile.am. + add AUTHORS file. +2006/01/24: [dist] test programs return exit code -1 when test fails. +2006/01/24: [bug] (thanks KIMURA Koichi) + invalid syntax definition in ONIG_SYNTAX_GREP. + ONIG_SYN_OP_BRACE_INTERVAL + -> ONIG_SYN_OP_ESC_BRACE_INTERVAL +2006/01/23: [dist] fix configure.in for onig-config. +2006/01/19: [new] add new config USE_UNICODE_ALL_LINE_TERMINATORS. + (U+000d, U+0085, U+2028, U+2029) +2005/12/29: [dist] change pmatch array size to 25 in testconv.rb. +2005/12/26: [dist] fix name in test.rb. +2005/12/26: [dist] update index.html for 2.5.1. + +2005/11/29: Version 3.9.1 + +2005/11/29: [test] success in ruby 1.9.0 (2005-11-28) [i686-linux]. +2005/11/24: [test] success in ruby 1.9.0 (2005-08-09) [i686-linux]. +2005/11/21: [test] success in ruby 1.9.0 (2005-11-20) [i386-cygwin]. +2005/11/21: [bug] (thanks Allan Odgaard) + utf-8 character comments in extended mode leads + invalid result. + ex. /(?x)(?<= # <any-utf-8 multibyte char>o\n~) / + fix onigenc_unicode_is_code_ctype() and + utf8_is_code_ctype(). +2005/11/20: [bug] (thanks MATSUMOTO Satoshi) (thanks Isao Sonobe) + begin-line anchor and BM search optimization leads + invalid result in UTF-16/32. + fix in set_optimize_exact_info(). + +2005/11/20: Version 3.9.0 + +2005/11/20: [test] success in ruby 1.9.0 (2005-11-20) [i386-cygwin]. +2005/11/20: [test] success in ruby 1.9.0 (2005-10-18) [i386-cygwin]. +2005/11/20: [new] add new config USE_CRNL_AS_LINE_TERMINATOR. + (!!! NO SUPPORT experimental option !!!) +2005/11/15: [bug] (thanks Allan Odgaard) + tok->escape was not cleared in fetch_token_in_cc(). + ex. [\s&&[^\n]] makes wrong result. +2005/10/18: [impl] (thanks nobu) + change sjis_mbc_enc_len() + and node_new_cclass_by_codepoint_range() scope to static. +2005/09/05: [dist] remove link to MultiFind. +2005/09/01: [dist] add link to yagrep. + +2005/08/23: Version 3.8.9 + +2005/08/23: [test] success in ruby 1.9.0 (2005-08-09) [i686-linux]. +2005/08/23: [inst] fix Makefile.in for make ctest/ptest. + +2005/08/23: Version 3.8.8 + +2005/08/23: [test] success in ruby 1.9.0 (2005-08-09) [i686-linux]. +2005/08/23: [impl] split is_code_in_cc() from onig_is_code_in_cc(). +2005/08/23: [impl] should check DATA_ENSURE() at OP_CCLASS_NODE in match_at(). +2005/08/23: [impl] (thanks akr) + add ONIG_OPTION_MAXBIT for escape conflict with + Ruby's option. +2005/08/22: [impl] escape GCC 4.0 warnings for testc.c. +2005/08/22: [bug] (thanks nobu, matz) [ruby-dev:26840] + UTF-8 0xFE, 0xFF handling bug in code_is_in_cclass_node(). + abort on /\S*/ =~ "\xfe" +2005/08/22: [impl] escape GCC 4.0 warnings for sample/*.c. +2005/08/22: [impl] fix testconvu.rb. +2005/08/22: [impl] escape GCC 4.0 warnings. + +2005/08/09: Version 3.8.7 + +2005/08/09: [test] success in ruby 1.9.0 (2005-08-09) [i686-linux]. +2005/08/09: [bug] (thanks Allan Odgaard) + should not call enc_len() for s == range + in onig_search(). +2005/08/01: [dist] add mkdir $prefix, mkdir $exec_prefix to make install. + +2005/07/27: Version 3.8.6 + +2005/07/27: [test] success in ruby 1.9.0 (2005-07-26) [i686-linux]. +2005/07/27: [impl] update onig-config.in. +2005/07/26: [new] (thanks Yen-Ju Chen) + add Oniguruma configuration check program. + (onig-config.in) + +2005/07/14: Version 3.8.5 + +2005/07/14: [test] success in ruby 1.9.0 (2005-07-14) [i686-linux]. +2005/07/11: [test] success in ruby 1.9.0 (2005-07-04) [i686-linux]. +2005/07/11: [bug] (thanks nobu) [ruby-dev:26505] + invalid handling for /\c\x/ and /\C-\x/. + fix fetch_escaped_value(). +2005/07/05: [impl] (thanks Alexey Zakhlestine) + escape GCC 4.0 warnings. + +2005/07/01: Version 3.8.4 + +2005/07/01: [test] success in ruby 1.9.0 (2005-07-01) [i686-linux]. +2005/06/30: [test] success in ruby 1.9.0 (2005-06-28) [i686-linux]. +2005/06/30: [dist] add GB 18030 test to sample/encode.c. +2005/06/30: [impl] escape warning of gb18030_left_adjust_char_head(). +2005/06/30: [new] (contributed by KUBO Takehiro) + add new character encoding ONIG_ENCODING_GB18030. +2005/06/30: [bug] invalid ctype check for multibyte encodings. + ("graph", "print") + fix onigenc_mb2/4_is_code_ctype(), + eucjp_is_code_ctype() and sjis_is_code_ctype(). +2005/06/30: [bug] invalid conversion from code point to mbc in + onigenc_mb4_code_to_mbc(). + +2005/06/28: Version 3.8.3 + +2005/06/28: [test] success in ruby 1.9.0 (2005-06-28) [i686-linux]. +2005/06/27: [test] success in ruby 1.9.0 (2005-05-31) [i686-linux]. +2005/06/27: [bug] (thanks Wolfgang Nadasi-Donner) + invalid check for never ending recursion. + lower zero quantifier should be treated as + a non-recursive call alternative. + ex. /(?<bal>[^()]*(\(\g<bal>\)[^()]*)*)/ +2005/06/15: [impl] add divide_ambig_string_node_sub(). +2005/06/15: [dist] add a test to sample/encode.c. +2005/06/10: [new] add ONIG_SYNTAX_PERL_NG. (Perl + named group) + +2005/06/01: Version 3.8.2 + +2005/06/01: [test] success in ruby 1.9.0 (2005-05-31) [i686-linux]. +2005/05/31: [dist] add doc/FAQ and doc/FAQ.ja. +2005/05/31: [impl] minor change in node_new(). +2005/05/30: [test] success in ruby 1.9.0 (2005-05-11) [i686-linux]. +2005/05/30: [bug] (thanks Allan Odgaard) + FreeNodeList null check should be on thread-atomic + in node_new(). + +2005/05/11: Version 3.8.1 + +2005/05/11: [test] success in ruby 1.9.0 (2005-05-11) [i386-mswin32]. +2005/05/11: [dist] update win32/Makefile (make 19). +2005/05/11: [test] success in ruby 1.9.0 (2005-05-11) [i686-linux]. +2005/05/06: [test] success in ruby 1.9.0 (2005-05-06) [i686-linux]. +2005/05/06: [impl] (thanks nobu) [ruby-core:4815] + add #ifdef USE_VARIABLE_META_CHARS to goto label. +2005/04/25: [test] success in ruby 1.9.0 (2005-04-25) [i686-linux]. +2005/04/25: [impl] change DEFAULT_WARN_FUNCTION and DEFAULT_VERB_WARN_FUNCTION + to onig_rb_warn() and onig_rb_warning(). + +2005/04/15: Version 3.8.0 + +2005/04/15: [test] success in ruby 1.9.0 (2005-04-14) [i686-linux]. +2005/04/01: [test] success in ruby 1.9.0 (2005-03-24) [i686-linux]. +2005/04/01: [impl] (thanks Joe Orton) + (thanks Moriyoshi Koizumi) + many const-ification to many *.[ch] files. + +2005/03/25: Version 3.7.2 + +2005/03/25: [test] success in ruby 1.9.0 (2005-03-24) [i686-linux]. +2005/03/23: [test] success in ruby 1.9.0 (2005-03-20) [i686-linux]. +2005/03/23: [test] success in ruby 1.9.0 (2005-03-08) [i686-linux]. +2005/03/23: [new] add ONIG_SYNTAX_ASIS. +2005/03/23: [new] add ONIG_SYN_OP2_INEFFECTIVE_ESCAPE. +2005/03/09: [spec] rename MBCTYPE_XXX to RE_MBCTYPE_XXX. (GNU API) +2005/03/08: [test] success in ruby 1.9.0 (2005-03-08) [i686-linux]. +2005/03/08: [impl] (thanks matz) [ruby-dev:25783] + should not allocate memory for key data in st.c. + move st_*_strend() functions from st.c. fixed some + potential memory leaks. + (imported from Ruby 1.9 2005-03-08) + +2005/03/07: Version 3.7.1 + +2005/03/07: [test] success in ruby 1.9.0 (2005-03-07) [i686-linux]. +2005/03/07: [impl] (thanks Rui Hirokawa) + add ONIG_ESCAPE_UCHAR_COLLISION. + rename UChar to OnigUChar in oniguruma.h. +2005/03/07: [impl] remove declarations for Ruby in oniggnu.h. +2005/03/05: [bug] ANCHOR_ANYCHAR_STAR didn't work in onig_search(). +2005/03/01: [dist] remove oniggnu.h from MANIFEST-RUBY. + remove oniggnu.h from make 19. +2005/03/01: [bug] (thanks matz) [ruby-dev:25778] + uninitialized member (OptEnv.backrefed_status) + was used. + +2005/02/19: Version 3.7.0 + +2005/02/19: [test] success in ruby 1.9.0 (2005-02-19) [i386-cygwin]. +2005/02/19: [new] (thanks Minero Aoki) + add onig_region_set(). +2005/02/19: [API] change onig_region_init() to extern. +2005/02/19: [dist] remove reggnu.c from MANIFEST-RUBY. + remove reggnu.c from make 19. +2005/02/19: [dist] update doc/API and doc/API.ja. +2005/02/19: [test] success in ruby 1.9.0 (2005-02-19) [i386-cygwin]. +2005/02/19: [impl] (thanks Alexey Zakhlestine) + change UChar* to const UChar* in oniguruma.h, + regenc.h and regparse.h. +2005/02/13: [impl] change UChar* to const UChar* in oniguruma.h and + onigposix.h and st.h. +2005/02/12: [test] success in ruby 1.9.0 (2005-02-11) [i386-cygwin]. +2005/02/12: [bug] (thanks nobu) [ruby-dev:25676] + type_cclass_hash() fix overrun. +2005/02/09: [test] success in ruby 1.9.0 (2005-02-09) [i686-linux]. +2005/02/09: [spec] add RE_OPTION_FIND_NOT_EMPTY etc.. to oniggnu.h. +2005/02/09: [dist] remove hash.c.patch. +2005/02/07: [impl] remove re_mbctab, mbctab_ascii etc... + (USE_COMPATIBILITY_FOR_RUBY_EXTENSION_LIBRARY) + +2005/02/04: Version 3.6.0 + +2005/02/04: [test] success in ruby 1.9.0 (2005-02-04) [i686-linux]. +2005/02/01: [bug] add key_free() call to st_free_table(). +2005/02/01: [new] add onig_get_default_ambig_flag() and + onig_set_default_ambig_flag(). +2005/02/01: [dist] update MANIFEST-RUBY. +2005/01/31: [test] success in ruby 1.9.0 (2005-01-29) [i686-linux]. +2005/01/31: [spec] remove ONIGENC_AMBIGUOUS_MATCH_COMPOUND + from ONIGENC_AMBIGUOUS_MATCH_DEFAULT. +2005/01/31: [dist] update Makefile.in (make 19). +2005/01/29: [memo] (thanks Kazuo Saito) + Oniguruma 3.5.4 was merged to Ruby 1.9.0. +2005/01/28: [impl] (thanks UK-taniyama) + add extern "C" { } directive to oniguruma.h, oniggnu.h + and onigposix.h for C++. +2005/01/25: [impl] remove nested function call for xxx_code_to_mbclen(). + (euc_kr.c, euc_tw.c, big5.c) + +2005/01/19: Version 3.5.4 + +2005/01/19: [test] success in ruby 1.9.0 (2005-01-05) [i686-linux]. +2005/01/19: [bug] (thanks Isao Sonobe) + callback function argument name_end of onig_foreach_name() + was wrong. + name key of name table should be null terminated for + character encoding length. + add strdup_with_null(), rename onig_strdup() to k_strdup(). + use e->name_len in i_names(). +2005/01/17: [impl] (thanks UK-taniyama) + add HAVE_SYS_TYPES_H to config.h.in. + +2005/01/13: Version 3.5.3 + +2005/01/13: [test] success in ruby 1.9.0 (2005-01-05) [i686-linux]. +2005/01/13: [bug] ignore case match bug. + ex. /s+/iu.match("SSSSS") ==> [4..5] + fix OP_EXACT1_IC, OP_EXACTN_IC process. +2005/01/13: [bug] (thanks Isao Sonobe) + ignore case match bug. + ex. /is/iu.match("ss") fail. + fix str_lower_case_match() etc. + +2005/01/05: Version 3.5.2 + +2005/01/05: [test] success in ruby 1.9.0 (2005-01-05) [i686-linux]. +2005/01/05: [test] success in ruby 1.9.0 (2004-12-16) [i686-linux]. +2005/01/05: [bug] (thanks Isao Sonobe) + ignore case match bug. + ex. /s+/iu.match("sssss") ==> [4..5] + fix OP_EXACT1_IC, OP_EXACTN_IC process. +2005/01/05: [bug] (thanks Isao Sonobe) + group name table should be renumbered. + add onig_renumber_name_table(). +2004/12/24: [dist] remove file onigcmpt200.h. + +2004/12/17: Version 3.5.1 + +2004/12/17: [dist] add INSTALL-RUBY to archive. +2004/12/16: [test] success in ruby 1.9.0 (2004-12-16) [i686-linux]. +2004/12/16: [dist] update hash.c.patch. +2004/12/15: [bug] (thanks matz) + char > 127 should be casted to unsigned char. (utf8.c) +2004/12/13: [impl] add HAVE_PROTOTYPES and HAVE_STDARG_PROTOTYPES definition + to oniguruma.h in the case __cplusplus. +2004/12/06: [dist] update doc/RE and doc/RE.ja. +2004/12/03: [impl] (thanks nobu) + st.h fix prototype for C++. + +2004/12/03: Version 3.5.0 + +2004/12/02: [test] success in ruby 1.9.0 (2004-12-02) [i686-linux]. +2004/12/01: [test] success in ruby 1.9.0 (2004-12-01) [i386-mswin32]. +2004/12/01: [dist] add make targets 19 and 19up to win32/Makefile. +2004/12/01: [test] success in ruby 1.9.0 (2004-12-01) [i386-cygwin]. +2004/12/01: [test] success in ruby 1.9.0 (2004-12-01) [i686-linux]. +2004/12/01: [impl] double cast for escape warning in Cygwin. + (HashDataType* )((void* )(&e)) in regparse.c +2004/12/01: [test] success in ruby 1.9.0 (2004-11-30) [i686-linux]. +2004/12/01: [tune] change implementation of clear_opt_map_info(). + (which was 10-16% cost in gprof result for my test program) +2004/12/01: [dist] remove regex.c from distribution files. +2004/11/30: [memo] remove targets 16 and 18 from Makefile.in. +2004/11/30: [test] success in ruby 1.9.0 (2004-11-30) [i686-linux]. +2004/11/30: [inst] add "cp -p st.[ch] st.[ch].ruby_orig" to "make 19". +2004/11/30: [tune] map_position_value() return 20 if code is 0 + and minimum enclen > 1. +2004/11/30: [test] success in ruby 1.9.0 (2004-11-29) [i686-linux]. +2004/11/30: [impl] minor changes for multi-thread in regexec.c and regcomp.c. +2004/11/30: [impl] change THREAD_PASS_LIMIT_COUNT value from 10 to 8. +2004/11/30: [impl] add THREAD_ATOMIC_XXX to FreeNodeList access in regparse.c +2004/11/29: [impl] add USE_MULTI_THREAD_SYSTEM. +2004/11/29: [memo] add hash.c.patch to CVS. +2004/11/29: [dist] change mail address to 'sndgk393 AT ...' +2004/11/29: [dist] add -s option (silent mode) to test.rb. +2004/11/29: [tune] change THRESHOLD_RANGE_NUM_FOR_SHARE_CCLASS value + from 20 to 8. +2004/11/29: [inst] add make target "19up". +2004/11/29: [dist] change Oniguruma Home Page URL. +2004/11/29: [impl] remove onig_is_in_code_range_array(). +2004/11/29: [dist] fix doc/RE and RE.ja (character types). +2004/11/26: [dist] fix win32/Makefile. +2004/11/26: [dist] fix doc/RE and RE.ja (multibyte character types). +2004/11/26: [impl] add onig_free_shared_cclass_table(). +2004/11/26: [impl] move definition USE_UNICODE_FULL_RANGE_CTYPE to regenc.h. +2004/11/26: [impl] add opcode OP_CCLASS_NODE. +2004/11/26: [impl] move definition of CClassNode to regint.h. +2004/11/26: [impl] add type PointerType in regint.h. +2004/11/25: [impl] remove ONIGENC_CTYPE_MOD_NOT. +2004/11/25: [impl] rename onig_node_new_cclass_by_codepoint_range to + node_new_cclass_by_codepoint_range. +2004/11/25: [impl] remove get_type_cc_node method from OnigEncodingType. +2004/11/25: [impl] move implementation of shared char-class from enc/*.c + to regparse.c. +2004/11/25: [dist] add hash.c.patch for Ruby 1.9 hash.c change. +2004/11/22: [impl] change utf8_get_type_node(). +2004/11/22: [impl] add ONIGENC_CTYPE_MOD_NOT. +2004/11/22: [bug] (thanks MIYAMUKO Katsuyuki) + ruby make test fail in HP-UX B.11.23 ia64. + should use tok->u.code instead of tok->u.c in + the case of TK_CODE_POINT. +2004/11/19: [bug] (thanks Yoshida Masato) + invalid multibyte code causes segmentation fault. + ex. /[\xFF-\xFF]/u +2004/11/19: [bug] (thanks Yoshida Masato) + illegal check in char-class range in UTF-8. + ex. s = "[\xC2\xA0-\xC3\xBE]" + p(Regexp.new(s, nil, "u") =~ "\xC3\xBE") +2004/11/18: [impl] add onig_node_new_cclass_by_codepoint_range(). +2004/11/18: [impl] remove OnigCodePointRange type. (use OnigCodePoint[].) +2004/11/17: [bug] (thanks nobu) + abort in "a".gsub(/a\Z/, "") + fix ONIGENC_STEP_BACK() argument in onig_search(). +2004/11/16: [impl] add key2 member to st_table_entry in st.[ch]. + change API of st for non-null terminated string key. +2004/11/16: [impl] add get_type_cc_node method to OnigEncodingType. +2004/11/15: [impl] add st.h and st.c from Ruby 1.9. + use st-hash always. +2004/11/12: [impl] change member 'not' of CClassNode to 'flags'. + add flags FLAG_CCLASS_NOT and FLAG_CCLASS_SHARE. +2004/11/12: [impl] add onig_is_in_code_range_array() to enc/unicode.c. +2004/11/12: [impl] fix CRWord in enc/unicode.c and MBWord in enc/utf8.c. +2004/11/11: [bug] fix enc/utf8.c. + size 0 array initializer was compile error in VC++. +2004/11/09: [inst] (thanks Hiroki YAGITA) + change installed file mode to 0644. +2004/11/09: [bug] (thanks UK-taniyama) + wrong definitions GET_RELADDR_INC(), GET_ABSADDR_INC() + etc... (NOT PLATFORM_UNALIGNED_WORD_ACCESS) +2004/11/09: [impl] type cast in regexec() for remove compile time warning. + (WIN32, regposix.c) +2004/11/08: [spec] fix Unicode character types. + 0x00ad (soft hyphen) should be [:cntrl:] and [:space:] type. + [0x0009..0x000d], 0x0085 should be [:print:] type. + 0x00ad should not be [:punct:] type. +2004/11/08: [inst] fix Makefile.in. (for make ctest/ptest/testcu) +2004/11/06: [impl] (thanks Kazuo Saito) + too many alternatives pattern causes core dump. + change implementation of onig_node_free(). +2004/11/05: [spec] rename ONIGERR_END_PATTERN_AT_BACKSLASH to + ONIGERR_END_PATTERN_AT_ESCAPE. +2004/11/05: [impl] (thanks matz) + escape compile time warnings for x86-64 Linux. + StackIndex type int -> long +2004/11/05: [memo] (thanks Kazuo Saito) + Oniguruma 3.4.0 was merged to Ruby 1.9.0. + +2004/10/30: Version 3.4.0 + +2004/10/30: [test] success in ruby 1.9.0 (2004-09-24) [i686-linux]. +2004/10/30: [new] add hexadecimal digit char type. (\h, \H) + syntax: ONIG_SYN_OP2_ESC_H_XDIGIT +2004/10/30: [bug] (thanks Guy Decoux) + reluctant infinite repeat bug. + ex. /^[a-z]{2,}?$/.match("aaa") fail. + fix OP_REPEAT_INC_NG process in match_at(). + +2004/10/18: Version 3.3.1 + +2004/10/18: [test] success in ruby 1.9.0 (2004-09-24) [i686-linux]. +2004/10/18: [impl] (thanks Imai Yasumasa) + enclose #include <sys/types.h> by #ifndef __BORLANDC__. +2004/10/18: [bug] (thanks Imai Yasumasa) + memory access violation in select_opt_exact_info(). +2004/09/25: [dist] fix doc/API and doc/API.ja. +2004/09/25: [bug] fix OP_SEMI_END_BUF process in match_at() for + the case USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE + is not defined. + +2004/09/17: Version 3.3.0 + +2004/09/17: [dist] add COPYING to program source files. +2004/09/17: [test] success in ruby 1.9.0 (2004-07-23) [i686-linux]. +2004/09/17: [bug] (thanks Isao Sonobe) + memory access violations in xxx_mbc_enc_len(), + and xxx_mbc_to_normalize() and + xxx_left_adjust_char_head(). + add string range check in match_at() and onig_search(). +2004/09/08: [dist] change mail address format.(kosako AT sofnec ...) + +2004/09/04: Version 3.2.9 + +2004/09/04: [test] success in ruby 1.9.0 (2004-07-23) [i686-linux]. +2004/09/04: [bug] (thanks Bob Kerstetter and Richard Koch) + search fail in ignore case mode. + fix str_lower_case_match(). +2004/09/04: [inst] (thanks Isao Sonobe) + clear sample directory in 'make clean'. +2004/09/04: [bug] fix ONIGENC_AMBIGUOUS_MATCH_COMPOUND/ASCII/NONASCII + meanings in XXXXX_mbc_to_normalize() and + XXXXX_is_mbc_ambiguous(). +2004/08/28: [bug] fix ONIGENC_AMBIGUOUS_MATCH_COMPOUND/ASCII/NONASCII + meanings in iso_8859_XX_mbc_to_normalize() and + iso_8859_XX_is_mbc_ambiguous(). + +2004/08/24: Version 3.2.8 + +2004/08/24: [test] success in ruby 1.9.0 (2004-07-23) [i686-linux]. +2004/08/24: [spec] add ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY. + /a{n}?/ == /(?:a{n})?/ +2004/08/24: [dist] fix doc/RE and doc/RE.ja. +2004/08/24: [bug] (thanks starfish) + memory leak in set_optimize_exact_info(). + +2004/08/21: Version 3.2.7 + +2004/08/21: [test] success in ruby 1.8.2 (2004-07-28) [i686-linux]. + (1.8.2 preview2) +2004/08/21: [test] success in ruby 1.9.0 (2004-07-23) [i686-linux]. +2004/08/21: [bug] (thanks Isao Sonobe) (thanks kage) + memory access violation in bm_search_notrev(). + (forgotten to merge from 2.X) + +2004/07/24: Version 3.2.6 + +2004/07/24: [test] success in ruby 1.9.0 (2004-07-23) [i686-linux]. +2004/07/24: [test] success in ruby 1.8.2 (2004-07-16) [i686-linux]. +2004/07/24: [bug] fix warnings for regexec.c. (gcc 2.91.66) +2004/07/24: [memo] change version control system from Subversion + to CVS 1.11.17. +2004/07/20: [bug] (thanks Isao Sonobe) + illegal result in negative character class in ignore case + mode. fix pair-ambig-codes process in parse_exp(). + ex. /[^a]/i.match("A") +2004/07/20: [bug] (thanks Isao Sonobe) + undefined bytecode error happens in UTF-16BE etc.. + compile_length_cclass_node() was not consistent with + compile_cclass_node(). + +2004/07/01: Version 3.2.5 + +2004/07/01: [test] success in ruby 1.8.2 (2004-06-23) [i686-linux]. +2004/07/01: [new] add onig_get_syntax_{op,op2,behavior,options}. +2004/07/01: [bug] (thanks Isao Sonobe) + invalid result in onig_capture_tree_traverse(). + fix make_capture_history_tree(). + +2004/06/29: Version 3.2.4 + +2004/06/29: [test] success in ruby 1.8.2 (2004-06-23) [i686-linux]. +2004/06/29: [new] (thanks Isao Sonobe) + add onig_number_of_captures(). + +2004/06/25: Version 3.2.3 + +2004/06/25: [test] success in ruby 1.8.2 (2004-06-23) [i686-linux]. +2004/06/25: [bug] (thanks Isao Sonobe) + invalid result in onig_capture_tree_traverse(). + fix make_capture_history_tree(). + +2004/06/24: Version 3.2.2 + +2004/06/24: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin]. +2004/06/24: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32]. +2004/06/24: [test] success in ruby 1.8.2 (2004-06-23) [i686-linux]. +2004/06/24: [new] (thanks Isao Sonobe) + add onig_number_of_capture_histories(). +2004/06/24: [bug] (thanks Isao Sonobe) + invalid char position match in UTF-16 and UTF-32. + add onigenc_always_false_is_allowed_reverse_match(). + +2004/06/17: Version 3.2.1 + +2004/06/17: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin]. +2004/06/17: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32]. +2004/06/17: [test] success in ruby 1.8.2 (2004-05-18) [i686-linux]. +2004/06/17: [impl] should not use OP_REPEAT for (...)? even if target size + is long. +2004/06/17: [bug] (thanks nobu) [ruby-dev:23703] + should use STACK_AT() instead of stkp in OP_REPEAT_INC. + add IN_VAR_REPEAT flag in setup_tree(). +2004/06/16: [impl] change select_opt_exact_info() to use ByteValTable[]. +2004/06/16: [impl] change map_position_value() table values. +2004/06/14: [impl] (thanks John Carter) + RelAddrType, AbsAddrType and LengthType change + from short int to int type for the very long string match. +2004/06/14: [bug] (thanks Greg A. Woods) + fix nmatch argument of regexec() is smaller than + reg->num_mem + 1 case. (POSIX API) +2004/06/14: [spec] (thanks Greg A. Woods) + set pmatch to NULL if nmatch is 0 in regexec(). (POSIX API) + +2004/06/10: Version 3.2.0 + +2004/06/10: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin]. +2004/06/10: [test] success in ruby 1.9.0 (2004-05-27) [i386-mswin32]. +2004/06/10: [test] success in ruby 1.8.2 (2004-05-18) [i686-linux]. +2004/06/10: [dist] add README.ja. +2004/06/10: [new] add onig_copy_encoding(). +2004/06/10: [API] add encoding argument to onig_set_meta_char(). + add meta_char_table member to OnigEncodingType. +2004/06/08: [dist] add doc/API.ja. +2004/06/07: [API] add num_of_elements member to OnigCompileInfo. +2004/05/29: [memo] (thanks Kazuo Saito) + Oniguruma 3.1.0 was merged to Ruby 1.9.0. +2004/05/26: [impl] rename NST_SIMPLE_REPEAT to NST_STOP_BT_SIMPLE_REPEAT. +2004/05/26: [impl] doesn't need to check that target's simple repeat-ness + for EFFECT_MEMORY type node in setup_tree(). + +2004/05/25: Version 3.1.0 + +2004/05/25: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32]. +2004/05/25: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin]. +2004/05/25: [test] success in ruby 1.9.0 (2004-05-23) [i686-linux]. +2004/05/25: [test] success in ruby 1.8.2 (2004-05-18) [i686-linux]. +2004/05/25: [bug] (thanks Masahiro Sakai) [ruby-dev:23560] + ruby -ruri -ve 'URI::ABS_URI =~ + "http://example.org/Andr\xC3\xA9"' + nested STK_REPEAT type stack can't backtrack repeat_stk[]. + add OP_REPEAT_INC_SG and OP_REPEAT_INC_NG_SG. +2004/05/25: [new] support UTF-32LE. (ONIG_ENCODING_UTF32_LE) +2004/05/25: [new] support UTF-32BE. (ONIG_ENCODING_UTF32_BE) +2004/05/24: [impl] divide enc/utf16.c to utf16_be.c and utf16_le.c. +2004/05/24: [impl] add enc/unicode.c. +2004/05/24: [API] change calling sequences of onig_new_deluxe() and + onig_recompile_deluxe(). + define OnigCompileInfo type. +2004/05/21: [impl] perform ensure process for rb_trap_exec() in match_at(). + add onig_exec_trap() and CHECK_INTERRUPT_IN_MATCH_AT. +2004/05/21: [impl] add regex status check to onig_match(). +2004/05/21: [new] add onig_get_capture_tree() and + onig_capture_tree_traverse(). +2004/05/20: [spec] (thanks Isao Sonobe) + capture history return capture data tree. + (see sample/listcap.c) +2004/05/19: [bug] (thanks Simon Strandgaard) + Control-C does not work in matching process on Ruby. + add calling of CHECK_INTERRUPT into match_at(). + ex. /<(?:[^">]+|"[^"]*")+>/.match('<META http-equiv= \ + "Content-Type content="text/html; charset=iso-8859-1">') +2004/05/19: [bug] (thanks Simon Strandgaard) + define virtual codepoint values for invalid encoding + byte 0xfe and 0xff in UTF-8. + ex. /\w+/u.match("%a\xffb\xfec%") ==> "a" +2004/05/19: [spec] (thanks Simon Strandgaard) + too big backref number should be treated as a sequence of + an octal char and number digits. + ex. /b\3777\c/.match("b\3777\c") +2004/05/17: [spec] rename encoding names "UTF-16 BE" and "UTF-16 LE" + to "UTF-16BE" and "UTF-16LE". +2004/05/17: [impl] move ismbchar() and mbclen() from oniguruma.h to oniggnu.h. +2004/05/17: [impl] rename onigenc_single_byte_is_allowed_reverse_match() to + onigenc_always_true_is_allowed_reverse_match(). + +2004/05/14: Version 3.0.0 + +2004/05/14: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin]. +2004/05/14: [test] success in ruby 1.9.0 (2004-05-14) [i686-linux]. +2004/05/14: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32]. + (* need to edit parse.y: + register int c; ---> int c; in yylex()) +2004/05/14: [impl] add regext.c. +2004/05/14: [spec] KOI8 is not included in library archive by default setup. +2004/05/14: [impl] implementation changes are completed for all encoding files. +2004/05/12: [impl] add divide_ambig_string_node(). + ambiguous string is divided and normalized before + optimization and compilation process. +2004/05/11: [dist] remove INSTALL-RUBY from distribution. +2004/04/28: [memo] (thanks Kazuo Saito) + Oniguruma 2.2.8 was merged to Ruby 1.9.0. +2004/04/26: [spec] change value DEFAULT_MATCH_STACK_LIMIT_SIZE = 0 : unlimited +2004/04/26: [new] add onig_get_match_stack_limit_size() and + onig_set_match_stack_limit_size(). +2004/04/26: [bug] add error check to re.c.181.patch and re.c.168.patch. +2004/04/23: [impl] remove ctype_support_level from OnigEncodingType. +2004/04/22: [spec] allow the range from single byte char to multibyte char in + character class for implementation reason. + ex. /[a-\xbb\xcc]/ in EUC-JP encoding. +2004/04/21: [impl] remove max_enc_len_by_first_byte() from OnigEncodingType. +2004/04/20: [new] add onig_copyright(). +2004/04/20: [impl] add regversion.c. +2004/04/15: [new] add onig_get_ambig_flag(). +2004/04/14: [bug] (thanks Isao Sonobe) + undefined bytecode error happens if ONIG_OPTION_FIND_LONGEST + is set. + should finish matching process if find-condition + is fail at OP_END in match_at(). +2004/04/12: [impl] add ambig_flag to regex_t. +2004/04/09: [impl] move onig_set_meta_char() to regsyntax.c. +2004/04/09: [bug] (thanks HIROSE Masaaki) fix onig_version(). +2004/04/08: [impl] add regsyntax.c. +2004/04/07: [new] support UTF-16 LE. (ONIG_ENCODING_UTF16_LE) +2004/04/05: [impl] add ONIGENC_CTYPE_NEWLINE. +2004/04/05: [memo] (thanks Kazuo Saito) + Oniguruma 2.2.6 was merged to Ruby 1.9.0. +2004/04/02: [memo] Version 2.2.6 was released. +2004/03/26: [new] support UTF-16 BE. (ONIG_ENCODING_UTF16_BE) +2004/03/25: [spec] support non 8-bit encodings. +2004/03/16: [memo] 2.X branch for 8-bit encodings only. + +2004/03/16: Version 2.2.5 + +2004/03/16: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32]. +2004/03/16: [test] success in ruby 1.9.0 (2004-02-24) [i686-linux]. +2004/03/16: [impl] add property name to error message of + ONIGERR_INVALID_CHAR_PROPERTY_NAME. +2004/03/16: [spec] allow prefix 'Is' for \p{...} in ONIG_SYNTAX_PERL. + add syntax op. ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS. +2004/03/15: [dist] add sample/syntax.c. +2004/03/15: [spec] support NOT op. in char property. \p{^...}, \P{^...}. + add syntax op. ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT. +2004/03/15: [spec] rename ONIG_SYN_OP2_ESC_P_CHAR_PROPERTY to + ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY. +2004/03/10: [impl] move ONIGERR_XXX from regenc.h to oniguruma.h, + rename ONIGERR_XXX to ONIGENCERR_XXX in regenc.h. +2004/03/08: [impl] (thanks eban) + replace defined(__CYGWIN__) to defined(__GNUC__). +2004/03/08: [bug] (thanks eban) [ruby-dev:23172] + need to separate initialization for bcc32. +2004/03/06: [memo] (thanks Kazuo Saito) + Oniguruma 2.2.4 was merged to Ruby 1.9.0. +2004/03/05: [API] change second argument type of onig_set_meta_char() + from unsigned int to OnigCodePoint. +2004/03/05: [dist] (thanks Kazuo Saito) + add MANIFEST-RUBY. + +2004/03/04: Version 2.2.4 + +2004/03/04: [impl] (thanks Moriyoshi Koizumi) + fix many warnings in Win32 VC++ with /W3 option. + +2004/03/02: Version 2.2.3 + +2004/03/02: [bug] (thanks Isao Sonobe) + return invalid capture region value if capture history + is used. (OP_MEMORY_END_PUSH_REC bug) + ex. /\g<p>(?@<p>\(\g<s>\)){0}(?<s>(?:\g<p>)*|){0}/ + .match("((())())") +2004/03/02: [impl] (thanks Kazuo Saito) + add :nodoc: to onig_stat_print() for RDoc. +2004/03/02: [impl] don't use ONIG_SOURCE_IS_WRAPPED. + +2004/02/27: Version 2.2.2 + +2004/02/27: [impl] fix the position of onig_stat_print(). +2004/02/27: [impl] define ONIG_RUBY_DEFINE_GLOBAL_FUNCTION() in regint.h + for ignored by RDoc. + +2004/02/26: Version 2.2.1 + +2004/02/26: [bug] [bugs.php.net:#26677] (thanks behrens) + invalid definition at onig_error_code_to_str() + in the case of NOT HAVE_STDARG_PROTOTYPES. + +2004/02/25: Version 2.2.0 + +2004/02/25: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32]. +2004/02/24: [test] success in ruby 1.9.0 (2004-02-24) [i686-linux]. +2004/02/24: [bug] undefined IS_BLANK() and IS_GRAPH() was used in + onigenc_is_code_ctype() in the case of Ruby M17N. +2004/02/24: [new] support ISO-8859-16. (ONIG_ENCODING_ISO_8859_16) +2004/02/24: [bug] should not fold match for 0xdf in iso8859_6.c. +2004/02/24: [new] support ISO-8859-14. (ONIG_ENCODING_ISO_8859_14) +2004/02/23: [new] support ISO-8859-13. (ONIG_ENCODING_ISO_8859_13) +2004/02/23: [new] support ISO-8859-10. (ONIG_ENCODING_ISO_8859_10) +2004/02/20: [bug] fix iso_8859_4_mbc_is_case_ambig(). +2004/02/20: [new] support ISO-8859-9. (ONIG_ENCODING_ISO_8859_9) +2004/02/19: [bug] correct ctype tables for ISO-8859-3, ISO-8859-4, + ISO-8859-6, ISO-8859-7, ISO-8859-8, KOI8_R. +2004/02/18: [bug] wrong replaced name OnigSyntaxGnuOnigex. +2004/02/17: [spec] check capture status for empty infinite loop. + [ruby-dev:20224] etc... + ex. /(?:\1a|())*/.match("a"), + /(?:()|()|()|(x)|()|())*\2b\5/.match("b") + add USE_INFINITE_REPEAT_MONOMANIAC_MEM_STATUS_CHECK. + add OP_NULL_CHECK_END_MEMST, OP_NULL_CHECK_END_MEMST_PUSH. + add stack type STK_NULL_CHECK_END. +2004/02/13: [impl] add OnigEncodingEUC_CN to enc/euc_kr.c. +2004/02/13: [bug] (thanks Simon Strandgaard) + parsing of nested repeat was invalid. + ex. /ab{2,3}*/ was /(?:a(?:b{2,3}))*/, + should be /a(?:b{2,3}*)/ +2004/02/12: [bug] (thanks Simon Strandgaard) + OP_REPEAT_INC_NG process in match_at() is wrong. + ex. bad match /a.{0,2}?a/ =~ "0aXXXa0" +2004/02/12: [bug] (thanks Simon Strandgaard) + wrong fetch after (?x) option. ex. "(?x)\ta .\n+b" +2004/02/12: [bug] (thanks Simon Strandgaard) + [\^] is not a empty char class. +2004/02/09: [new] add onig_set_syntax_op(), onig_set_syntax_op2(), + onig_set_syntax_behavior(), onig_set_syntax_options(). +2004/02/06: [dist] add a new target 'site' to Makefile.in. +2004/02/06: [dist] add index.html. +2004/02/03: [bug] oniggnu.h was not installed by 'make install'. + +2004/02/02: Version 2.1.0 + +2004/02/02: [test] success in ruby 1.9.0 (2004-02-02) [i686-linux]. +2004/02/02: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin]. +2004/02/02: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32]. +2004/02/02: [new] support ISO-8859-11. (ONIG_ENCODING_ISO_8859_11) +2004/02/02: [new] support ISO-8859-5. (ONIG_ENCODING_ISO_8859_5) +2004/02/02: [impl] should check single byte encoding or not in and_cclass() + and or_cclass(). +2004/01/30: [dist] add oniggnu.h. +2004/01/30: [bug] ISO-8859-7 0xb7 (middle dot) is Punct type. +2004/01/30: [new] support ISO-8859-8. (ONIG_ENCODING_ISO_8859_8) +2004/01/29: [new] support ISO-8859-7. (ONIG_ENCODING_ISO_8859_7) +2004/01/29: [new] support ISO-8859-6. (ONIG_ENCODING_ISO_8859_6) +2004/01/28: [new] support KOI8-R. (ONIG_ENCODING_KOI8_R) +2004/01/28: [new] support KOI8. (ONIG_ENCODING_KOI8) +2004/01/27: [dist] rename enc/isotable.c to enc/mktable.c. +2004/01/27: [new] support ISO-8859-4. (ONIG_ENCODING_ISO_8859_4) +2004/01/26: [new] support ISO-8859-3. (ONIG_ENCODING_ISO_8859_3) +2004/01/26: [bug] EncISO_8859_{1,15}_CtypeTable[256] was wrong. + (0x80 - 0xff is not ASCII) +2004/01/23: [new] support ISO-8859-2. (ONIG_ENCODING_ISO_8859_2) +2004/01/23: [dist] add enc/isotable.c. +2004/01/22: [new] support EUC-TW. (ONIG_ENCODING_EUC_TW) +2004/01/22: [bug] definition of GET_ALIGNMENT_PAD_SIZE() and + ALIGNMENT_RIGHT() was wrong. + type casting should be unsigned int, not int. +2004/01/22: [impl] add defined(__x86_64) || defined(__x86_64__) + to unaligned word access condition. (AMD64 ?) +2004/01/21: [dist] rename enc/eucjp.c to enc/euc_jp.c. +2004/01/21: [new] support EUC-KR. (ONIG_ENCODING_EUC_KR) +2004/01/20: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin]. +2004/01/20: [dist] change Makefile.in. +2004/01/20: [spec] add \p{...}, \P{...} in char class. +2004/01/20: [new] character property operators \p{...}, \P{...}. + supported in ONIG_SYNTAX_JAVA and ONIG_SYNTAX_PERL. +2004/01/19: [spec] allow /a{,n}/ as /a{0,n}/. (but don't allow /a{,}/) +2004/01/19: [dist] rename onigcomp200.h to onigcmpt200.h. +2004/01/19: [dist] update re.c.168.patch. svn add re.c.181.patch. +2004/01/16: [dist] update sample/*.c for new API. +2004/01/16: [dist] add onigcomp200.h. (for old API compatibility) +2004/01/16: [dist] update documents API, RE and RE.ja. +2004/01/16: [spec] change prefix REG_ -> ONIG_, regex_ onig_, + ENC_ -> ONIGENC, enc_ -> onigenc_. +2004/01/15: [impl] rename ENC_IS_MBC_E_WORD() to ENC_IS_MBC_WORD(). + rename ENC_CTYPE_SUPPORT_LEVEL_SB_ONLY to + ENC_CTYPE_SUPPORT_LEVEL_SB. +2004/01/14: [impl] rename UNALIGNED_WORD_ACCESS to + PLATFORM_UNALIGNED_WORD_ACCESS. +2004/01/14: [impl] change MATCH_STACK_LIMIT_SIZE value from 200000 to 500000. +2004/01/13: [impl] remove ENC_CODE_TO_MBC_FIRST(enc,code) in regenc.h. + remove code_to_mbc_first member in RegCharEncodingType. +2004/01/13: [impl] remove head byte bitset information in cclass->mbuf. +2003/12/26: [impl] change macro name ismb_xxxx() in enc/*.c for + escape conflict. + +2003/12/24: Version 2.0.0 + +2003/12/24: [spec] ignore case option is effective to numbered char. + ex. /\x61/i =~ "A" +2003/12/24: [test] success in ruby 1.8.1 (2003-12-24) [i686-linux]. +2003/12/24: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin]. +2003/12/24: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32]. +2003/12/24: [test] success in regex.c compile test on ruby-m17n. + (but can't make miniruby because re.c patch fail.) +2003/12/24: [bug] (thanks H.Miyamoto) /[\W]/ was wrong in 1.9.5. +2003/12/22: [spec] implement fold match on UTF-8 encoding. +2003/12/19: [impl] add ctype_support_level and ctype_add_codes() member to + RegCharEncoding type. +2003/12/19: [impl] add add_ctype_to_cc() in regparse.c. +2003/12/19: [impl] add enc_is_code_ctype() in REG_RUBY_M17N case. +2003/12/19: [impl] change ENC_CODE_TO_MBC() interface. +2003/12/18: [new] implement fold match. (variable number of char + match in ignore case mode.) + ex. German alphabet ess-tsett(U+00DF) match "SS" and "ss". +2003/12/17: [impl] refactoring of encoding system. +2003/12/17: [impl] add enc_init() in regenc.c. +2003/12/17: [new] support Big5. (REG_ENCODING_BIG5) +2003/12/16: [impl] change CodePoint from unsigned int to unsigned long. +2003/12/16: [new] support ISO 8859-15. (REG_ENCODING_ISO_8859_15) +2003/12/16: [impl] change P_() macro definition condition for Win32. +2003/12/16: [dist] add sample/encode.c +2003/12/16: [new] support ISO 8859-1. (REG_ENCODING_ISO_8859_1) +2003/12/15: [impl] rename IS_ENC_XXXX to ENC_IS_XXXX. +2003/12/15: [impl] rename RegDefaultCharEncoding to EncDefaultCharEncoding. +2003/12/15: [impl] divide encoding files. (enc/ascii.c, enc/utf8.c etc...) +2003/12/15: [bug] unexpected infinite loop in regex_snprintf_with_pattern(). + change local var. type char* to UChar*. +2003/12/15: [impl] remove REG_MBLEN_TABLE[]. +2003/12/15: [spec] rename function prefix regex_get_prev_char_head(), + regex_get_left_adjust_char_head() and + regex_get_right_adjust_char_head() to enc_xxxxxx(). +2003/12/15: [impl] rename function prefixes in regenc.h from regex_ to enc_. +2003/12/12: [impl] remove USE_SBMB_CLASS. +2003/12/12: [impl] rename mb -> mbc, mblen() to enc_len(). +2003/12/12: [impl] rename WCINT to CodePoint. +2003/12/11: [impl] delete IS_XXXX() ctype macros from regint.h. +2003/12/11: [impl] add enc->wc_is_ctype() and RegAsciiCtypeTable[256]. +2003/12/11: [impl] remove RegAsciiCaseAmbigTable. +2003/12/10: [impl] use ENC_TO_LOWER() for ignore case comparison. +2003/12/08: [impl] *** re-defined RegCharEncoding in oniguruma.h. *** +2003/12/08: [impl] add USE_POSIX_REGION_OPTION to regint.h. +2003/12/08: [impl] add IS_ENC_WORD() to regenc.h. +2003/12/05: [impl] rename IS_CODE_XXXX() to IS_ENC_XXXX(). +2003/12/05: [impl] delete IS_CODE_WORD() from regenc.h. +2003/12/04: [spec] rename REG_SYN_OP_BACK_REF to REG_SYN_OP_DECIMAL_BACKREF. +2003/12/04: [spec] add (REG_SYN_OP_ESC_W_WORD | REG_SYN_OP_ESC_B_WORD_BOUND | + REG_SYN_OP_ESC_LTGT_WORD_BEGIN_END | REG_SYN_OP_BACK_REF) + to RegSyntaxGrep. +2003/12/04: [spec] remove REG_ENCODING_DEFAULT and REGCODE_DEFAULT. +2003/12/04: [spec] move declarations of regex_get_default_encoding() and + regex_set_default_encoding() from oniguruma.h to regenc.h. +2003/12/03: [new] add regex_get_default_encoding() and + regex_set_default_encoding(). +2003/12/03: [spec] REG_ENCODING_DEFAULT meaning is changed. + (current default value, not initial default value.) +2003/12/03: [spec] REGCODE_XXX is obsoleted. use REG_ENCODING_XXX. +2003/12/02: [memo] alias svnst='svn status | grep -v "^\?"' +2003/12/02: [spec] move regex_set_default_trans_table() declaration + from oniguruma.h to regenc.h. (obsoleted API) +2003/12/02: [impl] move variables RegDefaultCharEncoding, DefaultTransTable and + AmbiguityTable to regenc.c. +2003/12/01: [impl] add regex_continuous_sbmb() to regenc.c. +2003/12/01: [dist] add regenc.h and regenc.c. +2003/11/18: [dist] change testconv.rb. +2003/11/18: [bug] (thanks Masaru Tsuda) + memory leak in parse_subexp(). +2003/11/18: [bug] (thanks Masaru Tsuda) + memory leak in names_clear() and parse_char_class(). +2003/11/17: [bug] memory leak in parse_char_class(). +2003/11/17: [bug] (thanks Masaru Tsuda) + OptExactInfo length should not over OPT_EXACT_MAXLEN. + (concat_opt_exact_info_str()) + +2003/11/12: Version 1.9.5 + +2003/11/12: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin]. +2003/11/12: [test] success in ruby 1.8.1 (2003-11-11) [i686-linux]. +2003/11/12: [spec] add definition of REG_INEFFECTIVE_META_CHAR. +2003/11/11: [dist] add a sample program sample/sql.c. +2003/11/11: [new] add variable meta character. + regex_set_meta_char() +2003/11/11: [spec] add syntax op. REG_SYN_OP_VARIABLE_META_CHARS. +2003/11/11: [spec] rename REG_SYN_OP_ESC_CAPITAL_Q_QUOTE to + REG_SYN_OP2_ESC_CAPITAL_Q_QUOTE, + REG_SYN_OP_QMARK_GROUP_EFFECT to + REG_SYN_OP2_QMARK_GROUP_EFFECT. +2003/11/06: [impl] define THREAD_PASS as rb_thread_schedule() in Ruby mode. +2003/11/05: [spec] add syntax behavior REG_SYN_WARN_REDUNDANT_NESTED_REPEAT. +2003/11/05: [spec] rename REG_SYN_WARN_FOR_CC_OP_NOT_ESCAPED to + REG_SYN_WARN_CC_OP_NOT_ESCAPED. +2003/11/04: [new] add regex_set_warn_func() and regex_set_verb_warn_func(). +2003/10/30: [new] add regex_name_to_backref_number(). + (for multiplex definition name, see sample/names.c) +2003/10/30: [spec] add name_end and reg argument to callback function of + regex_foreach_name(). (see sample/names.c) +2003/10/29: [spec] add syntax behavior REG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME. + add error code REGERR_MULTIPLEX_DEFINED_NAME. +2003/10/14: [dist] modify sample/simple.c. +2003/10/03: [bug] (thanks nobu) [ruby-dev:21472] + sub-anchor of optimization map info was wrong + in concat_left_node_opt_info(). + ex. /^(x?y)/ = "xy" fail. + +2003/09/17: Version 1.9.4 + +2003/09/17: [spec] change specification of char-class range in ignore case mode + follows with Ruby 1.8(2003-09-17). + ex. /[H-c]/i ==> (H-Z, 0x5b-0x60, a-c)/i + ==> H-Z, h-z, 0x5b-0x60, a-c, A-C +2003/09/16: [bug] (thanks Guy Decoux) + remove env->option == option check in parse_effect(). + change env->option for dynamic option in parse_exp(). + (ex. bad match /(?i)(?-i)a/ =~ "A") +2003/09/12: [spec] rename REG_SYN_ALLOW_RANGE_OP_IN_CC to + REG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC, + REG_SYN_ESCAPE_IN_CC to REG_SYN_BACKSLASH_ESCAPE_IN_CC. +2003/09/11: [bug] change to IS_SYNTAX_OP2 at REG_SYN_OP2_ESC_GNU_BUF_ANCHOR. +2003/09/09: [spec] rename REG_SYN_OP2_ESC_M_BAR_META to + REG_SYN_OP2_ESC_CAPITAL_M_BAR_META, + REG_SYN_OP_ESC_Q_QUOTE to REG_SYN_OP_ESC_CAPITAL_Q_QUOTE, + REG_SYN_OP_ESC_SUBEXP to REG_SYN_OP_ESC_LPAREN_SUBEXP, + REG_SYN_OP_ESC_BUF_ANCHOR to REG_SYN_OP_ESC_AZ_BUF_ANCHOR, + REG_SYN_OP_ESC_GNU_BUF_ANCHOR to + REG_SYN_OP2_ESC_GNU_BUF_ANCHOR, + REG_SYN_OP_ESC_CONTROL_CHAR to REG_SYN_OP_ESC_CONTROL_CHARS, + REG_SYN_OP_ESC_WORD to REG_SYN_OP_ESC_W_WORD, + REG_SYN_OP_ESC_WORD_BEGIN_END to + REG_SYN_OP_ESC_LTGT_WORD_BEGIN_END, + REG_SYN_OP_ESC_WORD_BOUND to REG_SYN_OP_ESC_B_WORD_BOUND, + REG_SYN_OP_ESC_WHITE_SPACE to REG_SYN_OP_ESC_S_WHITE_SPACE, + REG_SYN_OP_ESC_DIGIT to REG_SYN_OP_ESC_D_DIGIT, + REG_SYN_OP_CC to REG_SYN_OP_BRACKET_CC, + REG_SYN_OP2_CCLASS_SET to REG_SYN_OP2_CCLASS_SET_OP, + REG_SYN_CONTEXT_INDEP_OPS to + REG_SYN_CONTEXT_INDEP_REPEAT_OPS, + REG_SYN_CONTEXT_INVALID_REPEAT_OPS to + REG_SYN_CONTEXT_INVALID_REPEAT_OPS. + add REG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR. +2003/09/08: [spec] rename REG_SYN_OP_ANYCHAR to REG_SYN_OP_DOT_ANYCHAR, + REG_SYN_OP_0INF to REG_SYN_OP_ASTERISK_ZERO_INF, + REG_SYN_OP_ESC_0INF to REG_SYN_OP_ESC_ASTERISK_ZERO_INF, + REG_SYN_OP_1INF to REG_SYN_OP_PLUS_ONE_INF, + REG_SYN_OP_ESC_1INF to REG_SYN_OP_ESC_PLUS_ONE_INF, + REG_SYN_OP_0INF to REG_SYN_OP_QMARK_ZERO_ONE, + REG_SYN_OP_ESC_0INF to REG_SYN_OP_ESC_QMARK_ZERO_ONE, + REG_SYN_OP_INTERVAL to REG_SYN_OP_BRACE_INTERVAL, + REG_SYN_OP_ESC_INTERVAL to REG_SYN_OP_ESC_BRACE_INTERVAL, + REG_SYN_OP_SUBEXP to REG_SYN_OP_LPAREN_SUBEXP, + REG_SYN_OP_ALT to REG_SYN_OP_VBAR_ALT, + REG_SYN_OP_ESC_ALT to REG_SYN_OP_ESC_VBAR_ALT, + REG_SYN_OP_NON_GREEDY to REG_SYN_OP_QMARK_NON_GREEDY, + REG_SYN_OP_SUBEXP_EFFECT to REG_SYN_OP_QMARK_GROUP_EFFECT, + REG_SYN_OP2_POSSESSIVE_{REPEAT,INTERVAL} to + REG_SYN_OP2_PLUS_POSSESSIVE_{REPEAT,INTERVAL}, + REG_SYN_OP2_SUBEXP_CALL to REG_SYN_OP2_ESC_G_SUBEXP_CALL, + REG_SYN_OP2_NAMED_GROUP to REG_SYN_OP2_QMARK_LT_NAMED_GROUP + and REG_SYN_OP2_ESC_K_NAMED_BACKREF. +2003/09/02: [tune] call reduce_nested_qualifier() after disabling capture for + no-name group in noname_disable_map(). + ex. /(a+)*(?<name>...)/ +2003/09/02: [impl] include <stdio.h> is forgotten to erase in regcomp.c. +2003/09/01: [dist] update doc/RE and doc/RE.ja. +2003/08/26: [bug] (thanks Guy Decoux) + should not double free node at the case TK_CC_CC_OPEN + in parse_char_class(). + +2003/08/19: Version 1.9.3 + +2003/08/19: [inst] change re.c.180.patch. +2003/08/19: [impl] rename 'list of captures' to 'capture history'. +2003/08/19: [dist] add doc/RE.ja. (Japanese) +2003/08/19: [new] add regex_copy_syntax(). +2003/08/19: [spec] rename REG_SYN_OP2_ATMARK_LIST_OF_CAPTURES to + REG_SYN_OP2_ATMARK_CAPTURE_HISTORY. +2003/08/18: [spec] (thanks nobu) + don't use IMPORT in oniguruma.h and onigposix.h. +2003/08/18: [impl] (thanks nobu) change error output to stdout in testconv.rb. +2003/08/18: [inst] (thanks nobu) lacked $(srcdir) in Makefile.in. +2003/08/18: [bug] REG_MBLEN_TABLE[SJIS][0xFD-0xFF] should be 1. +2003/08/18: [bug] (thanks nobu) mbctab_sjis[0x80] should be 0. +2003/08/18: [bug] (thanks nobu) + single/multi-byte decision was wrong in parse_char_class(). + add regex_wc2mblen(). + should not set fetched to 1 in TK_RAW_BYTE case. +2003/08/18: [bug] should update BitSet in the case inc_n >= 0 + in add_wc_range_to_buf(). +2003/08/13: [bug] change re.c.180.patch for fix rb_reg_to_s() in re.c. +2003/08/11: [bug] should clear region->list in regex_region_resize(). + +2003/08/08: Version 1.9.2 + +2003/08/08: [test] success in ruby 1.8.0 (2003-08-08) on Windows 2000 + VC++ 6.0 and Cygwin. +2003/08/08: [impl] don't define macro vsnprintf for WIN32 platform, + because definition is added in win32\win32.h. +2003/08/08: [test] success in ruby 1.8.0 and ruby 1.6.8(2003-08-03) on Linux. +2003/08/08: [dist] change re.c.180.patch and re.c.168.patch. +2003/08/08: [new] (thanks akr) + implemented list of captures. (?@...), (?@<name>...) +2003/08/07: [dist] add sample/listcap.c. +2003/08/06: [bug] OP_MEMORY_END_PUSH_REC case in match_at(). + renewal of mem_start_stk[] should be after + STACK_PUSH_MEM_END() call. +2003/07/29: [new] add regex_get_encoding(), regex_get_options() and + regex_get_syntax(). +2003/07/25: [spec] (thanks akr) + change group(...) to shy-group(?:...) if named group is + used in the pattern. + add REG_SYN_CAPTURE_ONLY_NAMED_GROUP. +2003/07/24: [spec] rename REG_OPTION_CAPTURE_ONLY_NAMED_GROUP to + REG_OPTION_DONT_CAPTURE_GROUP. + add REG_OPTION_CAPTURE_GROUP. +2003/07/17: [spec] rename REG_SYN_OP2_NAMED_SUBEXP to REG_SYN_OP2_NAMED_GROUP. +2003/07/17: [spec] add REGERR_EMPTY_GROUP_NAME. +2003/07/17: [spec] rename REGERR_INVALID_SUBEXP_NAME + to REGERR_INVALID_CHAR_IN_GROUP_NAME. +2003/07/17: [spec] restrict usable chars of group name to alphabet, digit, + '_' or multibyte-char in fetch_name(). [ruby-dev:20706] +2003/07/16: [impl] minor change of sample/names.c. +2003/07/14: [impl] rename USE_NAMED_SUBEXP to USE_NAMED_GROUP. +2003/07/14: [bug] add fetch_name() for USE_NAMED_SUBEXP off case. +2003/07/14: [API] add regex_number_of_names(). +2003/07/08: [impl] change error message for undefined group number call. + 'undefined group reference: /(a)\g<2>/' + --> 'undefined group <2> reference: /(a)\g<2>/' +2003/07/08: [dist] modify doc/RE. +2003/07/07: [impl] OP_SET_OPTION is not needed in compiled code. + add IS_DYNAMIC_OPTION() to regint.h. +2003/07/07: [spec] called group should not ignore outside option (?i:...). + ex. /(?i:(?<n>(a)\2)){0}\g<n>/.match("aA") + add opcode OP_BACKREFN_IC and OP_BACKREF_MULTI_IC. + set option status to effect memory in optimize_node_left(). +2003/07/07: [impl] add opcode OP_ANYCHAR_ML, OP_ANYCHAR_ML_STAR and + OP_ANYCHAR_ML_START_PEEK_NEXT. +2003/07/07: [bug] (thanks nobu) REG_MBLEN_TABLE[SJIS][0x80] should be 1. +2003/07/07: [spec] rename REG_SYN_OP_QUOTE to REG_SYN_OP_ESC_Q_QUOTE. + +2003/07/04: Version 1.9.1 + +2003/07/04: [new] add REG_OPTION_CAPTURE_ONLY_NAMED_GROUP. (thanks .NET) +2003/07/04: [spec] check mbuf member in the case of + REG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC in parse_char_class(). +2003/07/04: [spec] typo REG_SYN_WARN_FOR_CC_OP_NOT_ESCAPEED. + should be REG_SYN_WARN_FOR_CC_OP_NOT_ESCAPED. +2003/07/04: [bug] conflict values on REG_SYN_WARN_FOR_CC_OP_NOT_ESCAPEED and + REG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC. (thanks nobu) +2003/07/03: [spec] add REG_SYN_OP_ESC_CONTROL_CHAR flag. +2003/07/03: [spec] remove REG_SYN_OP_ESC_OCTAL3 and REG_SYN_OP_ESC_X_HEX2 + flag from RegSyntaxGnuRegex. +2003/07/03: [spec] remove REG_SYN_OP_NON_GREEDY flag from RegSyntaxGnuRegex. +2003/07/02: [dist] fix doc/RE. +2003/07/01: [impl] add config flag USE_VARIABLE_SYNTAX. + (turn off variable syntax on Ruby) +2003/07/01: [spec] add syntax behavior REG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND. +2003/06/30: [spec] allow different length top-level alternatives + in look-behind. ex. (?<=abc|abcd), (?<!a|bc) +2003/06/26: [spec] add option REG_OPTION_NEGATE_SINGLELINE. +2003/06/26: [spec] should default on REG_OPTION_SINGLELINE + for REG_SYNTAX_PERL and REG_SYNTAX_JAVA. +2003/06/26: [impl] add options member to RegStntaxType. +2003/06/26: [spec] don't change the meaning of '\Z' for REG_OPTION_SINGLELINE. +2003/06/25: [dist] don't use option REG_NEWLINE for sample/posix.c. +2003/06/25: [dist] modify testconv.rb. + should match and convert double quoted string data. + ex. x(/\ca/, "\001", 0, 1) +2003/06/25: [impl] add REG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL and + REG_SYN_OP2_ESC_M_BAR_META. +2003/06/25: [impl] add REG_SYN_OP_ESC_OCTAL3 and REG_SYN_OP_ESC_X_HEX2. +2003/06/24: [impl] add REG_SYN_OP2_ESC_V_VTAB. (\v is VTAB) +2003/06/24: [bug] should invert REG_OPTION_SINGLELINE flag + in REG_SYN_OP2_OPTION_PERL. +2003/06/24: [impl] add REG_SYN_OP2_OPTION_PERL and REG_SYN_OP2_OPTION_RUBY. + meaning of (?m) and (?s) are depend on syntax. + +2003/06/20: Version 1.9.0 + +2003/06/20: [spec] \Q...\E is not effective on REG_SYNTAX_RUBY. (thanks akr) +2003/06/19: [inst] rename regex.h to oniguruma.h. +2003/06/18: [impl] change REG_EXTERN setting condition. (__CYGWIN__) +2003/06/18: [bug] return wrong result UTF-8 case in regex_mb2wc(). +2003/06/18: [impl] add REG_SYN_OP2_POSSESSIVE_INTERVAL. a{n,m}+ +2003/06/18: [new] add REG_SYNTAX_JAVA. +2003/06/18: [spec] add REG_SYN_OP_QUOTE. +2003/06/18: [spec] add op2 member to RegSyntaxType. + rename some REG_SYN_OP_XXX to REG_SYN_OP2. +2003/06/16: [new] Perl-like quotation operator \Q, \E. +2003/06/16: [spec] should not control ignore case mode by escaped char. + ex. /\J/i =~ "j", /[\J]/i =~ "j" (same as Perl) +2003/06/13: [bug] modify onigposix.h. +2003/06/13: [bug] should use -DIMPORT for link with DLL in win32/Makefile. +2003/06/13: [dist] add sample/names.c +2003/06/12: [bug] range should be from - 1 in not_wc_range_buf(). +2003/06/12: [spec] should warn for '-' before '&&' operator in char-class. +2003/06/12: [new] add REG_SYNTAX_PERL. +2003/06/12: [spec] add syntax behavior REG_SYN_WARN_FOR_CC_OP_NOT_ESCAPEED. +2003/06/12: [spec] invalid POSIX bracket should be error. ex. [[:upper :]] +2003/06/11: [new] char-class in char-class (as Java(TM)). +2003/06/11: [spec] change AND operator in char-class from &&[..] to &&. +2003/06/04: [spec] {n,m}+ should not be possessive operator. + ex. a{3}+ should be (?:a{3})+ +2003/06/03: [bug] should compare strings with min-length in is_not_included(). +2003/06/03: [impl] automatic possessivate optimization. a*b ==> (?>a*)b + (thanks Jeffrey E. F. Friedl) +2003/06/02: [impl] remove multibyte-BitSet for OP_CCLASS_MB/OP_CCLASS_MB_NOT. +2003/05/30: [new] char class intersection operator &&[...] like Java(TM). + (thanks akr) +2003/05/30: [bug] should use bbuf_free() for CClassNode in regex_node_free(). +2003/05/29: [bug] wrong usage of syntax REG_SYN_ALLOW_EMPTY_RANGE_IN_CC. + /[d-a]/ should be error. +2003/05/28: [impl] optimize stop-backtrack compiled code. + (/(?>a*)/, /(?>\w+)/ etc...) + add OP_POP opcode. +2003/05/28: [new] possessive repeat operator. (?+, *+, ++, {n,m}+) +2003/05/27: [spec] '-' at beginning of char-class should be warn only if + it is start of range. (ex. /[--a]/) +2003/05/27: [spec] should not warn for right bracket at beginning of pattern. + ex. /]aaa/ +2003/05/27: [spec] change CCEND_ESC_WARN() from VERB_WARNING() to WARNING(). +2003/05/27: [spec] /[]aaa/ should be empty char-class error. + /[]aaa]/ should be warn for 'without backslash'. + (add char_exist_check() in regparse.c) +2003/05/26: [bug] OP_REPEAT in recursive subexp call. + ex. /(?<n>(a|b\g<n>c){3,5})/.match("baaaaca") => "baaaaca" + was wrong result. (should be "aaaa") +2003/05/26: [impl] add num_call member to regex_t. +2003/05/26: [impl] add repeat_range member to regex_t. + (for delete upper,lower members from StackType.u.repeat) +2003/05/26: [bug] change print_names() to external regex_print_names(). +2003/05/26: [tune] change OP_NULL_CHECK_END process in match_at(). +2003/05/26: [spec] change CCEND_ESC_WARN() from WARNING() to VERB_WARNING(). +2003/05/26: [spec] remove POSIXLINE option. (?p:...) + (be made the same as Ruby.) +2003/05/22: [spec] use OP_NULL_CHECK_XXX only if repeat is infinite. + prev. /(?:()|()){0,10}\1\2/ =~ "" ==> FAIL + now /(?:()|()){0,10}\1\2/ =~ "" ==> MATCH + +2003/05/22: [impl] change target_empty setting condition in setup_tree(). +2003/05/19: [impl] avoid zero length repeat optimization. (thanks matz) + /()*/ ==> /()?/, /()+/ ==> /()/ etc... +2003/05/19: [impl] minor changes for gcc -Wall. (-DREG_DEBUG_STATISTICS case) +2003/05/19: [spec] rename regex_foreach_names() to regex_foreach_name(). +2003/05/16: [new] add --with-statistics option to configure. +2003/05/16: [bug] move RegOpInfo[] definition to regint.h. +2003/05/16: [new] add regex_version(). + +2003/05/14: Version 1.8.6 + +2003/05/14: [bug] use _vsnprintf() on Win32. +2003/05/14: [spec] define USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE. + (/\n$/ =~ "\n", /\n\Z/ =~ "\n") [ruby-dev:20125] +2003/05/14: [impl] minor changes for gcc -Wall. +2003/05/14: [impl] add string.h check in AC_CHECK_HEADERS(). +2003/05/13: [impl] minor changes for gcc -Wall. +2003/05/13: [impl] add regex_snprintf_with_pattern(). +2003/05/13: [spec] add warning for char class meta character without escape + in Ruby mode ('[', '-', ']'). +2003/05/13: [impl] define WARNING() and VERB_WARNING() in regint.h. +2003/05/13: [bug] correct is_code_ascii() for /[[:ascii:]]/. +2003/05/12: [dist] add regular expression document (doc/RE). +2003/05/12: [spec] specification of $(END_LINE) was made the same as Ruby 1.8. + [ruby-dev:20130] (thanks matz) +2003/05/12: [memo] shifted to Subversion(version 0.21.0) from CVS. + +2003/03/19: Version 1.8.5 + +2003/03/19: [impl] change REG_EXTERN definition. (thanks nobu) +2003/03/19: [impl] abbreviation for long error_par in regex_error_code_to_str(). +2003/03/18: [dist] change re.c.XXX.patch for GNU regex API changes. +2003/03/18: [spec] change API regex_new(), regex_recompile() and + regex_error_code_to_str(). + change API re_compile_pattern() and re_recompile_pattern(). +2003/03/18: [spec] replace REGERR_END_PATTERN_AT_GROUP_{COMMENT|OPTION} to + REGERR_END_PATTERN_IN_GROUP. +2003/03/17: [impl] should free err_arg. +2003/03/17: [bug] mistake(high -> to) in add_wc_range_to_buf(). +2003/03/17: [spec] add err_arg argument to regex_new() and regex_recompile(). + for detail error message. (thanks akr) + +2003/03/12: Version 1.8.4 + +2003/03/12: [tune] use cached value of effect node in get_min_match_length(). +2003/03/12: [bug] escaped alphabet should be TK_RAW_BYTE + in fetch_token() and fetch_token_in_cc(). +2003/03/12: [spec] change named backref and subexp call format. + backref: \k<name>, call: \g<name> (thanks akr) +2003/03/11: [inst] add regparse.[ch] in win32/Makefile. +2003/03/11: [bug] if UNALIGNED_WORD_ACCESS isn't set + then compile error in unset_addr_list_fix(). (thanks knu) +2003/03/10: [impl] divide regcomp.c to regcomp.c, regparse.c and regparse.h. +2003/03/10: [bug] should handle multi-byte code name in fetch_name(). +2003/03/10: [spec] remove REGERR_TABLE_FOR_IGNORE_CASE_IS_NOT_SETTED. +2003/03/10: [spec] support POSIX API option REG_NOSUB. + add comp_options member to POSIX API regex_t. + +2003/03/10: Version 1.8.3 + +2003/03/10: [bug] can not compile with Ruby 1.6.8. + (inconsistent st.h with 1.6 and 1.8) + use hash table on Ruby 1.8 only. +2003/03/10: [spec] forbid to use '\' in group name. +2003/03/08: [impl] remove check_backref_number(). +2003/03/08: [bug] called group in 0-repeat should not be eliminated from + compile code. ex. /(?*n)(?<n>){0}/ (thanks akr) + add is_refered member to QualifierNode. +2003/03/07: [impl] use hash table(st.[ch]) for implementation of name table. + (enable on Ruby in default) +2003/03/07: [new] add regex_foreach_names(). +2003/03/06: [impl] add member reg->stack_pop_level. +2003/03/06: [impl] add operator OP_MEMORY_START and member reg->backtrack_mem. +2003/03/06: [bug] if REG_OPTION_FIND_LONGEST or REG_OPTION_NOT_EMPTY, + should handle backtrack of MEM_END. + add OP_MEMORY_END_PUSH and OP_MEMORY_END_PUSH_REC. +2003/03/06: [impl] rename OP_MEMORY_END_PUSH to OP_MEMORY_END_MARK. +2003/03/06: [spec] change error messages. +2003/03/06: [tune] add tiny_pop check in STACK_POP. + +2003/03/05: Version 1.8.2 + +2003/03/05: [impl] use cache info in EFFECT_MEMORY case + in optimize_node_info(). +2003/03/05: [impl] add EFFECT_MEMORY node reference count check + in optimize_node_left(). +2003/03/05: [impl] add min-len, max-len, char-len cache in EffectNode. +2003/03/05: [spec] allow to call in look behind. ex. /(?<=(?*a))/ +2003/03/05: [bug] forgotten N_ANCHOR case in check_backref_number(), + subexp_inf_recursive_check_trav() etc... +2003/03/05: [impl] rename USE_ONIGURUMA_EXTENSION to USE_SBMB_CLASS. +2003/03/04: [impl] add CALL-node info in optimize_node_left(). +2003/03/04: [spec] prohibit left recursion of subexp call. ex. (?<n>|(?*n)a) + add subexp_inf_recursive_check_trav(). +2003/03/04: [spec] rename REG_SYN_STRICT_CHECK_BACKREF_NUMBER + to REG_SYN_STRICT_CHECK_BACKREF +2003/03/03: [bug] /(?<n>a(?*n)|)/ isn't infinite recursion. + fix N_LIST case in subexp_recursive_check(). (thanks akr) +2003/03/03: [bug] /(?<n>|(?*n))+/ segmentation fault. + should re-allocate in unset_addr_list_add(). (thanks akr) + +2003/03/01: Version 1.8.1 + +2003/03/01: [bug] change STACK_GET_MEM_START() and STACK_PUSH_MEM_END(). +2003/03/01: [new] add reg_name_to_group_numbers() to POSIX API. +2003/03/01: [impl] use OP_MEMORY_END_PUSH in callable subexp compiled code + only if subexp is recursive. +2003/03/01: [spec] rename regex_name_to_backrefs() to + regex_name_to_group_numbers(). +2003/02/28: [impl] use function stack_double() instead of macro. +2003/02/28: [new] subexp call. (?*name) (thanks akr) +2003/02/28: [spec] add match stack limit check. (MATCH_STACK_LIMIT_SIZE) +2003/02/28: [impl] check recursive subexp call. +2003/02/28: [impl] add opcode OP_MEMORY_END_PUSH for callable subexp. +2003/02/28: [impl] add opcode OP_CALL, OP_RETURN. + add stack type STK_CALL_FRAME, STK_RETURN, STK_MEM_END. +2003/02/26: [spec] add new syntax behavior REG_SYN_STRICT_CHECK_BACKREF_NUMBER. + if it is set, then error /(\1)/, /\1(..)/ etc... +2003/02/26: [spec] if backref number is greater than max group number, + then return compile error. (REGERR_INVALID_BACKREF_NUMBER) +2003/02/26: [tune] bad implemented N_ALT case in get_min_match_length(). +2003/02/26: [dist] auto update testc.c and win32/testc.c in dist target. +2003/02/26: [impl] add -win option to testconv.rb. +2003/02/25: [spec] allow to assign same name to different group. + add OP_BACKREF_MULTI. +2003/02/24: [impl] reduce redundant repeat of empty target. + ex. /()*/ ==> /()?/, /()+/ ==> /()/, /(?:)+/ ==> // +2003/02/24: [impl] change condition in regex_is_allow_reverse_match(). +2003/02/24: [impl] convert i(/../, ...) functions in testconv.rb. +2003/02/24: [impl] change name table struct. + +2003/02/22: Version 1.8.0 + +2003/02/22: [new] named subexp, named back reference. (thanks akr) + define: (?<name>...), back-ref: \g<name> +2003/02/22: [impl] use str_node_can_be_split(). +2003/02/21: [dist] add sample/posix.c +2003/02/21: [spec] rename some error code symbols. +2003/02/21: [spec] max number of multibyte ranges(255) is small. + 255 --> 1000. (thanks MoonWolf) +2003/02/20: [new] supported Basic Regular Expression(BRE) in POSIX API. + (REG_EXTENDED option: Extended RE) +2003/02/20: [new] variable syntax. + +2003/02/12: Version 1.7.2 + +2003/02/12: [bug] mismatch /\?a/i.match('?A'). + check raw value in scan_make_node() and scan_backslash(). + (thanks Nobu) +2003/02/12: [impl] rename 'max_mem' to 'num_mem' in regex_t. +2003/02/12: [impl] rename 'code' to 'enc' in regex_t. +2003/02/12: [spec] remove transtable argument in regex_new and regex_recompile. + remove transtable member in regex_t. +2003/02/10: [inst] change backup file suffix name from '.orig' to '.ruby_orig'. + (win32/Makefile) +2003/02/10: [spec] number check in scan_char_class() ignore-case mode. + ex. /[\x58-\x64]/i +2003/02/10: [impl] don't use OP_MEMORY_END_PUSH (and STK_MEM_END). +2003/02/10: [impl] lift up head_exact value from child qualifier node to parent. +2003/02/10: [tune] change stack type values. +2003/02/10: [dist] add HISTORY. +2003/02/08: [tune] change stack type values. +2003/02/08: [tune] add STACK_BASE_CHECK(). +2003/02/08: [tune] add STACK_PUSH_ENSURED(). +2003/02/08: [dist] change contents of doc/API. +2003/02/07: [inst] change backup file suffix name from '.orig' to '.ruby_orig'. +2003/02/07: [spec] range in char-class should be same spec. with Ruby + in ignore-case mode. (ex. /[A-c]/i == /[a-c]/i) + (thanks MoonWolf) +2003/02/07: [spec] [!--] should be allowed. (thanks MoonWolf) +2003/02/07: [dist] refresh re.c.180.patch for re.c (2003-02-06). + +2003/02/07: Version 1.7.1 + +2003/02/07: [impl] check first byte of string in ignore-case mode. + (get_head_exact_node()) +2003/02/07: [impl] remove redundant statements in setup_tree(). +2003/02/06: [new] create Win32 DLL. +2003/02/06: [impl] use P_() macro for function prototype. +2003/02/06: [impl] add HAVE_PROTOTYPE, HAVE_STDARG_PROTOTYPES in + configure.in and config.h.in. +2003/02/06: [spec] /[0-9-a]/ is allowed as usual char '-' and 'a' in Ruby. + add USE_BETTER_COMPATIBILITY_FOR_ORIGINAL_REGEX in + regint.h. (thanks MoonWolf) +2003/02/06: [spec] rename REG_MBCTYPE_XXXX to REG_ENCODING_XXXX in onigposix.h. +2003/02/05: [spec] rename MBCTYPE_XXXX to REG_MBCTYPE_XXXX in onigposix.h. +2003/02/05: [spec] add POSIX API error REG_EONIG_THREAD to onigposix.h. +2003/02/05: [dist] add .cvsignore file. + +2003/02/04: Version 1.7 + +2003/02/04: [bug] typo miss in regex_region_copy(). +2003/02/04: [impl] change THREAD_PASS macro. (regint.h) +2003/02/04: [dist] add API document file doc/API. +2003/02/04: [tune] if sub_anchor has ANCHOR_BEGIN_LINE then + set REG_OPTIMIZE_EXACT_BM in set_optimize_exact_info(). +2003/02/04: [spec] reimplement regex_clone() and it is obsoleted. +2003/02/04: [bug] add REGERR_OVER_THREAD_PASS_LIMIT_COUNT + to regerror.c regposix.c. +2003/02/03: [bug] Hankaku-Kana may be second byte in Shift_JIS + regex_is_allow_reverse_match(). +2003/02/03: [impl] add optimization type REG_OPTIMIZE_EXACT_BM_NOT_REV. + remove exact_allow_reverse_match member in regex_t. +2003/02/03: [impl] add exact_allow_reverse_match member in regex_t. +2003/02/03: [impl] compile-search conflict in regex_search() is handled. +2003/02/01: [tune] decrease regex_region_clear() calling from regex_search(). +2003/02/01: [tune] remove region argument from match_at(). +2003/01/31: [tune] don't use strlen() in regexec() and regcomp(). +2003/01/31: [tune] decrease regex_reduce_chain() calling in regex_search(). +2003/01/31: [bug] STRING_CMP() in regexec.c was wrong in ignore-case. +2003/01/31: [impl] convert to lower-case char at string compile time. + change SBTRANSCMP() in regexec.c. +2003/01/31: [impl] rename TTRANS() to TOLOWER(). +2003/01/30: [bug] .c.o --> .c.obj in win32\Makefile. +2003/01/30: [impl] add -DNOT_RUBY to Makefile.in. + NOT_RUBY is refered in regint.h for escape double + including config.h. +2003/01/30: [impl] when string hasn't case ambiguity, don't compile + to ignore case opcode. +2003/01/29: [impl] add SJIS, UTF-8 test_sb() test. +2003/01/29: [dist] add INSTALL-RUBY file. +2003/01/28: [test] success in Cygwin, Ruby 1.8.0 (2003-01-27). +2003/01/24: [inst] add rback target to Makefile.in. +2003/01/24: [impl] change SBCMP() -> IS_NEWLINE() in match_at(). +2003/01/23: [impl] add encoding arg to scan_xxxx_number(). +2003/01/23: [impl] rename WCInt to WCINT. +2003/01/22: [bug] POSIX API regexec() was not thread safe. + remove region member from POSIX regex_t. + [new] add search time option REG_OPTION_POSIX_REGION. + (region argument is treated as regmatch_t[] type) + speed up regexec(). +2003/01/22: [memo] start CVS entry in my box. + +2003/01/21: Version 1.6 + +2003/01/21: [test] Mac OS X 10.1, Ruby 1.8.0 (2003-01-20) +2003/01/20: [impl] add UTF-8 check to test.rb. (thanks UENO Katsuhiro) +2003/01/18: [impl] change REGION_NOTPOS to REG_REGION_NOTPOS in regex.h. +2003/01/17: [dist] add sample/simple.c. +2003/01/17: [inst] add configure option --with-rubydir. +2003/01/17: [bug] bad implemeted POSIX API options. + default: /./ not match "\n", anchor not match "\n" + REG_NEWLINE: /./ not match "\n", anchor match "\n" +2003/01/16: [impl] rewrite POSIX API regexec() for speed up. +2003/01/16: [impl] add region member to POSIX regex_t struct. +2003/01/16: [inst] rename library file from 'libregex.a' to 'libonig.a'. +2003/01/15: [dist] add testc.c to distribution file. +2003/01/15: [test] success in 'make rtest/ctest/ptest' on Windows 2000. +2003/01/15: [bug] change '/' to \' in win32/Makefile. +2003/01/14: [test] success in Ruby make test on Windows 2000. + VC++6.0, Ruby 1.6.8 (2003-01-12) +2003/01/14: [inst] change Makefile.in and win32/Makefile. +2003/01/11: [inst] changes for Win32 platform. (regint.h, reggnu.c, regcomp.c) +2003/01/11: [dist] add win32 directory. (config.h, Makefile, testc.c) +2003/01/10: [inst] add onigposix.h to install target. (Makefile.in) +2003/01/10: [bug] lacked a comma in ESTRING[]. (regposerr.c) +2003/01/10: [bug] local variable name was wrong. buf -> tbuf (regerror()) +2003/01/10: [spec] remove REG_RUBY_M17N case from onigposix.h and regposix.c. + +2003/01/09: Version 1.5 + +2003/01/09: [inst] replace Ruby re.c.XXX.patch files. (166 -> 168, 172 -> 180) +2003/01/09: [new] implement POSIX API. (thanks knu) + (onigposix.h, regposix.c, regposerr.c) +2003/01/08: [spec] remove REGERR_END_PATTERN_AFTER_BACKSLASH in regex.h. +2003/01/08: [spec] region arg can be NULL in regex_search() and regex_match(). + +2003/01/08: Version 1.4 + +2003/01/08: [inst] add test program converter (test.rb -> testc.c). +2003/01/08: [bug] move GET_WCINT() from regcomp.c to regint.h. +2003/01/07: [inst] add new test script (test.rb). +2002/12/30: [bug] wrong merge in multibyte mode (alt_merge_opt_exact_info()). +2002/12/28: [inst] add rtest target to Makefile.in. +2002/12/28: [bug] /\xfe/.match("\xfe") mismatch in multibyte mode. + add "raw" flag arg to concat_opt_exact_info_str(). +2002/12/25: [bug] check condition was wrong in alt_merge_opt_map_info(). +2002/12/25: [impl] add threshold_len check in regex_search(). +2002/12/23: [bug] prec-read in alternative (/a|(?=z).f/.match("zf") => nil) +2002/12/23: [bug] \G in alternative (/a|\Gz/.match("bza") => "z"). + add start member in MatchArg. (regexec.c) +2002/12/21: [impl] **** rewrite all optimization process. **** +2002/12/16: [impl] remove node subtype EFFECT_EMPTY. +2002/12/12: [impl] reconstruct node types. (regcomp.c) +2002/12/11: [impl] add regerror.c +2002/12/10: [bug] [ruby-dev:19042] (thanks Nobu) + anchor(\G etc...) influenced outside of "|". (/a|\Gb/) +2002/11/30: [bug] [ruby-dev:18966] (thanks Nobu) + char-class(\S, [^\s] etc...) optimize map-info was wrong. +2002/11/29: [bug] infinite loop on NULL-pointer str search (regex_search()). + (thanks matz) +2002/11/29: [bug] change static -> extern (regex_chain_reduce()). +2002/11/29: [bug] change encoding to RegDefaultCharEncoding + in re_recompile_pattern(). (adapt to re.c) +2002/04/24: [spec] USE_ONIGURUMA_EXTENSION is disabled in default. +2002/04/24: [new] add searching time option: REG_OPTION_NOTBOL/NOTEOL. + add searching time option argument to regex_search() and + regex_match(). (prepare for POSIX API) +2002/04/20: [impl] divide regex.c file into regcomp.c, regexec.c, reggnu.c + and regint.h. +2002/04/09: [impl] move IS_MULTILINE() to outside of loop in OP_ANYCHAR_STAR. +2002/04/08: [impl] don't use OP_REPEAT operator for '??'. +2002/04/06: [impl] reduce redundant nested repeat operators(?,*,+,??,*?,+?). + ex. (?:a*)?, (?:a??)* etc.. +2002/04/06: [spec] should not warn for /(?:a?)+?/. +2002/04/04: [spec] should allow fixed length alternative and repeat pattern + in look-behind. ex. /(?<=(a|b){3})/ (thanks Guy Decoux) +2002/04/02: [spec] should warn for /(?:a+)?/ and /(?:a*)??/. (thanks akr) + +2002/04/01: Version 1.3 + +2002/04/01: [dist] add COPYING. +2002/03/30: [spec] warn redundant nested repeat operator + in Ruby verbose mode. ex. (?:a*)? +2002/03/30: [spec] nested repeat operator error check should be + same with GNU regex. (thanks Guy Decoux) +2002/03/30: [new] add \x{hexadecimal-wide-char}. (thanks matz) +2002/03/27: [bug] MBCTYPE_XXX symbol values should be same with GNU regex. +2002/03/27: [impl] add THREAD_ATOMIC to regex_clone(), regex_init(), regex_end(). +2002/03/25: [spec] if encoding is utf-8, allow combination of singlebyte and + multibyte code range in char class. + (cancelled 2002/04/01: for M17N compatibility) +2002/03/25: [dist] description of the license condition is added to README. +2002/03/23: [bug] should set all bits of reg->mem_stats, + if REG_OPTION_FIND_LONGEST or REG_OPTION_NOT_EMPTY. +2002/03/23: [new] add a new option REG_OPTION_NOT_EMPTY. +2002/03/20: [spec] allow incompleted left brace as an usual char. + ex. /{/, /({)/, /a{2,3/ etc... +2002/03/20: [impl] serialize integer in bytecode. + (switch by UNALIGNED_WORD_ACCESS in regex.c) +2002/03/20: [impl] change re_mbcinit() for REG_RUBY_M17N. +2002/03/19: [impl] word alignment of char class multi-byte code ranges. +2002/03/19: [impl] replace OP_EXACTMB4N with OP_EXACTMB3N. +2002/03/19: [bug] OP_CCLASS_MB_NOT process in matchAt() is wrong. +2002/03/19: [new] add re_mbctab[] for Ruby extension library compatibility. +2002/03/19: [spec] allow nested repeat operator, if operator is {n,m} type. +2002/03/19: [new] add REG_IS_PATTERN_ERROR(ecode) in regex.h +2002/03/18: [spec] /[a-b-c]/ should be error. +2002/03/18: [bug] /[\w-a]/ should be error. (thanks Guy Decoux) +2002/03/18: [bug] /[\]/ should be error. (thanks Guy Decoux) +2002/03/18: [bug] /()*/ etc.. should not be error. (thanks Guy Decoux) +2002/03/18: [spec] /a{1}*/ should not be error. (thanks Guy Decoux) +2002/03/18: [bug] ab{2}{3} was interpreded to (?:a(?:b{2})){3} + (thanks Guy Decoux) +2002/03/18: [bug] abort /(?i)*a/ etc... (thanks Guy Decoux) +2002/03/18: [bug] abort /a|*/,/a|{1}/ etc... (thanks Guy Decoux) + +2002/03/13: Version 1.2 + +2002/03/13: [test] success in rubicon/builtin/AllBuiltinTests.rb. + (thanks rubicon) +2002/03/13: [bug] OP_EXACTMBN process in matchAt() is wrong. +2002/03/13: [bug] start argument of BackwardSearchRange() is wrong. +2002/03/12: [spec] change function name style from CamelCase + to underline_separation. (includes API) +2002/03/12: [bug] if pattern has nested null-check, cause infinite loop. + correct STACK_NULL_CHECK() macro. (thanks Guy Decoux) +2002/03/11: [bug] it is wrong that four numbers to continue as + an octal value in scanBackSlash(). ex. /\0111/ + (thanks matz) +2002/03/11: [new] \k (single-byte word char), \K (multi-byte char). +2002/03/09: [inst] add two targets to Makefile.in (166 and 172). +2002/03/09: [spec] decrease REG_MAX_BACKREF_NUM, REG_MAX_REPEAT_NUM + values. +2002/03/08: [spec] allow use of "\A"(begin-buf) in look-behind. +2002/03/08: [impl] add a new opcode OP_PUSH_IF_PEEK_NEXT. +2002/03/08: [impl] add a new opcode OP_ANYCHAR_STAR_PEEK_NEXT. +2002/03/07: [spec] prohibit use of capture group "(...)" + in negative look-behind. +2002/03/07: [inst] add configure.in, config.h.in, Makefile.in. +2002/03/07: [impl] call Init_REGEX_STAT() in RegexInit(). +2002/03/07: [spec] less length string match with negative look-behind. + ex. /(?<!XXX)a/.match("Xa"). (thanks Nobu) +2002/03/06: [impl] expand repeated string, if expanded length <= 100. + ex. /(?:abc){10}/ +2002/03/06: [new] add a symbol REG_TRANSTABLE_USE_DEFAULT in regex.h. +2002/03/06: [impl] rename RegDefaultCharCode to RegDefaultCharEncoding. +2002/03/06: [bug] if pattern has NULL(\000) char, infinite loop happens + in ScanMakeNode(). (beware of strchr(). thanks Nobu) +2002/03/06: [bug] range argument of ForwardSearchRange() is wrong. + ex. /\A.a/, /\G.a/ mismatched with "aa". (thanks Nobu) +2002/03/05: [new] add RegexMatch() API. rename regexMatch() to matchAt(). +2002/03/05: [impl] change function definition style. +2002/03/05: [impl] abolish use of macro symbol which name begin with underline. +2002/03/04: [bug] make up a break-statement in compileTree(). + (compile error on Mac OS X 10.1.3) + +2002/03/04: Version 1.1 + +2002/03/04: [impl] replace STK_BOTTOM with STK_ALT. +2002/03/02: [impl] add new opcode OP_FINISH and new stack type + STK_BOTTOM for (little bit) speed up STACK_POP. +2002/03/02: [impl] add new opcode OP_EXACT1_IC, OP_EXACTN_IC + for compile time ignore case check. + remove opcode OP_EXACT1_RAW, OP_EXACTN_RAW. +2002/03/02: [impl] add OpTime info to statistical data. +2002/02/28: [bug] sub_anchor($) in ForwardSearch() and BackwardSearch(). + ex. /$\x0az/.match("\nz") +2002/02/28: [new] look-behind (?<=pattern), (?<!pattern). +2002/02/27: [bug] use StackIndex instead of StackType* for realloc problem. +2002/02/27: [impl] use m17n_codepoint() as mb2wc() in REG_RUBY_M17N. +2002/02/27: [spec] undefined POSIX bracket /[[:xyz:]]/ should be syntax error. +2002/02/26: [bug] ex. /$*/, /[a-]/, /((?i)a)b/ (thanks matz) + +2002/02/25: Version 1.0 (first release) + +-- +[bug: bug fix] +[API: API change/new/delete] +[new: new feature] +[spec: specification change] +[impl: implementation change] +[tune: tune for speed up] +[inst: changes for installation] +[dist: distribution change] +[test: test] +[dev: development] +[memo: memo] +-- +<create tag> +svn copy file:///home/kosako/svnreps/svnrep_onig/trunk file:///home/kosako/svnreps/svnrep_onig/tags/5.0.0 -m "ADD TAG: 5.0.0" + +<set ignore files by .cvsignore> +svn propset svn:ignore -F .cvsignore . +svn commit -m "..." + + +<CVS: show all tags> +cvs history -T + +<CVS: add tag> +cvs rtag "VERSION_X_X_X" oniguruma + + +<GNU Autotools: bootstrap> +* write Makefile.am and configure.in. +> aclocal +> libtoolize or glibtoolize +> automake --foreign --add-missing +> autoconf +> configure --with-rubydir=... CFLAGS="-O2 -Wall" + + +<GNU libtool: version management> + + VERSION = current:revision:age + + current: interface number (from 0) + revision: implementation number of same interface (from 0) + age: number of supported previous interfaces + (if current only supported then age == 0) + +//END diff --git a/lib/edbee-lib/vendor/onig/INSTALL b/lib/edbee-lib/vendor/onig/INSTALL new file mode 100644 index 00000000..7d1c323b --- /dev/null +++ b/lib/edbee-lib/vendor/onig/INSTALL @@ -0,0 +1,365 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007, 2008, 2009 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + + The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type `make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `<wchar.h>' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/lib/edbee-lib/vendor/onig/Makefile.am b/lib/edbee-lib/vendor/onig/Makefile.am new file mode 100644 index 00000000..a6b01dca --- /dev/null +++ b/lib/edbee-lib/vendor/onig/Makefile.am @@ -0,0 +1,144 @@ +## Makefile.am for Onigmo +encdir = $(top_srcdir)/enc +sampledir = $(top_srcdir)/sample +libname = libonigmo.la + +PYTHON = @python_prog@ + +ACLOCAL_AMFLAGS = -I m4 +AM_CFLAGS = -Wall +AM_CPPFLAGS = -I$(top_srcdir) -I$(includedir) -I$(encdir)/unicode + +SUBDIRS = . sample + +include_HEADERS = onigmo.h onigmognu.h onigmoposix.h +lib_LTLIBRARIES = $(libname) + +libonigmo_la_SOURCES = regint.h regparse.h regenc.h st.h \ + regerror.c regparse.c regext.c regcomp.c regexec.c reggnu.c \ + regenc.c regsyntax.c regtrav.c regversion.c st.c \ + regposix.c regposerr.c \ + $(encdir)/unicode.c $(encdir)/ascii.c $(encdir)/utf_8.c \ + $(encdir)/utf_16be.c $(encdir)/utf_16le.c \ + $(encdir)/utf_32be.c $(encdir)/utf_32le.c \ + $(encdir)/unicode/casefold.h $(encdir)/unicode/name2ctype.h \ + $(encdir)/euc_jp.c $(encdir)/shift_jis.c $(encdir)/shift_jis.h \ + $(encdir)/windows_31j.c \ + $(encdir)/jis/props.h $(encdir)/jis/props.kwd \ + $(encdir)/iso_8859.h $(encdir)/iso_8859_1.c \ + $(encdir)/iso_8859_2.c $(encdir)/iso_8859_3.c \ + $(encdir)/iso_8859_4.c $(encdir)/iso_8859_5.c \ + $(encdir)/iso_8859_6.c $(encdir)/iso_8859_7.c \ + $(encdir)/iso_8859_8.c $(encdir)/iso_8859_9.c \ + $(encdir)/iso_8859_10.c $(encdir)/iso_8859_11.c \ + $(encdir)/iso_8859_13.c $(encdir)/iso_8859_14.c \ + $(encdir)/iso_8859_15.c $(encdir)/iso_8859_16.c \ + $(encdir)/euc_tw.c $(encdir)/euc_kr.c $(encdir)/big5.c \ + $(encdir)/gb18030.c $(encdir)/koi8_r.c $(encdir)/koi8_u.c \ + $(encdir)/windows_1250.c $(encdir)/windows_1251.c \ + $(encdir)/windows_1252.c $(encdir)/windows_1253.c \ + $(encdir)/windows_1254.c $(encdir)/windows_1257.c + +libonigmo_la_LDFLAGS = -version-info $(LTVERSION) -no-undefined + +EXTRA_DIST = .gitignore onigmo.pc.in HISTORY README.ja README.md \ + doc/API doc/API.ja doc/RE doc/RE.ja doc/FAQ doc/FAQ.ja \ + doc/UnicodeProps.txt \ + tool/.gitignore tool/Makefile tool/case-folding.rb \ + tool/convert-jis-props.sh \ + tool/enc-unicode.rb tool/download-ucd.sh tool/update-doc.py \ + win32/Makefile win32/Makefile.mingw win32/config.h win32/testc.c \ + win32/makedef.py win32/onigmo.rc \ + $(encdir)/mktable.c \ + test.rb testconv.rb testconvu.rb \ + onigmo.py testpy.py .editorconfig + +bin_SCRIPTS = onigmo-config + +onigmo-config: onigmo-config.in + +do_subst = sed \ + -e 's,[@]datadir[@],$(datadir),g' \ + -e 's,[@]datarootdir[@],$(datarootdir),g' \ + -e 's,[@]PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \ + -e 's,[@]prefix[@],$(prefix),g' \ + -e 's,[@]exec_prefix[@],$(exec_prefix),g' \ + -e 's,[@]libdir[@],$(libdir),g' \ + -e 's,[@]includedir[@],$(includedir),g' + +onigmo.pc: $(srcdir)/onigmo.pc.in Makefile + $(do_subst) < $(srcdir)/onigmo.pc.in > $(@) + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = onigmo.pc +CLEANFILES = onigmo.pc + +# character-types-table source generator +mktable: $(encdir)/mktable.c $(srcdir)/regenc.h + $(CC) -I$(top_srcdir) -o mktable $(encdir)/mktable.c + + +# TEST +TESTS = testc testp testcu + +check_PROGRAMS = testc testp testcu + +test: atest pytest + $(MAKE) -C sample test + +atest: testc$(EXEEXT) testp$(EXEEXT) testcu$(EXEEXT) + @echo "[Onigmo API, ASCII/EUC-JP check]" + @$(top_builddir)/testc | grep RESULT + @echo "[POSIX API, ASCII/EUC-JP check]" + @$(top_builddir)/testp | grep RESULT + @echo "[Onigmo API, UTF-16 check]" + @$(top_builddir)/testcu | grep RESULT + +testc_SOURCES = testc.c +testc_LDADD = libonigmo.la + +testp_SOURCES = testc.c +testp_LDADD = libonigmo.la +testp_CFLAGS = -DPOSIX_TEST + +testcu_SOURCES = testu.c +testcu_LDADD = libonigmo.la + + +#$(srcdir)/testc.c: $(srcdir)/test.rb $(srcdir)/testconv.rb +$(srcdir)/testc.c: + ruby -Ke $(srcdir)/testconv.rb < $(srcdir)/test.rb > $@ + +#$(srcdir)/testu.c: $(srcdir)/test.rb $(srcdir)/testconvu.rb +$(srcdir)/testu.c: + ruby -Ke $(srcdir)/testconvu.rb $(srcdir)/test.rb > $@ + +#$(srcdir)/win32/testc.c: $(srcdir)/test.rb $(srcdir)/testconv.rb +$(srcdir)/win32/testc.c: + ruby -Ke $(srcdir)/testconv.rb -win < $(srcdir)/test.rb | iconv -f euc-jp -t cp932 | sed -e "s/$$/\r/" > $@ + +# Python TEST +pytest: + LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py EUC-JP + LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py SJIS + LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py UTF-8 + LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py UTF-16LE + LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py UTF-16BE + LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py UTF-32LE + LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py UTF-32BE + + +# lcov + +# Collect coverage data and write to coverage.info, then create HTML output +# in the coverage directory. +lcov: + if [ ! -f $(builddir)/enc/jis/props.kwd ]; then mkdir -p $(builddir)/enc/jis; cp $(srcdir)/enc/jis/props.kwd $(builddir)/enc/jis/props.kwd; fi + lcov -c -d .libs -o coverage.info + genhtml -o coverage coverage.info + +# Clear coverage data. +lcov-clear: + lcov -d . -z + +## END OF FILE diff --git a/lib/edbee-lib/vendor/onig/Makefile.in b/lib/edbee-lib/vendor/onig/Makefile.in new file mode 100644 index 00000000..a0b098a7 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/Makefile.in @@ -0,0 +1,1569 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +TESTS = testc$(EXEEXT) testp$(EXEEXT) testcu$(EXEEXT) +check_PROGRAMS = testc$(EXEEXT) testp$(EXEEXT) testcu$(EXEEXT) +subdir = . +DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/config.h.in $(srcdir)/onigmo-config.in \ + $(top_srcdir)/configure AUTHORS COPYING INSTALL compile \ + config.guess config.sub depcomp install-sh ltmain.sh missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = onigmo-config +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ + "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libonigmo_la_LIBADD = +am_libonigmo_la_OBJECTS = regerror.lo regparse.lo regext.lo regcomp.lo \ + regexec.lo reggnu.lo regenc.lo regsyntax.lo regtrav.lo \ + regversion.lo st.lo regposix.lo regposerr.lo unicode.lo \ + ascii.lo utf_8.lo utf_16be.lo utf_16le.lo utf_32be.lo \ + utf_32le.lo euc_jp.lo shift_jis.lo windows_31j.lo \ + iso_8859_1.lo iso_8859_2.lo iso_8859_3.lo iso_8859_4.lo \ + iso_8859_5.lo iso_8859_6.lo iso_8859_7.lo iso_8859_8.lo \ + iso_8859_9.lo iso_8859_10.lo iso_8859_11.lo iso_8859_13.lo \ + iso_8859_14.lo iso_8859_15.lo iso_8859_16.lo euc_tw.lo \ + euc_kr.lo big5.lo gb18030.lo koi8_r.lo koi8_u.lo \ + windows_1250.lo windows_1251.lo windows_1252.lo \ + windows_1253.lo windows_1254.lo windows_1257.lo +libonigmo_la_OBJECTS = $(am_libonigmo_la_OBJECTS) +libonigmo_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libonigmo_la_LDFLAGS) $(LDFLAGS) -o $@ +am_testc_OBJECTS = testc.$(OBJEXT) +testc_OBJECTS = $(am_testc_OBJECTS) +testc_DEPENDENCIES = libonigmo.la +am_testcu_OBJECTS = testu.$(OBJEXT) +testcu_OBJECTS = $(am_testcu_OBJECTS) +testcu_DEPENDENCIES = libonigmo.la +am_testp_OBJECTS = testp-testc.$(OBJEXT) +testp_OBJECTS = $(am_testp_OBJECTS) +testp_DEPENDENCIES = libonigmo.la +testp_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(testp_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SCRIPTS = $(bin_SCRIPTS) +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libonigmo_la_SOURCES) $(testc_SOURCES) $(testcu_SOURCES) \ + $(testp_SOURCES) +DIST_SOURCES = $(libonigmo_la_SOURCES) $(testc_SOURCES) \ + $(testcu_SOURCES) $(testp_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DATA = $(pkgconfig_DATA) +HEADERS = $(include_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +am__tty_colors = \ +red=; grn=; lgn=; blu=; std= +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LTVERSION = @LTVERSION@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +RUBYDIR = @RUBYDIR@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STATISTICS = @STATISTICS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +python_prog = @python_prog@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +encdir = $(top_srcdir)/enc +sampledir = $(top_srcdir)/sample +libname = libonigmo.la +PYTHON = @python_prog@ +ACLOCAL_AMFLAGS = -I m4 +AM_CFLAGS = -Wall +AM_CPPFLAGS = -I$(top_srcdir) -I$(includedir) -I$(encdir)/unicode +SUBDIRS = . sample +include_HEADERS = onigmo.h onigmognu.h onigmoposix.h +lib_LTLIBRARIES = $(libname) +libonigmo_la_SOURCES = regint.h regparse.h regenc.h st.h \ + regerror.c regparse.c regext.c regcomp.c regexec.c reggnu.c \ + regenc.c regsyntax.c regtrav.c regversion.c st.c \ + regposix.c regposerr.c \ + $(encdir)/unicode.c $(encdir)/ascii.c $(encdir)/utf_8.c \ + $(encdir)/utf_16be.c $(encdir)/utf_16le.c \ + $(encdir)/utf_32be.c $(encdir)/utf_32le.c \ + $(encdir)/unicode/casefold.h $(encdir)/unicode/name2ctype.h \ + $(encdir)/euc_jp.c $(encdir)/shift_jis.c $(encdir)/shift_jis.h \ + $(encdir)/windows_31j.c \ + $(encdir)/jis/props.h $(encdir)/jis/props.kwd \ + $(encdir)/iso_8859.h $(encdir)/iso_8859_1.c \ + $(encdir)/iso_8859_2.c $(encdir)/iso_8859_3.c \ + $(encdir)/iso_8859_4.c $(encdir)/iso_8859_5.c \ + $(encdir)/iso_8859_6.c $(encdir)/iso_8859_7.c \ + $(encdir)/iso_8859_8.c $(encdir)/iso_8859_9.c \ + $(encdir)/iso_8859_10.c $(encdir)/iso_8859_11.c \ + $(encdir)/iso_8859_13.c $(encdir)/iso_8859_14.c \ + $(encdir)/iso_8859_15.c $(encdir)/iso_8859_16.c \ + $(encdir)/euc_tw.c $(encdir)/euc_kr.c $(encdir)/big5.c \ + $(encdir)/gb18030.c $(encdir)/koi8_r.c $(encdir)/koi8_u.c \ + $(encdir)/windows_1250.c $(encdir)/windows_1251.c \ + $(encdir)/windows_1252.c $(encdir)/windows_1253.c \ + $(encdir)/windows_1254.c $(encdir)/windows_1257.c + +libonigmo_la_LDFLAGS = -version-info $(LTVERSION) -no-undefined +EXTRA_DIST = .gitignore onigmo.pc.in HISTORY README.ja README.md \ + doc/API doc/API.ja doc/RE doc/RE.ja doc/FAQ doc/FAQ.ja \ + doc/UnicodeProps.txt \ + tool/.gitignore tool/Makefile tool/case-folding.rb \ + tool/convert-jis-props.sh \ + tool/enc-unicode.rb tool/download-ucd.sh tool/update-doc.py \ + win32/Makefile win32/Makefile.mingw win32/config.h win32/testc.c \ + win32/makedef.py win32/onigmo.rc \ + $(encdir)/mktable.c \ + test.rb testconv.rb testconvu.rb \ + onigmo.py testpy.py .editorconfig + +bin_SCRIPTS = onigmo-config +do_subst = sed \ + -e 's,[@]datadir[@],$(datadir),g' \ + -e 's,[@]datarootdir[@],$(datarootdir),g' \ + -e 's,[@]PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \ + -e 's,[@]prefix[@],$(prefix),g' \ + -e 's,[@]exec_prefix[@],$(exec_prefix),g' \ + -e 's,[@]libdir[@],$(libdir),g' \ + -e 's,[@]includedir[@],$(includedir),g' + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = onigmo.pc +CLEANFILES = onigmo.pc +testc_SOURCES = testc.c +testc_LDADD = libonigmo.la +testp_SOURCES = testc.c +testp_LDADD = libonigmo.la +testp_CFLAGS = -DPOSIX_TEST +testcu_SOURCES = testu.c +testcu_LDADD = libonigmo.la +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +onigmo-config: $(top_builddir)/config.status $(srcdir)/onigmo-config.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libonigmo.la: $(libonigmo_la_OBJECTS) $(libonigmo_la_DEPENDENCIES) $(EXTRA_libonigmo_la_DEPENDENCIES) + $(libonigmo_la_LINK) -rpath $(libdir) $(libonigmo_la_OBJECTS) $(libonigmo_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +testc$(EXEEXT): $(testc_OBJECTS) $(testc_DEPENDENCIES) $(EXTRA_testc_DEPENDENCIES) + @rm -f testc$(EXEEXT) + $(LINK) $(testc_OBJECTS) $(testc_LDADD) $(LIBS) +testcu$(EXEEXT): $(testcu_OBJECTS) $(testcu_DEPENDENCIES) $(EXTRA_testcu_DEPENDENCIES) + @rm -f testcu$(EXEEXT) + $(LINK) $(testcu_OBJECTS) $(testcu_LDADD) $(LIBS) +testp$(EXEEXT): $(testp_OBJECTS) $(testp_DEPENDENCIES) $(EXTRA_testp_DEPENDENCIES) + @rm -f testp$(EXEEXT) + $(testp_LINK) $(testp_OBJECTS) $(testp_LDADD) $(LIBS) +install-binSCRIPTS: $(bin_SCRIPTS) + @$(NORMAL_INSTALL) + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/big5.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/euc_jp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/euc_kr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/euc_tw.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gb18030.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso_8859_1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso_8859_10.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso_8859_11.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso_8859_13.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso_8859_14.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso_8859_15.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso_8859_16.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso_8859_2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso_8859_3.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso_8859_4.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso_8859_5.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso_8859_6.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso_8859_7.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso_8859_8.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso_8859_9.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/koi8_r.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/koi8_u.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regcomp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regenc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regerror.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regexec.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regext.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reggnu.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regparse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regposerr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regposix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regsyntax.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regtrav.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regversion.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shift_jis.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/st.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testp-testc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testu.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unicode.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf_16be.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf_16le.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf_32be.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf_32le.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf_8.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows_1250.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows_1251.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows_1252.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows_1253.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows_1254.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows_1257.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows_31j.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +unicode.lo: $(encdir)/unicode.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unicode.lo -MD -MP -MF $(DEPDIR)/unicode.Tpo -c -o unicode.lo `test -f '$(encdir)/unicode.c' || echo '$(srcdir)/'`$(encdir)/unicode.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/unicode.Tpo $(DEPDIR)/unicode.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/unicode.c' object='unicode.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unicode.lo `test -f '$(encdir)/unicode.c' || echo '$(srcdir)/'`$(encdir)/unicode.c + +ascii.lo: $(encdir)/ascii.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ascii.lo -MD -MP -MF $(DEPDIR)/ascii.Tpo -c -o ascii.lo `test -f '$(encdir)/ascii.c' || echo '$(srcdir)/'`$(encdir)/ascii.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ascii.Tpo $(DEPDIR)/ascii.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/ascii.c' object='ascii.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ascii.lo `test -f '$(encdir)/ascii.c' || echo '$(srcdir)/'`$(encdir)/ascii.c + +utf_8.lo: $(encdir)/utf_8.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT utf_8.lo -MD -MP -MF $(DEPDIR)/utf_8.Tpo -c -o utf_8.lo `test -f '$(encdir)/utf_8.c' || echo '$(srcdir)/'`$(encdir)/utf_8.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/utf_8.Tpo $(DEPDIR)/utf_8.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/utf_8.c' object='utf_8.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o utf_8.lo `test -f '$(encdir)/utf_8.c' || echo '$(srcdir)/'`$(encdir)/utf_8.c + +utf_16be.lo: $(encdir)/utf_16be.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT utf_16be.lo -MD -MP -MF $(DEPDIR)/utf_16be.Tpo -c -o utf_16be.lo `test -f '$(encdir)/utf_16be.c' || echo '$(srcdir)/'`$(encdir)/utf_16be.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/utf_16be.Tpo $(DEPDIR)/utf_16be.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/utf_16be.c' object='utf_16be.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o utf_16be.lo `test -f '$(encdir)/utf_16be.c' || echo '$(srcdir)/'`$(encdir)/utf_16be.c + +utf_16le.lo: $(encdir)/utf_16le.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT utf_16le.lo -MD -MP -MF $(DEPDIR)/utf_16le.Tpo -c -o utf_16le.lo `test -f '$(encdir)/utf_16le.c' || echo '$(srcdir)/'`$(encdir)/utf_16le.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/utf_16le.Tpo $(DEPDIR)/utf_16le.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/utf_16le.c' object='utf_16le.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o utf_16le.lo `test -f '$(encdir)/utf_16le.c' || echo '$(srcdir)/'`$(encdir)/utf_16le.c + +utf_32be.lo: $(encdir)/utf_32be.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT utf_32be.lo -MD -MP -MF $(DEPDIR)/utf_32be.Tpo -c -o utf_32be.lo `test -f '$(encdir)/utf_32be.c' || echo '$(srcdir)/'`$(encdir)/utf_32be.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/utf_32be.Tpo $(DEPDIR)/utf_32be.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/utf_32be.c' object='utf_32be.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o utf_32be.lo `test -f '$(encdir)/utf_32be.c' || echo '$(srcdir)/'`$(encdir)/utf_32be.c + +utf_32le.lo: $(encdir)/utf_32le.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT utf_32le.lo -MD -MP -MF $(DEPDIR)/utf_32le.Tpo -c -o utf_32le.lo `test -f '$(encdir)/utf_32le.c' || echo '$(srcdir)/'`$(encdir)/utf_32le.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/utf_32le.Tpo $(DEPDIR)/utf_32le.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/utf_32le.c' object='utf_32le.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o utf_32le.lo `test -f '$(encdir)/utf_32le.c' || echo '$(srcdir)/'`$(encdir)/utf_32le.c + +euc_jp.lo: $(encdir)/euc_jp.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT euc_jp.lo -MD -MP -MF $(DEPDIR)/euc_jp.Tpo -c -o euc_jp.lo `test -f '$(encdir)/euc_jp.c' || echo '$(srcdir)/'`$(encdir)/euc_jp.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/euc_jp.Tpo $(DEPDIR)/euc_jp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/euc_jp.c' object='euc_jp.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o euc_jp.lo `test -f '$(encdir)/euc_jp.c' || echo '$(srcdir)/'`$(encdir)/euc_jp.c + +shift_jis.lo: $(encdir)/shift_jis.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT shift_jis.lo -MD -MP -MF $(DEPDIR)/shift_jis.Tpo -c -o shift_jis.lo `test -f '$(encdir)/shift_jis.c' || echo '$(srcdir)/'`$(encdir)/shift_jis.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/shift_jis.Tpo $(DEPDIR)/shift_jis.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/shift_jis.c' object='shift_jis.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o shift_jis.lo `test -f '$(encdir)/shift_jis.c' || echo '$(srcdir)/'`$(encdir)/shift_jis.c + +windows_31j.lo: $(encdir)/windows_31j.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT windows_31j.lo -MD -MP -MF $(DEPDIR)/windows_31j.Tpo -c -o windows_31j.lo `test -f '$(encdir)/windows_31j.c' || echo '$(srcdir)/'`$(encdir)/windows_31j.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/windows_31j.Tpo $(DEPDIR)/windows_31j.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/windows_31j.c' object='windows_31j.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o windows_31j.lo `test -f '$(encdir)/windows_31j.c' || echo '$(srcdir)/'`$(encdir)/windows_31j.c + +iso_8859_1.lo: $(encdir)/iso_8859_1.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso_8859_1.lo -MD -MP -MF $(DEPDIR)/iso_8859_1.Tpo -c -o iso_8859_1.lo `test -f '$(encdir)/iso_8859_1.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_1.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/iso_8859_1.Tpo $(DEPDIR)/iso_8859_1.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso_8859_1.c' object='iso_8859_1.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso_8859_1.lo `test -f '$(encdir)/iso_8859_1.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_1.c + +iso_8859_2.lo: $(encdir)/iso_8859_2.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso_8859_2.lo -MD -MP -MF $(DEPDIR)/iso_8859_2.Tpo -c -o iso_8859_2.lo `test -f '$(encdir)/iso_8859_2.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_2.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/iso_8859_2.Tpo $(DEPDIR)/iso_8859_2.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso_8859_2.c' object='iso_8859_2.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso_8859_2.lo `test -f '$(encdir)/iso_8859_2.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_2.c + +iso_8859_3.lo: $(encdir)/iso_8859_3.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso_8859_3.lo -MD -MP -MF $(DEPDIR)/iso_8859_3.Tpo -c -o iso_8859_3.lo `test -f '$(encdir)/iso_8859_3.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_3.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/iso_8859_3.Tpo $(DEPDIR)/iso_8859_3.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso_8859_3.c' object='iso_8859_3.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso_8859_3.lo `test -f '$(encdir)/iso_8859_3.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_3.c + +iso_8859_4.lo: $(encdir)/iso_8859_4.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso_8859_4.lo -MD -MP -MF $(DEPDIR)/iso_8859_4.Tpo -c -o iso_8859_4.lo `test -f '$(encdir)/iso_8859_4.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_4.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/iso_8859_4.Tpo $(DEPDIR)/iso_8859_4.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso_8859_4.c' object='iso_8859_4.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso_8859_4.lo `test -f '$(encdir)/iso_8859_4.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_4.c + +iso_8859_5.lo: $(encdir)/iso_8859_5.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso_8859_5.lo -MD -MP -MF $(DEPDIR)/iso_8859_5.Tpo -c -o iso_8859_5.lo `test -f '$(encdir)/iso_8859_5.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_5.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/iso_8859_5.Tpo $(DEPDIR)/iso_8859_5.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso_8859_5.c' object='iso_8859_5.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso_8859_5.lo `test -f '$(encdir)/iso_8859_5.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_5.c + +iso_8859_6.lo: $(encdir)/iso_8859_6.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso_8859_6.lo -MD -MP -MF $(DEPDIR)/iso_8859_6.Tpo -c -o iso_8859_6.lo `test -f '$(encdir)/iso_8859_6.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_6.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/iso_8859_6.Tpo $(DEPDIR)/iso_8859_6.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso_8859_6.c' object='iso_8859_6.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso_8859_6.lo `test -f '$(encdir)/iso_8859_6.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_6.c + +iso_8859_7.lo: $(encdir)/iso_8859_7.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso_8859_7.lo -MD -MP -MF $(DEPDIR)/iso_8859_7.Tpo -c -o iso_8859_7.lo `test -f '$(encdir)/iso_8859_7.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_7.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/iso_8859_7.Tpo $(DEPDIR)/iso_8859_7.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso_8859_7.c' object='iso_8859_7.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso_8859_7.lo `test -f '$(encdir)/iso_8859_7.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_7.c + +iso_8859_8.lo: $(encdir)/iso_8859_8.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso_8859_8.lo -MD -MP -MF $(DEPDIR)/iso_8859_8.Tpo -c -o iso_8859_8.lo `test -f '$(encdir)/iso_8859_8.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_8.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/iso_8859_8.Tpo $(DEPDIR)/iso_8859_8.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso_8859_8.c' object='iso_8859_8.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso_8859_8.lo `test -f '$(encdir)/iso_8859_8.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_8.c + +iso_8859_9.lo: $(encdir)/iso_8859_9.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso_8859_9.lo -MD -MP -MF $(DEPDIR)/iso_8859_9.Tpo -c -o iso_8859_9.lo `test -f '$(encdir)/iso_8859_9.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_9.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/iso_8859_9.Tpo $(DEPDIR)/iso_8859_9.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso_8859_9.c' object='iso_8859_9.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso_8859_9.lo `test -f '$(encdir)/iso_8859_9.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_9.c + +iso_8859_10.lo: $(encdir)/iso_8859_10.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso_8859_10.lo -MD -MP -MF $(DEPDIR)/iso_8859_10.Tpo -c -o iso_8859_10.lo `test -f '$(encdir)/iso_8859_10.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_10.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/iso_8859_10.Tpo $(DEPDIR)/iso_8859_10.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso_8859_10.c' object='iso_8859_10.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso_8859_10.lo `test -f '$(encdir)/iso_8859_10.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_10.c + +iso_8859_11.lo: $(encdir)/iso_8859_11.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso_8859_11.lo -MD -MP -MF $(DEPDIR)/iso_8859_11.Tpo -c -o iso_8859_11.lo `test -f '$(encdir)/iso_8859_11.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_11.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/iso_8859_11.Tpo $(DEPDIR)/iso_8859_11.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso_8859_11.c' object='iso_8859_11.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso_8859_11.lo `test -f '$(encdir)/iso_8859_11.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_11.c + +iso_8859_13.lo: $(encdir)/iso_8859_13.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso_8859_13.lo -MD -MP -MF $(DEPDIR)/iso_8859_13.Tpo -c -o iso_8859_13.lo `test -f '$(encdir)/iso_8859_13.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_13.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/iso_8859_13.Tpo $(DEPDIR)/iso_8859_13.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso_8859_13.c' object='iso_8859_13.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso_8859_13.lo `test -f '$(encdir)/iso_8859_13.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_13.c + +iso_8859_14.lo: $(encdir)/iso_8859_14.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso_8859_14.lo -MD -MP -MF $(DEPDIR)/iso_8859_14.Tpo -c -o iso_8859_14.lo `test -f '$(encdir)/iso_8859_14.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_14.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/iso_8859_14.Tpo $(DEPDIR)/iso_8859_14.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso_8859_14.c' object='iso_8859_14.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso_8859_14.lo `test -f '$(encdir)/iso_8859_14.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_14.c + +iso_8859_15.lo: $(encdir)/iso_8859_15.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso_8859_15.lo -MD -MP -MF $(DEPDIR)/iso_8859_15.Tpo -c -o iso_8859_15.lo `test -f '$(encdir)/iso_8859_15.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_15.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/iso_8859_15.Tpo $(DEPDIR)/iso_8859_15.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso_8859_15.c' object='iso_8859_15.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso_8859_15.lo `test -f '$(encdir)/iso_8859_15.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_15.c + +iso_8859_16.lo: $(encdir)/iso_8859_16.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso_8859_16.lo -MD -MP -MF $(DEPDIR)/iso_8859_16.Tpo -c -o iso_8859_16.lo `test -f '$(encdir)/iso_8859_16.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_16.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/iso_8859_16.Tpo $(DEPDIR)/iso_8859_16.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso_8859_16.c' object='iso_8859_16.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso_8859_16.lo `test -f '$(encdir)/iso_8859_16.c' || echo '$(srcdir)/'`$(encdir)/iso_8859_16.c + +euc_tw.lo: $(encdir)/euc_tw.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT euc_tw.lo -MD -MP -MF $(DEPDIR)/euc_tw.Tpo -c -o euc_tw.lo `test -f '$(encdir)/euc_tw.c' || echo '$(srcdir)/'`$(encdir)/euc_tw.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/euc_tw.Tpo $(DEPDIR)/euc_tw.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/euc_tw.c' object='euc_tw.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o euc_tw.lo `test -f '$(encdir)/euc_tw.c' || echo '$(srcdir)/'`$(encdir)/euc_tw.c + +euc_kr.lo: $(encdir)/euc_kr.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT euc_kr.lo -MD -MP -MF $(DEPDIR)/euc_kr.Tpo -c -o euc_kr.lo `test -f '$(encdir)/euc_kr.c' || echo '$(srcdir)/'`$(encdir)/euc_kr.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/euc_kr.Tpo $(DEPDIR)/euc_kr.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/euc_kr.c' object='euc_kr.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o euc_kr.lo `test -f '$(encdir)/euc_kr.c' || echo '$(srcdir)/'`$(encdir)/euc_kr.c + +big5.lo: $(encdir)/big5.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT big5.lo -MD -MP -MF $(DEPDIR)/big5.Tpo -c -o big5.lo `test -f '$(encdir)/big5.c' || echo '$(srcdir)/'`$(encdir)/big5.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/big5.Tpo $(DEPDIR)/big5.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/big5.c' object='big5.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o big5.lo `test -f '$(encdir)/big5.c' || echo '$(srcdir)/'`$(encdir)/big5.c + +gb18030.lo: $(encdir)/gb18030.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gb18030.lo -MD -MP -MF $(DEPDIR)/gb18030.Tpo -c -o gb18030.lo `test -f '$(encdir)/gb18030.c' || echo '$(srcdir)/'`$(encdir)/gb18030.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/gb18030.Tpo $(DEPDIR)/gb18030.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/gb18030.c' object='gb18030.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gb18030.lo `test -f '$(encdir)/gb18030.c' || echo '$(srcdir)/'`$(encdir)/gb18030.c + +koi8_r.lo: $(encdir)/koi8_r.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT koi8_r.lo -MD -MP -MF $(DEPDIR)/koi8_r.Tpo -c -o koi8_r.lo `test -f '$(encdir)/koi8_r.c' || echo '$(srcdir)/'`$(encdir)/koi8_r.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/koi8_r.Tpo $(DEPDIR)/koi8_r.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/koi8_r.c' object='koi8_r.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o koi8_r.lo `test -f '$(encdir)/koi8_r.c' || echo '$(srcdir)/'`$(encdir)/koi8_r.c + +koi8_u.lo: $(encdir)/koi8_u.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT koi8_u.lo -MD -MP -MF $(DEPDIR)/koi8_u.Tpo -c -o koi8_u.lo `test -f '$(encdir)/koi8_u.c' || echo '$(srcdir)/'`$(encdir)/koi8_u.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/koi8_u.Tpo $(DEPDIR)/koi8_u.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/koi8_u.c' object='koi8_u.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o koi8_u.lo `test -f '$(encdir)/koi8_u.c' || echo '$(srcdir)/'`$(encdir)/koi8_u.c + +windows_1250.lo: $(encdir)/windows_1250.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT windows_1250.lo -MD -MP -MF $(DEPDIR)/windows_1250.Tpo -c -o windows_1250.lo `test -f '$(encdir)/windows_1250.c' || echo '$(srcdir)/'`$(encdir)/windows_1250.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/windows_1250.Tpo $(DEPDIR)/windows_1250.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/windows_1250.c' object='windows_1250.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o windows_1250.lo `test -f '$(encdir)/windows_1250.c' || echo '$(srcdir)/'`$(encdir)/windows_1250.c + +windows_1251.lo: $(encdir)/windows_1251.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT windows_1251.lo -MD -MP -MF $(DEPDIR)/windows_1251.Tpo -c -o windows_1251.lo `test -f '$(encdir)/windows_1251.c' || echo '$(srcdir)/'`$(encdir)/windows_1251.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/windows_1251.Tpo $(DEPDIR)/windows_1251.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/windows_1251.c' object='windows_1251.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o windows_1251.lo `test -f '$(encdir)/windows_1251.c' || echo '$(srcdir)/'`$(encdir)/windows_1251.c + +windows_1252.lo: $(encdir)/windows_1252.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT windows_1252.lo -MD -MP -MF $(DEPDIR)/windows_1252.Tpo -c -o windows_1252.lo `test -f '$(encdir)/windows_1252.c' || echo '$(srcdir)/'`$(encdir)/windows_1252.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/windows_1252.Tpo $(DEPDIR)/windows_1252.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/windows_1252.c' object='windows_1252.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o windows_1252.lo `test -f '$(encdir)/windows_1252.c' || echo '$(srcdir)/'`$(encdir)/windows_1252.c + +windows_1253.lo: $(encdir)/windows_1253.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT windows_1253.lo -MD -MP -MF $(DEPDIR)/windows_1253.Tpo -c -o windows_1253.lo `test -f '$(encdir)/windows_1253.c' || echo '$(srcdir)/'`$(encdir)/windows_1253.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/windows_1253.Tpo $(DEPDIR)/windows_1253.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/windows_1253.c' object='windows_1253.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o windows_1253.lo `test -f '$(encdir)/windows_1253.c' || echo '$(srcdir)/'`$(encdir)/windows_1253.c + +windows_1254.lo: $(encdir)/windows_1254.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT windows_1254.lo -MD -MP -MF $(DEPDIR)/windows_1254.Tpo -c -o windows_1254.lo `test -f '$(encdir)/windows_1254.c' || echo '$(srcdir)/'`$(encdir)/windows_1254.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/windows_1254.Tpo $(DEPDIR)/windows_1254.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/windows_1254.c' object='windows_1254.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o windows_1254.lo `test -f '$(encdir)/windows_1254.c' || echo '$(srcdir)/'`$(encdir)/windows_1254.c + +windows_1257.lo: $(encdir)/windows_1257.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT windows_1257.lo -MD -MP -MF $(DEPDIR)/windows_1257.Tpo -c -o windows_1257.lo `test -f '$(encdir)/windows_1257.c' || echo '$(srcdir)/'`$(encdir)/windows_1257.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/windows_1257.Tpo $(DEPDIR)/windows_1257.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/windows_1257.c' object='windows_1257.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o windows_1257.lo `test -f '$(encdir)/windows_1257.c' || echo '$(srcdir)/'`$(encdir)/windows_1257.c + +testp-testc.o: testc.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testp_CFLAGS) $(CFLAGS) -MT testp-testc.o -MD -MP -MF $(DEPDIR)/testp-testc.Tpo -c -o testp-testc.o `test -f 'testc.c' || echo '$(srcdir)/'`testc.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/testp-testc.Tpo $(DEPDIR)/testp-testc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testc.c' object='testp-testc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testp_CFLAGS) $(CFLAGS) -c -o testp-testc.o `test -f 'testc.c' || echo '$(srcdir)/'`testc.c + +testp-testc.obj: testc.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testp_CFLAGS) $(CFLAGS) -MT testp-testc.obj -MD -MP -MF $(DEPDIR)/testp-testc.Tpo -c -o testp-testc.obj `if test -f 'testc.c'; then $(CYGPATH_W) 'testc.c'; else $(CYGPATH_W) '$(srcdir)/testc.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/testp-testc.Tpo $(DEPDIR)/testp-testc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testc.c' object='testp-testc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testp_CFLAGS) $(CFLAGS) -c -o testp-testc.obj `if test -f 'testc.c'; then $(CYGPATH_W) 'testc.c'; else $(CYGPATH_W) '$(srcdir)/testc.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) +install-includeHEADERS: $(include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ + done + +uninstall-includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + $(am__tty_colors); \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$tst[\ \ ]*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + col=$$red; res=XPASS; \ + ;; \ + *) \ + col=$$grn; res=PASS; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$tst[\ \ ]*) \ + xfail=`expr $$xfail + 1`; \ + col=$$lgn; res=XFAIL; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + col=$$red; res=FAIL; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + col=$$blu; res=SKIP; \ + fi; \ + echo "$${col}$$res$${std}: $$tst"; \ + done; \ + if test "$$all" -eq 1; then \ + tests="test"; \ + All=""; \ + else \ + tests="tests"; \ + All="All "; \ + fi; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="$$All$$all $$tests passed"; \ + else \ + if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ + banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all $$tests failed"; \ + else \ + if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ + banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + if test "$$skip" -eq 1; then \ + skipped="($$skip test was not run)"; \ + else \ + skipped="($$skip tests were not run)"; \ + fi; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + if test "$$failed" -eq 0; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + fi; \ + echo "$${col}$$dashes$${std}"; \ + echo "$${col}$$banner$${std}"; \ + test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ + test -z "$$report" || echo "$${col}$$report$${std}"; \ + echo "$${col}$$dashes$${std}"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__remove_distdir) + +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod u+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-recursive +all-am: Makefile $(LTLIBRARIES) $(SCRIPTS) $(DATA) $(HEADERS) config.h +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-includeHEADERS install-pkgconfigDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-binSCRIPTS install-libLTLIBRARIES + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-binSCRIPTS uninstall-includeHEADERS \ + uninstall-libLTLIBRARIES uninstall-pkgconfigDATA + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check-am \ + ctags-recursive install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ + dist-zip distcheck distclean distclean-compile \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-binSCRIPTS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-includeHEADERS install-info \ + install-info-am install-libLTLIBRARIES install-man install-pdf \ + install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-binSCRIPTS \ + uninstall-includeHEADERS uninstall-libLTLIBRARIES \ + uninstall-pkgconfigDATA + + +onigmo-config: onigmo-config.in + +onigmo.pc: $(srcdir)/onigmo.pc.in Makefile + $(do_subst) < $(srcdir)/onigmo.pc.in > $(@) + +# character-types-table source generator +mktable: $(encdir)/mktable.c $(srcdir)/regenc.h + $(CC) -I$(top_srcdir) -o mktable $(encdir)/mktable.c + +test: atest pytest + $(MAKE) -C sample test + +atest: testc$(EXEEXT) testp$(EXEEXT) testcu$(EXEEXT) + @echo "[Onigmo API, ASCII/EUC-JP check]" + @$(top_builddir)/testc | grep RESULT + @echo "[POSIX API, ASCII/EUC-JP check]" + @$(top_builddir)/testp | grep RESULT + @echo "[Onigmo API, UTF-16 check]" + @$(top_builddir)/testcu | grep RESULT + +#$(srcdir)/testc.c: $(srcdir)/test.rb $(srcdir)/testconv.rb +$(srcdir)/testc.c: + ruby -Ke $(srcdir)/testconv.rb < $(srcdir)/test.rb > $@ + +#$(srcdir)/testu.c: $(srcdir)/test.rb $(srcdir)/testconvu.rb +$(srcdir)/testu.c: + ruby -Ke $(srcdir)/testconvu.rb $(srcdir)/test.rb > $@ + +#$(srcdir)/win32/testc.c: $(srcdir)/test.rb $(srcdir)/testconv.rb +$(srcdir)/win32/testc.c: + ruby -Ke $(srcdir)/testconv.rb -win < $(srcdir)/test.rb | iconv -f euc-jp -t cp932 | sed -e "s/$$/\r/" > $@ + +# Python TEST +pytest: + LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py EUC-JP + LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py SJIS + LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py UTF-8 + LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py UTF-16LE + LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py UTF-16BE + LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py UTF-32LE + LD_LIBRARY_PATH=.libs $(PYTHON) $(srcdir)/testpy.py UTF-32BE + +# lcov + +# Collect coverage data and write to coverage.info, then create HTML output +# in the coverage directory. +lcov: + if [ ! -f $(builddir)/enc/jis/props.kwd ]; then mkdir -p $(builddir)/enc/jis; cp $(srcdir)/enc/jis/props.kwd $(builddir)/enc/jis/props.kwd; fi + lcov -c -d .libs -o coverage.info + genhtml -o coverage coverage.info + +# Clear coverage data. +lcov-clear: + lcov -d . -z + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/lib/edbee-lib/vendor/onig/README b/lib/edbee-lib/vendor/onig/README new file mode 100644 index 00000000..87a48fa2 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/README @@ -0,0 +1,251 @@ +README 2016/11/30 + +Onigmo (Oniguruma-mod) -- (C) K.Takata <kentkt AT csc DOT jp> + +https://github.com/k-takata/Onigmo + +Onigmo is a regular expressions library forked from Oniguruma. +It focuses to support new expressions like `\K`, `\R`, `(?(cond)yes|no)` +and etc. which are supported in Perl 5.10+. + +Since Onigmo is used as the default regexp library of Ruby 2.0 or later, +many patches are backported from Ruby 2.x. + +See also the Wiki page: +https://github.com/k-takata/Onigmo/wiki + + +Main New features: + Regular Expressions (depends on the syntax): + \K, \R, \X, (?(cond)yes|no) + (?adlu), \g{name}, \g{n}, (?&name), (?n), (?R), (?0) + (?P<name>...), (?P=name), (?P>name) + + API: + onig_search_gpos (for Perl-compatible \G) + + Encoding: + CP932, CP1250, CP1251, CP1252, CP1253, CP1254, CP1257 + + Syntax: + Python + + +New Source Files: + enc/jis/props.h JIS character properties data. + enc/jis/props.kwd JIS character properties data. + enc/unicode/casefold.h Unicode case folding data. + enc/unicode/name2ctype.h Unicode properties data. + enc/windows_*.c CP* encoding + + onigmo.py onigmo.dll/libonigmo.so loader. + testpy.py test program. + + tool/download-ucd.sh downloads Unicode Character Database (UCD). + tool/case-folding.rb generates casefold.h from UCD. + tool/convert-jis-props.sh converts props.kwd to props.h. + tool/convert-name2ctype.sh converts name2ctype.kwd to name2ctypes.h. + tool/enc-unicode.rb generates name2ctype.kwd from UCD. + + win32/Makefile.mingw Makefile for Win32 (MinGW) + win32/makedef.py creates onigmo.def. + win32/onigmo.rc resource file for onigmo.dll. + + +ToDo: + * Reduce the size of Unicode Character Data. + * (?|...) + * Improve (?(cond)yes|no). (support look-ahead/behind assertions.) + + +Oniguruma's README follows: +====================================================================== +README 2007/05/31 + +Oniguruma ---- (C) K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + +http://www.geocities.jp/kosako3/oniguruma/ + +Oniguruma is a regular expressions library. +The characteristics of this library is that different character encoding +for every regular expression object can be specified. + +Supported character encodings: + + ASCII, UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE, + EUC-JP, EUC-TW, EUC-KR, EUC-CN, + Shift_JIS, Big5, GB18030, KOI8-R, CP1251, + ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5, + ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-10, + ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16 + +* GB18030: contributed by KUBO Takehiro +* CP1251: contributed by Byte +------------------------------------------------------------ + +License + + BSD license. + + +Install + + Case 1: Unix and Cygwin platform + + 1. ./configure + 2. make + 3. make install + + * uninstall + + make uninstall + + * test (ASCII/EUC-JP) + + make atest + + * configuration check + + onig-config --cflags + onig-config --libs + onig-config --prefix + onig-config --exec-prefix + + + + Case 2: Win32 platform (VC++) + + 1. copy win32\Makefile Makefile + 2. copy win32\config.h config.h + 3. nmake + + onig_s.lib: static link library + onig.dll: dynamic link library + + * test (ASCII/Shift_JIS) + 4. copy win32\testc.c testc.c + 5. nmake ctest + + + +Regular Expressions + + See doc/RE (or doc/RE.ja for Japanese). + + +Usage + + Include oniguruma.h in your program. (Oniguruma API) + See doc/API for Oniguruma API. + + If you want to disable UChar type (== unsigned char) definition + in oniguruma.h, define ONIG_ESCAPE_UCHAR_COLLISION and then + include oniguruma.h. + + If you want to disable regex_t type definition in oniguruma.h, + define ONIG_ESCAPE_REGEX_T_COLLISION and then include oniguruma.h. + + Example of the compiling/linking command line in Unix or Cygwin, + (prefix == /usr/local case) + + cc sample.c -L/usr/local/lib -lonig + + + If you want to use static link library(onig_s.lib) in Win32, + add option -DONIG_EXTERN=extern to C compiler. + + + +Sample Programs + + sample/simple.c example of the minimum (Oniguruma API) + sample/names.c example of the named group callback. + sample/encode.c example of some encodings. + sample/listcap.c example of the capture history. + sample/posix.c POSIX API sample. + sample/sql.c example of the variable meta characters. + (SQL-like pattern matching) + +Test Programs + sample/syntax.c Perl, Java and ASIS syntax test. + sample/crnl.c --enable-crnl-as-line-terminator test + + +Source Files + + oniguruma.h Oniguruma API header file. (public) + onig-config.in configuration check program template. + + regenc.h character encodings framework header file. + regint.h internal definitions + regparse.h internal definitions for regparse.c and regcomp.c + regcomp.c compiling and optimization functions + regenc.c character encodings framework. + regerror.c error message function + regext.c extended API functions. (deluxe version API) + regexec.c search and match functions + regparse.c parsing functions. + regsyntax.c pattern syntax functions and built-in syntax definitions. + regtrav.c capture history tree data traverse functions. + regversion.c version info function. + st.h hash table functions header file + st.c hash table functions + + oniggnu.h GNU regex API header file. (public) + reggnu.c GNU regex API functions + + onigposix.h POSIX API header file. (public) + regposerr.c POSIX error message function. + regposix.c POSIX API functions. + + enc/mktable.c character type table generator. + enc/ascii.c ASCII encoding. + enc/euc_jp.c EUC-JP encoding. + enc/euc_tw.c EUC-TW encoding. + enc/euc_kr.c EUC-KR, EUC-CN encoding. + enc/sjis.c Shift_JIS encoding. + enc/big5.c Big5 encoding. + enc/gb18030.c GB18030 encoding. + enc/koi8.c KOI8 encoding. + enc/koi8_r.c KOI8-R encoding. + enc/cp1251.c CP1251 encoding. + enc/iso8859_1.c ISO-8859-1 encoding. (Latin-1) + enc/iso8859_2.c ISO-8859-2 encoding. (Latin-2) + enc/iso8859_3.c ISO-8859-3 encoding. (Latin-3) + enc/iso8859_4.c ISO-8859-4 encoding. (Latin-4) + enc/iso8859_5.c ISO-8859-5 encoding. (Cyrillic) + enc/iso8859_6.c ISO-8859-6 encoding. (Arabic) + enc/iso8859_7.c ISO-8859-7 encoding. (Greek) + enc/iso8859_8.c ISO-8859-8 encoding. (Hebrew) + enc/iso8859_9.c ISO-8859-9 encoding. (Latin-5 or Turkish) + enc/iso8859_10.c ISO-8859-10 encoding. (Latin-6 or Nordic) + enc/iso8859_11.c ISO-8859-11 encoding. (Thai) + enc/iso8859_13.c ISO-8859-13 encoding. (Latin-7 or Baltic Rim) + enc/iso8859_14.c ISO-8859-14 encoding. (Latin-8 or Celtic) + enc/iso8859_15.c ISO-8859-15 encoding. (Latin-9 or West European with Euro) + enc/iso8859_16.c ISO-8859-16 encoding. + (Latin-10 or South-Eastern European with Euro) + enc/utf8.c UTF-8 encoding. + enc/utf16_be.c UTF-16BE encoding. + enc/utf16_le.c UTF-16LE encoding. + enc/utf32_be.c UTF-32BE encoding. + enc/utf32_le.c UTF-32LE encoding. + enc/unicode.c Unicode information data. + + win32/Makefile Makefile for Win32 (VC++) + win32/config.h config.h for Win32 + + + +ToDo + + ? case fold flag: Katakana <-> Hiragana. + ? add ONIG_OPTION_NOTBOS/NOTEOS. (\A, \z, \Z) + ?? \X (== \PM\pM*) + ?? implement syntax behavior ONIG_SYN_CONTEXT_INDEP_ANCHORS. + ?? transmission stopper. (return ONIG_STOP from match_at()) + +and I'm thankful to Akinori MUSHA. + + +Mail Address: K.Kosako <sndgk393 AT ybb DOT ne DOT jp> diff --git a/lib/edbee-lib/vendor/onig/README.ja b/lib/edbee-lib/vendor/onig/README.ja new file mode 100644 index 00000000..f30e08a2 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/README.ja @@ -0,0 +1,257 @@ +README.ja 2016/11/30 + +鬼雲 (鬼車改) -- (C) K.Takata <kentkt AT csc DOT jp> + +https://github.com/k-takata/Onigmo + +鬼雲は、鬼車から派生した正規表現ライブラリである。 +Perl 5.10以降で導入された `\K`, `\R`, `(?(cond)yes|no)` などの新たな +正規表現をサポートすることに注力している。 + +鬼雲は、Ruby 2.0以降の標準の正規表現ライブラリであるため、多くのパッチが +Ruby 2.xからバックポートされている。 + +Wikiページも参照のこと。 +https://github.com/k-takata/Onigmo/wiki + + +主な新機能: + 正規表現 (文法依存): + \K, \R, \X, (?(cond)yes|no) + (?adlu), \g{name}, \g{n}, (?&name), (?n), (?R), (?0) + (?P<name>...), (?P=name), (?P>name) + + API: + onig_search_gpos (Perl互換の \G 用) + + エンコーディング: + CP932, CP1250, CP1251, CP1252, CP1253, CP1254, CP1257 + + 文法: + Python + + +新規ソースファイル: + enc/jis/props.h JIS 文字プロパティーデータ + enc/jis/props.kwd JIS 文字プロパティーデータ + enc/unicode/casefold.h Unicodeケースフォールドデータ + enc/unicode/name2ctype.h Unicodeプロパティデータ + enc/windows_*.c CP*エンコーディング + + onigmo.py onigmo.dll/libonigmo.so ローダ + testpy.py テストプログラム + + tool/download-ucd.sh Unicode Character Database (UCD)をダウンロード + tool/case-folding.rb UCDからcasefold.hを生成 + tool/convert-jis-props.sh props.kwdをprops.hに変換 + tool/convert-name2ctype.sh name2ctype.kwdをname2ctypes.hに変換 + tool/enc-unicode.rb UCDからname2ctype.kwdを生成 + + win32/Makefile.mingw Win32用 Makefile (for MinGW) + win32/makedef.py onigmo.defを作成 + win32/onigmo.rc onigmo.dll用リソースファイル + + +ToDo: + * Unicode Character Data のサイズ削減。 + * (?|...) + * (?(cond)yes|no) の改善。(先読み・戻り読みの対応) + + +以下、鬼車の README.ja: +====================================================================== +README.ja 2007/05/31 + +鬼車 ---- (C) K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + +http://www.geocities.jp/kosako3/oniguruma/ + +鬼車は正規表現ライブラリである。 +このライブラリの特長は、それぞれの正規表現オブジェクトごとに +文字エンコーディングを指定できることである。 + +サポートしている文字エンコーディング: + + ASCII, UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE, + EUC-JP, EUC-TW, EUC-KR, EUC-CN, + Shift_JIS, Big5, GB18030, KOI8-R, CP1251, + ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5, + ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-10, + ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16 + +* GB18030: 久保健洋氏提供 +* CP1251: Byte氏提供 +------------------------------------------------------------ + +ライセンス + + BSDライセンスに従う。 + + +インストール + + ケース1: UnixとCygwin環境 + + 1. ./configure + 2. make + 3. make install + + アンインストール + + make uninstall + + 動作テスト (ASCII/EUC-JP) + + make atest + + + 構成確認 + + onig-config --cflags + onig-config --libs + onig-config --prefix + onig-config --exec-prefix + + + + ケース2: Win32(VC++)環境 + + 1. copy win32\Makefile Makefile + 2. copy win32\config.h config.h + 3. nmake + + onig_s.lib: static link library + onig.dll: dynamic link library + + * 動作テスト (ASCII/Shift_JIS) + 4. copy win32\testc.c testc.c + 5. nmake ctest + + + +正規表現 + + doc/RE.jaを参照 + + +使用方法 + + 使用するプログラムで、oniguruma.hをインクルードする(Oniguruma APIの場合)。 + Oniguruma APIについては、doc/API.jaを参照。 + + oniguruma.hで定義されている型名UChar(== unsigned char)を無効にしたい場合 + には、ONIG_ESCAPE_UCHAR_COLLISIONをdefineしてからoniguruma.hをインクルード + すること。このときにはUCharは定義されず、OnigUCharという名前の定義のみが + 有効になる。 + + oniguruma.hで定義されている型名regex_tを無効にしたい場合には、 + ONIG_ESCAPE_REGEX_T_COLLISIONをdefineしてからoniguruma.hをインクルード + すること。このときにはregex_tは定義されず、OnigRegexType, OnigRegexという + 名前の定義のみが有効になる。 + + Unix/Cygwin上でコンパイル、リンクする場合の例: + (prefixが/usr/localのとき) + cc sample.c -L/usr/local/lib -lonig + + GNU libtoolを使用しているので、プラットフォームが共有ライブラリをサポートして + いれば、使用できるようになっている。 + 静的ライブラリと共有ライブラリのどちらを使用するかを指定する方法、実行時点での + 環境設定方法については、自分で調べて下さい。 + + + Win32でスタティックリンクライブラリ(onig_s.lib)をリンクする場合には、 + コンパイルするときに -DONIG_EXTERN=extern をコンパイル引数に追加すること。 + + +使用例プログラム + + sample/simple.c 最小例 (Oniguruma API) + sample/names.c 名前付きグループコールバック使用例 + sample/encode.c 幾つかの文字エンコーディング使用例 + sample/listcap.c 捕獲履歴機能の使用例 + sample/posix.c POSIX API使用例 + sample/sql.c 可変メタ文字機能使用例 (SQL-like パターン) + +テストプログラム + sample/syntax.c Perl、Java、ASIS文法のテスト + sample/crnl.c --enable-crnl-as-line-terminator テスト + + +ソースファイル + + oniguruma.h 鬼車APIヘッダ (公開) + onig-config.in onig-configプログラム テンプレート + + regenc.h 文字エンコーディング枠組みヘッダ + regint.h 内部宣言 + regparse.h regparse.cとregcomp.cのための内部宣言 + regcomp.c コンパイル、最適化関数 + regenc.c 文字エンコーディング枠組み + regerror.c エラーメッセージ関数 + regext.c 拡張API関数 + regexec.c 検索、照合関数 + regparse.c 正規表現パターン解析関数 + regsyntax.c 正規表現パターン文法関数、組込み文法定義 + regtrav.c 捕獲履歴木巡回関数 + regversion.c 版情報関数 + st.h ハッシュテーブル関数宣言 + st.c ハッシュテーブル関数 + + oniggnu.h GNU regex APIヘッダ (公開) + reggnu.c GNU regex API関数 + + onigposix.h POSIX APIヘッダ (公開) + regposerr.c POSIX APIエラーメッセージ関数 + regposix.c POSIX API関数 + + enc/mktable.c 文字タイプテーブル生成プログラム + enc/ascii.c ASCII エンコーディング + enc/euc_jp.c EUC-JP エンコーディング + enc/euc_tw.c EUC-TW エンコーディング + enc/euc_kr.c EUC-KR, EUC-CN エンコーディング + enc/sjis.c Shift_JIS エンコーディング + enc/big5.c Big5 エンコーディング + enc/gb18030.c GB18030 エンコーディング + enc/koi8.c KOI8 エンコーディング + enc/koi8_r.c KOI8-R エンコーディング + enc/cp1251.c CP1251 エンコーディング + enc/iso8859_1.c ISO-8859-1 (Latin-1) + enc/iso8859_2.c ISO-8859-2 (Latin-2) + enc/iso8859_3.c ISO-8859-3 (Latin-3) + enc/iso8859_4.c ISO-8859-4 (Latin-4) + enc/iso8859_5.c ISO-8859-5 (Cyrillic) + enc/iso8859_6.c ISO-8859-6 (Arabic) + enc/iso8859_7.c ISO-8859-7 (Greek) + enc/iso8859_8.c ISO-8859-8 (Hebrew) + enc/iso8859_9.c ISO-8859-9 (Latin-5 または Turkish) + enc/iso8859_10.c ISO-8859-10 (Latin-6 または Nordic) + enc/iso8859_11.c ISO-8859-11 (Thai) + enc/iso8859_13.c ISO-8859-13 (Latin-7 または Baltic Rim) + enc/iso8859_14.c ISO-8859-14 (Latin-8 または Celtic) + enc/iso8859_15.c ISO-8859-15 (Latin-9 または West European with Euro) + enc/iso8859_16.c ISO-8859-16 + (Latin-10 または South-Eastern European with Euro) + enc/utf8.c UTF-8 エンコーディング + enc/utf16_be.c UTF-16BE エンコーディング + enc/utf16_le.c UTF-16LE エンコーディング + enc/utf32_be.c UTF-32BE エンコーディング + enc/utf32_le.c UTF-32LE エンコーディング + enc/unicode.c Unicode情報 + + win32/Makefile Win32用 Makefile (for VC++) + win32/config.h Win32用 config.h + + + +残件 + + ? case fold flag: Katakana <-> Hiragana + ? ONIG_OPTION_NOTBOS/NOTEOS追加 (\A, \z, \Z) + ?? \X (== \PM\pM*) + ?? 文法要素 ONIG_SYN_CONTEXT_INDEP_ANCHORSの実装 + ?? 検索位置移動停止演算子 (match_at()からONIG_STOPを返す) + +and I'm thankful to Akinori MUSHA. + + +アドレス: K.Kosako <sndgk393 AT ybb DOT ne DOT jp> diff --git a/lib/edbee-lib/vendor/onig/README.md b/lib/edbee-lib/vendor/onig/README.md new file mode 100644 index 00000000..ed705dad --- /dev/null +++ b/lib/edbee-lib/vendor/onig/README.md @@ -0,0 +1,217 @@ +[![Build Status](https://travis-ci.org/k-takata/Onigmo.svg?branch=master)](https://travis-ci.org/k-takata/Onigmo) +[![Build status](https://ci.appveyor.com/api/projects/status/kndb924qaw1hq72i/branch/master?svg=true)](https://ci.appveyor.com/project/k-takata/onigmo/branch/master) +[![Coverage Status](https://coveralls.io/repos/k-takata/Onigmo/badge.svg?branch=master&service=github)](https://coveralls.io/github/k-takata/Onigmo?branch=master) +[![Coverity Scan Build Status](https://scan.coverity.com/projects/2778/badge.svg)](https://scan.coverity.com/projects/k-takata-onigmo) + +Onigmo (Oniguruma-mod) +====================== + +https://github.com/k-takata/Onigmo + +Onigmo is a regular expressions library forked from [Oniguruma](https://github.com/kkos/oniguruma). +It focuses to support new expressions like `\K`, `\R`, `(?(cond)yes|no)` +and etc. which are supported in Perl 5.10+. + +Since Onigmo is used as the default regexp library of Ruby 2.0 or later, +many patches are backported from Ruby 2.x. + +See also the Wiki page: +https://github.com/k-takata/Onigmo/wiki + + +License +------- + + BSD license. + + +Install +------- + +### Case 1: Unix and Cygwin platform + + 1. `./configure` + 2. `make` + 3. `make install` + + * test + + make test + + * uninstall + + make uninstall + + * configuration check + + onigmo-config --cflags + onigmo-config --libs + onigmo-config --prefix + onigmo-config --exec-prefix + + +### Case 2: Windows 64/32bit platform (Visual C++) + + Execute `build_nmake.cmd`. + `build_x64` or `build_x86` will be used as a working/output directory. + + onigmo_s.lib: static link library + onigmo.lib: import library for dynamic link + onigmo.dll: dynamic link library + + * test (ASCII/Shift_JIS/EUC-JP/Unicode) + + Execute `build_nmake.cmd test`. + Python (with the same bitness of Onigmo) is needed to run the tests. + + +### Case 3: Windows 64/32bit platform (MinGW) + + Execute `mingw32-make -f win32/Makefile.mingw`. + `build_x86-64`, `build_i686` and etc. will be used as a working/output + directory. + + libonigmo.a: static link library + libonigmo.dll.a: import library for dynamic link + onigmo.dll: dynamic link library + + * test (ASCII/Shift_JIS/EUC-JP/Unicode) + + Execute `mingw32-make -f win32/Makefile.mingw test`. + Python (with the same bitness of Onigmo) is needed to run the tests. + + * If you use MinGW on MSYS2, you can also use `./configure` and `make` + like Unix. In this case, DLL name will have API version number. E.g.: + + libonigmo-6.dll + + +Regular Expressions +------------------- + + See [doc/RE](doc/RE) or [doc/RE.ja](doc/RE.ja) for Japanese. + + +Usage +----- + + Include onigmo.h in your program. (Onigmo API) + See [doc/API](doc/API) for Onigmo API. + + If you want to disable `UChar` type (== `unsigned char`) definition + in onigmo.h, define `ONIG_ESCAPE_UCHAR_COLLISION` and then + include onigmo.h. + + If you want to disable `regex_t` type definition in onigmo.h, + define `ONIG_ESCAPE_REGEX_T_COLLISION` and then include onigmo.h. + + Example of the compiling/linking command line in Unix or Cygwin, + (prefix == /usr/local case) + + cc sample.c -L/usr/local/lib -lonigmo + + + If you want to use static link library (onigmo_s.lib) in Win32, + add option `-DONIG_EXTERN=extern` to C compiler. + + + +Sample Programs +--------------- + +|File |Description | +|:---------------------|:-----------------------------------------| +|sample/simple.c |example of the minimum (Onigmo API) | +|sample/names.c |example of the named group callback. | +|sample/encode.c |example of some encodings. | +|sample/listcap.c |example of the capture history. | +|sample/posix.c |POSIX API sample. | +|sample/sql.c |example of the variable meta characters. | + + +Test Programs + +|File |Description | +|:------------------|:--------------------------------------| +|sample/syntax.c |Perl, Java and ASIS syntax test. | +|sample/crnl.c |CRNL test | + + + +Source Files +------------ + +|File |Description | +|:-------------------|:------------------------------------------------------| +|onigmo.h |Onigmo API header file (public) | +|onigmo-config.in |configuration check program template | +|onigmo.py |Onigmo module for Python | +|regenc.h |character encodings framework header file | +|regint.h |internal definitions | +|regparse.h |internal definitions for regparse.c and regcomp.c | +|regcomp.c |compiling and optimization functions | +|regenc.c |character encodings framework | +|regerror.c |error message function | +|regext.c |extended API functions (deluxe version API) | +|regexec.c |search and match functions | +|regparse.c |parsing functions. | +|regsyntax.c |pattern syntax functions and built-in syntax definition| +|regtrav.c |capture history tree data traverse functions | +|regversion.c |version info function | +|st.h |hash table functions header file | +|st.c |hash table functions | +|onigmognu.h |GNU regex API header file (public) | +|reggnu.c |GNU regex API functions | +|onigmoposix.h |POSIX API header file (public) | +|regposerr.c |POSIX error message function | +|regposix.c |POSIX API functions | +|enc/mktable.c |character type table generator | +|enc/ascii.c |ASCII-8BIT encoding | +|enc/jis/ |JIS properties data | +|enc/euc_jp.c |EUC-JP encoding | +|enc/euc_tw.c |EUC-TW encoding | +|enc/euc_kr.c |EUC-KR, EUC-CN encoding | +|enc/shift_jis.c |Shift_JIS encoding | +|enc/windows_31j.c |Windows-31J (CP932) encoding | +|enc/big5.c |Big5 encoding | +|enc/gb18030.c |GB18030 encoding | +|enc/gbk.c |GBK encoding | +|enc/koi8_r.c |KOI8-R encoding | +|enc/koi8_u.c |KOI8-U encoding | +|enc/iso_8859.h |common definition of ISO-8859 encoding | +|enc/iso_8859_1.c |ISO-8859-1 (Latin-1) | +|enc/iso_8859_2.c |ISO-8859-2 (Latin-2) | +|enc/iso_8859_3.c |ISO-8859-3 (Latin-3) | +|enc/iso_8859_4.c |ISO-8859-4 (Latin-4) | +|enc/iso_8859_5.c |ISO-8859-5 (Cyrillic) | +|enc/iso_8859_6.c |ISO-8859-6 (Arabic) | +|enc/iso_8859_7.c |ISO-8859-7 (Greek) | +|enc/iso_8859_8.c |ISO-8859-8 (Hebrew) | +|enc/iso_8859_9.c |ISO-8859-9 (Latin-5 or Turkish) | +|enc/iso_8859_10.c |ISO-8859-10 (Latin-6 or Nordic) | +|enc/iso_8859_11.c |ISO-8859-11 (Thai) | +|enc/iso_8859_13.c |ISO-8859-13 (Latin-7 or Baltic Rim) | +|enc/iso_8859_14.c |ISO-8859-14 (Latin-8 or Celtic) | +|enc/iso_8859_15.c |ISO-8859-15 (Latin-9 or West European with Euro) | +|enc/iso_8859_16.c |ISO-8859-16 (Latin-10) | +|enc/utf_8.c |UTF-8 encoding | +|enc/utf_16be.c |UTF-16BE encoding | +|enc/utf_16le.c |UTF-16LE encoding | +|enc/utf_32be.c |UTF-32BE encoding | +|enc/utf_32le.c |UTF-32LE encoding | +|enc/unicode.c |common codes of Unicode encoding | +|enc/unicode/ |Unicode case folding data and properties data | +|enc/windows_1250.c |Windows-1250 (CP1250) encoding (Central/Eastern Europe)| +|enc/windows_1251.c |Windows-1251 (CP1251) encoding (Cyrillic) | +|enc/windows_1252.c |Windows-1252 (CP1252) encoding (Latin) | +|enc/windows_1253.c |Windows-1253 (CP1253) encoding (Greek) | +|enc/windows_1254.c |Windows-1254 (CP1254) encoding (Turkish) | +|enc/windows_1257.c |Windows-1257 (CP1257) encoding (Baltic Rim) | +|enc/cp949.c |CP949 encoding (only used in Ruby) | +|enc/emacs_mule.c |Emacs internal encoding (only used in Ruby) | +|enc/gb2312.c |GB2312 encoding (only used in Ruby) | +|enc/us_ascii.c |US-ASCII encoding (only used in Ruby) | +|win32/Makefile |Makefile for Win32 (VC++) | +|win32/Makefile.mingw|Makefile for Win32 (MinGW) | +|win32/config.h |config.h for Win32 | +|win32/onigmo.rc |resource file for Win32 | diff --git a/lib/edbee-lib/vendor/onig/aclocal.m4 b/lib/edbee-lib/vendor/onig/aclocal.m4 new file mode 100644 index 00000000..d19f8315 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/aclocal.m4 @@ -0,0 +1,1011 @@ +# generated automatically by aclocal 1.11.6 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, +# Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software +# Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.6], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.11.6])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, +# 2010, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 5 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 16 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, +# Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_PROG_CC_C_O +# -------------- +# Like AC_PROG_CC_C_O, but changed for automake. +AC_DEFUN([AM_PROG_CC_C_O], +[AC_REQUIRE([AC_PROG_CC_C_O])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +dnl Make sure AC_PROG_CC is never called again, or it will override our +dnl setting of CC. +m4_define([AC_PROG_CC], + [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, +# Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software +# Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar <conftest.tar]) + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) diff --git a/lib/edbee-lib/vendor/onig/appveyor.yml b/lib/edbee-lib/vendor/onig/appveyor.yml new file mode 100644 index 00000000..1984573b --- /dev/null +++ b/lib/edbee-lib/vendor/onig/appveyor.yml @@ -0,0 +1,42 @@ +version: 1.0.{build} + +branches: + except: + - ruby-2.x + - onig-5.9.x-mod + - onig-5.9.x-mod_for_bregonig-v2 + +environment: + matrix: + - ARCH: x64 + PYOPT: -3 + - ARCH: x86 + PYOPT: -3.4-32 + +install: +- cmd: |- + rem Check environments. + rem path + rem dir C:\ + rem dir "C:\Program Files" + rem dir "C:\Program Files\Microsoft SDKs\Windows" + rem dir "C:\Program Files (x86)" + rem dir "C:\Program Files (x86)\Windows Kits" + rem Using Windows SDK 7.1 (VC10) + rem "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /%ARCH% /release + rem Using VC12 + "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" %ARCH% + path + +build_script: +- cmd: |- + nmake -f win32\Makefile + dir build_%ARCH%\onigmo.dll + \msys64\usr\bin\file build_%ARCH%\onigmo.dll + +test_script: +- cmd: |- + py %PYOPT% -c "import locale; print(locale.getpreferredencoding())" + nmake -f win32\Makefile test + +# vim: ts=2 sw=2 sts=2 et diff --git a/lib/edbee-lib/vendor/onig/build_nmake.cmd b/lib/edbee-lib/vendor/onig/build_nmake.cmd new file mode 100644 index 00000000..c5a622a6 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/build_nmake.cmd @@ -0,0 +1,2 @@ +@setlocal enabledelayedexpansion +nmake -f "%~dp0win32\Makefile" %* diff --git a/lib/edbee-lib/vendor/onig/compile b/lib/edbee-lib/vendor/onig/compile new file mode 100755 index 00000000..862a14e8 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/compile @@ -0,0 +1,343 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-03-05.13; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free +# Software Foundation, Inc. +# Written by Tom Tromey <tromey@cygnus.com>. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to <bug-automake@gnu.org>. +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/lib/edbee-lib/vendor/onig/config-onig-edbee.h b/lib/edbee-lib/vendor/onig/config-onig-edbee.h new file mode 100644 index 00000000..2e65314e --- /dev/null +++ b/lib/edbee-lib/vendor/onig/config-onig-edbee.h @@ -0,0 +1,25 @@ +#ifndef CONFIGONIGEDBEE_H +#define CONFIGONIGEDBEE_H + +#ifdef __clang__ +// #pragma clang diagnostic ignored "-Wunused-variable" +# pragma clang diagnostic ignored "-Wunused-parameter" +# pragma clang diagnostic ignored "-Wmissing-field-initializers" + +#else +# ifdef __GNUC__ +// #pragma GCC diagnostic ignored "-Wunused-variable" +# pragma GCC diagnostic ignored "-Wunused-parameter" +# pragma GCC diagnostic ignored "-Wmissing-field-initializers" +# endif +#endif + +#ifdef _MSC_VER +// Visual studio directives +// C4100: unreferenced formal parameter +# pragma warning(disable : 4100) +#endif + +// TODO: Add more visual studio and other compiler directives + +#endif // CONFIGONIGEDBEE_H diff --git a/lib/edbee-lib/vendor/onig/config.guess b/lib/edbee-lib/vendor/onig/config.guess new file mode 100755 index 00000000..bf5ad890 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/config.guess @@ -0,0 +1,1459 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2016 Free Software Foundation, Inc. + +timestamp='2016-09-11' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <http://www.gnu.org/licenses/>. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# +# Please send patches to <config-patches@gnu.org>. + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2016 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include <features.h> + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case "${UNAME_MACHINE_ARCH}" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}${abi}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <sys/systemcfg.h> + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include <stdlib.h> + #include <unistd.h> + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = hppa2.0w ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <unistd.h> + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + *:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + else + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-${LIBC} + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-${LIBC} + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` + echo ${UNAME_MACHINE}-pc-isc$UNAME_REL + elif /bin/uname -X 2>/dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <Richard.M.Bartel@ccMail.Census.GOV> + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes <hewes@openmarket.com>. + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = 386; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; +esac + +cat >&2 <<EOF +$0: unable to guess system type + +This script (version $timestamp), has failed to recognize the +operating system you are using. If your script is old, overwrite +config.guess and config.sub with the latest versions from: + + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +and + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/lib/edbee-lib/vendor/onig/config.h.in b/lib/edbee-lib/vendor/onig/config.h.in new file mode 100644 index 00000000..f7766c3b --- /dev/null +++ b/lib/edbee-lib/vendor/onig/config.h.in @@ -0,0 +1,139 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +#include "config-onig-edbee.h" + +#ifdef _WIN32 + + #include "win32/config.h" + + // Rick: added to make it compile on windows + #define ONIG_EXTERN extern + + // Rick: added to decrease the numberr of warnings for onig + #define _CRT_SECURE_NO_WARNINGS + +#else + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +#undef CRAY_STACKSEG_END + +/* Define to 1 if using `alloca.c'. */ +#undef C_ALLOCA + +/* Define to 1 if you have `alloca', as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). + */ +#undef HAVE_ALLOCA_H + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the <string.h> header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the <sys/times.h> header file. */ +#undef HAVE_SYS_TIMES_H + +/* Define to 1 if you have the <sys/time.h> header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#undef LT_OBJDIR + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +#undef NO_MINUS_C_MINUS_O + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* The size of `int', as computed by sizeof. */ +#undef SIZEOF_INT + +/* The size of `long', as computed by sizeof. */ +#undef SIZEOF_LONG + +/* The size of `long long', as computed by sizeof. */ +#undef SIZEOF_LONG_LONG + +/* The size of `short', as computed by sizeof. */ +#undef SIZEOF_SHORT + +/* The size of `void*', as computed by sizeof. */ +#undef SIZEOF_VOIDP + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ +#undef TIME_WITH_SYS_TIME + +/* Define if combination explosion check */ +#undef USE_COMBINATION_EXPLOSION_CHECK + +/* Define if enable CR+NL as line terminator */ +#undef USE_CRNL_AS_LINE_TERMINATOR + +/* Version number of package */ +#undef VERSION + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `unsigned int' if <sys/types.h> does not define. */ +#undef size_t + +#endif diff --git a/lib/edbee-lib/vendor/onig/config.sub b/lib/edbee-lib/vendor/onig/config.sub new file mode 100755 index 00000000..cc69b067 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/config.sub @@ -0,0 +1,1823 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2016 Free Software Foundation, Inc. + +timestamp='2016-09-05' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <http://www.gnu.org/licenses/>. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to <config-patches@gnu.org>. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2016 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | ba \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | riscv32 | riscv64 \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | ba-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | e2k-* | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | riscv32-* | riscv64-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | visium-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + asmjs) + basic_machine=asmjs-unknown + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + os=$os"spe" + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -ios) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/lib/edbee-lib/vendor/onig/configure b/lib/edbee-lib/vendor/onig/configure new file mode 100755 index 00000000..31cc8544 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/configure @@ -0,0 +1,15207 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for onigmo 6.1.2. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 </dev/null +exec 6>&1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='onigmo' +PACKAGE_TARNAME='onigmo' +PACKAGE_VERSION='6.1.2' +PACKAGE_STRING='onigmo 6.1.2' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include <stdio.h> +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <stddef.h> +#else +# ifdef HAVE_STDLIB_H +# include <stdlib.h> +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include <memory.h> +# endif +# include <string.h> +#endif +#ifdef HAVE_STRINGS_H +# include <strings.h> +#endif +#ifdef HAVE_INTTYPES_H +# include <inttypes.h> +#endif +#ifdef HAVE_STDINT_H +# include <stdint.h> +#endif +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +ALLOCA +python_prog +LTVERSION +CPP +LT_SYS_LIBRARY_PATH +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +DLLTOOL +OBJDUMP +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBTOOL +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +STATISTICS +RUBYDIR +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +with_rubydir +with_statistics +enable_combination_explosion_check +enable_crnl_as_line_terminator +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_aix_soname +with_gnu_ld +with_sysroot +enable_libtool_lock +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +LT_SYS_LIBRARY_PATH +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures onigmo 6.1.2 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/onigmo] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of onigmo 6.1.2:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-combination-explosion-check enable combination explosion check + --enable-crnl-as-line-terminator enable CR+NL as line terminator + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-rubydir=RUBYDIR specify value for RUBYDIR (default ..) + --with-statistics take matching time statistical data + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot[=DIR] Search for dependent libraries within DIR (or the + compiler's sysroot if not specified). + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a + nonstandard directory <lib dir> + LIBS libraries to pass to the linker, e.g. -l<library> + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if + you have headers in a nonstandard directory <include dir> + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +onigmo configure 6.1.2 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case <limits.h> declares $2. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include <stdio.h> +#include <stdlib.h> +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 <conftest.val; ac_retval=0 +else + ac_retval=1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f conftest.val + + fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_compute_int + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by onigmo $as_me 6.1.2, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + +am__api_version='1.11' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='onigmo' + VERSION='6.1.2' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + +ac_config_headers="$ac_config_headers config.h" + + + +RUBYDIR=".." + +# Check whether --with-rubydir was given. +if test "${with_rubydir+set}" = set; then : + withval=$with_rubydir; RUBYDIR=$withval +fi + + + +STATISTICS="" + +# Check whether --with-statistics was given. +if test "${with_statistics+set}" = set; then : + withval=$with_statistics; STATISTICS=-DONIG_DEBUG_STATISTICS +fi + + + +# Check whether --enable-combination-explosion-check was given. +if test "${enable_combination_explosion_check+set}" = set; then : + enableval=$enable_combination_explosion_check; comb_expl_check=$enableval +fi + +if test "${comb_expl_check}" = yes; then + +$as_echo "#define USE_COMBINATION_EXPLOSION_CHECK 1" >>confdefs.h + +fi + +# Check whether --enable-crnl-as-line-terminator was given. +if test "${enable_crnl_as_line_terminator+set}" = set; then : + enableval=$enable_crnl_as_line_terminator; crnl_as_line_terminator=$enableval +fi + +if test "${crnl_as_line_terminator}" = yes; then + +$as_echo "#define USE_CRNL_AS_LINE_TERMINATOR 1" >>confdefs.h + +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdio.h> +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.6' +macro_revision='2.4.6' + + + + + + + + + + + + + +ltmain=$ac_aux_dir/ltmain.sh + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case $ECHO in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in + *GNU* | *'with BFD'*) + test no != "$with_gnu_ld" && break + ;; + *) + test yes != "$with_gnu_ld" && break + ;; + esac + fi + done + IFS=$lt_save_ifs +else + lt_cv_path_LD=$LD # Let the user override the test with a path. +fi +fi + +LD=$lt_cv_path_LD +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 </dev/null` in +*GNU* | *'with BFD'*) + lt_cv_prog_gnu_ld=yes + ;; +*) + lt_cv_prog_gnu_ld=no + ;; +esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM=$NM +else + lt_nm_to_check=${ac_tool_prefix}nm + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break 2 + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS=$lt_save_ifs + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test : != "$DUMPBIN"; then + NM=$DUMPBIN + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring=ABCD + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test 17 != "$i" # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n "$lt_cv_sys_max_cmd_len"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test yes != "$GCC"; then + reload_cmds=false + fi + ;; + darwin*) + if test yes = "$GCC"; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# 'unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + bitrig* | openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test ia64 = "$host_cpu"; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case $with_sysroot in #( + yes) + if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +$as_echo "$with_sysroot" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +$as_echo_n "checking for a working dd... " >&6; } +if ${ac_cv_path_lt_DD+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +if test -z "$lt_DD"; then + ac_path_lt_DD_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in dd; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_lt_DD" || continue +if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi + $ac_path_lt_DD_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_lt_DD"; then + : + fi +else + ac_cv_path_lt_DD=$lt_DD +fi + +rm -f conftest.i conftest2.i conftest.out +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +$as_echo "$ac_cv_path_lt_DD" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +$as_echo_n "checking how to truncate binary pipes... " >&6; } +if ${lt_cv_truncate_bin+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +$as_echo "$lt_cv_truncate_bin" >&6; } + + + + + + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test no = "$enable_libtool_lock" || enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE=32 + ;; + *ELF-64*) + HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test yes = "$lt_cv_prog_gnu_ld"; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS=$SAVE_CFLAGS + fi + ;; +*-*solaris*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD=${LD-ld}_sol2 + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks=$enable_libtool_lock + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test yes != "$lt_cv_path_mainfest_tool"; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "$LT_MULTI_MODULE"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[012][,.]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + fi + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ctype.h> +#include <stdlib.h> +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + + + +# Set options + + + + enable_dlopen=no + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + pic_mode=default +fi + + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[5-9]*,yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } + +# Check whether --with-aix-soname was given. +if test "${with_aix_soname+set}" = set; then : + withval=$with_aix_soname; case $withval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname +else + if ${lt_cv_with_aix_soname+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_with_aix_soname=aix +fi + + with_aix_soname=$lt_cv_with_aix_soname +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +$as_echo "$with_aix_soname" >&6; } + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS=$ltmain + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld=$lt_cv_prog_gnu_ld + +old_CC=$CC +old_CFLAGS=$CFLAGS + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/${ac_tool_prefix}file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC=$CC +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test yes = "$GCC"; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + lt_prog_compiler_pic='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64, which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works"; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works"; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test no = "$hard_links"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd* | bitrig*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test yes = "$lt_use_gnu_ld_interface"; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='$wl' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + export_dynamic_flag_spec='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test ia64 != "$host_cpu"; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach <jrb3@best.com> says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='$wl--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test linux-dietlibc = "$host_os"; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + tcc*) + export_dynamic_flag_spec='-rdynamic' + ;; + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test no = "$ld_shlibs"; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct=no + hardcode_direct_absolute=no + ;; + esac + + if test yes = "$GCC"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + export_dynamic_flag_spec='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' $wl-bernotok' + allow_undefined_flag=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test yes = "$GCC"; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='$wl-E' + ;; + + hpux10*) + if test yes,no = "$GCC,$with_gnu_ld"; then + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test yes = "$lt_cv_prog_compiler__b"; then + archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test yes = "$GCC"; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test yes = "$lt_cv_irix_exported_symbol"; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + ld_shlibs=yes + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + else + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + + osf3*) + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test yes = "$GCC"; then + wlarc='$wl' + archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='$wl' + archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. GCC discards it without '$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test yes = "$GCC"; then + whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='$wl-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='$wl-z,text' + allow_undefined_flag='$wl-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='$wl-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test no = "$ld_shlibs" && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test yes = "$GCC"; then + case $host_os in + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary... + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo = "/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's|/\([A-Za-z]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + + + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib<name>.so + # instead of lib<name>.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test yes = "$hardcode_automatic"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && + test no != "$hardcode_minus_L"; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test relink = "$hardcode_action" || + test yes = "$inherit_rpath"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen=LoadLibrary + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else + + lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen=shl_load +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen=dlopen +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test no = "$lt_cv_dlopen"; then + enable_dlopen=no + else + enable_dlopen=yes + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP"; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report what library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + +if test "x$CC" != xcc; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +fi +set dummy $CC; ac_cc=`$as_echo "$2" | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* + +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + + +LTVERSION="6:3:0" + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + +for ac_prog in python3 python python2 +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_python_prog+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$python_prog"; then + ac_cv_prog_python_prog="$python_prog" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_python_prog="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +python_prog=$ac_cv_prog_python_prog +if test -n "$python_prog"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $python_prog" >&5 +$as_echo "$python_prog" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$python_prog" && break +done + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ctype.h> +#include <stdlib.h> +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +for ac_header in sys/time.h unistd.h sys/times.h stdint.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } +if ${ac_cv_sizeof_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_int" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (int) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_int=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 +$as_echo_n "checking size of short... " >&6; } +if ${ac_cv_sizeof_short+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_short" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (short) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_short=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 +$as_echo "$ac_cv_sizeof_short" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SHORT $ac_cv_sizeof_short +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void*" >&5 +$as_echo_n "checking size of void*... " >&6; } +if ${ac_cv_sizeof_voidp+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void*))" "ac_cv_sizeof_voidp" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_voidp" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (void*) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_voidp=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_voidp" >&5 +$as_echo "$ac_cv_sizeof_voidp" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_VOIDP $ac_cv_sizeof_voidp +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } +if ${ac_cv_sizeof_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if ${ac_cv_header_time+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <sys/time.h> +#include <time.h> + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_time=yes +else + ac_cv_header_time=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h + +fi + + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +$as_echo_n "checking for working alloca.h... " >&6; } +if ${ac_cv_working_alloca_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <alloca.h> +int +main () +{ +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_working_alloca_h=yes +else + ac_cv_working_alloca_h=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +$as_echo "$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then + +$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +$as_echo_n "checking for alloca... " >&6; } +if ${ac_cv_func_alloca_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include <malloc.h> +# define alloca _alloca +# else +# ifdef HAVE_ALLOCA_H +# include <alloca.h> +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +void *alloca (size_t); +# endif +# endif +# endif +# endif +#endif + +int +main () +{ +char *p = (char *) alloca (1); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_func_alloca_works=yes +else + ac_cv_func_alloca_works=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +$as_echo "$ac_cv_func_alloca_works" >&6; } + +if test $ac_cv_func_alloca_works = yes; then + +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h + +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext + +$as_echo "#define C_ALLOCA 1" >>confdefs.h + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 +$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } +if ${ac_cv_os_cray+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined CRAY && ! defined CRAY2 +webecray +#else +wenotbecray +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "webecray" >/dev/null 2>&1; then : + ac_cv_os_cray=yes +else + ac_cv_os_cray=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 +$as_echo "$ac_cv_os_cray" >&6; } +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + +cat >>confdefs.h <<_ACEOF +#define CRAY_STACKSEG_END $ac_func +_ACEOF + + break +fi + + done +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +$as_echo_n "checking stack direction for C alloca... " >&6; } +if ${ac_cv_c_stack_direction+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_c_stack_direction=0 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +find_stack_direction (int *addr, int depth) +{ + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; +} + +int +main (int argc, char **argv) +{ + return find_stack_direction (0, argc + !argv + 20) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_stack_direction=1 +else + ac_cv_c_stack_direction=-1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +$as_echo "$ac_cv_c_stack_direction" >&6; } +cat >>confdefs.h <<_ACEOF +#define STACK_DIRECTION $ac_cv_c_stack_direction +_ACEOF + + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 +$as_echo_n "checking for working memcmp... " >&6; } +if ${ac_cv_func_memcmp_working+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_memcmp_working=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Some versions of memcmp are not 8-bit clean. */ + char c0 = '\100', c1 = '\200', c2 = '\201'; + if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) + return 1; + + /* The Next x86 OpenStep bug shows up only when comparing 16 bytes + or more and with at least one buffer not starting on a 4-byte boundary. + William Lewis provided this test program. */ + { + char foo[21]; + char bar[21]; + int i; + for (i = 0; i < 4; i++) + { + char *a = foo + i; + char *b = bar + i; + strcpy (a, "--------01111111"); + strcpy (b, "--------10000000"); + if (memcmp (a, b, 16) >= 0) + return 1; + } + return 0; + } + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_memcmp_working=yes +else + ac_cv_func_memcmp_working=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 +$as_echo "$ac_cv_func_memcmp_working" >&6; } +test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in + *" memcmp.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" + ;; +esac + + + + +ac_config_files="$ac_config_files Makefile onigmo-config sample/Makefile" + +ac_config_commands="$ac_config_commands default" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by onigmo $as_me 6.1.2, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +onigmo config.status 6.1.2 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_import \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_cv_nm_interface \ +nm_file_list_spec \ +lt_cv_truncate_bin \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' + +# See if we are running on zsh, and set the options that allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "onigmo-config") CONFIG_FILES="$CONFIG_FILES onigmo-config" ;; + "sample/Makefile") CONFIG_FILES="$CONFIG_FILES sample/Makefile" ;; + "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' <conf$$subs.awk | sed ' +/^[^""]/{ + N + s/\n// +} +' >>$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' <confdefs.h | sed ' +s/'"$ac_delim"'/"\\\ +"/g' >>$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + + cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL +# Generated automatically by $as_me ($PACKAGE) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +# The names of the tagged configurations supported by this script. +available_tags='' + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shared archive member basename,for filename based shared library versioning on AIX. +shared_archive_member_spec=$shared_archive_member_spec + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm into a list of symbols to manually relocate. +global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name lister interface. +nm_interface=$lt_lt_cv_nm_interface + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and where our libraries should be installed. +lt_sysroot=$lt_sysroot + +# Command to truncate a binary pipe. +lt_truncate_bin=$lt_lt_cv_truncate_bin + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain=$ac_aux_dir/ltmain.sh + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + "default":C) chmod +x onigmo-config ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/lib/edbee-lib/vendor/onig/configure.ac b/lib/edbee-lib/vendor/onig/configure.ac new file mode 100644 index 00000000..05641f36 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/configure.ac @@ -0,0 +1,90 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(onigmo, 6.1.2) + +AC_CONFIG_MACRO_DIR([m4]) + +AM_INIT_AUTOMAKE(foreign) +AC_CONFIG_HEADER(config.h) + + +dnl default value for RUBYDIR +RUBYDIR=".." +AC_ARG_WITH(rubydir, + [ --with-rubydir=RUBYDIR specify value for RUBYDIR (default ..)], + [ RUBYDIR=$withval ]) +AC_SUBST(RUBYDIR) + +dnl default value for STATISTICS +STATISTICS="" +AC_ARG_WITH(statistics, + [ --with-statistics take matching time statistical data], + [ STATISTICS=-DONIG_DEBUG_STATISTICS ]) +AC_SUBST(STATISTICS) + +dnl check for COMBINATION_EXPLOSION +AC_ARG_ENABLE(combination-explosion-check, + [ --enable-combination-explosion-check enable combination explosion check], + [comb_expl_check=$enableval]) +if test "${comb_expl_check}" = yes; then + AC_DEFINE(USE_COMBINATION_EXPLOSION_CHECK,1,[Define if combination explosion check]) +fi + +dnl check for CRNL_AS_LINE_TERMINATOR +AC_ARG_ENABLE(crnl-as-line-terminator, + [ --enable-crnl-as-line-terminator enable CR+NL as line terminator], + [crnl_as_line_terminator=$enableval]) +if test "${crnl_as_line_terminator}" = yes; then + AC_DEFINE(USE_CRNL_AS_LINE_TERMINATOR,1,[Define if enable CR+NL as line terminator]) +fi + + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_LIBTOOL +AM_PROG_CC_C_O +LTVERSION="6:3:0" +AC_SUBST(LTVERSION) + +AC_PROG_INSTALL +AC_PROG_MAKE_SET + +AC_CHECK_PROGS(python_prog, python3 python python2) + +dnl Checks for libraries. + +dnl Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS(sys/time.h unistd.h sys/times.h stdint.h) + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_CHECK_SIZEOF(int, 4) +AC_CHECK_SIZEOF(short, 2) +AC_CHECK_SIZEOF(long, 4) +AC_CHECK_SIZEOF([void*]) +AC_CHECK_SIZEOF([long long]) +AC_C_CONST +AC_HEADER_TIME + +dnl Checks for library functions. +AC_FUNC_ALLOCA +AC_FUNC_MEMCMP + +dnl Add custom edbee boilerplate start +AH_TOP([#include "config-onig-edbee.h" + +#ifdef _WIN32 + + #include "win32/config.h" + + // Rick: added to make it compile on windows + #define ONIG_EXTERN extern + + // Rick: added to decrease the numberr of warnings for onig + #define _CRT_SECURE_NO_WARNINGS + +#else]) + +AC_OUTPUT([Makefile onigmo-config sample/Makefile], [chmod +x onigmo-config]) + +dnl Add custom edbee boilerplate end +AH_BOTTOM([#endif]) diff --git a/lib/edbee-lib/vendor/onig/depcomp b/lib/edbee-lib/vendor/onig/depcomp new file mode 100755 index 00000000..25a39e6c --- /dev/null +++ b/lib/edbee-lib/vendor/onig/depcomp @@ -0,0 +1,708 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2012-03-27.16; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to <bug-automake@gnu.org>. +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' "$nl" < "$tmpdepfile" | +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependent.h'. + # Do two passes, one to just change these to + # '$object: dependent.h' and one to simply 'dependent.h:'. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. + # However on + # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\': + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + # tcc 0.9.26 (FIXME still under development at the moment of writing) + # will emit a similar output, but also prepend the continuation lines + # with horizontal tabulation characters. + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form 'foo.o: dependent.h', + # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. + # Do two passes, one to just change these to + # '$object: dependent.h' and one to simply 'dependent.h:'. + sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ + < "$tmpdepfile" > "$depfile" + sed ' + s/[ '"$tab"'][ '"$tab"']*/ /g + s/^ *// + s/ *\\*$// + s/^[^:]*: *// + /^$/d + /:$/d + s/$/ :/ + ' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test "$stat" = 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' "$nl" < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/lib/edbee-lib/vendor/onig/doc/API b/lib/edbee-lib/vendor/onig/doc/API new file mode 100644 index 00000000..1dcb93ce --- /dev/null +++ b/lib/edbee-lib/vendor/onig/doc/API @@ -0,0 +1,702 @@ +Onigmo (Oniguruma-mod) API Version 6.1.2 2017/05/10 + +#include <onigmo.h> + + +# int onig_initialize(OnigEncoding use_encodings[], int num_encodings) + + Initialize library. + This is added for compatibility to Oniguruma 6.0. + Currently this is same as onig_init(). + + arguments + 1 use_encodings: array of encodings used in application. + 2 num_encodings: number of encodings. + + +# int onig_init(void) + + Initialize library. + + Single thread program: + You don't have to call it explicitly, because it is called in onig_new(). + However calling it is preferred. + + Multi thread program: + You have to call it explicitly from a specific thread (normally the main + thread) before you use onig_new(), because onig_init() is not thread safe. + + +# int onig_error_code_to_str(UChar* err_buf, OnigPosition err_code, ...) + + Get error message string. + If this function is used for onig_new(), + don't call this after the pattern argument of onig_new() is freed. + + normal return: error message string length + + arguments + 1 err_buf: error message string buffer. + (required size: ONIG_MAX_ERROR_MESSAGE_LEN) + 2 err_code: error code returned by other API functions. + 3 err_info (optional): error info returned by onig_new(). + + +# void onig_set_warn_func(OnigWarnFunc func) + + Set warning function. + + WARNING: + '[', '-', ']' in character class without escape. + ']' in pattern without escape. + + arguments + 1 func: function pointer. void (*func)(char* warning_message) + + +# void onig_set_verb_warn_func(OnigWarnFunc func) + + Set verbose warning function. + + WARNING: + redundant nested repeat operator. + + arguments + 1 func: function pointer. void (*func)(char* warning_message) + + +# int onig_new(regex_t** reg, const UChar* pattern, const UChar* pattern_end, + OnigOptionType option, OnigEncoding enc, + const OnigSyntaxType* syntax, OnigErrorInfo* err_info) + + Create a regex object. + + normal return: ONIG_NORMAL + + arguments + 1 reg: return regex object's address. + 2 pattern: regex pattern string. + 3 pattern_end: terminate address of pattern. (pattern + pattern length) + 4 option: compile time options. + + ONIG_OPTION_NONE no option + ONIG_OPTION_SINGLELINE '^' -> '\A', '$' -> '\Z' + ONIG_OPTION_DOTALL '.' match with newline + ONIG_OPTION_MULTILINE same as ONIG_OPTION_DOTALL + ONIG_OPTION_IGNORECASE ambiguity match on + ONIG_OPTION_EXTEND extended pattern form + ONIG_OPTION_FIND_LONGEST find longest match + ONIG_OPTION_FIND_NOT_EMPTY ignore empty match + ONIG_OPTION_NEGATE_SINGLELINE + clear ONIG_OPTION_SINGLELINE which is enabled on + ONIG_SYNTAX_POSIX_BASIC, ONIG_SYNTAX_POSIX_EXTENDED, + ONIG_SYNTAX_PERL, ONIG_SYNTAX_PERL58, ONIG_SYNTAX_PERL58_NG, + ONIG_SYNTAX_JAVA, ONIG_SYNTAX_PYTHON + + ONIG_OPTION_DONT_CAPTURE_GROUP only named group captured. + ONIG_OPTION_CAPTURE_GROUP named and no-named group captured. + + ONIG_OPTION_NEWLINE_CRLF + Treat CR+LF as a newline too. (default: LF only) + To use this option, you must enable the following line in regenc.h. + + /* #define USE_CRNL_AS_LINE_TERMINATOR */ + + 5 enc: character encoding. + + ONIG_ENCODING_ASCII ASCII + ONIG_ENCODING_ISO_8859_1 ISO 8859-1 + ONIG_ENCODING_ISO_8859_2 ISO 8859-2 + ONIG_ENCODING_ISO_8859_3 ISO 8859-3 + ONIG_ENCODING_ISO_8859_4 ISO 8859-4 + ONIG_ENCODING_ISO_8859_5 ISO 8859-5 + ONIG_ENCODING_ISO_8859_6 ISO 8859-6 + ONIG_ENCODING_ISO_8859_7 ISO 8859-7 + ONIG_ENCODING_ISO_8859_8 ISO 8859-8 + ONIG_ENCODING_ISO_8859_9 ISO 8859-9 + ONIG_ENCODING_ISO_8859_10 ISO 8859-10 + ONIG_ENCODING_ISO_8859_11 ISO 8859-11 + ONIG_ENCODING_ISO_8859_13 ISO 8859-13 + ONIG_ENCODING_ISO_8859_14 ISO 8859-14 + ONIG_ENCODING_ISO_8859_15 ISO 8859-15 + ONIG_ENCODING_ISO_8859_16 ISO 8859-16 + ONIG_ENCODING_UTF_8 UTF-8 + ONIG_ENCODING_UTF_16BE UTF-16BE + ONIG_ENCODING_UTF_16LE UTF-16LE + ONIG_ENCODING_UTF_32BE UTF-32BE + ONIG_ENCODING_UTF_32LE UTF-32LE + ONIG_ENCODING_EUC_JP EUC-JP + ONIG_ENCODING_EUC_TW EUC-TW + ONIG_ENCODING_EUC_KR EUC-KR + ONIG_ENCODING_EUC_CN EUC-CN + ONIG_ENCODING_SHIFT_JIS Shift_JIS + ONIG_ENCODING_WINDOWS_31J Windows-31J (CP932) + ONIG_ENCODING_KOI8_R KOI8-R + ONIG_ENCODING_KOI8_U KOI8-U + ONIG_ENCODING_WINDOWS_1250 Windows-1250 (CP1250) + ONIG_ENCODING_WINDOWS_1251 Windows-1251 (CP1251) + ONIG_ENCODING_WINDOWS_1252 Windows-1252 (CP1252) + ONIG_ENCODING_WINDOWS_1253 Windows-1253 (CP1253) + ONIG_ENCODING_WINDOWS_1254 Windows-1254 (CP1254) + ONIG_ENCODING_WINDOWS_1257 Windows-1257 (CP1257) + ONIG_ENCODING_BIG5 Big5 + ONIG_ENCODING_GB18030 GB18030 + + or any OnigEncodingType data address defined by user. + + The following encoding names can be also used for backward compatibility: + + ONIG_ENCODING_UTF8 UTF-8 + ONIG_ENCODING_UTF16_BE UTF-16BE + ONIG_ENCODING_UTF16_LE UTF-16LE + ONIG_ENCODING_UTF32_BE UTF-32BE + ONIG_ENCODING_UTF32_LE UTF-32LE + ONIG_ENCODING_SJIS Shift_JIS + ONIG_ENCODING_CP932 Windows-31J (CP932) + ONIG_ENCODING_CP1250 Windows-1250 (CP1250) + ONIG_ENCODING_CP1251 Windows-1251 (CP1251) + ONIG_ENCODING_CP1252 Windows-1252 (CP1252) + ONIG_ENCODING_CP1253 Windows-1253 (CP1253) + ONIG_ENCODING_CP1254 Windows-1254 (CP1254) + ONIG_ENCODING_CP1257 Windows-1257 (CP1257) + + + 6 syntax: address of pattern syntax definition. + + ONIG_SYNTAX_ASIS plain text + ONIG_SYNTAX_POSIX_BASIC POSIX Basic RE + ONIG_SYNTAX_POSIX_EXTENDED POSIX Extended RE + ONIG_SYNTAX_EMACS Emacs + ONIG_SYNTAX_GREP grep + ONIG_SYNTAX_GNU_REGEX GNU regex + ONIG_SYNTAX_JAVA Java (Sun java.util.regex) + ONIG_SYNTAX_PERL58 Perl 5.8 + ONIG_SYNTAX_PERL58_NG Perl 5.8 + named group + ONIG_SYNTAX_PERL Perl 5.10+ + ONIG_SYNTAX_PYTHON Python + ONIG_SYNTAX_RUBY Ruby + ONIG_SYNTAX_DEFAULT default (== Ruby) + onig_set_default_syntax() + + or any OnigSyntaxType data address defined by user. + + 7 err_info: address for return optional error info. + Use this value as 3rd argument of onig_error_code_to_str(). + + + +# int onig_new_without_alloc(regex_t* reg, const UChar* pattern, + const UChar* pattern_end, + OnigOptionType option, OnigEncoding enc, + const OnigSyntaxType* syntax, OnigErrorInfo* err_info) + + Create a regex object. + reg object area is not allocated in this function. + + normal return: ONIG_NORMAL + + + +# int onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end, + OnigCompileInfo* ci, OnigErrorInfo* einfo) + + Create a regex object. + This function is deluxe version of onig_new(). + + normal return: ONIG_NORMAL + + arguments + 1 reg: return address of regex object. + 2 pattern: regex pattern string. + 3 pattern_end: terminate address of pattern. (pattern + pattern length) + 4 ci: compile time info. + + ci->num_of_elements: number of elements in ci. (current version: 5) + ci->pattern_enc: pattern string character encoding. + ci->target_enc: target string character encoding. + ci->syntax: address of pattern syntax definition. + ci->option: compile time option. + ci->case_fold_flag: character matching case fold bit flag for + ONIG_OPTION_IGNORECASE mode. + + ONIGENC_CASE_FOLD_MIN: minimum + ONIGENC_CASE_FOLD_DEFAULT: minimum + onig_set_default_case_fold_flag() + + 5 err_info: address for return optional error info. + Use this value as 3rd argument of onig_error_code_to_str(). + + + Different character encoding combination is allowed for + the following cases only. + + pattern_enc: ASCII, ISO_8859_1 + target_enc: UTF_16BE, UTF_16LE, UTF_32BE, UTF_32LE + + pattern_enc: UTF_16BE/LE + target_enc: UTF_16LE/BE + + pattern_enc: UTF_32BE/LE + target_enc: UTF_32LE/BE + + +# void onig_free(regex_t* reg) + + Free memory used by regex object. + + arguments + 1 reg: regex object. + + +# void onig_free_body(regex_t* reg) + + Free memory used by regex object. (Except reg oneself.) + + arguments + 1 reg: regex object. + + +# OnigPosition onig_search(regex_t* reg, const UChar* str, const UChar* end, + const UChar* start, const UChar* range, OnigRegion* region, + OnigOptionType option) +# OnigPosition onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end, + const UChar* global_pos, + const UChar* start, const UChar* range, OnigRegion* region, + OnigOptionType option) + + Search string and return search result and matching region. + + normal return: match position offset (i.e. p - str >= 0) + not found: ONIG_MISMATCH (< 0) + + arguments + 1 reg: regex object + 2 str: target string + 3 end: terminate address of target string + 4 global_pos: position of \G + if not need, set same value as str. + 5 start: search start address of target string + 6 range: search terminate address of target string + in forward search (start <= searched string < range) + in backward search (range <= searched string <= start) + 7 region: address for return group match range info (NULL is allowed) + 8 option: search time option + + ONIG_OPTION_NOTBOL string head(str) isn't considered as begin of line + ONIG_OPTION_NOTEOL string end (end) isn't considered as end of line + ONIG_OPTION_NOTBOS string head(str) isn't considered as begin of string (\A) + ONIG_OPTION_NOTEOS string end (end) isn't considered as end of string (\z) + + +# OnigPosition onig_match(regex_t* reg, const UChar* str, const UChar* end, + const UChar* at, OnigRegion* region, OnigOptionType option) + + Match string and return result and matching region. + + normal return: match length (>= 0) + not match: ONIG_MISMATCH ( < 0) + + arguments + 1 reg: regex object + 2 str: target string + 3 end: terminate address of target string + 4 at: match address of target string + 5 region: address for return group match range info (NULL is allowed) + 6 option: search time option + + ONIG_OPTION_NOTBOL string head(str) isn't considered as begin of line + ONIG_OPTION_NOTEOL string end (end) isn't considered as end of line + ONIG_OPTION_NOTBOS string head(str) isn't considered as begin of string (\A) + ONIG_OPTION_NOTEOS string end (end) isn't considered as end of string (\z) + + +# OnigPosition onig_scan(regex_t* reg, const UChar* str, const UChar* end, + OnigRegion* region, OnigOptionType option, + int (*scan_callback)(OnigPosition, OnigPosition, OnigRegion*, void*), + void* callback_arg) + + Scan string and callback with matching region. + + normal return: number of matching times + error: error code + interruption: return value of callback function (!= 0) + + arguments + 1 reg: regex object + 2 str: target string + 3 end: terminate address of target string + 4 region: address for return group match range info (NULL is allowed) + 5 option: search time option + 6 scan_callback: callback function (defined by user) + 7 callback_arg: optional argument passed to callback + + +# OnigRegion* onig_region_new(void) + + Create a region. + + +# void onig_region_free(OnigRegion* region, int free_self) + + Free memory used by region. + + arguments + 1 region: target region + 2 free_self: [1: free all, 0: free memory used in region but not self] + + +# void onig_region_copy(OnigRegion* to, const OnigRegion* from) + + Copy contents of region. + + arguments + 1 to: target region + 2 from: source region + + +# void onig_region_clear(OnigRegion* region) + + Clear contents of region. + + arguments + 1 region: target region + + +# int onig_region_resize(OnigRegion* region, int n) + + Resize group range area of region. + + normal return: ONIG_NORMAL + + arguments + 1 region: target region + 2 n: new size + + +# int onig_name_to_group_numbers(regex_t* reg, const UChar* name, const UChar* name_end, + int** num_list) + + Return the group number list of the name. + Named subexp is defined by (?<name>....). + + normal return: number of groups for the name. + (ex. /(?<x>..)(?<x>..)/ ==> 2) + name not found: -1 + + arguments + 1 reg: regex object. + 2 name: group name. + 3 name_end: terminate address of group name. + 4 num_list: return list of group number. + + +# int onig_name_to_backref_number(regex_t* reg, const UChar* name, const UChar* name_end, + const OnigRegion *region) + + Return the group number corresponding to the named backref (\k<name>). + If two or more regions for the groups of the name are effective, + the greatest number in it is obtained. + + normal return: group number. + + arguments + 1 reg: regex object. + 2 name: group name. + 3 name_end: terminate address of group name. + 4 region: search/match result region. + + +# int onig_foreach_name(regex_t* reg, + int (*func)(const UChar*, const UChar*, int,int*,regex_t*,void*), + void* arg) + + Iterate function call for all names. + + normal return: 0 + error: func's return value. + + arguments + 1 reg: regex object. + 2 func: callback function. + func(name, name_end, <number of groups>, <group number's list>, + reg, arg); + if func does not return 0, then iteration is stopped. + 3 arg: argument for func. + + +# int onig_number_of_names(const regex_t* reg) + + Return the number of names defined in the pattern. + Multiple definitions of one name is counted as one. + + arguments + 1 reg: regex object. + + +# OnigEncoding onig_get_encoding(const regex_t* reg) +# OnigOptionType onig_get_options(const regex_t* reg) +# OnigCaseFoldType onig_get_case_fold_flag(const regex_t* reg) +# const OnigSyntaxType* onig_get_syntax(const regex_t* reg) + + Return a value of the regex object. + + arguments + 1 reg: regex object. + + +# int onig_number_of_captures(const regex_t* reg) + + Return the number of capture group in the pattern. + + arguments + 1 reg: regex object. + + +# int onig_number_of_capture_histories(const regex_t* reg) + + Return the number of capture history defined in the pattern. + + You can't use capture history if ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY + is disabled in the pattern syntax.(disabled in the default syntax) + + arguments + 1 reg: regex object. + + + +# OnigCaptureTreeNode* onig_get_capture_tree(OnigRegion* region) + + Return the root node of capture history data tree. + + This value is undefined if matching has faild. + + arguments + 1 region: matching result. + + +# int onig_capture_tree_traverse(OnigRegion* region, int at, + int(*func)(int,OnigPosition,OnigPosition,int,int,void*), + void* arg) + + Traverse and callback in capture history data tree. + + normal return: 0 + error: callback func's return value. + + arguments + 1 region: match region data. + 2 at: callback position. + + ONIG_TRAVERSE_CALLBACK_AT_FIRST: callback first, then traverse children. + ONIG_TRAVERSE_CALLBACK_AT_LAST: traverse children first, then callback. + ONIG_TRAVERSE_CALLBACK_AT_BOTH: callback first, then traverse children, + and at last callback again. + + 3 func: callback function. + if func does not return 0, then traverse is stopped. + + int func(int group, OnigPosition beg, OnigPosition end, + int level, int at, void* arg) + + group: group number + beg: capture start position + end: capture end position + level: nest level (from 0) + at: callback position + ONIG_TRAVERSE_CALLBACK_AT_FIRST + ONIG_TRAVERSE_CALLBACK_AT_LAST + arg: optional callback argument + + 4 arg; optional callback argument. + + +# int onig_noname_group_capture_is_active(const regex_t* reg) + + Return noname group capture activity. + + active: 1 + inactive: 0 + + arguments + 1 reg: regex object. + + if option ONIG_OPTION_DONT_CAPTURE_GROUP == ON + --> inactive + + if the regex pattern have named group + and syntax ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP == ON + and option ONIG_OPTION_CAPTURE_GROUP == OFF + --> inactive + + else --> active + + +# UChar* onigenc_get_prev_char_head(OnigEncoding enc, const UChar* start, + const UChar* s, const UChar* end) + + Return previous character head address. + + arguments + 1 enc: character encoding + 2 start: string address + 3 s: target address of string + 4 end: end of string + + +# UChar* onigenc_get_left_adjust_char_head(OnigEncoding enc, + const UChar* start, const UChar* s, const UChar* end) + + Return left-adjusted head address of a character. + + arguments + 1 enc: character encoding + 2 start: string address + 3 s: target address of string + 4 end: end of string + + +# UChar* onigenc_get_right_adjust_char_head(OnigEncoding enc, + const UChar* start, const UChar* s, const UChar* end) + + Return right-adjusted head address of a character. + + arguments + 1 enc: character encoding + 2 start: string address + 3 s: target address of string + 4 end: end of string + + +# int onigenc_strlen(OnigEncoding enc, const UChar* s, const UChar* end) +# int onigenc_strlen_null(OnigEncoding enc, const UChar* s) + + Return number of characters in the string. + + +# int onigenc_str_bytelen_null(OnigEncoding enc, const UChar* s) + + Return number of bytes in the string. + + +# int onig_set_default_syntax(const OnigSyntaxType* syntax) + + Set default syntax. + + arguments + 1 syntax: address of pattern syntax definition. + + +# void onig_copy_syntax(OnigSyntaxType* to, const OnigSyntaxType* from) + + Copy syntax. + + arguments + 1 to: destination address. + 2 from: source address. + + +# unsigned int onig_get_syntax_op(const OnigSyntaxType* syntax) +# unsigned int onig_get_syntax_op2(const OnigSyntaxType* syntax) +# unsigned int onig_get_syntax_behavior(const OnigSyntaxType* syntax) +# OnigOptionType onig_get_syntax_options(const OnigSyntaxType* syntax) + +# void onig_set_syntax_op(OnigSyntaxType* syntax, unsigned int op) +# void onig_set_syntax_op2(OnigSyntaxType* syntax, unsigned int op2) +# void onig_set_syntax_behavior(OnigSyntaxType* syntax, unsigned int behavior) +# void onig_set_syntax_options(OnigSyntaxType* syntax, OnigOptionType options) + + Get/Set elements of the syntax. + + arguments + 1 syntax: syntax + 2 op, op2, behavior, options: value of element. + + +# void onig_copy_encoding(OnigEncodingType *to, OnigEncoding from) + + Copy encoding. + + arguments + 1 to: destination address. + 2 from: source address. + + +# int onig_set_meta_char(OnigSyntaxType* syntax, unsigned int what, + OnigCodePoint code) + + Set a variable meta character to the code point value. + Except for an escape character, this meta characters specification + is not work, if ONIG_SYN_OP_VARIABLE_META_CHARACTERS is not effective + by the syntax. (Build-in syntaxes are not effective.) + + normal return: ONIG_NORMAL + + arguments + 1 syntax: target syntax + 2 what: specifies which meta character it is. + + ONIG_META_CHAR_ESCAPE + ONIG_META_CHAR_ANYCHAR + ONIG_META_CHAR_ANYTIME + ONIG_META_CHAR_ZERO_OR_ONE_TIME + ONIG_META_CHAR_ONE_OR_MORE_TIME + ONIG_META_CHAR_ANYCHAR_ANYTIME + + 3 code: meta character or ONIG_INEFFECTIVE_META_CHAR. + + +# OnigCaseFoldType onig_get_default_case_fold_flag(void) + + Get default case fold flag. + + +# int onig_set_default_case_fold_flag(OnigCaseFoldType case_fold_flag) + + Set default case fold flag. + + 1 case_fold_flag: case fold flag + + +# unsigned int onig_get_match_stack_limit_size(void) + + Return the maximum number of stack size. + (default: 0 == unlimited) + + +# int onig_set_match_stack_limit_size(unsigned int size) + + Set the maximum number of stack size. + (size = 0: unlimited) + + normal return: ONIG_NORMAL + + +# unsigned int onig_get_parse_depth_limit(void) + + Return the maximum depth of parser recursion. + (default: DEFAULT_PARSE_DEPTH_LIMIT defined in regint.h. Currently 4096.) + + +# int onig_set_parse_depth_limit(unsigned int depth) + + Set the maximum depth of parser recursion. + (depth = 0: Set to the default value defined in regint.h.) + + normal return: ONIG_NORMAL + + +# int onig_end(void) + + The use of this library is finished. + + normal return: ONIG_NORMAL + + It is not allowed to use regex objects which created + before onig_end() call. + + +# const char* onig_version(void) + + Return version string. (ex. "5.0.3") + +// END diff --git a/lib/edbee-lib/vendor/onig/doc/API.ja b/lib/edbee-lib/vendor/onig/doc/API.ja new file mode 100644 index 00000000..4ae972f6 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/doc/API.ja @@ -0,0 +1,710 @@ +Onigmo インターフェース Version 6.1.2 2017/05/10 + +#include <onigmo.h> + + +# int onig_initialize(OnigEncoding use_encodings[], int num_encodings) + + ライブラリの初期化 + 鬼車6.0との互換性のために追加された。 + 現時点ではonig_init()と同じである。 + + 引数 + 1 use_encodings: 使用する文字エンコーディングの配列 + 2 num_encodings: 文字エンコーディングの数 + + +# int onig_init(void) + + ライブラリの初期化 + + シングルスレッドプログラム: + onig_new()の中で呼び出されるので、この関数を明示的に呼び出さなくてもよい。 + しかし呼び出す方が望ましい。 + + マルチスレッドプログラム: + この関数はスレッドセーフではないため、onig_new()を呼ぶ前にある特定の + スレッド(通常はメインスレッド)からこの関数を呼び出さなければならない。 + + +# int onig_error_code_to_str(UChar* err_buf, OnigPosition err_code, ...) + + エラーメッセージを取得する。 + + この関数を、onig_new()の結果に対して呼び出す場合には、onig_new()のpattern引数を + メモリ解放するよりも前に呼び出さなければならない。 + + 正常終了戻り値: エラーメッセージ文字列のバイト長 + + 引数 + 1 err_buf: エラーメッセージを格納する領域 + (必要なサイズ: ONIG_MAX_ERROR_MESSAGE_LEN) + 2 err_code: エラーコード + 3 err_info (optional): onig_new()のerr_info + + +# void onig_set_warn_func(OnigWarnFunc func) + + 警告通知関数をセットする。 + + 警告: + '[', '-', ']' in character class without escape. + ']' in pattern without escape. + + 引数 + 1 func: 警告関数 void (*func)(char* warning_message) + + +# void onig_set_verb_warn_func(OnigWarnFunc func) + + 詳細警告通知関数をセットする。 + + 詳細警告: + redundant nested repeat operator. + + 引数 + 1 func: 詳細警告関数 void (*func)(char* warning_message) + + +# int onig_new(regex_t** reg, const UChar* pattern, const UChar* pattern_end, + OnigOptionType option, OnigEncoding enc, + const OnigSyntaxType* syntax, OnigErrorInfo* err_info) + + 正規表現オブジェクト(regex)を作成する。 + + 正常終了戻り値: ONIG_NORMAL + + 引数 + 1 reg: 作成された正規表現オブジェクトを返すアドレス + 2 pattern: 正規表現パターン文字列 + 3 pattern_end: 正規表現パターン文字列の終端アドレス(pattern + pattern length) + 4 option: 正規表現コンパイル時オプション + + ONIG_OPTION_NONE オプションなし + ONIG_OPTION_SINGLELINE '^' -> '\A', '$' -> '\Z' + ONIG_OPTION_DOTALL '.'が改行にマッチする + ONIG_OPTION_MULTILINE ONIG_OPTION_DOTALLと同じ + ONIG_OPTION_IGNORECASE 曖昧マッチ オン + ONIG_OPTION_EXTEND パターン拡張形式 + ONIG_OPTION_FIND_LONGEST 最長マッチ + ONIG_OPTION_FIND_NOT_EMPTY 空マッチを無視 + ONIG_OPTION_NEGATE_SINGLELINE + ONIG_SYNTAX_POSIX_BASIC, ONIG_SYNTAX_POSIX_EXTENDED, + ONIG_SYNTAX_PERL, ONIG_SYNTAX_PERL58, ONIG_SYNTAX_PERL58_NG, + ONIG_SYNTAX_JAVA, ONIG_SYNTAX_PYTHONで + デフォルトで有効なONIG_OPTION_SINGLELINEをクリアする。 + + ONIG_OPTION_DONT_CAPTURE_GROUP 名前付き捕獲式集合のみ捕獲 + ONIG_OPTION_CAPTURE_GROUP 名前無し捕獲式集合も捕獲 + + ONIG_OPTION_NEWLINE_CRLF + CR+LFも改行として扱う。(デフォルトではLFのみ。) + この機能を使うには、regenc.hの以下の行を有効にする必要がある。 + + /* #define USE_CRNL_AS_LINE_TERMINATOR */ + + 5 enc: 文字エンコーディング + + ONIG_ENCODING_ASCII ASCII + ONIG_ENCODING_ISO_8859_1 ISO 8859-1 + ONIG_ENCODING_ISO_8859_2 ISO 8859-2 + ONIG_ENCODING_ISO_8859_3 ISO 8859-3 + ONIG_ENCODING_ISO_8859_4 ISO 8859-4 + ONIG_ENCODING_ISO_8859_5 ISO 8859-5 + ONIG_ENCODING_ISO_8859_6 ISO 8859-6 + ONIG_ENCODING_ISO_8859_7 ISO 8859-7 + ONIG_ENCODING_ISO_8859_8 ISO 8859-8 + ONIG_ENCODING_ISO_8859_9 ISO 8859-9 + ONIG_ENCODING_ISO_8859_10 ISO 8859-10 + ONIG_ENCODING_ISO_8859_11 ISO 8859-11 + ONIG_ENCODING_ISO_8859_13 ISO 8859-13 + ONIG_ENCODING_ISO_8859_14 ISO 8859-14 + ONIG_ENCODING_ISO_8859_15 ISO 8859-15 + ONIG_ENCODING_ISO_8859_16 ISO 8859-16 + ONIG_ENCODING_UTF_8 UTF-8 + ONIG_ENCODING_UTF_16BE UTF-16BE + ONIG_ENCODING_UTF_16LE UTF-16LE + ONIG_ENCODING_UTF_32BE UTF-32BE + ONIG_ENCODING_UTF_32LE UTF-32LE + ONIG_ENCODING_EUC_JP EUC-JP + ONIG_ENCODING_EUC_TW EUC-TW + ONIG_ENCODING_EUC_KR EUC-KR + ONIG_ENCODING_EUC_CN EUC-CN + ONIG_ENCODING_SHIFT_JIS Shift_JIS + ONIG_ENCODING_WINDOWS_31J Windows-31J (CP932) + ONIG_ENCODING_KOI8_R KOI8-R + ONIG_ENCODING_KOI8_U KOI8-U + ONIG_ENCODING_WINDOWS_1250 Windows-1250 (CP1250) + ONIG_ENCODING_WINDOWS_1251 Windows-1251 (CP1251) + ONIG_ENCODING_WINDOWS_1252 Windows-1252 (CP1252) + ONIG_ENCODING_WINDOWS_1253 Windows-1253 (CP1253) + ONIG_ENCODING_WINDOWS_1254 Windows-1254 (CP1254) + ONIG_ENCODING_WINDOWS_1257 Windows-1257 (CP1257) + ONIG_ENCODING_BIG5 Big5 + ONIG_ENCODING_GB18030 GB18030 + + または、ユーザが定義したOnigEncodingTypeデータのアドレス + + 後方互換性のため、以下のエンコーディング名も使用できる。 + + ONIG_ENCODING_UTF8 UTF-8 + ONIG_ENCODING_UTF16_BE UTF-16BE + ONIG_ENCODING_UTF16_LE UTF-16LE + ONIG_ENCODING_UTF32_BE UTF-32BE + ONIG_ENCODING_UTF32_LE UTF-32LE + ONIG_ENCODING_SJIS Shift_JIS + ONIG_ENCODING_CP932 Windows-31J (CP932) + ONIG_ENCODING_CP1250 Windows-1250 (CP1250) + ONIG_ENCODING_CP1251 Windows-1251 (CP1251) + ONIG_ENCODING_CP1252 Windows-1252 (CP1252) + ONIG_ENCODING_CP1253 Windows-1253 (CP1253) + ONIG_ENCODING_CP1254 Windows-1254 (CP1254) + ONIG_ENCODING_CP1257 Windows-1257 (CP1257) + + + 6 syntax: 正規表現パターン文法定義 + + ONIG_SYNTAX_ASIS plain text + ONIG_SYNTAX_POSIX_BASIC POSIX Basic RE + ONIG_SYNTAX_POSIX_EXTENDED POSIX Extended RE + ONIG_SYNTAX_EMACS Emacs + ONIG_SYNTAX_GREP grep + ONIG_SYNTAX_GNU_REGEX GNU regex + ONIG_SYNTAX_JAVA Java (Sun java.util.regex) + ONIG_SYNTAX_PERL58 Perl 5.8 + ONIG_SYNTAX_PERL58_NG Perl 5.8 + 名前付き捕獲式集合 + ONIG_SYNTAX_PERL Perl 5.10以降 + ONIG_SYNTAX_PYTHON Python + ONIG_SYNTAX_RUBY Ruby + ONIG_SYNTAX_DEFAULT default (== Ruby) + onig_set_default_syntax() + + または、ユーザが定義したOnigSyntaxTypeデータのアドレス + + 7 err_info: エラー情報を返すためのアドレス + onig_error_code_to_str()の三番目の引数として使用する + + + +# int onig_new_without_alloc(regex_t* reg, const UChar* pattern, + const UChar* pattern_end, + OnigOptionType option, OnigEncoding enc, + const OnigSyntaxType* syntax, OnigErrorInfo* err_info) + + 正規表現オブジェクト(regex)を作成する。 + regの領域を内部で割り当てない。 + + 正常終了戻り値: ONIG_NORMAL + + + +# int onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end, + OnigCompileInfo* ci, OnigErrorInfo* einfo) + + 正規表現オブジェクト(regex)を作成する。 + この関数は、onig_new()のデラックス版。 + + 正常終了戻り値: ONIG_NORMAL + + 引数 + 1 reg: 作成された正規表現オブジェクトを返すアドレス + 2 pattern: 正規表現パターン文字列 + 3 pattern_end: 正規表現パターン文字列の終端アドレス(pattern + pattern length) + 4 ci: コンパイル情報 + + ci->num_of_elements: ciの要素数 (現在の版では: 5) + ci->pattern_enc: パターン文字列の文字エンコーディング + ci->target_enc: 対象文字列の文字エンコーディング + ci->syntax: 正規表現パターン文法定義 + ci->option: 正規表現コンパイル時オプション + ci->case_fold_flag: ONIG_OPTION_IGNORECASEモードでの + 文字曖昧マッチ指定ビットフラグ + + ONIGENC_CASE_FOLD_MIN: 最小 + ONIGENC_CASE_FOLD_DEFAULT: 最小 + onig_set_default_case_fold_flag() + + 5 err_info: エラー情報を返すためのアドレス + onig_error_code_to_str()の三番目の引数として使用する + + + 異なる文字エンコーディングの組み合わせは、以下の場合にのみ許される。 + + pattern_enc: ASCII, ISO_8859_1 + target_enc: UTF16_BE, UTF16_LE, UTF32_BE, UTF32_LE + + pattern_enc: UTF16_BE/LE + target_enc: UTF16_LE/BE + + pattern_enc: UTF32_BE/LE + target_enc: UTF32_LE/BE + + +# void onig_free(regex_t* reg) + + 正規表現オブジェクトのメモリを解放する。 + + 引数 + 1 reg: 正規表現オブジェクト + + +# void onig_free_body(regex_t* reg) + + 正規表現オブジェクトのメモリを解放する。(reg自身の領域を除いて) + + 引数 + 1 reg: 正規表現オブジェクト + + + +# OnigPosition onig_search(regex_t* reg, const UChar* str, const UChar* end, + const UChar* start, const UChar* range, OnigRegion* region, + OnigOptionType option) +# OnigPosition onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end, + const UChar* global_pos, + const UChar* start, const UChar* range, OnigRegion* region, + OnigOptionType option) + + 正規表現で文字列を検索し、検索結果とマッチ領域を返す。 + + 正常終了戻り値: マッチ位置 (p - str >= 0) + 検索失敗: ONIG_MISMATCH (< 0) + + 引数 + 1 reg: 正規表現オブジェクト + 2 str: 検索対象文字列 + 3 end: 検索対象文字列の終端アドレス + 4 global_pos: \Gのアドレス + 不要時はstrと同じ値を設定すること + 5 start: 検索対象文字列の検索先頭位置アドレス + 6 range: 検索対象文字列の検索終了位置アドレス + 前方探索 (start <= 探索される文字列 < range) + 後方探索 (range <= 探索される文字列 <= start) + 7 region: マッチ領域情報(region) (NULLも許される) + 8 option: 検索時オプション + + ONIG_OPTION_NOTBOL 文字列の先頭(str)を行頭と看做さない + ONIG_OPTION_NOTEOL 文字列の終端(end)を行末と看做さない + ONIG_OPTION_NOTBOS 文字列の先頭(str)を先頭(\A)と看做さない + ONIG_OPTION_NOTEOS 文字列の終端(end)を終端(\z)と看做さない + + +# OnigPosition onig_match(regex_t* reg, const UChar* str, const UChar* end, + const UChar* at, OnigRegion* region, OnigOptionType option) + + 文字列の指定位置でマッチングを行い、結果とマッチ領域を返す。 + + 正常終了戻り値: マッチしたバイト長 (>= 0) + not match: ONIG_MISMATCH ( < 0) + + 引数 + 1 reg: 正規表現オブジェクト + 2 str: 検索対象文字列 + 3 end: 検索対象文字列の終端アドレス + 4 at: 検索対象文字列の検索アドレス + 5 region: マッチ領域情報(region) (NULLも許される) + 6 option: 検索時オプション + + ONIG_OPTION_NOTBOL 文字列の先頭(str)を行頭と看做さない + ONIG_OPTION_NOTEOL 文字列の終端(end)を行末と看做さない + ONIG_OPTION_NOTBOS 文字列の先頭(str)を先頭(\A)と看做さない + ONIG_OPTION_NOTEOS 文字列の終端(end)を終端(\z)と看做さない + + +# OnigPosition onig_scan(regex_t* reg, const UChar* str, const UChar* end, + OnigRegion* region, OnigOptionType option, + int (*scan_callback)(OnigPosition, OnigPosition, OnigRegion*, void*), + void* callback_arg) + + 正規表現で文字列をスキャンして、マッチングする毎にコールバック関数を呼び出す。 + + 正常終了: マッチ回数 (0回も含める) + エラー: エラーコード (< 0) + 中断: コールバック関数が0以外の戻り値を返したとき、その値を戻り値として中断 + + 引数 + 1 reg: 正規表現オブジェクト + 2 str: 検索対象文字列 + 3 end: 検索対象文字列の終端アドレス + 4 region: マッチ領域情報(region) (NULLも許される) + 5 option: 検索時オプション + 6 scan_callback: コールバック関数 + 7 callback_arg: コールバック関数に渡される付加引数値 + + +# OnigRegion* onig_region_new(void) + + マッチ領域情報(region)を作成する。 + + +# void onig_region_free(OnigRegion* region, int free_self) + + マッチ領域情報(region)で使用されているメモリを解放する。 + + 引数 + 1 region: マッチ領域情報オブジェクト + 2 free_self: [1: region自身を含めて全て解放, 0: region自身は解放しない] + + +# void onig_region_copy(OnigRegion* to, const OnigRegion* from) + + マッチ領域情報(region)を複製する。 + + 引数 + 1 to: 対象領域 + 2 from: 元領域 + + +# void onig_region_clear(OnigRegion* region) + + マッチ領域情報(region)の中味をクリアする。 + + 引数 + 1 region: 対象領域 + + +# int onig_region_resize(OnigRegion* region, int n) + + マッチ領域情報(region)の捕獲式集合(グループ)数を変更する。 + + 正常終了戻り値: ONIG_NORMAL + + 引数 + 1 region: 対象領域 + 2 n: 新しいサイズ + + +# int onig_name_to_group_numbers(regex_t* reg, const UChar* name, const UChar* name_end, + int** num_list) + + 指定した名前に対する名前付き捕獲式集合(グループ)の + グループ番号リストを返す。 + 名前付き捕獲式集合は、(?<name>....)によって定義できる。 + + 正常終了戻り値: 指定された名前に対するグループ数 + (例 /(?<x>..)(?<x>..)/ ==> 2) + 名前に対するグループが存在しない: -1 + + 引数 + 1 reg: 正規表現オブジェクト + 2 name: 捕獲式集合(グループ)名 + 3 name_end: 捕獲式集合(グループ)名の終端アドレス + 4 num_list: 番号リストを返すアドレス + + +# int onig_name_to_backref_number(regex_t* reg, const UChar* name, const UChar* name_end, + const OnigRegion *region) + + 指定された名前の後方参照(\k<name>)に対する捕獲式集合(グループ)の番号を返す。 + 名前に対して、複数のマッチ領域が有効であれば、その中の最大の番号を返す。 + 名前に対する捕獲式集合が一個しかないときには、対応するマッチ領域が有効か + どうかに関係なく、その番号を返す。(従って、regionにはNULLを渡してもよい。) + + 正常終了戻り値: 番号 + + 引数 + 1 reg: 正規表現オブジェクト + 2 name: 捕獲式集合(グループ)名 + 3 name_end: 捕獲式集合(グループ)名の終端アドレス + 4 region: search/match結果のマッチ領域 + + +# int onig_foreach_name(regex_t* reg, + int (*func)(const UChar*, const UChar*, int,int*,regex_t*,void*), + void* arg) + + 全ての名前に対してコールバック関数呼び出しを実行する。 + + 正常終了戻り値: 0 + エラー: コールバック関数の戻り値 + + 引数 + 1 reg: 正規表現オブジェクト + 2 func: コールバック関数 + func(name, name_end, <number of groups>, <group number's list>, + reg, arg); + + funcが0以外の値を返すと、それ以降のコールバックは行なわずに + 終了する。 + + 3 arg: funcに対する追加引数 + + +# int onig_number_of_names(const regex_t* reg) + + パターン中で定義された名前の数を返す。 + 一個の名前の多重定義は一個と看做す。 + + 引数 + 1 reg: 正規表現オブジェクト + + +# OnigEncoding onig_get_encoding(const regex_t* reg) +# OnigOptionType onig_get_options(const regex_t* reg) +# OnigCaseFoldType onig_get_case_fold_flag(const regex_t* reg) +# const OnigSyntaxType* onig_get_syntax(const regex_t* reg) + + 正規表現オブジェクトに対して、対応する値を返す。 + + 引数 + 1 reg: 正規表現オブジェクト + + +# int onig_number_of_captures(const regex_t* reg) + + パターン中で定義された捕獲グループの数を返す。 + + 引数 + 1 reg: 正規表現オブジェクト + + +# int onig_number_of_capture_histories(const regex_t* reg) + + パターン中で定義された捕獲履歴(?@...)の数を返す。 + + 使用する文法で捕獲履歴機能が有効(ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY) + でなければ、捕獲履歴機能は使用できない。 + + 引数 + 1 reg: 正規表現オブジェクト + + +# OnigCaptureTreeNode* onig_get_capture_tree(OnigRegion* region) + + 捕獲履歴データのルートノードを返す。 + + マッチが失敗している場合には、この値は不定である。 + + 引数 + 1 region: マッチ領域 + + +# int onig_capture_tree_traverse(OnigRegion* region, int at, + int(*func)(int,OnigPosition,OnigPosition,int,int,void*), + void* arg) + + 捕獲履歴データ木を巡回してコールバックする。 + + 正常終了戻り値: 0 + エラー: コールバック関数の戻り値 + + 引数 + 1 region: マッチ領域 + 2 at: コールバックを行なうタイミング + + ONIG_TRAVERSE_CALLBACK_AT_FIRST: + 最初にコールバックして、子ノードを巡回 + ONIG_TRAVERSE_CALLBACK_AT_LAST: + 子ノードを巡回して、コールバック + ONIG_TRAVERSE_CALLBACK_AT_BOTH: + 最初にコールバックして、子ノードを巡回、最後にもう一度コールバック + + 3 func: コールバック関数 + funcが0以外の値を返すと、それ以降の巡回は行なわずに + 終了する。 + + int func(int group, OnigPosition beg, OnigPosition end, + int level, int at, void* arg) + group: グループ番号 + beg: マッチ開始位置 + end マッチ終了位置 + level: ネストレベル (0から) + at: コールバックが呼び出されたタイミング + ONIG_TRAVERSE_CALLBACK_AT_FIRST + ONIG_TRAVERSE_CALLBACK_AT_LAST + arg: 追加引数 + + 4 arg; funcに対する追加引数 + + +# int onig_noname_group_capture_is_active(const regex_t* reg) + + 名前なし式集合の捕獲機能が有効かどうかを返す。 + + 有効: 1 + 無効: 0 + + 引数 + 1 reg: 正規表現オブジェクト + + + オプションのONIG_OPTION_DONT_CAPTURE_GROUPがON --> 無効 + + パターンが名前つき式集合を使用している + AND 使用文法で、ONIG_SYN_CAPTURE_ONLY_NAMED_GROUPがON + AND オプションのONIG_OPTION_CAPTURE_GROUPがOFF + --> 無効 + + 上記以外の場合 --> 有効 + + +# UChar* onigenc_get_prev_char_head(OnigEncoding enc, const UChar* start, + const UChar* s, const UChar* end) + + 文字一個分前の文字列位置を返す。 + + 引数 + 1 enc: 文字エンコーディング + 2 start: 文字列の先頭アドレス + 3 s: 文字列中の位置 + 4 end: 文字列の末尾 + + +# UChar* onigenc_get_left_adjust_char_head(OnigEncoding enc, + const UChar* start, const UChar* s, const UChar* end) + + 文字の先頭バイト位置になるように左側に調整したアドレスを返す。 + + 引数 + 1 enc: 文字エンコーディング + 2 start: 文字列の先頭アドレス + 3 s: 文字列中の位置 + 4 end: 文字列の末尾 + + +# UChar* onigenc_get_right_adjust_char_head(OnigEncoding enc, + const UChar* start, const UChar* s, const UChar* end) + + 文字の先頭バイト位置になるように右側に調整したアドレスを返す。 + + 引数 + 1 enc: 文字エンコーディング + 2 start: 文字列の先頭アドレス + 3 s: 文字列中の位置 + 4 end: 文字列の末尾 + + +# int onigenc_strlen(OnigEncoding enc, const UChar* s, const UChar* end) +# int onigenc_strlen_null(OnigEncoding enc, const UChar* s) + + 文字列の文字数を返す。 + + +# int onigenc_str_bytelen_null(OnigEncoding enc, const UChar* s) + + 文字列のバイト数を返す。 + + +# int onig_set_default_syntax(const OnigSyntaxType* syntax) + + デフォルトの正規表現パターン文法をセットする。 + + 引数 + 1 syntax: 正規表現パターン文法 + + +# void onig_copy_syntax(OnigSyntaxType* to, const OnigSyntaxType* from) + + 正規表現パターン文法をコピーする。 + + 引数 + 1 to: 対象 + 2 from: 元 + + +# unsigned int onig_get_syntax_op(const OnigSyntaxType* syntax) +# unsigned int onig_get_syntax_op2(const OnigSyntaxType* syntax) +# unsigned int onig_get_syntax_behavior(const OnigSyntaxType* syntax) +# OnigOptionType onig_get_syntax_options(const OnigSyntaxType* syntax) + +# void onig_set_syntax_op(OnigSyntaxType* syntax, unsigned int op) +# void onig_set_syntax_op2(OnigSyntaxType* syntax, unsigned int op2) +# void onig_set_syntax_behavior(OnigSyntaxType* syntax, unsigned int behavior) +# void onig_set_syntax_options(OnigSyntaxType* syntax, OnigOptionType options) + + 正規表現パターン文法の要素を参照/取得する。 + + 引数 + 1 syntax: 正規表現パターン文法 + 2 op, op2, behavior, options: 要素の値 + + +# void onig_copy_encoding(OnigEncodingType *to, OnigEncoding from) + + 文字エンコーディングをコピーする。 + + 引数 + 1 to: 対象 + 2 from: 元 + + +# int onig_set_meta_char(OnigSyntaxType* syntax, unsigned int what, + OnigCodePoint code) + + メタ文字を指定したコードポイント値にセットする。 + ONIG_SYN_OP_VARIABLE_META_CHARACTERSが正規表現パターン文法で有効に + なっていない場合には、エスケープ文字を除いて、ここで指定したメタ文字は + 機能しない。(組込みの文法では有効にしていない。) + + 正常終了戻り値: ONIG_NORMAL + + 引数 + 1 syntax: 対象文法 + 2 what: メタ文字機能の指定 + + ONIG_META_CHAR_ESCAPE + ONIG_META_CHAR_ANYCHAR + ONIG_META_CHAR_ANYTIME + ONIG_META_CHAR_ZERO_OR_ONE_TIME + ONIG_META_CHAR_ONE_OR_MORE_TIME + ONIG_META_CHAR_ANYCHAR_ANYTIME + + 3 code: メタ文字のコードポイント または ONIG_INEFFECTIVE_META_CHAR. + + +# OnigCaseFoldType onig_get_default_case_fold_flag(void) + + デフォルトのcase foldフラグを取得する。 + + +# int onig_set_default_case_fold_flag(OnigCaseFoldType case_fold_flag) + + デフォルトのcase foldフラグをセットする。 + + 引数 + 1 case_fold_flag: case foldフラグ + + +# unsigned int onig_get_match_stack_limit_size(void) + + マッチスタックサイズの最大値を返す。 + (デフォルト: 0 == 無制限) + + +# int onig_set_match_stack_limit_size(unsigned int size) + + マッチスタックサイズの最大値を指定する。 + (size = 0: 無制限) + + 正常終了戻り値: ONIG_NORMAL + + +# unsigned int onig_get_parse_depth_limit(void) + + 再帰パース処理の最大深さを返す。 + (デフォルト: regint.h で定義されている DEFAULT_PARSE_DEPTH_LIMIT。現在は 4096) + + +# int onig_set_parse_depth_limit(unsigned int depth) + + 再帰パース処理の最大深さを指定する。 + (depth = 0: regint.h で定義されたデフォルト値に設定する。) + + 正常終了戻り値: ONIG_NORMAL + + +# int onig_end(void) + + ライブラリの使用を終了する。 + + 正常終了戻り値: ONIG_NORMAL + + onig_init()を再度呼び出しても、以前に作成した正規表現オブジェクト + を使用することはできない。 + + +# const char* onig_version(void) + + バージョン文字列を返す。(例 "5.0.3") + +// END diff --git a/lib/edbee-lib/vendor/onig/doc/FAQ b/lib/edbee-lib/vendor/onig/doc/FAQ new file mode 100644 index 00000000..444753ad --- /dev/null +++ b/lib/edbee-lib/vendor/onig/doc/FAQ @@ -0,0 +1,23 @@ +FAQ 2016/11/07 + +1. Longest match + + You can execute longest match by using ONIG_OPTION_FIND_LONGEST option + in onig_new(). + + +2. CR + LF + + DOS newline (CR (0x0c) + LF (0x0a) sequence) + + Enable the following line in regenc.h, and use ONIG_OPTION_NEWLINE_CRLF + option in onig_new(). + + /* #define USE_CRNL_AS_LINE_TERMINATOR */ + + +3. Mailing list + + There is no mailing list about Onigmo/Oniguruma. + +// END diff --git a/lib/edbee-lib/vendor/onig/doc/FAQ.ja b/lib/edbee-lib/vendor/onig/doc/FAQ.ja new file mode 100644 index 00000000..0749aca8 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/doc/FAQ.ja @@ -0,0 +1,23 @@ +FAQ 2016/11/07 + +1. 最長マッチ + + onig_new()の中で、ONIG_OPTION_FIND_LONGESTオプション + を使用すれば最長マッチになる。 + + +2. CR + LF + + DOSの改行(CR(0x0c) + LF(0x0a)の連続) + + regenc.hの中の、以下の部分を有効にし、onig_new()で + ONIG_OPTION_NEWLINE_CRLFオプションを使用する。 + + /* #define USE_CRNL_AS_LINE_TERMINATOR */ + + +3. メーリングリスト + + 鬼雲/鬼車に関するメーリングリストは存在しない。 + +//END diff --git a/lib/edbee-lib/vendor/onig/doc/RE b/lib/edbee-lib/vendor/onig/doc/RE new file mode 100644 index 00000000..17c84ba9 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/doc/RE @@ -0,0 +1,569 @@ +Onigmo (Oniguruma-mod) Regular Expressions Version 6.1.0 2016/12/25 + +syntax: ONIG_SYNTAX_RUBY (default) + + +1. Syntax elements + + \ escape (enable or disable meta character) + | alternation + (...) group + [...] character class + + +2. Characters + + \t horizontal tab (0x09) + \v vertical tab (0x0B) + \n newline (line feed) (0x0A) + \r carriage return (0x0D) + \b backspace (0x08) + \f form feed (0x0C) + \a bell (0x07) + \e escape (0x1B) + \nnn octal char (encoded byte value) + \xHH hexadecimal char (encoded byte value) + \x{7HHHHHHH} wide hexadecimal char (character code point value) + \uHHHH wide hexadecimal char (character code point value) + \cx control char (character code point value) + \C-x control char (character code point value) + \M-x meta (x|0x80) (character code point value) + \M-\C-x meta control char (character code point value) + + (* \b as backspace is effective in character class only) + + * ONIG_SYNTAX_PERL: \o{nnn} (octal char) can be also used. + + +3. Character types + + . any character (except newline) + + \w word character + + Not Unicode: + alphanumeric and "_". + + Unicode: + General_Category -- (Letter|Mark|Number|Connector_Punctuation) + + It depends on ONIG_OPTION_ASCII_RANGE option that non-ASCII char + includes or not. + + \W non-word char + + \s whitespace char + + Not Unicode: + \t, \n, \v, \f, \r, \x20 + + Unicode: + 0009, 000A, 000B, 000C, 000D, 0085(NEL), + General_Category -- Line_Separator + -- Paragraph_Separator + -- Space_Separator + + It depends on ONIG_OPTION_ASCII_RANGE option that non-ASCII char + includes or not. + + \S non-whitespace char + + \d decimal digit char + + Unicode: General_Category -- Decimal_Number + + It depends on ONIG_OPTION_ASCII_RANGE option that non-ASCII char + includes or not. + + \D non-decimal-digit char + + \h hexadecimal-digit char [0-9a-fA-F] + + \H non-hexadecimal-digit char + + + Character Property + + * \p{property-name} + * \p{^property-name} (negative) + * \P{property-name} (negative) + + property-name: + + + works on all encodings + Alnum, Alpha, Blank, Cntrl, Digit, Graph, Lower, + Print, Punct, Space, Upper, XDigit, Word, ASCII + + + works on EUC_JP, Shift_JIS, CP932 + Hiragana, Katakana, Han, Latin, Greek, Cyrillic + + + works on UTF-8, UTF-16, UTF-32 + see UnicodeProps.txt + + \p{Punct} works slightly different on Unicode encodings and the other + encodings. It matches the nine characters "$+<=>^`|~" on non-Unicode + encodings (which is the same as [[:punct:]]), but not on Unicode encodings. + \p{XPosixPunct} matches the nine characters on Unicode encodings. + + + \R Linebreak + + Unicode: + (?>\x0D\x0A|[\x0A-\x0D\x{85}\x{2028}\x{2029}]) + + Not Unicode: + (?>\x0D\x0A|[\x0A-\x0D]) + + \X Extended Grapheme cluster + + Unicode: + See: Unicode Standard Annex #29 UNICODE TEXT SEGMENTATION + http://unicode.org/reports/tr29/ + + Not Unicode: + (?>\x0D\x0A|(?m:.)) + + + +4. Quantifier + + greedy + + ? 1 or 0 times + * 0 or more times + + 1 or more times + {n,m} at least n but no more than m times + {n,} at least n times + {,n} at least 0 but no more than n times ({0,n}) + {n} n times + + reluctant + + ?? 1 or 0 times + *? 0 or more times + +? 1 or more times + {n,m}? at least n but not more than m times + {n,}? at least n times + {,n}? at least 0 but not more than n times (== {0,n}?) + + possessive (greedy and does not backtrack once match) + + ?+ 1 or 0 times + *+ 0 or more times + ++ 1 or more times + + ({n,m}+, {n,}+, {n}+ are possessive op. in ONIG_SYNTAX_JAVA and + ONIG_SYNTAX_PERL only) + + ex. /a*+/ === /(?>a*)/ + + +5. Anchors + + ^ beginning of the line + $ end of the line + \b word boundary + \B non-word boundary + \A beginning of string + \Z end of string, or before newline at the end + \z end of string + \G where the current search attempt begins + + +6. Character class + + ^... negative class (lowest precedence) + x-y range from x to y + [...] set (character class in character class) + ..&&.. intersection (low precedence, only higher than ^) + + ex. [a-w&&[^c-g]z] ==> ([a-w] AND ([^c-g] OR z)) ==> [abh-w] + + * If you want to use '[', '-', or ']' as a normal character + in character class, you should escape them with '\'. + + + POSIX bracket ([:xxxxx:], negate [:^xxxxx:]) + + Not Unicode Case: + + alnum alphabet or digit char + alpha alphabet + ascii code value: [0 - 127] + blank \t, \x20 + cntrl + digit 0-9 + graph \x21-\x7E and all of multibyte encoded characters + lower + print \x20-\x7E and all of multibyte encoded characters + punct + space \t, \n, \v, \f, \r, \x20 + upper + xdigit 0-9, a-f, A-F + word alphanumeric, "_" and multibyte characters + + + Unicode Case: + + alnum Letter | Mark | Decimal_Number + alpha Letter | Mark + ascii 0000 - 007F + blank Space_Separator | 0009 + cntrl Control | Format | Unassigned | Private_Use | Surrogate + digit Decimal_Number + graph [[:^space:]] && ^Control && ^Unassigned && ^Surrogate + lower Lowercase_Letter + print [[:graph:]] | Space_Separator + punct Connector_Punctuation | Dash_Punctuation | Close_Punctuation | + Final_Punctuation | Initial_Punctuation | Other_Punctuation | + Open_Punctuation | 0024 | 002B | 003C | 003D | 003E | 005E | + 0060 | 007C | 007E + space Space_Separator | Line_Separator | Paragraph_Separator | + 0009 | 000A | 000B | 000C | 000D | 0085 + upper Uppercase_Letter + xdigit 0030 - 0039 | 0041 - 0046 | 0061 - 0066 + (0-9, a-f, A-F) + word Letter | Mark | Decimal_Number | Connector_Punctuation + + + It depends on ONIG_OPTION_ASCII_RANGE option and + ONIG_OPTION_POSIX_BRACKET_ALL_RANGE option that POSIX brackets + match non-ASCII char or not. + + + +7. Extended groups + + (?#...) comment + + (?imxdau-imx) option on/off + i: ignore case + m: multi-line (dot (.) also matches newline) + x: extended form + + character set option (character range option) + d: Default (compatible with Ruby 1.9.3) + \w, \d and \s doesn't match non-ASCII characters. + \b, \B and POSIX brackets use the each encoding's + rules. + a: ASCII + ONIG_OPTION_ASCII_RANGE option is turned on. + \w, \d, \s and POSIX brackets doesn't match + non-ASCII characters. + \b and \B use the ASCII rules. + u: Unicode + ONIG_OPTION_ASCII_RANGE option is turned off. + \w (\W), \d (\D), \s (\S), \b (\B) and POSIX + brackets use the each encoding's rules. + + (?imxdau-imx:subexp) + option on/off for subexp + + (?:subexp) non-capturing group + (subexp) capturing group + + (?=subexp) look-ahead + (?!subexp) negative look-ahead + (?<=subexp) look-behind + (?<!subexp) negative look-behind + + Subexp of look-behind must be fixed-width. + But top-level alternatives can be of various lengths. + ex. (?<=a|bc) is OK. (?<=aaa(?:b|cd)) is not allowed. + + In negative look-behind, capturing group isn't allowed, + but non-capturing group (?:) is allowed. + + \K keep + Another expression of look-behind. Keep the stuff left + of the \K, don't include it in the result. + + (?>subexp) atomic group + no backtracks in subexp. + + (?<name>subexp), (?'name'subexp) + define named group + (Each character of the name must be a word character.) + + Not only a name but a number is assigned like a capturing + group. + + Assigning the same name to two or more subexps is allowed. + + (?(cond)yes-subexp), (?(cond)yes-subexp|no-subexp) + conditional expression + Matches yes-subexp if (cond) yields a true value, matches + no-subexp otherwise. + Following (cond) can be used: + + (n) (n >= 1) + Checks if the numbered capturing group has matched + something. + + (<name>), ('name') + Checks if a group with the given name has matched + something. + + BUG: If the name is defined more than once, the + left-most group is checked, but it should be the + same as \k<name>. + + (?~subexp) absence operator (experimental) + Matches any string which doesn't contain any string which + matches subexp. + More precisely, (?~subexp) matches the complement set of + a set which .*subexp.* matches. This is regular in the + meaning of formal language theory. + Similar to (?:(?!subexp).)*, but easy to write. + + E.g.: + (?~abc) matches: "", "ab", "aab", "ccdd", etc. + It doesn't match: "abc", "aabc", "ccabcdd", etc. + + \/\*(?~\*\/)\*\/ matches C style comments: + "/**/", "/* foobar */", etc. + + \A\/\*(?~\*\/)\*\/\z doesn't match "/**/ */". + This is different from \A\/\*.*?\*\/\z which uses a + reluctant quantifier (.*?). + + Unlike (?:(?!abc).)*c, (?~abc)c matches "abc", because + (?~abc) matches "ab". + + (?~) never matches. + + Theoretical backgrounds are discussed in Tanaka Akira's + paper and slide (both Japanese): + + * Absent Operator for Regular Expression + https://staff.aist.go.jp/tanaka-akira/pub/prosym49-akr-paper.pdf + * 正規表現における非包含オペレータの提案 + https://staff.aist.go.jp/tanaka-akira/pub/prosym49-akr-presen.pdf + + +8. Backreferences + + When we say "backreference a group," it actually means, "re-match the same + text matched by the subexp in that group." + + \n \k<n> \k'n' (n >= 1) backreference the nth group in the regexp + \k<-n> \k'-n' (n >= 1) backreference the nth group counting + backwards from the referring position + \k<name> \k'name' backreference a group with the specified name + + When backreferencing with a name that is assigned to more than one groups, + the last group with the name is checked first, if not matched then the + previous one with the name, and so on, until there is a match. + + * Backreference by number is forbidden if any named group is defined and + ONIG_OPTION_CAPTURE_GROUP is not set. + + * ONIG_SYNTAX_PERL: \g{n}, \g{-n} and \g{name} can also be used. + If a name is defined more than once in Perl syntax, only the left-most + group is checked. + + + backreference with recursion level + + (n >= 1, level >= 0) + + \k<n+level> \k'n+level' + \k<n-level> \k'n-level' + \k<-n+level> \k'-n+level' + \k<-n-level> \k'-n-level' + + \k<name+level> \k'name+level' + \k<name-level> \k'name-level' + + Destine a group on the recursion level relative to the referring position. + + ex 1. + + /\A(?<a>|.|(?:(?<b>.)\g<a>\k<b>))\z/.match("reee") + /\A(?<a>|.|(?:(?<b>.)\g<a>\k<b+0>))\z/.match("reer") + + \k<b+0> refers to the (?<b>.) on the same recursion level with it. + + ex 2. + + r = Regexp.compile(<<'__REGEXP__'.strip, Regexp::EXTENDED) + (?<element> \g<stag> \g<content>* \g<etag> ){0} + (?<stag> < \g<name> \s* > ){0} + (?<name> [a-zA-Z_:]+ ){0} + (?<content> [^<&]+ (\g<element> | [^<&]+)* ){0} + (?<etag> </ \k<name+1> >){0} + \g<element> + __REGEXP__ + + p r.match("<foo>f<bar>bbb</bar>f</foo>").captures + + +9. Subexp calls ("Tanaka Akira special") + + When we say "call a group," it actually means, "re-execute the subexp in + that group." + + \g<0> \g'0' call the whole pattern recursively + \g<n> \g'n' (n >= 1) call the nth group + \g<-n> \g'-n' (n >= 1) call the nth group counting backwards from + the calling position + \g<+n> \g'+n' (n >= 1) call the nth group counting forwards from + the calling position + \g<name> \g'name' call the group with the specified name + + * Left-most recursive calls are not allowed. + + ex. (?<name>a|\g<name>b) => error + (?<name>a|b\g<name>c) => OK + + * Calls with a name that is assigned to more than one groups are not + allowed in ONIG_SYNTAX_RUBY. + + * Call by number is forbidden if any named group is defined and + ONIG_OPTION_CAPTURE_GROUP is not set. + + * The option status of the called group is always effective. + + ex. /(?-i:\g<name>)(?i:(?<name>a)){0}/.match("A") + + * ONIG_SYNTAX_PERL: + Use (?&name), (?n), (?-n), (?+n), (?R) or (?0) instead of \g<>. + Calls with a name that is assigned to more than one groups are allowed, + and the left-most subexp is used. + + +10. Captured group + + Behavior of an unnamed group (...) changes with the following conditions. + (But named group is not changed.) + + case 1. /.../ (named group is not used, no option) + + (...) is treated as a capturing group. + + case 2. /.../g (named group is not used, 'g' option) + + (...) is treated as a non-capturing group (?:...). + + case 3. /..(?<name>..)../ (named group is used, no option) + + (...) is treated as a non-capturing group. + numbered-backref/call is not allowed. + + case 4. /..(?<name>..)../G (named group is used, 'G' option) + + (...) is treated as a capturing group. + numbered-backref/call is allowed. + + where + g: ONIG_OPTION_DONT_CAPTURE_GROUP + G: ONIG_OPTION_CAPTURE_GROUP + + ('g' and 'G' options are argued in ruby-dev ML) + + + +----------------------------- +A-1. Syntax-dependent options + + + ONIG_SYNTAX_RUBY + (?m): dot (.) also matches newline + + + ONIG_SYNTAX_PERL, ONIG_SYNTAX_JAVA and ONIG_SYNTAX_PYTHON + (?s): dot (.) also matches newline + (?m): ^ matches after newline, $ matches before newline + + + ONIG_SYNTAX_PERL + (?d), (?l): same as (?u) + + +A-2. Original extensions + + + hexadecimal digit char type \h, \H + + named group (?<name>...), (?'name'...) + + named backref \k<name> + + subexp call \g<name>, \g<group-num> + + +A-3. Missing features compared with perl 5.18.0 + + + \N{name}, \N{U+xxxx}, \N + + \l,\u,\L,\U, \C + + \v, \V, \h, \H + + (?{code}) + + (??{code}) + + (?|...) + + (?[]) + + (*VERB:ARG) + + * \Q...\E + This is effective on ONIG_SYNTAX_PERL and ONIG_SYNTAX_JAVA. + + +A-4. Differences with Japanized GNU regex(version 0.12) of Ruby 1.8 + + + add character property (\p{property}, \P{property}) + + add hexadecimal digit char type (\h, \H) + + add look-behind + (?<=fixed-width-pattern), (?<!fixed-width-pattern) + + add possessive quantifier. ?+, *+, ++ + + add operations in character class. [], && + ('[' must be escaped as an usual char in character class.) + + add named group and subexp call. + + octal or hexadecimal number sequence can be treated as + a multibyte code char in character class if multibyte encoding + is specified. + (ex. [\xa1\xa2], [\xa1\xa7-\xa4\xa1]) + + allow the range of single byte char and multibyte char in character + class. + ex. /[a-<<any EUC-JP character>>]/ in EUC-JP encoding. + + effect range of isolated option is to next ')'. + ex. (?:(?i)a|b) is interpreted as (?:(?i:a|b)), not (?:(?i:a)|b). + + isolated option is not transparent to previous pattern. + ex. a(?i)* is a syntax error pattern. + + allowed unpaired left brace as a normal character. + ex. /{/, /({)/, /a{2,3/ etc... + + negative POSIX bracket [:^xxxx:] is supported. + + POSIX bracket [:ascii:] is added. + + repeat of look-ahead is not allowed. + ex. /(?=a)*/, /(?!b){5}/ + + Ignore case option is effective to escape sequence. + ex. /\x61/i =~ "A" + + In the range quantifier, the number of the minimum is optional. + /a{,n}/ == /a{0,n}/ + The omission of both minimum and maximum values is not allowed. + /a{,}/ + + /{n}?/ is not a reluctant quantifier. + /a{n}?/ == /(?:a{n})?/ + + invalid back reference is checked and raises error. + /\1/, /(a)\2/ + + Zero-width match in an infinite loop stops the repeat, + then changes of the capture group status are checked as stop condition. + /(?:()|())*\1\2/ =~ "" + /(?:\1a|())*/ =~ "a" + + +A-5. Features disabled in default syntax + + + capture history + + (?@...) and (?@<name>...) + + ex. /(?@a)*/.match("aaa") ==> [<0-1>, <1-2>, <2-3>] + + see sample/listcap.c file. + + +A-6. Problems + + + Invalid encoding byte sequence is not checked. + + ex. UTF-8 + + * Invalid first byte is treated as a character. + /./u =~ "\xa3" + + * Incomplete byte sequence is not checked. + /\w+/ =~ "a\xf3\x8ec" + +// END diff --git a/lib/edbee-lib/vendor/onig/doc/RE.ja b/lib/edbee-lib/vendor/onig/doc/RE.ja new file mode 100644 index 00000000..c4e25687 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/doc/RE.ja @@ -0,0 +1,565 @@ +鬼雲 (鬼車改) 正規表現 Version 6.1.0 2016/12/25 + +使用文法: ONIG_SYNTAX_RUBY (既定値) + + +1. 基本要素 + + \ 退避修飾 (エスケープ) 正規表現記号の有効/無効の制御 + | 選択子 + (...) 式集合 (グループ) + [...] 文字集合 (文字クラス) + + +2. 文字 + + \t 水平タブ (0x09) + \v 垂直タブ (0x0B) + \n 改行 (0x0A) + \r 復帰 (0x0D) + \b 後退空白 (0x08) + \f 改頁 (0x0C) + \a 鐘 (0x07) + \e 退避修飾 (0x1B) + \nnn 八進数表現 符号化バイト値(の一部) + \xHH 十六進数表現 符号化バイト値(の一部) + \x{7HHHHHHH} 拡張十六進数表現 コードポイント値 + \uHHHH 拡張十六進数表現 コードポイント値 + \cx 制御文字表現 コードポイント値 + \C-x 制御文字表現 コードポイント値 + \M-x 超 (x|0x80) コードポイント値 + \M-\C-x 超 + 制御文字表現 コードポイント値 + + ※ \bは、文字集合内でのみ有効 + + ※ ONIG_SYNTAX_PERLでは \o{nnn} (八進数表現)も使用できる。 + + +3. 文字種 + + . 任意文字 (改行を除く) + + \w 単語構成文字 + + Unicode以外の場合: + 英数字 および "_"。 + + Unicodeの場合: + General_Category -- (Letter|Mark|Number|Connector_Punctuation) + + ASCII外の文字を含むかどうかは ONIG_OPTION_ASCII_RANGE オプションに + 依存する。 + + \W 非単語構成文字 + + \s 空白文字 + + Unicode以外の場合: + \t, \n, \v, \f, \r, \x20 + + Unicodeの場合: + 0009, 000A, 000B, 000C, 000D, 0085(NEL), + General_Category -- Line_Separator + -- Paragraph_Separator + -- Space_Separator + + ASCII外の文字を含むかどうかは ONIG_OPTION_ASCII_RANGE オプションに + 依存する。 + + \S 非空白文字 + + \d 10進数字 + + Unicodeの場合: General_Category -- Decimal_Number + + ASCII外の文字を含むかどうかは ONIG_OPTION_ASCII_RANGE オプションに + 依存する。 + + \D 非10進数字 + + \h 16進数字 [0-9a-fA-F] + + \H 非16進数字 + + + Character Property + + * \p{property-name} + * \p{^property-name} (negative) + * \P{property-name} (negative) + + property-name: + + + 全てのエンコーディングで有効 + Alnum, Alpha, Blank, Cntrl, Digit, Graph, Lower, + Print, Punct, Space, Upper, XDigit, Word, ASCII, + + + EUC-JP, Shift_JIS, CP932で有効 + Hiragana, Katakana, Han, Latin, Greek, Cyrillic + + + UTF-8, UTF-16, UTF-32で有効 + UnicodeProps.txt 参照 + + \p{Punct} は、Unicodeの場合とそれ以外で少し異なった動作をする。Unicode + 以外の場合は、"$+<=>^`|~" の9個の文字にマッチするが(これは [[:punct:]] と + 同じである)、Unicodeの場合はマッチしない。 + Unicodeの場合、\p{XPosixPunct} はこの9個の文字にマッチする。 + + + \R 改行文字 (Linebreak) + + Unicodeの場合: + (?>\x0D\x0A|[\x0A-\x0D\x{85}\x{2028}\x{2029}]) + + Unicode以外の場合: + (?>\x0D\x0A|[\x0A-\x0D]) + + \X 拡張書記素クラスタ (Extended Grapheme cluster) + + Unicodeの場合: + 参照: Unicode Standard Annex #29 UNICODE TEXT SEGMENTATION + http://unicode.org/reports/tr29/ + + Unicode以外の場合: + (?>\x0D\x0A|(?m:.)) + + + +4. 量指定子 + + 欲張り + + ? 一回または零回 + * 零回以上 + + 一回以上 + {n,m} n回以上m回以下 + {n,} n回以上 + {,n} 零回以上n回以下 ({0,n}) + {n} n回 + + 無欲 + + ?? 一回または零回 + *? 零回以上 + +? 一回以上 + {n,m}? n回以上m回以下 + {n,}? n回以上 + {,n}? 零回以上n回以下 (== {0,n}?) + + 強欲 (欲張りで、繰り返しに成功した後は回数を減らすような後退再試行をしない) + + ?+ 一回または零回 + *+ 零回以上 + ++ 一回以上 + + ({n,m}+, {n,}+, {n}+ は、ONIG_SYNTAX_JAVAとONIG_SYNTAX_PERLでのみ強欲な + 指定子) + + 例. /a*+/ === /(?>a*)/ + + +5. 錨 + + ^ 行頭 + $ 行末 + \b 単語境界 + \B 非単語境界 + \A 文字列先頭 + \Z 文字列末尾、または文字列末尾の改行の直前 + \z 文字列末尾 + \G 照合開始位置 + + +6. 文字集合 + + ^... 否定 (最低優先度演算子) + x-y 範囲 (xからyまで) + [...] 集合 (文字集合内文字集合) + ..&&.. 積演算 (^の次に優先度が低い演算子) + + 例. [a-w&&[^c-g]z] ==> ([a-w] and ([^c-g] or z)) ==> [abh-w] + + ※ '[', '-', ']'を、文字集合内で通常文字の意味で使用したい場合には、 + これらの文字を'\'で退避修飾しなければならない。 + + + POSIXブラケット ([:xxxxx:], 否定 [:^xxxxx:]) + + Unicode以外の場合: + + alnum 英数字 + alpha 英字 + ascii 0 - 127 + blank \t, \x20 + cntrl + digit 0-9 + graph \x21-\x7E および 多バイト文字全部を含む + lower + print \x20-\x7E および 多バイト文字全部を含む + punct + space \t, \n, \v, \f, \r, \x20 + upper + xdigit 0-9, a-f, A-F + word 英数字, "_" および 多バイト文字 + + Unicodeの場合: + + alnum Letter | Mark | Decimal_Number + alpha Letter | Mark + ascii 0000 - 007F + blank Space_Separator | 0009 + cntrl Control | Format | Unassigned | Private_Use | Surrogate + digit Decimal_Number + graph [[:^space:]] && ^Control && ^Unassigned && ^Surrogate + lower Lowercase_Letter + print [[:graph:]] | Space_Separator + punct Connector_Punctuation | Dash_Punctuation | Close_Punctuation | + Final_Punctuation | Initial_Punctuation | Other_Punctuation | + Open_Punctuation | 0024 | 002B | 003C | 003D | 003E | 005E | + 0060 | 007C | 007E + space Space_Separator | Line_Separator | Paragraph_Separator | + 0009 | 000A | 000B | 000C | 000D | 0085 + upper Uppercase_Letter + xdigit 0030 - 0039 | 0041 - 0046 | 0061 - 0066 + (0-9, a-f, A-F) + word Letter | Mark | Decimal_Number | Connector_Punctuation + + + POSIXブラケットがASCII外の文字にマッチするかどうかは + ONIG_OPTION_ASCII_RANGEオプションとONIG_OPTION_POSIX_BRACKET_ALL_RANGE + オプションに依存する。 + + + +7. 拡張式集合 + + (?#...) 注釈 + (?imxdau-imx) 孤立オプション + i: 大文字小文字照合 + m: 複数行 + x: 拡張形式 + + 文字集合オプション (文字範囲オプション) + d: デフォルト (Ruby 1.9.3 互換) + \w, \d, \s は、非ASCII文字にマッチしない。 + \b, \B, POSIXブラケットは、各エンコーディングの + ルールに従う。 + a: ASCII + ONIG_OPTION_ASCII_RANGEオプションがオンになる。 + \w, \d, \s, POSIXブラケットは、非ASCII文字に + マッチしない。 + \b, \B は、ASCIIのルールに従う。 + u: Unicode + ONIG_OPTION_ASCII_RANGEオプションがオフになる。 + \w (\W), \d (\D), \s (\S), \b (\B), POSIXブラケット + は、各エンコーディングのルールに従う。 + + (?imxdau-imx:式) 式オプション + + (式) 捕獲式集合 + (?:式) 非捕獲式集合 + + (?=式) 先読み + (?!式) 否定先読み + (?<=式) 戻り読み + (?<!式) 否定戻り読み + + 戻り読みの式は固定文字長でなければならない。 + しかし、最上位の選択子だけは異なった文字長が許される。 + 例. (?<=a|bc) は許可. (?<=aaa(?:b|cd)) は不許可 + + 否定戻り読みでは、捕獲式集合は許されないが、 + 非捕獲式集合は許される。 + + \K 保持 + 戻り読みの別表記。\K の左側を保持し、検索結果に含まない。 + + (?>式) 原子的式集合 + 式全体を通過したとき、式の中での後退再試行を行なわない + + (?<name>式), (?'name'式) + 名前付き捕獲式集合 + 式集合に名前を割り当てる(定義する)。 + (名前は単語構成文字でなければならない。) + + 名前だけでなく、捕獲式集合と同様に番号も割り当てられる。 + 番号指定が禁止されていない状態 (10. 捕獲式集合 を参照) + のときは、名前を使わないで番号でも参照できる。 + + 複数の式集合に同じ名前を与えることは許されている。 + + (?(条件)真の式), (?(条件)真の式|偽の式) + 条件式 + (条件)が真であれば真の式がマッチし、偽であれば偽の式が + マッチする。 + (条件)には以下のものが使用できる。 + + (n) (n >= 1) + 番号指定の後方参照が何かにマッチしていれば真、 + マッチしていなければ偽 + + (<name>), ('name') + 名前指定の後方参照が何かにマッチしていれば真、 + マッチしていなければ偽 + + バグ: 指定されていた名前が多重定義されていた場合、 + 最も左のグループを参照するが、これは本来 \k<name> + と同じ動作になるべきである。 + + (?~式) 非包含オペレータ (実験的) + 式にマッチする文字列を含まない任意の文字列にマッチする。 + より正確には、(?~式) は、.*式.* がマッチする集合の補集合に + マッチする。これは形式言語理論の意味で正規である。 + (?:(?!式).)* と似ているが簡単に書ける。 + + 例: + (?~abc) は以下にマッチする: "", "ab", "aab", "ccdd" 等 + 以下にはマッチしない: "abc", "aabc", "ccabcdd" 等 + + \/\*(?~\*\/)\*\/ は C スタイルのコメントにマッチする: + "/**/", "/* foobar */" 等 + + \A\/\*(?~\*\/)\*\/\z は "/**/ */" にはマッチしない。 + これは、無欲な量指定子(.*?)を使った \A\/\*.*?\*\/\z とは + 異なる。 + + (?:(?!abc).)*c とは違い、(?~abc)c は "abc" にマッチする。 + なぜなら (?~abc) は "ab" にマッチするからである。 + + (?~) は何にもマッチしない。 + + 理論的背景は田中哲氏の論文とスライドで議論されている + (どちらも日本語): + + * Absent Operator for Regular Expression + https://staff.aist.go.jp/tanaka-akira/pub/prosym49-akr-paper.pdf + * 正規表現における非包含オペレータの提案 + https://staff.aist.go.jp/tanaka-akira/pub/prosym49-akr-presen.pdf + + +8. 後方参照 + + \n \k<n> \k'n' (n >= 1) 番号指定参照 + \k<-n> \k'-n' (n >= 1) 相対番号指定参照 + \k<name> \k'name' 名前指定参照 + + 名前指定参照で、その名前が複数の式集合で多重定義されている場合には、 + 番号の大きい式集合から優先的に参照される。 + (マッチしないときには番号の小さい式集合が参照される) + + ※ 番号指定参照は、名前付き捕獲式集合が定義され、 + かつ ONIG_OPTION_CAPTURE_GROUPが指定されていない場合には、 + 禁止される。(10. 捕獲式集合 を参照) + + ※ ONIG_SYNTAX_PERLでは、\g{n}, \g{-n}, \g{name} も使用可能。 + Perl文法で名前が多重定義されていた場合、最も左のグループのみが + 参照される。 + + + 再帰レベル付き後方参照 + + (n >= 1, level >= 0) + + \k<n+level> \k'n+level' + \k<n-level> \k'n-level' + \k<-n+level> \k'-n+level' + \k<-n-level> \k'-n-level' + + \k<name+level> \k'name+level' + \k<name-level> \k'name-level' + + 後方参照の位置から相対的な部分式呼出し再帰レベルを指定して、そのレベルでの + 捕獲値を参照する。 + + 例-1. + + /\A(?<a>|.|(?:(?<b>.)\g<a>\k<b+0>))\z/.match("reer") + + 例-2. + + r = Regexp.compile(<<'__REGEXP__'.strip, Regexp::EXTENDED) + (?<element> \g<stag> \g<content>* \g<etag> ){0} + (?<stag> < \g<name> \s* > ){0} + (?<name> [a-zA-Z_:]+ ){0} + (?<content> [^<&]+ (\g<element> | [^<&]+)* ){0} + (?<etag> </ \k<name+1> >){0} + \g<element> + __REGEXP__ + + p r.match('<foo>f<bar>bbb</bar>f</foo>').captures + + + +9. 部分式呼出し ("田中哲スペシャル") + + \g<0> \g'0' パターン全体の再帰呼び出し + \g<n> \g'n' (n >= 1) 番号指定呼出し + \g<-n> \g'-n' (n >= 1) 後方への相対番号指定呼出し + \g<+n> \g'+n' (n >= 1) 前方への相対番号指定呼出し + \g<name> \g'name' 名前指定呼出し + + ※ ONIG_SYNTAX_RUBYでは多重定義された名前による部分式呼び出しはできない。 + + ※ 最左位置での再帰呼出しは禁止される。 + 例. (?<name>a|\g<name>b) => error + (?<name>a|b\g<name>c) => OK + + ※ 番号指定呼出しは、名前付き捕獲式集合が定義され、 + かつ ONIG_OPTION_CAPTURE_GROUPが指定されていない場合には、 + 禁止される。 (10. 捕獲式集合 を参照) + + ※ 呼び出された式集合のオプション状態が呼出し側のオプション状態と異なっている + とき、呼び出された側のオプション状態が有効である。 + + 例. (?-i:\g<name>)(?i:(?<name>a)){0} は "A" に照合成功する。 + + ※ ONIG_SYNTAX_PERLでは \g<> の代わりに (?&name), (?n), (?-n), (?+n), (?R), + (?0) を使用する。 + 多重定義された名前による部分式呼び出しは可能である。その際、最も左の + 部分式が利用される。 + + +10. 捕獲式集合 + + 捕獲式集合(...)は、以下の条件に応じて振舞が変化する。 + (名前付き捕獲式集合は変化しない) + + case 1. /.../ (名前付き捕獲式集合は不使用、オプションなし) + + (...) は、捕獲式集合として扱われる。 + + case 2. /.../g (名前付き捕獲式集合は不使用、オプション 'g'を指定) + + (...) は、非捕獲式集合として扱われる。 + + case 3. /..(?<name>..)../ (名前付き捕獲式集合は使用、オプションなし) + + (...) は、非捕獲式集合として扱われる。 + 番号指定参照/呼び出しは不許可。 + + case 4. /..(?<name>..)../G (名前付き捕獲式集合は使用、オプション 'G'を指定) + + (...) は、捕獲式集合として扱われる。 + 番号指定参照/呼び出しは許可。 + + 但し + g: ONIG_OPTION_DONT_CAPTURE_GROUP + G: ONIG_OPTION_CAPTURE_GROUP + ('g'と'G'オプションは、ruby-dev MLで議論された。) + + これらの振舞の意味は、 + 名前付き捕獲と名前無し捕獲を同時に使用する必然性のある場面は少ないであろう + という理由から考えられたものである。 + + +----------------------------- +補記 1. 文法依存オプション + + + ONIG_SYNTAX_RUBY + (?m): 終止符記号(.)は改行と照合成功 + + + ONIG_SYNTAX_PERL、ONIG_SYNTAX_JAVA、ONIG_SYNTAX_PYTHON + (?s): 終止符記号(.)は改行と照合成功 + (?m): ^ は改行の直後に照合する、$ は改行の直前に照合する + + + ONIG_SYNTAX_PERL + (?d), (?l): (?u)と同じ + + +補記 2. 独自拡張機能 + + + 16進数数字、非16進数字 \h, \H + + 名前付き捕獲式集合 (?<name>...), (?'name'...) + + 名前指定後方参照 \k<name> + + 部分式呼出し \g<name>, \g<group-num> + + +補記 3. Perl 5.18.0と比較して存在しない機能 + + + \N{name}, \N{U+xxxx}, \N + + \l,\u,\L,\U, \C + + \v, \V, \h, \H + + (?{code}) + + (??{code}) + + (?|...) + + (?[]) + + (*VERB:ARG) + + * \Q...\E + 但しONIG_SYNTAX_PERLとONIG_SYNTAX_JAVAでは有効 + + +補記 4. Ruby 1.8 の日本語化 GNU regex(version 0.12)との違い + + + 文字Property機能追加 (\p{property}, \P{Property}) + + 16進数字タイプ追加 (\h, \H) + + 戻り読み機能を追加 + + 強欲な繰り返し指定子を追加 (?+, *+, ++) + + 文字集合の中の演算子を追加 ([...], &&) + ('[' は、文字集合の中で通常の文字として使用するときには + 退避修飾しなければならない) + + 名前付き捕獲式集合と、部分式呼出し機能追加 + + 多バイト文字コードが指定されているとき、 + 文字集合の中で八進数または十六進数表現の連続は、多バイト符号で表現された + 一個の文字と解釈される + (例. [\xa1\xa2], [\xa1\xa7-\xa4\xa1]) + + 文字集合の中で、一バイト文字と多バイト文字の範囲指定は許される。 + ex. /[a-あ]/ + + 孤立オプションの有効範囲は、その孤立オプションを含んでいる式集合の + 終わりまでである + 例. (?:(?i)a|b) は (?:(?i:a|b)) と解釈される、(?:(?i:a)|b)ではない + + 孤立オプションはその前の式に対して透過的ではない + 例. /a(?i)*/ は文法エラーとなる + + 不完全な繰り返し範囲指定子は通常の文字列として許可される + 例. /{/, /({)/, /a{2,3/ + + 否定的POSIXブラケット [:^xxxx:] を追加 + + POSIXブラケット [:ascii:] を追加 + + 先読みの繰り返しは不許可 + 例. /(?=a)*/, /(?!b){5}/ + + 数値で指定された文字に対しても、大文字小文字照合オプションは有効 + 例. /\x61/i =~ "A" + + 繰り返し回数指定で、最低回数の省略(0回)ができる + /a{,n}/ == /a{0,n}/ + 最低回数と最大回数の同時省略は許されない。(/a{,}/) + + /a{n}?/は無欲な演算子ではない。 + /a{n}?/ == /(?:a{n})?/ + + 無効な後方参照をチェックしてエラーにする。 + /\1/, /(a)\2/ + + 無限繰り返しの中で、長さ零での照合成功は繰り返しを中断させるが、 + このとき、中断すべきかどうかの判定として、捕獲式集合の捕獲状態の + 変化まで考慮している + /(?:()|())*\1\2/ =~ "" + /(?:\1a|())*/ =~ "a" + + + +補記 5. 実装されているが、既定値では有効にしていない機能 + + + 捕獲履歴参照 + + (?@...) と (?@<name>...) + + 例. /(?@a)*/.match("aaa") ==> [<0-1>, <1-2>, <2-3>] + + 使用方法は、sample/listcap.cを参照 + + 有効にしていない理由は、どの程度役に立つかはっきりしないため。 + + +補記 6. 問題点 + + + エンコーディングバイト値が適正な価かどうかのチェックは行なっていない。 + + 例: UTF-8 + + * 先頭バイトとして不正なバイトを一文字とみなす + /./u =~ "\xa3" + + * 不完全なバイトシーケンスのチェックをしない + /\w+/u =~ "a\xf3\x8ec" + + これを調べることは可能ではあるが、遅くなるので行なわない。 + + 文字列として、そのようなバイト列を指定した場合の動作は保証しない。 + +終り diff --git a/lib/edbee-lib/vendor/onig/doc/UnicodeProps.txt b/lib/edbee-lib/vendor/onig/doc/UnicodeProps.txt new file mode 100644 index 00000000..14ddd301 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/doc/UnicodeProps.txt @@ -0,0 +1,777 @@ +Onigmo (Oniguruma-mod) Unicode Properties Version 6.0.0 2016/10/15 + +* POSIX brackets + Alpha + Blank + Cntrl + Digit + Graph + Lower + Print + Punct + Space + Upper + XDigit + Word + Alnum + ASCII + XPosixPunct + +* Special + Any + Assigned + +* Major and General Categories + C + Cc + Cf + Cn + Co + Cs + L + LC + Ll + Lm + Lo + Lt + Lu + M + Mc + Me + Mn + N + Nd + Nl + No + P + Pc + Pd + Pe + Pf + Pi + Po + Ps + S + Sc + Sk + Sm + So + Z + Zl + Zp + Zs + +* Scripts + Adlam + Ahom + Anatolian_Hieroglyphs + Arabic + Armenian + Avestan + Balinese + Bamum + Bassa_Vah + Batak + Bengali + Bhaiksuki + Bopomofo + Brahmi + Braille + Buginese + Buhid + Canadian_Aboriginal + Carian + Caucasian_Albanian + Chakma + Cham + Cherokee + Common + Coptic + Cuneiform + Cypriot + Cyrillic + Deseret + Devanagari + Duployan + Egyptian_Hieroglyphs + Elbasan + Ethiopic + Georgian + Glagolitic + Gothic + Grantha + Greek + Gujarati + Gurmukhi + Han + Hangul + Hanunoo + Hatran + Hebrew + Hiragana + Imperial_Aramaic + Inherited + Inscriptional_Pahlavi + Inscriptional_Parthian + Javanese + Kaithi + Kannada + Katakana + Kayah_Li + Kharoshthi + Khmer + Khojki + Khudawadi + Lao + Latin + Lepcha + Limbu + Linear_A + Linear_B + Lisu + Lycian + Lydian + Mahajani + Malayalam + Mandaic + Manichaean + Marchen + Meetei_Mayek + Mende_Kikakui + Meroitic_Cursive + Meroitic_Hieroglyphs + Miao + Modi + Mongolian + Mro + Multani + Myanmar + Nabataean + New_Tai_Lue + Newa + Nko + Ogham + Ol_Chiki + Old_Hungarian + Old_Italic + Old_North_Arabian + Old_Permic + Old_Persian + Old_South_Arabian + Old_Turkic + Oriya + Osage + Osmanya + Pahawh_Hmong + Palmyrene + Pau_Cin_Hau + Phags_Pa + Phoenician + Psalter_Pahlavi + Rejang + Runic + Samaritan + Saurashtra + Sharada + Shavian + Siddham + SignWriting + Sinhala + Sora_Sompeng + Sundanese + Syloti_Nagri + Syriac + Tagalog + Tagbanwa + Tai_Le + Tai_Tham + Tai_Viet + Takri + Tamil + Tangut + Telugu + Thaana + Thai + Tibetan + Tifinagh + Tirhuta + Ugaritic + Unknown + Vai + Warang_Citi + Yi + +* DerivedCoreProperties + Alphabetic + Case_Ignorable + Cased + Changes_When_Casefolded + Changes_When_Casemapped + Changes_When_Lowercased + Changes_When_Titlecased + Changes_When_Uppercased + Default_Ignorable_Code_Point + Grapheme_Base + Grapheme_Extend + Grapheme_Link + ID_Continue + ID_Start + Lowercase + Math + Uppercase + XID_Continue + XID_Start + +* PropList + ASCII_Hex_Digit + Bidi_Control + Dash + Deprecated + Diacritic + Extender + Hex_Digit + Hyphen + IDS_Binary_Operator + IDS_Trinary_Operator + Ideographic + Join_Control + Logical_Order_Exception + Noncharacter_Code_Point + Other_Alphabetic + Other_Default_Ignorable_Code_Point + Other_Grapheme_Extend + Other_ID_Continue + Other_ID_Start + Other_Lowercase + Other_Math + Other_Uppercase + Pattern_Syntax + Pattern_White_Space + Prepended_Concatenation_Mark + Quotation_Mark + Radical + Sentence_Terminal + Soft_Dotted + Terminal_Punctuation + Unified_Ideograph + Variation_Selector + White_Space + +* PropertyAliases + AHex + Bidi_C + CI + CWCF + CWCM + CWL + CWT + CWU + DI + Dep + Dia + Ext + Gr_Base + Gr_Ext + Gr_Link + Hex + IDC + IDS + IDSB + IDST + Ideo + Join_C + LOE + NChar + OAlpha + ODI + OGr_Ext + OIDC + OIDS + OLower + OMath + OUpper + PCM + Pat_Syn + Pat_WS + QMark + SD + STerm + Term + UIdeo + VS + WSpace + XIDC + XIDS + +* PropertyValueAliases (General_Category) + Other + Control + Format + Unassigned + Private_Use + Surrogate + Letter + Cased_Letter + Lowercase_Letter + Modifier_Letter + Other_Letter + Titlecase_Letter + Uppercase_Letter + Mark + Combining_Mark + Spacing_Mark + Enclosing_Mark + Nonspacing_Mark + Number + Decimal_Number + Letter_Number + Other_Number + Punctuation + Connector_Punctuation + Dash_Punctuation + Close_Punctuation + Final_Punctuation + Initial_Punctuation + Other_Punctuation + Open_Punctuation + Symbol + Currency_Symbol + Modifier_Symbol + Math_Symbol + Other_Symbol + Separator + Line_Separator + Paragraph_Separator + Space_Separator + +* PropertyValueAliases (Script) + Adlm + Aghb + Arab + Armi + Armn + Avst + Bali + Bamu + Bass + Batk + Beng + Bhks + Bopo + Brah + Brai + Bugi + Buhd + Cakm + Cans + Cari + Cher + Copt + Qaac + Cprt + Cyrl + Deva + Dsrt + Dupl + Egyp + Elba + Ethi + Geor + Glag + Goth + Gran + Grek + Gujr + Guru + Hang + Hani + Hano + Hatr + Hebr + Hira + Hluw + Hmng + Hung + Ital + Java + Kali + Kana + Khar + Khmr + Khoj + Knda + Kthi + Lana + Laoo + Latn + Lepc + Limb + Lina + Linb + Lyci + Lydi + Mahj + Mand + Mani + Marc + Mend + Merc + Mero + Mlym + Mong + Mroo + Mtei + Mult + Mymr + Narb + Nbat + Nkoo + Ogam + Olck + Orkh + Orya + Osge + Osma + Palm + Pauc + Perm + Phag + Phli + Phlp + Phnx + Plrd + Prti + Rjng + Runr + Samr + Sarb + Saur + Sgnw + Shaw + Shrd + Sidd + Sind + Sinh + Sora + Sund + Sylo + Syrc + Tagb + Takr + Tale + Talu + Taml + Tang + Tavt + Telu + Tfng + Tglg + Thaa + Tibt + Tirh + Ugar + Vaii + Wara + Xpeo + Xsux + Yiii + Zinh + Qaai + Zyyy + Zzzz + +* DerivedAges + Age=1.1 + Age=2.0 + Age=2.1 + Age=3.0 + Age=3.1 + Age=3.2 + Age=4.0 + Age=4.1 + Age=5.0 + Age=5.1 + Age=5.2 + Age=6.0 + Age=6.1 + Age=6.2 + Age=6.3 + Age=7.0 + Age=8.0 + Age=9.0 + +* Blocks + In_Basic_Latin + In_Latin_1_Supplement + In_Latin_Extended_A + In_Latin_Extended_B + In_IPA_Extensions + In_Spacing_Modifier_Letters + In_Combining_Diacritical_Marks + In_Greek_and_Coptic + In_Cyrillic + In_Cyrillic_Supplement + In_Armenian + In_Hebrew + In_Arabic + In_Syriac + In_Arabic_Supplement + In_Thaana + In_NKo + In_Samaritan + In_Mandaic + In_Arabic_Extended_A + In_Devanagari + In_Bengali + In_Gurmukhi + In_Gujarati + In_Oriya + In_Tamil + In_Telugu + In_Kannada + In_Malayalam + In_Sinhala + In_Thai + In_Lao + In_Tibetan + In_Myanmar + In_Georgian + In_Hangul_Jamo + In_Ethiopic + In_Ethiopic_Supplement + In_Cherokee + In_Unified_Canadian_Aboriginal_Syllabics + In_Ogham + In_Runic + In_Tagalog + In_Hanunoo + In_Buhid + In_Tagbanwa + In_Khmer + In_Mongolian + In_Unified_Canadian_Aboriginal_Syllabics_Extended + In_Limbu + In_Tai_Le + In_New_Tai_Lue + In_Khmer_Symbols + In_Buginese + In_Tai_Tham + In_Combining_Diacritical_Marks_Extended + In_Balinese + In_Sundanese + In_Batak + In_Lepcha + In_Ol_Chiki + In_Cyrillic_Extended_C + In_Sundanese_Supplement + In_Vedic_Extensions + In_Phonetic_Extensions + In_Phonetic_Extensions_Supplement + In_Combining_Diacritical_Marks_Supplement + In_Latin_Extended_Additional + In_Greek_Extended + In_General_Punctuation + In_Superscripts_and_Subscripts + In_Currency_Symbols + In_Combining_Diacritical_Marks_for_Symbols + In_Letterlike_Symbols + In_Number_Forms + In_Arrows + In_Mathematical_Operators + In_Miscellaneous_Technical + In_Control_Pictures + In_Optical_Character_Recognition + In_Enclosed_Alphanumerics + In_Box_Drawing + In_Block_Elements + In_Geometric_Shapes + In_Miscellaneous_Symbols + In_Dingbats + In_Miscellaneous_Mathematical_Symbols_A + In_Supplemental_Arrows_A + In_Braille_Patterns + In_Supplemental_Arrows_B + In_Miscellaneous_Mathematical_Symbols_B + In_Supplemental_Mathematical_Operators + In_Miscellaneous_Symbols_and_Arrows + In_Glagolitic + In_Latin_Extended_C + In_Coptic + In_Georgian_Supplement + In_Tifinagh + In_Ethiopic_Extended + In_Cyrillic_Extended_A + In_Supplemental_Punctuation + In_CJK_Radicals_Supplement + In_Kangxi_Radicals + In_Ideographic_Description_Characters + In_CJK_Symbols_and_Punctuation + In_Hiragana + In_Katakana + In_Bopomofo + In_Hangul_Compatibility_Jamo + In_Kanbun + In_Bopomofo_Extended + In_CJK_Strokes + In_Katakana_Phonetic_Extensions + In_Enclosed_CJK_Letters_and_Months + In_CJK_Compatibility + In_CJK_Unified_Ideographs_Extension_A + In_Yijing_Hexagram_Symbols + In_CJK_Unified_Ideographs + In_Yi_Syllables + In_Yi_Radicals + In_Lisu + In_Vai + In_Cyrillic_Extended_B + In_Bamum + In_Modifier_Tone_Letters + In_Latin_Extended_D + In_Syloti_Nagri + In_Common_Indic_Number_Forms + In_Phags_pa + In_Saurashtra + In_Devanagari_Extended + In_Kayah_Li + In_Rejang + In_Hangul_Jamo_Extended_A + In_Javanese + In_Myanmar_Extended_B + In_Cham + In_Myanmar_Extended_A + In_Tai_Viet + In_Meetei_Mayek_Extensions + In_Ethiopic_Extended_A + In_Latin_Extended_E + In_Cherokee_Supplement + In_Meetei_Mayek + In_Hangul_Syllables + In_Hangul_Jamo_Extended_B + In_High_Surrogates + In_High_Private_Use_Surrogates + In_Low_Surrogates + In_Private_Use_Area + In_CJK_Compatibility_Ideographs + In_Alphabetic_Presentation_Forms + In_Arabic_Presentation_Forms_A + In_Variation_Selectors + In_Vertical_Forms + In_Combining_Half_Marks + In_CJK_Compatibility_Forms + In_Small_Form_Variants + In_Arabic_Presentation_Forms_B + In_Halfwidth_and_Fullwidth_Forms + In_Specials + In_Linear_B_Syllabary + In_Linear_B_Ideograms + In_Aegean_Numbers + In_Ancient_Greek_Numbers + In_Ancient_Symbols + In_Phaistos_Disc + In_Lycian + In_Carian + In_Coptic_Epact_Numbers + In_Old_Italic + In_Gothic + In_Old_Permic + In_Ugaritic + In_Old_Persian + In_Deseret + In_Shavian + In_Osmanya + In_Osage + In_Elbasan + In_Caucasian_Albanian + In_Linear_A + In_Cypriot_Syllabary + In_Imperial_Aramaic + In_Palmyrene + In_Nabataean + In_Hatran + In_Phoenician + In_Lydian + In_Meroitic_Hieroglyphs + In_Meroitic_Cursive + In_Kharoshthi + In_Old_South_Arabian + In_Old_North_Arabian + In_Manichaean + In_Avestan + In_Inscriptional_Parthian + In_Inscriptional_Pahlavi + In_Psalter_Pahlavi + In_Old_Turkic + In_Old_Hungarian + In_Rumi_Numeral_Symbols + In_Brahmi + In_Kaithi + In_Sora_Sompeng + In_Chakma + In_Mahajani + In_Sharada + In_Sinhala_Archaic_Numbers + In_Khojki + In_Multani + In_Khudawadi + In_Grantha + In_Newa + In_Tirhuta + In_Siddham + In_Modi + In_Mongolian_Supplement + In_Takri + In_Ahom + In_Warang_Citi + In_Pau_Cin_Hau + In_Bhaiksuki + In_Marchen + In_Cuneiform + In_Cuneiform_Numbers_and_Punctuation + In_Early_Dynastic_Cuneiform + In_Egyptian_Hieroglyphs + In_Anatolian_Hieroglyphs + In_Bamum_Supplement + In_Mro + In_Bassa_Vah + In_Pahawh_Hmong + In_Miao + In_Ideographic_Symbols_and_Punctuation + In_Tangut + In_Tangut_Components + In_Kana_Supplement + In_Duployan + In_Shorthand_Format_Controls + In_Byzantine_Musical_Symbols + In_Musical_Symbols + In_Ancient_Greek_Musical_Notation + In_Tai_Xuan_Jing_Symbols + In_Counting_Rod_Numerals + In_Mathematical_Alphanumeric_Symbols + In_Sutton_SignWriting + In_Glagolitic_Supplement + In_Mende_Kikakui + In_Adlam + In_Arabic_Mathematical_Alphabetic_Symbols + In_Mahjong_Tiles + In_Domino_Tiles + In_Playing_Cards + In_Enclosed_Alphanumeric_Supplement + In_Enclosed_Ideographic_Supplement + In_Miscellaneous_Symbols_and_Pictographs + In_Emoticons + In_Ornamental_Dingbats + In_Transport_and_Map_Symbols + In_Alchemical_Symbols + In_Geometric_Shapes_Extended + In_Supplemental_Arrows_C + In_Supplemental_Symbols_and_Pictographs + In_CJK_Unified_Ideographs_Extension_B + In_CJK_Unified_Ideographs_Extension_C + In_CJK_Unified_Ideographs_Extension_D + In_CJK_Unified_Ideographs_Extension_E + In_CJK_Compatibility_Ideographs_Supplement + In_Tags + In_Variation_Selectors_Supplement + In_Supplementary_Private_Use_Area_A + In_Supplementary_Private_Use_Area_B + In_No_Block diff --git a/lib/edbee-lib/vendor/onig/enc/ascii.c b/lib/edbee-lib/vendor/onig/enc/ascii.c new file mode 100644 index 00000000..06b7b3e2 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/ascii.c @@ -0,0 +1,104 @@ +/********************************************************************** + ascii.c - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" +#ifdef RUBY +# include "encindex.h" +#endif + +#ifndef ENCINDEX_ASCII +# define ENCINDEX_ASCII 0 +#endif + +OnigEncodingDefine(ascii, ASCII) = { + onigenc_single_byte_mbc_enc_len, + "ASCII-8BIT", /* name */ + 1, /* max byte length */ + 1, /* min byte length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + onigenc_ascii_mbc_case_fold, + onigenc_ascii_apply_all_case_fold, + onigenc_ascii_get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + onigenc_ascii_is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + onigenc_single_byte_ascii_only_case_map, + ENCINDEX_ASCII, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("BINARY", "ASCII-8BIT") +ENC_REPLICATE("IBM437", "ASCII-8BIT") +ENC_ALIAS("CP437", "IBM437") +ENC_REPLICATE("IBM737", "ASCII-8BIT") +ENC_ALIAS("CP737", "IBM737") +ENC_REPLICATE("IBM775", "ASCII-8BIT") +ENC_ALIAS("CP775", "IBM775") +ENC_REPLICATE("CP850", "ASCII-8BIT") +ENC_ALIAS("IBM850", "CP850") +ENC_REPLICATE("IBM852", "ASCII-8BIT") +ENC_REPLICATE("CP852", "IBM852") +ENC_REPLICATE("IBM855", "ASCII-8BIT") +ENC_REPLICATE("CP855", "IBM855") +ENC_REPLICATE("IBM857", "ASCII-8BIT") +ENC_ALIAS("CP857", "IBM857") +ENC_REPLICATE("IBM860", "ASCII-8BIT") +ENC_ALIAS("CP860", "IBM860") +ENC_REPLICATE("IBM861", "ASCII-8BIT") +ENC_ALIAS("CP861", "IBM861") +ENC_REPLICATE("IBM862", "ASCII-8BIT") +ENC_ALIAS("CP862", "IBM862") +ENC_REPLICATE("IBM863", "ASCII-8BIT") +ENC_ALIAS("CP863", "IBM863") +ENC_REPLICATE("IBM864", "ASCII-8BIT") +ENC_ALIAS("CP864", "IBM864") +ENC_REPLICATE("IBM865", "ASCII-8BIT") +ENC_ALIAS("CP865", "IBM865") +ENC_REPLICATE("IBM866", "ASCII-8BIT") +ENC_ALIAS("CP866", "IBM866") +ENC_REPLICATE("IBM869", "ASCII-8BIT") +ENC_ALIAS("CP869", "IBM869") +ENC_REPLICATE("Windows-1258", "ASCII-8BIT") +ENC_ALIAS("CP1258", "Windows-1258") +ENC_REPLICATE("GB1988", "ASCII-8BIT") +ENC_REPLICATE("macCentEuro", "ASCII-8BIT") +ENC_REPLICATE("macCroatian", "ASCII-8BIT") +ENC_REPLICATE("macCyrillic", "ASCII-8BIT") +ENC_REPLICATE("macGreek", "ASCII-8BIT") +ENC_REPLICATE("macIceland", "ASCII-8BIT") +ENC_REPLICATE("macRoman", "ASCII-8BIT") +ENC_REPLICATE("macRomania", "ASCII-8BIT") +ENC_REPLICATE("macThai", "ASCII-8BIT") +ENC_REPLICATE("macTurkish", "ASCII-8BIT") +ENC_REPLICATE("macUkraine", "ASCII-8BIT") diff --git a/lib/edbee-lib/vendor/onig/enc/big5.c b/lib/edbee-lib/vendor/onig/enc/big5.c new file mode 100644 index 00000000..c7142ce3 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/big5.c @@ -0,0 +1,370 @@ +/********************************************************************** + big5.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" + +static const int EncLen_BIG5[] + = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1}; +static const int EncLen_BIG5_HKSCS[] = { + /* LEN 0 1 2 3 4 5 6 7 8 9 A B C D E F */ + /* 0 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 1 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 2 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 3 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 4 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 5 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 6 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 7 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 8 */ 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, + /* 9 */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + /* A */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + /* B */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + /* C */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + /* D */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + /* E */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + /* F */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, +}; + +static const int EncLen_BIG5_UAO[] = { + /* LEN 0 1 2 3 4 5 6 7 8 9 A B C D E F */ + /* 0 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 1 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 2 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 3 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 4 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 5 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 6 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 7 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 8 */ 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + /* 9 */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + /* A */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + /* B */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + /* C */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + /* D */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + /* E */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + /* F */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, +}; + +typedef enum +{ + FAILURE = -2, + ACCEPT = -1, + S0 = 0, + S1 +} state_t; +#define A ACCEPT +#define F FAILURE +static const signed char trans[][0x100] + = {{/* S0 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 1 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 2 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 3 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ F, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F}, + {/* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ F, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* b */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F}, + {/* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 1 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 2 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 3 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 8 */ F, F, F, F, F, F, F, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 9 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* a */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F}}; +#undef A +#undef F + +static int big5_mbc_enc_len0(const UChar *p, const UChar *e, int tridx, + const int tbl[]) +{ + int firstbyte = *p++; + state_t s = trans[tridx][firstbyte]; +#define RETURN(n) \ + return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(n) \ + : ONIGENC_CONSTRUCT_MBCLEN_INVALID() + if (s < 0) + RETURN(1); + if (p == e) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(tbl[firstbyte] - 1); + s = trans[s][*p++]; + RETURN(2); +#undef RETURN +} + +static int big5_mbc_enc_len(const UChar *p, const UChar *e, + OnigEncoding enc ARG_UNUSED) +{ + return big5_mbc_enc_len0(p, e, 0, EncLen_BIG5); +} + +static int big5_hkscs_mbc_enc_len(const UChar *p, const UChar *e, + OnigEncoding enc ARG_UNUSED) +{ + return big5_mbc_enc_len0(p, e, 2, EncLen_BIG5_HKSCS); +} + +static int big5_uao_mbc_enc_len(const UChar *p, const UChar *e, + OnigEncoding enc ARG_UNUSED) +{ + return big5_mbc_enc_len0(p, e, 2, EncLen_BIG5_UAO); +} + +static OnigCodePoint big5_mbc_to_code(const UChar *p, const UChar *end, + OnigEncoding enc) +{ + return onigenc_mbn_mbc_to_code(enc, p, end); +} + +static int big5_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc) +{ + return onigenc_mb2_code_to_mbc(enc, code, buf); +} + +static int big5_mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end, UChar *lower, OnigEncoding enc) +{ + return onigenc_mbn_mbc_case_fold(enc, flag, pp, end, lower); +} + +#if 0 +static int +big5_is_mbc_ambiguous(OnigCaseFoldType flag, + const UChar** pp, const UChar* end, OnigEncoding enc) +{ + return onigenc_mbn_is_mbc_ambiguous(enc, flag, pp, end); +} +#endif + +static int big5_is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc) +{ + return onigenc_mb2_is_code_ctype(enc, code, ctype); +} + +static const char BIG5_CAN_BE_TRAIL_TABLE[256] + = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}; + +#define BIG5_HKSCS_P(enc) ((enc)->precise_mbc_enc_len == big5_hkscs_mbc_enc_len) +#define BIG5_UAO_P(enc) ((enc)->precise_mbc_enc_len == big5_uao_mbc_enc_len) + +#define BIG5_ISMB_FIRST(byte) \ + (BIG5_HKSCS_P(enc) ? EncLen_BIG5_HKSCS[byte] > 1 : EncLen_BIG5[byte] > 1) +#define BIG5_ISMB_TRAIL(byte) BIG5_CAN_BE_TRAIL_TABLE[(byte)] + +static UChar *big5_left_adjust_char_head(const UChar *start, const UChar *s, + const UChar *end, OnigEncoding enc) +{ + const UChar *p; + int len; + + if (s <= start) + return (UChar *)s; + p = s; + + if (BIG5_ISMB_TRAIL(*p)) + { + while (p > start) + { + if (!BIG5_ISMB_FIRST(*--p)) + { + p++; + break; + } + } + } + len = enclen(enc, p, end); + if (p + len > s) + return (UChar *)p; + p += len; + return (UChar *)(p + ((s - p) & ~1)); +} + +static int big5_is_allowed_reverse_match(const UChar *s, + const UChar *end ARG_UNUSED, + OnigEncoding enc ARG_UNUSED) +{ + const UChar c = *s; + + return (BIG5_ISMB_TRAIL(c) ? FALSE : TRUE); +} + +/* + * Name: Big5 (preferred MIME name) + * MIBenum: 2026 + * Source: Chinese for Taiwan Multi-byte set. + * PCL Symbol Set Id: 18T + * Alias: csBig5 + */ +OnigEncodingDefine(big5, BIG5) = { + big5_mbc_enc_len, + "Big5", /* name */ + 2, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + big5_mbc_to_code, + onigenc_mb2_code_to_mbclen, + big5_code_to_mbc, + big5_mbc_case_fold, + onigenc_ascii_apply_all_case_fold, + onigenc_ascii_get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + big5_is_code_ctype, + onigenc_not_support_get_ctype_code_range, + big5_left_adjust_char_head, + big5_is_allowed_reverse_match, + onigenc_ascii_only_case_map, + 0, + ONIGENC_FLAG_NONE, +}; + +/* + * Name: CP950 + * Source: http://msdn.microsoft.com/en-us/goglobal/cc305155.aspx + */ +ENC_REPLICATE("CP950", "Big5") + +/* + * Name: Big5-HKSCS + * MIBenum: 2101 + * Source: http://www.iana.org/assignments/charset-reg/Big5-HKSCS + * Source: http://www.ogcio.gov.hk/ccli/eng/hkscs/mapping_table_2008.html + * Alias: None + */ +OnigEncodingDefine(big5_hkscs, BIG5_HKSCS) = { + big5_hkscs_mbc_enc_len, + "Big5-HKSCS", /* name */ + 2, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + big5_mbc_to_code, + onigenc_mb2_code_to_mbclen, + big5_code_to_mbc, + big5_mbc_case_fold, + onigenc_ascii_apply_all_case_fold, + onigenc_ascii_get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + big5_is_code_ctype, + onigenc_not_support_get_ctype_code_range, + big5_left_adjust_char_head, + big5_is_allowed_reverse_match, + onigenc_ascii_only_case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("Big5-HKSCS:2008", "Big5-HKSCS") + +/* + * Name: CP951 + * Source: http://www.microsoft.com/hk/hkscs/default.aspx + * Source: + * http://www.microsoft.com/downloads/en/details.aspx?FamilyID=0e6f5ac8-7baa-4571-b8e8-78b3b776afd7&DisplayLang=en + * Source: http://blogs.msdn.com/b/shawnste/archive/2007/03/12/cp-951-hkscs.aspx + */ +ENC_REPLICATE("CP951", "Big5-HKSCS") + +/* + * Name: Big5-UAO [NOT registered by IANA!] + * Source: http://moztw.org/docs/big5/table/big5_2003-b2u.txt + */ +OnigEncodingDefine(big5_uao, BIG5_UAO) = { + big5_uao_mbc_enc_len, + "Big5-UAO", /* name */ + 2, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + big5_mbc_to_code, + onigenc_mb2_code_to_mbclen, + big5_code_to_mbc, + big5_mbc_case_fold, + onigenc_ascii_apply_all_case_fold, + onigenc_ascii_get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + big5_is_code_ctype, + onigenc_not_support_get_ctype_code_range, + big5_left_adjust_char_head, + big5_is_allowed_reverse_match, + onigenc_ascii_only_case_map, + 0, + ONIGENC_FLAG_NONE, +}; diff --git a/lib/edbee-lib/vendor/onig/enc/cp949.c b/lib/edbee-lib/vendor/onig/enc/cp949.c new file mode 100644 index 00000000..0bc651c2 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/cp949.c @@ -0,0 +1,218 @@ +/********************************************************************** + cp949.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" + +static const int EncLen_CP949[] + = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1}; + +static const char CP949_CAN_BE_TRAIL_TABLE[256] + = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}; + +#define CP949_ISMB_FIRST(byte) (EncLen_CP949[byte] > 1) +#define CP949_ISMB_TRAIL(byte) CP949_CAN_BE_TRAIL_TABLE[(byte)] + +typedef enum +{ + FAILURE = -2, + ACCEPT = -1, + S0 = 0, + S1 +} state_t; +#define A ACCEPT +#define F FAILURE +static const signed char trans[][0x100] + = {{/* S0 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 1 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 2 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 3 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 8 */ A, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 9 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* a */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F}, + {/* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 5 */ A, A, A, A, A, A, A, A, A, A, A, F, F, F, F, F, + /* 6 */ F, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 7 */ A, A, A, A, A, A, A, A, A, A, A, F, F, F, F, F, + /* 8 */ F, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 9 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* a */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* b */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F}}; +#undef A +#undef F + +static int cp949_mbc_enc_len(const UChar *p, const UChar *e, + OnigEncoding enc ARG_UNUSED) +{ + int firstbyte = *p++; + state_t s = trans[0][firstbyte]; +#define RETURN(n) \ + return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(n) \ + : ONIGENC_CONSTRUCT_MBCLEN_INVALID() + if (s < 0) + RETURN(1); + if (p == e) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_CP949[firstbyte] - 1); + s = trans[s][*p++]; + RETURN(2); +#undef RETURN +} + +static OnigCodePoint cp949_mbc_to_code(const UChar *p, const UChar *end, + OnigEncoding enc) +{ + return onigenc_mbn_mbc_to_code(enc, p, end); +} + +static int cp949_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc) +{ + return onigenc_mb2_code_to_mbc(enc, code, buf); +} + +static int cp949_mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end, UChar *lower, OnigEncoding enc) +{ + return onigenc_mbn_mbc_case_fold(enc, flag, pp, end, lower); +} + +#if 0 +static int +cp949_is_mbc_ambiguous(OnigCaseFoldType flag, + const UChar** pp, const UChar* end, OnigEncoding enc) +{ + return onigenc_mbn_is_mbc_ambiguous(enc, flag, pp, end); +} +#endif + +static int cp949_is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc) +{ + return onigenc_mb2_is_code_ctype(enc, code, ctype); +} + +static UChar *cp949_left_adjust_char_head(const UChar *start, const UChar *s, + const UChar *end, OnigEncoding enc) +{ + const UChar *p; + int len; + + if (s <= start) + return (UChar *)s; + p = s; + + if (CP949_ISMB_TRAIL(*p)) + { + while (p > start) + { + if (!CP949_ISMB_FIRST(*--p)) + { + p++; + break; + } + } + } + len = enclen(enc, p, end); + if (p + len > s) + return (UChar *)p; + p += len; + return (UChar *)(p + ((s - p) & ~1)); +} + +static int cp949_is_allowed_reverse_match(const UChar *s, + const UChar *end ARG_UNUSED, + OnigEncoding enc ARG_UNUSED) +{ + const UChar c = *s; + return (CP949_ISMB_TRAIL(c) ? FALSE : TRUE); +} + +OnigEncodingDefine(cp949, CP949) = { + cp949_mbc_enc_len, + "CP949", /* name */ + 2, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + cp949_mbc_to_code, + onigenc_mb2_code_to_mbclen, + cp949_code_to_mbc, + cp949_mbc_case_fold, + onigenc_ascii_apply_all_case_fold, + onigenc_ascii_get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + cp949_is_code_ctype, + onigenc_not_support_get_ctype_code_range, + cp949_left_adjust_char_head, + cp949_is_allowed_reverse_match, + onigenc_ascii_only_case_map, + 0, + ONIGENC_FLAG_NONE, +}; +/* + * Name: CP949 + * Link: http://www.microsoft.com/globaldev/reference/dbcs/949.mspx + * Link: http://en.wikipedia.org/wiki/EUC-KR#EUC-KR + */ diff --git a/lib/edbee-lib/vendor/onig/enc/emacs_mule.c b/lib/edbee-lib/vendor/onig/enc/emacs_mule.c new file mode 100644 index 00000000..dfe34b29 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/emacs_mule.c @@ -0,0 +1,359 @@ +/********************************************************************** + emacs_mule.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" + +#define emacsmule_islead(c) ((UChar)(c) < 0x9e) + +/* + CHARACTER := ASCII_CHAR | MULTIBYTE_CHAR + MULTIBYTE_CHAR := PRIMARY_CHAR_1 | PRIMARY_CHAR_2 + | SECONDARY_CHAR_1 | SECONDARY_CHAR_2 + PRIMARY_CHAR_1 := LEADING_CODE_PRI C1 + PRIMARY_CHAR_2 := LEADING_CODE_PRI C1 C2 + SECONDARY_CHAR_1 := LEADING_CODE_SEC LEADING_CODE_EXT C1 + SECONDARY_CHAR_2 := LEADING_CODE_SEC LEADING_CODE_EXT C1 C2 + ASCII_CHAR := 0 | 1 | ... | 127 + LEADING_CODE_PRI := 129 | 130 | ... | 153 + LEADING_CODE_SEC := 154 | 155 | 156 | 157 + C1, C2, LEADING_CODE_EXT := 160 | 161 | ... | 255 + */ + +static const int EncLen_EmacsMule[] = { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +}; + +typedef enum +{ + FAILURE = -2, + ACCEPT = -1, + S0 = 0, + S1, + S2, + S3, + S4, + S5, + S6 +} state_t; +#define A ACCEPT +#define F FAILURE +static const signed char trans[][0x100] = { + {/* S0 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 1 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 2 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 3 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 8 */ F, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 9 */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 5, 6, F, F, + /* a */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* b */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F}, + {/* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* b */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A}, + {/* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + {/* S3 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F}, + {/* S4 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* b */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F}, + {/* S5 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* b */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* f */ 2, 2, 2, 2, 2, F, F, F, F, F, F, F, F, F, F, F}, + {/* S6 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* b */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* f */ F, F, F, F, F, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, F}, + +}; +#undef A +#undef F + +static int mbc_enc_len(const UChar *p, const UChar *e, + OnigEncoding enc ARG_UNUSED) +{ + int firstbyte = *p++; + state_t s; + s = trans[0][firstbyte]; + if (s < 0) + return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(1) + : ONIGENC_CONSTRUCT_MBCLEN_INVALID(); + if (p == e) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_EmacsMule[firstbyte] - 1); + s = trans[s][*p++]; + if (s < 0) + return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(2) + : ONIGENC_CONSTRUCT_MBCLEN_INVALID(); + if (p == e) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_EmacsMule[firstbyte] - 2); + s = trans[s][*p++]; + if (s < 0) + return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(3) + : ONIGENC_CONSTRUCT_MBCLEN_INVALID(); + if (p == e) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_EmacsMule[firstbyte] - 3); + s = trans[s][*p++]; + return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(4) + : ONIGENC_CONSTRUCT_MBCLEN_INVALID(); +} + +static OnigCodePoint mbc_to_code(const UChar *p, const UChar *end, + OnigEncoding enc) +{ + int c, i, len; + OnigCodePoint n; + + len = enclen(enc, p, end); + n = (OnigCodePoint)*p++; + if (len == 1) + return n; + + for (i = 1; i < len; i++) + { + if (p >= end) + break; + c = *p++; + n <<= 8; + n += c; + } + return n; +} + +static int code_to_mbclen(OnigCodePoint code, OnigEncoding enc ARG_UNUSED) +{ + if (ONIGENC_IS_CODE_ASCII(code)) + return 1; + else if (code > 0xffffffff) + return 0; + else if ((code & 0xff000000) >= 0x80000000) + return 4; + else if ((code & 0xff0000) >= 0x800000) + return 3; + else if ((code & 0xff00) >= 0x8000) + return 2; + else + return ONIGERR_INVALID_CODE_POINT_VALUE; +} + +static int code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc) +{ + UChar *p = buf; + + if ((code & 0xff000000) != 0) + *p++ = (UChar)(((code >> 24) & 0xff)); + if ((code & 0xff0000) != 0) + *p++ = (UChar)(((code >> 16) & 0xff)); + if ((code & 0xff00) != 0) + *p++ = (UChar)(((code >> 8) & 0xff)); + *p++ = (UChar)(code & 0xff); + + if (enclen(enc, buf, p) != (p - buf)) + return ONIGERR_INVALID_CODE_POINT_VALUE; + return (int)(p - buf); +} + +static int mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end, UChar *lower, OnigEncoding enc) +{ + int len; + const UChar *p = *pp; + + if (ONIGENC_IS_MBC_ASCII(p)) + { + *lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p); + (*pp)++; + return 1; + } + else + { + int i; + + len = mbc_enc_len(p, end, enc); + for (i = 0; i < len; i++) + { + *lower++ = *p++; + } + (*pp) += len; + return len; /* return byte length of converted char to lower */ + } +} + +static UChar *left_adjust_char_head(const UChar *start, const UChar *s, + const UChar *end, OnigEncoding enc) +{ + const UChar *p; + + if (s <= start) + return (UChar *)s; + p = s; + + while (!emacsmule_islead(*p) && p > start) + p--; + return (UChar *)p; +} + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 128) + return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype); + else + return (code_to_mbclen(code, enc) > 1 ? TRUE : FALSE); +} + +/* + * Name: Emacs-Mule + * Link: http://www.m17n.org/mule/pricai96/mule.en.html + */ +OnigEncodingDefine(emacs_mule, Emacs_Mule) = { + mbc_enc_len, + "Emacs-Mule", /* name */ + 4, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + mbc_to_code, + code_to_mbclen, + code_to_mbc, + mbc_case_fold, + onigenc_ascii_apply_all_case_fold, + onigenc_ascii_get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + is_code_ctype, + onigenc_not_support_get_ctype_code_range, + left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + onigenc_ascii_only_case_map, + 0, + ONIGENC_FLAG_NONE, +}; + +ENC_REPLICATE("stateless-ISO-2022-JP", "Emacs-Mule") diff --git a/lib/edbee-lib/vendor/onig/enc/euc_jp.c b/lib/edbee-lib/vendor/onig/enc/euc_jp.c new file mode 100644 index 00000000..f58259b4 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/euc_jp.c @@ -0,0 +1,626 @@ +/********************************************************************** + euc_jp.c - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" + +#define eucjp_islead(c) ((UChar)((c) - 0xa1) > 0xfe - 0xa1) + +static const int EncLen_EUCJP[] + = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1}; + +typedef enum +{ + FAILURE = -2, + ACCEPT = -1, + S0 = 0, + S1, + S2 +} state_t; +#define A ACCEPT +#define F FAILURE +static const signed char trans[][0x100] = { + {/* S0 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 1 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 2 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 3 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, 1, 2, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ F, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F}, + {/* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ F, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* b */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F}, + {/* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ F, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F}, + +}; +#undef A +#undef F + +static const OnigPairCaseFoldCodes CaseFoldMap[] = { + /* Fullwidth Alphabet */ + {0xa3c1, 0xa3e1}, + {0xa3c2, 0xa3e2}, + {0xa3c3, 0xa3e3}, + {0xa3c4, 0xa3e4}, + {0xa3c5, 0xa3e5}, + {0xa3c6, 0xa3e6}, + {0xa3c7, 0xa3e7}, + {0xa3c8, 0xa3e8}, + {0xa3c9, 0xa3e9}, + {0xa3ca, 0xa3ea}, + {0xa3cb, 0xa3eb}, + {0xa3cc, 0xa3ec}, + {0xa3cd, 0xa3ed}, + {0xa3ce, 0xa3ee}, + {0xa3cf, 0xa3ef}, + {0xa3d0, 0xa3f0}, + {0xa3d1, 0xa3f1}, + {0xa3d2, 0xa3f2}, + {0xa3d3, 0xa3f3}, + {0xa3d4, 0xa3f4}, + {0xa3d5, 0xa3f5}, + {0xa3d6, 0xa3f6}, + {0xa3d7, 0xa3f7}, + {0xa3d8, 0xa3f8}, + {0xa3d9, 0xa3f9}, + {0xa3da, 0xa3fa}, + + /* Greek */ + {0xa6a1, 0xa6c1}, + {0xa6a2, 0xa6c2}, + {0xa6a3, 0xa6c3}, + {0xa6a4, 0xa6c4}, + {0xa6a5, 0xa6c5}, + {0xa6a6, 0xa6c6}, + {0xa6a7, 0xa6c7}, + {0xa6a8, 0xa6c8}, + {0xa6a9, 0xa6c9}, + {0xa6aa, 0xa6ca}, + {0xa6ab, 0xa6cb}, + {0xa6ac, 0xa6cc}, + {0xa6ad, 0xa6cd}, + {0xa6ae, 0xa6ce}, + {0xa6af, 0xa6cf}, + {0xa6b0, 0xa6d0}, + {0xa6b1, 0xa6d1}, + {0xa6b2, 0xa6d2}, + {0xa6b3, 0xa6d3}, + {0xa6b4, 0xa6d4}, + {0xa6b5, 0xa6d5}, + {0xa6b6, 0xa6d6}, + {0xa6b7, 0xa6d7}, + {0xa6b8, 0xa6d8}, + + /* Cyrillic */ + {0xa7a1, 0xa7d1}, + {0xa7a2, 0xa7d2}, + {0xa7a3, 0xa7d3}, + {0xa7a4, 0xa7d4}, + {0xa7a5, 0xa7d5}, + {0xa7a6, 0xa7d6}, + {0xa7a7, 0xa7d7}, + {0xa7a8, 0xa7d8}, + {0xa7a9, 0xa7d9}, + {0xa7aa, 0xa7da}, + {0xa7ab, 0xa7db}, + {0xa7ac, 0xa7dc}, + {0xa7ad, 0xa7dd}, + {0xa7ae, 0xa7de}, + {0xa7af, 0xa7df}, + {0xa7b0, 0xa7e0}, + {0xa7b1, 0xa7e1}, + {0xa7b2, 0xa7e2}, + {0xa7b3, 0xa7e3}, + {0xa7b4, 0xa7e4}, + {0xa7b5, 0xa7e5}, + {0xa7b6, 0xa7e6}, + {0xa7b7, 0xa7e7}, + {0xa7b8, 0xa7e8}, + {0xa7b9, 0xa7e9}, + {0xa7ba, 0xa7ea}, + {0xa7bb, 0xa7eb}, + {0xa7bc, 0xa7ec}, + {0xa7bd, 0xa7ed}, + {0xa7be, 0xa7ee}, + {0xa7bf, 0xa7ef}, + {0xa7c0, 0xa7f0}, + {0xa7c1, 0xa7f1}, +}; + +static int mbc_enc_len(const UChar *p, const UChar *e, + OnigEncoding enc ARG_UNUSED) +{ + int firstbyte = *p++; + state_t s; + s = trans[0][firstbyte]; + if (s < 0) + return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(1) + : ONIGENC_CONSTRUCT_MBCLEN_INVALID(); + if (p == e) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_EUCJP[firstbyte] - 1); + s = trans[s][*p++]; + if (s < 0) + return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(2) + : ONIGENC_CONSTRUCT_MBCLEN_INVALID(); + if (p == e) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_EUCJP[firstbyte] - 2); + s = trans[s][*p++]; + return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(3) + : ONIGENC_CONSTRUCT_MBCLEN_INVALID(); +} + +static OnigCodePoint mbc_to_code(const UChar *p, const UChar *end, + OnigEncoding enc) +{ + int c, i, len; + OnigCodePoint n; + + len = mbc_enc_len(p, end, enc); + n = (OnigCodePoint)*p++; + if (len == 1) + return n; + + for (i = 1; i < len; i++) + { + if (p >= end) + break; + c = *p++; + n <<= 8; + n += c; + } + return n; +} + +static int code_to_mbclen(OnigCodePoint code, OnigEncoding enc ARG_UNUSED) +{ + if (ONIGENC_IS_CODE_ASCII(code)) + return 1; + else if (code > 0x00ffffff) + return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE; + else if ((code & 0xff808080) == 0x00808080) + return 3; + else if ((code & 0xffff8080) == 0x00008080) + return 2; + else + return ONIGERR_INVALID_CODE_POINT_VALUE; +} + +#if 0 +static int +code_to_mbc_first(OnigCodePoint code) +{ + int first; + + if ((code & 0xff0000) != 0) { + first = (code >> 16) & 0xff; + } + else if ((code & 0xff00) != 0) { + first = (code >> 8) & 0xff; + } + else { + return (int )code; + } + return first; +} +#endif + +static int code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc) +{ + UChar *p = buf; + + if ((code & 0xff0000) != 0) + *p++ = (UChar)(((code >> 16) & 0xff)); + if ((code & 0xff00) != 0) + *p++ = (UChar)(((code >> 8) & 0xff)); + *p++ = (UChar)(code & 0xff); + +#if 1 + if (mbc_enc_len(buf, p, enc) != (p - buf)) + return ONIGERR_INVALID_CODE_POINT_VALUE; +#endif + return (int)(p - buf); +} + +static int apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc) +{ + return onigenc_apply_all_case_fold_with_map(numberof(CaseFoldMap), + CaseFoldMap, 0, flag, f, arg); +} + +static OnigCodePoint get_lower_case(OnigCodePoint code) +{ + if (ONIGENC_IS_IN_RANGE(code, 0xa3c1, 0xa3da)) + { + /* Fullwidth Alphabet */ + return (OnigCodePoint)(code + 0x0020); + } + else if (ONIGENC_IS_IN_RANGE(code, 0xa6a1, 0xa6b8)) + { + /* Greek */ + return (OnigCodePoint)(code + 0x0020); + } + else if (ONIGENC_IS_IN_RANGE(code, 0xa7a1, 0xa7c1)) + { + /* Cyrillic */ + return (OnigCodePoint)(code + 0x0030); + } + return code; +} + +static OnigCodePoint get_upper_case(OnigCodePoint code) +{ + if (ONIGENC_IS_IN_RANGE(code, 0xa3e1, 0xa3fa)) + { + /* Fullwidth Alphabet */ + return (OnigCodePoint)(code - 0x0020); + } + else if (ONIGENC_IS_IN_RANGE(code, 0xa6c1, 0xa6d8)) + { + /* Greek */ + return (OnigCodePoint)(code - 0x0020); + } + else if (ONIGENC_IS_IN_RANGE(code, 0xa7d1, 0xa7f1)) + { + /* Cyrillic */ + return (OnigCodePoint)(code - 0x0030); + } + return code; +} + +static int get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc) +{ + int len; + OnigCodePoint code, code_lo, code_up; + + code = mbc_to_code(p, end, enc); + if (ONIGENC_IS_ASCII_CODE(code)) + return onigenc_ascii_get_case_fold_codes_by_str(flag, p, end, items, enc); + + len = mbc_enc_len(p, end, enc); + code_lo = get_lower_case(code); + code_up = get_upper_case(code); + + if (code != code_lo) + { + items[0].byte_len = len; + items[0].code_len = 1; + items[0].code[0] = code_lo; + return 1; + } + else if (code != code_up) + { + items[0].byte_len = len; + items[0].code_len = 1; + items[0].code[0] = code_up; + return 1; + } + + return 0; +} + +static int mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end, UChar *lower, OnigEncoding enc) +{ + const UChar *p = *pp; + + if (ONIGENC_IS_MBC_ASCII(p)) + { + *lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p); + (*pp)++; + return 1; + } + else + { + OnigCodePoint code; + int len; + + len = mbc_enc_len(p, end, enc); + code = get_lower_case(mbc_to_code(p, end, enc)); + len = code_to_mbc(code, lower, enc); + if (len == ONIGERR_INVALID_CODE_POINT_VALUE) + len = 1; + (*pp) += len; + return len; /* return byte length of converted char to lower */ + } +} + +static UChar *left_adjust_char_head(const UChar *start, const UChar *s, + const UChar *end, OnigEncoding enc) +{ + /* In this encoding + mb-trail bytes doesn't mix with single bytes. + */ + const UChar *p; + int len; + + if (s <= start) + return (UChar *)s; + p = s; + + while (!eucjp_islead(*p) && p > start) + p--; + len = mbc_enc_len(p, end, enc); + if (p + len > s) + return (UChar *)p; + p += len; + return (UChar *)(p + ((s - p) & ~1)); +} + +static int is_allowed_reverse_match(const UChar *s, const UChar *end, + OnigEncoding enc ARG_UNUSED) +{ + const UChar c = *s; + if (c <= 0x7e || c == 0x8e || c == 0x8f) + return TRUE; + else + return FALSE; +} + +static const OnigCodePoint CR_Hiragana[] = {1, +#ifdef ENC_EUC_JIS_2004 + 0xa4a1, 0xa4fb +#else + 0xa4a1, 0xa4f3 +#endif +}; /* CR_Hiragana */ + +#ifdef ENC_EUC_JIS_2004 +static const OnigCodePoint CR_Katakana[] = { + 5, 0x8ea6, 0x8eaf, /* JIS X 0201 Katakana */ + 0x8eb1, 0x8edd, /* JIS X 0201 Katakana */ + 0xa5a1, 0xa5fe, 0xa6ee, 0xa6fe, 0xa7f2, 0xa7f5, +}; /* CR_Katakana */ +#else +static const OnigCodePoint CR_Katakana[] = { + 3, 0x8ea6, 0x8eaf, /* JIS X 0201 Katakana */ + 0x8eb1, 0x8edd, /* JIS X 0201 Katakana */ + 0xa5a1, 0xa5f6, +}; /* CR_Katakana */ +#endif + +#ifdef ENC_EUC_JIS_2004 +static const OnigCodePoint CR_Han[] = { + /* EUC-JIS-2004 (JIS X 0213:2004) */ + 7, + /* plane 1 */ + 0xa1b8, 0xa1b8, 0xaea1, 0xfefe, /* Kanji level 1, 2 and 3 */ + /* plane 2 */ + 0x8fa1a1, 0x8fa1fe, /* row 1 */ + 0x8fa3a1, 0x8fa5fe, /* row 3 .. 5 */ + 0x8fa8a1, 0x8fa8fe, /* row 8 */ + 0x8faca1, 0x8faffe, /* row 12 .. 15 */ + 0x8feea1, 0x8ffef6, /* row 78 .. 94 */ +}; /* CR_Han */ +#else +static const OnigCodePoint CR_Han[] = { + /* EUC-JP (JIS X 0208 based) */ + 4, 0xa1b8, 0xa1b8, 0xb0a1, 0xcfd3, /* Kanji level 1 */ + 0xd0a1, 0xf4a6, /* Kanji level 2 */ + 0x8fb0a1, 0x8fedf3 /* JIS X 0212 Supplemental Kanji (row 16 .. 77) */ +}; /* CR_Han */ +#endif + +static const OnigCodePoint CR_Latin[] = { + 4, 0x0041, 0x005a, 0x0061, 0x007a, 0xa3c1, 0xa3da, 0xa3e1, 0xa3fa, + /* TODO: add raw 8 .. 11 to support EUC-JIS-2004 */ + /* TODO: add JIS X 0212 row 9 .. 11 */ +}; /* CR_Latin */ + +static const OnigCodePoint CR_Greek[] = { + 2, 0xa6a1, 0xa6b8, +#ifdef ENC_EUC_JIS_2004 + 0xa6c1, 0xa6d9, +#else + 0xa6c1, 0xa6d8, +/* TODO: add JIS X 0212 row 6 */ +#endif +}; /* CR_Greek */ + +static const OnigCodePoint CR_Cyrillic[] = { + 2, 0xa7a1, 0xa7c1, 0xa7d1, 0xa7f1, + /* TODO: add JIS X 0212 row 7 */ +}; /* CR_Cyrillic */ + +#include "enc/jis/props.h" + +static int property_name_to_ctype(OnigEncoding enc, const UChar *p, + const UChar *end) +{ + const UChar *s = p, *e = end; + const struct enc_property *prop + = onig_jis_property((const char *)s, (unsigned int)(e - s)); + + if (!prop) + { + return onigenc_minimum_property_name_to_ctype(enc, s, e); + } + + return (int)prop->ctype; +} + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (ctype <= ONIGENC_MAX_STD_CTYPE) + { + if (code < 128) + return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype); + else + { + if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) + { + return (code_to_mbclen(code, enc) > 1 ? TRUE : FALSE); + } + } + } + else + { + ctype -= (ONIGENC_MAX_STD_CTYPE + 1); + if (ctype >= (unsigned int)PropertyListNum) + return ONIGERR_TYPE_BUG; + + return onig_is_in_code_range((UChar *)PropertyList[ctype], code); + } + + return FALSE; +} + +static int get_ctype_code_range(OnigCtype ctype, OnigCodePoint *sb_out, + const OnigCodePoint *ranges[], + OnigEncoding enc ARG_UNUSED) +{ + if (ctype <= ONIGENC_MAX_STD_CTYPE) + { + return ONIG_NO_SUPPORT_CONFIG; + } + else + { + *sb_out = 0x80; + + ctype -= (ONIGENC_MAX_STD_CTYPE + 1); + if (ctype >= (OnigCtype)PropertyListNum) + return ONIGERR_TYPE_BUG; + + *ranges = PropertyList[ctype]; + return 0; + } +} + +OnigEncodingDefine(euc_jp, EUC_JP) = { + mbc_enc_len, + "EUC-JP", /* name */ + 3, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + mbc_to_code, + code_to_mbclen, + code_to_mbc, + mbc_case_fold, + apply_all_case_fold, + get_case_fold_codes_by_str, + property_name_to_ctype, + is_code_ctype, + get_ctype_code_range, + left_adjust_char_head, + is_allowed_reverse_match, + onigenc_ascii_only_case_map, + 0, + ONIGENC_FLAG_NONE, +}; +/* + * Name: EUC-JP + * MIBenum: 18 + * Link: http://www.iana.org/assignments/character-sets + * Link: http://home.m05.itscom.net/numa/cde/sjis-euc/sjis-euc.html + * Link: http://home.m05.itscom.net/numa/uocjleE.pdf + */ +ENC_ALIAS("eucJP", "EUC-JP") /* UI-OSF Application Platform Profile for Japanese + Environment Version 1.1 */ + +/* + * Name: eucJP-ms + * Link: http://home.m05.itscom.net/numa/cde/ucs-conv/ucs-conv.html + * Link: http://www2d.biglobe.ne.jp/~msyk/charcode/cp932/eucJP-ms.html + * Link: http://ja.wikipedia.org/wiki/EUC-JP + */ +ENC_REPLICATE("eucJP-ms", "EUC-JP") /* TOG/JVC CDE/Motif Technical WG */ +ENC_ALIAS("euc-jp-ms", "eucJP-ms") + +/* + * Name: CP51932 + * MIBenum: 2108 + * Link: http://www.iana.org/assignments/charset-reg/CP51932 + * Link: http://search.cpan.org/src/NARUSE/Encode-EUCJPMS-0.07/ucm/cp51932.ucm + * Link: http://legacy-encoding.sourceforge.jp/wiki/index.php?cp51932 + * Link: http://msyk.at.webry.info/200511/article_2.html + */ +ENC_REPLICATE("CP51932", "EUC-JP") + +/* + * Name: EUC-JIS-2004 + * Link: http://ja.wikipedia.org/wiki/EUC-JIS-2004 + */ +ENC_REPLICATE("EUC-JIS-2004", "EUC-JP") /* defined at JIS X 0213:2004 */ +ENC_ALIAS("EUC-JISX0213", "EUC-JIS-2004") /* defined at JIS X 0213:2000, and + obsolete at JIS X 0213:2004 */ diff --git a/lib/edbee-lib/vendor/onig/enc/euc_kr.c b/lib/edbee-lib/vendor/onig/enc/euc_kr.c new file mode 100644 index 00000000..a1d3e41c --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/euc_kr.c @@ -0,0 +1,222 @@ +/********************************************************************** + euc_kr.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" + +static const int EncLen_EUCKR[] + = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1}; + +typedef enum +{ + FAILURE = -2, + ACCEPT = -1, + S0 = 0, + S1 +} state_t; +#define A ACCEPT +#define F FAILURE +static const signed char trans[][0x100] + = {{/* S0 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 1 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 2 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 3 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ F, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F}, + {/* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ F, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* b */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F}}; +#undef A +#undef F + +static int euckr_mbc_enc_len(const UChar *p, const UChar *e, + OnigEncoding enc ARG_UNUSED) +{ + int firstbyte = *p++; + state_t s = trans[0][firstbyte]; +#define RETURN(n) \ + return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(n) \ + : ONIGENC_CONSTRUCT_MBCLEN_INVALID() + if (s < 0) + RETURN(1); + if (p == e) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_EUCKR[firstbyte] - 1); + s = trans[s][*p++]; + RETURN(2); +#undef RETURN +} + +static OnigCodePoint euckr_mbc_to_code(const UChar *p, const UChar *end, + OnigEncoding enc) +{ + return onigenc_mbn_mbc_to_code(enc, p, end); +} + +static int euckr_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc) +{ + return onigenc_mb2_code_to_mbc(enc, code, buf); +} + +static int euckr_mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end, UChar *lower, OnigEncoding enc) +{ + return onigenc_mbn_mbc_case_fold(enc, flag, pp, end, lower); +} + +#if 0 +static int +euckr_is_mbc_ambiguous(OnigCaseFoldType flag, + const UChar** pp, const UChar* end, OnigEncoding enc) +{ + return onigenc_mbn_is_mbc_ambiguous(enc, flag, pp, end); +} +#endif + +static int euckr_is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc) +{ + return onigenc_mb2_is_code_ctype(enc, code, ctype); +} + +#define euckr_islead(c) ((c) < 0xa1 || (c) == 0xff) + +static UChar *euckr_left_adjust_char_head(const UChar *start, const UChar *s, + const UChar *end, OnigEncoding enc) +{ + /* Assumed in this encoding, + mb-trail bytes don't mix with single bytes. + */ + const UChar *p; + int len; + + if (s <= start) + return (UChar *)s; + p = s; + + while (!euckr_islead(*p) && p > start) + p--; + len = enclen(enc, p, end); + if (p + len > s) + return (UChar *)p; + p += len; + return (UChar *)(p + ((s - p) & ~1)); +} + +static int euckr_is_allowed_reverse_match(const UChar *s, + const UChar *end ARG_UNUSED, + OnigEncoding enc ARG_UNUSED) +{ + const UChar c = *s; + if (c <= 0x7e) + return TRUE; + else + return FALSE; +} + +OnigEncodingDefine(euc_kr, EUC_KR) = { + euckr_mbc_enc_len, + "EUC-KR", /* name */ + 2, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + euckr_mbc_to_code, + onigenc_mb2_code_to_mbclen, + euckr_code_to_mbc, + euckr_mbc_case_fold, + onigenc_ascii_apply_all_case_fold, + onigenc_ascii_get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + euckr_is_code_ctype, + onigenc_not_support_get_ctype_code_range, + euckr_left_adjust_char_head, + euckr_is_allowed_reverse_match, + onigenc_ascii_only_case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("eucKR", "EUC-KR") + +#ifndef RUBY +/* Same with OnigEncodingEUC_KR except the name */ +OnigEncodingDefine(euc_cn, EUC_CN) = { + euckr_mbc_enc_len, + "EUC-CN", /* name */ + 2, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + euckr_mbc_to_code, + onigenc_mb2_code_to_mbclen, + euckr_code_to_mbc, + euckr_mbc_case_fold, + onigenc_ascii_apply_all_case_fold, + onigenc_ascii_get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + euckr_is_code_ctype, + onigenc_not_support_get_ctype_code_range, + euckr_left_adjust_char_head, + euckr_is_allowed_reverse_match, + onigenc_ascii_only_case_map, + 0, + ONIGENC_FLAG_NONE, +}; +#endif /* RUBY */ diff --git a/lib/edbee-lib/vendor/onig/enc/euc_tw.c b/lib/edbee-lib/vendor/onig/enc/euc_tw.c new file mode 100644 index 00000000..1170f7d3 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/euc_tw.c @@ -0,0 +1,234 @@ +/********************************************************************** + euc_tw.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" + +static const int EncLen_EUCTW[] + = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1}; + +typedef enum +{ + FAILURE = -2, + ACCEPT = -1, + S0 = 0, + S1, + S2, + S3 +} state_t; +#define A ACCEPT +#define F FAILURE +static const signed char trans[][0x100] + = {{/* S0 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 1 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 2 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 3 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, 2, F, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ F, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F}, + {/* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ F, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* b */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F}, + {/* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ F, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* b */ 3, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F}, + {/* S3 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ F, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F}}; +#undef A +#undef F + +static int euctw_mbc_enc_len(const UChar *p, const UChar *e, + OnigEncoding enc ARG_UNUSED) +{ + int firstbyte = *p++; + state_t s = trans[0][firstbyte]; +#define RETURN(n) \ + return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(n) \ + : ONIGENC_CONSTRUCT_MBCLEN_INVALID() + if (s < 0) + RETURN(1); + if (p == e) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_EUCTW[firstbyte] - 1); + s = trans[s][*p++]; + if (s < 0) + RETURN(2); + if (p == e) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(4 - 2); + s = trans[s][*p++]; + if (s < 0) + RETURN(3); + if (p == e) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(4 - 3); + s = trans[s][*p++]; + RETURN(4); +#undef RETURN +} + +static OnigCodePoint euctw_mbc_to_code(const UChar *p, const UChar *end, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_mbn_mbc_to_code(enc, p, end); +} + +static int euctw_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc) +{ + return onigenc_mb4_code_to_mbc(enc, code, buf); +} + +static int euctw_mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end, UChar *lower, OnigEncoding enc) +{ + return onigenc_mbn_mbc_case_fold(enc, flag, pp, end, lower); +} + +static int euctw_is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc) +{ + return onigenc_mb4_is_code_ctype(enc, code, ctype); +} + +#define euctw_islead(c) ((UChar)((c) - 0xa1) > 0xfe - 0xa1) + +static UChar *euctw_left_adjust_char_head(const UChar *start, const UChar *s, + const UChar *end, OnigEncoding enc) +{ + /* Assumed in this encoding, + mb-trail bytes don't mix with single bytes. + */ + const UChar *p; + int len; + + if (s <= start) + return (UChar *)s; + p = s; + + while (!euctw_islead(*p) && p > start) + p--; + len = enclen(enc, p, end); + if (p + len > s) + return (UChar *)p; + p += len; + return (UChar *)(p + ((s - p) & ~1)); +} + +static int euctw_is_allowed_reverse_match(const UChar *s, + const UChar *end ARG_UNUSED, + OnigEncoding enc ARG_UNUSED) +{ + const UChar c = *s; + if (c <= 0x7e) + return TRUE; + else + return FALSE; +} + +OnigEncodingDefine(euc_tw, EUC_TW) = { + euctw_mbc_enc_len, + "EUC-TW", /* name */ + 4, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + euctw_mbc_to_code, + onigenc_mb4_code_to_mbclen, + euctw_code_to_mbc, + euctw_mbc_case_fold, + onigenc_ascii_apply_all_case_fold, + onigenc_ascii_get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + euctw_is_code_ctype, + onigenc_not_support_get_ctype_code_range, + euctw_left_adjust_char_head, + euctw_is_allowed_reverse_match, + onigenc_ascii_only_case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("eucTW", "EUC-TW") diff --git a/lib/edbee-lib/vendor/onig/enc/gb18030.c b/lib/edbee-lib/vendor/onig/enc/gb18030.c new file mode 100644 index 00000000..8b77ee13 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/gb18030.c @@ -0,0 +1,663 @@ +/********************************************************************** + gb18030.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2005-2007 KUBO Takehiro <kubo AT jiubao DOT org> + * K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" + +#if 1 +# define DEBUG_GB18030(arg) +#else +# define DEBUG_GB18030(arg) printf arg +#endif + +enum +{ + C1, /* one-byte char */ + C2, /* one-byte or second of two-byte char */ + C4, /* one-byte or second or fourth of four-byte char */ + CM /* first of two- or four-byte char or second of two-byte char */ +}; + +static const char GB18030_MAP[] = { + C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, + C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, + C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C4, C4, C4, C4, C4, C4, C4, C4, C4, + C4, C1, C1, C1, C1, C1, C1, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, + C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, + C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, + C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C1, C2, CM, CM, CM, CM, + CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, + CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, + CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, + CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, + CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, + CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, + CM, CM, CM, CM, CM, CM, CM, CM, C1}; + +typedef enum +{ + FAILURE = -2, + ACCEPT = -1, + S0 = 0, + S1, + S2, + S3 +} state_t; +#define A ACCEPT +#define F FAILURE +static const signed char trans[][0x100] + = {{/* S0 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 1 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 2 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 3 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 8 */ F, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 9 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* a */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F}, + {/* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, F, F, F, F, F, F, + /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F, + /* 8 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 9 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* a */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* b */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F}, + {/* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ F, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* 9 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* a */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* b */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* c */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* d */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* e */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* f */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, F}, + {/* S3 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ A, A, A, A, A, A, A, A, A, A, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* b */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F}}; +#undef A +#undef F + +static int gb18030_mbc_enc_len(const UChar *p, const UChar *e, + OnigEncoding enc ARG_UNUSED) +{ + int firstbyte = *p++; + state_t s = trans[0][firstbyte]; +#define RETURN(n) \ + return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(n) \ + : ONIGENC_CONSTRUCT_MBCLEN_INVALID() + if (s < 0) + RETURN(1); + if (p == e) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(2 - 1); + s = trans[s][*p++]; + if (s < 0) + RETURN(2); + if (p == e) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(4 - 2); + s = trans[s][*p++]; + if (s < 0) + RETURN(3); + if (p == e) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(4 - 3); + s = trans[s][*p++]; + RETURN(4); +#undef RETURN +} + +static OnigCodePoint gb18030_mbc_to_code(const UChar *p, const UChar *end, + OnigEncoding enc) +{ + int c, i, len; + OnigCodePoint n; + + len = enclen(enc, p, end); + n = (OnigCodePoint)(*p++); + if (len == 1) + return n; + + for (i = 1; i < len; i++) + { + if (p >= end) + break; + c = *p++; + n <<= 8; + n += c; + } + return n; +} + +static int gb18030_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc) +{ + return onigenc_mb4_code_to_mbc(enc, code, buf); +} + +static int gb18030_mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end, UChar *lower, + OnigEncoding enc) +{ + return onigenc_mbn_mbc_case_fold(enc, flag, pp, end, lower); +} + +#if 0 +static int +gb18030_is_mbc_ambiguous(OnigCaseFoldType flag, + const UChar** pp, const UChar* end, OnigEncoding enc) +{ + return onigenc_mbn_is_mbc_ambiguous(enc, flag, pp, end); +} +#endif + +static int gb18030_is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc) +{ + return onigenc_mb4_is_code_ctype(enc, code, ctype); +} + +enum state +{ + S_START, + S_one_C2, + S_one_C4, + S_one_CM, + + S_odd_CM_one_CX, + S_even_CM_one_CX, + + /* CMC4 : pair of "CM C4" */ + S_one_CMC4, + S_odd_CMC4, + S_one_C4_odd_CMC4, + S_even_CMC4, + S_one_C4_even_CMC4, + + S_odd_CM_odd_CMC4, + S_even_CM_odd_CMC4, + + S_odd_CM_even_CMC4, + S_even_CM_even_CMC4, + + /* C4CM : pair of "C4 CM" */ + S_odd_C4CM, + S_one_CM_odd_C4CM, + S_even_C4CM, + S_one_CM_even_C4CM, + + S_even_CM_odd_C4CM, + S_odd_CM_odd_C4CM, + S_even_CM_even_C4CM, + S_odd_CM_even_C4CM +}; + +static UChar *gb18030_left_adjust_char_head(const UChar *start, const UChar *s, + const UChar *end, OnigEncoding enc) +{ + const UChar *p; + enum state state = S_START; + + DEBUG_GB18030(("----------------\n")); + for (p = s; p >= start; p--) + { + DEBUG_GB18030(("state %d --(%02x)-->\n", state, *p)); + switch (state) + { + case S_START: + switch (GB18030_MAP[*p]) + { + case C1: + return (UChar *)s; + case C2: + state = S_one_C2; /* C2 */ + break; + case C4: + state = S_one_C4; /* C4 */ + break; + case CM: + state = S_one_CM; /* CM */ + break; + } + break; + case S_one_C2: /* C2 */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + case C4: + return (UChar *)s; + case CM: + state = S_odd_CM_one_CX; /* CM C2 */ + break; + } + break; + case S_one_C4: /* C4 */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + case C4: + return (UChar *)s; + case CM: + state = S_one_CMC4; + break; + } + break; + case S_one_CM: /* CM */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + return (UChar *)s; + case C4: + state = S_odd_C4CM; + break; + case CM: + state = S_odd_CM_one_CX; /* CM CM */ + break; + } + break; + + case S_odd_CM_one_CX: /* CM C2 */ /* CM CM */ /* CM CM CM C4 */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + case C4: + return (UChar *)(s - 1); + case CM: + state = S_even_CM_one_CX; + break; + } + break; + case S_even_CM_one_CX: /* CM CM C2 */ /* CM CM CM */ /* CM CM C4 */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + case C4: + return (UChar *)s; + case CM: + state = S_odd_CM_one_CX; + break; + } + break; + + case S_one_CMC4: /* CM C4 */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + return (UChar *)(s - 1); + case C4: + state = S_one_C4_odd_CMC4; /* C4 CM C4 */ + break; + case CM: + state = S_even_CM_one_CX; /* CM CM C4 */ + break; + } + break; + case S_odd_CMC4: /* CM C4 CM C4 CM C4 */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + return (UChar *)(s - 1); + case C4: + state = S_one_C4_odd_CMC4; + break; + case CM: + state = S_odd_CM_odd_CMC4; + break; + } + break; + case S_one_C4_odd_CMC4: /* C4 CM C4 */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + case C4: + return (UChar *)(s - 1); + case CM: + state = S_even_CMC4; /* CM C4 CM C4 */ + break; + } + break; + case S_even_CMC4: /* CM C4 CM C4 */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + return (UChar *)(s - 3); + case C4: + state = S_one_C4_even_CMC4; + break; + case CM: + state = S_odd_CM_even_CMC4; + break; + } + break; + case S_one_C4_even_CMC4: /* C4 CM C4 CM C4 */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + case C4: + return (UChar *)(s - 3); + case CM: + state = S_odd_CMC4; + break; + } + break; + + case S_odd_CM_odd_CMC4: /* CM CM C4 CM C4 CM C4 */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + case C4: + return (UChar *)(s - 3); + case CM: + state = S_even_CM_odd_CMC4; + break; + } + break; + case S_even_CM_odd_CMC4: /* CM CM CM C4 CM C4 CM C4 */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + case C4: + return (UChar *)(s - 1); + case CM: + state = S_odd_CM_odd_CMC4; + break; + } + break; + + case S_odd_CM_even_CMC4: /* CM CM C4 CM C4 */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + case C4: + return (UChar *)(s - 1); + case CM: + state = S_even_CM_even_CMC4; + break; + } + break; + case S_even_CM_even_CMC4: /* CM CM CM C4 CM C4 */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + case C4: + return (UChar *)(s - 3); + case CM: + state = S_odd_CM_even_CMC4; + break; + } + break; + + case S_odd_C4CM: /* C4 CM */ /* C4 CM C4 CM C4 CM*/ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + case C4: + return (UChar *)s; + case CM: + state = S_one_CM_odd_C4CM; /* CM C4 CM */ + break; + } + break; + case S_one_CM_odd_C4CM: /* CM C4 CM */ /* CM C4 CM C4 CM C4 CM */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + return (UChar *)(s - 2); /* |CM C4 CM */ + case C4: + state = S_even_C4CM; + break; + case CM: + state = S_even_CM_odd_C4CM; + break; + } + break; + case S_even_C4CM: /* C4 CM C4 CM */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + case C4: + return (UChar *)(s - 2); /* C4|CM C4 CM */ + case CM: + state = S_one_CM_even_C4CM; + break; + } + break; + case S_one_CM_even_C4CM: /* CM C4 CM C4 CM */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + return (UChar *)(s - 0); /*|CM C4 CM C4|CM */ + case C4: + state = S_odd_C4CM; + break; + case CM: + state = S_even_CM_even_C4CM; + break; + } + break; + + case S_even_CM_odd_C4CM: /* CM CM C4 CM */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + case C4: + return (UChar *)(s - 0); /* |CM CM|C4|CM */ + case CM: + state = S_odd_CM_odd_C4CM; + break; + } + break; + case S_odd_CM_odd_C4CM: /* CM CM CM C4 CM */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + case C4: + return (UChar *)(s - 2); /* |CM CM|CM C4 CM */ + case CM: + state = S_even_CM_odd_C4CM; + break; + } + break; + + case S_even_CM_even_C4CM: /* CM CM C4 CM C4 CM */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + case C4: + return (UChar *)(s - 2); /* |CM CM|C4|CM C4 CM */ + case CM: + state = S_odd_CM_even_C4CM; + break; + } + break; + case S_odd_CM_even_C4CM: /* CM CM CM C4 CM C4 CM */ + switch (GB18030_MAP[*p]) + { + case C1: + case C2: + case C4: + return (UChar *)(s - 0); /* |CM CM|CM C4 CM C4|CM */ + case CM: + state = S_even_CM_even_C4CM; + break; + } + break; + } + } + + DEBUG_GB18030(("state %d\n", state)); + switch (state) + { + case S_START: + return (UChar *)(s - 0); + case S_one_C2: + return (UChar *)(s - 0); + case S_one_C4: + return (UChar *)(s - 0); + case S_one_CM: + return (UChar *)(s - 0); + + case S_odd_CM_one_CX: + return (UChar *)(s - 1); + case S_even_CM_one_CX: + return (UChar *)(s - 0); + + case S_one_CMC4: + return (UChar *)(s - 1); + case S_odd_CMC4: + return (UChar *)(s - 1); + case S_one_C4_odd_CMC4: + return (UChar *)(s - 1); + case S_even_CMC4: + return (UChar *)(s - 3); + case S_one_C4_even_CMC4: + return (UChar *)(s - 3); + + case S_odd_CM_odd_CMC4: + return (UChar *)(s - 3); + case S_even_CM_odd_CMC4: + return (UChar *)(s - 1); + + case S_odd_CM_even_CMC4: + return (UChar *)(s - 1); + case S_even_CM_even_CMC4: + return (UChar *)(s - 3); + + case S_odd_C4CM: + return (UChar *)(s - 0); + case S_one_CM_odd_C4CM: + return (UChar *)(s - 2); + case S_even_C4CM: + return (UChar *)(s - 2); + case S_one_CM_even_C4CM: + return (UChar *)(s - 0); + + case S_even_CM_odd_C4CM: + return (UChar *)(s - 0); + case S_odd_CM_odd_C4CM: + return (UChar *)(s - 2); + case S_even_CM_even_C4CM: + return (UChar *)(s - 2); + case S_odd_CM_even_C4CM: + return (UChar *)(s - 0); + } + + return (UChar *)s; /* never come here. (escape warning) */ +} + +static int gb18030_is_allowed_reverse_match(const UChar *s, + const UChar *end ARG_UNUSED, + OnigEncoding enc ARG_UNUSED) +{ + return GB18030_MAP[*s] == C1 ? TRUE : FALSE; +} + +/* + * Name: GB18030 + * MIBenum: 114 + * Link: http://www.iana.org/assignments/charset-reg/GB18030 + */ +OnigEncodingDefine(gb18030, GB18030) = { + gb18030_mbc_enc_len, + "GB18030", /* name */ + 4, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + gb18030_mbc_to_code, + onigenc_mb4_code_to_mbclen, + gb18030_code_to_mbc, + gb18030_mbc_case_fold, + onigenc_ascii_apply_all_case_fold, + onigenc_ascii_get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + gb18030_is_code_ctype, + onigenc_not_support_get_ctype_code_range, + gb18030_left_adjust_char_head, + gb18030_is_allowed_reverse_match, + onigenc_ascii_only_case_map, + 0, + ONIGENC_FLAG_NONE, +}; diff --git a/lib/edbee-lib/vendor/onig/enc/gb2312.c b/lib/edbee-lib/vendor/onig/enc/gb2312.c new file mode 100644 index 00000000..04d14270 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/gb2312.c @@ -0,0 +1,12 @@ +#include <ruby/ruby.h> +#include <ruby/encoding.h> +#include "regenc.h" + +void Init_gb2312(void) +{ + rb_enc_register("GB2312", rb_enc_find("EUC-KR")); +} + +ENC_ALIAS("EUC-CN", "GB2312") +ENC_ALIAS("eucCN", "GB2312") +ENC_REPLICATE("GB12345", "GB2312") diff --git a/lib/edbee-lib/vendor/onig/enc/gbk.c b/lib/edbee-lib/vendor/onig/enc/gbk.c new file mode 100644 index 00000000..ac198c24 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/gbk.c @@ -0,0 +1,221 @@ +/********************************************************************** + gbk.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" + +static const int EncLen_GBK[] + = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1}; + +static const char GBK_CAN_BE_TRAIL_TABLE[256] + = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}; + +#define GBK_ISMB_FIRST(byte) (EncLen_GBK[byte] > 1) +#define GBK_ISMB_TRAIL(byte) GBK_CAN_BE_TRAIL_TABLE[(byte)] + +typedef enum +{ + FAILURE = -2, + ACCEPT = -1, + S0 = 0, + S1 +} state_t; +#define A ACCEPT +#define F FAILURE +static const signed char trans[][0x100] + = {{/* S0 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 1 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 2 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 3 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 8 */ A, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 9 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* a */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F}, + {/* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F, + /* 8 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 9 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* a */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* b */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F}}; +#undef A +#undef F + +static int gbk_mbc_enc_len(const UChar *p, const UChar *e, + OnigEncoding enc ARG_UNUSED) +{ + int firstbyte = *p++; + state_t s = trans[0][firstbyte]; +#define RETURN(n) \ + return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(n) \ + : ONIGENC_CONSTRUCT_MBCLEN_INVALID() + if (s < 0) + RETURN(1); + if (p == e) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_GBK[firstbyte] - 1); + s = trans[s][*p++]; + RETURN(2); +#undef RETURN +} + +static OnigCodePoint gbk_mbc_to_code(const UChar *p, const UChar *end, + OnigEncoding enc) +{ + return onigenc_mbn_mbc_to_code(enc, p, end); +} + +static int gbk_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc) +{ + return onigenc_mb2_code_to_mbc(enc, code, buf); +} + +static int gbk_mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end, UChar *lower, OnigEncoding enc) +{ + return onigenc_mbn_mbc_case_fold(enc, flag, pp, end, lower); +} + +#if 0 +static int +gbk_is_mbc_ambiguous(OnigCaseFoldType flag, + const UChar** pp, const UChar* end, OnigEncoding enc) +{ + return onigenc_mbn_is_mbc_ambiguous(enc, flag, pp, end); +} +#endif + +static int gbk_is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc) +{ + return onigenc_mb2_is_code_ctype(enc, code, ctype); +} + +static UChar *gbk_left_adjust_char_head(const UChar *start, const UChar *s, + const UChar *end, OnigEncoding enc) +{ + const UChar *p; + int len; + + if (s <= start) + return (UChar *)s; + p = s; + + if (GBK_ISMB_TRAIL(*p)) + { + while (p > start) + { + if (!GBK_ISMB_FIRST(*--p)) + { + p++; + break; + } + } + } + len = enclen(enc, p, end); + if (p + len > s) + return (UChar *)p; + p += len; + return (UChar *)(p + ((s - p) & ~1)); +} + +static int gbk_is_allowed_reverse_match(const UChar *s, + const UChar *end ARG_UNUSED, + OnigEncoding enc ARG_UNUSED) +{ + const UChar c = *s; + return (GBK_ISMB_TRAIL(c) ? FALSE : TRUE); +} + +OnigEncodingDefine(gbk, GBK) = { + gbk_mbc_enc_len, + "GBK", /* name */ + 2, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + gbk_mbc_to_code, + onigenc_mb2_code_to_mbclen, + gbk_code_to_mbc, + gbk_mbc_case_fold, + onigenc_ascii_apply_all_case_fold, + onigenc_ascii_get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + gbk_is_code_ctype, + onigenc_not_support_get_ctype_code_range, + gbk_left_adjust_char_head, + gbk_is_allowed_reverse_match, + onigenc_ascii_only_case_map, + 0, + ONIGENC_FLAG_NONE, +}; +/* + * Name: GBK + * MIBenum: 113 + * Link: http://www.iana.org/assignments/character-sets + * Link: http://www.iana.org/assignments/charset-reg/GBK + * Link: http://www.microsoft.com/globaldev/reference/dbcs/936.mspx + */ +ENC_ALIAS("CP936", "GBK") diff --git a/lib/edbee-lib/vendor/onig/enc/iso_8859.h b/lib/edbee-lib/vendor/onig/enc/iso_8859.h new file mode 100644 index 00000000..0ec14686 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/iso_8859.h @@ -0,0 +1 @@ +#define SHARP_s 0xdf diff --git a/lib/edbee-lib/vendor/onig/enc/iso_8859_1.c b/lib/edbee-lib/vendor/onig/enc/iso_8859_1.c new file mode 100644 index 00000000..90a89dae --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/iso_8859_1.c @@ -0,0 +1,308 @@ +/********************************************************************** + iso8859_1.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" +#include "iso_8859.h" + +#define ENC_IS_ISO_8859_1_CTYPE(code, ctype) \ + ((EncISO_8859_1_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const unsigned short EncISO_8859_1_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0284, 0x01a0, + 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x30e2, + 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x10a0, 0x10a0, + 0x00a0, 0x30e2, 0x00a0, 0x01a0, 0x00a0, 0x10a0, 0x30e2, 0x01a0, 0x10a0, + 0x10a0, 0x10a0, 0x01a0, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2}; + +static const OnigPairCaseFoldCodes CaseFoldMap[] + = {{0xc0, 0xe0}, {0xc1, 0xe1}, {0xc2, 0xe2}, {0xc3, 0xe3}, {0xc4, 0xe4}, + {0xc5, 0xe5}, {0xc6, 0xe6}, {0xc7, 0xe7}, {0xc8, 0xe8}, {0xc9, 0xe9}, + {0xca, 0xea}, {0xcb, 0xeb}, {0xcc, 0xec}, {0xcd, 0xed}, {0xce, 0xee}, + {0xcf, 0xef}, + + {0xd0, 0xf0}, {0xd1, 0xf1}, {0xd2, 0xf2}, {0xd3, 0xf3}, {0xd4, 0xf4}, + {0xd5, 0xf5}, {0xd6, 0xf6}, {0xd8, 0xf8}, {0xd9, 0xf9}, {0xda, 0xfa}, + {0xdb, 0xfb}, {0xdc, 0xfc}, {0xdd, 0xfd}, {0xde, 0xfe}}; + +static int apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_apply_all_case_fold_with_map(numberof(CaseFoldMap), + CaseFoldMap, 1, flag, f, arg); +} + +static int get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + if (0x41 <= *p && *p <= 0x5a) + { + items[0].byte_len = 1; + items[0].code_len = 1; + items[0].code[0] = (OnigCodePoint)(*p + 0x20); + if (*p == 0x53 && end > p + 1 && (*(p + 1) == 0x53 || *(p + 1) == 0x73)) + { /* SS */ + items[1].byte_len = 2; + items[1].code_len = 1; + items[1].code[0] = (OnigCodePoint)SHARP_s; + return 2; + } + else + return 1; + } + else if (0x61 <= *p && *p <= 0x7a) + { + items[0].byte_len = 1; + items[0].code_len = 1; + items[0].code[0] = (OnigCodePoint)(*p - 0x20); + if (*p == 0x73 && end > p + 1 && (*(p + 1) == 0x73 || *(p + 1) == 0x53)) + { /* ss */ + items[1].byte_len = 2; + items[1].code_len = 1; + items[1].code[0] = (OnigCodePoint)SHARP_s; + return 2; + } + else + return 1; + } + else if (0xc0 <= *p && *p <= 0xcf) + { + items[0].byte_len = 1; + items[0].code_len = 1; + items[0].code[0] = (OnigCodePoint)(*p + 0x20); + return 1; + } + else if (0xd0 <= *p && *p <= 0xdf) + { + if (*p == SHARP_s) + { + items[0].byte_len = 1; + items[0].code_len = 2; + items[0].code[0] = (OnigCodePoint)'s'; + items[0].code[1] = (OnigCodePoint)'s'; + + items[1].byte_len = 1; + items[1].code_len = 2; + items[1].code[0] = (OnigCodePoint)'S'; + items[1].code[1] = (OnigCodePoint)'S'; + + items[2].byte_len = 1; + items[2].code_len = 2; + items[2].code[0] = (OnigCodePoint)'s'; + items[2].code[1] = (OnigCodePoint)'S'; + + items[3].byte_len = 1; + items[3].code_len = 2; + items[3].code[0] = (OnigCodePoint)'S'; + items[3].code[1] = (OnigCodePoint)'s'; + + return 4; + } + else if (*p != 0xd7) + { + items[0].byte_len = 1; + items[0].code_len = 1; + items[0].code[0] = (OnigCodePoint)(*p + 0x20); + return 1; + } + } + else if (0xe0 <= *p && *p <= 0xef) + { + items[0].byte_len = 1; + items[0].code_len = 1; + items[0].code[0] = (OnigCodePoint)(*p - 0x20); + return 1; + } + else if (0xf0 <= *p && *p <= 0xfe) + { + if (*p != 0xf7) + { + items[0].byte_len = 1; + items[0].code_len = 1; + items[0].code[0] = (OnigCodePoint)(*p - 0x20); + return 1; + } + } + + return 0; +} + +static int mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end ARG_UNUSED, UChar *lower, + OnigEncoding enc ARG_UNUSED) +{ + const UChar *p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) + { + *lower++ = 's'; + *lower = 's'; + (*pp)++; + return 2; + } + + *lower = ONIGENC_ISO_8859_1_TO_LOWER_CASE(*p); + (*pp)++; + return 1; +} + +#if 0 +static int +is_mbc_ambiguous(OnigCaseFoldType flag, + const UChar** pp, const UChar* end) +{ + int v; + const UChar* p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) { + (*pp)++; + return TRUE; + } + + (*pp)++; + v = (EncISO_8859_1_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + if ((v | BIT_CTYPE_LOWER) != 0) { + /* 0xdf, 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */ + if (*p >= 0xaa && *p <= 0xba) + return FALSE; + else + return TRUE; + } + + return (v != 0 ? TRUE : FALSE); +} +#endif + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_ISO_8859_1_CTYPE(code, ctype); + else + return FALSE; +} + +static int case_map(OnigCaseFoldType *flagP, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, OnigUChar *to_end, + const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp < end && to < to_end) + { + code = *(*pp)++; + if (code == SHARP_s) + { + if (flags & ONIGENC_CASE_UPCASE) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 'S'; + code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S'; + } + else if (flags & ONIGENC_CASE_FOLD) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 's'; + code = 's'; + } + } + else if ((EncISO_8859_1_CtypeTable[code] & BIT_CTYPE_UPPER) + && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) + { + flags |= ONIGENC_CASE_MODIFIED; + code += 0x20; + } + else if (code == 0xAA || code == 0xBA || code == 0xB5 || code == 0xFF) + ; + else if ((EncISO_8859_1_CtypeTable[code] & BIT_CTYPE_LOWER) + && (flags & ONIGENC_CASE_UPCASE)) + { + flags |= ONIGENC_CASE_MODIFIED; + code -= 0x20; + } + *to++ = code; + if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase + for capitalize */ + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE); + } + *flagP = flags; + return (int)(to - to_start); +} + +OnigEncodingDefine(iso_8859_1, ISO_8859_1) = { + onigenc_single_byte_mbc_enc_len, + "ISO-8859-1", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + mbc_case_fold, + apply_all_case_fold, + get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("ISO8859-1", "ISO-8859-1") diff --git a/lib/edbee-lib/vendor/onig/enc/iso_8859_10.c b/lib/edbee-lib/vendor/onig/enc/iso_8859_10.c new file mode 100644 index 00000000..d8aaf5c7 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/iso_8859_10.c @@ -0,0 +1,254 @@ +/********************************************************************** + iso8859_10.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" +#include "iso_8859.h" + +#define ENC_ISO_8859_10_TO_LOWER_CASE(c) EncISO_8859_10_ToLowerCaseTable[c] +#define ENC_IS_ISO_8859_10_CTYPE(code, ctype) \ + ((EncISO_8859_10_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const UChar EncISO_8859_10_ToLowerCaseTable[256] + = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\261', + '\262', '\263', '\264', '\265', '\266', '\247', '\270', '\271', '\272', + '\273', '\274', '\255', '\276', '\277', '\260', '\261', '\262', '\263', + '\264', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\274', + '\275', '\276', '\277', '\340', '\341', '\342', '\343', '\344', '\345', + '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', + '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', + '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', '\340', + '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', + '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', + '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', + '\374', '\375', '\376', '\377'}; + +static const unsigned short EncISO_8859_10_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0284, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x01a0, 0x34a2, 0x34a2, 0x00a0, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x01a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x01a0, 0x30e2, 0x30e2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2}; + +static int mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end ARG_UNUSED, UChar *lower, + OnigEncoding enc ARG_UNUSED) +{ + const UChar *p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) + { + *lower++ = 's'; + *lower = 's'; + (*pp)++; + return 2; + } + + *lower = ENC_ISO_8859_10_TO_LOWER_CASE(*p); + (*pp)++; + return 1; +} + +#if 0 +static int +is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end) +{ + int v; + const UChar* p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) { + (*pp)++; + return TRUE; + } + + (*pp)++; + v = (EncISO_8859_10_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + if ((v | BIT_CTYPE_LOWER) != 0) { + return TRUE; + } + + return (v != 0 ? TRUE : FALSE); +} +#endif + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_ISO_8859_10_CTYPE(code, ctype); + else + return FALSE; +} + +static const OnigPairCaseFoldCodes CaseFoldMap[] + = {{0xa1, 0xb1}, {0xa2, 0xb2}, {0xa3, 0xb3}, {0xa4, 0xb4}, {0xa5, 0xb5}, + {0xa6, 0xb6}, {0xa8, 0xb8}, {0xa9, 0xb9}, {0xaa, 0xba}, {0xab, 0xbb}, + {0xac, 0xbc}, {0xae, 0xbe}, {0xaf, 0xbf}, + + {0xc0, 0xe0}, {0xc1, 0xe1}, {0xc2, 0xe2}, {0xc3, 0xe3}, {0xc4, 0xe4}, + {0xc5, 0xe5}, {0xc6, 0xe6}, {0xc7, 0xe7}, {0xc8, 0xe8}, {0xc9, 0xe9}, + {0xca, 0xea}, {0xcb, 0xeb}, {0xcc, 0xec}, {0xcd, 0xed}, {0xce, 0xee}, + {0xcf, 0xef}, + + {0xd0, 0xf0}, {0xd1, 0xf1}, {0xd2, 0xf2}, {0xd3, 0xf3}, {0xd4, 0xf4}, + {0xd5, 0xf5}, {0xd6, 0xf6}, {0xd7, 0xf7}, {0xd8, 0xf8}, {0xd9, 0xf9}, + {0xda, 0xfa}, {0xdb, 0xfb}, {0xdc, 0xfc}, {0xdd, 0xfd}, {0xde, 0xfe}}; + +static int apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_apply_all_case_fold_with_map(numberof(CaseFoldMap), + CaseFoldMap, 1, flag, f, arg); +} + +static int get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_get_case_fold_codes_by_str_with_map( + numberof(CaseFoldMap), CaseFoldMap, 1, flag, p, end, items); +} + +static int case_map(OnigCaseFoldType *flagP, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, OnigUChar *to_end, + const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp < end && to < to_end) + { + code = *(*pp)++; + if (code == SHARP_s) + { + if (flags & ONIGENC_CASE_UPCASE) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 'S'; + code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S'; + } + else if (flags & ONIGENC_CASE_FOLD) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 's'; + code = 's'; + } + } + else if (code == 0xBD || code == 0xFF) + ; + else if ((EncISO_8859_10_CtypeTable[code] & BIT_CTYPE_UPPER) + && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) + { + flags |= ONIGENC_CASE_MODIFIED; + code = ENC_ISO_8859_10_TO_LOWER_CASE(code); + } + else if ((EncISO_8859_10_CtypeTable[code] & BIT_CTYPE_LOWER) + && (flags & ONIGENC_CASE_UPCASE)) + { + flags |= ONIGENC_CASE_MODIFIED; + if (code >= 0xA0 && code <= 0xBF) + code -= 0x10; + else + code -= 0x20; + } + *to++ = code; + if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase + for capitalize */ + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE); + } + *flagP = flags; + return (int)(to - to_start); +} + +OnigEncodingDefine(iso_8859_10, ISO_8859_10) = { + onigenc_single_byte_mbc_enc_len, + "ISO-8859-10", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + mbc_case_fold, + apply_all_case_fold, + get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("ISO8859-10", "ISO-8859-10") diff --git a/lib/edbee-lib/vendor/onig/enc/iso_8859_11.c b/lib/edbee-lib/vendor/onig/enc/iso_8859_11.c new file mode 100644 index 00000000..632e88db --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/iso_8859_11.c @@ -0,0 +1,110 @@ +/********************************************************************** + iso8859_11.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" + +#define ENC_IS_ISO_8859_11_CTYPE(code, ctype) \ + ((EncISO_8859_11_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const unsigned short EncISO_8859_11_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0284, 0x30a2, + 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, + 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, + 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, + 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, + 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, + 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, + 0x30a2, 0x30a2, 0x30a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x30a2, 0x30a2, + 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, + 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, + 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, + 0x0000, 0x0000, 0x0000, 0x0000}; + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_ISO_8859_11_CTYPE(code, ctype); + else + return FALSE; +} + +OnigEncodingDefine(iso_8859_11, ISO_8859_11) = { + onigenc_single_byte_mbc_enc_len, + "ISO-8859-11", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + onigenc_ascii_mbc_case_fold, + onigenc_ascii_apply_all_case_fold, + onigenc_ascii_get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + onigenc_single_byte_ascii_only_case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("ISO8859-11", "ISO-8859-11") + +/* + * Name: TIS-620 + * MIBenum: 2259 + * Link: http://en.wikipedia.org/wiki/Thai_Industrial_Standard_620-2533 + */ +ENC_REPLICATE("TIS-620", "ISO-8859-11") + +/* + * Name: Windows-874 + * Link: http://www.microsoft.com/globaldev/reference/sbcs/874.mspx + */ +ENC_REPLICATE("Windows-874", "ISO-8859-11") +ENC_ALIAS("CP874", "Windows-874") diff --git a/lib/edbee-lib/vendor/onig/enc/iso_8859_13.c b/lib/edbee-lib/vendor/onig/enc/iso_8859_13.c new file mode 100644 index 00000000..6de123ea --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/iso_8859_13.c @@ -0,0 +1,260 @@ +/********************************************************************** + iso8859_13.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" +#include "iso_8859.h" + +#define ENC_ISO_8859_13_TO_LOWER_CASE(c) EncISO_8859_13_ToLowerCaseTable[c] +#define ENC_IS_ISO_8859_13_CTYPE(code, ctype) \ + ((EncISO_8859_13_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const UChar EncISO_8859_13_ToLowerCaseTable[256] + = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\241', + '\242', '\243', '\244', '\245', '\246', '\247', '\270', '\251', '\272', + '\253', '\254', '\255', '\256', '\277', '\260', '\261', '\262', '\263', + '\264', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\274', + '\275', '\276', '\277', '\340', '\341', '\342', '\343', '\344', '\345', + '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', + '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327', + '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', '\340', + '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', + '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', + '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', + '\374', '\375', '\376', '\377'}; + +static const unsigned short EncISO_8859_13_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0284, 0x01a0, + 0x00a0, 0x00a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0, 0x34a2, 0x00a0, 0x34a2, + 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x34a2, 0x00a0, 0x00a0, 0x10a0, 0x10a0, + 0x01a0, 0x30e2, 0x00a0, 0x01a0, 0x30e2, 0x10a0, 0x30e2, 0x01a0, 0x10a0, + 0x10a0, 0x10a0, 0x30e2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x01a0}; + +static int mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end ARG_UNUSED, UChar *lower, + OnigEncoding enc ARG_UNUSED) +{ + const UChar *p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) + { + *lower++ = 's'; + *lower = 's'; + (*pp)++; + return 2; + } + + *lower = ENC_ISO_8859_13_TO_LOWER_CASE(*p); + (*pp)++; + return 1; +} + +#if 0 +static int +is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end) +{ + int v; + const UChar* p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) { + (*pp)++; + return TRUE; + } + + (*pp)++; + v = (EncISO_8859_13_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + if ((v | BIT_CTYPE_LOWER) != 0) { + /* 0xdf, 0xb5 are lower case letter, but can't convert. */ + if (*p == 0xb5) + return FALSE; + else + return TRUE; + } + + return (v != 0 ? TRUE : FALSE); +} +#endif + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_ISO_8859_13_CTYPE(code, ctype); + else + return FALSE; +} + +static const OnigPairCaseFoldCodes CaseFoldMap[] + = {{0xa8, 0xb8}, {0xaa, 0xba}, {0xaf, 0xbf}, + + {0xc0, 0xe0}, {0xc1, 0xe1}, {0xc2, 0xe2}, {0xc3, 0xe3}, {0xc4, 0xe4}, + {0xc5, 0xe5}, {0xc6, 0xe6}, {0xc7, 0xe7}, {0xc8, 0xe8}, {0xc9, 0xe9}, + {0xca, 0xea}, {0xcb, 0xeb}, {0xcc, 0xec}, {0xcd, 0xed}, {0xce, 0xee}, + {0xcf, 0xef}, + + {0xd0, 0xf0}, {0xd1, 0xf1}, {0xd2, 0xf2}, {0xd3, 0xf3}, {0xd4, 0xf4}, + {0xd5, 0xf5}, {0xd6, 0xf6}, {0xd8, 0xf8}, {0xd9, 0xf9}, {0xda, 0xfa}, + {0xdb, 0xfb}, {0xdc, 0xfc}, {0xdd, 0xfd}, {0xde, 0xfe}}; + +static int apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_apply_all_case_fold_with_map(numberof(CaseFoldMap), + CaseFoldMap, 1, flag, f, arg); +} + +static int get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_get_case_fold_codes_by_str_with_map( + numberof(CaseFoldMap), CaseFoldMap, 1, flag, p, end, items); +} + +static int case_map(OnigCaseFoldType *flagP, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, OnigUChar *to_end, + const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp < end && to < to_end) + { + code = *(*pp)++; + if (code == SHARP_s) + { + if (flags & ONIGENC_CASE_UPCASE) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 'S'; + code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S'; + } + else if (flags & ONIGENC_CASE_FOLD) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 's'; + code = 's'; + } + } + else if ((EncISO_8859_13_CtypeTable[code] & BIT_CTYPE_UPPER) + && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) + { + flags |= ONIGENC_CASE_MODIFIED; + code = ENC_ISO_8859_13_TO_LOWER_CASE(code); + } + else if (code == 0xB5) + ; + else if ((EncISO_8859_13_CtypeTable[code] & BIT_CTYPE_LOWER) + && (flags & ONIGENC_CASE_UPCASE)) + { + flags |= ONIGENC_CASE_MODIFIED; + if (code == 0xB8 || code == 0xBA || code == 0xBF) + { + code -= 0x10; + } + else + { + code -= 0x20; + } + } + *to++ = code; + if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase + for capitalize */ + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE); + } + *flagP = flags; + return (int)(to - to_start); +} + +OnigEncodingDefine(iso_8859_13, ISO_8859_13) = { + onigenc_single_byte_mbc_enc_len, + "ISO-8859-13", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + mbc_case_fold, + apply_all_case_fold, + get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("ISO8859-13", "ISO-8859-13") diff --git a/lib/edbee-lib/vendor/onig/enc/iso_8859_14.c b/lib/edbee-lib/vendor/onig/enc/iso_8859_14.c new file mode 100644 index 00000000..91031e78 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/iso_8859_14.c @@ -0,0 +1,267 @@ +/********************************************************************** + iso8859_14.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" +#include "iso_8859.h" + +#define ENC_ISO_8859_14_TO_LOWER_CASE(c) EncISO_8859_14_ToLowerCaseTable[c] +#define ENC_IS_ISO_8859_14_CTYPE(code, ctype) \ + ((EncISO_8859_14_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const UChar EncISO_8859_14_ToLowerCaseTable[256] + = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\242', + '\242', '\243', '\245', '\245', '\253', '\247', '\270', '\251', '\272', + '\253', '\274', '\255', '\256', '\377', '\261', '\261', '\263', '\263', + '\265', '\265', '\266', '\271', '\270', '\271', '\272', '\277', '\274', + '\276', '\276', '\277', '\340', '\341', '\342', '\343', '\344', '\345', + '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', + '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', + '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', '\340', + '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', + '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', + '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', + '\374', '\375', '\376', '\377'}; + +static const unsigned short EncISO_8859_14_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0284, 0x34a2, + 0x30e2, 0x00a0, 0x34a2, 0x30e2, 0x34a2, 0x00a0, 0x34a2, 0x00a0, 0x34a2, + 0x30e2, 0x34a2, 0x01a0, 0x00a0, 0x34a2, 0x34a2, 0x30e2, 0x34a2, 0x30e2, + 0x34a2, 0x30e2, 0x00a0, 0x34a2, 0x30e2, 0x30e2, 0x30e2, 0x34a2, 0x30e2, + 0x34a2, 0x30e2, 0x30e2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2}; + +static int mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end ARG_UNUSED, UChar *lower, + OnigEncoding enc ARG_UNUSED) +{ + const UChar *p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) + { + *lower++ = 's'; + *lower = 's'; + (*pp)++; + return 2; + } + + *lower = ENC_ISO_8859_14_TO_LOWER_CASE(*p); + (*pp)++; + return 1; /* return byte length of converted char to lower */ +} + +#if 0 +static int +is_mbc_ambiguous(OnigCaseFoldType flag, + const UChar** pp, const UChar* end) +{ + int v; + const UChar* p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) { + (*pp)++; + return TRUE; + } + + (*pp)++; + v = (EncISO_8859_14_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + if ((v | BIT_CTYPE_LOWER) != 0) { + return TRUE; + } + + return (v != 0 ? TRUE : FALSE); +} +#endif + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_ISO_8859_14_CTYPE(code, ctype); + else + return FALSE; +} + +static const OnigPairCaseFoldCodes CaseFoldMap[] + = {{0xa1, 0xa2}, {0xa4, 0xa5}, {0xa6, 0xab}, {0xa8, 0xb8}, {0xaa, 0xba}, + {0xac, 0xbc}, {0xaf, 0xff}, + + {0xb0, 0xb1}, {0xb2, 0xb3}, {0xb4, 0xb5}, {0xb7, 0xb9}, {0xbb, 0xbf}, + {0xbd, 0xbe}, + + {0xc0, 0xe0}, {0xc1, 0xe1}, {0xc2, 0xe2}, {0xc3, 0xe3}, {0xc4, 0xe4}, + {0xc5, 0xe5}, {0xc6, 0xe6}, {0xc7, 0xe7}, {0xc8, 0xe8}, {0xc9, 0xe9}, + {0xca, 0xea}, {0xcb, 0xeb}, {0xcc, 0xec}, {0xcd, 0xed}, {0xce, 0xee}, + {0xcf, 0xef}, + + {0xd0, 0xf0}, {0xd1, 0xf1}, {0xd2, 0xf2}, {0xd3, 0xf3}, {0xd4, 0xf4}, + {0xd5, 0xf5}, {0xd6, 0xf6}, {0xd7, 0xf7}, {0xd8, 0xf8}, {0xd9, 0xf9}, + {0xda, 0xfa}, {0xdb, 0xfb}, {0xdc, 0xfc}, {0xdd, 0xfd}, {0xde, 0xfe}}; + +static int apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_apply_all_case_fold_with_map(numberof(CaseFoldMap), + CaseFoldMap, 1, flag, f, arg); +} + +static int get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_get_case_fold_codes_by_str_with_map( + numberof(CaseFoldMap), CaseFoldMap, 1, flag, p, end, items); +} + +static int case_map(OnigCaseFoldType *flagP, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, OnigUChar *to_end, + const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp < end && to < to_end) + { + code = *(*pp)++; + if (code == SHARP_s) + { + if (flags & ONIGENC_CASE_UPCASE) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 'S'; + code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S'; + } + else if (flags & ONIGENC_CASE_FOLD) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 's'; + code = 's'; + } + } + /* else if (code == 0xAA || code == 0xBA) ; */ + else if ((EncISO_8859_14_CtypeTable[code] & BIT_CTYPE_UPPER) + && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) + { + flags |= ONIGENC_CASE_MODIFIED; + code = ENC_ISO_8859_14_TO_LOWER_CASE(code); + } + else if ((EncISO_8859_14_CtypeTable[code] & BIT_CTYPE_LOWER) + && (flags & ONIGENC_CASE_UPCASE)) + { + flags |= ONIGENC_CASE_MODIFIED; + if (code == 0xA2 || code == 0xA5 || code == 0xB1 || code == 0xB3 + || code == 0xB5 || code == 0xBE) + code -= 0x1; + else if (code == 0xAB) + code -= 0x5; + else if (code == 0xFF) + code -= 0x50; + else if (code == 0xB9) + code -= 0x2; + else if (code == 0xBF) + code -= 0x4; + else if (code == 0xB8 || code == 0xBA || code == 0xBC) + code -= 0x10; + else + code -= 0x20; + } + *to++ = code; + if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase + for capitalize */ + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE); + } + *flagP = flags; + return (int)(to - to_start); +} + +OnigEncodingDefine(iso_8859_14, ISO_8859_14) = { + onigenc_single_byte_mbc_enc_len, + "ISO-8859-14", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + mbc_case_fold, + apply_all_case_fold, + get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("ISO8859-14", "ISO-8859-14") diff --git a/lib/edbee-lib/vendor/onig/enc/iso_8859_15.c b/lib/edbee-lib/vendor/onig/enc/iso_8859_15.c new file mode 100644 index 00000000..575308c8 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/iso_8859_15.c @@ -0,0 +1,265 @@ +/********************************************************************** + iso8859_15.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" +#include "iso_8859.h" + +#define ENC_ISO_8859_15_TO_LOWER_CASE(c) EncISO_8859_15_ToLowerCaseTable[c] +#define ENC_IS_ISO_8859_15_CTYPE(code, ctype) \ + ((EncISO_8859_15_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const UChar EncISO_8859_15_ToLowerCaseTable[256] + = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\241', + '\242', '\243', '\244', '\245', '\250', '\247', '\250', '\251', '\252', + '\253', '\254', '\255', '\256', '\257', '\260', '\261', '\262', '\263', + '\270', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\275', + '\275', '\377', '\277', '\340', '\341', '\342', '\343', '\344', '\345', + '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', + '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327', + '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', '\340', + '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', + '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', + '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', + '\374', '\375', '\376', '\377'}; + +static const unsigned short EncISO_8859_15_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0284, 0x01a0, + 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x34a2, 0x00a0, 0x30e2, 0x00a0, 0x30e2, + 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x10a0, 0x10a0, + 0x34a2, 0x30e2, 0x00a0, 0x01a0, 0x30e2, 0x10a0, 0x30e2, 0x01a0, 0x34a2, + 0x30e2, 0x34a2, 0x01a0, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2}; + +static int mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end ARG_UNUSED, UChar *lower, + OnigEncoding enc ARG_UNUSED) +{ + const UChar *p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) + { + *lower++ = 's'; + *lower = 's'; + (*pp)++; + return 2; + } + + *lower = ENC_ISO_8859_15_TO_LOWER_CASE(*p); + (*pp)++; + return 1; /* return byte length of converted char to lower */ +} + +#if 0 +static int +is_mbc_ambiguous(OnigCaseFoldType flag, + const UChar** pp, const UChar* end) +{ + int v; + const UChar* p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) { + (*pp)++; + return TRUE; + } + + (*pp)++; + v = (EncISO_8859_15_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + if ((v | BIT_CTYPE_LOWER) != 0) { + /* 0xdf etc.. are lower case letter, but can't convert. */ + if (*p == 0xaa || *p == 0xb5 || *p == 0xba) + return FALSE; + else + return TRUE; + } + + return (v != 0 ? TRUE : FALSE); +} +#endif + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_ISO_8859_15_CTYPE(code, ctype); + else + return FALSE; +} + +static const OnigPairCaseFoldCodes CaseFoldMap[] + = {{0xa6, 0xa8}, + + {0xb4, 0xb8}, {0xbc, 0xbd}, {0xbe, 0xff}, + + {0xc0, 0xe0}, {0xc1, 0xe1}, {0xc2, 0xe2}, {0xc3, 0xe3}, {0xc4, 0xe4}, + {0xc5, 0xe5}, {0xc6, 0xe6}, {0xc7, 0xe7}, {0xc8, 0xe8}, {0xc9, 0xe9}, + {0xca, 0xea}, {0xcb, 0xeb}, {0xcc, 0xec}, {0xcd, 0xed}, {0xce, 0xee}, + {0xcf, 0xef}, + + {0xd0, 0xf0}, {0xd1, 0xf1}, {0xd2, 0xf2}, {0xd3, 0xf3}, {0xd4, 0xf4}, + {0xd5, 0xf5}, {0xd6, 0xf6}, {0xd8, 0xf8}, {0xd9, 0xf9}, {0xda, 0xfa}, + {0xdb, 0xfb}, {0xdc, 0xfc}, {0xdd, 0xfd}, {0xde, 0xfe}}; + +static int apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_apply_all_case_fold_with_map(numberof(CaseFoldMap), + CaseFoldMap, 1, flag, f, arg); +} + +static int get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_get_case_fold_codes_by_str_with_map( + numberof(CaseFoldMap), CaseFoldMap, 1, flag, p, end, items); +} + +static int case_map(OnigCaseFoldType *flagP, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, OnigUChar *to_end, + const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp < end && to < to_end) + { + code = *(*pp)++; + if (code == SHARP_s) + { + if (flags & ONIGENC_CASE_UPCASE) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 'S'; + code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S'; + } + else if (flags & ONIGENC_CASE_FOLD) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 's'; + code = 's'; + } + } + else if (code == 0xAA || code == 0xBA || code == 0xB5) + ; + else if ((EncISO_8859_15_CtypeTable[code] & BIT_CTYPE_UPPER) + && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) + { + flags |= ONIGENC_CASE_MODIFIED; + code = ENC_ISO_8859_15_TO_LOWER_CASE(code); + } + else if ((EncISO_8859_15_CtypeTable[code] & BIT_CTYPE_LOWER) + && (flags & ONIGENC_CASE_UPCASE)) + { + flags |= ONIGENC_CASE_MODIFIED; + if (code == 0xA8) + code -= 2; + else if (code == 0xB8) + code -= 4; + else if (code == 0xBD) + code -= 1; + else if (code == 0xFF) + code -= 0x41; + else + code -= 0x20; + } + *to++ = code; + if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase + for capitalize */ + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE); + } + *flagP = flags; + return (int)(to - to_start); +} + +OnigEncodingDefine(iso_8859_15, ISO_8859_15) = { + onigenc_single_byte_mbc_enc_len, + "ISO-8859-15", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + mbc_case_fold, + apply_all_case_fold, + get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("ISO8859-15", "ISO-8859-15") diff --git a/lib/edbee-lib/vendor/onig/enc/iso_8859_16.c b/lib/edbee-lib/vendor/onig/enc/iso_8859_16.c new file mode 100644 index 00000000..c28e47ae --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/iso_8859_16.c @@ -0,0 +1,263 @@ +/********************************************************************** + iso8859_16.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" +#include "iso_8859.h" + +#define ENC_ISO_8859_16_TO_LOWER_CASE(c) EncISO_8859_16_ToLowerCaseTable[c] +#define ENC_IS_ISO_8859_16_CTYPE(code, ctype) \ + ((EncISO_8859_16_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const UChar EncISO_8859_16_ToLowerCaseTable[256] + = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\242', + '\242', '\263', '\245', '\245', '\250', '\247', '\250', '\251', '\272', + '\253', '\256', '\255', '\256', '\277', '\260', '\261', '\271', '\263', + '\270', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\275', + '\275', '\377', '\277', '\340', '\341', '\342', '\343', '\344', '\345', + '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', + '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', + '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', '\340', + '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', + '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', + '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', + '\374', '\375', '\376', '\377'}; + +static const unsigned short EncISO_8859_16_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0284, 0x34a2, + 0x30e2, 0x34a2, 0x00a0, 0x01a0, 0x34a2, 0x00a0, 0x30e2, 0x00a0, 0x34a2, + 0x01a0, 0x34a2, 0x01a0, 0x30e2, 0x34a2, 0x00a0, 0x00a0, 0x34a2, 0x30e2, + 0x34a2, 0x01a0, 0x00a0, 0x01a0, 0x30e2, 0x30e2, 0x30e2, 0x01a0, 0x34a2, + 0x30e2, 0x34a2, 0x30e2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2}; + +static int mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end ARG_UNUSED, UChar *lower, + OnigEncoding enc ARG_UNUSED) +{ + const UChar *p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) + { + *lower++ = 's'; + *lower = 's'; + (*pp)++; + return 2; + } + + *lower = ENC_ISO_8859_16_TO_LOWER_CASE(*p); + (*pp)++; + return 1; /* return byte length of converted char to lower */ +} + +#if 0 +static int +is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end) +{ + int v; + const UChar* p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) { + (*pp)++; + return TRUE; + } + + (*pp)++; + v = (EncISO_8859_16_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + if ((v | BIT_CTYPE_LOWER) != 0) { + return TRUE; + } + + return (v != 0 ? TRUE : FALSE); +} +#endif + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_ISO_8859_16_CTYPE(code, ctype); + else + return FALSE; +} + +static const OnigPairCaseFoldCodes CaseFoldMap[] + = {{0xa1, 0xa2}, {0xa3, 0xb3}, {0xa6, 0xa8}, {0xaa, 0xba}, {0xac, 0xae}, + {0xaf, 0xbf}, + + {0xb2, 0xb9}, {0xb4, 0xb8}, {0xbc, 0xbd}, {0xbe, 0xff}, + + {0xc0, 0xe0}, {0xc1, 0xe1}, {0xc2, 0xe2}, {0xc3, 0xe3}, {0xc4, 0xe4}, + {0xc5, 0xe5}, {0xc6, 0xe6}, {0xc7, 0xe7}, {0xc8, 0xe8}, {0xc9, 0xe9}, + {0xca, 0xea}, {0xcb, 0xeb}, {0xcc, 0xec}, {0xcd, 0xed}, {0xce, 0xee}, + {0xcf, 0xef}, + + {0xd0, 0xf0}, {0xd1, 0xf1}, {0xd2, 0xf2}, {0xd3, 0xf3}, {0xd4, 0xf4}, + {0xd5, 0xf5}, {0xd6, 0xf6}, {0xd7, 0xf7}, {0xd8, 0xf8}, {0xd9, 0xf9}, + {0xda, 0xfa}, {0xdb, 0xfb}, {0xdc, 0xfc}, {0xdd, 0xfd}, {0xde, 0xfe}}; + +static int apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_apply_all_case_fold_with_map(numberof(CaseFoldMap), + CaseFoldMap, 1, flag, f, arg); +} + +static int get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_get_case_fold_codes_by_str_with_map( + numberof(CaseFoldMap), CaseFoldMap, 1, flag, p, end, items); +} + +static int case_map(OnigCaseFoldType *flagP, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, OnigUChar *to_end, + const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp < end && to < to_end) + { + code = *(*pp)++; + if (code == SHARP_s) + { + if (flags & ONIGENC_CASE_UPCASE) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 'S'; + code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S'; + } + else if (flags & ONIGENC_CASE_FOLD) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 's'; + code = 's'; + } + } + else if ((EncISO_8859_16_CtypeTable[code] & BIT_CTYPE_UPPER) + && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) + { + flags |= ONIGENC_CASE_MODIFIED; + code = ENC_ISO_8859_16_TO_LOWER_CASE(code); + } + else if ((EncISO_8859_16_CtypeTable[code] & BIT_CTYPE_LOWER) + && (flags & ONIGENC_CASE_UPCASE)) + { + flags |= ONIGENC_CASE_MODIFIED; + if (code == 0xA2 || code == 0xBD) + code--; + else if (code == 0xB3 || code == 0xBA || code == 0xBF) + code -= 0x10; + else if (code == 0xA8 || code == 0xAE) + code -= 0x02; + else if (code == 0xB9) + code -= 0x07; + else if (code == 0xB8) + code -= 0x04; + else if (code == 0xFF) + code -= 0x41; + else + code -= 0x20; + } + *to++ = code; + if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase + for capitalize */ + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE); + } + *flagP = flags; + return (int)(to - to_start); +} + +OnigEncodingDefine(iso_8859_16, ISO_8859_16) = { + onigenc_single_byte_mbc_enc_len, + "ISO-8859-16", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + mbc_case_fold, + apply_all_case_fold, + get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("ISO8859-16", "ISO-8859-16") diff --git a/lib/edbee-lib/vendor/onig/enc/iso_8859_2.c b/lib/edbee-lib/vendor/onig/enc/iso_8859_2.c new file mode 100644 index 00000000..3ab8bd52 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/iso_8859_2.c @@ -0,0 +1,256 @@ +/********************************************************************** + iso8859_2.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" +#include "iso_8859.h" + +#define ENC_ISO_8859_2_TO_LOWER_CASE(c) EncISO_8859_2_ToLowerCaseTable[c] +#define ENC_IS_ISO_8859_2_CTYPE(code, ctype) \ + ((EncISO_8859_2_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const UChar EncISO_8859_2_ToLowerCaseTable[256] + = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\261', + '\242', '\263', '\244', '\265', '\266', '\247', '\250', '\271', '\272', + '\273', '\274', '\255', '\276', '\277', '\260', '\261', '\262', '\263', + '\264', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\274', + '\275', '\276', '\277', '\340', '\341', '\342', '\343', '\344', '\345', + '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', + '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327', + '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', '\340', + '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', + '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', + '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', + '\374', '\375', '\376', '\377'}; + +static const unsigned short EncISO_8859_2_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0284, 0x34a2, + 0x00a0, 0x34a2, 0x00a0, 0x34a2, 0x34a2, 0x00a0, 0x00a0, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x01a0, 0x34a2, 0x34a2, 0x00a0, 0x30e2, 0x00a0, 0x30e2, + 0x00a0, 0x30e2, 0x30e2, 0x00a0, 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x00a0, 0x30e2, 0x30e2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x00a0}; + +static int mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end ARG_UNUSED, UChar *lower, + OnigEncoding enc ARG_UNUSED) +{ + const UChar *p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) + { + *lower++ = 's'; + *lower = 's'; + (*pp)++; + return 2; + } + + *lower = ENC_ISO_8859_2_TO_LOWER_CASE(*p); + (*pp)++; + return 1; /* return byte length of converted char to lower */ +} + +#if 0 +static int +is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end) +{ + int v; + const UChar* p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) { + (*pp)++; + return TRUE; + } + + (*pp)++; + v = (EncISO_8859_2_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + if ((v | BIT_CTYPE_LOWER) != 0) { + return TRUE; + } + + return (v != 0 ? TRUE : FALSE); +} +#endif + +static const OnigPairCaseFoldCodes CaseFoldMap[] + = {{0xa1, 0xb1}, {0xa3, 0xb3}, {0xa5, 0xb5}, {0xa6, 0xb6}, {0xa9, 0xb9}, + {0xaa, 0xba}, {0xab, 0xbb}, {0xac, 0xbc}, {0xae, 0xbe}, {0xaf, 0xbf}, + + {0xc0, 0xe0}, {0xc1, 0xe1}, {0xc2, 0xe2}, {0xc3, 0xe3}, {0xc4, 0xe4}, + {0xc5, 0xe5}, {0xc6, 0xe6}, {0xc7, 0xe7}, {0xc8, 0xe8}, {0xc9, 0xe9}, + {0xca, 0xea}, {0xcb, 0xeb}, {0xcc, 0xec}, {0xcd, 0xed}, {0xce, 0xee}, + {0xcf, 0xef}, + + {0xd0, 0xf0}, {0xd1, 0xf1}, {0xd2, 0xf2}, {0xd3, 0xf3}, {0xd4, 0xf4}, + {0xd5, 0xf5}, {0xd6, 0xf6}, {0xd8, 0xf8}, {0xd9, 0xf9}, {0xda, 0xfa}, + {0xdb, 0xfb}, {0xdc, 0xfc}, {0xdd, 0xfd}, {0xde, 0xfe}}; + +static int apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_apply_all_case_fold_with_map(numberof(CaseFoldMap), + CaseFoldMap, 1, flag, f, arg); +} + +static int get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_get_case_fold_codes_by_str_with_map( + numberof(CaseFoldMap), CaseFoldMap, 1, flag, p, end, items); +} + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_ISO_8859_2_CTYPE(code, ctype); + else + return FALSE; +} + +static int case_map(OnigCaseFoldType *flagP, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, OnigUChar *to_end, + const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp < end && to < to_end) + { + code = *(*pp)++; + if (code == SHARP_s) + { + if (flags & ONIGENC_CASE_UPCASE) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 'S'; + code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S'; + } + else if (flags & ONIGENC_CASE_FOLD) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 's'; + code = 's'; + } + } + else if ((EncISO_8859_2_CtypeTable[code] & BIT_CTYPE_UPPER) + && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) + { + flags |= ONIGENC_CASE_MODIFIED; + code = ENC_ISO_8859_2_TO_LOWER_CASE(code); + } + else if ((EncISO_8859_2_CtypeTable[code] & BIT_CTYPE_LOWER) + && (flags & ONIGENC_CASE_UPCASE)) + { + if (code >= 0xB1 && code <= 0xBF) + { + flags |= ONIGENC_CASE_MODIFIED; + code -= 0x10; + } + else + { + flags |= ONIGENC_CASE_MODIFIED; + code -= 0x20; + } + } + *to++ = code; + if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase + for capitalize */ + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE); + } + *flagP = flags; + return (int)(to - to_start); +} + +OnigEncodingDefine(iso_8859_2, ISO_8859_2) = { + onigenc_single_byte_mbc_enc_len, + "ISO-8859-2", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + mbc_case_fold, + apply_all_case_fold, + get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("ISO8859-2", "ISO-8859-2") diff --git a/lib/edbee-lib/vendor/onig/enc/iso_8859_3.c b/lib/edbee-lib/vendor/onig/enc/iso_8859_3.c new file mode 100644 index 00000000..ebd438b7 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/iso_8859_3.c @@ -0,0 +1,296 @@ +/********************************************************************** + iso8859_3.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" +#include "iso_8859.h" + +#define ENC_ISO_8859_3_TO_LOWER_CASE(c) EncISO_8859_3_ToLowerCaseTable[c] +#define ENC_IS_ISO_8859_3_CTYPE(code, ctype) \ + ((EncISO_8859_3_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const UChar EncISO_8859_3_ToLowerCaseTable[256] + = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\261', + '\242', '\243', '\244', '\245', '\266', '\247', '\250', '\151', '\272', + '\273', '\274', '\255', '\256', '\277', '\260', '\261', '\262', '\263', + '\264', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\274', + '\275', '\276', '\277', '\340', '\341', '\342', '\303', '\344', '\345', + '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', + '\357', '\320', '\361', '\362', '\363', '\364', '\365', '\366', '\327', + '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', '\340', + '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', + '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', + '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', + '\374', '\375', '\376', '\377'}; + +static const unsigned short EncISO_8859_3_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0284, 0x34a2, + 0x00a0, 0x00a0, 0x00a0, 0x0000, 0x34a2, 0x00a0, 0x00a0, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x01a0, 0x0000, 0x34a2, 0x00a0, 0x30e2, 0x10a0, 0x10a0, + 0x00a0, 0x30e2, 0x30e2, 0x01a0, 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x11a0, 0x0000, 0x30e2, 0x34a2, 0x34a2, 0x34a2, 0x0000, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x0000, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x0000, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x0000, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x00a0}; + +static int mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end ARG_UNUSED, UChar *lower, + OnigEncoding enc ARG_UNUSED) +{ + const UChar *p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) + { + *lower++ = 's'; + *lower = 's'; + (*pp)++; + return 2; + } + + *lower = ENC_ISO_8859_3_TO_LOWER_CASE(*p); + (*pp)++; + return 1; +} + +#if 0 +static int +is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end) +{ + int v; + const UChar* p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) { + (*pp)++; + return TRUE; + } + + (*pp)++; + v = (EncISO_8859_3_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + if ((v | BIT_CTYPE_LOWER) != 0) { + /* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */ + if (*p == 0xb5) + return FALSE; + else + return TRUE; + } + + return (v != 0 ? TRUE : FALSE); +} +#endif + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_ISO_8859_3_CTYPE(code, ctype); + else + return FALSE; +} + +static const OnigPairCaseFoldCodes CaseFoldMap[] + = {{0xa1, 0xb1}, + {0xa6, 0xb6}, + /*{ 0xa9, 0xb9 }, exclude dotless i/I with dot; not a case pair */ + {0xaa, 0xba}, + {0xab, 0xbb}, + {0xac, 0xbc}, + {0xaf, 0xbf}, + + {0xc0, 0xe0}, + {0xc1, 0xe1}, + {0xc2, 0xe2}, + {0xc4, 0xe4}, + {0xc5, 0xe5}, + {0xc6, 0xe6}, + {0xc7, 0xe7}, + {0xc8, 0xe8}, + {0xc9, 0xe9}, + {0xca, 0xea}, + {0xcb, 0xeb}, + {0xcc, 0xec}, + {0xcd, 0xed}, + {0xce, 0xee}, + {0xcf, 0xef}, + + {0xd1, 0xf1}, + {0xd2, 0xf2}, + {0xd3, 0xf3}, + {0xd4, 0xf4}, + {0xd5, 0xf5}, + {0xd6, 0xf6}, + {0xd8, 0xf8}, + {0xd9, 0xf9}, + {0xda, 0xfa}, + {0xdb, 0xfb}, + {0xdc, 0xfc}, + {0xdd, 0xfd}, + {0xde, 0xfe}}; + +static int apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_apply_all_case_fold_with_map(numberof(CaseFoldMap), + CaseFoldMap, 1, flag, f, arg); +} + +static int get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_get_case_fold_codes_by_str_with_map( + numberof(CaseFoldMap), CaseFoldMap, 1, flag, p, end, items); +} + +#define DOTLESS_i (0xB9) +#define I_WITH_DOT_ABOVE (0xA9) +static int case_map(OnigCaseFoldType *flagP, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, OnigUChar *to_end, + const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp < end && to < to_end) + { + code = *(*pp)++; + if (code == SHARP_s) + { + if (flags & ONIGENC_CASE_UPCASE) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 'S'; + code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S'; + } + else if (flags & ONIGENC_CASE_FOLD) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 's'; + code = 's'; + } + } + else if (code == 0xB5) + ; + else if ((EncISO_8859_3_CtypeTable[code] & BIT_CTYPE_UPPER) + && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) + { + flags |= ONIGENC_CASE_MODIFIED; + if (code == 'I') + code = flags & ONIGENC_CASE_FOLD_TURKISH_AZERI ? DOTLESS_i : 'i'; + else + code = ENC_ISO_8859_3_TO_LOWER_CASE(code); + } + else if ((EncISO_8859_3_CtypeTable[code] & BIT_CTYPE_LOWER) + && (flags & ONIGENC_CASE_UPCASE)) + { + flags |= ONIGENC_CASE_MODIFIED; + if (code == 'i') + code = flags & ONIGENC_CASE_FOLD_TURKISH_AZERI ? I_WITH_DOT_ABOVE : 'I'; + else if (code == DOTLESS_i) + code = 'I'; + else if (code >= 0xB0 && code <= 0xBF) + { + code -= 0x10; + } + else + { + code -= 0x20; + } + } + *to++ = code; + if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase + for capitalize */ + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE); + } + *flagP = flags; + return (int)(to - to_start); +} + +OnigEncodingDefine(iso_8859_3, ISO_8859_3) = { + onigenc_single_byte_mbc_enc_len, + "ISO-8859-3", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + mbc_case_fold, + apply_all_case_fold, + get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("ISO8859-3", "ISO-8859-3") diff --git a/lib/edbee-lib/vendor/onig/enc/iso_8859_4.c b/lib/edbee-lib/vendor/onig/enc/iso_8859_4.c new file mode 100644 index 00000000..4932a7cb --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/iso_8859_4.c @@ -0,0 +1,261 @@ +/********************************************************************** + iso8859_4.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" +#include "iso_8859.h" + +#define ENC_ISO_8859_4_TO_LOWER_CASE(c) EncISO_8859_4_ToLowerCaseTable[c] +#define ENC_IS_ISO_8859_4_CTYPE(code, ctype) \ + ((EncISO_8859_4_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const UChar EncISO_8859_4_ToLowerCaseTable[256] + = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\261', + '\242', '\263', '\244', '\265', '\266', '\247', '\250', '\271', '\272', + '\273', '\274', '\255', '\276', '\257', '\260', '\261', '\262', '\263', + '\264', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\274', + '\277', '\276', '\277', '\340', '\341', '\342', '\343', '\344', '\345', + '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', + '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327', + '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', '\340', + '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', + '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', + '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', + '\374', '\375', '\376', '\377'}; + +static const unsigned short EncISO_8859_4_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0284, 0x34a2, + 0x30e2, 0x34a2, 0x00a0, 0x34a2, 0x34a2, 0x00a0, 0x00a0, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x01a0, 0x34a2, 0x00a0, 0x00a0, 0x30e2, 0x00a0, 0x30e2, + 0x00a0, 0x30e2, 0x30e2, 0x00a0, 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x34a2, 0x30e2, 0x30e2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x00a0}; + +static int mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end ARG_UNUSED, UChar *lower, + OnigEncoding enc ARG_UNUSED) +{ + const UChar *p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) + { + *lower++ = 's'; + *lower = 's'; + (*pp)++; + return 2; + } + + *lower = ENC_ISO_8859_4_TO_LOWER_CASE(*p); + (*pp)++; + return 1; /* return byte length of converted char to lower */ +} + +#if 0 +static int +is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end) +{ + int v; + const UChar* p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) { + (*pp)++; + return TRUE; + } + + (*pp)++; + v = (EncISO_8859_4_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + if ((v | BIT_CTYPE_LOWER) != 0) { + if (*p == 0xa2) + return FALSE; + else + return TRUE; + } + + return (v != 0 ? TRUE : FALSE); +} +#endif + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_ISO_8859_4_CTYPE(code, ctype); + else + return FALSE; +} + +static const OnigPairCaseFoldCodes CaseFoldMap[] + = {{0xa1, 0xb1}, {0xa3, 0xb3}, {0xa5, 0xb5}, {0xa6, 0xb6}, {0xa9, 0xb9}, + {0xaa, 0xba}, {0xab, 0xbb}, {0xac, 0xbc}, {0xae, 0xbe}, {0xbd, 0xbf}, + + {0xc0, 0xe0}, {0xc1, 0xe1}, {0xc2, 0xe2}, {0xc3, 0xe3}, {0xc4, 0xe4}, + {0xc5, 0xe5}, {0xc6, 0xe6}, {0xc7, 0xe7}, {0xc8, 0xe8}, {0xc9, 0xe9}, + {0xca, 0xea}, {0xcb, 0xeb}, {0xcc, 0xec}, {0xcd, 0xed}, {0xce, 0xee}, + {0xcf, 0xef}, + + {0xd0, 0xf0}, {0xd1, 0xf1}, {0xd2, 0xf2}, {0xd3, 0xf3}, {0xd4, 0xf4}, + {0xd5, 0xf5}, {0xd6, 0xf6}, {0xd8, 0xf8}, {0xd9, 0xf9}, {0xda, 0xfa}, + {0xdb, 0xfb}, {0xdc, 0xfc}, {0xdd, 0xfd}, {0xde, 0xfe}}; + +static int apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_apply_all_case_fold_with_map(numberof(CaseFoldMap), + CaseFoldMap, 1, flag, f, arg); +} + +static int get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_get_case_fold_codes_by_str_with_map( + numberof(CaseFoldMap), CaseFoldMap, 1, flag, p, end, items); +} + +static int case_map(OnigCaseFoldType *flagP, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, OnigUChar *to_end, + const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp < end && to < to_end) + { + code = *(*pp)++; + if (code == SHARP_s) + { + if (flags & ONIGENC_CASE_UPCASE) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 'S'; + code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S'; + } + else if (flags & ONIGENC_CASE_FOLD) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 's'; + code = 's'; + } + } + else if ((EncISO_8859_4_CtypeTable[code] & BIT_CTYPE_UPPER) + && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) + { + flags |= ONIGENC_CASE_MODIFIED; + code = ENC_ISO_8859_4_TO_LOWER_CASE(code); + } + else if (code == 0xA2) + ; + else if ((EncISO_8859_4_CtypeTable[code] & BIT_CTYPE_LOWER) + && (flags & ONIGENC_CASE_UPCASE)) + { + flags |= ONIGENC_CASE_MODIFIED; + if (code >= 0xA0 && code <= 0xBF) + { + if (code == 0xBF) + code -= 0x02; + else + code -= 0x10; + } + else + code -= 0x20; + } + *to++ = code; + if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase + for capitalize */ + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE); + } + *flagP = flags; + return (int)(to - to_start); +} + +OnigEncodingDefine(iso_8859_4, ISO_8859_4) = { + onigenc_single_byte_mbc_enc_len, + "ISO-8859-4", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + mbc_case_fold, + apply_all_case_fold, + get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("ISO8859-4", "ISO-8859-4") diff --git a/lib/edbee-lib/vendor/onig/enc/iso_8859_5.c b/lib/edbee-lib/vendor/onig/enc/iso_8859_5.c new file mode 100644 index 00000000..3a19eeec --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/iso_8859_5.c @@ -0,0 +1,220 @@ +/********************************************************************** + iso8859_5.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" + +#define ENC_ISO_8859_5_TO_LOWER_CASE(c) EncISO_8859_5_ToLowerCaseTable[c] +#define ENC_IS_ISO_8859_5_CTYPE(code, ctype) \ + ((EncISO_8859_5_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const UChar EncISO_8859_5_ToLowerCaseTable[256] + = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\361', + '\362', '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', + '\373', '\374', '\255', '\376', '\377', '\320', '\321', '\322', '\323', + '\324', '\325', '\326', '\327', '\330', '\331', '\332', '\333', '\334', + '\335', '\336', '\337', '\340', '\341', '\342', '\343', '\344', '\345', + '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', + '\357', '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327', + '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337', '\340', + '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', + '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', + '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', + '\374', '\375', '\376', '\377'}; + +static const unsigned short EncISO_8859_5_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0284, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x01a0, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x00a0, 0x30e2, 0x30e2}; + +static int mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end ARG_UNUSED, UChar *lower, + OnigEncoding enc ARG_UNUSED) +{ + const UChar *p = *pp; + + *lower = ENC_ISO_8859_5_TO_LOWER_CASE(*p); + (*pp)++; + return 1; +} + +#if 0 +static int +is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end) +{ + int v; + const UChar* p = *pp; + + (*pp)++; + v = (EncISO_8859_5_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + return (v != 0 ? TRUE : FALSE); +} +#endif + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_ISO_8859_5_CTYPE(code, ctype); + else + return FALSE; +} + +static const OnigPairCaseFoldCodes CaseFoldMap[] + = {{0xa1, 0xf1}, {0xa2, 0xf2}, {0xa3, 0xf3}, {0xa4, 0xf4}, {0xa5, 0xf5}, + {0xa6, 0xf6}, {0xa7, 0xf7}, {0xa8, 0xf8}, {0xa9, 0xf9}, {0xaa, 0xfa}, + {0xab, 0xfb}, {0xac, 0xfc}, {0xae, 0xfe}, {0xaf, 0xff}, + + {0xb0, 0xd0}, {0xb1, 0xd1}, {0xb2, 0xd2}, {0xb3, 0xd3}, {0xb4, 0xd4}, + {0xb5, 0xd5}, {0xb6, 0xd6}, {0xb7, 0xd7}, {0xb8, 0xd8}, {0xb9, 0xd9}, + {0xba, 0xda}, {0xbb, 0xdb}, {0xbc, 0xdc}, {0xbd, 0xdd}, {0xbe, 0xde}, + {0xbf, 0xdf}, + + {0xc0, 0xe0}, {0xc1, 0xe1}, {0xc2, 0xe2}, {0xc3, 0xe3}, {0xc4, 0xe4}, + {0xc5, 0xe5}, {0xc6, 0xe6}, {0xc7, 0xe7}, {0xc8, 0xe8}, {0xc9, 0xe9}, + {0xca, 0xea}, {0xcb, 0xeb}, {0xcc, 0xec}, {0xcd, 0xed}, {0xce, 0xee}, + {0xcf, 0xef}}; + +static int apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_apply_all_case_fold_with_map(numberof(CaseFoldMap), + CaseFoldMap, 0, flag, f, arg); +} + +static int get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_get_case_fold_codes_by_str_with_map( + numberof(CaseFoldMap), CaseFoldMap, 0, flag, p, end, items); +} + +static int case_map(OnigCaseFoldType *flagP, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, OnigUChar *to_end, + const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp < end && to < to_end) + { + code = *(*pp)++; + if ((EncISO_8859_5_CtypeTable[code] & BIT_CTYPE_UPPER) + && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) + { + flags |= ONIGENC_CASE_MODIFIED; + code = ENC_ISO_8859_5_TO_LOWER_CASE(code); + } + else if ((EncISO_8859_5_CtypeTable[code] & BIT_CTYPE_LOWER) + && (flags & ONIGENC_CASE_UPCASE)) + { + flags |= ONIGENC_CASE_MODIFIED; + if (0xF1 <= code && code <= 0xFF) + code -= 0x50; + else + code -= 0x20; + } + *to++ = code; + if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase + for capitalize */ + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE); + } + *flagP = flags; + return (int)(to - to_start); +} + +OnigEncodingDefine(iso_8859_5, ISO_8859_5) = { + onigenc_single_byte_mbc_enc_len, + "ISO-8859-5", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + mbc_case_fold, + apply_all_case_fold, + get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("ISO8859-5", "ISO-8859-5") diff --git a/lib/edbee-lib/vendor/onig/enc/iso_8859_6.c b/lib/edbee-lib/vendor/onig/enc/iso_8859_6.c new file mode 100644 index 00000000..afed6d44 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/iso_8859_6.c @@ -0,0 +1,106 @@ +/********************************************************************** + iso8859_6.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" + +#define ENC_IS_ISO_8859_6_CTYPE(code, ctype) \ + ((EncISO_8859_6_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const unsigned short EncISO_8859_6_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0284, 0x0000, + 0x0000, 0x0000, 0x00a0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x01a0, 0x01a0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x01a0, 0x0000, + 0x0000, 0x0000, 0x01a0, 0x0000, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, + 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, + 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, + 0x30a2, 0x30a2, 0x30a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x30a2, + 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, + 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000}; + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_ISO_8859_6_CTYPE(code, ctype); + else + return FALSE; +} + +OnigEncodingDefine(iso_8859_6, ISO_8859_6) = { + onigenc_single_byte_mbc_enc_len, + "ISO-8859-6", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + onigenc_ascii_mbc_case_fold, + onigenc_ascii_apply_all_case_fold, + onigenc_ascii_get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + onigenc_single_byte_ascii_only_case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("ISO8859-6", "ISO-8859-6") + +/* + * Name: windows-1256 + * MIBenum: 2256 + * Link: http://www.iana.org/assignments/character-sets + * Link: http://www.microsoft.com/globaldev/reference/sbcs/1256.mspx + * Link: http://en.wikipedia.org/wiki/Windows-1256 + */ +ENC_REPLICATE("Windows-1256", "ISO-8859-6") +ENC_ALIAS("CP1256", "Windows-1256") diff --git a/lib/edbee-lib/vendor/onig/enc/iso_8859_7.c b/lib/edbee-lib/vendor/onig/enc/iso_8859_7.c new file mode 100644 index 00000000..dd03e405 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/iso_8859_7.c @@ -0,0 +1,256 @@ +/********************************************************************** + iso8859_7.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" + +#define ENC_ISO_8859_7_TO_LOWER_CASE(c) EncISO_8859_7_ToLowerCaseTable[c] +#define ENC_IS_ISO_8859_7_CTYPE(code, ctype) \ + ((EncISO_8859_7_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const UChar EncISO_8859_7_ToLowerCaseTable[256] + = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\241', + '\242', '\243', '\244', '\245', '\246', '\247', '\250', '\251', '\252', + '\253', '\254', '\255', '\256', '\257', '\260', '\261', '\262', '\263', + '\264', '\265', '\334', '\267', '\335', '\336', '\337', '\273', '\374', + '\275', '\375', '\376', '\300', '\341', '\342', '\343', '\344', '\345', + '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', + '\357', '\360', '\361', '\322', '\363', '\364', '\365', '\366', '\367', + '\370', '\371', '\372', '\373', '\334', '\335', '\336', '\337', '\340', + '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', + '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', + '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', + '\374', '\375', '\376', '\377'}; + +static const unsigned short EncISO_8859_7_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0284, 0x01a0, + 0x01a0, 0x00a0, 0x0000, 0x0000, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x0000, + 0x01a0, 0x00a0, 0x01a0, 0x0000, 0x01a0, 0x00a0, 0x00a0, 0x10a0, 0x10a0, + 0x00a0, 0x00a0, 0x34a2, 0x01a0, 0x34a2, 0x34a2, 0x34a2, 0x01a0, 0x34a2, + 0x10a0, 0x34a2, 0x34a2, 0x30e2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x0000, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x0000}; + +static int mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end ARG_UNUSED, UChar *lower, + OnigEncoding enc ARG_UNUSED) +{ + const UChar *p = *pp; + + *lower = ENC_ISO_8859_7_TO_LOWER_CASE(*p); + (*pp)++; + return 1; +} + +#if 0 +static int +is_mbc_ambiguous(OnigCaseFoldType flag, + const UChar** pp, const UChar* end) +{ + int v; + const UChar* p = *pp; + + (*pp)++; + v = (EncISO_8859_7_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + if ((v | BIT_CTYPE_LOWER) != 0) { + if (*p == 0xc0 || *p == 0xe0) + return FALSE; + else + return TRUE; + } + + return (v != 0 ? TRUE : FALSE); +} +#endif + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_ISO_8859_7_CTYPE(code, ctype); + else + return FALSE; +} + +static const OnigPairCaseFoldCodes CaseFoldMap[] + = {{0xb6, 0xdc}, {0xb8, 0xdd}, {0xb9, 0xde}, {0xba, 0xdf}, {0xbc, 0xfc}, + {0xbe, 0xfd}, {0xbf, 0xfe}, + + {0xc1, 0xe1}, {0xc2, 0xe2}, {0xc3, 0xe3}, {0xc4, 0xe4}, {0xc5, 0xe5}, + {0xc6, 0xe6}, {0xc7, 0xe7}, {0xc8, 0xe8}, {0xc9, 0xe9}, {0xca, 0xea}, + {0xcb, 0xeb}, {0xcc, 0xec}, {0xcd, 0xed}, {0xce, 0xee}, {0xcf, 0xef}, + + {0xd0, 0xf0}, {0xd1, 0xf1}, {0xd2, 0xf2}, {0xd3, 0xf3}, {0xd4, 0xf4}, + {0xd5, 0xf5}, {0xd6, 0xf6}, {0xd7, 0xf7}, {0xd8, 0xf8}, {0xd9, 0xf9}, + {0xda, 0xfa}, {0xdb, 0xfb}}; + +static int apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_apply_all_case_fold_with_map(numberof(CaseFoldMap), + CaseFoldMap, 0, flag, f, arg); +} + +static int get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_get_case_fold_codes_by_str_with_map( + numberof(CaseFoldMap), CaseFoldMap, 0, flag, p, end, items); +} + +static int case_map(OnigCaseFoldType *flagP, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, OnigUChar *to_end, + const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp < end && to < to_end) + { + code = *(*pp)++; + if (code == 0xF2) + { + if (flags & ONIGENC_CASE_UPCASE) + { + flags |= ONIGENC_CASE_MODIFIED; + code = 0xD3; + } + else if (flags & ONIGENC_CASE_FOLD) + { + flags |= ONIGENC_CASE_MODIFIED; + code = 0xF3; + } + } + else if ((EncISO_8859_7_CtypeTable[code] & BIT_CTYPE_UPPER) + && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) + { + flags |= ONIGENC_CASE_MODIFIED; + code = ENC_ISO_8859_7_TO_LOWER_CASE(code); + } + else if (code == 0xC0 || code == 0xE0) + ; + else if ((EncISO_8859_7_CtypeTable[code] & BIT_CTYPE_LOWER) + && (flags & ONIGENC_CASE_UPCASE)) + { + flags |= ONIGENC_CASE_MODIFIED; + if (code == 0xDC) + { + code -= 0x26; + } + else if (code >= 0xDD && code <= 0xDF) + { + code -= 0x25; + } + else if (code == 0xFC) + { + code -= 0x40; + } + else if (code == 0xFD || code == 0xFE) + { + code -= 0x3F; + } + else + { + code -= 0x20; + } + } + *to++ = code; + if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase + for capitalize */ + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE); + } + *flagP = flags; + return (int)(to - to_start); +} + +OnigEncodingDefine(iso_8859_7, ISO_8859_7) = { + onigenc_single_byte_mbc_enc_len, + "ISO-8859-7", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + mbc_case_fold, + apply_all_case_fold, + get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("ISO8859-7", "ISO-8859-7") diff --git a/lib/edbee-lib/vendor/onig/enc/iso_8859_8.c b/lib/edbee-lib/vendor/onig/enc/iso_8859_8.c new file mode 100644 index 00000000..2e4b4fb9 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/iso_8859_8.c @@ -0,0 +1,106 @@ +/********************************************************************** + iso8859_8.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" + +#define ENC_IS_ISO_8859_8_CTYPE(code, ctype) \ + ((EncISO_8859_8_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const unsigned short EncISO_8859_8_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0284, 0x0000, + 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, + 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x10a0, 0x10a0, + 0x00a0, 0x30e2, 0x00a0, 0x01a0, 0x00a0, 0x10a0, 0x00a0, 0x01a0, 0x10a0, + 0x10a0, 0x10a0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x01a0, 0x30a2, + 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, + 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, + 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000}; + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_ISO_8859_8_CTYPE(code, ctype); + else + return FALSE; +} + +OnigEncodingDefine(iso_8859_8, ISO_8859_8) = { + onigenc_single_byte_mbc_enc_len, + "ISO-8859-8", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + onigenc_ascii_mbc_case_fold, + onigenc_ascii_apply_all_case_fold, + onigenc_ascii_get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + onigenc_single_byte_ascii_only_case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("ISO8859-8", "ISO-8859-8") + +/* + * Name: windows-1255 + * MIBenum: 2255 + * Link: http://www.iana.org/assignments/character-sets + * Link: http://www.microsoft.com/globaldev/reference/sbcs/1255.mspx + * Link: http://en.wikipedia.org/wiki/Windows-1255 + */ +ENC_REPLICATE("Windows-1255", "ISO-8859-8") +ENC_ALIAS("CP1255", "Windows-1255") diff --git a/lib/edbee-lib/vendor/onig/enc/iso_8859_9.c b/lib/edbee-lib/vendor/onig/enc/iso_8859_9.c new file mode 100644 index 00000000..826078cf --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/iso_8859_9.c @@ -0,0 +1,284 @@ +/********************************************************************** + iso8859_9.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" +#include "iso_8859.h" + +#define ENC_ISO_8859_9_TO_LOWER_CASE(c) EncISO_8859_9_ToLowerCaseTable[c] +#define ENC_IS_ISO_8859_9_CTYPE(code, ctype) \ + ((EncISO_8859_9_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const UChar EncISO_8859_9_ToLowerCaseTable[256] + = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\241', + '\242', '\243', '\244', '\245', '\246', '\247', '\250', '\251', '\252', + '\253', '\254', '\255', '\256', '\257', '\260', '\261', '\262', '\263', + '\264', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\274', + '\275', '\276', '\277', '\340', '\341', '\342', '\343', '\344', '\345', + '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', + '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327', + '\370', '\371', '\372', '\373', '\374', '\151', '\376', '\337', '\340', + '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', + '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', + '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', + '\374', '\375', '\376', '\377'}; + +static const unsigned short EncISO_8859_9_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0284, 0x01a0, + 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x30e2, + 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x10a0, 0x10a0, + 0x00a0, 0x30e2, 0x00a0, 0x01a0, 0x00a0, 0x10a0, 0x30e2, 0x01a0, 0x10a0, + 0x10a0, 0x10a0, 0x01a0, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2}; + +static int mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end ARG_UNUSED, UChar *lower, + OnigEncoding enc ARG_UNUSED) +{ + const UChar *p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) + { + *lower++ = 's'; + *lower = 's'; + (*pp)++; + return 2; + } + + *lower = ENC_ISO_8859_9_TO_LOWER_CASE(*p); + (*pp)++; + return 1; +} + +#if 0 +static int +is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end) +{ + int v; + const UChar* p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) { + (*pp)++; + return TRUE; + } + + (*pp)++; + v = (EncISO_8859_9_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + if ((v | BIT_CTYPE_LOWER) != 0) { + /* 0xdf etc.. are lower case letter, but can't convert. */ + if (*p >= 0xaa && *p <= 0xba) + return FALSE; + else + return TRUE; + } + + return (v != 0 ? TRUE : FALSE); +} +#endif + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_ISO_8859_9_CTYPE(code, ctype); + else + return FALSE; +} + +static const OnigPairCaseFoldCodes CaseFoldMap[] + = {{0xc0, 0xe0}, + {0xc1, 0xe1}, + {0xc2, 0xe2}, + {0xc3, 0xe3}, + {0xc4, 0xe4}, + {0xc5, 0xe5}, + {0xc6, 0xe6}, + {0xc7, 0xe7}, + {0xc8, 0xe8}, + {0xc9, 0xe9}, + {0xca, 0xea}, + {0xcb, 0xeb}, + {0xcc, 0xec}, + {0xcd, 0xed}, + {0xce, 0xee}, + {0xcf, 0xef}, + + {0xd0, 0xf0}, + {0xd1, 0xf1}, + {0xd2, 0xf2}, + {0xd3, 0xf3}, + {0xd4, 0xf4}, + {0xd5, 0xf5}, + {0xd6, 0xf6}, + {0xd8, 0xf8}, + {0xd9, 0xf9}, + {0xda, 0xfa}, + {0xdb, 0xfb}, + {0xdc, 0xfc}, + /*{ 0xdd, 0xfd }, exclude dotless i/I with dot; not a case pair */ + {0xde, 0xfe}}; + +static int apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_apply_all_case_fold_with_map(numberof(CaseFoldMap), + CaseFoldMap, 1, flag, f, arg); +} + +static int get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_get_case_fold_codes_by_str_with_map( + numberof(CaseFoldMap), CaseFoldMap, 1, flag, p, end, items); +} + +#define DOTLESS_i (0xFD) +#define I_WITH_DOT_ABOVE (0xDD) +static int case_map(OnigCaseFoldType *flagP, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, OnigUChar *to_end, + const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp < end && to < to_end) + { + code = *(*pp)++; + if (code == SHARP_s) + { + if (flags & ONIGENC_CASE_UPCASE) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 'S'; + code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S'; + } + else if (flags & ONIGENC_CASE_FOLD) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 's'; + code = 's'; + } + } + else if (code == 0xAA || code == 0xB5 || code == 0xBA || code == 0xFF) + ; + else if ((EncISO_8859_9_CtypeTable[code] & BIT_CTYPE_UPPER) + && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) + { + flags |= ONIGENC_CASE_MODIFIED; + if (code == 'I') + code = flags & ONIGENC_CASE_FOLD_TURKISH_AZERI ? DOTLESS_i : 'i'; + else + code = ENC_ISO_8859_9_TO_LOWER_CASE(code); + } + else if ((EncISO_8859_9_CtypeTable[code] & BIT_CTYPE_LOWER) + && (flags & ONIGENC_CASE_UPCASE)) + { + flags |= ONIGENC_CASE_MODIFIED; + if (code == 'i') + code = flags & ONIGENC_CASE_FOLD_TURKISH_AZERI ? I_WITH_DOT_ABOVE : 'I'; + else if (code == DOTLESS_i) + code = 'I'; + else + code -= 0x20; + } + *to++ = code; + if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase + for capitalize */ + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE); + } + *flagP = flags; + return (int)(to - to_start); +} + +OnigEncodingDefine(iso_8859_9, ISO_8859_9) = { + onigenc_single_byte_mbc_enc_len, + "ISO-8859-9", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + mbc_case_fold, + apply_all_case_fold, + get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("ISO8859-9", "ISO-8859-9") diff --git a/lib/edbee-lib/vendor/onig/enc/jis/props.h b/lib/edbee-lib/vendor/onig/enc/jis/props.h new file mode 100644 index 00000000..5671db48 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/jis/props.h @@ -0,0 +1,229 @@ +/* C code produced by gperf version 3.0.4 */ +/* Command-line: gperf -k1,3 -7 -c -j1 -i1 -t -C -P -t --ignore-case -H + * onig_jis_property_hash -Q onig_jis_property_pool -N onig_jis_property + * enc/jis/props.kwd */ + +#if !( \ + (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) && ('%' == 37) \ + && ('&' == 38) && ('\'' == 39) && ('(' == 40) && (')' == 41) \ + && ('*' == 42) && ('+' == 43) && (',' == 44) && ('-' == 45) && ('.' == 46) \ + && ('/' == 47) && ('0' == 48) && ('1' == 49) && ('2' == 50) && ('3' == 51) \ + && ('4' == 52) && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) && ('=' == 61) \ + && ('>' == 62) && ('?' == 63) && ('A' == 65) && ('B' == 66) && ('C' == 67) \ + && ('D' == 68) && ('E' == 69) && ('F' == 70) && ('G' == 71) && ('H' == 72) \ + && ('I' == 73) && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) && ('R' == 82) \ + && ('S' == 83) && ('T' == 84) && ('U' == 85) && ('V' == 86) && ('W' == 87) \ + && ('X' == 88) && ('Y' == 89) && ('Z' == 90) && ('[' == 91) \ + && ('\\' == 92) && (']' == 93) && ('^' == 94) && ('_' == 95) \ + && ('a' == 97) && ('b' == 98) && ('c' == 99) && ('d' == 100) \ + && ('e' == 101) && ('f' == 102) && ('g' == 103) && ('h' == 104) \ + && ('i' == 105) && ('j' == 106) && ('k' == 107) && ('l' == 108) \ + && ('m' == 109) && ('n' == 110) && ('o' == 111) && ('p' == 112) \ + && ('q' == 113) && ('r' == 114) && ('s' == 115) && ('t' == 116) \ + && ('u' == 117) && ('v' == 118) && ('w' == 119) && ('x' == 120) \ + && ('y' == 121) && ('z' == 122) && ('{' == 123) && ('|' == 124) \ + && ('}' == 125) && ('~' == 126)) +/* The character set is not based on ISO-646. */ +error "gperf generated tables don't work with this execution character set. " + "Please report a bug to <bug-gnu-gperf@gnu.org>." +#endif + +#line 1 "enc/jis/props.kwd" +/* -*- c -*- */ +#define GPERF_DOWNCASE 1 +#define GPERF_CASE_STRNCMP 1 + + static inline int + gperf_case_strncmp(const char *s1, const char *s2, unsigned int n) +{ + const UChar *str = (const UChar *)s1; + const UChar *s = (const UChar *)s2; + return onigenc_with_ascii_strnicmp(ONIG_ENCODING_ASCII, str, str + n, s, n); +} + +enum onigenc_jis_ctype +{ + onigenc_jis_min = ONIGENC_MAX_STD_CTYPE, + onigenc_jis_hiragana, + onigenc_jis_katakana, + onigenc_jis_han, + onigenc_jis_latin, + onigenc_jis_greek, + onigenc_jis_cyrillic, + onigenc_jis_max +}; + +enum +{ + PropertyListNum = onigenc_jis_max - onigenc_jis_min - 1 +}; + +static const OnigCodePoint *const PropertyList[PropertyListNum] = { + CR_Hiragana, CR_Katakana, CR_Han, CR_Latin, CR_Greek, CR_Cyrillic, +}; + +struct enc_property +{ + signed char name; + unsigned char ctype; +}; + +static const struct enc_property *onig_jis_property(const char *str, + unsigned int len); +#line 43 "enc/jis/props.kwd" +struct enc_property; + +#define TOTAL_KEYWORDS 6 +#define MIN_WORD_LENGTH 3 +#define MAX_WORD_LENGTH 8 +#define MIN_HASH_VALUE 5 +#define MAX_HASH_VALUE 12 +/* maximum key range = 8, duplicates = 0 */ + +#ifndef GPERF_DOWNCASE +# define GPERF_DOWNCASE 1 +static unsigned char gperf_downcase[256] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255}; +#endif + +#ifndef GPERF_CASE_STRNCMP +# define GPERF_CASE_STRNCMP 1 +static int gperf_case_strncmp(s1, s2, n) +register const char *s1; +register const char *s2; +register unsigned int n; +{ + for (; n > 0;) + { + unsigned char c1 = gperf_downcase[(unsigned char)*s1++]; + unsigned char c2 = gperf_downcase[(unsigned char)*s2++]; + if (c1 != 0 && c1 == c2) + { + n--; + continue; + } + return (int)c1 - (int)c2; + } + return 0; +} +#endif + +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ + || defined(__cplusplus) || defined(__GNUC_STDC_INLINE__) +inline +#elif defined(__GNUC__) +__inline +#endif + static unsigned int + onig_jis_property_hash(str, len) +register const char *str; +register unsigned int len; +{ + static const unsigned char asso_values[] + = {13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 3, 13, 2, 13, 1, 1, 13, 13, 2, 1, 13, 1, 13, + 13, 13, 1, 13, 1, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 3, 13, 2, 13, 1, 1, 13, 13, 2, 1, 13, 1, 13, + 13, 13, 1, 13, 1, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13}; + return len + asso_values[(unsigned char)str[2]] + + asso_values[(unsigned char)str[0]]; +} + +struct onig_jis_property_pool_t +{ + char onig_jis_property_pool_str5[sizeof("han")]; + char onig_jis_property_pool_str7[sizeof("latin")]; + char onig_jis_property_pool_str8[sizeof("greek")]; + char onig_jis_property_pool_str10[sizeof("hiragana")]; + char onig_jis_property_pool_str11[sizeof("katakana")]; + char onig_jis_property_pool_str12[sizeof("cyrillic")]; +}; +static const struct onig_jis_property_pool_t onig_jis_property_pool_contents + = {"han", "latin", "greek", "hiragana", "katakana", "cyrillic"}; +#define onig_jis_property_pool ((const char *)&onig_jis_property_pool_contents) +#ifdef __GNUC__ +__inline +# if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ + __attribute__((__gnu_inline__)) +# endif +#endif + const struct enc_property * + onig_jis_property(str, len) +register const char *str; +register unsigned int len; +{ + static const struct enc_property wordlist[] + = {{-1}, + {-1}, + {-1}, + {-1}, + {-1}, +#line 48 "enc/jis/props.kwd" + {(char)offsetof(struct onig_jis_property_pool_t, + onig_jis_property_pool_str5), + onigenc_jis_han}, + {-1}, +#line 49 "enc/jis/props.kwd" + {(char)offsetof(struct onig_jis_property_pool_t, + onig_jis_property_pool_str7), + onigenc_jis_latin}, +#line 50 "enc/jis/props.kwd" + {(char)offsetof(struct onig_jis_property_pool_t, + onig_jis_property_pool_str8), + onigenc_jis_greek}, + {-1}, +#line 46 "enc/jis/props.kwd" + {(char)offsetof(struct onig_jis_property_pool_t, + onig_jis_property_pool_str10), + onigenc_jis_hiragana}, +#line 47 "enc/jis/props.kwd" + {(char)offsetof(struct onig_jis_property_pool_t, + onig_jis_property_pool_str11), + onigenc_jis_katakana}, +#line 51 "enc/jis/props.kwd" + {(char)offsetof(struct onig_jis_property_pool_t, + onig_jis_property_pool_str12), + onigenc_jis_cyrillic}}; + + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = onig_jis_property_hash(str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register int o = wordlist[key].name; + if (o >= 0) + { + register const char *s = o + onig_jis_property_pool; + + if ((((unsigned char)*str ^ (unsigned char)*s) & ~32) == 0 + && !gperf_case_strncmp(str, s, len) && s[len] == '\0') + return &wordlist[key]; + } + } + } + return 0; +} +#line 52 "enc/jis/props.kwd" diff --git a/lib/edbee-lib/vendor/onig/enc/jis/props.kwd b/lib/edbee-lib/vendor/onig/enc/jis/props.kwd new file mode 100644 index 00000000..f3235c01 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/jis/props.kwd @@ -0,0 +1,52 @@ +%{/* -*- c -*- */ +#define GPERF_DOWNCASE 1 +#define GPERF_CASE_STRNCMP 1 + +static inline int +gperf_case_strncmp(const char *s1, const char *s2, unsigned int n) +{ + const UChar *str = (const UChar *)s1; + const UChar *s = (const UChar *)s2; + return onigenc_with_ascii_strnicmp(ONIG_ENCODING_ASCII, str, str + n, s, n); +} + +enum onigenc_jis_ctype { + onigenc_jis_min = ONIGENC_MAX_STD_CTYPE, + onigenc_jis_hiragana, + onigenc_jis_katakana, + onigenc_jis_han, + onigenc_jis_latin, + onigenc_jis_greek, + onigenc_jis_cyrillic, + onigenc_jis_max +}; + +enum {PropertyListNum = onigenc_jis_max - onigenc_jis_min - 1}; + +static const OnigCodePoint* const PropertyList[PropertyListNum] = { + CR_Hiragana, + CR_Katakana, + CR_Han, + CR_Latin, + CR_Greek, + CR_Cyrillic, +}; + +struct enc_property { + signed char name; + unsigned char ctype; +}; + +static const struct enc_property *onig_jis_property(const char *str, unsigned int len); +%} + +struct enc_property; + +%% +hiragana, onigenc_jis_hiragana +katakana, onigenc_jis_katakana +han, onigenc_jis_han +latin, onigenc_jis_latin +greek, onigenc_jis_greek +cyrillic, onigenc_jis_cyrillic +%% diff --git a/lib/edbee-lib/vendor/onig/enc/koi8_r.c b/lib/edbee-lib/vendor/onig/enc/koi8_r.c new file mode 100644 index 00000000..c9889f18 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/koi8_r.c @@ -0,0 +1,184 @@ +/********************************************************************** + koi8_r.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" + +#define ENC_KOI8_R_TO_LOWER_CASE(c) EncKOI8_R_ToLowerCaseTable[c] +#define ENC_IS_KOI8_R_CTYPE(code, ctype) \ + ((EncKOI8_R_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const UChar EncKOI8_R_ToLowerCaseTable[256] + = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\241', + '\242', '\243', '\244', '\245', '\246', '\247', '\250', '\251', '\252', + '\253', '\254', '\255', '\256', '\257', '\260', '\261', '\262', '\243', + '\264', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\274', + '\275', '\276', '\277', '\300', '\301', '\302', '\303', '\304', '\305', + '\306', '\307', '\310', '\311', '\312', '\313', '\314', '\315', '\316', + '\317', '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327', + '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337', '\300', + '\301', '\302', '\303', '\304', '\305', '\306', '\307', '\310', '\311', + '\312', '\313', '\314', '\315', '\316', '\317', '\320', '\321', '\322', + '\323', '\324', '\325', '\326', '\327', '\330', '\331', '\332', '\333', + '\334', '\335', '\336', '\337'}; + +static const unsigned short EncKOI8_R_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, + 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, + 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, + 0x00a0, 0x0284, 0x00a0, 0x00a0, 0x10a0, 0x01a0, 0x00a0, 0x00a0, 0x00a0, + 0x00a0, 0x30e2, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, + 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x34a2, + 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, + 0x00a0, 0x00a0, 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2}; + +static int koi8_r_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED, + const UChar **pp, const UChar *end ARG_UNUSED, + UChar *lower, OnigEncoding enc ARG_UNUSED) +{ + const UChar *p = *pp; + + *lower = ENC_KOI8_R_TO_LOWER_CASE(*p); + (*pp)++; + return 1; +} + +#if 0 +static int +koi8_r_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, + const UChar* end, OnigEncoding enc ARG_UNUSED) +{ + int v; + const UChar* p = *pp; + + (*pp)++; + v = (EncKOI8_R_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + return (v != 0 ? TRUE : FALSE); +} +#endif + +static int koi8_r_is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_KOI8_R_CTYPE(code, ctype); + else + return FALSE; +} + +static const OnigPairCaseFoldCodes CaseFoldMap[] + = {{0xa3, 0xb3}, + + {0xc0, 0xe0}, {0xc1, 0xe1}, {0xc2, 0xe2}, {0xc3, 0xe3}, + {0xc4, 0xe4}, {0xc5, 0xe5}, {0xc6, 0xe6}, {0xc7, 0xe7}, + {0xc8, 0xe8}, {0xc9, 0xe9}, {0xca, 0xea}, {0xcb, 0xeb}, + {0xcc, 0xec}, {0xcd, 0xed}, {0xce, 0xee}, {0xcf, 0xef}, + + {0xd0, 0xf0}, {0xd1, 0xf1}, {0xd2, 0xf2}, {0xd3, 0xf3}, + {0xd4, 0xf4}, {0xd5, 0xf5}, {0xd6, 0xf6}, {0xd7, 0xf7}, + {0xd8, 0xf8}, {0xd9, 0xf9}, {0xda, 0xfa}, {0xdb, 0xfb}, + {0xdc, 0xfc}, {0xdd, 0xfd}, {0xde, 0xfe}, {0xdf, 0xff}}; + +static int koi8_r_apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_apply_all_case_fold_with_map(numberof(CaseFoldMap), + CaseFoldMap, 0, flag, f, arg); +} + +static int koi8_r_get_case_fold_codes_by_str(OnigCaseFoldType flag, + const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_get_case_fold_codes_by_str_with_map( + numberof(CaseFoldMap), CaseFoldMap, 0, flag, p, end, items); +} + +OnigEncodingDefine(koi8_r, KOI8_R) = { + onigenc_single_byte_mbc_enc_len, + "KOI8-R", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + koi8_r_mbc_case_fold, + koi8_r_apply_all_case_fold, + koi8_r_get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + koi8_r_is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + onigenc_single_byte_ascii_only_case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("CP878", "KOI8-R") diff --git a/lib/edbee-lib/vendor/onig/enc/koi8_u.c b/lib/edbee-lib/vendor/onig/enc/koi8_u.c new file mode 100644 index 00000000..3aeca3a9 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/koi8_u.c @@ -0,0 +1,183 @@ +/********************************************************************** + koi8_u.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" + +#define ENC_KOI8_U_TO_LOWER_CASE(c) EncKOI8_U_ToLowerCaseTable[c] +#define ENC_IS_KOI8_U_CTYPE(code, ctype) \ + ((EncKOI8_U_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const UChar EncKOI8_U_ToLowerCaseTable[256] + = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\241', + '\242', '\243', '\244', '\245', '\246', '\247', '\250', '\251', '\252', + '\253', '\254', '\255', '\256', '\257', '\260', '\261', '\262', '\243', + '\244', '\265', '\246', '\247', '\270', '\271', '\272', '\273', '\274', + '\255', '\276', '\277', '\300', '\301', '\302', '\303', '\304', '\305', + '\306', '\307', '\310', '\311', '\312', '\313', '\314', '\315', '\316', + '\317', '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327', + '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337', '\300', + '\301', '\302', '\303', '\304', '\305', '\306', '\307', '\310', '\311', + '\312', '\313', '\314', '\315', '\316', '\317', '\320', '\321', '\322', + '\323', '\324', '\325', '\326', '\327', '\330', '\331', '\332', '\333', + '\334', '\335', '\336', '\337'}; + +static const unsigned short EncKOI8_U_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, + 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, + 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, + 0x00a0, 0x0284, 0x00a0, 0x00a0, 0x10a0, 0x01a0, 0x00a0, 0x00a0, 0x00a0, + 0x00a0, 0x30e2, 0x30e2, 0x00a0, 0x30e2, 0x30e2, 0x00a0, 0x00a0, 0x00a0, + 0x00a0, 0x00a0, 0x30e2, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x34a2, + 0x34a2, 0x00a0, 0x34a2, 0x34a2, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, + 0x34a2, 0x00a0, 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2}; + +static int koi8_u_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED, + const UChar **pp, const UChar *end ARG_UNUSED, + UChar *lower, OnigEncoding enc ARG_UNUSED) +{ + const UChar *p = *pp; + + *lower = ENC_KOI8_U_TO_LOWER_CASE(*p); + (*pp)++; + return 1; +} + +#if 0 +static int +koi8_u_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, + const UChar* end, OnigEncoding enc ARG_UNUSED) +{ + int v; + const UChar* p = *pp; + + (*pp)++; + v = (EncKOI8_U_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + return (v != 0 ? TRUE : FALSE); +} +#endif + +static int koi8_u_is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_KOI8_U_CTYPE(code, ctype); + else + return FALSE; +} + +static const OnigPairCaseFoldCodes CaseFoldMap[] + = {{0xa3, 0xb3}, {0xa4, 0xb4}, {0xa6, 0xb6}, {0xa7, 0xb7}, {0xad, 0xbd}, + + {0xc0, 0xe0}, {0xc1, 0xe1}, {0xc2, 0xe2}, {0xc3, 0xe3}, {0xc4, 0xe4}, + {0xc5, 0xe5}, {0xc6, 0xe6}, {0xc7, 0xe7}, {0xc8, 0xe8}, {0xc9, 0xe9}, + {0xca, 0xea}, {0xcb, 0xeb}, {0xcc, 0xec}, {0xcd, 0xed}, {0xce, 0xee}, + {0xcf, 0xef}, + + {0xd0, 0xf0}, {0xd1, 0xf1}, {0xd2, 0xf2}, {0xd3, 0xf3}, {0xd4, 0xf4}, + {0xd5, 0xf5}, {0xd6, 0xf6}, {0xd7, 0xf7}, {0xd8, 0xf8}, {0xd9, 0xf9}, + {0xda, 0xfa}, {0xdb, 0xfb}, {0xdc, 0xfc}, {0xdd, 0xfd}, {0xde, 0xfe}, + {0xdf, 0xff}}; + +static int koi8_u_apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_apply_all_case_fold_with_map(numberof(CaseFoldMap), + CaseFoldMap, 0, flag, f, arg); +} + +static int koi8_u_get_case_fold_codes_by_str(OnigCaseFoldType flag, + const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_get_case_fold_codes_by_str_with_map( + numberof(CaseFoldMap), CaseFoldMap, 0, flag, p, end, items); +} + +OnigEncodingDefine(koi8_u, KOI8_U) = { + onigenc_single_byte_mbc_enc_len, + "KOI8-U", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + koi8_u_mbc_case_fold, + koi8_u_apply_all_case_fold, + koi8_u_get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + koi8_u_is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + onigenc_single_byte_ascii_only_case_map, + 0, + ONIGENC_FLAG_NONE, +}; diff --git a/lib/edbee-lib/vendor/onig/enc/mktable.c b/lib/edbee-lib/vendor/onig/enc/mktable.c new file mode 100644 index 00000000..aa40453a --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/mktable.c @@ -0,0 +1,1665 @@ +/********************************************************************** + mktable.c +**********************************************************************/ +/*- + * Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <stdlib.h> +#include <stdio.h> +#include <locale.h> + +#ifndef __USE_ISOC99 +# define __USE_ISOC99 +#endif + +#include <ctype.h> + +#include "regenc.h" + +#define ASCII 0 +#define UNICODE_ISO_8859_1 1 +#define ISO_8859_1 2 +#define ISO_8859_2 3 +#define ISO_8859_3 4 +#define ISO_8859_4 5 +#define ISO_8859_5 6 +#define ISO_8859_6 7 +#define ISO_8859_7 8 +#define ISO_8859_8 9 +#define ISO_8859_9 10 +#define ISO_8859_10 11 +#define ISO_8859_11 12 +#define ISO_8859_13 13 +#define ISO_8859_14 14 +#define ISO_8859_15 15 +#define ISO_8859_16 16 +#define KOI8 17 +#define KOI8_R 18 + +typedef struct +{ + int num; + const char *name; +} ENC_INFO; + +static ENC_INFO Info[] = {{ASCII, "ASCII"}, + {UNICODE_ISO_8859_1, "UNICODE_ISO_8859_1"}, + {ISO_8859_1, "ISO_8859_1"}, + {ISO_8859_2, "ISO_8859_2"}, + {ISO_8859_3, "ISO_8859_3"}, + {ISO_8859_4, "ISO_8859_4"}, + {ISO_8859_5, "ISO_8859_5"}, + {ISO_8859_6, "ISO_8859_6"}, + {ISO_8859_7, "ISO_8859_7"}, + {ISO_8859_8, "ISO_8859_8"}, + {ISO_8859_9, "ISO_8859_9"}, + {ISO_8859_10, "ISO_8859_10"}, + {ISO_8859_11, "ISO_8859_11"}, + {ISO_8859_13, "ISO_8859_13"}, + {ISO_8859_14, "ISO_8859_14"}, + {ISO_8859_15, "ISO_8859_15"}, + {ISO_8859_16, "ISO_8859_16"}, + {KOI8, "KOI8"}, + {KOI8_R, "KOI8_R"}}; + +static int IsAlpha(int enc, int c) +{ + if (enc == ASCII) + return isalpha(c); + + if (c >= 0x41 && c <= 0x5a) + return 1; + if (c >= 0x61 && c <= 0x7a) + return 1; + + switch (enc) + { + case UNICODE_ISO_8859_1: + case ISO_8859_1: + case ISO_8859_9: + if (c == 0xaa) + return 1; + if (c == 0xb5) + return 1; + if (c == 0xba) + return 1; + if (c >= 0xc0 && c <= 0xd6) + return 1; + if (c >= 0xd8 && c <= 0xf6) + return 1; + if (c >= 0xf8 && c <= 0xff) + return 1; + break; + + case ISO_8859_2: + if (c == 0xa1 || c == 0xa3) + return 1; + if (c == 0xa5 || c == 0xa6) + return 1; + if (c >= 0xa9 && c <= 0xac) + return 1; + if (c >= 0xae && c <= 0xaf) + return 1; + if (c == 0xb1 || c == 0xb3) + return 1; + if (c == 0xb5 || c == 0xb6) + return 1; + if (c >= 0xb9 && c <= 0xbc) + return 1; + if (c >= 0xbe && c <= 0xbf) + return 1; + if (c >= 0xc0 && c <= 0xd6) + return 1; + if (c >= 0xd8 && c <= 0xf6) + return 1; + if (c >= 0xf8 && c <= 0xfe) + return 1; + break; + + case ISO_8859_3: + if (c == 0xa1) + return 1; + if (c == 0xa6) + return 1; + if (c >= 0xa9 && c <= 0xac) + return 1; + if (c == 0xaf) + return 1; + if (c == 0xb1) + return 1; + if (c == 0xb5 || c == 0xb6) + return 1; + if (c >= 0xb9 && c <= 0xbc) + return 1; + if (c == 0xbf) + return 1; + if (c >= 0xc0 && c <= 0xc2) + return 1; + if (c >= 0xc4 && c <= 0xcf) + return 1; + if (c >= 0xd1 && c <= 0xd6) + return 1; + if (c >= 0xd8 && c <= 0xe2) + return 1; + if (c >= 0xe4 && c <= 0xef) + return 1; + if (c >= 0xf1 && c <= 0xf6) + return 1; + if (c >= 0xf8 && c <= 0xfe) + return 1; + break; + + case ISO_8859_4: + if (c >= 0xa1 && c <= 0xa3) + return 1; + if (c == 0xa5 || c == 0xa6) + return 1; + if (c >= 0xa9 && c <= 0xac) + return 1; + if (c == 0xae) + return 1; + if (c == 0xb1 || c == 0xb3) + return 1; + if (c == 0xb5 || c == 0xb6) + return 1; + if (c >= 0xb9 && c <= 0xbf) + return 1; + if (c >= 0xc0 && c <= 0xd6) + return 1; + if (c >= 0xd8 && c <= 0xf6) + return 1; + if (c >= 0xf8 && c <= 0xfe) + return 1; + break; + + case ISO_8859_5: + if (c >= 0xa1 && c <= 0xcf && c != 0xad) + return 1; + if (c >= 0xd0 && c <= 0xff && c != 0xf0 && c != 0xfd) + return 1; + break; + + case ISO_8859_6: + if (c >= 0xc1 && c <= 0xda) + return 1; + if (c >= 0xe0 && c <= 0xf2) + return 1; + break; + + case ISO_8859_7: + if (c == 0xb6) + return 1; + if (c >= 0xb8 && c <= 0xba) + return 1; + if (c == 0xbc) + return 1; + if (c >= 0xbe && c <= 0xbf) + return 1; + if (c == 0xc0) + return 1; + if (c >= 0xc1 && c <= 0xdb && c != 0xd2) + return 1; + if (c >= 0xdc && c <= 0xfe) + return 1; + break; + + case ISO_8859_8: + if (c == 0xb5) + return 1; + if (c >= 0xe0 && c <= 0xfa) + return 1; + break; + + case ISO_8859_10: + if (c >= 0xa1 && c <= 0xa6) + return 1; + if (c >= 0xa8 && c <= 0xac) + return 1; + if (c == 0xae || c == 0xaf) + return 1; + if (c >= 0xb1 && c <= 0xb6) + return 1; + if (c >= 0xb8 && c <= 0xbc) + return 1; + if (c >= 0xbe && c <= 0xff) + return 1; + break; + + case ISO_8859_11: + if (c >= 0xa1 && c <= 0xda) + return 1; + if (c >= 0xdf && c <= 0xfb) + return 1; + break; + + case ISO_8859_13: + if (c == 0xa8) + return 1; + if (c == 0xaa) + return 1; + if (c == 0xaf) + return 1; + if (c == 0xb5) + return 1; + if (c == 0xb8) + return 1; + if (c == 0xba) + return 1; + if (c >= 0xbf && c <= 0xd6) + return 1; + if (c >= 0xd8 && c <= 0xf6) + return 1; + if (c >= 0xf8 && c <= 0xfe) + return 1; + break; + + case ISO_8859_14: + if (c == 0xa1 || c == 0xa2) + return 1; + if (c == 0xa4 || c == 0xa5) + return 1; + if (c == 0xa6 || c == 0xa8) + return 1; + if (c >= 0xaa && c <= 0xac) + return 1; + if (c >= 0xaf && c <= 0xb5) + return 1; + if (c >= 0xb7 && c <= 0xff) + return 1; + break; + + case ISO_8859_15: + if (c == 0xaa) + return 1; + if (c == 0xb5) + return 1; + if (c == 0xba) + return 1; + if (c >= 0xc0 && c <= 0xd6) + return 1; + if (c >= 0xd8 && c <= 0xf6) + return 1; + if (c >= 0xf8 && c <= 0xff) + return 1; + if (c == 0xa6) + return 1; + if (c == 0xa8) + return 1; + if (c == 0xb4) + return 1; + if (c == 0xb8) + return 1; + if (c == 0xbc) + return 1; + if (c == 0xbd) + return 1; + if (c == 0xbe) + return 1; + break; + + case ISO_8859_16: + if (c == 0xa1) + return 1; + if (c == 0xa2) + return 1; + if (c == 0xa3) + return 1; + if (c == 0xa6) + return 1; + if (c == 0xa8) + return 1; + if (c == 0xaa) + return 1; + if (c == 0xac) + return 1; + if (c == 0xae) + return 1; + if (c == 0xaf) + return 1; + if (c == 0xb2) + return 1; + if (c == 0xb3) + return 1; + if (c == 0xb4) + return 1; + if (c >= 0xb8 && c <= 0xba) + return 1; + if (c == 0xbc) + return 1; + if (c == 0xbd) + return 1; + if (c == 0xbe) + return 1; + if (c == 0xbf) + return 1; + if (c >= 0xc0 && c <= 0xde) + return 1; + if (c >= 0xdf && c <= 0xff) + return 1; + break; + + case KOI8_R: + if (c == 0xa3 || c == 0xb3) + return 1; + /* fall */ + case KOI8: + if (c >= 0xc0 && c <= 0xff) + return 1; + break; + + default: + exit(-1); + } + + return 0; +} + +static int IsBlank(int enc, int c) +{ + if (enc == ASCII) + return isblank(c); + + if (c == 0x09 || c == 0x20) + return 1; + + switch (enc) + { + case UNICODE_ISO_8859_1: + case ISO_8859_1: + case ISO_8859_2: + case ISO_8859_3: + case ISO_8859_4: + case ISO_8859_5: + case ISO_8859_6: + case ISO_8859_7: + case ISO_8859_8: + case ISO_8859_9: + case ISO_8859_10: + case ISO_8859_11: + case ISO_8859_13: + case ISO_8859_14: + case ISO_8859_15: + case ISO_8859_16: + case KOI8: + if (c == 0xa0) + return 1; + break; + + case KOI8_R: + if (c == 0x9a) + return 1; + break; + + default: + exit(-1); + } + + return 0; +} + +static int IsCntrl(int enc, int c) +{ + if (enc == ASCII) + return iscntrl(c); + + if (c >= 0x00 && c <= 0x1F) + return 1; + + switch (enc) + { + case UNICODE_ISO_8859_1: + if (c == 0xad) + return 1; + /* fall */ + case ISO_8859_1: + case ISO_8859_2: + case ISO_8859_3: + case ISO_8859_4: + case ISO_8859_5: + case ISO_8859_6: + case ISO_8859_7: + case ISO_8859_8: + case ISO_8859_9: + case ISO_8859_10: + case ISO_8859_11: + case ISO_8859_13: + case ISO_8859_14: + case ISO_8859_15: + case ISO_8859_16: + case KOI8: + if (c >= 0x7f && c <= 0x9F) + return 1; + break; + + case KOI8_R: + if (c == 0x7f) + return 1; + break; + + default: + exit(-1); + } + + return 0; +} + +static int IsDigit(int enc ARG_UNUSED, int c) +{ + if (c >= 0x30 && c <= 0x39) + return 1; + return 0; +} + +static int IsGraph(int enc, int c) +{ + if (enc == ASCII) + return isgraph(c); + + if (c >= 0x21 && c <= 0x7e) + return 1; + + switch (enc) + { + case UNICODE_ISO_8859_1: + case ISO_8859_1: + case ISO_8859_2: + case ISO_8859_4: + case ISO_8859_5: + case ISO_8859_9: + case ISO_8859_10: + case ISO_8859_13: + case ISO_8859_14: + case ISO_8859_15: + case ISO_8859_16: + if (c >= 0xa1 && c <= 0xff) + return 1; + break; + + case ISO_8859_3: + if (c >= 0xa1) + { + if (c == 0xa5 || c == 0xae || c == 0xbe || c == 0xc3 || c == 0xd0 + || c == 0xe3 || c == 0xf0) + return 0; + else + return 1; + } + break; + + case ISO_8859_6: + if (c == 0xa4 || c == 0xac || c == 0xad || c == 0xbb || c == 0xbf) + return 1; + if (c >= 0xc1 && c <= 0xda) + return 1; + if (c >= 0xe0 && c <= 0xf2) + return 1; + break; + + case ISO_8859_7: + if (c >= 0xa1 && c <= 0xfe && c != 0xa4 && c != 0xa5 && c != 0xaa + && c != 0xae && c != 0xd2) + return 1; + break; + + case ISO_8859_8: + if (c >= 0xa2 && c <= 0xfa) + { + if (c >= 0xbf && c <= 0xde) + return 0; + return 1; + } + break; + + case ISO_8859_11: + if (c >= 0xa1 && c <= 0xda) + return 1; + if (c >= 0xdf && c <= 0xfb) + return 1; + break; + + case KOI8: + if (c >= 0xc0 && c <= 0xff) + return 1; + break; + + case KOI8_R: + if (c >= 0x80 && c <= 0xff && c != 0x9a) + return 1; + break; + + default: + exit(-1); + } + + return 0; +} + +static int IsLower(int enc, int c) +{ + if (enc == ASCII) + return islower(c); + + if (c >= 0x61 && c <= 0x7a) + return 1; + + switch (enc) + { + case UNICODE_ISO_8859_1: + case ISO_8859_1: + case ISO_8859_9: + if (c == 0xaa) + return 1; + if (c == 0xb5) + return 1; + if (c == 0xba) + return 1; + if (c >= 0xdf && c <= 0xf6) + return 1; + if (c >= 0xf8 && c <= 0xff) + return 1; + break; + + case ISO_8859_2: + if (c == 0xb1 || c == 0xb3) + return 1; + if (c == 0xb5 || c == 0xb6) + return 1; + if (c >= 0xb9 && c <= 0xbc) + return 1; + if (c >= 0xbe && c <= 0xbf) + return 1; + if (c >= 0xdf && c <= 0xf6) + return 1; + if (c >= 0xf8 && c <= 0xfe) + return 1; + break; + + case ISO_8859_3: + if (c == 0xb1) + return 1; + if (c == 0xb5 || c == 0xb6) + return 1; + if (c >= 0xb9 && c <= 0xbc) + return 1; + if (c == 0xbf) + return 1; + if (c == 0xdf) + return 1; + if (c >= 0xe0 && c <= 0xe2) + return 1; + if (c >= 0xe4 && c <= 0xef) + return 1; + if (c >= 0xf1 && c <= 0xf6) + return 1; + if (c >= 0xf8 && c <= 0xfe) + return 1; + break; + + case ISO_8859_4: + if (c == 0xa2) + return 1; + if (c == 0xb1 || c == 0xb3) + return 1; + if (c == 0xb5 || c == 0xb6) + return 1; + if (c >= 0xb9 && c <= 0xbc) + return 1; + if (c >= 0xbe && c <= 0xbf) + return 1; + if (c == 0xdf) + return 1; + if (c >= 0xe0 && c <= 0xf6) + return 1; + if (c >= 0xf8 && c <= 0xfe) + return 1; + break; + + case ISO_8859_5: + if (c >= 0xd0 && c <= 0xff && c != 0xf0 && c != 0xfd) + return 1; + break; + + case ISO_8859_6: + break; + + case ISO_8859_7: + if (c == 0xc0) + return 1; + if (c >= 0xdc && c <= 0xfe) + return 1; + break; + + case ISO_8859_8: + if (c == 0xb5) + return 1; + break; + + case ISO_8859_10: + if (c >= 0xb1 && c <= 0xb6) + return 1; + if (c >= 0xb8 && c <= 0xbc) + return 1; + if (c == 0xbe || c == 0xbf) + return 1; + if (c >= 0xdf && c <= 0xff) + return 1; + break; + + case ISO_8859_11: + break; + + case ISO_8859_13: + if (c == 0xb5) + return 1; + if (c == 0xb8) + return 1; + if (c == 0xba) + return 1; + if (c == 0xbf) + return 1; + if (c >= 0xdf && c <= 0xf6) + return 1; + if (c >= 0xf8 && c <= 0xfe) + return 1; + break; + + case ISO_8859_14: + if (c == 0xa2) + return 1; + if (c == 0xa5) + return 1; + if (c == 0xab) + return 1; + if (c == 0xb1 || c == 0xb3 || c == 0xb5) + return 1; + if (c >= 0xb8 && c <= 0xba) + return 1; + if (c == 0xbc) + return 1; + if (c == 0xbe || c == 0xbf) + return 1; + if (c >= 0xdf && c <= 0xff) + return 1; + break; + + case ISO_8859_15: + if (c == 0xaa) + return 1; + if (c == 0xb5) + return 1; + if (c == 0xba) + return 1; + if (c >= 0xdf && c <= 0xf6) + return 1; + if (c >= 0xf8 && c <= 0xff) + return 1; + if (c == 0xa8) + return 1; + if (c == 0xb8) + return 1; + if (c == 0xbd) + return 1; + break; + + case ISO_8859_16: + if (c == 0xa2) + return 1; + if (c == 0xa8) + return 1; + if (c == 0xae) + return 1; + if (c == 0xb3) + return 1; + if (c >= 0xb8 && c <= 0xba) + return 1; + if (c == 0xbd) + return 1; + if (c == 0xbf) + return 1; + if (c >= 0xdf && c <= 0xff) + return 1; + break; + + case KOI8_R: + if (c == 0xa3) + return 1; + /* fall */ + case KOI8: + if (c >= 0xc0 && c <= 0xdf) + return 1; + break; + + default: + exit(-1); + } + + return 0; +} + +static int IsPrint(int enc, int c) +{ + if (enc == ASCII) + return isprint(c); + + if (c >= 0x20 && c <= 0x7e) + return 1; + + switch (enc) + { + case UNICODE_ISO_8859_1: + /* if (c >= 0x09 && c <= 0x0d) return 1; */ + if (c == 0x85) + return 1; + /* fall */ + case ISO_8859_1: + case ISO_8859_2: + case ISO_8859_4: + case ISO_8859_5: + case ISO_8859_9: + case ISO_8859_10: + case ISO_8859_13: + case ISO_8859_14: + case ISO_8859_15: + case ISO_8859_16: + if (c >= 0xa0 && c <= 0xff) + return 1; + break; + + case ISO_8859_3: + if (c >= 0xa0) + { + if (c == 0xa5 || c == 0xae || c == 0xbe || c == 0xc3 || c == 0xd0 + || c == 0xe3 || c == 0xf0) + return 0; + else + return 1; + } + break; + + case ISO_8859_6: + if (c == 0xa0) + return 1; + if (c == 0xa4 || c == 0xac || c == 0xad || c == 0xbb || c == 0xbf) + return 1; + if (c >= 0xc1 && c <= 0xda) + return 1; + if (c >= 0xe0 && c <= 0xf2) + return 1; + break; + + case ISO_8859_7: + if (c >= 0xa0 && c <= 0xfe && c != 0xa4 && c != 0xa5 && c != 0xaa + && c != 0xae && c != 0xd2) + return 1; + break; + + case ISO_8859_8: + if (c >= 0xa0 && c <= 0xfa) + { + if (c >= 0xbf && c <= 0xde) + return 0; + if (c == 0xa1) + return 0; + return 1; + } + break; + + case ISO_8859_11: + if (c >= 0xa0 && c <= 0xda) + return 1; + if (c >= 0xdf && c <= 0xfb) + return 1; + break; + + case KOI8: + if (c == 0xa0) + return 1; + if (c >= 0xc0 && c <= 0xff) + return 1; + break; + + case KOI8_R: + if (c >= 0x80 && c <= 0xff) + return 1; + break; + + default: + exit(-1); + } + + return 0; +} + +static int IsPunct(int enc, int c) +{ + if (enc == ASCII) + return ispunct(c); + + if (enc == UNICODE_ISO_8859_1) + { + if (c == 0x24 || c == 0x2b || c == 0x5e || c == 0x60 || c == 0x7c + || c == 0x7e) + return 1; + if (c >= 0x3c && c <= 0x3e) + return 1; + } + + if (c >= 0x21 && c <= 0x2f) + return 1; + if (c >= 0x3a && c <= 0x40) + return 1; + if (c >= 0x5b && c <= 0x60) + return 1; + if (c >= 0x7b && c <= 0x7e) + return 1; + + switch (enc) + { + case ISO_8859_1: + case ISO_8859_9: + case ISO_8859_15: + if (c == 0xad) + return 1; + /* fall */ + case UNICODE_ISO_8859_1: + if (c == 0xa1) + return 1; + if (c == 0xab) + return 1; + if (c == 0xb7) + return 1; + if (c == 0xbb) + return 1; + if (c == 0xbf) + return 1; + break; + + case ISO_8859_2: + case ISO_8859_4: + case ISO_8859_5: + case ISO_8859_14: + if (c == 0xad) + return 1; + break; + + case ISO_8859_3: + case ISO_8859_10: + if (c == 0xad) + return 1; + if (c == 0xb7) + return 1; + if (c == 0xbd) + return 1; + break; + + case ISO_8859_6: + if (c == 0xac) + return 1; + if (c == 0xad) + return 1; + if (c == 0xbb) + return 1; + if (c == 0xbf) + return 1; + break; + + case ISO_8859_7: + if (c == 0xa1 || c == 0xa2) + return 1; + if (c == 0xab) + return 1; + if (c == 0xaf) + return 1; + if (c == 0xad) + return 1; + if (c == 0xb7 || c == 0xbb) + return 1; + break; + + case ISO_8859_8: + if (c == 0xab) + return 1; + if (c == 0xad) + return 1; + if (c == 0xb7) + return 1; + if (c == 0xbb) + return 1; + if (c == 0xdf) + return 1; + break; + + case ISO_8859_13: + if (c == 0xa1 || c == 0xa5) + return 1; + if (c == 0xab || c == 0xad) + return 1; + if (c == 0xb4 || c == 0xb7) + return 1; + if (c == 0xbb) + return 1; + if (c == 0xff) + return 1; + break; + + case ISO_8859_16: + if (c == 0xa5) + return 1; + if (c == 0xab) + return 1; + if (c == 0xad) + return 1; + if (c == 0xb5) + return 1; + if (c == 0xb7) + return 1; + if (c == 0xbb) + return 1; + break; + + case KOI8_R: + if (c == 0x9e) + return 1; + break; + + case ISO_8859_11: + case KOI8: + break; + + default: + exit(-1); + } + + return 0; +} + +static int IsSpace(int enc, int c) +{ + if (enc == ASCII) + return isspace(c); + + if (c >= 0x09 && c <= 0x0d) + return 1; + if (c == 0x20) + return 1; + + switch (enc) + { + case UNICODE_ISO_8859_1: + if (c == 0x85) + return 1; + /* fall */ + case ISO_8859_1: + case ISO_8859_2: + case ISO_8859_3: + case ISO_8859_4: + case ISO_8859_5: + case ISO_8859_6: + case ISO_8859_7: + case ISO_8859_8: + case ISO_8859_9: + case ISO_8859_10: + case ISO_8859_11: + case ISO_8859_13: + case ISO_8859_14: + case ISO_8859_15: + case ISO_8859_16: + case KOI8: + if (c == 0xa0) + return 1; + break; + + case KOI8_R: + if (c == 0x9a) + return 1; + break; + + default: + exit(-1); + } + + return 0; +} + +static int IsUpper(int enc, int c) +{ + if (enc == ASCII) + return isupper(c); + + if (c >= 0x41 && c <= 0x5a) + return 1; + + switch (enc) + { + case UNICODE_ISO_8859_1: + case ISO_8859_1: + case ISO_8859_9: + if (c >= 0xc0 && c <= 0xd6) + return 1; + if (c >= 0xd8 && c <= 0xde) + return 1; + break; + + case ISO_8859_2: + if (c == 0xa1 || c == 0xa3) + return 1; + if (c == 0xa5 || c == 0xa6) + return 1; + if (c >= 0xa9 && c <= 0xac) + return 1; + if (c >= 0xae && c <= 0xaf) + return 1; + if (c >= 0xc0 && c <= 0xd6) + return 1; + if (c >= 0xd8 && c <= 0xde) + return 1; + break; + + case ISO_8859_3: + if (c == 0xa1) + return 1; + if (c == 0xa6) + return 1; + if (c >= 0xa9 && c <= 0xac) + return 1; + if (c == 0xaf) + return 1; + if (c >= 0xc0 && c <= 0xc2) + return 1; + if (c >= 0xc4 && c <= 0xcf) + return 1; + if (c >= 0xd1 && c <= 0xd6) + return 1; + if (c >= 0xd8 && c <= 0xde) + return 1; + break; + + case ISO_8859_4: + if (c == 0xa1 || c == 0xa3) + return 1; + if (c == 0xa5 || c == 0xa6) + return 1; + if (c >= 0xa9 && c <= 0xac) + return 1; + if (c == 0xae) + return 1; + if (c == 0xbd) + return 1; + if (c >= 0xc0 && c <= 0xd6) + return 1; + if (c >= 0xd8 && c <= 0xde) + return 1; + break; + + case ISO_8859_5: + if (c >= 0xa1 && c <= 0xcf && c != 0xad) + return 1; + break; + + case ISO_8859_6: + break; + + case ISO_8859_7: + if (c == 0xb6) + return 1; + if (c >= 0xb8 && c <= 0xba) + return 1; + if (c == 0xbc) + return 1; + if (c >= 0xbe && c <= 0xbf) + return 1; + if (c >= 0xc1 && c <= 0xdb && c != 0xd2) + return 1; + break; + + case ISO_8859_8: + case ISO_8859_11: + break; + + case ISO_8859_10: + if (c >= 0xa1 && c <= 0xa6) + return 1; + if (c >= 0xa8 && c <= 0xac) + return 1; + if (c == 0xae || c == 0xaf) + return 1; + if (c >= 0xc0 && c <= 0xde) + return 1; + break; + + case ISO_8859_13: + if (c == 0xa8) + return 1; + if (c == 0xaa) + return 1; + if (c == 0xaf) + return 1; + if (c >= 0xc0 && c <= 0xd6) + return 1; + if (c >= 0xd8 && c <= 0xde) + return 1; + break; + + case ISO_8859_14: + if (c == 0xa1) + return 1; + if (c == 0xa4 || c == 0xa6) + return 1; + if (c == 0xa8) + return 1; + if (c == 0xaa || c == 0xac) + return 1; + if (c == 0xaf || c == 0xb0) + return 1; + if (c == 0xb2 || c == 0xb4 || c == 0xb7) + return 1; + if (c == 0xbb || c == 0xbd) + return 1; + if (c >= 0xc0 && c <= 0xde) + return 1; + break; + + case ISO_8859_15: + if (c >= 0xc0 && c <= 0xd6) + return 1; + if (c >= 0xd8 && c <= 0xde) + return 1; + if (c == 0xa6) + return 1; + if (c == 0xb4) + return 1; + if (c == 0xbc) + return 1; + if (c == 0xbe) + return 1; + break; + + case ISO_8859_16: + if (c == 0xa1) + return 1; + if (c == 0xa3) + return 1; + if (c == 0xa6) + return 1; + if (c == 0xaa) + return 1; + if (c == 0xac) + return 1; + if (c == 0xaf) + return 1; + if (c == 0xb2) + return 1; + if (c == 0xb4) + return 1; + if (c == 0xbc) + return 1; + if (c == 0xbe) + return 1; + if (c >= 0xc0 && c <= 0xde) + return 1; + break; + + case KOI8_R: + if (c == 0xb3) + return 1; + /* fall */ + case KOI8: + if (c >= 0xe0 && c <= 0xff) + return 1; + break; + + default: + exit(-1); + } + + return 0; +} + +static int IsXDigit(int enc, int c) +{ + if (enc == ASCII) + return isxdigit(c); + + if (c >= 0x30 && c <= 0x39) + return 1; + if (c >= 0x41 && c <= 0x46) + return 1; + if (c >= 0x61 && c <= 0x66) + return 1; + return 0; +} + +static int IsWord(int enc, int c) +{ + if (enc == ASCII) + { + return (isalpha(c) || isdigit(c) || c == 0x5f); + } + + if (c >= 0x30 && c <= 0x39) + return 1; + if (c >= 0x41 && c <= 0x5a) + return 1; + if (c == 0x5f) + return 1; + if (c >= 0x61 && c <= 0x7a) + return 1; + + switch (enc) + { + case UNICODE_ISO_8859_1: + case ISO_8859_1: + case ISO_8859_9: + if (c == 0xaa) + return 1; + if (c >= 0xb2 && c <= 0xb3) + return 1; + if (c == 0xb5) + return 1; + if (c >= 0xb9 && c <= 0xba) + return 1; + if (c >= 0xbc && c <= 0xbe) + return 1; + if (c >= 0xc0 && c <= 0xd6) + return 1; + if (c >= 0xd8 && c <= 0xf6) + return 1; + if (c >= 0xf8 && c <= 0xff) + return 1; + break; + + case ISO_8859_2: + if (c == 0xa1 || c == 0xa3) + return 1; + if (c == 0xa5 || c == 0xa6) + return 1; + if (c >= 0xa9 && c <= 0xac) + return 1; + if (c >= 0xae && c <= 0xaf) + return 1; + if (c == 0xb1 || c == 0xb3) + return 1; + if (c == 0xb5 || c == 0xb6) + return 1; + if (c >= 0xb9 && c <= 0xbc) + return 1; + if (c >= 0xbe && c <= 0xbf) + return 1; + if (c >= 0xc0 && c <= 0xd6) + return 1; + if (c >= 0xd8 && c <= 0xf6) + return 1; + if (c >= 0xf8 && c <= 0xfe) + return 1; + break; + + case ISO_8859_3: + if (c == 0xa1) + return 1; + if (c == 0xa6) + return 1; + if (c >= 0xa9 && c <= 0xac) + return 1; + if (c == 0xaf) + return 1; + if (c >= 0xb1 && c <= 0xb3) + return 1; + if (c == 0xb5 || c == 0xb6) + return 1; + if (c >= 0xb9 && c <= 0xbd) + return 1; + if (c == 0xbf) + return 1; + if (c >= 0xc0 && c <= 0xc2) + return 1; + if (c >= 0xc4 && c <= 0xcf) + return 1; + if (c >= 0xd1 && c <= 0xd6) + return 1; + if (c >= 0xd8 && c <= 0xe2) + return 1; + if (c >= 0xe4 && c <= 0xef) + return 1; + if (c >= 0xf1 && c <= 0xf6) + return 1; + if (c >= 0xf8 && c <= 0xfe) + return 1; + break; + + case ISO_8859_4: + if (c >= 0xa1 && c <= 0xa3) + return 1; + if (c == 0xa5 || c == 0xa6) + return 1; + if (c >= 0xa9 && c <= 0xac) + return 1; + if (c == 0xae) + return 1; + if (c == 0xb1 || c == 0xb3) + return 1; + if (c == 0xb5 || c == 0xb6) + return 1; + if (c >= 0xb9 && c <= 0xbf) + return 1; + if (c >= 0xc0 && c <= 0xd6) + return 1; + if (c >= 0xd8 && c <= 0xf6) + return 1; + if (c >= 0xf8 && c <= 0xfe) + return 1; + break; + + case ISO_8859_5: + if (c >= 0xa1 && c <= 0xcf && c != 0xad) + return 1; + if (c >= 0xd0 && c <= 0xff && c != 0xf0 && c != 0xfd) + return 1; + break; + + case ISO_8859_6: + if (c >= 0xc1 && c <= 0xda) + return 1; + if (c >= 0xe0 && c <= 0xea) + return 1; + if (c >= 0xeb && c <= 0xf2) + return 1; + break; + + case ISO_8859_7: + if (c == 0xb2 || c == 0xb3) + return 1; + if (c == 0xb6) + return 1; + if (c >= 0xb8 && c <= 0xba) + return 1; + if (c >= 0xbc && c <= 0xbf) + return 1; + if (c == 0xc0) + return 1; + if (c >= 0xc1 && c <= 0xdb && c != 0xd2) + return 1; + if (c >= 0xdc && c <= 0xfe) + return 1; + break; + + case ISO_8859_8: + if (c == 0xb2 || c == 0xb3 || c == 0xb5 || c == 0xb9) + return 1; + if (c >= 0xbc && c <= 0xbe) + return 1; + if (c >= 0xe0 && c <= 0xfa) + return 1; + break; + + case ISO_8859_10: + if (c >= 0xa1 && c <= 0xff) + { + if (c != 0xa7 && c != 0xad && c != 0xb0 && c != 0xb7 && c != 0xbd) + return 1; + } + break; + + case ISO_8859_11: + if (c >= 0xa1 && c <= 0xda) + return 1; + if (c >= 0xdf && c <= 0xfb) + return 1; + break; + + case ISO_8859_13: + if (c == 0xa8) + return 1; + if (c == 0xaa) + return 1; + if (c == 0xaf) + return 1; + if (c == 0xb2 || c == 0xb3 || c == 0xb5 || c == 0xb9) + return 1; + if (c >= 0xbc && c <= 0xbe) + return 1; + if (c == 0xb8) + return 1; + if (c == 0xba) + return 1; + if (c >= 0xbf && c <= 0xd6) + return 1; + if (c >= 0xd8 && c <= 0xf6) + return 1; + if (c >= 0xf8 && c <= 0xfe) + return 1; + break; + + case ISO_8859_14: + if (c >= 0xa1 && c <= 0xff) + { + if (c == 0xa3 || c == 0xa7 || c == 0xa9 || c == 0xad || c == 0xae + || c == 0xb6) + return 0; + return 1; + } + break; + + case ISO_8859_15: + if (c == 0xaa) + return 1; + if (c >= 0xb2 && c <= 0xb3) + return 1; + if (c == 0xb5) + return 1; + if (c >= 0xb9 && c <= 0xba) + return 1; + if (c >= 0xbc && c <= 0xbe) + return 1; + if (c >= 0xc0 && c <= 0xd6) + return 1; + if (c >= 0xd8 && c <= 0xf6) + return 1; + if (c >= 0xf8 && c <= 0xff) + return 1; + if (c == 0xa6) + return 1; + if (c == 0xa8) + return 1; + if (c == 0xb4) + return 1; + if (c == 0xb8) + return 1; + break; + + case ISO_8859_16: + if (c == 0xa1) + return 1; + if (c == 0xa2) + return 1; + if (c == 0xa3) + return 1; + if (c == 0xa6) + return 1; + if (c == 0xa8) + return 1; + if (c == 0xaa) + return 1; + if (c == 0xac) + return 1; + if (c == 0xae) + return 1; + if (c == 0xaf) + return 1; + if (c == 0xb2) + return 1; + if (c == 0xb3) + return 1; + if (c == 0xb4) + return 1; + if (c >= 0xb8 && c <= 0xba) + return 1; + if (c == 0xbc) + return 1; + if (c == 0xbd) + return 1; + if (c == 0xbe) + return 1; + if (c == 0xbf) + return 1; + if (c >= 0xc0 && c <= 0xde) + return 1; + if (c >= 0xdf && c <= 0xff) + return 1; + break; + + case KOI8_R: + if (c == 0x9d) + return 1; + if (c == 0xa3 || c == 0xb3) + return 1; + /* fall */ + case KOI8: + if (c >= 0xc0 && c <= 0xff) + return 1; + break; + + default: + exit(-1); + } + + return 0; +} + +static int IsAscii(int enc ARG_UNUSED, int c) +{ + if (c >= 0x00 && c <= 0x7f) + return 1; + return 0; +} + +static int IsNewline(int enc ARG_UNUSED, int c) +{ + if (c == 0x0a) + return 1; + return 0; +} + +static int exec(FILE *fp, ENC_INFO *einfo) +{ +#define NCOL 8 + + int c, val, enc; + int r; + + enc = einfo->num; + + r = fprintf(fp, "static const unsigned short Enc%s_CtypeTable[256] = {\n", + einfo->name); + if (r < 0) + return -1; + + for (c = 0; c < 256; c++) + { + val = 0; + if (IsNewline(enc, c)) + val |= BIT_CTYPE_NEWLINE; + if (IsAlpha(enc, c)) + val |= (BIT_CTYPE_ALPHA | BIT_CTYPE_ALNUM); + if (IsBlank(enc, c)) + val |= BIT_CTYPE_BLANK; + if (IsCntrl(enc, c)) + val |= BIT_CTYPE_CNTRL; + if (IsDigit(enc, c)) + val |= (BIT_CTYPE_DIGIT | BIT_CTYPE_ALNUM); + if (IsGraph(enc, c)) + val |= BIT_CTYPE_GRAPH; + if (IsLower(enc, c)) + val |= BIT_CTYPE_LOWER; + if (IsPrint(enc, c)) + val |= BIT_CTYPE_PRINT; + if (IsPunct(enc, c)) + val |= BIT_CTYPE_PUNCT; + if (IsSpace(enc, c)) + val |= BIT_CTYPE_SPACE; + if (IsUpper(enc, c)) + val |= BIT_CTYPE_UPPER; + if (IsXDigit(enc, c)) + val |= BIT_CTYPE_XDIGIT; + if (IsWord(enc, c)) + val |= BIT_CTYPE_WORD; + if (IsAscii(enc, c)) + val |= BIT_CTYPE_ASCII; + + if (c % NCOL == 0) + { + r = fputs(" ", fp); + if (r < 0) + return -1; + } + r = fprintf(fp, "0x%04x", val); + if (r < 0) + return -1; + + if (c != 255) + { + r = fputs(",", fp); + if (r < 0) + return -1; + } + if (c != 0 && c % NCOL == (NCOL - 1)) + r = fputs("\n", fp); + else + r = fputs(" ", fp); + + if (r < 0) + return -1; + } + r = fprintf(fp, "};\n"); + if (r < 0) + return -1; + + return 0; +} + +extern int main(int argc ARG_UNUSED, char *argv[] ARG_UNUSED) +{ + int r; + int i; + FILE *fp = stdout; + + setlocale(LC_ALL, "C"); + /* setlocale(LC_ALL, "POSIX"); */ + /* setlocale(LC_ALL, "en_GB.iso88591"); */ + /* setlocale(LC_ALL, "de_BE.iso88591"); */ + /* setlocale(LC_ALL, "fr_FR.iso88591"); */ + + for (i = 0; i < (int)(sizeof(Info) / sizeof(ENC_INFO)); i++) + { + r = exec(fp, &Info[i]); + if (r < 0) + { + fprintf(stderr, "FAIL exec(): %d\n", r); + return -1; + } + } + + return 0; +} diff --git a/lib/edbee-lib/vendor/onig/enc/shift_jis.c b/lib/edbee-lib/vendor/onig/enc/shift_jis.c new file mode 100644 index 00000000..ff05ff43 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/shift_jis.c @@ -0,0 +1,67 @@ +/********************************************************************** + shift_jis.c - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011-2017 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "shift_jis.h" + +OnigEncodingDefine(shift_jis, Shift_JIS) = { + mbc_enc_len, + "Shift_JIS", /* name */ + 2, /* max byte length */ + 1, /* min byte length */ + onigenc_is_mbc_newline_0x0a, + mbc_to_code, + code_to_mbclen, + code_to_mbc, + mbc_case_fold, + apply_all_case_fold, + get_case_fold_codes_by_str, + property_name_to_ctype, + is_code_ctype, + get_ctype_code_range, + left_adjust_char_head, + is_allowed_reverse_match, + onigenc_ascii_only_case_map, + 0, + ONIGENC_FLAG_NONE, +}; +/* + * Name: Shift_JIS + * MIBenum: 17 + * Link: http://www.iana.org/assignments/character-sets + * Link: http://ja.wikipedia.org/wiki/Shift_JIS + */ + +/* + * Name: MacJapanese + * Link: http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/JAPANESE.TXT + * Link: http://ja.wikipedia.org/wiki/MacJapanese + */ +ENC_REPLICATE("MacJapanese", "Shift_JIS") +ENC_ALIAS("MacJapan", "MacJapanese") diff --git a/lib/edbee-lib/vendor/onig/enc/shift_jis.h b/lib/edbee-lib/vendor/onig/enc/shift_jis.h new file mode 100644 index 00000000..9caa8d8a --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/shift_jis.h @@ -0,0 +1,541 @@ +/********************************************************************** + shift_jis.h - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" + +static const int EncLen_SJIS[] + = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1}; + +static const char SJIS_CAN_BE_TRAIL_TABLE[256] + = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0}; + +static const OnigPairCaseFoldCodes CaseFoldMap[] = { + /* Fullwidth Alphabet */ + {0x8260, 0x8281}, + {0x8261, 0x8282}, + {0x8262, 0x8283}, + {0x8263, 0x8284}, + {0x8264, 0x8285}, + {0x8265, 0x8286}, + {0x8266, 0x8287}, + {0x8267, 0x8288}, + {0x8268, 0x8289}, + {0x8269, 0x828a}, + {0x826a, 0x828b}, + {0x826b, 0x828c}, + {0x826c, 0x828d}, + {0x826d, 0x828e}, + {0x826e, 0x828f}, + {0x826f, 0x8290}, + {0x8270, 0x8291}, + {0x8271, 0x8292}, + {0x8272, 0x8293}, + {0x8273, 0x8294}, + {0x8274, 0x8295}, + {0x8275, 0x8296}, + {0x8276, 0x8297}, + {0x8277, 0x8298}, + {0x8278, 0x8299}, + {0x8279, 0x829a}, + + /* Greek */ + {0x839f, 0x83bf}, + {0x83a0, 0x83c0}, + {0x83a1, 0x83c1}, + {0x83a2, 0x83c2}, + {0x83a3, 0x83c3}, + {0x83a4, 0x83c4}, + {0x83a5, 0x83c5}, + {0x83a6, 0x83c6}, + {0x83a7, 0x83c7}, + {0x83a8, 0x83c8}, + {0x83a9, 0x83c9}, + {0x83aa, 0x83ca}, + {0x83ab, 0x83cb}, + {0x83ac, 0x83cc}, + {0x83ad, 0x83cd}, + {0x83ae, 0x83ce}, + {0x83af, 0x83cf}, + {0x83b0, 0x83d0}, + {0x83b1, 0x83d1}, + {0x83b2, 0x83d2}, + {0x83b3, 0x83d3}, + {0x83b4, 0x83d4}, + {0x83b5, 0x83d5}, + {0x83b6, 0x83d6}, + + /* Cyrillic */ + {0x8440, 0x8470}, + {0x8441, 0x8471}, + {0x8442, 0x8472}, + {0x8443, 0x8473}, + {0x8444, 0x8474}, + {0x8445, 0x8475}, + {0x8446, 0x8476}, + {0x8447, 0x8477}, + {0x8448, 0x8478}, + {0x8449, 0x8479}, + {0x844a, 0x847a}, + {0x844b, 0x847b}, + {0x844c, 0x847c}, + {0x844d, 0x847d}, + {0x844e, 0x847e}, + {0x844f, 0x8480}, + {0x8450, 0x8481}, + {0x8451, 0x8482}, + {0x8452, 0x8483}, + {0x8453, 0x8484}, + {0x8454, 0x8485}, + {0x8455, 0x8486}, + {0x8456, 0x8487}, + {0x8457, 0x8488}, + {0x8458, 0x8489}, + {0x8459, 0x848a}, + {0x845a, 0x848b}, + {0x845b, 0x848c}, + {0x845c, 0x848d}, + {0x845d, 0x848e}, + {0x845e, 0x848f}, + {0x845f, 0x8490}, + {0x8460, 0x8491}, +}; + +#define SJIS_ISMB_FIRST(byte) (EncLen_SJIS[byte] > 1) +#define SJIS_ISMB_TRAIL(byte) SJIS_CAN_BE_TRAIL_TABLE[(byte)] + +typedef enum +{ + FAILURE = -2, + ACCEPT = -1, + S0 = 0, + S1 +} state_t; +#define A ACCEPT +#define F FAILURE +static const signed char trans[][0x100] + = {{/* S0 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 1 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 2 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 3 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 8 */ F, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 9 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* a */ F, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* b */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F, F, F}, + {/* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F, + /* 8 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 9 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* a */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* b */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, F, F, F}}; +#undef A +#undef F + +static int mbc_enc_len(const UChar *p, const UChar *e, + OnigEncoding enc ARG_UNUSED) +{ + int firstbyte = *p++; + state_t s; + s = trans[0][firstbyte]; + if (s < 0) + return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(1) + : ONIGENC_CONSTRUCT_MBCLEN_INVALID(); + if (p == e) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_SJIS[firstbyte] - 1); + s = trans[s][*p++]; + return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(2) + : ONIGENC_CONSTRUCT_MBCLEN_INVALID(); +} + +static int code_to_mbclen(OnigCodePoint code, OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + { + if (EncLen_SJIS[(int)code] == 1) + return 1; + else + return ONIGERR_INVALID_CODE_POINT_VALUE; + } + else if (code <= 0xffff) + { + int low = code & 0xff; + if (!SJIS_ISMB_TRAIL(low)) + return ONIGERR_INVALID_CODE_POINT_VALUE; + return 2; + } + else + return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE; +} + +static OnigCodePoint mbc_to_code(const UChar *p, const UChar *end, + OnigEncoding enc) +{ + int c, i, len; + OnigCodePoint n; + + len = mbc_enc_len(p, end, enc); + c = *p++; + n = c; + if (len == 1) + return n; + + for (i = 1; i < len; i++) + { + if (p >= end) + break; + c = *p++; + n <<= 8; + n += c; + } + return n; +} + +static int code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc) +{ + UChar *p = buf; + + if ((code & 0xff00) != 0) + *p++ = (UChar)(((code >> 8) & 0xff)); + *p++ = (UChar)(code & 0xff); + +#if 0 + if (mbc_enc_len(buf, p, enc) != (p - buf)) + return REGERR_INVALID_CODE_POINT_VALUE; +#endif + return (int)(p - buf); +} + +static int apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc) +{ + return onigenc_apply_all_case_fold_with_map(numberof(CaseFoldMap), + CaseFoldMap, 0, flag, f, arg); +} + +static OnigCodePoint get_lower_case(OnigCodePoint code) +{ + if (ONIGENC_IS_IN_RANGE(code, 0x8260, 0x8279)) + { + /* Fullwidth Alphabet */ + return (OnigCodePoint)(code + 0x0021); + } + else if (ONIGENC_IS_IN_RANGE(code, 0x839f, 0x83b6)) + { + /* Greek */ + return (OnigCodePoint)(code + 0x0020); + } + else if (ONIGENC_IS_IN_RANGE(code, 0x8440, 0x8460)) + { + /* Cyrillic */ + int d = (code >= 0x844f) ? 1 : 0; + return (OnigCodePoint)(code + (0x0030 + d)); + } + return code; +} + +static OnigCodePoint get_upper_case(OnigCodePoint code) +{ + if (ONIGENC_IS_IN_RANGE(code, 0x8281, 0x829a)) + { + /* Fullwidth Alphabet */ + return (OnigCodePoint)(code - 0x0021); + } + else if (ONIGENC_IS_IN_RANGE(code, 0x83bf, 0x83d6)) + { + /* Greek */ + return (OnigCodePoint)(code - 0x0020); + } + else if (ONIGENC_IS_IN_RANGE(code, 0x8470, 0x847e) + || ONIGENC_IS_IN_RANGE(code, 0x8480, 0x8491)) + { + /* Cyrillic */ + int d = (code >= 0x8480) ? 1 : 0; + return (OnigCodePoint)(code - (0x0030 - d)); + } + return code; +} + +static int get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc) +{ + int len; + OnigCodePoint code, code_lo, code_up; + + code = mbc_to_code(p, end, enc); + if (ONIGENC_IS_ASCII_CODE(code)) + return onigenc_ascii_get_case_fold_codes_by_str(flag, p, end, items, enc); + + len = mbc_enc_len(p, end, enc); + code_lo = get_lower_case(code); + code_up = get_upper_case(code); + + if (code != code_lo) + { + items[0].byte_len = len; + items[0].code_len = 1; + items[0].code[0] = code_lo; + return 1; + } + else if (code != code_up) + { + items[0].byte_len = len; + items[0].code_len = 1; + items[0].code[0] = code_up; + return 1; + } + + return 0; +} + +static int mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end, UChar *lower, OnigEncoding enc) +{ + const UChar *p = *pp; + + if (ONIGENC_IS_MBC_ASCII(p)) + { + *lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p); + (*pp)++; + return 1; + } + else + { + OnigCodePoint code; + int len; + + code = get_lower_case(mbc_to_code(p, end, enc)); + len = code_to_mbc(code, lower, enc); + (*pp) += len; + return len; /* return byte length of converted char to lower */ + } +} + +#if 0 +static int +is_mbc_ambiguous(OnigCaseFoldType flag, + const UChar** pp, const UChar* end) +{ + return onigenc_mbn_is_mbc_ambiguous(enc, flag, pp, end); + +} +#endif + +#if 0 +static int +is_code_ctype(OnigCodePoint code, unsigned int ctype) +{ + if (code < 128) + return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype); + else { + if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) { + return (code_to_mbclen(code) > 1 ? TRUE : FALSE); + } + } + + return FALSE; +} +#endif + +static UChar *left_adjust_char_head(const UChar *start, const UChar *s, + const UChar *end, OnigEncoding enc) +{ + const UChar *p; + int len; + + if (s <= start) + return (UChar *)s; + p = s; + + if (SJIS_ISMB_TRAIL(*p)) + { + while (p > start) + { + if (!SJIS_ISMB_FIRST(*--p)) + { + p++; + break; + } + } + } + len = mbc_enc_len(p, end, enc); + if (p + len > s) + return (UChar *)p; + p += len; + return (UChar *)(p + ((s - p) & ~1)); +} + +static int is_allowed_reverse_match(const UChar *s, const UChar *end, + OnigEncoding enc ARG_UNUSED) +{ + const UChar c = *s; + return (SJIS_ISMB_TRAIL(c) ? FALSE : TRUE); +} + +static const OnigCodePoint CR_Hiragana[] + = {1, 0x829f, 0x82f1}; /* CR_Hiragana */ + +static const OnigCodePoint CR_Katakana[] = { + 4, 0x00a6, 0x00af, 0x00b1, 0x00dd, 0x8340, 0x837e, 0x8380, 0x8396, +}; /* CR_Katakana */ + +#ifdef ENC_CP932 +static const OnigCodePoint CR_Han[] = { + 6, 0x8157, 0x8157, 0x889f, 0x9872, /* Kanji level 1 */ + 0x989f, 0x9ffc, /* Kanji level 2 */ + 0xe040, 0xeaa4, /* Kanji level 2 */ + 0xed40, 0xeeec, /* NEC-selected IBM extended characters (without symbols) */ + 0xfa5c, 0xfc4b, /* IBM extended characters (without symbols) */ +}; /* CR_Han */ +#else +static const OnigCodePoint CR_Han[] = { + 4, 0x8157, 0x8157, 0x889f, 0x9872, /* Kanji level 1 */ + 0x989f, 0x9ffc, /* Kanji level 2 */ + 0xe040, 0xeaa4, /* Kanji level 2 */ +}; /* CR_Han */ +#endif + +static const OnigCodePoint CR_Latin[] = { + 4, 0x0041, 0x005a, 0x0061, 0x007a, 0x8260, 0x8279, 0x8281, 0x829a, +}; /* CR_Latin */ + +static const OnigCodePoint CR_Greek[] = { + 2, 0x839f, 0x83b6, 0x83bf, 0x83d6, +}; /* CR_Greek */ + +static const OnigCodePoint CR_Cyrillic[] = { + 3, 0x8440, 0x8460, 0x8470, 0x847f, 0x8480, 0x8491, +}; /* CR_Cyrillic */ + +#include "enc/jis/props.h" + +static int property_name_to_ctype(OnigEncoding enc, const UChar *p, + const UChar *end) +{ + const UChar *s = p, *e = end; + const struct enc_property *prop + = onig_jis_property((const char *)s, (unsigned int)(e - s)); + + if (!prop) + { + return onigenc_minimum_property_name_to_ctype(enc, s, e); + } + + return (int)prop->ctype; +} + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc) +{ + if (ctype <= ONIGENC_MAX_STD_CTYPE) + { + if (code < 128) + return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype); + else + { + if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) + { + return TRUE; + } + } + } + else + { + ctype -= (ONIGENC_MAX_STD_CTYPE + 1); + if (ctype >= (unsigned int)PropertyListNum) + return ONIGERR_TYPE_BUG; + + return onig_is_in_code_range((UChar *)PropertyList[ctype], code); + } + + return FALSE; +} + +static int get_ctype_code_range(OnigCtype ctype, OnigCodePoint *sb_out, + const OnigCodePoint *ranges[], + OnigEncoding enc ARG_UNUSED) +{ + if (ctype <= ONIGENC_MAX_STD_CTYPE) + { + return ONIG_NO_SUPPORT_CONFIG; + } + else + { + *sb_out = 0x80; + + ctype -= (ONIGENC_MAX_STD_CTYPE + 1); + if (ctype >= (OnigCtype)PropertyListNum) + return ONIGERR_TYPE_BUG; + + *ranges = PropertyList[ctype]; + return 0; + } +} diff --git a/lib/edbee-lib/vendor/onig/enc/unicode.c b/lib/edbee-lib/vendor/onig/enc/unicode.c new file mode 100644 index 00000000..dd063bb1 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/unicode.c @@ -0,0 +1,935 @@ +/********************************************************************** + unicode.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2013 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regint.h" + +#define ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE(code, ctype) \ + ((EncUNICODE_ISO_8859_1_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) +#if 0 +# define ONIGENC_IS_UNICODE_ISO_8859_1_BIT_CTYPE(code, cbit) \ + ((EncUNICODE_ISO_8859_1_CtypeTable[code] & (cbit)) != 0) +#endif + +static const unsigned short EncUNICODE_ISO_8859_1_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0288, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0284, 0x01a0, + 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x30e2, + 0x01a0, 0x00a0, 0x00a8, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x10a0, 0x10a0, + 0x00a0, 0x30e2, 0x00a0, 0x01a0, 0x00a0, 0x10a0, 0x30e2, 0x01a0, 0x10a0, + 0x10a0, 0x10a0, 0x01a0, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2}; + +typedef struct +{ + int n; + OnigCodePoint code[3]; +} CodePointList3; + +typedef struct +{ + OnigCodePoint from; + CodePointList3 to; +} CaseFold_11_Type; + +typedef struct +{ + OnigCodePoint from; + CodePointList3 to; +} CaseUnfold_11_Type; + +typedef struct +{ + int n; + OnigCodePoint code[2]; +} CodePointList2; + +typedef struct +{ + OnigCodePoint from[2]; + CodePointList2 to; +} CaseUnfold_12_Type; + +typedef struct +{ + OnigCodePoint from[3]; + CodePointList2 to; +} CaseUnfold_13_Type; + +static inline int bits_of(const OnigCodePoint c, const int n) +{ + return (c >> (2 - n) * 7) & 127; +} + +static inline int bits_at(const OnigCodePoint *c, const int n) +{ + return bits_of(c[n / 3], n % 3); +} + +static int code1_equal(const OnigCodePoint x, const OnigCodePoint y) +{ + if (x != y) + return 0; + return 1; +} + +static int code2_equal(const OnigCodePoint *x, const OnigCodePoint *y) +{ + if (x[0] != y[0]) + return 0; + if (x[1] != y[1]) + return 0; + return 1; +} + +static int code3_equal(const OnigCodePoint *x, const OnigCodePoint *y) +{ + if (x[0] != y[0]) + return 0; + if (x[1] != y[1]) + return 0; + if (x[2] != y[2]) + return 0; + return 1; +} + +/* macros related to ONIGENC_CASE flags */ +/* defined here because not used in other files */ +#define ONIGENC_CASE_SPECIALS \ + (ONIGENC_CASE_TITLECASE | ONIGENC_CASE_IS_TITLECASE \ + | ONIGENC_CASE_UP_SPECIAL | ONIGENC_CASE_DOWN_SPECIAL) + +/* macros for length in CaseMappingSpecials array in enc/unicode/casefold.h */ +#define SpecialsLengthOffset \ + 25 /* needs to be higher than the 22 bits used for Unicode codepoints */ +#define SpecialsLengthExtract(n) ((n) >> SpecialsLengthOffset) +#define SpecialsCodepointExtract(n) ((n) & ((1 << SpecialsLengthOffset) - 1)) +#define SpecialsLengthEncode(n) ((n) << SpecialsLengthOffset) + +#define OnigSpecialIndexMask \ + (((1 << OnigSpecialIndexWidth) - 1) << OnigSpecialIndexShift) +#define OnigSpecialIndexEncode(n) ((n) << OnigSpecialIndexShift) +#define OnigSpecialIndexDecode(n) \ + (((n) & OnigSpecialIndexMask) >> OnigSpecialIndexShift) + +/* macros to shorten "enc/unicode/casefold.h", undefined immediately after + * including the file */ +#define U ONIGENC_CASE_UPCASE +#define D ONIGENC_CASE_DOWNCASE +#define F ONIGENC_CASE_FOLD +#define ST ONIGENC_CASE_TITLECASE +#define SU ONIGENC_CASE_UP_SPECIAL +#define SL ONIGENC_CASE_DOWN_SPECIAL +#define IT ONIGENC_CASE_IS_TITLECASE +#define I(n) OnigSpecialIndexEncode(n) +#define L(n) SpecialsLengthEncode(n) + +#include "casefold.h" + +#undef U +#undef D +#undef F +#undef ST +#undef SU +#undef SL +#undef IT +#undef I +#undef L + +#include "name2ctype.h" + +#define CODE_RANGES_NUM numberof(CodeRanges) + +extern int onigenc_unicode_is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if ( +#ifdef USE_UNICODE_PROPERTIES + ctype <= ONIGENC_MAX_STD_CTYPE && +#endif + code < 256) + { + return ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE(code, ctype); + } + + if (ctype >= CODE_RANGES_NUM) + { + return ONIGERR_TYPE_BUG; + } + + return onig_is_in_code_range((UChar *)CodeRanges[ctype], code); +} + +extern int onigenc_unicode_ctype_code_range(int ctype, + const OnigCodePoint *ranges[]) +{ + if (ctype >= CODE_RANGES_NUM) + { + return ONIGERR_TYPE_BUG; + } + + *ranges = CodeRanges[ctype]; + + return 0; +} + +extern int onigenc_utf16_32_get_ctype_code_range(OnigCtype ctype, + OnigCodePoint *sb_out, + const OnigCodePoint *ranges[], + OnigEncoding enc ARG_UNUSED) +{ + *sb_out = 0x00; + return onigenc_unicode_ctype_code_range(ctype, ranges); +} + +#define PROPERTY_NAME_MAX_SIZE (MAX_WORD_LENGTH + 1) + +extern int onigenc_unicode_property_name_to_ctype(OnigEncoding enc, + const UChar *name, + const UChar *end) +{ + int len; + int ctype; + UChar buf[PROPERTY_NAME_MAX_SIZE]; + const UChar *p; + OnigCodePoint code; + + len = 0; + for (p = name; p < end; p += enclen(enc, p, end)) + { + code = ONIGENC_MBC_TO_CODE(enc, p, end); + if (code == ' ' || code == '-' || code == '_') + continue; + if (code >= 0x80) + return ONIGERR_INVALID_CHAR_PROPERTY_NAME; + + buf[len++] = ONIGENC_ASCII_CODE_TO_LOWER_CASE(code); + if (len >= PROPERTY_NAME_MAX_SIZE) + return ONIGERR_INVALID_CHAR_PROPERTY_NAME; + } + + buf[len] = 0; + + if ((ctype = uniname2ctype(buf, len)) < 0) + { + return ONIGERR_INVALID_CHAR_PROPERTY_NAME; + } + + return ctype; +} + +#define onigenc_unicode_fold_lookup onigenc_unicode_CaseFold_11_lookup +#define onigenc_unicode_unfold1_lookup onigenc_unicode_CaseUnfold_11_lookup +#define onigenc_unicode_unfold2_lookup onigenc_unicode_CaseUnfold_12_lookup +#define onigenc_unicode_unfold3_lookup onigenc_unicode_CaseUnfold_13_lookup + +enum +{ + I_WITH_DOT_ABOVE = 0x0130, + DOTLESS_i = 0x0131, + DOT_ABOVE = 0x0307 +}; + +extern int onigenc_unicode_mbc_case_fold(OnigEncoding enc, + OnigCaseFoldType flag ARG_UNUSED, + const UChar **pp, const UChar *end, + UChar *fold) +{ + const CodePointList3 *to; + OnigCodePoint code; + int i, len, rlen; + const UChar *p = *pp; + + code = ONIGENC_MBC_TO_CODE(enc, p, end); + len = enclen(enc, p, end); + *pp += len; + +#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI + if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) + { + if (code == 'I') + { + return ONIGENC_CODE_TO_MBC(enc, DOTLESS_i, fold); + } + else if (code == I_WITH_DOT_ABOVE) + { + return ONIGENC_CODE_TO_MBC(enc, 'i', fold); + } + } +#endif + + if ((to = onigenc_unicode_fold_lookup(code)) != 0) + { + if (OnigCodePointCount(to->n) == 1) + { + return ONIGENC_CODE_TO_MBC(enc, to->code[0], fold); + } +#if 0 + /* NO NEEDS TO CHECK */ + else if ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) +#else + else +#endif + { + rlen = 0; + for (i = 0; i < OnigCodePointCount(to->n); i++) + { + len = ONIGENC_CODE_TO_MBC(enc, to->code[i], fold); + fold += len; + rlen += len; + } + return rlen; + } + } + + for (i = 0; i < len; i++) + { + *fold++ = *p++; + } + return len; +} + +extern int onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, + void *arg, + OnigEncoding enc ARG_UNUSED) +{ + const CaseUnfold_11_Type *p11; + OnigCodePoint code; + int i, j, k, r; + + for (i = 0; i < numberof(CaseUnfold_11); i++) + { + p11 = &CaseUnfold_11[i]; + for (j = 0; j < OnigCodePointCount(p11->to.n); j++) + { + code = p11->from; + r = (*f)(p11->to.code[j], &code, 1, arg); + if (r != 0) + return r; + + code = p11->to.code[j]; + r = (*f)(p11->from, &code, 1, arg); + if (r != 0) + return r; + + for (k = 0; k < j; k++) + { + r = (*f)(p11->to.code[j], (OnigCodePoint *)(&p11->to.code[k]), 1, arg); + if (r != 0) + return r; + + r = (*f)(p11->to.code[k], (OnigCodePoint *)(&p11->to.code[j]), 1, arg); + if (r != 0) + return r; + } + } + } + +#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI + if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) + { + code = DOTLESS_i; + r = (*f)('I', &code, 1, arg); + if (r != 0) + return r; + code = 'I'; + r = (*f)(DOTLESS_i, &code, 1, arg); + if (r != 0) + return r; + + code = I_WITH_DOT_ABOVE; + r = (*f)('i', &code, 1, arg); + if (r != 0) + return r; + code = 'i'; + r = (*f)(I_WITH_DOT_ABOVE, &code, 1, arg); + if (r != 0) + return r; + } + else + { +#endif + for (i = 0; i < numberof(CaseUnfold_11_Locale); i++) + { + p11 = &CaseUnfold_11_Locale[i]; + for (j = 0; j < OnigCodePointCount(p11->to.n); j++) + { + code = p11->from; + r = (*f)(p11->to.code[j], &code, 1, arg); + if (r != 0) + return r; + + code = p11->to.code[j]; + r = (*f)(p11->from, &code, 1, arg); + if (r != 0) + return r; + + for (k = 0; k < j; k++) + { + r = (*f)(p11->to.code[j], (OnigCodePoint *)(&p11->to.code[k]), 1, + arg); + if (r != 0) + return r; + + r = (*f)(p11->to.code[k], (OnigCodePoint *)(&p11->to.code[j]), 1, + arg); + if (r != 0) + return r; + } + } + } +#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI + } +#endif + + if ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) + { + for (i = 0; i < numberof(CaseUnfold_12); i++) + { + for (j = 0; j < OnigCodePointCount(CaseUnfold_12[i].to.n); j++) + { + r = (*f)(CaseUnfold_12[i].to.code[j], + (OnigCodePoint *)CaseUnfold_12[i].from, 2, arg); + if (r != 0) + return r; + + for (k = 0; k < OnigCodePointCount(CaseUnfold_12[i].to.n); k++) + { + if (k == j) + continue; + + r = (*f)(CaseUnfold_12[i].to.code[j], + (OnigCodePoint *)(&CaseUnfold_12[i].to.code[k]), 1, arg); + if (r != 0) + return r; + } + } + } + +#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI + if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) == 0) + { +#endif + for (i = 0; i < numberof(CaseUnfold_12_Locale); i++) + { + for (j = 0; j < OnigCodePointCount(CaseUnfold_12_Locale[i].to.n); j++) + { + r = (*f)(CaseUnfold_12_Locale[i].to.code[j], + (OnigCodePoint *)CaseUnfold_12_Locale[i].from, 2, arg); + if (r != 0) + return r; + + for (k = 0; k < OnigCodePointCount(CaseUnfold_12_Locale[i].to.n); k++) + { + if (k == j) + continue; + + r = (*f)(CaseUnfold_12_Locale[i].to.code[j], + (OnigCodePoint *)(&CaseUnfold_12_Locale[i].to.code[k]), 1, + arg); + if (r != 0) + return r; + } + } + } +#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI + } +#endif + + for (i = 0; i < numberof(CaseUnfold_13); i++) + { + for (j = 0; j < OnigCodePointCount(CaseUnfold_13[i].to.n); j++) + { + r = (*f)(CaseUnfold_13[i].to.code[j], + (OnigCodePoint *)CaseUnfold_13[i].from, 3, arg); + if (r != 0) + return r; + + for (k = 0; k < OnigCodePointCount(CaseUnfold_13[i].to.n); k++) + { + if (k == j) + continue; + + r = (*f)(CaseUnfold_13[i].to.code[j], + (OnigCodePoint *)(&CaseUnfold_13[i].to.code[k]), 1, arg); + if (r != 0) + return r; + } + } + } + } + + return 0; +} + +#define CodePointListValidP(x) \ + (OnigCodePointCount((x)->n) <= numberof((x)->code)) + +extern int onigenc_unicode_get_case_fold_codes_by_str( + OnigEncoding enc, OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, OnigCaseFoldCodeItem items[]) +{ + int n, i, j, k, len; + OnigCodePoint code, codes[3]; + const CodePointList3 *to, *z3; + const CodePointList2 *z2; + + n = 0; + + code = ONIGENC_MBC_TO_CODE(enc, p, end); + len = enclen(enc, p, end); + +#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI + if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) + { + switch (code) + { + case 'I': + items[0].byte_len = len; + items[0].code_len = 1; + items[0].code[0] = DOTLESS_i; + return 1; + case I_WITH_DOT_ABOVE: + items[0].byte_len = len; + items[0].code_len = 1; + items[0].code[0] = 'i'; + return 1; + case DOTLESS_i: + items[0].byte_len = len; + items[0].code_len = 1; + items[0].code[0] = 'I'; + return 1; + case 'i': + items[0].byte_len = len; + items[0].code_len = 1; + items[0].code[0] = I_WITH_DOT_ABOVE; + return 1; + } + } +#endif + + if ((to = onigenc_unicode_fold_lookup(code)) != 0) + { + if (OnigCodePointCount(to->n) == 1) + { + OnigCodePoint orig_code = code; + + items[0].byte_len = len; + items[0].code_len = 1; + items[0].code[0] = to->code[0]; + n++; + + code = to->code[0]; + if ((to = onigenc_unicode_unfold1_lookup(code)) != 0 + && CodePointListValidP(to)) + { + for (i = 0; i < OnigCodePointCount(to->n); i++) + { + if (to->code[i] != orig_code) + { + items[n].byte_len = len; + items[n].code_len = 1; + items[n].code[0] = to->code[i]; + n++; + } + } + } + } + else if ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) + { + OnigCodePoint cs[3][4]; + int fn, ncs[3]; + + for (fn = 0; fn < OnigCodePointCount(to->n); fn++) + { + cs[fn][0] = to->code[fn]; + if ((z3 = onigenc_unicode_unfold1_lookup(cs[fn][0])) != 0) + { + for (i = 0; i < OnigCodePointCount(z3->n); i++) + { + cs[fn][i + 1] = z3->code[i]; + } + ncs[fn] = OnigCodePointCount(z3->n) + 1; + } + else + ncs[fn] = 1; + } + + if (fn == 2) + { + for (i = 0; i < ncs[0]; i++) + { + for (j = 0; j < ncs[1]; j++) + { + items[n].byte_len = len; + items[n].code_len = 2; + items[n].code[0] = cs[0][i]; + items[n].code[1] = cs[1][j]; + n++; + } + } + + if ((z2 = onigenc_unicode_unfold2_lookup(to->code)) != 0 + && CodePointListValidP(z2)) + { + for (i = 0; i < OnigCodePointCount(z2->n); i++) + { + if (z2->code[i] == code) + continue; + + items[n].byte_len = len; + items[n].code_len = 1; + items[n].code[0] = z2->code[i]; + n++; + } + } + } + else + { + for (i = 0; i < ncs[0]; i++) + { + for (j = 0; j < ncs[1]; j++) + { + for (k = 0; k < ncs[2]; k++) + { + items[n].byte_len = len; + items[n].code_len = 3; + items[n].code[0] = cs[0][i]; + items[n].code[1] = cs[1][j]; + items[n].code[2] = cs[2][k]; + n++; + } + } + } + + if ((z2 = onigenc_unicode_unfold3_lookup(to->code)) != 0 + && CodePointListValidP(z2)) + { + for (i = 0; i < OnigCodePointCount(z2->n); i++) + { + if (z2->code[i] == code) + continue; + + items[n].byte_len = len; + items[n].code_len = 1; + items[n].code[0] = z2->code[i]; + n++; + } + } + } + + /* multi char folded code is not head of another folded multi char */ + flag = 0; /* DISABLE_CASE_FOLD_MULTI_CHAR(flag); */ + } + } + else + { + if ((to = onigenc_unicode_unfold1_lookup(code)) != 0 + && CodePointListValidP(to)) + { + for (i = 0; i < OnigCodePointCount(to->n); i++) + { + items[n].byte_len = len; + items[n].code_len = 1; + items[n].code[0] = to->code[i]; + n++; + } + } + } + + if ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) + { + p += len; + if (p < end) + { + int clen; + + codes[0] = code; + code = ONIGENC_MBC_TO_CODE(enc, p, end); + if ((to = onigenc_unicode_fold_lookup(code)) != 0 + && OnigCodePointCount(to->n) == 1) + { + codes[1] = to->code[0]; + } + else + codes[1] = code; + + clen = enclen(enc, p, end); + len += clen; + if ((z2 = onigenc_unicode_unfold2_lookup(codes)) != 0 + && CodePointListValidP(z2)) + { + for (i = 0; i < OnigCodePointCount(z2->n); i++) + { + items[n].byte_len = len; + items[n].code_len = 1; + items[n].code[0] = z2->code[i]; + n++; + } + } + + p += clen; + if (p < end) + { + code = ONIGENC_MBC_TO_CODE(enc, p, end); + if ((to = onigenc_unicode_fold_lookup(code)) != 0 + && OnigCodePointCount(to->n) == 1) + { + codes[2] = to->code[0]; + } + else + codes[2] = code; + + clen = enclen(enc, p, end); + len += clen; + if ((z2 = onigenc_unicode_unfold3_lookup(codes)) != 0 + && CodePointListValidP(z2)) + { + for (i = 0; i < OnigCodePointCount(z2->n); i++) + { + items[n].byte_len = len; + items[n].code_len = 1; + items[n].code[0] = z2->code[i]; + n++; + } + } + } + } + } + + return n; +} + +/* length in bytes for three characters in UTF-32; e.g. needed for ffi (U+FB03) + */ +#define CASE_MAPPING_SLACK 12 +#define MODIFIED (flags |= ONIGENC_CASE_MODIFIED) +extern int onigenc_unicode_case_map(OnigCaseFoldType *flagP, + const OnigUChar **pp, const OnigUChar *end, + OnigUChar *to, OnigUChar *to_end, + const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + int codepoint_length; + + to_end -= CASE_MAPPING_SLACK; + /* copy flags ONIGENC_CASE_UPCASE and ONIGENC_CASE_DOWNCASE over to + * ONIGENC_CASE_UP_SPECIAL and ONIGENC_CASE_DOWN_SPECIAL */ + flags |= (flags & (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE)) + << ONIGENC_CASE_SPECIAL_OFFSET; + + while (*pp < end && to <= to_end) + { + codepoint_length = ONIGENC_PRECISE_MBC_ENC_LEN(enc, *pp, end); + if (codepoint_length < 0) + return codepoint_length; /* encoding invalid */ + code = ONIGENC_MBC_TO_CODE(enc, *pp, end); + *pp += codepoint_length; + + if (code <= 'z') + { /* ASCII comes first */ + if (code >= 'a' && code <= 'z') + { + if (flags & ONIGENC_CASE_UPCASE) + { + MODIFIED; + if (flags & ONIGENC_CASE_FOLD_TURKISH_AZERI && code == 'i') + code = I_WITH_DOT_ABOVE; + else + code += 'A' - 'a'; + } + } + else if (code >= 'A' && code <= 'Z') + { + if (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD)) + { + MODIFIED; + if (flags & ONIGENC_CASE_FOLD_TURKISH_AZERI && code == 'I') + code = DOTLESS_i; + else + code += 'a' - 'A'; + } + } + } + else if (!(flags & ONIGENC_CASE_ASCII_ONLY) && code >= 0x00B5) + { /* deal with non-ASCII; micron sign (U+00B5) is lowest affected */ + const CodePointList3 *folded; + + if (code == I_WITH_DOT_ABOVE) + { + if (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD)) + { + MODIFIED; + code = 'i'; + if (!(flags & ONIGENC_CASE_FOLD_TURKISH_AZERI)) + { /* make dot above explicit */ + to += ONIGENC_CODE_TO_MBC(enc, code, to); + code = DOT_ABOVE; + } + } + } + else if (code == DOTLESS_i) + { /* handle this manually, because it isn't involved in folding */ + if (flags & ONIGENC_CASE_UPCASE) + { + MODIFIED; + code = 'I'; + } + } + else if ((folded = onigenc_unicode_fold_lookup(code)) != 0) + { /* data about character found in CaseFold_11_Table */ + if ((flags & ONIGENC_CASE_TITLECASE) /* Titlecase needed, */ + && (OnigCaseFoldFlags(folded->n) & ONIGENC_CASE_IS_TITLECASE)) + { /* but already Titlecase */ + /* already Titlecase, no changes needed */ + } + else if (flags & OnigCaseFoldFlags(folded->n)) + { /* needs and data availability match */ + const OnigCodePoint *next; + int count; + + MODIFIED; + if (flags & OnigCaseFoldFlags(folded->n) & ONIGENC_CASE_SPECIALS) + { /* special */ + const OnigCodePoint *SpecialsStart + = CaseMappingSpecials + OnigSpecialIndexDecode(folded->n); + + if (OnigCaseFoldFlags(folded->n) & ONIGENC_CASE_IS_TITLECASE) + { /* swapCASE available */ + if ((flags & (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE)) + == (ONIGENC_CASE_UPCASE + | ONIGENC_CASE_DOWNCASE)) /* swapCASE needed */ + goto SpecialsCopy; + else /* swapCASE not needed */ + SpecialsStart += SpecialsLengthExtract(*SpecialsStart); + } + if (OnigCaseFoldFlags(folded->n) & ONIGENC_CASE_TITLECASE) + { /* Titlecase available */ + if (flags & ONIGENC_CASE_TITLECASE) /* Titlecase needed, but not + yet Titlecase */ + goto SpecialsCopy; + else /* Titlecase not needed */ + SpecialsStart += SpecialsLengthExtract(*SpecialsStart); + } + if (OnigCaseFoldFlags(folded->n) & ONIGENC_CASE_DOWN_SPECIAL) + { + if (!(flags & ONIGENC_CASE_DOWN_SPECIAL)) + SpecialsStart += SpecialsLengthExtract(*SpecialsStart); + } + /* here, we know we use ONIGENC_CASE_UP_SPECIAL, and the position is + * right */ + SpecialsCopy: + count = SpecialsLengthExtract(*SpecialsStart); + next = SpecialsStart; + code = SpecialsCodepointExtract(*next++); + } + else + { /* no specials */ + count = OnigCodePointCount(folded->n); + next = folded->code; + code = *next++; + } + if (count == 1) + ; + else if (count == 2) + { + to += ONIGENC_CODE_TO_MBC(enc, code, to); + code = *next; + } + else + { /* count == 3 */ + to += ONIGENC_CODE_TO_MBC(enc, code, to); + to += ONIGENC_CODE_TO_MBC(enc, *next++, to); + code = *next; + } + } + } + else if ((folded = onigenc_unicode_unfold1_lookup(code)) + != 0 /* data about character found in CaseUnfold_11_Table */ + && flags & OnigCaseFoldFlags(folded->n)) + { /* needs and data availability match */ + MODIFIED; + code = folded->code[(flags & OnigCaseFoldFlags(folded->n) + & ONIGENC_CASE_TITLECASE) + ? 1 + : 0]; + } + } + to += ONIGENC_CODE_TO_MBC(enc, code, to); + /* switch from titlecase to lowercase for capitalize */ + if (flags & ONIGENC_CASE_TITLECASE) + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE | ONIGENC_CASE_UP_SPECIAL + | ONIGENC_CASE_DOWN_SPECIAL); + } + *flagP = flags; + return (int)(to - to_start); +} + +#if 0 +const char onigenc_unicode_version_string[] = +# ifdef ONIG_UNICODE_VERSION_STRING + ONIG_UNICODE_VERSION_STRING +# endif + ""; + +const int onigenc_unicode_version_number[3] = { +# ifdef ONIG_UNICODE_VERSION_MAJOR + ONIG_UNICODE_VERSION_MAJOR, + ONIG_UNICODE_VERSION_MINOR, + ONIG_UNICODE_VERSION_TEENY, +# else + 0 +# endif +}; +#endif diff --git a/lib/edbee-lib/vendor/onig/enc/unicode/casefold.h b/lib/edbee-lib/vendor/onig/enc/unicode/casefold.h new file mode 100644 index 00000000..07247d73 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/unicode/casefold.h @@ -0,0 +1,9129 @@ +/* DO NOT EDIT THIS FILE. */ +/* Generated by tool/case-folding.rb */ + +#if defined ONIG_UNICODE_VERSION_STRING \ + && !(ONIG_UNICODE_VERSION_MAJOR == 9 && ONIG_UNICODE_VERSION_MINOR == 0 \ + && ONIG_UNICODE_VERSION_TEENY == 0 && 1) +# error ONIG_UNICODE_VERSION_STRING mismatch +#endif +#define ONIG_UNICODE_VERSION_STRING "9.0.0" +#define ONIG_UNICODE_VERSION_MAJOR 9 +#define ONIG_UNICODE_VERSION_MINOR 0 +#define ONIG_UNICODE_VERSION_TEENY 0 + +static const CaseFold_11_Type CaseFold_11_Table[] = { +#define CaseFold (*(CaseFold_11_Type(*)[1399])(CaseFold_11_Table + 0)) + {0x0041, {1 | F | D, {0x0061}}}, + {0x0042, {1 | F | D, {0x0062}}}, + {0x0043, {1 | F | D, {0x0063}}}, + {0x0044, {1 | F | D, {0x0064}}}, + {0x0045, {1 | F | D, {0x0065}}}, + {0x0046, {1 | F | D, {0x0066}}}, + {0x0047, {1 | F | D, {0x0067}}}, + {0x0048, {1 | F | D, {0x0068}}}, + {0x004a, {1 | F | D, {0x006a}}}, + {0x004b, {1 | F | D, {0x006b}}}, + {0x004c, {1 | F | D, {0x006c}}}, + {0x004d, {1 | F | D, {0x006d}}}, + {0x004e, {1 | F | D, {0x006e}}}, + {0x004f, {1 | F | D, {0x006f}}}, + {0x0050, {1 | F | D, {0x0070}}}, + {0x0051, {1 | F | D, {0x0071}}}, + {0x0052, {1 | F | D, {0x0072}}}, + {0x0053, {1 | F | D, {0x0073}}}, + {0x0054, {1 | F | D, {0x0074}}}, + {0x0055, {1 | F | D, {0x0075}}}, + {0x0056, {1 | F | D, {0x0076}}}, + {0x0057, {1 | F | D, {0x0077}}}, + {0x0058, {1 | F | D, {0x0078}}}, + {0x0059, {1 | F | D, {0x0079}}}, + {0x005a, {1 | F | D, {0x007a}}}, + {0x00b5, {1 | F | SU | I(0), {0x03bc}}}, + {0x00c0, {1 | F | D, {0x00e0}}}, + {0x00c1, {1 | F | D, {0x00e1}}}, + {0x00c2, {1 | F | D, {0x00e2}}}, + {0x00c3, {1 | F | D, {0x00e3}}}, + {0x00c4, {1 | F | D, {0x00e4}}}, + {0x00c5, {1 | F | D, {0x00e5}}}, + {0x00c6, {1 | F | D, {0x00e6}}}, + {0x00c7, {1 | F | D, {0x00e7}}}, + {0x00c8, {1 | F | D, {0x00e8}}}, + {0x00c9, {1 | F | D, {0x00e9}}}, + {0x00ca, {1 | F | D, {0x00ea}}}, + {0x00cb, {1 | F | D, {0x00eb}}}, + {0x00cc, {1 | F | D, {0x00ec}}}, + {0x00cd, {1 | F | D, {0x00ed}}}, + {0x00ce, {1 | F | D, {0x00ee}}}, + {0x00cf, {1 | F | D, {0x00ef}}}, + {0x00d0, {1 | F | D, {0x00f0}}}, + {0x00d1, {1 | F | D, {0x00f1}}}, + {0x00d2, {1 | F | D, {0x00f2}}}, + {0x00d3, {1 | F | D, {0x00f3}}}, + {0x00d4, {1 | F | D, {0x00f4}}}, + {0x00d5, {1 | F | D, {0x00f5}}}, + {0x00d6, {1 | F | D, {0x00f6}}}, + {0x00d8, {1 | F | D, {0x00f8}}}, + {0x00d9, {1 | F | D, {0x00f9}}}, + {0x00da, {1 | F | D, {0x00fa}}}, + {0x00db, {1 | F | D, {0x00fb}}}, + {0x00dc, {1 | F | D, {0x00fc}}}, + {0x00dd, {1 | F | D, {0x00fd}}}, + {0x00de, {1 | F | D, {0x00fe}}}, + {0x00df, {2 | F | ST | SU | I(1), {0x0073, 0x0073}}}, + {0x0100, {1 | F | D, {0x0101}}}, + {0x0102, {1 | F | D, {0x0103}}}, + {0x0104, {1 | F | D, {0x0105}}}, + {0x0106, {1 | F | D, {0x0107}}}, + {0x0108, {1 | F | D, {0x0109}}}, + {0x010a, {1 | F | D, {0x010b}}}, + {0x010c, {1 | F | D, {0x010d}}}, + {0x010e, {1 | F | D, {0x010f}}}, + {0x0110, {1 | F | D, {0x0111}}}, + {0x0112, {1 | F | D, {0x0113}}}, + {0x0114, {1 | F | D, {0x0115}}}, + {0x0116, {1 | F | D, {0x0117}}}, + {0x0118, {1 | F | D, {0x0119}}}, + {0x011a, {1 | F | D, {0x011b}}}, + {0x011c, {1 | F | D, {0x011d}}}, + {0x011e, {1 | F | D, {0x011f}}}, + {0x0120, {1 | F | D, {0x0121}}}, + {0x0122, {1 | F | D, {0x0123}}}, + {0x0124, {1 | F | D, {0x0125}}}, + {0x0126, {1 | F | D, {0x0127}}}, + {0x0128, {1 | F | D, {0x0129}}}, + {0x012a, {1 | F | D, {0x012b}}}, + {0x012c, {1 | F | D, {0x012d}}}, + {0x012e, {1 | F | D, {0x012f}}}, + {0x0132, {1 | F | D, {0x0133}}}, + {0x0134, {1 | F | D, {0x0135}}}, + {0x0136, {1 | F | D, {0x0137}}}, + {0x0139, {1 | F | D, {0x013a}}}, + {0x013b, {1 | F | D, {0x013c}}}, + {0x013d, {1 | F | D, {0x013e}}}, + {0x013f, {1 | F | D, {0x0140}}}, + {0x0141, {1 | F | D, {0x0142}}}, + {0x0143, {1 | F | D, {0x0144}}}, + {0x0145, {1 | F | D, {0x0146}}}, + {0x0147, {1 | F | D, {0x0148}}}, + {0x0149, {2 | F | SU | I(5), {0x02bc, 0x006e}}}, + {0x014a, {1 | F | D, {0x014b}}}, + {0x014c, {1 | F | D, {0x014d}}}, + {0x014e, {1 | F | D, {0x014f}}}, + {0x0150, {1 | F | D, {0x0151}}}, + {0x0152, {1 | F | D, {0x0153}}}, + {0x0154, {1 | F | D, {0x0155}}}, + {0x0156, {1 | F | D, {0x0157}}}, + {0x0158, {1 | F | D, {0x0159}}}, + {0x015a, {1 | F | D, {0x015b}}}, + {0x015c, {1 | F | D, {0x015d}}}, + {0x015e, {1 | F | D, {0x015f}}}, + {0x0160, {1 | F | D, {0x0161}}}, + {0x0162, {1 | F | D, {0x0163}}}, + {0x0164, {1 | F | D, {0x0165}}}, + {0x0166, {1 | F | D, {0x0167}}}, + {0x0168, {1 | F | D, {0x0169}}}, + {0x016a, {1 | F | D, {0x016b}}}, + {0x016c, {1 | F | D, {0x016d}}}, + {0x016e, {1 | F | D, {0x016f}}}, + {0x0170, {1 | F | D, {0x0171}}}, + {0x0172, {1 | F | D, {0x0173}}}, + {0x0174, {1 | F | D, {0x0175}}}, + {0x0176, {1 | F | D, {0x0177}}}, + {0x0178, {1 | F | D, {0x00ff}}}, + {0x0179, {1 | F | D, {0x017a}}}, + {0x017b, {1 | F | D, {0x017c}}}, + {0x017d, {1 | F | D, {0x017e}}}, + {0x017f, {1 | F | SU | I(7), {0x0073}}}, + {0x0181, {1 | F | D, {0x0253}}}, + {0x0182, {1 | F | D, {0x0183}}}, + {0x0184, {1 | F | D, {0x0185}}}, + {0x0186, {1 | F | D, {0x0254}}}, + {0x0187, {1 | F | D, {0x0188}}}, + {0x0189, {1 | F | D, {0x0256}}}, + {0x018a, {1 | F | D, {0x0257}}}, + {0x018b, {1 | F | D, {0x018c}}}, + {0x018e, {1 | F | D, {0x01dd}}}, + {0x018f, {1 | F | D, {0x0259}}}, + {0x0190, {1 | F | D, {0x025b}}}, + {0x0191, {1 | F | D, {0x0192}}}, + {0x0193, {1 | F | D, {0x0260}}}, + {0x0194, {1 | F | D, {0x0263}}}, + {0x0196, {1 | F | D, {0x0269}}}, + {0x0197, {1 | F | D, {0x0268}}}, + {0x0198, {1 | F | D, {0x0199}}}, + {0x019c, {1 | F | D, {0x026f}}}, + {0x019d, {1 | F | D, {0x0272}}}, + {0x019f, {1 | F | D, {0x0275}}}, + {0x01a0, {1 | F | D, {0x01a1}}}, + {0x01a2, {1 | F | D, {0x01a3}}}, + {0x01a4, {1 | F | D, {0x01a5}}}, + {0x01a6, {1 | F | D, {0x0280}}}, + {0x01a7, {1 | F | D, {0x01a8}}}, + {0x01a9, {1 | F | D, {0x0283}}}, + {0x01ac, {1 | F | D, {0x01ad}}}, + {0x01ae, {1 | F | D, {0x0288}}}, + {0x01af, {1 | F | D, {0x01b0}}}, + {0x01b1, {1 | F | D, {0x028a}}}, + {0x01b2, {1 | F | D, {0x028b}}}, + {0x01b3, {1 | F | D, {0x01b4}}}, + {0x01b5, {1 | F | D, {0x01b6}}}, + {0x01b7, {1 | F | D, {0x0292}}}, + {0x01b8, {1 | F | D, {0x01b9}}}, + {0x01bc, {1 | F | D, {0x01bd}}}, + {0x01c4, {1 | F | D | ST | I(8), {0x01c6}}}, + {0x01c5, {1 | F | D | IT | SU | I(9), {0x01c6}}}, + {0x01c7, {1 | F | D | ST | I(12), {0x01c9}}}, + {0x01c8, {1 | F | D | IT | SU | I(13), {0x01c9}}}, + {0x01ca, {1 | F | D | ST | I(16), {0x01cc}}}, + {0x01cb, {1 | F | D | IT | SU | I(17), {0x01cc}}}, + {0x01cd, {1 | F | D, {0x01ce}}}, + {0x01cf, {1 | F | D, {0x01d0}}}, + {0x01d1, {1 | F | D, {0x01d2}}}, + {0x01d3, {1 | F | D, {0x01d4}}}, + {0x01d5, {1 | F | D, {0x01d6}}}, + {0x01d7, {1 | F | D, {0x01d8}}}, + {0x01d9, {1 | F | D, {0x01da}}}, + {0x01db, {1 | F | D, {0x01dc}}}, + {0x01de, {1 | F | D, {0x01df}}}, + {0x01e0, {1 | F | D, {0x01e1}}}, + {0x01e2, {1 | F | D, {0x01e3}}}, + {0x01e4, {1 | F | D, {0x01e5}}}, + {0x01e6, {1 | F | D, {0x01e7}}}, + {0x01e8, {1 | F | D, {0x01e9}}}, + {0x01ea, {1 | F | D, {0x01eb}}}, + {0x01ec, {1 | F | D, {0x01ed}}}, + {0x01ee, {1 | F | D, {0x01ef}}}, + {0x01f0, {2 | F | SU | I(20), {0x006a, 0x030c}}}, + {0x01f1, {1 | F | D | ST | I(22), {0x01f3}}}, + {0x01f2, {1 | F | D | IT | SU | I(23), {0x01f3}}}, + {0x01f4, {1 | F | D, {0x01f5}}}, + {0x01f6, {1 | F | D, {0x0195}}}, + {0x01f7, {1 | F | D, {0x01bf}}}, + {0x01f8, {1 | F | D, {0x01f9}}}, + {0x01fa, {1 | F | D, {0x01fb}}}, + {0x01fc, {1 | F | D, {0x01fd}}}, + {0x01fe, {1 | F | D, {0x01ff}}}, + {0x0200, {1 | F | D, {0x0201}}}, + {0x0202, {1 | F | D, {0x0203}}}, + {0x0204, {1 | F | D, {0x0205}}}, + {0x0206, {1 | F | D, {0x0207}}}, + {0x0208, {1 | F | D, {0x0209}}}, + {0x020a, {1 | F | D, {0x020b}}}, + {0x020c, {1 | F | D, {0x020d}}}, + {0x020e, {1 | F | D, {0x020f}}}, + {0x0210, {1 | F | D, {0x0211}}}, + {0x0212, {1 | F | D, {0x0213}}}, + {0x0214, {1 | F | D, {0x0215}}}, + {0x0216, {1 | F | D, {0x0217}}}, + {0x0218, {1 | F | D, {0x0219}}}, + {0x021a, {1 | F | D, {0x021b}}}, + {0x021c, {1 | F | D, {0x021d}}}, + {0x021e, {1 | F | D, {0x021f}}}, + {0x0220, {1 | F | D, {0x019e}}}, + {0x0222, {1 | F | D, {0x0223}}}, + {0x0224, {1 | F | D, {0x0225}}}, + {0x0226, {1 | F | D, {0x0227}}}, + {0x0228, {1 | F | D, {0x0229}}}, + {0x022a, {1 | F | D, {0x022b}}}, + {0x022c, {1 | F | D, {0x022d}}}, + {0x022e, {1 | F | D, {0x022f}}}, + {0x0230, {1 | F | D, {0x0231}}}, + {0x0232, {1 | F | D, {0x0233}}}, + {0x023a, {1 | F | D, {0x2c65}}}, + {0x023b, {1 | F | D, {0x023c}}}, + {0x023d, {1 | F | D, {0x019a}}}, + {0x023e, {1 | F | D, {0x2c66}}}, + {0x0241, {1 | F | D, {0x0242}}}, + {0x0243, {1 | F | D, {0x0180}}}, + {0x0244, {1 | F | D, {0x0289}}}, + {0x0245, {1 | F | D, {0x028c}}}, + {0x0246, {1 | F | D, {0x0247}}}, + {0x0248, {1 | F | D, {0x0249}}}, + {0x024a, {1 | F | D, {0x024b}}}, + {0x024c, {1 | F | D, {0x024d}}}, + {0x024e, {1 | F | D, {0x024f}}}, + {0x0345, {1 | F | SU | I(26), {0x03b9}}}, + {0x0370, {1 | F | D, {0x0371}}}, + {0x0372, {1 | F | D, {0x0373}}}, + {0x0376, {1 | F | D, {0x0377}}}, + {0x037f, {1 | F | D, {0x03f3}}}, + {0x0386, {1 | F | D, {0x03ac}}}, + {0x0388, {1 | F | D, {0x03ad}}}, + {0x0389, {1 | F | D, {0x03ae}}}, + {0x038a, {1 | F | D, {0x03af}}}, + {0x038c, {1 | F | D, {0x03cc}}}, + {0x038e, {1 | F | D, {0x03cd}}}, + {0x038f, {1 | F | D, {0x03ce}}}, + {0x0390, {3 | F | SU | I(27), {0x03b9, 0x0308, 0x0301}}}, + {0x0391, {1 | F | D, {0x03b1}}}, + {0x0392, {1 | F | D, {0x03b2}}}, + {0x0393, {1 | F | D, {0x03b3}}}, + {0x0394, {1 | F | D, {0x03b4}}}, + {0x0395, {1 | F | D, {0x03b5}}}, + {0x0396, {1 | F | D, {0x03b6}}}, + {0x0397, {1 | F | D, {0x03b7}}}, + {0x0398, {1 | F | D, {0x03b8}}}, + {0x0399, {1 | F | D, {0x03b9}}}, + {0x039a, {1 | F | D, {0x03ba}}}, + {0x039b, {1 | F | D, {0x03bb}}}, + {0x039c, {1 | F | D, {0x03bc}}}, + {0x039d, {1 | F | D, {0x03bd}}}, + {0x039e, {1 | F | D, {0x03be}}}, + {0x039f, {1 | F | D, {0x03bf}}}, + {0x03a0, {1 | F | D, {0x03c0}}}, + {0x03a1, {1 | F | D, {0x03c1}}}, + {0x03a3, {1 | F | D, {0x03c3}}}, + {0x03a4, {1 | F | D, {0x03c4}}}, + {0x03a5, {1 | F | D, {0x03c5}}}, + {0x03a6, {1 | F | D, {0x03c6}}}, + {0x03a7, {1 | F | D, {0x03c7}}}, + {0x03a8, {1 | F | D, {0x03c8}}}, + {0x03a9, {1 | F | D, {0x03c9}}}, + {0x03aa, {1 | F | D, {0x03ca}}}, + {0x03ab, {1 | F | D, {0x03cb}}}, + {0x03b0, {3 | F | SU | I(30), {0x03c5, 0x0308, 0x0301}}}, + {0x03c2, {1 | F | SU | I(33), {0x03c3}}}, + {0x03cf, {1 | F | D, {0x03d7}}}, + {0x03d0, {1 | F | SU | I(34), {0x03b2}}}, + {0x03d1, {1 | F | SU | I(35), {0x03b8}}}, + {0x03d5, {1 | F | SU | I(36), {0x03c6}}}, + {0x03d6, {1 | F | SU | I(37), {0x03c0}}}, + {0x03d8, {1 | F | D, {0x03d9}}}, + {0x03da, {1 | F | D, {0x03db}}}, + {0x03dc, {1 | F | D, {0x03dd}}}, + {0x03de, {1 | F | D, {0x03df}}}, + {0x03e0, {1 | F | D, {0x03e1}}}, + {0x03e2, {1 | F | D, {0x03e3}}}, + {0x03e4, {1 | F | D, {0x03e5}}}, + {0x03e6, {1 | F | D, {0x03e7}}}, + {0x03e8, {1 | F | D, {0x03e9}}}, + {0x03ea, {1 | F | D, {0x03eb}}}, + {0x03ec, {1 | F | D, {0x03ed}}}, + {0x03ee, {1 | F | D, {0x03ef}}}, + {0x03f0, {1 | F | SU | I(38), {0x03ba}}}, + {0x03f1, {1 | F | SU | I(39), {0x03c1}}}, + {0x03f4, {1 | F | D, {0x03b8}}}, + {0x03f5, {1 | F | SU | I(40), {0x03b5}}}, + {0x03f7, {1 | F | D, {0x03f8}}}, + {0x03f9, {1 | F | D, {0x03f2}}}, + {0x03fa, {1 | F | D, {0x03fb}}}, + {0x03fd, {1 | F | D, {0x037b}}}, + {0x03fe, {1 | F | D, {0x037c}}}, + {0x03ff, {1 | F | D, {0x037d}}}, + {0x0400, {1 | F | D, {0x0450}}}, + {0x0401, {1 | F | D, {0x0451}}}, + {0x0402, {1 | F | D, {0x0452}}}, + {0x0403, {1 | F | D, {0x0453}}}, + {0x0404, {1 | F | D, {0x0454}}}, + {0x0405, {1 | F | D, {0x0455}}}, + {0x0406, {1 | F | D, {0x0456}}}, + {0x0407, {1 | F | D, {0x0457}}}, + {0x0408, {1 | F | D, {0x0458}}}, + {0x0409, {1 | F | D, {0x0459}}}, + {0x040a, {1 | F | D, {0x045a}}}, + {0x040b, {1 | F | D, {0x045b}}}, + {0x040c, {1 | F | D, {0x045c}}}, + {0x040d, {1 | F | D, {0x045d}}}, + {0x040e, {1 | F | D, {0x045e}}}, + {0x040f, {1 | F | D, {0x045f}}}, + {0x0410, {1 | F | D, {0x0430}}}, + {0x0411, {1 | F | D, {0x0431}}}, + {0x0412, {1 | F | D, {0x0432}}}, + {0x0413, {1 | F | D, {0x0433}}}, + {0x0414, {1 | F | D, {0x0434}}}, + {0x0415, {1 | F | D, {0x0435}}}, + {0x0416, {1 | F | D, {0x0436}}}, + {0x0417, {1 | F | D, {0x0437}}}, + {0x0418, {1 | F | D, {0x0438}}}, + {0x0419, {1 | F | D, {0x0439}}}, + {0x041a, {1 | F | D, {0x043a}}}, + {0x041b, {1 | F | D, {0x043b}}}, + {0x041c, {1 | F | D, {0x043c}}}, + {0x041d, {1 | F | D, {0x043d}}}, + {0x041e, {1 | F | D, {0x043e}}}, + {0x041f, {1 | F | D, {0x043f}}}, + {0x0420, {1 | F | D, {0x0440}}}, + {0x0421, {1 | F | D, {0x0441}}}, + {0x0422, {1 | F | D, {0x0442}}}, + {0x0423, {1 | F | D, {0x0443}}}, + {0x0424, {1 | F | D, {0x0444}}}, + {0x0425, {1 | F | D, {0x0445}}}, + {0x0426, {1 | F | D, {0x0446}}}, + {0x0427, {1 | F | D, {0x0447}}}, + {0x0428, {1 | F | D, {0x0448}}}, + {0x0429, {1 | F | D, {0x0449}}}, + {0x042a, {1 | F | D, {0x044a}}}, + {0x042b, {1 | F | D, {0x044b}}}, + {0x042c, {1 | F | D, {0x044c}}}, + {0x042d, {1 | F | D, {0x044d}}}, + {0x042e, {1 | F | D, {0x044e}}}, + {0x042f, {1 | F | D, {0x044f}}}, + {0x0460, {1 | F | D, {0x0461}}}, + {0x0462, {1 | F | D, {0x0463}}}, + {0x0464, {1 | F | D, {0x0465}}}, + {0x0466, {1 | F | D, {0x0467}}}, + {0x0468, {1 | F | D, {0x0469}}}, + {0x046a, {1 | F | D, {0x046b}}}, + {0x046c, {1 | F | D, {0x046d}}}, + {0x046e, {1 | F | D, {0x046f}}}, + {0x0470, {1 | F | D, {0x0471}}}, + {0x0472, {1 | F | D, {0x0473}}}, + {0x0474, {1 | F | D, {0x0475}}}, + {0x0476, {1 | F | D, {0x0477}}}, + {0x0478, {1 | F | D, {0x0479}}}, + {0x047a, {1 | F | D, {0x047b}}}, + {0x047c, {1 | F | D, {0x047d}}}, + {0x047e, {1 | F | D, {0x047f}}}, + {0x0480, {1 | F | D, {0x0481}}}, + {0x048a, {1 | F | D, {0x048b}}}, + {0x048c, {1 | F | D, {0x048d}}}, + {0x048e, {1 | F | D, {0x048f}}}, + {0x0490, {1 | F | D, {0x0491}}}, + {0x0492, {1 | F | D, {0x0493}}}, + {0x0494, {1 | F | D, {0x0495}}}, + {0x0496, {1 | F | D, {0x0497}}}, + {0x0498, {1 | F | D, {0x0499}}}, + {0x049a, {1 | F | D, {0x049b}}}, + {0x049c, {1 | F | D, {0x049d}}}, + {0x049e, {1 | F | D, {0x049f}}}, + {0x04a0, {1 | F | D, {0x04a1}}}, + {0x04a2, {1 | F | D, {0x04a3}}}, + {0x04a4, {1 | F | D, {0x04a5}}}, + {0x04a6, {1 | F | D, {0x04a7}}}, + {0x04a8, {1 | F | D, {0x04a9}}}, + {0x04aa, {1 | F | D, {0x04ab}}}, + {0x04ac, {1 | F | D, {0x04ad}}}, + {0x04ae, {1 | F | D, {0x04af}}}, + {0x04b0, {1 | F | D, {0x04b1}}}, + {0x04b2, {1 | F | D, {0x04b3}}}, + {0x04b4, {1 | F | D, {0x04b5}}}, + {0x04b6, {1 | F | D, {0x04b7}}}, + {0x04b8, {1 | F | D, {0x04b9}}}, + {0x04ba, {1 | F | D, {0x04bb}}}, + {0x04bc, {1 | F | D, {0x04bd}}}, + {0x04be, {1 | F | D, {0x04bf}}}, + {0x04c0, {1 | F | D, {0x04cf}}}, + {0x04c1, {1 | F | D, {0x04c2}}}, + {0x04c3, {1 | F | D, {0x04c4}}}, + {0x04c5, {1 | F | D, {0x04c6}}}, + {0x04c7, {1 | F | D, {0x04c8}}}, + {0x04c9, {1 | F | D, {0x04ca}}}, + {0x04cb, {1 | F | D, {0x04cc}}}, + {0x04cd, {1 | F | D, {0x04ce}}}, + {0x04d0, {1 | F | D, {0x04d1}}}, + {0x04d2, {1 | F | D, {0x04d3}}}, + {0x04d4, {1 | F | D, {0x04d5}}}, + {0x04d6, {1 | F | D, {0x04d7}}}, + {0x04d8, {1 | F | D, {0x04d9}}}, + {0x04da, {1 | F | D, {0x04db}}}, + {0x04dc, {1 | F | D, {0x04dd}}}, + {0x04de, {1 | F | D, {0x04df}}}, + {0x04e0, {1 | F | D, {0x04e1}}}, + {0x04e2, {1 | F | D, {0x04e3}}}, + {0x04e4, {1 | F | D, {0x04e5}}}, + {0x04e6, {1 | F | D, {0x04e7}}}, + {0x04e8, {1 | F | D, {0x04e9}}}, + {0x04ea, {1 | F | D, {0x04eb}}}, + {0x04ec, {1 | F | D, {0x04ed}}}, + {0x04ee, {1 | F | D, {0x04ef}}}, + {0x04f0, {1 | F | D, {0x04f1}}}, + {0x04f2, {1 | F | D, {0x04f3}}}, + {0x04f4, {1 | F | D, {0x04f5}}}, + {0x04f6, {1 | F | D, {0x04f7}}}, + {0x04f8, {1 | F | D, {0x04f9}}}, + {0x04fa, {1 | F | D, {0x04fb}}}, + {0x04fc, {1 | F | D, {0x04fd}}}, + {0x04fe, {1 | F | D, {0x04ff}}}, + {0x0500, {1 | F | D, {0x0501}}}, + {0x0502, {1 | F | D, {0x0503}}}, + {0x0504, {1 | F | D, {0x0505}}}, + {0x0506, {1 | F | D, {0x0507}}}, + {0x0508, {1 | F | D, {0x0509}}}, + {0x050a, {1 | F | D, {0x050b}}}, + {0x050c, {1 | F | D, {0x050d}}}, + {0x050e, {1 | F | D, {0x050f}}}, + {0x0510, {1 | F | D, {0x0511}}}, + {0x0512, {1 | F | D, {0x0513}}}, + {0x0514, {1 | F | D, {0x0515}}}, + {0x0516, {1 | F | D, {0x0517}}}, + {0x0518, {1 | F | D, {0x0519}}}, + {0x051a, {1 | F | D, {0x051b}}}, + {0x051c, {1 | F | D, {0x051d}}}, + {0x051e, {1 | F | D, {0x051f}}}, + {0x0520, {1 | F | D, {0x0521}}}, + {0x0522, {1 | F | D, {0x0523}}}, + {0x0524, {1 | F | D, {0x0525}}}, + {0x0526, {1 | F | D, {0x0527}}}, + {0x0528, {1 | F | D, {0x0529}}}, + {0x052a, {1 | F | D, {0x052b}}}, + {0x052c, {1 | F | D, {0x052d}}}, + {0x052e, {1 | F | D, {0x052f}}}, + {0x0531, {1 | F | D, {0x0561}}}, + {0x0532, {1 | F | D, {0x0562}}}, + {0x0533, {1 | F | D, {0x0563}}}, + {0x0534, {1 | F | D, {0x0564}}}, + {0x0535, {1 | F | D, {0x0565}}}, + {0x0536, {1 | F | D, {0x0566}}}, + {0x0537, {1 | F | D, {0x0567}}}, + {0x0538, {1 | F | D, {0x0568}}}, + {0x0539, {1 | F | D, {0x0569}}}, + {0x053a, {1 | F | D, {0x056a}}}, + {0x053b, {1 | F | D, {0x056b}}}, + {0x053c, {1 | F | D, {0x056c}}}, + {0x053d, {1 | F | D, {0x056d}}}, + {0x053e, {1 | F | D, {0x056e}}}, + {0x053f, {1 | F | D, {0x056f}}}, + {0x0540, {1 | F | D, {0x0570}}}, + {0x0541, {1 | F | D, {0x0571}}}, + {0x0542, {1 | F | D, {0x0572}}}, + {0x0543, {1 | F | D, {0x0573}}}, + {0x0544, {1 | F | D, {0x0574}}}, + {0x0545, {1 | F | D, {0x0575}}}, + {0x0546, {1 | F | D, {0x0576}}}, + {0x0547, {1 | F | D, {0x0577}}}, + {0x0548, {1 | F | D, {0x0578}}}, + {0x0549, {1 | F | D, {0x0579}}}, + {0x054a, {1 | F | D, {0x057a}}}, + {0x054b, {1 | F | D, {0x057b}}}, + {0x054c, {1 | F | D, {0x057c}}}, + {0x054d, {1 | F | D, {0x057d}}}, + {0x054e, {1 | F | D, {0x057e}}}, + {0x054f, {1 | F | D, {0x057f}}}, + {0x0550, {1 | F | D, {0x0580}}}, + {0x0551, {1 | F | D, {0x0581}}}, + {0x0552, {1 | F | D, {0x0582}}}, + {0x0553, {1 | F | D, {0x0583}}}, + {0x0554, {1 | F | D, {0x0584}}}, + {0x0555, {1 | F | D, {0x0585}}}, + {0x0556, {1 | F | D, {0x0586}}}, + {0x0587, {2 | F | ST | SU | I(41), {0x0565, 0x0582}}}, + {0x10a0, {1 | F | D, {0x2d00}}}, + {0x10a1, {1 | F | D, {0x2d01}}}, + {0x10a2, {1 | F | D, {0x2d02}}}, + {0x10a3, {1 | F | D, {0x2d03}}}, + {0x10a4, {1 | F | D, {0x2d04}}}, + {0x10a5, {1 | F | D, {0x2d05}}}, + {0x10a6, {1 | F | D, {0x2d06}}}, + {0x10a7, {1 | F | D, {0x2d07}}}, + {0x10a8, {1 | F | D, {0x2d08}}}, + {0x10a9, {1 | F | D, {0x2d09}}}, + {0x10aa, {1 | F | D, {0x2d0a}}}, + {0x10ab, {1 | F | D, {0x2d0b}}}, + {0x10ac, {1 | F | D, {0x2d0c}}}, + {0x10ad, {1 | F | D, {0x2d0d}}}, + {0x10ae, {1 | F | D, {0x2d0e}}}, + {0x10af, {1 | F | D, {0x2d0f}}}, + {0x10b0, {1 | F | D, {0x2d10}}}, + {0x10b1, {1 | F | D, {0x2d11}}}, + {0x10b2, {1 | F | D, {0x2d12}}}, + {0x10b3, {1 | F | D, {0x2d13}}}, + {0x10b4, {1 | F | D, {0x2d14}}}, + {0x10b5, {1 | F | D, {0x2d15}}}, + {0x10b6, {1 | F | D, {0x2d16}}}, + {0x10b7, {1 | F | D, {0x2d17}}}, + {0x10b8, {1 | F | D, {0x2d18}}}, + {0x10b9, {1 | F | D, {0x2d19}}}, + {0x10ba, {1 | F | D, {0x2d1a}}}, + {0x10bb, {1 | F | D, {0x2d1b}}}, + {0x10bc, {1 | F | D, {0x2d1c}}}, + {0x10bd, {1 | F | D, {0x2d1d}}}, + {0x10be, {1 | F | D, {0x2d1e}}}, + {0x10bf, {1 | F | D, {0x2d1f}}}, + {0x10c0, {1 | F | D, {0x2d20}}}, + {0x10c1, {1 | F | D, {0x2d21}}}, + {0x10c2, {1 | F | D, {0x2d22}}}, + {0x10c3, {1 | F | D, {0x2d23}}}, + {0x10c4, {1 | F | D, {0x2d24}}}, + {0x10c5, {1 | F | D, {0x2d25}}}, + {0x10c7, {1 | F | D, {0x2d27}}}, + {0x10cd, {1 | F | D, {0x2d2d}}}, + {0x13f8, {1 | F | U, {0x13f0}}}, + {0x13f9, {1 | F | U, {0x13f1}}}, + {0x13fa, {1 | F | U, {0x13f2}}}, + {0x13fb, {1 | F | U, {0x13f3}}}, + {0x13fc, {1 | F | U, {0x13f4}}}, + {0x13fd, {1 | F | U, {0x13f5}}}, + {0x1c80, {1 | F | SU | I(45), {0x0432}}}, + {0x1c81, {1 | F | SU | I(46), {0x0434}}}, + {0x1c82, {1 | F | SU | I(47), {0x043e}}}, + {0x1c83, {1 | F | SU | I(48), {0x0441}}}, + {0x1c84, {1 | F | SU | I(49), {0x0442}}}, + {0x1c85, {1 | F | SU | I(50), {0x0442}}}, + {0x1c86, {1 | F | SU | I(51), {0x044a}}}, + {0x1c87, {1 | F | SU | I(52), {0x0463}}}, + {0x1c88, {1 | F | SU | I(53), {0xa64b}}}, + {0x1e00, {1 | F | D, {0x1e01}}}, + {0x1e02, {1 | F | D, {0x1e03}}}, + {0x1e04, {1 | F | D, {0x1e05}}}, + {0x1e06, {1 | F | D, {0x1e07}}}, + {0x1e08, {1 | F | D, {0x1e09}}}, + {0x1e0a, {1 | F | D, {0x1e0b}}}, + {0x1e0c, {1 | F | D, {0x1e0d}}}, + {0x1e0e, {1 | F | D, {0x1e0f}}}, + {0x1e10, {1 | F | D, {0x1e11}}}, + {0x1e12, {1 | F | D, {0x1e13}}}, + {0x1e14, {1 | F | D, {0x1e15}}}, + {0x1e16, {1 | F | D, {0x1e17}}}, + {0x1e18, {1 | F | D, {0x1e19}}}, + {0x1e1a, {1 | F | D, {0x1e1b}}}, + {0x1e1c, {1 | F | D, {0x1e1d}}}, + {0x1e1e, {1 | F | D, {0x1e1f}}}, + {0x1e20, {1 | F | D, {0x1e21}}}, + {0x1e22, {1 | F | D, {0x1e23}}}, + {0x1e24, {1 | F | D, {0x1e25}}}, + {0x1e26, {1 | F | D, {0x1e27}}}, + {0x1e28, {1 | F | D, {0x1e29}}}, + {0x1e2a, {1 | F | D, {0x1e2b}}}, + {0x1e2c, {1 | F | D, {0x1e2d}}}, + {0x1e2e, {1 | F | D, {0x1e2f}}}, + {0x1e30, {1 | F | D, {0x1e31}}}, + {0x1e32, {1 | F | D, {0x1e33}}}, + {0x1e34, {1 | F | D, {0x1e35}}}, + {0x1e36, {1 | F | D, {0x1e37}}}, + {0x1e38, {1 | F | D, {0x1e39}}}, + {0x1e3a, {1 | F | D, {0x1e3b}}}, + {0x1e3c, {1 | F | D, {0x1e3d}}}, + {0x1e3e, {1 | F | D, {0x1e3f}}}, + {0x1e40, {1 | F | D, {0x1e41}}}, + {0x1e42, {1 | F | D, {0x1e43}}}, + {0x1e44, {1 | F | D, {0x1e45}}}, + {0x1e46, {1 | F | D, {0x1e47}}}, + {0x1e48, {1 | F | D, {0x1e49}}}, + {0x1e4a, {1 | F | D, {0x1e4b}}}, + {0x1e4c, {1 | F | D, {0x1e4d}}}, + {0x1e4e, {1 | F | D, {0x1e4f}}}, + {0x1e50, {1 | F | D, {0x1e51}}}, + {0x1e52, {1 | F | D, {0x1e53}}}, + {0x1e54, {1 | F | D, {0x1e55}}}, + {0x1e56, {1 | F | D, {0x1e57}}}, + {0x1e58, {1 | F | D, {0x1e59}}}, + {0x1e5a, {1 | F | D, {0x1e5b}}}, + {0x1e5c, {1 | F | D, {0x1e5d}}}, + {0x1e5e, {1 | F | D, {0x1e5f}}}, + {0x1e60, {1 | F | D, {0x1e61}}}, + {0x1e62, {1 | F | D, {0x1e63}}}, + {0x1e64, {1 | F | D, {0x1e65}}}, + {0x1e66, {1 | F | D, {0x1e67}}}, + {0x1e68, {1 | F | D, {0x1e69}}}, + {0x1e6a, {1 | F | D, {0x1e6b}}}, + {0x1e6c, {1 | F | D, {0x1e6d}}}, + {0x1e6e, {1 | F | D, {0x1e6f}}}, + {0x1e70, {1 | F | D, {0x1e71}}}, + {0x1e72, {1 | F | D, {0x1e73}}}, + {0x1e74, {1 | F | D, {0x1e75}}}, + {0x1e76, {1 | F | D, {0x1e77}}}, + {0x1e78, {1 | F | D, {0x1e79}}}, + {0x1e7a, {1 | F | D, {0x1e7b}}}, + {0x1e7c, {1 | F | D, {0x1e7d}}}, + {0x1e7e, {1 | F | D, {0x1e7f}}}, + {0x1e80, {1 | F | D, {0x1e81}}}, + {0x1e82, {1 | F | D, {0x1e83}}}, + {0x1e84, {1 | F | D, {0x1e85}}}, + {0x1e86, {1 | F | D, {0x1e87}}}, + {0x1e88, {1 | F | D, {0x1e89}}}, + {0x1e8a, {1 | F | D, {0x1e8b}}}, + {0x1e8c, {1 | F | D, {0x1e8d}}}, + {0x1e8e, {1 | F | D, {0x1e8f}}}, + {0x1e90, {1 | F | D, {0x1e91}}}, + {0x1e92, {1 | F | D, {0x1e93}}}, + {0x1e94, {1 | F | D, {0x1e95}}}, + {0x1e96, {2 | F | SU | I(54), {0x0068, 0x0331}}}, + {0x1e97, {2 | F | SU | I(56), {0x0074, 0x0308}}}, + {0x1e98, {2 | F | SU | I(58), {0x0077, 0x030a}}}, + {0x1e99, {2 | F | SU | I(60), {0x0079, 0x030a}}}, + {0x1e9a, {2 | F | SU | I(62), {0x0061, 0x02be}}}, + {0x1e9b, {1 | F | SU | I(64), {0x1e61}}}, + {0x1e9e, {2 | F | SL | I(65), {0x0073, 0x0073}}}, + {0x1ea0, {1 | F | D, {0x1ea1}}}, + {0x1ea2, {1 | F | D, {0x1ea3}}}, + {0x1ea4, {1 | F | D, {0x1ea5}}}, + {0x1ea6, {1 | F | D, {0x1ea7}}}, + {0x1ea8, {1 | F | D, {0x1ea9}}}, + {0x1eaa, {1 | F | D, {0x1eab}}}, + {0x1eac, {1 | F | D, {0x1ead}}}, + {0x1eae, {1 | F | D, {0x1eaf}}}, + {0x1eb0, {1 | F | D, {0x1eb1}}}, + {0x1eb2, {1 | F | D, {0x1eb3}}}, + {0x1eb4, {1 | F | D, {0x1eb5}}}, + {0x1eb6, {1 | F | D, {0x1eb7}}}, + {0x1eb8, {1 | F | D, {0x1eb9}}}, + {0x1eba, {1 | F | D, {0x1ebb}}}, + {0x1ebc, {1 | F | D, {0x1ebd}}}, + {0x1ebe, {1 | F | D, {0x1ebf}}}, + {0x1ec0, {1 | F | D, {0x1ec1}}}, + {0x1ec2, {1 | F | D, {0x1ec3}}}, + {0x1ec4, {1 | F | D, {0x1ec5}}}, + {0x1ec6, {1 | F | D, {0x1ec7}}}, + {0x1ec8, {1 | F | D, {0x1ec9}}}, + {0x1eca, {1 | F | D, {0x1ecb}}}, + {0x1ecc, {1 | F | D, {0x1ecd}}}, + {0x1ece, {1 | F | D, {0x1ecf}}}, + {0x1ed0, {1 | F | D, {0x1ed1}}}, + {0x1ed2, {1 | F | D, {0x1ed3}}}, + {0x1ed4, {1 | F | D, {0x1ed5}}}, + {0x1ed6, {1 | F | D, {0x1ed7}}}, + {0x1ed8, {1 | F | D, {0x1ed9}}}, + {0x1eda, {1 | F | D, {0x1edb}}}, + {0x1edc, {1 | F | D, {0x1edd}}}, + {0x1ede, {1 | F | D, {0x1edf}}}, + {0x1ee0, {1 | F | D, {0x1ee1}}}, + {0x1ee2, {1 | F | D, {0x1ee3}}}, + {0x1ee4, {1 | F | D, {0x1ee5}}}, + {0x1ee6, {1 | F | D, {0x1ee7}}}, + {0x1ee8, {1 | F | D, {0x1ee9}}}, + {0x1eea, {1 | F | D, {0x1eeb}}}, + {0x1eec, {1 | F | D, {0x1eed}}}, + {0x1eee, {1 | F | D, {0x1eef}}}, + {0x1ef0, {1 | F | D, {0x1ef1}}}, + {0x1ef2, {1 | F | D, {0x1ef3}}}, + {0x1ef4, {1 | F | D, {0x1ef5}}}, + {0x1ef6, {1 | F | D, {0x1ef7}}}, + {0x1ef8, {1 | F | D, {0x1ef9}}}, + {0x1efa, {1 | F | D, {0x1efb}}}, + {0x1efc, {1 | F | D, {0x1efd}}}, + {0x1efe, {1 | F | D, {0x1eff}}}, + {0x1f08, {1 | F | D, {0x1f00}}}, + {0x1f09, {1 | F | D, {0x1f01}}}, + {0x1f0a, {1 | F | D, {0x1f02}}}, + {0x1f0b, {1 | F | D, {0x1f03}}}, + {0x1f0c, {1 | F | D, {0x1f04}}}, + {0x1f0d, {1 | F | D, {0x1f05}}}, + {0x1f0e, {1 | F | D, {0x1f06}}}, + {0x1f0f, {1 | F | D, {0x1f07}}}, + {0x1f18, {1 | F | D, {0x1f10}}}, + {0x1f19, {1 | F | D, {0x1f11}}}, + {0x1f1a, {1 | F | D, {0x1f12}}}, + {0x1f1b, {1 | F | D, {0x1f13}}}, + {0x1f1c, {1 | F | D, {0x1f14}}}, + {0x1f1d, {1 | F | D, {0x1f15}}}, + {0x1f28, {1 | F | D, {0x1f20}}}, + {0x1f29, {1 | F | D, {0x1f21}}}, + {0x1f2a, {1 | F | D, {0x1f22}}}, + {0x1f2b, {1 | F | D, {0x1f23}}}, + {0x1f2c, {1 | F | D, {0x1f24}}}, + {0x1f2d, {1 | F | D, {0x1f25}}}, + {0x1f2e, {1 | F | D, {0x1f26}}}, + {0x1f2f, {1 | F | D, {0x1f27}}}, + {0x1f38, {1 | F | D, {0x1f30}}}, + {0x1f39, {1 | F | D, {0x1f31}}}, + {0x1f3a, {1 | F | D, {0x1f32}}}, + {0x1f3b, {1 | F | D, {0x1f33}}}, + {0x1f3c, {1 | F | D, {0x1f34}}}, + {0x1f3d, {1 | F | D, {0x1f35}}}, + {0x1f3e, {1 | F | D, {0x1f36}}}, + {0x1f3f, {1 | F | D, {0x1f37}}}, + {0x1f48, {1 | F | D, {0x1f40}}}, + {0x1f49, {1 | F | D, {0x1f41}}}, + {0x1f4a, {1 | F | D, {0x1f42}}}, + {0x1f4b, {1 | F | D, {0x1f43}}}, + {0x1f4c, {1 | F | D, {0x1f44}}}, + {0x1f4d, {1 | F | D, {0x1f45}}}, + {0x1f50, {2 | F | SU | I(66), {0x03c5, 0x0313}}}, + {0x1f52, {3 | F | SU | I(68), {0x03c5, 0x0313, 0x0300}}}, + {0x1f54, {3 | F | SU | I(71), {0x03c5, 0x0313, 0x0301}}}, + {0x1f56, {3 | F | SU | I(74), {0x03c5, 0x0313, 0x0342}}}, + {0x1f59, {1 | F | D, {0x1f51}}}, + {0x1f5b, {1 | F | D, {0x1f53}}}, + {0x1f5d, {1 | F | D, {0x1f55}}}, + {0x1f5f, {1 | F | D, {0x1f57}}}, + {0x1f68, {1 | F | D, {0x1f60}}}, + {0x1f69, {1 | F | D, {0x1f61}}}, + {0x1f6a, {1 | F | D, {0x1f62}}}, + {0x1f6b, {1 | F | D, {0x1f63}}}, + {0x1f6c, {1 | F | D, {0x1f64}}}, + {0x1f6d, {1 | F | D, {0x1f65}}}, + {0x1f6e, {1 | F | D, {0x1f66}}}, + {0x1f6f, {1 | F | D, {0x1f67}}}, + {0x1f80, {2 | F | ST | SU | I(77), {0x1f00, 0x03b9}}}, + {0x1f81, {2 | F | ST | SU | I(80), {0x1f01, 0x03b9}}}, + {0x1f82, {2 | F | ST | SU | I(83), {0x1f02, 0x03b9}}}, + {0x1f83, {2 | F | ST | SU | I(86), {0x1f03, 0x03b9}}}, + {0x1f84, {2 | F | ST | SU | I(89), {0x1f04, 0x03b9}}}, + {0x1f85, {2 | F | ST | SU | I(92), {0x1f05, 0x03b9}}}, + {0x1f86, {2 | F | ST | SU | I(95), {0x1f06, 0x03b9}}}, + {0x1f87, {2 | F | ST | SU | I(98), {0x1f07, 0x03b9}}}, + {0x1f88, {2 | F | IT | SL | SU | I(101), {0x1f00, 0x03b9}}}, + {0x1f89, {2 | F | IT | SL | SU | I(106), {0x1f01, 0x03b9}}}, + {0x1f8a, {2 | F | IT | SL | SU | I(111), {0x1f02, 0x03b9}}}, + {0x1f8b, {2 | F | IT | SL | SU | I(116), {0x1f03, 0x03b9}}}, + {0x1f8c, {2 | F | IT | SL | SU | I(121), {0x1f04, 0x03b9}}}, + {0x1f8d, {2 | F | IT | SL | SU | I(126), {0x1f05, 0x03b9}}}, + {0x1f8e, {2 | F | IT | SL | SU | I(131), {0x1f06, 0x03b9}}}, + {0x1f8f, {2 | F | IT | SL | SU | I(136), {0x1f07, 0x03b9}}}, + {0x1f90, {2 | F | ST | SU | I(141), {0x1f20, 0x03b9}}}, + {0x1f91, {2 | F | ST | SU | I(144), {0x1f21, 0x03b9}}}, + {0x1f92, {2 | F | ST | SU | I(147), {0x1f22, 0x03b9}}}, + {0x1f93, {2 | F | ST | SU | I(150), {0x1f23, 0x03b9}}}, + {0x1f94, {2 | F | ST | SU | I(153), {0x1f24, 0x03b9}}}, + {0x1f95, {2 | F | ST | SU | I(156), {0x1f25, 0x03b9}}}, + {0x1f96, {2 | F | ST | SU | I(159), {0x1f26, 0x03b9}}}, + {0x1f97, {2 | F | ST | SU | I(162), {0x1f27, 0x03b9}}}, + {0x1f98, {2 | F | IT | SL | SU | I(165), {0x1f20, 0x03b9}}}, + {0x1f99, {2 | F | IT | SL | SU | I(170), {0x1f21, 0x03b9}}}, + {0x1f9a, {2 | F | IT | SL | SU | I(175), {0x1f22, 0x03b9}}}, + {0x1f9b, {2 | F | IT | SL | SU | I(180), {0x1f23, 0x03b9}}}, + {0x1f9c, {2 | F | IT | SL | SU | I(185), {0x1f24, 0x03b9}}}, + {0x1f9d, {2 | F | IT | SL | SU | I(190), {0x1f25, 0x03b9}}}, + {0x1f9e, {2 | F | IT | SL | SU | I(195), {0x1f26, 0x03b9}}}, + {0x1f9f, {2 | F | IT | SL | SU | I(200), {0x1f27, 0x03b9}}}, + {0x1fa0, {2 | F | ST | SU | I(205), {0x1f60, 0x03b9}}}, + {0x1fa1, {2 | F | ST | SU | I(208), {0x1f61, 0x03b9}}}, + {0x1fa2, {2 | F | ST | SU | I(211), {0x1f62, 0x03b9}}}, + {0x1fa3, {2 | F | ST | SU | I(214), {0x1f63, 0x03b9}}}, + {0x1fa4, {2 | F | ST | SU | I(217), {0x1f64, 0x03b9}}}, + {0x1fa5, {2 | F | ST | SU | I(220), {0x1f65, 0x03b9}}}, + {0x1fa6, {2 | F | ST | SU | I(223), {0x1f66, 0x03b9}}}, + {0x1fa7, {2 | F | ST | SU | I(226), {0x1f67, 0x03b9}}}, + {0x1fa8, {2 | F | IT | SL | SU | I(229), {0x1f60, 0x03b9}}}, + {0x1fa9, {2 | F | IT | SL | SU | I(234), {0x1f61, 0x03b9}}}, + {0x1faa, {2 | F | IT | SL | SU | I(239), {0x1f62, 0x03b9}}}, + {0x1fab, {2 | F | IT | SL | SU | I(244), {0x1f63, 0x03b9}}}, + {0x1fac, {2 | F | IT | SL | SU | I(249), {0x1f64, 0x03b9}}}, + {0x1fad, {2 | F | IT | SL | SU | I(254), {0x1f65, 0x03b9}}}, + {0x1fae, {2 | F | IT | SL | SU | I(259), {0x1f66, 0x03b9}}}, + {0x1faf, {2 | F | IT | SL | SU | I(264), {0x1f67, 0x03b9}}}, + {0x1fb2, {2 | F | ST | SU | I(269), {0x1f70, 0x03b9}}}, + {0x1fb3, {2 | F | ST | SU | I(273), {0x03b1, 0x03b9}}}, + {0x1fb4, {2 | F | ST | SU | I(276), {0x03ac, 0x03b9}}}, + {0x1fb6, {2 | F | SU | I(280), {0x03b1, 0x0342}}}, + {0x1fb7, {3 | F | ST | SU | I(282), {0x03b1, 0x0342, 0x03b9}}}, + {0x1fb8, {1 | F | D, {0x1fb0}}}, + {0x1fb9, {1 | F | D, {0x1fb1}}}, + {0x1fba, {1 | F | D, {0x1f70}}}, + {0x1fbb, {1 | F | D, {0x1f71}}}, + {0x1fbc, {2 | F | IT | SL | SU | I(288), {0x03b1, 0x03b9}}}, + {0x1fbe, {1 | F | SU | I(293), {0x03b9}}}, + {0x1fc2, {2 | F | ST | SU | I(294), {0x1f74, 0x03b9}}}, + {0x1fc3, {2 | F | ST | SU | I(298), {0x03b7, 0x03b9}}}, + {0x1fc4, {2 | F | ST | SU | I(301), {0x03ae, 0x03b9}}}, + {0x1fc6, {2 | F | SU | I(305), {0x03b7, 0x0342}}}, + {0x1fc7, {3 | F | ST | SU | I(307), {0x03b7, 0x0342, 0x03b9}}}, + {0x1fc8, {1 | F | D, {0x1f72}}}, + {0x1fc9, {1 | F | D, {0x1f73}}}, + {0x1fca, {1 | F | D, {0x1f74}}}, + {0x1fcb, {1 | F | D, {0x1f75}}}, + {0x1fcc, {2 | F | IT | SL | SU | I(313), {0x03b7, 0x03b9}}}, + {0x1fd2, {3 | F | SU | I(318), {0x03b9, 0x0308, 0x0300}}}, + {0x1fd3, {3 | F | SU | I(321), {0x03b9, 0x0308, 0x0301}}}, + {0x1fd6, {2 | F | SU | I(324), {0x03b9, 0x0342}}}, + {0x1fd7, {3 | F | SU | I(326), {0x03b9, 0x0308, 0x0342}}}, + {0x1fd8, {1 | F | D, {0x1fd0}}}, + {0x1fd9, {1 | F | D, {0x1fd1}}}, + {0x1fda, {1 | F | D, {0x1f76}}}, + {0x1fdb, {1 | F | D, {0x1f77}}}, + {0x1fe2, {3 | F | SU | I(329), {0x03c5, 0x0308, 0x0300}}}, + {0x1fe3, {3 | F | SU | I(332), {0x03c5, 0x0308, 0x0301}}}, + {0x1fe4, {2 | F | SU | I(335), {0x03c1, 0x0313}}}, + {0x1fe6, {2 | F | SU | I(337), {0x03c5, 0x0342}}}, + {0x1fe7, {3 | F | SU | I(339), {0x03c5, 0x0308, 0x0342}}}, + {0x1fe8, {1 | F | D, {0x1fe0}}}, + {0x1fe9, {1 | F | D, {0x1fe1}}}, + {0x1fea, {1 | F | D, {0x1f7a}}}, + {0x1feb, {1 | F | D, {0x1f7b}}}, + {0x1fec, {1 | F | D, {0x1fe5}}}, + {0x1ff2, {2 | F | ST | SU | I(342), {0x1f7c, 0x03b9}}}, + {0x1ff3, {2 | F | ST | SU | I(346), {0x03c9, 0x03b9}}}, + {0x1ff4, {2 | F | ST | SU | I(349), {0x03ce, 0x03b9}}}, + {0x1ff6, {2 | F | SU | I(353), {0x03c9, 0x0342}}}, + {0x1ff7, {3 | F | ST | SU | I(355), {0x03c9, 0x0342, 0x03b9}}}, + {0x1ff8, {1 | F | D, {0x1f78}}}, + {0x1ff9, {1 | F | D, {0x1f79}}}, + {0x1ffa, {1 | F | D, {0x1f7c}}}, + {0x1ffb, {1 | F | D, {0x1f7d}}}, + {0x1ffc, {2 | F | IT | SL | SU | I(361), {0x03c9, 0x03b9}}}, + {0x2126, {1 | F | D, {0x03c9}}}, + {0x212a, {1 | F | D, {0x006b}}}, + {0x212b, {1 | F | D, {0x00e5}}}, + {0x2132, {1 | F | D, {0x214e}}}, + {0x2160, {1 | F | D, {0x2170}}}, + {0x2161, {1 | F | D, {0x2171}}}, + {0x2162, {1 | F | D, {0x2172}}}, + {0x2163, {1 | F | D, {0x2173}}}, + {0x2164, {1 | F | D, {0x2174}}}, + {0x2165, {1 | F | D, {0x2175}}}, + {0x2166, {1 | F | D, {0x2176}}}, + {0x2167, {1 | F | D, {0x2177}}}, + {0x2168, {1 | F | D, {0x2178}}}, + {0x2169, {1 | F | D, {0x2179}}}, + {0x216a, {1 | F | D, {0x217a}}}, + {0x216b, {1 | F | D, {0x217b}}}, + {0x216c, {1 | F | D, {0x217c}}}, + {0x216d, {1 | F | D, {0x217d}}}, + {0x216e, {1 | F | D, {0x217e}}}, + {0x216f, {1 | F | D, {0x217f}}}, + {0x2183, {1 | F | D, {0x2184}}}, + {0x24b6, {1 | F | D, {0x24d0}}}, + {0x24b7, {1 | F | D, {0x24d1}}}, + {0x24b8, {1 | F | D, {0x24d2}}}, + {0x24b9, {1 | F | D, {0x24d3}}}, + {0x24ba, {1 | F | D, {0x24d4}}}, + {0x24bb, {1 | F | D, {0x24d5}}}, + {0x24bc, {1 | F | D, {0x24d6}}}, + {0x24bd, {1 | F | D, {0x24d7}}}, + {0x24be, {1 | F | D, {0x24d8}}}, + {0x24bf, {1 | F | D, {0x24d9}}}, + {0x24c0, {1 | F | D, {0x24da}}}, + {0x24c1, {1 | F | D, {0x24db}}}, + {0x24c2, {1 | F | D, {0x24dc}}}, + {0x24c3, {1 | F | D, {0x24dd}}}, + {0x24c4, {1 | F | D, {0x24de}}}, + {0x24c5, {1 | F | D, {0x24df}}}, + {0x24c6, {1 | F | D, {0x24e0}}}, + {0x24c7, {1 | F | D, {0x24e1}}}, + {0x24c8, {1 | F | D, {0x24e2}}}, + {0x24c9, {1 | F | D, {0x24e3}}}, + {0x24ca, {1 | F | D, {0x24e4}}}, + {0x24cb, {1 | F | D, {0x24e5}}}, + {0x24cc, {1 | F | D, {0x24e6}}}, + {0x24cd, {1 | F | D, {0x24e7}}}, + {0x24ce, {1 | F | D, {0x24e8}}}, + {0x24cf, {1 | F | D, {0x24e9}}}, + {0x2c00, {1 | F | D, {0x2c30}}}, + {0x2c01, {1 | F | D, {0x2c31}}}, + {0x2c02, {1 | F | D, {0x2c32}}}, + {0x2c03, {1 | F | D, {0x2c33}}}, + {0x2c04, {1 | F | D, {0x2c34}}}, + {0x2c05, {1 | F | D, {0x2c35}}}, + {0x2c06, {1 | F | D, {0x2c36}}}, + {0x2c07, {1 | F | D, {0x2c37}}}, + {0x2c08, {1 | F | D, {0x2c38}}}, + {0x2c09, {1 | F | D, {0x2c39}}}, + {0x2c0a, {1 | F | D, {0x2c3a}}}, + {0x2c0b, {1 | F | D, {0x2c3b}}}, + {0x2c0c, {1 | F | D, {0x2c3c}}}, + {0x2c0d, {1 | F | D, {0x2c3d}}}, + {0x2c0e, {1 | F | D, {0x2c3e}}}, + {0x2c0f, {1 | F | D, {0x2c3f}}}, + {0x2c10, {1 | F | D, {0x2c40}}}, + {0x2c11, {1 | F | D, {0x2c41}}}, + {0x2c12, {1 | F | D, {0x2c42}}}, + {0x2c13, {1 | F | D, {0x2c43}}}, + {0x2c14, {1 | F | D, {0x2c44}}}, + {0x2c15, {1 | F | D, {0x2c45}}}, + {0x2c16, {1 | F | D, {0x2c46}}}, + {0x2c17, {1 | F | D, {0x2c47}}}, + {0x2c18, {1 | F | D, {0x2c48}}}, + {0x2c19, {1 | F | D, {0x2c49}}}, + {0x2c1a, {1 | F | D, {0x2c4a}}}, + {0x2c1b, {1 | F | D, {0x2c4b}}}, + {0x2c1c, {1 | F | D, {0x2c4c}}}, + {0x2c1d, {1 | F | D, {0x2c4d}}}, + {0x2c1e, {1 | F | D, {0x2c4e}}}, + {0x2c1f, {1 | F | D, {0x2c4f}}}, + {0x2c20, {1 | F | D, {0x2c50}}}, + {0x2c21, {1 | F | D, {0x2c51}}}, + {0x2c22, {1 | F | D, {0x2c52}}}, + {0x2c23, {1 | F | D, {0x2c53}}}, + {0x2c24, {1 | F | D, {0x2c54}}}, + {0x2c25, {1 | F | D, {0x2c55}}}, + {0x2c26, {1 | F | D, {0x2c56}}}, + {0x2c27, {1 | F | D, {0x2c57}}}, + {0x2c28, {1 | F | D, {0x2c58}}}, + {0x2c29, {1 | F | D, {0x2c59}}}, + {0x2c2a, {1 | F | D, {0x2c5a}}}, + {0x2c2b, {1 | F | D, {0x2c5b}}}, + {0x2c2c, {1 | F | D, {0x2c5c}}}, + {0x2c2d, {1 | F | D, {0x2c5d}}}, + {0x2c2e, {1 | F | D, {0x2c5e}}}, + {0x2c60, {1 | F | D, {0x2c61}}}, + {0x2c62, {1 | F | D, {0x026b}}}, + {0x2c63, {1 | F | D, {0x1d7d}}}, + {0x2c64, {1 | F | D, {0x027d}}}, + {0x2c67, {1 | F | D, {0x2c68}}}, + {0x2c69, {1 | F | D, {0x2c6a}}}, + {0x2c6b, {1 | F | D, {0x2c6c}}}, + {0x2c6d, {1 | F | D, {0x0251}}}, + {0x2c6e, {1 | F | D, {0x0271}}}, + {0x2c6f, {1 | F | D, {0x0250}}}, + {0x2c70, {1 | F | D, {0x0252}}}, + {0x2c72, {1 | F | D, {0x2c73}}}, + {0x2c75, {1 | F | D, {0x2c76}}}, + {0x2c7e, {1 | F | D, {0x023f}}}, + {0x2c7f, {1 | F | D, {0x0240}}}, + {0x2c80, {1 | F | D, {0x2c81}}}, + {0x2c82, {1 | F | D, {0x2c83}}}, + {0x2c84, {1 | F | D, {0x2c85}}}, + {0x2c86, {1 | F | D, {0x2c87}}}, + {0x2c88, {1 | F | D, {0x2c89}}}, + {0x2c8a, {1 | F | D, {0x2c8b}}}, + {0x2c8c, {1 | F | D, {0x2c8d}}}, + {0x2c8e, {1 | F | D, {0x2c8f}}}, + {0x2c90, {1 | F | D, {0x2c91}}}, + {0x2c92, {1 | F | D, {0x2c93}}}, + {0x2c94, {1 | F | D, {0x2c95}}}, + {0x2c96, {1 | F | D, {0x2c97}}}, + {0x2c98, {1 | F | D, {0x2c99}}}, + {0x2c9a, {1 | F | D, {0x2c9b}}}, + {0x2c9c, {1 | F | D, {0x2c9d}}}, + {0x2c9e, {1 | F | D, {0x2c9f}}}, + {0x2ca0, {1 | F | D, {0x2ca1}}}, + {0x2ca2, {1 | F | D, {0x2ca3}}}, + {0x2ca4, {1 | F | D, {0x2ca5}}}, + {0x2ca6, {1 | F | D, {0x2ca7}}}, + {0x2ca8, {1 | F | D, {0x2ca9}}}, + {0x2caa, {1 | F | D, {0x2cab}}}, + {0x2cac, {1 | F | D, {0x2cad}}}, + {0x2cae, {1 | F | D, {0x2caf}}}, + {0x2cb0, {1 | F | D, {0x2cb1}}}, + {0x2cb2, {1 | F | D, {0x2cb3}}}, + {0x2cb4, {1 | F | D, {0x2cb5}}}, + {0x2cb6, {1 | F | D, {0x2cb7}}}, + {0x2cb8, {1 | F | D, {0x2cb9}}}, + {0x2cba, {1 | F | D, {0x2cbb}}}, + {0x2cbc, {1 | F | D, {0x2cbd}}}, + {0x2cbe, {1 | F | D, {0x2cbf}}}, + {0x2cc0, {1 | F | D, {0x2cc1}}}, + {0x2cc2, {1 | F | D, {0x2cc3}}}, + {0x2cc4, {1 | F | D, {0x2cc5}}}, + {0x2cc6, {1 | F | D, {0x2cc7}}}, + {0x2cc8, {1 | F | D, {0x2cc9}}}, + {0x2cca, {1 | F | D, {0x2ccb}}}, + {0x2ccc, {1 | F | D, {0x2ccd}}}, + {0x2cce, {1 | F | D, {0x2ccf}}}, + {0x2cd0, {1 | F | D, {0x2cd1}}}, + {0x2cd2, {1 | F | D, {0x2cd3}}}, + {0x2cd4, {1 | F | D, {0x2cd5}}}, + {0x2cd6, {1 | F | D, {0x2cd7}}}, + {0x2cd8, {1 | F | D, {0x2cd9}}}, + {0x2cda, {1 | F | D, {0x2cdb}}}, + {0x2cdc, {1 | F | D, {0x2cdd}}}, + {0x2cde, {1 | F | D, {0x2cdf}}}, + {0x2ce0, {1 | F | D, {0x2ce1}}}, + {0x2ce2, {1 | F | D, {0x2ce3}}}, + {0x2ceb, {1 | F | D, {0x2cec}}}, + {0x2ced, {1 | F | D, {0x2cee}}}, + {0x2cf2, {1 | F | D, {0x2cf3}}}, + {0xa640, {1 | F | D, {0xa641}}}, + {0xa642, {1 | F | D, {0xa643}}}, + {0xa644, {1 | F | D, {0xa645}}}, + {0xa646, {1 | F | D, {0xa647}}}, + {0xa648, {1 | F | D, {0xa649}}}, + {0xa64a, {1 | F | D, {0xa64b}}}, + {0xa64c, {1 | F | D, {0xa64d}}}, + {0xa64e, {1 | F | D, {0xa64f}}}, + {0xa650, {1 | F | D, {0xa651}}}, + {0xa652, {1 | F | D, {0xa653}}}, + {0xa654, {1 | F | D, {0xa655}}}, + {0xa656, {1 | F | D, {0xa657}}}, + {0xa658, {1 | F | D, {0xa659}}}, + {0xa65a, {1 | F | D, {0xa65b}}}, + {0xa65c, {1 | F | D, {0xa65d}}}, + {0xa65e, {1 | F | D, {0xa65f}}}, + {0xa660, {1 | F | D, {0xa661}}}, + {0xa662, {1 | F | D, {0xa663}}}, + {0xa664, {1 | F | D, {0xa665}}}, + {0xa666, {1 | F | D, {0xa667}}}, + {0xa668, {1 | F | D, {0xa669}}}, + {0xa66a, {1 | F | D, {0xa66b}}}, + {0xa66c, {1 | F | D, {0xa66d}}}, + {0xa680, {1 | F | D, {0xa681}}}, + {0xa682, {1 | F | D, {0xa683}}}, + {0xa684, {1 | F | D, {0xa685}}}, + {0xa686, {1 | F | D, {0xa687}}}, + {0xa688, {1 | F | D, {0xa689}}}, + {0xa68a, {1 | F | D, {0xa68b}}}, + {0xa68c, {1 | F | D, {0xa68d}}}, + {0xa68e, {1 | F | D, {0xa68f}}}, + {0xa690, {1 | F | D, {0xa691}}}, + {0xa692, {1 | F | D, {0xa693}}}, + {0xa694, {1 | F | D, {0xa695}}}, + {0xa696, {1 | F | D, {0xa697}}}, + {0xa698, {1 | F | D, {0xa699}}}, + {0xa69a, {1 | F | D, {0xa69b}}}, + {0xa722, {1 | F | D, {0xa723}}}, + {0xa724, {1 | F | D, {0xa725}}}, + {0xa726, {1 | F | D, {0xa727}}}, + {0xa728, {1 | F | D, {0xa729}}}, + {0xa72a, {1 | F | D, {0xa72b}}}, + {0xa72c, {1 | F | D, {0xa72d}}}, + {0xa72e, {1 | F | D, {0xa72f}}}, + {0xa732, {1 | F | D, {0xa733}}}, + {0xa734, {1 | F | D, {0xa735}}}, + {0xa736, {1 | F | D, {0xa737}}}, + {0xa738, {1 | F | D, {0xa739}}}, + {0xa73a, {1 | F | D, {0xa73b}}}, + {0xa73c, {1 | F | D, {0xa73d}}}, + {0xa73e, {1 | F | D, {0xa73f}}}, + {0xa740, {1 | F | D, {0xa741}}}, + {0xa742, {1 | F | D, {0xa743}}}, + {0xa744, {1 | F | D, {0xa745}}}, + {0xa746, {1 | F | D, {0xa747}}}, + {0xa748, {1 | F | D, {0xa749}}}, + {0xa74a, {1 | F | D, {0xa74b}}}, + {0xa74c, {1 | F | D, {0xa74d}}}, + {0xa74e, {1 | F | D, {0xa74f}}}, + {0xa750, {1 | F | D, {0xa751}}}, + {0xa752, {1 | F | D, {0xa753}}}, + {0xa754, {1 | F | D, {0xa755}}}, + {0xa756, {1 | F | D, {0xa757}}}, + {0xa758, {1 | F | D, {0xa759}}}, + {0xa75a, {1 | F | D, {0xa75b}}}, + {0xa75c, {1 | F | D, {0xa75d}}}, + {0xa75e, {1 | F | D, {0xa75f}}}, + {0xa760, {1 | F | D, {0xa761}}}, + {0xa762, {1 | F | D, {0xa763}}}, + {0xa764, {1 | F | D, {0xa765}}}, + {0xa766, {1 | F | D, {0xa767}}}, + {0xa768, {1 | F | D, {0xa769}}}, + {0xa76a, {1 | F | D, {0xa76b}}}, + {0xa76c, {1 | F | D, {0xa76d}}}, + {0xa76e, {1 | F | D, {0xa76f}}}, + {0xa779, {1 | F | D, {0xa77a}}}, + {0xa77b, {1 | F | D, {0xa77c}}}, + {0xa77d, {1 | F | D, {0x1d79}}}, + {0xa77e, {1 | F | D, {0xa77f}}}, + {0xa780, {1 | F | D, {0xa781}}}, + {0xa782, {1 | F | D, {0xa783}}}, + {0xa784, {1 | F | D, {0xa785}}}, + {0xa786, {1 | F | D, {0xa787}}}, + {0xa78b, {1 | F | D, {0xa78c}}}, + {0xa78d, {1 | F | D, {0x0265}}}, + {0xa790, {1 | F | D, {0xa791}}}, + {0xa792, {1 | F | D, {0xa793}}}, + {0xa796, {1 | F | D, {0xa797}}}, + {0xa798, {1 | F | D, {0xa799}}}, + {0xa79a, {1 | F | D, {0xa79b}}}, + {0xa79c, {1 | F | D, {0xa79d}}}, + {0xa79e, {1 | F | D, {0xa79f}}}, + {0xa7a0, {1 | F | D, {0xa7a1}}}, + {0xa7a2, {1 | F | D, {0xa7a3}}}, + {0xa7a4, {1 | F | D, {0xa7a5}}}, + {0xa7a6, {1 | F | D, {0xa7a7}}}, + {0xa7a8, {1 | F | D, {0xa7a9}}}, + {0xa7aa, {1 | F | D, {0x0266}}}, + {0xa7ab, {1 | F | D, {0x025c}}}, + {0xa7ac, {1 | F | D, {0x0261}}}, + {0xa7ad, {1 | F | D, {0x026c}}}, + {0xa7ae, {1 | F | D, {0x026a}}}, + {0xa7b0, {1 | F | D, {0x029e}}}, + {0xa7b1, {1 | F | D, {0x0287}}}, + {0xa7b2, {1 | F | D, {0x029d}}}, + {0xa7b3, {1 | F | D, {0xab53}}}, + {0xa7b4, {1 | F | D, {0xa7b5}}}, + {0xa7b6, {1 | F | D, {0xa7b7}}}, + {0xab70, {1 | F | U, {0x13a0}}}, + {0xab71, {1 | F | U, {0x13a1}}}, + {0xab72, {1 | F | U, {0x13a2}}}, + {0xab73, {1 | F | U, {0x13a3}}}, + {0xab74, {1 | F | U, {0x13a4}}}, + {0xab75, {1 | F | U, {0x13a5}}}, + {0xab76, {1 | F | U, {0x13a6}}}, + {0xab77, {1 | F | U, {0x13a7}}}, + {0xab78, {1 | F | U, {0x13a8}}}, + {0xab79, {1 | F | U, {0x13a9}}}, + {0xab7a, {1 | F | U, {0x13aa}}}, + {0xab7b, {1 | F | U, {0x13ab}}}, + {0xab7c, {1 | F | U, {0x13ac}}}, + {0xab7d, {1 | F | U, {0x13ad}}}, + {0xab7e, {1 | F | U, {0x13ae}}}, + {0xab7f, {1 | F | U, {0x13af}}}, + {0xab80, {1 | F | U, {0x13b0}}}, + {0xab81, {1 | F | U, {0x13b1}}}, + {0xab82, {1 | F | U, {0x13b2}}}, + {0xab83, {1 | F | U, {0x13b3}}}, + {0xab84, {1 | F | U, {0x13b4}}}, + {0xab85, {1 | F | U, {0x13b5}}}, + {0xab86, {1 | F | U, {0x13b6}}}, + {0xab87, {1 | F | U, {0x13b7}}}, + {0xab88, {1 | F | U, {0x13b8}}}, + {0xab89, {1 | F | U, {0x13b9}}}, + {0xab8a, {1 | F | U, {0x13ba}}}, + {0xab8b, {1 | F | U, {0x13bb}}}, + {0xab8c, {1 | F | U, {0x13bc}}}, + {0xab8d, {1 | F | U, {0x13bd}}}, + {0xab8e, {1 | F | U, {0x13be}}}, + {0xab8f, {1 | F | U, {0x13bf}}}, + {0xab90, {1 | F | U, {0x13c0}}}, + {0xab91, {1 | F | U, {0x13c1}}}, + {0xab92, {1 | F | U, {0x13c2}}}, + {0xab93, {1 | F | U, {0x13c3}}}, + {0xab94, {1 | F | U, {0x13c4}}}, + {0xab95, {1 | F | U, {0x13c5}}}, + {0xab96, {1 | F | U, {0x13c6}}}, + {0xab97, {1 | F | U, {0x13c7}}}, + {0xab98, {1 | F | U, {0x13c8}}}, + {0xab99, {1 | F | U, {0x13c9}}}, + {0xab9a, {1 | F | U, {0x13ca}}}, + {0xab9b, {1 | F | U, {0x13cb}}}, + {0xab9c, {1 | F | U, {0x13cc}}}, + {0xab9d, {1 | F | U, {0x13cd}}}, + {0xab9e, {1 | F | U, {0x13ce}}}, + {0xab9f, {1 | F | U, {0x13cf}}}, + {0xaba0, {1 | F | U, {0x13d0}}}, + {0xaba1, {1 | F | U, {0x13d1}}}, + {0xaba2, {1 | F | U, {0x13d2}}}, + {0xaba3, {1 | F | U, {0x13d3}}}, + {0xaba4, {1 | F | U, {0x13d4}}}, + {0xaba5, {1 | F | U, {0x13d5}}}, + {0xaba6, {1 | F | U, {0x13d6}}}, + {0xaba7, {1 | F | U, {0x13d7}}}, + {0xaba8, {1 | F | U, {0x13d8}}}, + {0xaba9, {1 | F | U, {0x13d9}}}, + {0xabaa, {1 | F | U, {0x13da}}}, + {0xabab, {1 | F | U, {0x13db}}}, + {0xabac, {1 | F | U, {0x13dc}}}, + {0xabad, {1 | F | U, {0x13dd}}}, + {0xabae, {1 | F | U, {0x13de}}}, + {0xabaf, {1 | F | U, {0x13df}}}, + {0xabb0, {1 | F | U, {0x13e0}}}, + {0xabb1, {1 | F | U, {0x13e1}}}, + {0xabb2, {1 | F | U, {0x13e2}}}, + {0xabb3, {1 | F | U, {0x13e3}}}, + {0xabb4, {1 | F | U, {0x13e4}}}, + {0xabb5, {1 | F | U, {0x13e5}}}, + {0xabb6, {1 | F | U, {0x13e6}}}, + {0xabb7, {1 | F | U, {0x13e7}}}, + {0xabb8, {1 | F | U, {0x13e8}}}, + {0xabb9, {1 | F | U, {0x13e9}}}, + {0xabba, {1 | F | U, {0x13ea}}}, + {0xabbb, {1 | F | U, {0x13eb}}}, + {0xabbc, {1 | F | U, {0x13ec}}}, + {0xabbd, {1 | F | U, {0x13ed}}}, + {0xabbe, {1 | F | U, {0x13ee}}}, + {0xabbf, {1 | F | U, {0x13ef}}}, + {0xfb00, {2 | F | ST | SU | I(366), {0x0066, 0x0066}}}, + {0xfb01, {2 | F | ST | SU | I(370), {0x0066, 0x0069}}}, + {0xfb02, {2 | F | ST | SU | I(374), {0x0066, 0x006c}}}, + {0xfb03, {3 | F | ST | SU | I(378), {0x0066, 0x0066, 0x0069}}}, + {0xfb04, {3 | F | ST | SU | I(384), {0x0066, 0x0066, 0x006c}}}, + {0xfb05, {2 | F | ST | SU | I(390), {0x0073, 0x0074}}}, + {0xfb06, {2 | F | ST | SU | I(394), {0x0073, 0x0074}}}, + {0xfb13, {2 | F | ST | SU | I(398), {0x0574, 0x0576}}}, + {0xfb14, {2 | F | ST | SU | I(402), {0x0574, 0x0565}}}, + {0xfb15, {2 | F | ST | SU | I(406), {0x0574, 0x056b}}}, + {0xfb16, {2 | F | ST | SU | I(410), {0x057e, 0x0576}}}, + {0xfb17, {2 | F | ST | SU | I(414), {0x0574, 0x056d}}}, + {0xff21, {1 | F | D, {0xff41}}}, + {0xff22, {1 | F | D, {0xff42}}}, + {0xff23, {1 | F | D, {0xff43}}}, + {0xff24, {1 | F | D, {0xff44}}}, + {0xff25, {1 | F | D, {0xff45}}}, + {0xff26, {1 | F | D, {0xff46}}}, + {0xff27, {1 | F | D, {0xff47}}}, + {0xff28, {1 | F | D, {0xff48}}}, + {0xff29, {1 | F | D, {0xff49}}}, + {0xff2a, {1 | F | D, {0xff4a}}}, + {0xff2b, {1 | F | D, {0xff4b}}}, + {0xff2c, {1 | F | D, {0xff4c}}}, + {0xff2d, {1 | F | D, {0xff4d}}}, + {0xff2e, {1 | F | D, {0xff4e}}}, + {0xff2f, {1 | F | D, {0xff4f}}}, + {0xff30, {1 | F | D, {0xff50}}}, + {0xff31, {1 | F | D, {0xff51}}}, + {0xff32, {1 | F | D, {0xff52}}}, + {0xff33, {1 | F | D, {0xff53}}}, + {0xff34, {1 | F | D, {0xff54}}}, + {0xff35, {1 | F | D, {0xff55}}}, + {0xff36, {1 | F | D, {0xff56}}}, + {0xff37, {1 | F | D, {0xff57}}}, + {0xff38, {1 | F | D, {0xff58}}}, + {0xff39, {1 | F | D, {0xff59}}}, + {0xff3a, {1 | F | D, {0xff5a}}}, + {0x10400, {1 | F | D, {0x10428}}}, + {0x10401, {1 | F | D, {0x10429}}}, + {0x10402, {1 | F | D, {0x1042a}}}, + {0x10403, {1 | F | D, {0x1042b}}}, + {0x10404, {1 | F | D, {0x1042c}}}, + {0x10405, {1 | F | D, {0x1042d}}}, + {0x10406, {1 | F | D, {0x1042e}}}, + {0x10407, {1 | F | D, {0x1042f}}}, + {0x10408, {1 | F | D, {0x10430}}}, + {0x10409, {1 | F | D, {0x10431}}}, + {0x1040a, {1 | F | D, {0x10432}}}, + {0x1040b, {1 | F | D, {0x10433}}}, + {0x1040c, {1 | F | D, {0x10434}}}, + {0x1040d, {1 | F | D, {0x10435}}}, + {0x1040e, {1 | F | D, {0x10436}}}, + {0x1040f, {1 | F | D, {0x10437}}}, + {0x10410, {1 | F | D, {0x10438}}}, + {0x10411, {1 | F | D, {0x10439}}}, + {0x10412, {1 | F | D, {0x1043a}}}, + {0x10413, {1 | F | D, {0x1043b}}}, + {0x10414, {1 | F | D, {0x1043c}}}, + {0x10415, {1 | F | D, {0x1043d}}}, + {0x10416, {1 | F | D, {0x1043e}}}, + {0x10417, {1 | F | D, {0x1043f}}}, + {0x10418, {1 | F | D, {0x10440}}}, + {0x10419, {1 | F | D, {0x10441}}}, + {0x1041a, {1 | F | D, {0x10442}}}, + {0x1041b, {1 | F | D, {0x10443}}}, + {0x1041c, {1 | F | D, {0x10444}}}, + {0x1041d, {1 | F | D, {0x10445}}}, + {0x1041e, {1 | F | D, {0x10446}}}, + {0x1041f, {1 | F | D, {0x10447}}}, + {0x10420, {1 | F | D, {0x10448}}}, + {0x10421, {1 | F | D, {0x10449}}}, + {0x10422, {1 | F | D, {0x1044a}}}, + {0x10423, {1 | F | D, {0x1044b}}}, + {0x10424, {1 | F | D, {0x1044c}}}, + {0x10425, {1 | F | D, {0x1044d}}}, + {0x10426, {1 | F | D, {0x1044e}}}, + {0x10427, {1 | F | D, {0x1044f}}}, + {0x104b0, {1 | F | D, {0x104d8}}}, + {0x104b1, {1 | F | D, {0x104d9}}}, + {0x104b2, {1 | F | D, {0x104da}}}, + {0x104b3, {1 | F | D, {0x104db}}}, + {0x104b4, {1 | F | D, {0x104dc}}}, + {0x104b5, {1 | F | D, {0x104dd}}}, + {0x104b6, {1 | F | D, {0x104de}}}, + {0x104b7, {1 | F | D, {0x104df}}}, + {0x104b8, {1 | F | D, {0x104e0}}}, + {0x104b9, {1 | F | D, {0x104e1}}}, + {0x104ba, {1 | F | D, {0x104e2}}}, + {0x104bb, {1 | F | D, {0x104e3}}}, + {0x104bc, {1 | F | D, {0x104e4}}}, + {0x104bd, {1 | F | D, {0x104e5}}}, + {0x104be, {1 | F | D, {0x104e6}}}, + {0x104bf, {1 | F | D, {0x104e7}}}, + {0x104c0, {1 | F | D, {0x104e8}}}, + {0x104c1, {1 | F | D, {0x104e9}}}, + {0x104c2, {1 | F | D, {0x104ea}}}, + {0x104c3, {1 | F | D, {0x104eb}}}, + {0x104c4, {1 | F | D, {0x104ec}}}, + {0x104c5, {1 | F | D, {0x104ed}}}, + {0x104c6, {1 | F | D, {0x104ee}}}, + {0x104c7, {1 | F | D, {0x104ef}}}, + {0x104c8, {1 | F | D, {0x104f0}}}, + {0x104c9, {1 | F | D, {0x104f1}}}, + {0x104ca, {1 | F | D, {0x104f2}}}, + {0x104cb, {1 | F | D, {0x104f3}}}, + {0x104cc, {1 | F | D, {0x104f4}}}, + {0x104cd, {1 | F | D, {0x104f5}}}, + {0x104ce, {1 | F | D, {0x104f6}}}, + {0x104cf, {1 | F | D, {0x104f7}}}, + {0x104d0, {1 | F | D, {0x104f8}}}, + {0x104d1, {1 | F | D, {0x104f9}}}, + {0x104d2, {1 | F | D, {0x104fa}}}, + {0x104d3, {1 | F | D, {0x104fb}}}, + {0x10c80, {1 | F | D, {0x10cc0}}}, + {0x10c81, {1 | F | D, {0x10cc1}}}, + {0x10c82, {1 | F | D, {0x10cc2}}}, + {0x10c83, {1 | F | D, {0x10cc3}}}, + {0x10c84, {1 | F | D, {0x10cc4}}}, + {0x10c85, {1 | F | D, {0x10cc5}}}, + {0x10c86, {1 | F | D, {0x10cc6}}}, + {0x10c87, {1 | F | D, {0x10cc7}}}, + {0x10c88, {1 | F | D, {0x10cc8}}}, + {0x10c89, {1 | F | D, {0x10cc9}}}, + {0x10c8a, {1 | F | D, {0x10cca}}}, + {0x10c8b, {1 | F | D, {0x10ccb}}}, + {0x10c8c, {1 | F | D, {0x10ccc}}}, + {0x10c8d, {1 | F | D, {0x10ccd}}}, + {0x10c8e, {1 | F | D, {0x10cce}}}, + {0x10c8f, {1 | F | D, {0x10ccf}}}, + {0x10c90, {1 | F | D, {0x10cd0}}}, + {0x10c91, {1 | F | D, {0x10cd1}}}, + {0x10c92, {1 | F | D, {0x10cd2}}}, + {0x10c93, {1 | F | D, {0x10cd3}}}, + {0x10c94, {1 | F | D, {0x10cd4}}}, + {0x10c95, {1 | F | D, {0x10cd5}}}, + {0x10c96, {1 | F | D, {0x10cd6}}}, + {0x10c97, {1 | F | D, {0x10cd7}}}, + {0x10c98, {1 | F | D, {0x10cd8}}}, + {0x10c99, {1 | F | D, {0x10cd9}}}, + {0x10c9a, {1 | F | D, {0x10cda}}}, + {0x10c9b, {1 | F | D, {0x10cdb}}}, + {0x10c9c, {1 | F | D, {0x10cdc}}}, + {0x10c9d, {1 | F | D, {0x10cdd}}}, + {0x10c9e, {1 | F | D, {0x10cde}}}, + {0x10c9f, {1 | F | D, {0x10cdf}}}, + {0x10ca0, {1 | F | D, {0x10ce0}}}, + {0x10ca1, {1 | F | D, {0x10ce1}}}, + {0x10ca2, {1 | F | D, {0x10ce2}}}, + {0x10ca3, {1 | F | D, {0x10ce3}}}, + {0x10ca4, {1 | F | D, {0x10ce4}}}, + {0x10ca5, {1 | F | D, {0x10ce5}}}, + {0x10ca6, {1 | F | D, {0x10ce6}}}, + {0x10ca7, {1 | F | D, {0x10ce7}}}, + {0x10ca8, {1 | F | D, {0x10ce8}}}, + {0x10ca9, {1 | F | D, {0x10ce9}}}, + {0x10caa, {1 | F | D, {0x10cea}}}, + {0x10cab, {1 | F | D, {0x10ceb}}}, + {0x10cac, {1 | F | D, {0x10cec}}}, + {0x10cad, {1 | F | D, {0x10ced}}}, + {0x10cae, {1 | F | D, {0x10cee}}}, + {0x10caf, {1 | F | D, {0x10cef}}}, + {0x10cb0, {1 | F | D, {0x10cf0}}}, + {0x10cb1, {1 | F | D, {0x10cf1}}}, + {0x10cb2, {1 | F | D, {0x10cf2}}}, + {0x118a0, {1 | F | D, {0x118c0}}}, + {0x118a1, {1 | F | D, {0x118c1}}}, + {0x118a2, {1 | F | D, {0x118c2}}}, + {0x118a3, {1 | F | D, {0x118c3}}}, + {0x118a4, {1 | F | D, {0x118c4}}}, + {0x118a5, {1 | F | D, {0x118c5}}}, + {0x118a6, {1 | F | D, {0x118c6}}}, + {0x118a7, {1 | F | D, {0x118c7}}}, + {0x118a8, {1 | F | D, {0x118c8}}}, + {0x118a9, {1 | F | D, {0x118c9}}}, + {0x118aa, {1 | F | D, {0x118ca}}}, + {0x118ab, {1 | F | D, {0x118cb}}}, + {0x118ac, {1 | F | D, {0x118cc}}}, + {0x118ad, {1 | F | D, {0x118cd}}}, + {0x118ae, {1 | F | D, {0x118ce}}}, + {0x118af, {1 | F | D, {0x118cf}}}, + {0x118b0, {1 | F | D, {0x118d0}}}, + {0x118b1, {1 | F | D, {0x118d1}}}, + {0x118b2, {1 | F | D, {0x118d2}}}, + {0x118b3, {1 | F | D, {0x118d3}}}, + {0x118b4, {1 | F | D, {0x118d4}}}, + {0x118b5, {1 | F | D, {0x118d5}}}, + {0x118b6, {1 | F | D, {0x118d6}}}, + {0x118b7, {1 | F | D, {0x118d7}}}, + {0x118b8, {1 | F | D, {0x118d8}}}, + {0x118b9, {1 | F | D, {0x118d9}}}, + {0x118ba, {1 | F | D, {0x118da}}}, + {0x118bb, {1 | F | D, {0x118db}}}, + {0x118bc, {1 | F | D, {0x118dc}}}, + {0x118bd, {1 | F | D, {0x118dd}}}, + {0x118be, {1 | F | D, {0x118de}}}, + {0x118bf, {1 | F | D, {0x118df}}}, + {0x1e900, {1 | F | D, {0x1e922}}}, + {0x1e901, {1 | F | D, {0x1e923}}}, + {0x1e902, {1 | F | D, {0x1e924}}}, + {0x1e903, {1 | F | D, {0x1e925}}}, + {0x1e904, {1 | F | D, {0x1e926}}}, + {0x1e905, {1 | F | D, {0x1e927}}}, + {0x1e906, {1 | F | D, {0x1e928}}}, + {0x1e907, {1 | F | D, {0x1e929}}}, + {0x1e908, {1 | F | D, {0x1e92a}}}, + {0x1e909, {1 | F | D, {0x1e92b}}}, + {0x1e90a, {1 | F | D, {0x1e92c}}}, + {0x1e90b, {1 | F | D, {0x1e92d}}}, + {0x1e90c, {1 | F | D, {0x1e92e}}}, + {0x1e90d, {1 | F | D, {0x1e92f}}}, + {0x1e90e, {1 | F | D, {0x1e930}}}, + {0x1e90f, {1 | F | D, {0x1e931}}}, + {0x1e910, {1 | F | D, {0x1e932}}}, + {0x1e911, {1 | F | D, {0x1e933}}}, + {0x1e912, {1 | F | D, {0x1e934}}}, + {0x1e913, {1 | F | D, {0x1e935}}}, + {0x1e914, {1 | F | D, {0x1e936}}}, + {0x1e915, {1 | F | D, {0x1e937}}}, + {0x1e916, {1 | F | D, {0x1e938}}}, + {0x1e917, {1 | F | D, {0x1e939}}}, + {0x1e918, {1 | F | D, {0x1e93a}}}, + {0x1e919, {1 | F | D, {0x1e93b}}}, + {0x1e91a, {1 | F | D, {0x1e93c}}}, + {0x1e91b, {1 | F | D, {0x1e93d}}}, + {0x1e91c, {1 | F | D, {0x1e93e}}}, + {0x1e91d, {1 | F | D, {0x1e93f}}}, + {0x1e91e, {1 | F | D, {0x1e940}}}, + {0x1e91f, {1 | F | D, {0x1e941}}}, + {0x1e920, {1 | F | D, {0x1e942}}}, + {0x1e921, {1 | F | D, {0x1e943}}}, +#define CaseFold_Locale (*(CaseFold_11_Type(*)[2])(CaseFold_11_Table + 1399)) + {0x0049, {1 | F | D, {0x0069}}}, + {0x0130, {2 | F | D, {0x0069, 0x0307}}}, +}; + +/* C code produced by gperf version 3.0.4 */ +/* Command-line: gperf -7 -k1,2,3 -F,-1 -c -j1 -i1 -t -T -E -C -H + * onigenc_unicode_CaseFold_11_hash -N onigenc_unicode_CaseFold_11_lookup -n */ + +/* maximum key range = 3623, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +# ifdef __cplusplus +inline +# endif +#endif + /*ARGSUSED*/ + static unsigned int + onigenc_unicode_CaseFold_11_hash(const OnigCodePoint code) +{ + static const unsigned short asso_values[] + = {1, 3627, 2, 28, 3, 303, 218, 5, 21, 167, 2, 199, + 194, 7, 3627, 3627, 3627, 3627, 3627, 3627, 3627, 3627, 3627, 3627, + 3627, 3627, 3627, 28, 3627, 3627, 3627, 3627, 3627, 3627, 3627, 282, + 3627, 3627, 3627, 3627, 3627, 113, 3627, 3627, 3627, 3627, 3627, 3627, + 3627, 3627, 3627, 318, 3627, 3627, 3627, 3627, 3627, 3627, 3627, 1197, + 3627, 3627, 149, 73, 513, 1, 3627, 3627, 267, 17, 3627, 3627, + 3627, 3627, 3627, 286, 3627, 3627, 289, 617, 291, 28, 1163, 444, + 36, 430, 954, 110, 1767, 5, 11, 22, 1761, 486, 1921, 250, + 1746, 122, 1905, 163, 1716, 262, 1880, 80, 1503, 68, 1704, 157, + 1681, 376, 1673, 209, 1822, 203, 1406, 498, 1622, 362, 1588, 316, + 475, 599, 1228, 538, 1160, 585, 1510, 544, 331, 685, 1672, 603, + 1536, 840, 1684, 786, 1594, 743, 1380, 700, 142, 839, 1302, 865, + 1173, 1329, 1730, 1043, 1449, 969, 1437, 1108, 1360, 925, 1497, 723, + 154, 810, 391, 1083, 1777, 1047, 436, 1051, 47, 1342, 8, 974, + 98, 1318, 781, 1314, 148, 1403, 39, 1357, 18, 1265, 11, 928, + 92, 1205, 2, 1295, 3, 1181, 187, 1151, 385, 1132, 107, 1280, + 8, 1678, 41, 511, 42, 1655, 78, 294, 134, 1857, 17, 784, + 2, 1113, 57, 496, 52}; + return asso_values[bits_of(code, 2) + 81] + asso_values[bits_of(code, 1) + 2] + + asso_values[bits_of(code, 0)]; +} + +#ifdef __GNUC__ +__inline +# if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ + __attribute__((__gnu_inline__)) +# endif +#endif + static const CodePointList3 * + onigenc_unicode_CaseFold_11_lookup(const OnigCodePoint code) +{ + enum + { + MIN_CODE_VALUE = 0x41, + MAX_CODE_VALUE = 0x1e921, + TOTAL_KEYWORDS = 1401, + MIN_WORD_LENGTH = 3, + MAX_WORD_LENGTH = 3, + MIN_HASH_VALUE = 4, + MAX_HASH_VALUE = 3626 + }; + + static const short wordlist[] = {-1, + -1, + -1, + -1, + /*0x1ffb*/ 816, + /*0x1fe7*/ 802, + /*0x017b*/ 118, + /*0x1f88*/ 729, + /*0x0408*/ 305, + /*0x0108*/ 61, + /*0x10408*/ 1214, + /*0x0055*/ 19, + /*0xab88*/ 1112, + /*0x1f89*/ 730, + /*0x0409*/ 306, + /*0x2c67*/ 916, + /*0x10409*/ 1215, + /*0x2c08*/ 873, + /*0xab89*/ 1113, + /*0x1ff9*/ 814, + /*0x2c6f*/ 921, + /*0x0179*/ 117, + -1, + /*0x2c09*/ 874, + /*0x1f8a*/ 731, + /*0x040a*/ 307, + /*0x010a*/ 62, + /*0x1040a*/ 1216, + /*0x2c88*/ 931, + /*0xab8a*/ 1114, + /*0x1f80*/ 721, + /*0x0400*/ 297, + /*0x0100*/ 57, + /*0x10400*/ 1206, + /*0x2c0a*/ 875, + /*0xab80*/ 1104, + /*0x10c88*/ 1290, + /*0x00d5*/ 47, + /*0x1f83*/ 724, + /*0x0403*/ 300, + /*0x2c00*/ 865, + /*0x10403*/ 1209, + /*0x10c89*/ 1291, + /*0xab83*/ 1107, + /*0x1ff3*/ 809, + /*0x2c8a*/ 932, + /*0x1e908*/ 1373, + /*0x00df*/ 56, + /*0x2c03*/ 868, + /*0x1fd3*/ 791, + /*0x0053*/ 17, + /*0x2c80*/ 927, + /*0x1e909*/ 1374, + /*0x10c8a*/ 1292, + /*0x2183*/ 838, + -1, + /*0x017f*/ 120, + -1, + /*0xa780*/ 1059, + /*0x10c80*/ 1282, + -1, + /*0x017d*/ 119, + -1, + /*0x1e90a*/ 1375, + /*0x2c7f*/ 926, + -1, + -1, + /*0x10c83*/ 1285, + /*0x00dd*/ 54, + /*0x1e900*/ 1365, + /*0x1f98*/ 745, + /*0x0418*/ 321, + /*0x0118*/ 69, + /*0x10418*/ 1230, + /*0x037f*/ 233, + /*0xab98*/ 1128, + /*0x00d3*/ 45, + /*0x1e903*/ 1368, + -1, + /*0x1e88*/ 607, + /*0x2c18*/ 889, + -1, + /*0x1f96*/ 743, + /*0x0416*/ 319, + /*0x0116*/ 68, + /*0x10416*/ 1228, + -1, + /*0xab96*/ 1126, + -1, + -1, + /*0x2c75*/ 924, + /*0x2c98*/ 939, + /*0x2c16*/ 887, + -1, + /*0x1fe3*/ 799, + -1, + /*0x1e8a*/ 608, + -1, + /*0xa798*/ 1068, + /*0x10c98*/ 1306, + /*0x1fd7*/ 793, + /*0x0057*/ 21, + /*0x1e80*/ 603, + /*0x2c96*/ 938, + /*0x2c63*/ 914, + -1, + -1, + -1, + -1, + /*0x1e918*/ 1389, + /*0xa796*/ 1067, + /*0x10c96*/ 1304, + /*0x1f86*/ 727, + /*0x0406*/ 303, + /*0x0106*/ 60, + /*0x10406*/ 1212, + /*0x13fb*/ 527, + /*0xab86*/ 1110, + -1, + /*0x2c6d*/ 919, + -1, + /*0x1e916*/ 1387, + /*0x2c06*/ 871, + -1, + /*0x1f90*/ 737, + /*0x0410*/ 313, + /*0x0110*/ 65, + /*0x10410*/ 1222, + -1, + /*0xab90*/ 1120, + /*0x2ced*/ 978, + /*0x13f9*/ 525, + -1, + /*0x2c86*/ 930, + /*0x2c10*/ 881, + -1, + /*0x1ff7*/ 812, + -1, + -1, + -1, + /*0xa786*/ 1062, + /*0x10c86*/ 1288, + /*0x1e98*/ 616, + -1, + /*0x1fbb*/ 777, + /*0x2c90*/ 935, + /*0x013b*/ 85, + -1, + -1, + /*0xabbb*/ 1163, + /*0x1fdb*/ 797, + /*0x1e906*/ 1371, + /*0xa790*/ 1065, + /*0x10c90*/ 1298, + /*0x1e96*/ 614, + /*0x1e08*/ 543, + /*0x1fcb*/ 788, + /*0x004b*/ 9, + -1, + /*0x1f9a*/ 747, + /*0x041a*/ 323, + /*0x011a*/ 70, + /*0x1041a*/ 1232, + /*0x1e910*/ 1381, + /*0xab9a*/ 1130, + /*0x1f92*/ 739, + /*0x0412*/ 315, + /*0x0112*/ 66, + /*0x10412*/ 1224, + /*0x2c1a*/ 891, + /*0xab92*/ 1122, + /*0x13fd*/ 529, + /*0x1e0a*/ 544, + /*0x0388*/ 235, + -1, + /*0x2c12*/ 883, + /*0x03d5*/ 273, + /*0x00db*/ 52, + /*0x1e00*/ 539, + /*0x0389*/ 236, + /*0x2c9a*/ 940, + -1, + -1, + /*0x00cb*/ 37, + /*0x1e86*/ 606, + /*0x03f9*/ 292, + /*0x2c92*/ 936, + /*0xa79a*/ 1069, + /*0x10c9a*/ 1308, + /*0x1fe9*/ 804, + /*0x038a*/ 237, + -1, + -1, + /*0xa792*/ 1066, + /*0x10c92*/ 1300, + -1, + /*0x1e90*/ 611, + -1, + /*0x1e91a*/ 1391, + /*0x2c69*/ 917, + /*0x0508*/ 425, + -1, + -1, + /*0x0555*/ 481, + /*0x1e912*/ 1383, + /*0x1fa0*/ 753, + /*0x0420*/ 329, + /*0x0120*/ 73, + /*0x10420*/ 1238, + /*0x03f1*/ 288, + /*0xaba0*/ 1136, + /*0x1f9e*/ 751, + /*0x041e*/ 327, + /*0x011e*/ 72, + /*0x1041e*/ 1236, + /*0x2c20*/ 897, + /*0xab9e*/ 1134, + /*0x050a*/ 426, + /*0x1e18*/ 551, + -1, + /*0x03ff*/ 296, + /*0x2c1e*/ 895, + /*0x048a*/ 362, + /*0x0500*/ 421, + /*0x0208*/ 194, + /*0x03fd*/ 294, + /*0x2ca0*/ 943, + -1, + /*0x0480*/ 361, + -1, + /*0x1e16*/ 550, + /*0x1e9a*/ 618, + /*0x2c9e*/ 942, + /*0xa7a0*/ 1072, + /*0x10ca0*/ 1314, + -1, + /*0x0398*/ 249, + /*0x1e92*/ 612, + -1, + /*0xa79e*/ 1071, + /*0x10c9e*/ 1312, + /*0x020a*/ 195, + /*0x0553*/ 479, + -1, + /*0x1e920*/ 1397, + -1, + /*0x03f5*/ 290, + /*0x0200*/ 190, + /*0x0396*/ 247, + /*0x104d3*/ 1281, + /*0x1e91e*/ 1395, + -1, + /*0x1f8e*/ 735, + /*0x040e*/ 311, + /*0x010e*/ 64, + /*0x1040e*/ 1220, + -1, + /*0xab8e*/ 1118, + -1, + -1, + /*0x1e06*/ 542, + -1, + /*0x2c0e*/ 879, + /*0x0518*/ 433, + /*0x1f94*/ 741, + /*0x0414*/ 317, + /*0x0114*/ 67, + /*0x10414*/ 1226, + /*0x0498*/ 369, + /*0xab94*/ 1124, + /*0x2165*/ 827, + /*0x2167*/ 829, + /*0x1e10*/ 547, + /*0x2c8e*/ 934, + /*0x2c14*/ 885, + /*0x0516*/ 432, + /*0x216f*/ 837, + /*0x1ea0*/ 621, + /*0x0386*/ 234, + /*0x2161*/ 823, + /*0x0496*/ 368, + /*0x10c8e*/ 1296, + -1, + /*0x1e9e*/ 620, + -1, + /*0x2c94*/ 937, + -1, + /*0x0218*/ 202, + -1, + -1, + /*0x0390*/ 241, + /*0x1e90e*/ 1379, + -1, + /*0x10c94*/ 1302, + -1, + /*0xa77b*/ 1056, + /*0x1ff6*/ 811, + /*0x0476*/ 356, + /*0x0176*/ 115, + /*0x0216*/ 201, + -1, + -1, + /*0x03f7*/ 291, + /*0x1e914*/ 1385, + -1, + /*0x0506*/ 424, + -1, + /*0x1e1a*/ 552, + -1, + -1, + /*0xa779*/ 1055, + -1, + /*0x01d5*/ 167, + /*0x1e12*/ 548, + -1, + /*0x0189*/ 126, + /*0x0376*/ 232, + /*0x0510*/ 429, + /*0x1fa6*/ 759, + /*0x0426*/ 335, + /*0x0126*/ 76, + /*0x10426*/ 1244, + /*0x0490*/ 365, + /*0xaba6*/ 1142, + /*0x1e8e*/ 610, + /*0x039a*/ 251, + /*0x018a*/ 127, + -1, + /*0x2c26*/ 903, + /*0x0206*/ 193, + -1, + /*0x0392*/ 243, + -1, + /*0x1faf*/ 768, + /*0x042f*/ 344, + -1, + /*0x1e94*/ 613, + /*0x053b*/ 455, + /*0xabaf*/ 1151, + /*0x2ca6*/ 946, + -1, + /*0x0210*/ 198, + -1, + -1, + /*0x104bb*/ 1257, + /*0x01f1*/ 181, + /*0xa7a6*/ 1075, + /*0x10ca6*/ 1320, + -1, + /*0x054b*/ 471, + /*0xa77d*/ 1057, + /*0x01d3*/ 166, + /*0x051a*/ 434, + /*0x1e20*/ 555, + /*0x04cb*/ 395, + -1, + /*0x104cb*/ 1273, + /*0x049a*/ 370, + /*0x0512*/ 430, + /*0x1e1e*/ 554, + /*0x2163*/ 825, + /*0x023b*/ 217, + /*0x10caf*/ 1329, + /*0x0492*/ 366, + /*0x1fa4*/ 757, + /*0x0424*/ 333, + /*0x0124*/ 75, + /*0x10424*/ 1242, + /*0x1ef6*/ 664, + /*0xaba4*/ 1140, + -1, + /*0x03a0*/ 257, + /*0x0198*/ 137, + -1, + /*0x2c24*/ 901, + /*0x216d*/ 835, + /*0x021a*/ 203, + /*0x039e*/ 255, + /*0x1f9c*/ 749, + /*0x041c*/ 325, + /*0x011c*/ 71, + /*0x1041c*/ 1234, + /*0x0212*/ 199, + /*0xab9c*/ 1132, + /*0x0196*/ 135, + /*0x2ca4*/ 945, + -1, + /*0x1feb*/ 806, + /*0x2c1c*/ 893, + -1, + /*0x1ea6*/ 624, + -1, + /*0xa7a4*/ 1074, + /*0x10ca4*/ 1318, + /*0x004d*/ 11, + -1, + -1, + /*0x2c6b*/ 918, + /*0x0520*/ 437, + /*0x2c9c*/ 941, + /*0x1e0e*/ 546, + -1, + /*0x01d7*/ 168, + /*0x04a0*/ 373, + /*0x051e*/ 436, + -1, + /*0xa79c*/ 1070, + /*0x10c9c*/ 1310, + /*0x2ceb*/ 977, + /*0x049e*/ 372, + -1, + -1, + /*0x1e14*/ 549, + -1, + /*0x0186*/ 124, + -1, + -1, + /*0x1e91c*/ 1393, + /*0x038e*/ 239, + -1, + /*0x00cd*/ 39, + -1, + /*0x0220*/ 206, + -1, + -1, + /*0x10bb*/ 511, + /*0x0190*/ 131, + -1, + /*0x021e*/ 205, + /*0x24bb*/ 844, + /*0x0394*/ 245, + -1, + /*0x1f84*/ 725, + /*0x0404*/ 301, + /*0x0104*/ 59, + /*0x10404*/ 1210, + /*0x1ea4*/ 623, + /*0xab84*/ 1108, + /*0x01f7*/ 185, + /*0x0051*/ 15, + -1, + /*0x24cb*/ 860, + /*0x2c04*/ 869, + -1, + /*0x1e76*/ 598, + /*0x050e*/ 428, + /*0x1f82*/ 723, + /*0x0402*/ 299, + /*0x0102*/ 58, + /*0x10402*/ 1208, + /*0x048e*/ 364, + /*0xab82*/ 1106, + /*0x01db*/ 170, + /*0x2c84*/ 929, + -1, + /*0x2169*/ 831, + /*0x2c02*/ 867, + /*0x0514*/ 431, + /*0x01cb*/ 162, + -1, + /*0xa784*/ 1061, + /*0x10c84*/ 1286, + /*0x0494*/ 367, + /*0x118bb*/ 1360, + -1, + /*0x00d1*/ 43, + /*0x1e26*/ 558, + /*0x2c82*/ 928, + -1, + /*0x020e*/ 197, + -1, + /*0x1e904*/ 1369, + -1, + -1, + /*0xa782*/ 1060, + /*0x10c82*/ 1284, + -1, + /*0x1fa7*/ 760, + /*0x0427*/ 336, + -1, + /*0x10427*/ 1245, + /*0x0214*/ 200, + /*0xaba7*/ 1143, + -1, + /*0x03a6*/ 262, + /*0x1e902*/ 1367, + /*0x10a0*/ 484, + /*0x2c27*/ 904, + /*0x1f8c*/ 733, + /*0x040c*/ 309, + /*0x010c*/ 63, + /*0x1040c*/ 1218, + -1, + /*0xab8c*/ 1116, + /*0x04f6*/ 416, + -1, + -1, + -1, + /*0x2c0c*/ 877, + /*0x047e*/ 360, + /*0x1fa2*/ 755, + /*0x0422*/ 331, + /*0x0122*/ 74, + /*0x10422*/ 1240, + /*0x1e84*/ 605, + /*0xaba2*/ 1138, + /*0x10ca7*/ 1321, + /*0x01a0*/ 141, + /*0x2c7e*/ 925, + /*0x2c8c*/ 933, + /*0x2c22*/ 899, + /*0x0526*/ 440, + /*0x1e24*/ 557, + /*0x1ff2*/ 808, + /*0x0472*/ 354, + /*0x0172*/ 113, + /*0x04a6*/ 376, + /*0x10c8c*/ 1294, + /*0x1e82*/ 604, + /*0x1f08*/ 669, + -1, + /*0x2ca2*/ 944, + /*0x1f6f*/ 720, + /*0x2c72*/ 923, + /*0x118a0*/ 1333, + /*0x1f09*/ 670, + /*0x1e1c*/ 553, + /*0x1e90c*/ 1377, + /*0xa7a2*/ 1073, + /*0x10ca2*/ 1316, + /*0x03a4*/ 260, + /*0xfb00*/ 1168, + /*0x1f5f*/ 712, + /*0x0372*/ 231, + /*0x2cf2*/ 979, + /*0x0226*/ 209, + /*0x1f0a*/ 671, + -1, + -1, + /*0xfb03*/ 1171, + /*0x1faa*/ 763, + /*0x042a*/ 339, + /*0x012a*/ 78, + -1, + /*0x039c*/ 253, + /*0xabaa*/ 1146, + /*0x1fae*/ 767, + /*0x042e*/ 343, + /*0x012e*/ 80, + -1, + /*0x2c2a*/ 907, + /*0xabae*/ 1150, + -1, + /*0x1f5d*/ 711, + /*0x018e*/ 129, + -1, + /*0x2c2e*/ 911, + /*0x0524*/ 439, + -1, + -1, + /*0x1e8c*/ 609, + /*0x2caa*/ 948, + /*0x04a4*/ 375, + -1, + -1, + -1, + /*0x0194*/ 134, + /*0x2cae*/ 950, + /*0xa7aa*/ 1077, + /*0x10caa*/ 1324, + /*0x1efe*/ 668, + /*0x051c*/ 435, + /*0x1ea2*/ 622, + -1, + /*0xa7ae*/ 1081, + /*0x10cae*/ 1328, + /*0x049c*/ 371, + -1, + -1, + -1, + /*0x1e04*/ 541, + /*0x0224*/ 208, + /*0x1f18*/ 677, + /*0xfb16*/ 1178, + /*0x2126*/ 818, + /*0x1ef2*/ 662, + /*0x054d*/ 473, + /*0x1fac*/ 765, + /*0x042c*/ 341, + /*0x012c*/ 79, + -1, + /*0x04cd*/ 396, + /*0xabac*/ 1148, + /*0x104cd*/ 1275, + /*0x1e02*/ 540, + /*0x021c*/ 204, + -1, + /*0x2c2c*/ 909, + /*0x01f6*/ 184, + /*0x10a6*/ 490, + -1, + /*0x1fa8*/ 761, + /*0x0428*/ 337, + /*0x0128*/ 77, + /*0x03d1*/ 272, + /*0x1fb2*/ 769, + /*0xaba8*/ 1144, + /*0x0132*/ 81, + /*0x2cac*/ 949, + /*0xa726*/ 1019, + /*0xabb2*/ 1154, + /*0x2c28*/ 905, + /*0x1eaa*/ 626, + /*0xfb06*/ 1174, + /*0x10af*/ 499, + /*0xa7ac*/ 1079, + /*0x10cac*/ 1326, + -1, + /*0x1eae*/ 628, + -1, + /*0x01a6*/ 144, + /*0x1f6d*/ 718, + /*0x2ca8*/ 947, + -1, + /*0xa688*/ 1007, + /*0x0504*/ 423, + /*0x2cb2*/ 952, + -1, + -1, + /*0xa7a8*/ 1076, + /*0x10ca8*/ 1322, + /*0x0551*/ 477, + -1, + /*0xa7b2*/ 1084, + /*0x10cb2*/ 1332, + /*0x01af*/ 149, + /*0x1e0c*/ 545, + /*0x118a6*/ 1339, + /*0x104d1*/ 1279, + /*0x0502*/ 422, + -1, + /*0xa68a*/ 1008, + -1, + /*0x03a7*/ 263, + -1, + /*0x10a4*/ 488, + /*0x1e7e*/ 602, + /*0xa680*/ 1003, + /*0x1e22*/ 556, + /*0x0204*/ 192, + -1, + -1, + /*0x118af*/ 1348, + /*0x216b*/ 833, + /*0x038c*/ 238, + /*0xa724*/ 1018, + /*0x1f3b*/ 694, + -1, + -1, + /*0x1eac*/ 627, + -1, + /*0x1e72*/ 596, + /*0x1f5b*/ 710, + /*0x0202*/ 191, + /*0x03fe*/ 295, + -1, + /*0x01a4*/ 143, + -1, + /*0x1f4b*/ 702, + -1, + -1, + /*0x1f1a*/ 679, + -1, + /*0x1ea8*/ 625, + /*0x10cd*/ 523, + /*0xff26*/ 1185, + -1, + /*0x1eb2*/ 630, + /*0x24cd*/ 862, + -1, + /*0x019c*/ 138, + /*0x050c*/ 427, + -1, + /*0x118a4*/ 1337, + -1, + -1, + /*0x048c*/ 363, + /*0xa698*/ 1015, + /*0x1e2a*/ 560, + /*0x0130*/ 1400, + /*0xff2f*/ 1194, + -1, + /*0xabb0*/ 1152, + /*0x0522*/ 438, + /*0x1e2e*/ 562, + /*0x01cd*/ 163, + /*0x04fe*/ 420, + -1, + /*0x04a2*/ 374, + /*0xa696*/ 1014, + -1, + /*0x1f69*/ 714, + /*0x1fba*/ 776, + -1, + -1, + /*0x020c*/ 196, + /*0x03aa*/ 266, + /*0xabba*/ 1162, + /*0x2cb0*/ 951, + -1, + -1, + /*0x04f2*/ 414, + -1, + -1, + -1, + /*0xa7b0*/ 1082, + /*0x10cb0*/ 1330, + /*0x0222*/ 207, + -1, + -1, + -1, + /*0xff24*/ 1183, + -1, + /*0x2cba*/ 956, + -1, + /*0x1fca*/ 787, + /*0x004a*/ 8, + /*0x014a*/ 93, + -1, + /*0xa686*/ 1006, + -1, + -1, + -1, + /*0x052a*/ 442, + /*0x0184*/ 123, + /*0x1e2c*/ 561, + -1, + -1, + /*0x04aa*/ 378, + /*0x052e*/ 444, + /*0x01d1*/ 165, + /*0xa690*/ 1011, + -1, + -1, + /*0x04ae*/ 380, + /*0x1fb8*/ 774, + /*0x2cca*/ 964, + -1, + /*0x0182*/ 122, + /*0x1e28*/ 559, + /*0xabb8*/ 1160, + -1, + /*0x00ca*/ 36, + /*0x1e32*/ 564, + -1, + -1, + -1, + /*0x022a*/ 211, + /*0x10a7*/ 491, + /*0x1eb0*/ 629, + -1, + -1, + -1, + /*0x022e*/ 213, + /*0x1f0e*/ 675, + /*0xfb14*/ 1176, + /*0x2cb8*/ 955, + /*0x03a8*/ 264, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x1eba*/ 634, + -1, + /*0xa69a*/ 1016, + -1, + -1, + /*0x01a7*/ 145, + /*0x052c*/ 443, + /*0x10a2*/ 486, + /*0xa692*/ 1012, + /*0x1fd9*/ 795, + /*0x0059*/ 23, + /*0x04ac*/ 379, + /*0x1ffa*/ 815, + /*0x047a*/ 358, + /*0x1fb6*/ 772, + /*0xa77e*/ 1058, + /*0x0136*/ 83, + /*0xa722*/ 1017, + -1, + /*0xabb6*/ 1158, + /*0x0528*/ 441, + -1, + /*0x118a7*/ 1340, + /*0x1eca*/ 642, + /*0x0532*/ 446, + /*0x04a8*/ 377, + /*0x01fe*/ 189, + -1, + /*0x01a2*/ 142, + /*0x04b2*/ 382, + /*0x022c*/ 212, + /*0x104b2*/ 1248, + /*0x212a*/ 819, + -1, + -1, + /*0x2cb6*/ 954, + /*0x00d9*/ 50, + -1, + /*0x1fcc*/ 789, + /*0x004c*/ 10, + /*0x014c*/ 94, + /*0x01f2*/ 182, + /*0xa7b6*/ 1087, + /*0x1eb8*/ 633, + /*0x0228*/ 210, + /*0x118a2*/ 1335, + -1, + /*0x10aa*/ 494, + /*0x0232*/ 215, + -1, + -1, + -1, + -1, + /*0x10ae*/ 498, + -1, + -1, + -1, + /*0xa72a*/ 1021, + -1, + /*0x2ccc*/ 965, + /*0xff27*/ 1186, + /*0x1e30*/ 563, + -1, + /*0xa72e*/ 1023, + -1, + /*0x00cc*/ 38, + -1, + /*0x1fbc*/ 778, + /*0x1fb4*/ 771, + -1, + /*0x0134*/ 82, + /*0x1f2f*/ 690, + /*0xabbc*/ 1164, + /*0xabb4*/ 1156, + /*0x01ae*/ 148, + -1, + /*0x1e3a*/ 568, + -1, + -1, + /*0x03b0*/ 268, + -1, + -1, + -1, + /*0xff22*/ 1181, + /*0x1efa*/ 666, + /*0x118aa*/ 1343, + /*0x1eb6*/ 632, + -1, + /*0x2cbc*/ 957, + /*0x2cb4*/ 953, + -1, + /*0x118ae*/ 1347, + -1, + /*0x1fbe*/ 779, + /*0x10ac*/ 496, + /*0xa68e*/ 1010, + /*0xa7b4*/ 1086, + /*0x2132*/ 821, + /*0xabbe*/ 1166, + /*0x1e4a*/ 576, + -1, + -1, + -1, + -1, + /*0xa72c*/ 1022, + -1, + -1, + /*0xa694*/ 1013, + /*0x10a8*/ 492, + -1, + /*0x1ecc*/ 643, + /*0x04b0*/ 381, + /*0x10b2*/ 502, + /*0x104b0*/ 1246, + /*0x2cbe*/ 958, + /*0x01ac*/ 147, + /*0x1f1c*/ 681, + -1, + /*0xa728*/ 1020, + /*0x1e38*/ 567, + -1, + /*0x053a*/ 454, + /*0xa732*/ 1024, + /*0xff2a*/ 1189, + /*0x13fa*/ 526, + /*0x1f6b*/ 716, + /*0x04ba*/ 386, + -1, + /*0x104ba*/ 1256, + /*0xff2e*/ 1193, + /*0x0230*/ 214, + /*0x1f4d*/ 704, + /*0x118ac*/ 1345, + /*0x01b2*/ 151, + -1, + -1, + -1, + -1, + -1, + /*0x1ebc*/ 635, + /*0x1eb4*/ 631, + -1, + -1, + -1, + /*0x054a*/ 470, + /*0x023a*/ 216, + /*0x118a8*/ 1341, + -1, + -1, + -1, + /*0x118b2*/ 1351, + /*0x104ca*/ 1272, + -1, + /*0x1fc8*/ 785, + /*0x0048*/ 7, + -1, + /*0x1fe2*/ 798, + /*0x0462*/ 346, + /*0x0162*/ 105, + /*0xfb04*/ 1172, + /*0x1e7a*/ 600, + -1, + /*0x1e36*/ 566, + -1, + /*0x0538*/ 452, + /*0x1ebe*/ 636, + /*0x2c62*/ 913, + -1, + /*0x024a*/ 226, + /*0x04b8*/ 385, + /*0xff2c*/ 1191, + /*0x104b8*/ 1254, + -1, + /*0xfb02*/ 1170, + /*0x2cc8*/ 963, + -1, + -1, + /*0x2ce2*/ 976, + /*0x03fa*/ 293, + -1, + /*0x00c8*/ 34, + -1, + /*0x1f85*/ 726, + /*0x0405*/ 302, + /*0xff28*/ 1187, + /*0x10405*/ 1211, + /*0x1e4c*/ 577, + /*0xab85*/ 1109, + /*0xff32*/ 1197, + -1, + -1, + -1, + /*0x2c05*/ 870, + -1, + /*0x10b0*/ 500, + -1, + -1, + /*0x1fc4*/ 782, + /*0x0044*/ 3, + -1, + -1, + -1, + /*0x1fd6*/ 792, + /*0x0056*/ 20, + /*0x0156*/ 99, + -1, + -1, + /*0x0536*/ 450, + -1, + /*0x10ba*/ 510, + /*0x04fa*/ 418, + /*0x10c85*/ 1287, + /*0x04b6*/ 384, + /*0x24ba*/ 843, + /*0x104b6*/ 1252, + /*0x1e3c*/ 569, + /*0x1e34*/ 565, + -1, + /*0x2cc4*/ 961, + /*0xa73a*/ 1028, + -1, + /*0x1e905*/ 1370, + -1, + /*0x2cd6*/ 970, + /*0x00c4*/ 30, + /*0x1ec8*/ 641, + /*0x1f0c*/ 673, + -1, + /*0x1ee2*/ 654, + /*0x00d6*/ 48, + -1, + /*0x054c*/ 472, + /*0x118b0*/ 1349, + -1, + -1, + -1, + /*0x24ca*/ 859, + -1, + /*0x104cc*/ 1274, + -1, + /*0xa64a*/ 985, + /*0x1e3e*/ 570, + /*0xa74a*/ 1036, + -1, + -1, + -1, + -1, + /*0x118ba*/ 1359, + -1, + -1, + -1, + -1, + /*0x10b8*/ 508, + /*0x01ca*/ 161, + -1, + /*0x024c*/ 227, + /*0x24b8*/ 841, + -1, + -1, + -1, + /*0x053c*/ 456, + /*0x0534*/ 448, + /*0xa738*/ 1027, + -1, + -1, + /*0x04bc*/ 387, + /*0x04b4*/ 383, + /*0x104bc*/ 1258, + /*0x104b4*/ 1250, + /*0x1ec4*/ 639, + /*0xff30*/ 1195, + /*0x1fc2*/ 780, + /*0x0042*/ 1, + /*0x01b8*/ 155, + /*0x1ed6*/ 648, + /*0xa684*/ 1005, + /*0x0050*/ 14, + /*0x0150*/ 96, + /*0x1f2a*/ 685, + /*0x1fd2*/ 790, + /*0x0052*/ 16, + /*0x0152*/ 97, + -1, + -1, + /*0x1f2e*/ 689, + /*0xff3a*/ 1205, + /*0x053e*/ 458, + -1, + -1, + /*0xa682*/ 1004, + /*0x118b8*/ 1357, + /*0x04be*/ 388, + /*0x2cc2*/ 960, + /*0x104be*/ 1260, + -1, + /*0x10b6*/ 506, + /*0x2cd0*/ 967, + -1, + /*0x00c2*/ 28, + /*0x24b6*/ 839, + /*0x2cd2*/ 968, + /*0x1e48*/ 575, + /*0x00d0*/ 42, + -1, + /*0x1e62*/ 588, + /*0xa736*/ 1026, + /*0x00d2*/ 44, + -1, + -1, + -1, + /*0x023e*/ 219, + /*0x01d9*/ 169, + /*0x004e*/ 12, + /*0x014e*/ 95, + /*0x01fa*/ 187, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x03e2*/ 280, + /*0x24cc*/ 861, + -1, + /*0x1f2c*/ 687, + -1, + /*0xa64c*/ 986, + /*0xff38*/ 1203, + /*0xa74c*/ 1037, + -1, + /*0xa68c*/ 1009, + /*0x2cce*/ 966, + /*0x118b6*/ 1355, + -1, + -1, + /*0x1fc6*/ 783, + /*0x0046*/ 5, + /*0x00ce*/ 40, + /*0x1f28*/ 683, + -1, + /*0x1ffc*/ 817, + /*0x047c*/ 359, + /*0x1ec2*/ 638, + -1, + /*0x1e44*/ 573, + /*0x0548*/ 468, + /*0x1ed0*/ 645, + /*0x10bc*/ 512, + /*0x10b4*/ 504, + /*0x1e56*/ 582, + /*0x1ed2*/ 646, + /*0x24bc*/ 845, + /*0x104c8*/ 1270, + /*0x04e2*/ 406, + -1, + -1, + /*0x2cc6*/ 962, + /*0xa73c*/ 1029, + /*0xa734*/ 1025, + /*0x1fec*/ 807, + /*0x046c*/ 351, + /*0x016c*/ 110, + /*0x00c6*/ 32, + -1, + -1, + -1, + -1, + /*0x03d6*/ 274, + /*0x01bc*/ 156, + /*0x0248*/ 225, + /*0xff36*/ 1201, + -1, + -1, + /*0x10be*/ 514, + -1, + -1, + -1, + /*0x24be*/ 847, + /*0x1fea*/ 805, + /*0x046a*/ 350, + /*0x016a*/ 109, + -1, + /*0x1ece*/ 644, + /*0xa73e*/ 1030, + -1, + /*0x118bc*/ 1361, + /*0x118b4*/ 1353, + /*0x1fab*/ 764, + /*0x042b*/ 340, + /*0x0544*/ 464, + /*0x1f81*/ 722, + /*0x0401*/ 298, + /*0xabab*/ 1147, + /*0x10401*/ 1207, + /*0x0556*/ 482, + /*0xab81*/ 1105, + /*0x104c4*/ 1266, + /*0x2c2b*/ 908, + -1, + /*0x04d6*/ 400, + /*0x2c01*/ 866, + -1, + /*0x013f*/ 87, + -1, + -1, + /*0xabbf*/ 1167, + -1, + /*0x1ec6*/ 640, + /*0x1fe8*/ 803, + /*0x0468*/ 349, + /*0x0168*/ 108, + /*0x118be*/ 1363, + /*0x1efc*/ 667, + /*0x0244*/ 222, + -1, + /*0xa7ab*/ 1078, + /*0x10cab*/ 1325, + -1, + /*0x1e42*/ 572, + /*0x10c81*/ 1283, + -1, + /*0x2162*/ 824, + /*0x1e50*/ 579, + -1, + /*0xff34*/ 1199, + -1, + /*0x1e52*/ 580, + -1, + /*0x1c88*/ 538, + /*0x1e901*/ 1366, + -1, + /*0x1eec*/ 659, + /*0x1fe4*/ 800, + /*0x0464*/ 347, + /*0x0164*/ 106, + -1, + /*0x03c2*/ 269, + /*0x24c8*/ 857, + -1, + /*0x1f3a*/ 693, + /*0x03d0*/ 271, + /*0xa648*/ 984, + /*0x2c64*/ 915, + /*0xa748*/ 1035, + /*0xa662*/ 997, + -1, + /*0xa762*/ 1048, + -1, + -1, + -1, + /*0x1eea*/ 658, + /*0x1c80*/ 530, + /*0x13fc*/ 528, + -1, + /*0x01c8*/ 160, + /*0x1fa9*/ 762, + /*0x0429*/ 338, + /*0x01e2*/ 173, + /*0x1e4e*/ 578, + /*0x1c83*/ 533, + /*0xaba9*/ 1145, + -1, + /*0x1f4a*/ 701, + /*0x0542*/ 462, + -1, + /*0x2c29*/ 906, + -1, + /*0x0550*/ 476, + -1, + -1, + /*0x104c2*/ 1264, + /*0x0552*/ 478, + /*0x04d0*/ 397, + -1, + /*0x104d0*/ 1278, + -1, + /*0x04d2*/ 398, + /*0x10c4*/ 520, + /*0x104d2*/ 1280, + -1, + /*0x1ee8*/ 657, + /*0x24c4*/ 853, + /*0x1f38*/ 691, + /*0x1e46*/ 574, + /*0x10ca9*/ 1323, + /*0xa644*/ 982, + -1, + /*0xa744*/ 1033, + /*0x1e7c*/ 601, + -1, + /*0xa656*/ 991, + -1, + /*0xa756*/ 1042, + /*0x0460*/ 345, + /*0x0160*/ 104, + -1, + -1, + -1, + /*0x01c4*/ 157, + -1, + -1, + -1, + /*0x2c60*/ 912, + /*0x054e*/ 474, + /*0x1ee4*/ 655, + -1, + -1, + /*0x1e6c*/ 593, + /*0x046e*/ 352, + /*0x016e*/ 111, + /*0x104ce*/ 1276, + -1, + -1, + /*0x2ce0*/ 975, + -1, + -1, + -1, + /*0x2c6e*/ 920, + -1, + -1, + /*0x1f59*/ 709, + -1, + /*0x1fe6*/ 801, + /*0x0466*/ 348, + /*0x0166*/ 107, + /*0x03ec*/ 285, + /*0x1e6a*/ 592, + /*0x024e*/ 228, + /*0x0546*/ 466, + -1, + -1, + /*0x013d*/ 86, + -1, + /*0x1c86*/ 536, + /*0xabbd*/ 1165, + /*0x104c6*/ 1268, + -1, + -1, + /*0x04fc*/ 419, + -1, + -1, + /*0x1fda*/ 796, + /*0x005a*/ 24, + /*0x015a*/ 101, + /*0x03ea*/ 284, + /*0x1fd8*/ 794, + /*0x0058*/ 22, + /*0x0158*/ 100, + -1, + /*0x1f4c*/ 703, + -1, + /*0x10c2*/ 518, + /*0x0246*/ 224, + /*0x03ab*/ 267, + -1, + /*0x24c2*/ 851, + /*0x1e68*/ 591, + /*0x04ec*/ 411, + -1, + /*0xa642*/ 981, + -1, + /*0xa742*/ 1032, + /*0x2cda*/ 972, + /*0xa650*/ 988, + /*0x1ee0*/ 653, + /*0xa750*/ 1039, + /*0x2cd8*/ 971, + /*0xa652*/ 989, + /*0x00da*/ 51, + /*0xa752*/ 1040, + /*0x0054*/ 18, + /*0x0154*/ 98, + /*0x00d8*/ 49, + -1, + /*0x03e8*/ 283, + -1, + /*0x04ea*/ 410, + /*0x2cc0*/ 959, + /*0x1f3c*/ 695, + /*0x1eee*/ 660, + /*0x1e64*/ 589, + -1, + -1, + /*0x00c0*/ 26, + -1, + -1, + /*0x015e*/ 103, + /*0x1fc7*/ 784, + /*0x0047*/ 6, + /*0x0147*/ 91, + /*0x2cd4*/ 969, + -1, + -1, + /*0x053f*/ 459, + /*0x1ee6*/ 656, + /*0x24ce*/ 863, + /*0x00d4*/ 46, + -1, + /*0x03e4*/ 281, + /*0xa64e*/ 987, + /*0x104bf*/ 1261, + /*0xa74e*/ 1038, + -1, + -1, + /*0x1f3e*/ 697, + /*0x2cde*/ 974, + /*0x04e8*/ 409, + /*0x1fb9*/ 775, + -1, + /*0x0139*/ 84, + -1, + /*0x00de*/ 55, + /*0xabb9*/ 1161, + /*0x1eda*/ 650, + /*0x00c7*/ 33, + -1, + -1, + /*0x1ed8*/ 649, + -1, + -1, + /*0x24c6*/ 855, + /*0x03a9*/ 265, + -1, + -1, + /*0xa646*/ 983, + /*0x216c*/ 834, + /*0xa746*/ 1034, + -1, + /*0x1ec0*/ 637, + -1, + /*0x04e4*/ 407, + -1, + /*0x015c*/ 102, + /*0x1fa1*/ 754, + /*0x0421*/ 330, + -1, + /*0x10421*/ 1239, + -1, + /*0xaba1*/ 1137, + -1, + /*0x1e60*/ 587, + /*0x1ed4*/ 647, + /*0x01fc*/ 188, + /*0x2c21*/ 898, + /*0x216a*/ 832, + -1, + -1, + -1, + /*0xa66c*/ 1002, + -1, + /*0xa76c*/ 1053, + /*0x2cdc*/ 973, + -1, + /*0x212b*/ 820, + -1, + /*0x1e6e*/ 594, + /*0x1ede*/ 652, + /*0x00dc*/ 53, + /*0x03e0*/ 279, + -1, + -1, + /*0x01ec*/ 178, + /*0x10ca1*/ 1315, + -1, + /*0x1f48*/ 699, + /*0x0045*/ 4, + /*0x0145*/ 90, + /*0xa66a*/ 1001, + /*0x10ab*/ 495, + /*0xa76a*/ 1052, + /*0x1e66*/ 590, + -1, + /*0x1e921*/ 1398, + /*0x03ee*/ 286, + /*0x2168*/ 830, + -1, + /*0x1fc3*/ 781, + /*0x0043*/ 2, + /*0x0143*/ 89, + -1, + /*0x01ea*/ 177, + /*0x10bf*/ 515, + /*0xfb05*/ 1173, + -1, + /*0x0345*/ 229, + /*0x24bf*/ 848, + -1, + -1, + /*0x03e6*/ 282, + /*0x1e5a*/ 584, + /*0x04e0*/ 405, + /*0x00c5*/ 31, + /*0x0181*/ 121, + /*0x1e58*/ 583, + -1, + -1, + -1, + /*0xa668*/ 1000, + /*0x2164*/ 826, + /*0xa768*/ 1051, + -1, + -1, + /*0x1edc*/ 651, + /*0x00c3*/ 29, + /*0x1e40*/ 571, + /*0x04ee*/ 412, + /*0x118ab*/ 1344, + /*0x03da*/ 276, + -1, + -1, + /*0x01e8*/ 176, + /*0x03d8*/ 275, + -1, + /*0x1f56*/ 708, + -1, + -1, + -1, + /*0x1e54*/ 581, + -1, + /*0x118bf*/ 1364, + /*0x04e6*/ 408, + /*0xa664*/ 998, + /*0x053d*/ 457, + /*0xa764*/ 1049, + /*0x1fc9*/ 786, + /*0x0049*/ 1399, + /*0x0149*/ 92, + -1, + -1, + /*0x104bd*/ 1259, + /*0x1f97*/ 744, + /*0x0417*/ 320, + /*0x1e5e*/ 586, + /*0x10417*/ 1229, + /*0x01e4*/ 174, + /*0xab97*/ 1127, + /*0x10a9*/ 493, + /*0x1fad*/ 766, + /*0x042d*/ 342, + /*0x04da*/ 402, + /*0x2c17*/ 888, + -1, + /*0xabad*/ 1149, + /*0x04d8*/ 401, + /*0xff2b*/ 1190, + -1, + /*0x023d*/ 218, + /*0x2c2d*/ 910, + -1, + /*0x0540*/ 460, + /*0x03de*/ 278, + /*0x00c9*/ 35, + -1, + -1, + /*0x04c0*/ 389, + -1, + /*0x104c0*/ 1262, + /*0x01a9*/ 146, + /*0x2160*/ 822, + /*0x10c97*/ 1305, + -1, + -1, + /*0x0554*/ 480, + /*0x1fb3*/ 770, + -1, + /*0xa7ad*/ 1080, + /*0x10cad*/ 1327, + /*0x04d4*/ 399, + /*0xabb3*/ 1155, + /*0x1e917*/ 1388, + -1, + -1, + -1, + /*0x216e*/ 836, + /*0x118a9*/ 1342, + -1, + -1, + -1, + /*0x1e5c*/ 585, + -1, + /*0x0547*/ 467, + /*0xa660*/ 996, + /*0x04de*/ 404, + /*0xa760*/ 1047, + -1, + /*0x04c7*/ 393, + /*0x1f50*/ 705, + /*0x104c7*/ 1269, + /*0x2166*/ 828, + -1, + /*0x1f52*/ 706, + /*0xa7b3*/ 1085, + -1, + -1, + /*0x01e0*/ 172, + -1, + /*0x03dc*/ 277, + -1, + /*0xa76e*/ 1054, + /*0x03a1*/ 258, + /*0x0539*/ 453, + -1, + /*0x1e97*/ 615, + -1, + -1, + -1, + -1, + /*0x104b9*/ 1255, + -1, + /*0x01ee*/ 179, + /*0x10bd*/ 513, + /*0xa666*/ 999, + /*0xff29*/ 1188, + /*0xa766*/ 1050, + /*0x24bd*/ 846, + /*0x1fa5*/ 758, + /*0x0425*/ 334, + -1, + /*0x10425*/ 1243, + -1, + /*0xaba5*/ 1141, + /*0x1fb7*/ 773, + -1, + -1, + /*0x01e6*/ 175, + /*0x2c25*/ 902, + /*0xabb7*/ 1159, + -1, + /*0x04dc*/ 403, + -1, + /*0xa65a*/ 993, + -1, + /*0xa75a*/ 1044, + -1, + /*0xa658*/ 992, + -1, + /*0xa758*/ 1043, + /*0x10c0*/ 516, + -1, + -1, + -1, + /*0x24c0*/ 849, + -1, + -1, + /*0x10ca5*/ 1319, + /*0xa640*/ 980, + -1, + /*0xa740*/ 1031, + /*0x118bd*/ 1362, + /*0x1fa3*/ 756, + /*0x0423*/ 332, + -1, + /*0x10423*/ 1241, + /*0x1c84*/ 534, + /*0xaba3*/ 1139, + -1, + -1, + /*0x0545*/ 465, + /*0xa654*/ 990, + /*0x2c23*/ 900, + /*0xa754*/ 1041, + -1, + /*0x04c5*/ 392, + -1, + /*0x104c5*/ 1267, + -1, + -1, + /*0x1c82*/ 532, + /*0x10c7*/ 522, + /*0x0543*/ 463, + -1, + /*0x1f6c*/ 717, + /*0x24c7*/ 856, + /*0xa65e*/ 995, + /*0x04c3*/ 391, + /*0xa75e*/ 1046, + /*0x104c3*/ 1265, + -1, + /*0x10ca3*/ 1317, + -1, + -1, + /*0x0245*/ 223, + /*0x1ff4*/ 810, + /*0x0474*/ 355, + /*0x0174*/ 114, + -1, + /*0x01de*/ 171, + -1, + /*0x10b9*/ 509, + /*0x01c7*/ 159, + /*0x1f6a*/ 715, + /*0xfb01*/ 1169, + /*0x24b9*/ 842, + /*0x0243*/ 221, + -1, + -1, + /*0x0397*/ 248, + -1, + -1, + /*0x1f2b*/ 686, + /*0x1f9d*/ 750, + /*0x041d*/ 326, + -1, + /*0x1041d*/ 1235, + /*0xabb1*/ 1153, + /*0xab9d*/ 1133, + /*0x0470*/ 353, + /*0x0170*/ 112, + /*0x1f9b*/ 748, + /*0x041b*/ 324, + /*0x2c1d*/ 894, + /*0x1041b*/ 1233, + /*0x1f3f*/ 698, + /*0xab9b*/ 1131, + /*0x10a1*/ 485, + /*0x2c70*/ 922, + /*0xabb5*/ 1157, + /*0x0549*/ 469, + /*0x2c1b*/ 892, + /*0xa65c*/ 994, + /*0x1f68*/ 713, + /*0xa75c*/ 1045, + /*0x04c9*/ 394, + -1, + /*0x104c9*/ 1271, + /*0x0370*/ 230, + /*0x118b9*/ 1358, + /*0xa7b1*/ 1083, + /*0x10cb1*/ 1331, + /*0x10c9d*/ 1311, + -1, + /*0x1f99*/ 746, + /*0x0419*/ 322, + -1, + /*0x10419*/ 1231, + -1, + /*0xab99*/ 1129, + /*0x10c9b*/ 1309, + /*0x00b5*/ 25, + /*0x1e91d*/ 1394, + -1, + /*0x2c19*/ 890, + -1, + /*0x1f93*/ 740, + /*0x0413*/ 316, + /*0x10c5*/ 521, + /*0x10413*/ 1225, + /*0x1e91b*/ 1392, + /*0xab93*/ 1123, + /*0x24c5*/ 854, + -1, + -1, + /*0x118a1*/ 1334, + /*0x2c13*/ 884, + /*0x1ef4*/ 663, + -1, + /*0x0533*/ 447, + /*0x10c3*/ 519, + /*0x0041*/ 0, + /*0x0141*/ 88, + /*0x10c99*/ 1307, + /*0x24c3*/ 852, + -1, + /*0x104b3*/ 1249, + /*0xff39*/ 1204, + -1, + /*0x01c5*/ 158, + /*0x1f29*/ 684, + -1, + -1, + /*0x1e919*/ 1390, + -1, + /*0x10c93*/ 1301, + /*0x1f8f*/ 736, + /*0x040f*/ 312, + -1, + /*0x1040f*/ 1221, + /*0x1ef0*/ 661, + /*0xab8f*/ 1119, + -1, + /*0x1e9b*/ 619, + /*0x03a5*/ 261, + /*0x1e913*/ 1384, + /*0x2c0f*/ 880, + /*0x00c1*/ 27, + -1, + -1, + -1, + /*0x1f8b*/ 732, + /*0x040b*/ 308, + /*0xff21*/ 1180, + /*0x1040b*/ 1217, + -1, + /*0xab8b*/ 1115, + /*0x1f87*/ 728, + /*0x0407*/ 304, + /*0xab7b*/ 1099, + /*0x10407*/ 1213, + /*0x2c0b*/ 876, + /*0xab87*/ 1111, + /*0x0587*/ 483, + -1, + /*0x10c8f*/ 1297, + /*0x1e99*/ 617, + /*0x2c07*/ 872, + /*0x004f*/ 13, + -1, + -1, + -1, + /*0x24c9*/ 858, + -1, + /*0xab79*/ 1097, + /*0x1e90f*/ 1380, + -1, + /*0x0537*/ 451, + /*0x03a3*/ 259, + /*0xa78b*/ 1063, + /*0x10c8b*/ 1293, + /*0x10ad*/ 497, + /*0x1f6e*/ 719, + -1, + /*0x104b7*/ 1253, + -1, + /*0x10c87*/ 1289, + -1, + -1, + -1, + /*0x1e90b*/ 1376, + -1, + -1, + /*0x1e74*/ 597, + /*0x00cf*/ 41, + /*0x0197*/ 136, + /*0x1e907*/ 1372, + -1, + /*0xab71*/ 1089, + /*0xab73*/ 1091, + -1, + -1, + -1, + -1, + /*0x1f3d*/ 696, + -1, + -1, + /*0x10b3*/ 503, + -1, + /*0xab7f*/ 1103, + -1, + /*0x03f4*/ 289, + /*0x1f9f*/ 752, + /*0x041f*/ 328, + /*0xab7d*/ 1101, + /*0x1041f*/ 1237, + /*0x1e70*/ 595, + /*0xab9f*/ 1135, + -1, + /*0x118ad*/ 1346, + -1, + -1, + /*0x2c1f*/ 896, + -1, + -1, + -1, + -1, + -1, + /*0x01b3*/ 152, + /*0x039d*/ 254, + -1, + -1, + -1, + -1, + /*0x03f0*/ 287, + /*0xab75*/ 1093, + -1, + /*0x039b*/ 252, + -1, + -1, + -1, + /*0x10c9f*/ 1313, + -1, + /*0x04f4*/ 415, + /*0x1f54*/ 707, + /*0x118b3*/ 1352, + -1, + /*0x1ff8*/ 813, + /*0x0478*/ 357, + /*0x0178*/ 116, + -1, + /*0x1e91f*/ 1396, + -1, + -1, + -1, + /*0x0531*/ 445, + -1, + /*0xff2d*/ 1192, + -1, + /*0x10a5*/ 489, + /*0x0399*/ 250, + -1, + /*0x104b1*/ 1247, + -1, + -1, + /*0x10b7*/ 507, + /*0x04f0*/ 413, + /*0x0535*/ 449, + -1, + /*0x24b7*/ 840, + /*0x1f95*/ 742, + /*0x0415*/ 318, + /*0x0393*/ 244, + /*0x10415*/ 1227, + /*0x104b5*/ 1251, + /*0xab95*/ 1125, + -1, + -1, + -1, + -1, + /*0x2c15*/ 886, + -1, + /*0x1f39*/ 692, + /*0xff33*/ 1198, + -1, + -1, + /*0x01b7*/ 154, + -1, + -1, + -1, + -1, + /*0xab77*/ 1095, + -1, + /*0x10a3*/ 487, + -1, + /*0x1f91*/ 738, + /*0x0411*/ 314, + /*0x118a5*/ 1338, + /*0x10411*/ 1223, + /*0x10c95*/ 1303, + /*0xab91*/ 1121, + -1, + /*0x038f*/ 240, + /*0x118b7*/ 1356, + -1, + /*0x2c11*/ 882, + -1, + -1, + -1, + /*0x1e915*/ 1386, + -1, + /*0x1f8d*/ 734, + /*0x040d*/ 310, + /*0x0541*/ 461, + /*0x1040d*/ 1219, + -1, + /*0xab8d*/ 1117, + -1, + /*0x04c1*/ 390, + /*0x1ef8*/ 665, + /*0x104c1*/ 1263, + /*0x2c0d*/ 878, + -1, + -1, + /*0x10c91*/ 1299, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x118a3*/ 1336, + -1, + /*0x03cf*/ 270, + /*0x1e911*/ 1382, + /*0xff25*/ 1184, + -1, + /*0x0241*/ 220, + -1, + /*0xa78d*/ 1064, + /*0x10c8d*/ 1295, + /*0xff37*/ 1202, + -1, + /*0x10b1*/ 501, + -1, + -1, + -1, + /*0x01f4*/ 183, + -1, + -1, + /*0x1e90d*/ 1378, + -1, + -1, + -1, + -1, + /*0x10b5*/ 505, + -1, + -1, + -1, + /*0x13f8*/ 524, + /*0x054f*/ 475, + -1, + -1, + -1, + /*0x01b1*/ 150, + /*0x019d*/ 139, + -1, + /*0x104cf*/ 1277, + -1, + /*0xff23*/ 1182, + /*0x01f0*/ 180, + -1, + -1, + -1, + -1, + -1, + /*0x01b5*/ 153, + -1, + /*0x039f*/ 256, + -1, + -1, + /*0x118b1*/ 1350, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x118b5*/ 1354, + /*0xfb17*/ 1179, + /*0x1e78*/ 599, + -1, + -1, + -1, + /*0x1f49*/ 700, + -1, + /*0x10c1*/ 517, + -1, + -1, + -1, + /*0x24c1*/ 850, + -1, + -1, + /*0x0193*/ 133, + -1, + -1, + -1, + /*0x1f2d*/ 688, + -1, + -1, + -1, + -1, + -1, + -1, + /*0xff31*/ 1196, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0xff35*/ 1200, + -1, + -1, + -1, + -1, + /*0x0395*/ 246, + -1, + /*0x018f*/ 130, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x04f8*/ 417, + -1, + -1, + -1, + -1, + -1, + /*0xab76*/ 1094, + /*0x24cf*/ 864, + /*0x018b*/ 128, + -1, + -1, + -1, + -1, + -1, + /*0x0187*/ 125, + -1, + /*0x0391*/ 242, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x01cf*/ 164, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x019f*/ 140, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x1c85*/ 535, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x01f8*/ 186, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x1f1d*/ 682, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x1f1b*/ 680, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x0191*/ 132, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x1f19*/ 678, + /*0xfb13*/ 1175, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x1f0f*/ 676, + -1, + -1, + -1, + -1, + /*0xab7e*/ 1102, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x1f0b*/ 672, + -1, + -1, + -1, + -1, + /*0xab72*/ 1090, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x1c81*/ 531, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0xfb15*/ 1177, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x1f0d*/ 674, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0xab7a*/ 1098, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0xab7c*/ 1100, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x1c87*/ 537, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0xab74*/ 1092, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0xab70*/ 1088, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0xab78*/ 1096}; + + if (code <= MAX_CODE_VALUE && code >= MIN_CODE_VALUE) + { + register int key = onigenc_unicode_CaseFold_11_hash(code); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register short s = wordlist[key]; + + if (s >= 0 && code1_equal(code, CaseFold_11_Table[s].from)) + return &CaseFold_11_Table[s].to; + } + } + return 0; +} + +static const CaseUnfold_11_Type CaseUnfold_11_Table[] = { +#define CaseUnfold_11 (*(CaseUnfold_11_Type(*)[1266])(CaseUnfold_11_Table + 0)) + {0x0061, {1 | U, {0x0041}}}, + {0x0062, {1 | U, {0x0042}}}, + {0x0063, {1 | U, {0x0043}}}, + {0x0064, {1 | U, {0x0044}}}, + {0x0065, {1 | U, {0x0045}}}, + {0x0066, {1 | U, {0x0046}}}, + {0x0067, {1 | U, {0x0047}}}, + {0x0068, {1 | U, {0x0048}}}, + {0x006a, {1 | U, {0x004a}}}, + {0x006b, {2 | U, {0x004b, 0x212a}}}, + {0x006c, {1 | U, {0x004c}}}, + {0x006d, {1 | U, {0x004d}}}, + {0x006e, {1 | U, {0x004e}}}, + {0x006f, {1 | U, {0x004f}}}, + {0x0070, {1 | U, {0x0050}}}, + {0x0071, {1 | U, {0x0051}}}, + {0x0072, {1 | U, {0x0052}}}, + {0x0073, {2 | U, {0x0053, 0x017f}}}, + {0x0074, {1 | U, {0x0054}}}, + {0x0075, {1 | U, {0x0055}}}, + {0x0076, {1 | U, {0x0056}}}, + {0x0077, {1 | U, {0x0057}}}, + {0x0078, {1 | U, {0x0058}}}, + {0x0079, {1 | U, {0x0059}}}, + {0x007a, {1 | U, {0x005a}}}, + {0x00e0, {1 | U, {0x00c0}}}, + {0x00e1, {1 | U, {0x00c1}}}, + {0x00e2, {1 | U, {0x00c2}}}, + {0x00e3, {1 | U, {0x00c3}}}, + {0x00e4, {1 | U, {0x00c4}}}, + {0x00e5, {2 | U, {0x00c5, 0x212b}}}, + {0x00e6, {1 | U, {0x00c6}}}, + {0x00e7, {1 | U, {0x00c7}}}, + {0x00e8, {1 | U, {0x00c8}}}, + {0x00e9, {1 | U, {0x00c9}}}, + {0x00ea, {1 | U, {0x00ca}}}, + {0x00eb, {1 | U, {0x00cb}}}, + {0x00ec, {1 | U, {0x00cc}}}, + {0x00ed, {1 | U, {0x00cd}}}, + {0x00ee, {1 | U, {0x00ce}}}, + {0x00ef, {1 | U, {0x00cf}}}, + {0x00f0, {1 | U, {0x00d0}}}, + {0x00f1, {1 | U, {0x00d1}}}, + {0x00f2, {1 | U, {0x00d2}}}, + {0x00f3, {1 | U, {0x00d3}}}, + {0x00f4, {1 | U, {0x00d4}}}, + {0x00f5, {1 | U, {0x00d5}}}, + {0x00f6, {1 | U, {0x00d6}}}, + {0x00f8, {1 | U, {0x00d8}}}, + {0x00f9, {1 | U, {0x00d9}}}, + {0x00fa, {1 | U, {0x00da}}}, + {0x00fb, {1 | U, {0x00db}}}, + {0x00fc, {1 | U, {0x00dc}}}, + {0x00fd, {1 | U, {0x00dd}}}, + {0x00fe, {1 | U, {0x00de}}}, + {0x00ff, {1 | U, {0x0178}}}, + {0x0101, {1 | U, {0x0100}}}, + {0x0103, {1 | U, {0x0102}}}, + {0x0105, {1 | U, {0x0104}}}, + {0x0107, {1 | U, {0x0106}}}, + {0x0109, {1 | U, {0x0108}}}, + {0x010b, {1 | U, {0x010a}}}, + {0x010d, {1 | U, {0x010c}}}, + {0x010f, {1 | U, {0x010e}}}, + {0x0111, {1 | U, {0x0110}}}, + {0x0113, {1 | U, {0x0112}}}, + {0x0115, {1 | U, {0x0114}}}, + {0x0117, {1 | U, {0x0116}}}, + {0x0119, {1 | U, {0x0118}}}, + {0x011b, {1 | U, {0x011a}}}, + {0x011d, {1 | U, {0x011c}}}, + {0x011f, {1 | U, {0x011e}}}, + {0x0121, {1 | U, {0x0120}}}, + {0x0123, {1 | U, {0x0122}}}, + {0x0125, {1 | U, {0x0124}}}, + {0x0127, {1 | U, {0x0126}}}, + {0x0129, {1 | U, {0x0128}}}, + {0x012b, {1 | U, {0x012a}}}, + {0x012d, {1 | U, {0x012c}}}, + {0x012f, {1 | U, {0x012e}}}, + {0x0133, {1 | U, {0x0132}}}, + {0x0135, {1 | U, {0x0134}}}, + {0x0137, {1 | U, {0x0136}}}, + {0x013a, {1 | U, {0x0139}}}, + {0x013c, {1 | U, {0x013b}}}, + {0x013e, {1 | U, {0x013d}}}, + {0x0140, {1 | U, {0x013f}}}, + {0x0142, {1 | U, {0x0141}}}, + {0x0144, {1 | U, {0x0143}}}, + {0x0146, {1 | U, {0x0145}}}, + {0x0148, {1 | U, {0x0147}}}, + {0x014b, {1 | U, {0x014a}}}, + {0x014d, {1 | U, {0x014c}}}, + {0x014f, {1 | U, {0x014e}}}, + {0x0151, {1 | U, {0x0150}}}, + {0x0153, {1 | U, {0x0152}}}, + {0x0155, {1 | U, {0x0154}}}, + {0x0157, {1 | U, {0x0156}}}, + {0x0159, {1 | U, {0x0158}}}, + {0x015b, {1 | U, {0x015a}}}, + {0x015d, {1 | U, {0x015c}}}, + {0x015f, {1 | U, {0x015e}}}, + {0x0161, {1 | U, {0x0160}}}, + {0x0163, {1 | U, {0x0162}}}, + {0x0165, {1 | U, {0x0164}}}, + {0x0167, {1 | U, {0x0166}}}, + {0x0169, {1 | U, {0x0168}}}, + {0x016b, {1 | U, {0x016a}}}, + {0x016d, {1 | U, {0x016c}}}, + {0x016f, {1 | U, {0x016e}}}, + {0x0171, {1 | U, {0x0170}}}, + {0x0173, {1 | U, {0x0172}}}, + {0x0175, {1 | U, {0x0174}}}, + {0x0177, {1 | U, {0x0176}}}, + {0x017a, {1 | U, {0x0179}}}, + {0x017c, {1 | U, {0x017b}}}, + {0x017e, {1 | U, {0x017d}}}, + {0x0180, {1 | U, {0x0243}}}, + {0x0183, {1 | U, {0x0182}}}, + {0x0185, {1 | U, {0x0184}}}, + {0x0188, {1 | U, {0x0187}}}, + {0x018c, {1 | U, {0x018b}}}, + {0x0192, {1 | U, {0x0191}}}, + {0x0195, {1 | U, {0x01f6}}}, + {0x0199, {1 | U, {0x0198}}}, + {0x019a, {1 | U, {0x023d}}}, + {0x019e, {1 | U, {0x0220}}}, + {0x01a1, {1 | U, {0x01a0}}}, + {0x01a3, {1 | U, {0x01a2}}}, + {0x01a5, {1 | U, {0x01a4}}}, + {0x01a8, {1 | U, {0x01a7}}}, + {0x01ad, {1 | U, {0x01ac}}}, + {0x01b0, {1 | U, {0x01af}}}, + {0x01b4, {1 | U, {0x01b3}}}, + {0x01b6, {1 | U, {0x01b5}}}, + {0x01b9, {1 | U, {0x01b8}}}, + {0x01bd, {1 | U, {0x01bc}}}, + {0x01bf, {1 | U, {0x01f7}}}, + {0x01c6, {2 | U | ST, {0x01c4, 0x01c5}}}, + {0x01c9, {2 | U | ST, {0x01c7, 0x01c8}}}, + {0x01cc, {2 | U | ST, {0x01ca, 0x01cb}}}, + {0x01ce, {1 | U, {0x01cd}}}, + {0x01d0, {1 | U, {0x01cf}}}, + {0x01d2, {1 | U, {0x01d1}}}, + {0x01d4, {1 | U, {0x01d3}}}, + {0x01d6, {1 | U, {0x01d5}}}, + {0x01d8, {1 | U, {0x01d7}}}, + {0x01da, {1 | U, {0x01d9}}}, + {0x01dc, {1 | U, {0x01db}}}, + {0x01dd, {1 | U, {0x018e}}}, + {0x01df, {1 | U, {0x01de}}}, + {0x01e1, {1 | U, {0x01e0}}}, + {0x01e3, {1 | U, {0x01e2}}}, + {0x01e5, {1 | U, {0x01e4}}}, + {0x01e7, {1 | U, {0x01e6}}}, + {0x01e9, {1 | U, {0x01e8}}}, + {0x01eb, {1 | U, {0x01ea}}}, + {0x01ed, {1 | U, {0x01ec}}}, + {0x01ef, {1 | U, {0x01ee}}}, + {0x01f3, {2 | U | ST, {0x01f1, 0x01f2}}}, + {0x01f5, {1 | U, {0x01f4}}}, + {0x01f9, {1 | U, {0x01f8}}}, + {0x01fb, {1 | U, {0x01fa}}}, + {0x01fd, {1 | U, {0x01fc}}}, + {0x01ff, {1 | U, {0x01fe}}}, + {0x0201, {1 | U, {0x0200}}}, + {0x0203, {1 | U, {0x0202}}}, + {0x0205, {1 | U, {0x0204}}}, + {0x0207, {1 | U, {0x0206}}}, + {0x0209, {1 | U, {0x0208}}}, + {0x020b, {1 | U, {0x020a}}}, + {0x020d, {1 | U, {0x020c}}}, + {0x020f, {1 | U, {0x020e}}}, + {0x0211, {1 | U, {0x0210}}}, + {0x0213, {1 | U, {0x0212}}}, + {0x0215, {1 | U, {0x0214}}}, + {0x0217, {1 | U, {0x0216}}}, + {0x0219, {1 | U, {0x0218}}}, + {0x021b, {1 | U, {0x021a}}}, + {0x021d, {1 | U, {0x021c}}}, + {0x021f, {1 | U, {0x021e}}}, + {0x0223, {1 | U, {0x0222}}}, + {0x0225, {1 | U, {0x0224}}}, + {0x0227, {1 | U, {0x0226}}}, + {0x0229, {1 | U, {0x0228}}}, + {0x022b, {1 | U, {0x022a}}}, + {0x022d, {1 | U, {0x022c}}}, + {0x022f, {1 | U, {0x022e}}}, + {0x0231, {1 | U, {0x0230}}}, + {0x0233, {1 | U, {0x0232}}}, + {0x023c, {1 | U, {0x023b}}}, + {0x023f, {1 | U, {0x2c7e}}}, + {0x0240, {1 | U, {0x2c7f}}}, + {0x0242, {1 | U, {0x0241}}}, + {0x0247, {1 | U, {0x0246}}}, + {0x0249, {1 | U, {0x0248}}}, + {0x024b, {1 | U, {0x024a}}}, + {0x024d, {1 | U, {0x024c}}}, + {0x024f, {1 | U, {0x024e}}}, + {0x0250, {1 | U, {0x2c6f}}}, + {0x0251, {1 | U, {0x2c6d}}}, + {0x0252, {1 | U, {0x2c70}}}, + {0x0253, {1 | U, {0x0181}}}, + {0x0254, {1 | U, {0x0186}}}, + {0x0256, {1 | U, {0x0189}}}, + {0x0257, {1 | U, {0x018a}}}, + {0x0259, {1 | U, {0x018f}}}, + {0x025b, {1 | U, {0x0190}}}, + {0x025c, {1 | U, {0xa7ab}}}, + {0x0260, {1 | U, {0x0193}}}, + {0x0261, {1 | U, {0xa7ac}}}, + {0x0263, {1 | U, {0x0194}}}, + {0x0265, {1 | U, {0xa78d}}}, + {0x0266, {1 | U, {0xa7aa}}}, + {0x0268, {1 | U, {0x0197}}}, + {0x0269, {1 | U, {0x0196}}}, + {0x026a, {1 | U, {0xa7ae}}}, + {0x026b, {1 | U, {0x2c62}}}, + {0x026c, {1 | U, {0xa7ad}}}, + {0x026f, {1 | U, {0x019c}}}, + {0x0271, {1 | U, {0x2c6e}}}, + {0x0272, {1 | U, {0x019d}}}, + {0x0275, {1 | U, {0x019f}}}, + {0x027d, {1 | U, {0x2c64}}}, + {0x0280, {1 | U, {0x01a6}}}, + {0x0283, {1 | U, {0x01a9}}}, + {0x0287, {1 | U, {0xa7b1}}}, + {0x0288, {1 | U, {0x01ae}}}, + {0x0289, {1 | U, {0x0244}}}, + {0x028a, {1 | U, {0x01b1}}}, + {0x028b, {1 | U, {0x01b2}}}, + {0x028c, {1 | U, {0x0245}}}, + {0x0292, {1 | U, {0x01b7}}}, + {0x029d, {1 | U, {0xa7b2}}}, + {0x029e, {1 | U, {0xa7b0}}}, + {0x0371, {1 | U, {0x0370}}}, + {0x0373, {1 | U, {0x0372}}}, + {0x0377, {1 | U, {0x0376}}}, + {0x037b, {1 | U, {0x03fd}}}, + {0x037c, {1 | U, {0x03fe}}}, + {0x037d, {1 | U, {0x03ff}}}, + {0x03ac, {1 | U, {0x0386}}}, + {0x03ad, {1 | U, {0x0388}}}, + {0x03ae, {1 | U, {0x0389}}}, + {0x03af, {1 | U, {0x038a}}}, + {0x03b1, {1 | U, {0x0391}}}, + {0x03b2, {2 | U, {0x0392, 0x03d0}}}, + {0x03b3, {1 | U, {0x0393}}}, + {0x03b4, {1 | U, {0x0394}}}, + {0x03b5, {2 | U, {0x0395, 0x03f5}}}, + {0x03b6, {1 | U, {0x0396}}}, + {0x03b7, {1 | U, {0x0397}}}, + {0x03b8, {3 | U, {0x0398, 0x03d1, 0x03f4}}}, + {0x03b9, {3 | U, {0x0399, 0x0345, 0x1fbe}}}, + {0x03ba, {2 | U, {0x039a, 0x03f0}}}, + {0x03bb, {1 | U, {0x039b}}}, + {0x03bc, {2 | U, {0x039c, 0x00b5}}}, + {0x03bd, {1 | U, {0x039d}}}, + {0x03be, {1 | U, {0x039e}}}, + {0x03bf, {1 | U, {0x039f}}}, + {0x03c0, {2 | U, {0x03a0, 0x03d6}}}, + {0x03c1, {2 | U, {0x03a1, 0x03f1}}}, + {0x03c3, {2 | U, {0x03a3, 0x03c2}}}, + {0x03c4, {1 | U, {0x03a4}}}, + {0x03c5, {1 | U, {0x03a5}}}, + {0x03c6, {2 | U, {0x03a6, 0x03d5}}}, + {0x03c7, {1 | U, {0x03a7}}}, + {0x03c8, {1 | U, {0x03a8}}}, + {0x03c9, {2 | U, {0x03a9, 0x2126}}}, + {0x03ca, {1 | U, {0x03aa}}}, + {0x03cb, {1 | U, {0x03ab}}}, + {0x03cc, {1 | U, {0x038c}}}, + {0x03cd, {1 | U, {0x038e}}}, + {0x03ce, {1 | U, {0x038f}}}, + {0x03d7, {1 | U, {0x03cf}}}, + {0x03d9, {1 | U, {0x03d8}}}, + {0x03db, {1 | U, {0x03da}}}, + {0x03dd, {1 | U, {0x03dc}}}, + {0x03df, {1 | U, {0x03de}}}, + {0x03e1, {1 | U, {0x03e0}}}, + {0x03e3, {1 | U, {0x03e2}}}, + {0x03e5, {1 | U, {0x03e4}}}, + {0x03e7, {1 | U, {0x03e6}}}, + {0x03e9, {1 | U, {0x03e8}}}, + {0x03eb, {1 | U, {0x03ea}}}, + {0x03ed, {1 | U, {0x03ec}}}, + {0x03ef, {1 | U, {0x03ee}}}, + {0x03f2, {1 | U, {0x03f9}}}, + {0x03f3, {1 | U, {0x037f}}}, + {0x03f8, {1 | U, {0x03f7}}}, + {0x03fb, {1 | U, {0x03fa}}}, + {0x0430, {1 | U, {0x0410}}}, + {0x0431, {1 | U, {0x0411}}}, + {0x0432, {2 | U, {0x0412, 0x1c80}}}, + {0x0433, {1 | U, {0x0413}}}, + {0x0434, {2 | U, {0x0414, 0x1c81}}}, + {0x0435, {1 | U, {0x0415}}}, + {0x0436, {1 | U, {0x0416}}}, + {0x0437, {1 | U, {0x0417}}}, + {0x0438, {1 | U, {0x0418}}}, + {0x0439, {1 | U, {0x0419}}}, + {0x043a, {1 | U, {0x041a}}}, + {0x043b, {1 | U, {0x041b}}}, + {0x043c, {1 | U, {0x041c}}}, + {0x043d, {1 | U, {0x041d}}}, + {0x043e, {2 | U, {0x041e, 0x1c82}}}, + {0x043f, {1 | U, {0x041f}}}, + {0x0440, {1 | U, {0x0420}}}, + {0x0441, {2 | U, {0x0421, 0x1c83}}}, + {0x0442, {3 | U, {0x0422, 0x1c84, 0x1c85}}}, + {0x0443, {1 | U, {0x0423}}}, + {0x0444, {1 | U, {0x0424}}}, + {0x0445, {1 | U, {0x0425}}}, + {0x0446, {1 | U, {0x0426}}}, + {0x0447, {1 | U, {0x0427}}}, + {0x0448, {1 | U, {0x0428}}}, + {0x0449, {1 | U, {0x0429}}}, + {0x044a, {2 | U, {0x042a, 0x1c86}}}, + {0x044b, {1 | U, {0x042b}}}, + {0x044c, {1 | U, {0x042c}}}, + {0x044d, {1 | U, {0x042d}}}, + {0x044e, {1 | U, {0x042e}}}, + {0x044f, {1 | U, {0x042f}}}, + {0x0450, {1 | U, {0x0400}}}, + {0x0451, {1 | U, {0x0401}}}, + {0x0452, {1 | U, {0x0402}}}, + {0x0453, {1 | U, {0x0403}}}, + {0x0454, {1 | U, {0x0404}}}, + {0x0455, {1 | U, {0x0405}}}, + {0x0456, {1 | U, {0x0406}}}, + {0x0457, {1 | U, {0x0407}}}, + {0x0458, {1 | U, {0x0408}}}, + {0x0459, {1 | U, {0x0409}}}, + {0x045a, {1 | U, {0x040a}}}, + {0x045b, {1 | U, {0x040b}}}, + {0x045c, {1 | U, {0x040c}}}, + {0x045d, {1 | U, {0x040d}}}, + {0x045e, {1 | U, {0x040e}}}, + {0x045f, {1 | U, {0x040f}}}, + {0x0461, {1 | U, {0x0460}}}, + {0x0463, {2 | U, {0x0462, 0x1c87}}}, + {0x0465, {1 | U, {0x0464}}}, + {0x0467, {1 | U, {0x0466}}}, + {0x0469, {1 | U, {0x0468}}}, + {0x046b, {1 | U, {0x046a}}}, + {0x046d, {1 | U, {0x046c}}}, + {0x046f, {1 | U, {0x046e}}}, + {0x0471, {1 | U, {0x0470}}}, + {0x0473, {1 | U, {0x0472}}}, + {0x0475, {1 | U, {0x0474}}}, + {0x0477, {1 | U, {0x0476}}}, + {0x0479, {1 | U, {0x0478}}}, + {0x047b, {1 | U, {0x047a}}}, + {0x047d, {1 | U, {0x047c}}}, + {0x047f, {1 | U, {0x047e}}}, + {0x0481, {1 | U, {0x0480}}}, + {0x048b, {1 | U, {0x048a}}}, + {0x048d, {1 | U, {0x048c}}}, + {0x048f, {1 | U, {0x048e}}}, + {0x0491, {1 | U, {0x0490}}}, + {0x0493, {1 | U, {0x0492}}}, + {0x0495, {1 | U, {0x0494}}}, + {0x0497, {1 | U, {0x0496}}}, + {0x0499, {1 | U, {0x0498}}}, + {0x049b, {1 | U, {0x049a}}}, + {0x049d, {1 | U, {0x049c}}}, + {0x049f, {1 | U, {0x049e}}}, + {0x04a1, {1 | U, {0x04a0}}}, + {0x04a3, {1 | U, {0x04a2}}}, + {0x04a5, {1 | U, {0x04a4}}}, + {0x04a7, {1 | U, {0x04a6}}}, + {0x04a9, {1 | U, {0x04a8}}}, + {0x04ab, {1 | U, {0x04aa}}}, + {0x04ad, {1 | U, {0x04ac}}}, + {0x04af, {1 | U, {0x04ae}}}, + {0x04b1, {1 | U, {0x04b0}}}, + {0x04b3, {1 | U, {0x04b2}}}, + {0x04b5, {1 | U, {0x04b4}}}, + {0x04b7, {1 | U, {0x04b6}}}, + {0x04b9, {1 | U, {0x04b8}}}, + {0x04bb, {1 | U, {0x04ba}}}, + {0x04bd, {1 | U, {0x04bc}}}, + {0x04bf, {1 | U, {0x04be}}}, + {0x04c2, {1 | U, {0x04c1}}}, + {0x04c4, {1 | U, {0x04c3}}}, + {0x04c6, {1 | U, {0x04c5}}}, + {0x04c8, {1 | U, {0x04c7}}}, + {0x04ca, {1 | U, {0x04c9}}}, + {0x04cc, {1 | U, {0x04cb}}}, + {0x04ce, {1 | U, {0x04cd}}}, + {0x04cf, {1 | U, {0x04c0}}}, + {0x04d1, {1 | U, {0x04d0}}}, + {0x04d3, {1 | U, {0x04d2}}}, + {0x04d5, {1 | U, {0x04d4}}}, + {0x04d7, {1 | U, {0x04d6}}}, + {0x04d9, {1 | U, {0x04d8}}}, + {0x04db, {1 | U, {0x04da}}}, + {0x04dd, {1 | U, {0x04dc}}}, + {0x04df, {1 | U, {0x04de}}}, + {0x04e1, {1 | U, {0x04e0}}}, + {0x04e3, {1 | U, {0x04e2}}}, + {0x04e5, {1 | U, {0x04e4}}}, + {0x04e7, {1 | U, {0x04e6}}}, + {0x04e9, {1 | U, {0x04e8}}}, + {0x04eb, {1 | U, {0x04ea}}}, + {0x04ed, {1 | U, {0x04ec}}}, + {0x04ef, {1 | U, {0x04ee}}}, + {0x04f1, {1 | U, {0x04f0}}}, + {0x04f3, {1 | U, {0x04f2}}}, + {0x04f5, {1 | U, {0x04f4}}}, + {0x04f7, {1 | U, {0x04f6}}}, + {0x04f9, {1 | U, {0x04f8}}}, + {0x04fb, {1 | U, {0x04fa}}}, + {0x04fd, {1 | U, {0x04fc}}}, + {0x04ff, {1 | U, {0x04fe}}}, + {0x0501, {1 | U, {0x0500}}}, + {0x0503, {1 | U, {0x0502}}}, + {0x0505, {1 | U, {0x0504}}}, + {0x0507, {1 | U, {0x0506}}}, + {0x0509, {1 | U, {0x0508}}}, + {0x050b, {1 | U, {0x050a}}}, + {0x050d, {1 | U, {0x050c}}}, + {0x050f, {1 | U, {0x050e}}}, + {0x0511, {1 | U, {0x0510}}}, + {0x0513, {1 | U, {0x0512}}}, + {0x0515, {1 | U, {0x0514}}}, + {0x0517, {1 | U, {0x0516}}}, + {0x0519, {1 | U, {0x0518}}}, + {0x051b, {1 | U, {0x051a}}}, + {0x051d, {1 | U, {0x051c}}}, + {0x051f, {1 | U, {0x051e}}}, + {0x0521, {1 | U, {0x0520}}}, + {0x0523, {1 | U, {0x0522}}}, + {0x0525, {1 | U, {0x0524}}}, + {0x0527, {1 | U, {0x0526}}}, + {0x0529, {1 | U, {0x0528}}}, + {0x052b, {1 | U, {0x052a}}}, + {0x052d, {1 | U, {0x052c}}}, + {0x052f, {1 | U, {0x052e}}}, + {0x0561, {1 | U, {0x0531}}}, + {0x0562, {1 | U, {0x0532}}}, + {0x0563, {1 | U, {0x0533}}}, + {0x0564, {1 | U, {0x0534}}}, + {0x0565, {1 | U, {0x0535}}}, + {0x0566, {1 | U, {0x0536}}}, + {0x0567, {1 | U, {0x0537}}}, + {0x0568, {1 | U, {0x0538}}}, + {0x0569, {1 | U, {0x0539}}}, + {0x056a, {1 | U, {0x053a}}}, + {0x056b, {1 | U, {0x053b}}}, + {0x056c, {1 | U, {0x053c}}}, + {0x056d, {1 | U, {0x053d}}}, + {0x056e, {1 | U, {0x053e}}}, + {0x056f, {1 | U, {0x053f}}}, + {0x0570, {1 | U, {0x0540}}}, + {0x0571, {1 | U, {0x0541}}}, + {0x0572, {1 | U, {0x0542}}}, + {0x0573, {1 | U, {0x0543}}}, + {0x0574, {1 | U, {0x0544}}}, + {0x0575, {1 | U, {0x0545}}}, + {0x0576, {1 | U, {0x0546}}}, + {0x0577, {1 | U, {0x0547}}}, + {0x0578, {1 | U, {0x0548}}}, + {0x0579, {1 | U, {0x0549}}}, + {0x057a, {1 | U, {0x054a}}}, + {0x057b, {1 | U, {0x054b}}}, + {0x057c, {1 | U, {0x054c}}}, + {0x057d, {1 | U, {0x054d}}}, + {0x057e, {1 | U, {0x054e}}}, + {0x057f, {1 | U, {0x054f}}}, + {0x0580, {1 | U, {0x0550}}}, + {0x0581, {1 | U, {0x0551}}}, + {0x0582, {1 | U, {0x0552}}}, + {0x0583, {1 | U, {0x0553}}}, + {0x0584, {1 | U, {0x0554}}}, + {0x0585, {1 | U, {0x0555}}}, + {0x0586, {1 | U, {0x0556}}}, + {0x13a0, {1 | D, {0xab70}}}, + {0x13a1, {1 | D, {0xab71}}}, + {0x13a2, {1 | D, {0xab72}}}, + {0x13a3, {1 | D, {0xab73}}}, + {0x13a4, {1 | D, {0xab74}}}, + {0x13a5, {1 | D, {0xab75}}}, + {0x13a6, {1 | D, {0xab76}}}, + {0x13a7, {1 | D, {0xab77}}}, + {0x13a8, {1 | D, {0xab78}}}, + {0x13a9, {1 | D, {0xab79}}}, + {0x13aa, {1 | D, {0xab7a}}}, + {0x13ab, {1 | D, {0xab7b}}}, + {0x13ac, {1 | D, {0xab7c}}}, + {0x13ad, {1 | D, {0xab7d}}}, + {0x13ae, {1 | D, {0xab7e}}}, + {0x13af, {1 | D, {0xab7f}}}, + {0x13b0, {1 | D, {0xab80}}}, + {0x13b1, {1 | D, {0xab81}}}, + {0x13b2, {1 | D, {0xab82}}}, + {0x13b3, {1 | D, {0xab83}}}, + {0x13b4, {1 | D, {0xab84}}}, + {0x13b5, {1 | D, {0xab85}}}, + {0x13b6, {1 | D, {0xab86}}}, + {0x13b7, {1 | D, {0xab87}}}, + {0x13b8, {1 | D, {0xab88}}}, + {0x13b9, {1 | D, {0xab89}}}, + {0x13ba, {1 | D, {0xab8a}}}, + {0x13bb, {1 | D, {0xab8b}}}, + {0x13bc, {1 | D, {0xab8c}}}, + {0x13bd, {1 | D, {0xab8d}}}, + {0x13be, {1 | D, {0xab8e}}}, + {0x13bf, {1 | D, {0xab8f}}}, + {0x13c0, {1 | D, {0xab90}}}, + {0x13c1, {1 | D, {0xab91}}}, + {0x13c2, {1 | D, {0xab92}}}, + {0x13c3, {1 | D, {0xab93}}}, + {0x13c4, {1 | D, {0xab94}}}, + {0x13c5, {1 | D, {0xab95}}}, + {0x13c6, {1 | D, {0xab96}}}, + {0x13c7, {1 | D, {0xab97}}}, + {0x13c8, {1 | D, {0xab98}}}, + {0x13c9, {1 | D, {0xab99}}}, + {0x13ca, {1 | D, {0xab9a}}}, + {0x13cb, {1 | D, {0xab9b}}}, + {0x13cc, {1 | D, {0xab9c}}}, + {0x13cd, {1 | D, {0xab9d}}}, + {0x13ce, {1 | D, {0xab9e}}}, + {0x13cf, {1 | D, {0xab9f}}}, + {0x13d0, {1 | D, {0xaba0}}}, + {0x13d1, {1 | D, {0xaba1}}}, + {0x13d2, {1 | D, {0xaba2}}}, + {0x13d3, {1 | D, {0xaba3}}}, + {0x13d4, {1 | D, {0xaba4}}}, + {0x13d5, {1 | D, {0xaba5}}}, + {0x13d6, {1 | D, {0xaba6}}}, + {0x13d7, {1 | D, {0xaba7}}}, + {0x13d8, {1 | D, {0xaba8}}}, + {0x13d9, {1 | D, {0xaba9}}}, + {0x13da, {1 | D, {0xabaa}}}, + {0x13db, {1 | D, {0xabab}}}, + {0x13dc, {1 | D, {0xabac}}}, + {0x13dd, {1 | D, {0xabad}}}, + {0x13de, {1 | D, {0xabae}}}, + {0x13df, {1 | D, {0xabaf}}}, + {0x13e0, {1 | D, {0xabb0}}}, + {0x13e1, {1 | D, {0xabb1}}}, + {0x13e2, {1 | D, {0xabb2}}}, + {0x13e3, {1 | D, {0xabb3}}}, + {0x13e4, {1 | D, {0xabb4}}}, + {0x13e5, {1 | D, {0xabb5}}}, + {0x13e6, {1 | D, {0xabb6}}}, + {0x13e7, {1 | D, {0xabb7}}}, + {0x13e8, {1 | D, {0xabb8}}}, + {0x13e9, {1 | D, {0xabb9}}}, + {0x13ea, {1 | D, {0xabba}}}, + {0x13eb, {1 | D, {0xabbb}}}, + {0x13ec, {1 | D, {0xabbc}}}, + {0x13ed, {1 | D, {0xabbd}}}, + {0x13ee, {1 | D, {0xabbe}}}, + {0x13ef, {1 | D, {0xabbf}}}, + {0x13f0, {1 | D, {0x13f8}}}, + {0x13f1, {1 | D, {0x13f9}}}, + {0x13f2, {1 | D, {0x13fa}}}, + {0x13f3, {1 | D, {0x13fb}}}, + {0x13f4, {1 | D, {0x13fc}}}, + {0x13f5, {1 | D, {0x13fd}}}, + {0x1d79, {1 | U, {0xa77d}}}, + {0x1d7d, {1 | U, {0x2c63}}}, + {0x1e01, {1 | U, {0x1e00}}}, + {0x1e03, {1 | U, {0x1e02}}}, + {0x1e05, {1 | U, {0x1e04}}}, + {0x1e07, {1 | U, {0x1e06}}}, + {0x1e09, {1 | U, {0x1e08}}}, + {0x1e0b, {1 | U, {0x1e0a}}}, + {0x1e0d, {1 | U, {0x1e0c}}}, + {0x1e0f, {1 | U, {0x1e0e}}}, + {0x1e11, {1 | U, {0x1e10}}}, + {0x1e13, {1 | U, {0x1e12}}}, + {0x1e15, {1 | U, {0x1e14}}}, + {0x1e17, {1 | U, {0x1e16}}}, + {0x1e19, {1 | U, {0x1e18}}}, + {0x1e1b, {1 | U, {0x1e1a}}}, + {0x1e1d, {1 | U, {0x1e1c}}}, + {0x1e1f, {1 | U, {0x1e1e}}}, + {0x1e21, {1 | U, {0x1e20}}}, + {0x1e23, {1 | U, {0x1e22}}}, + {0x1e25, {1 | U, {0x1e24}}}, + {0x1e27, {1 | U, {0x1e26}}}, + {0x1e29, {1 | U, {0x1e28}}}, + {0x1e2b, {1 | U, {0x1e2a}}}, + {0x1e2d, {1 | U, {0x1e2c}}}, + {0x1e2f, {1 | U, {0x1e2e}}}, + {0x1e31, {1 | U, {0x1e30}}}, + {0x1e33, {1 | U, {0x1e32}}}, + {0x1e35, {1 | U, {0x1e34}}}, + {0x1e37, {1 | U, {0x1e36}}}, + {0x1e39, {1 | U, {0x1e38}}}, + {0x1e3b, {1 | U, {0x1e3a}}}, + {0x1e3d, {1 | U, {0x1e3c}}}, + {0x1e3f, {1 | U, {0x1e3e}}}, + {0x1e41, {1 | U, {0x1e40}}}, + {0x1e43, {1 | U, {0x1e42}}}, + {0x1e45, {1 | U, {0x1e44}}}, + {0x1e47, {1 | U, {0x1e46}}}, + {0x1e49, {1 | U, {0x1e48}}}, + {0x1e4b, {1 | U, {0x1e4a}}}, + {0x1e4d, {1 | U, {0x1e4c}}}, + {0x1e4f, {1 | U, {0x1e4e}}}, + {0x1e51, {1 | U, {0x1e50}}}, + {0x1e53, {1 | U, {0x1e52}}}, + {0x1e55, {1 | U, {0x1e54}}}, + {0x1e57, {1 | U, {0x1e56}}}, + {0x1e59, {1 | U, {0x1e58}}}, + {0x1e5b, {1 | U, {0x1e5a}}}, + {0x1e5d, {1 | U, {0x1e5c}}}, + {0x1e5f, {1 | U, {0x1e5e}}}, + {0x1e61, {2 | U, {0x1e60, 0x1e9b}}}, + {0x1e63, {1 | U, {0x1e62}}}, + {0x1e65, {1 | U, {0x1e64}}}, + {0x1e67, {1 | U, {0x1e66}}}, + {0x1e69, {1 | U, {0x1e68}}}, + {0x1e6b, {1 | U, {0x1e6a}}}, + {0x1e6d, {1 | U, {0x1e6c}}}, + {0x1e6f, {1 | U, {0x1e6e}}}, + {0x1e71, {1 | U, {0x1e70}}}, + {0x1e73, {1 | U, {0x1e72}}}, + {0x1e75, {1 | U, {0x1e74}}}, + {0x1e77, {1 | U, {0x1e76}}}, + {0x1e79, {1 | U, {0x1e78}}}, + {0x1e7b, {1 | U, {0x1e7a}}}, + {0x1e7d, {1 | U, {0x1e7c}}}, + {0x1e7f, {1 | U, {0x1e7e}}}, + {0x1e81, {1 | U, {0x1e80}}}, + {0x1e83, {1 | U, {0x1e82}}}, + {0x1e85, {1 | U, {0x1e84}}}, + {0x1e87, {1 | U, {0x1e86}}}, + {0x1e89, {1 | U, {0x1e88}}}, + {0x1e8b, {1 | U, {0x1e8a}}}, + {0x1e8d, {1 | U, {0x1e8c}}}, + {0x1e8f, {1 | U, {0x1e8e}}}, + {0x1e91, {1 | U, {0x1e90}}}, + {0x1e93, {1 | U, {0x1e92}}}, + {0x1e95, {1 | U, {0x1e94}}}, + {0x1ea1, {1 | U, {0x1ea0}}}, + {0x1ea3, {1 | U, {0x1ea2}}}, + {0x1ea5, {1 | U, {0x1ea4}}}, + {0x1ea7, {1 | U, {0x1ea6}}}, + {0x1ea9, {1 | U, {0x1ea8}}}, + {0x1eab, {1 | U, {0x1eaa}}}, + {0x1ead, {1 | U, {0x1eac}}}, + {0x1eaf, {1 | U, {0x1eae}}}, + {0x1eb1, {1 | U, {0x1eb0}}}, + {0x1eb3, {1 | U, {0x1eb2}}}, + {0x1eb5, {1 | U, {0x1eb4}}}, + {0x1eb7, {1 | U, {0x1eb6}}}, + {0x1eb9, {1 | U, {0x1eb8}}}, + {0x1ebb, {1 | U, {0x1eba}}}, + {0x1ebd, {1 | U, {0x1ebc}}}, + {0x1ebf, {1 | U, {0x1ebe}}}, + {0x1ec1, {1 | U, {0x1ec0}}}, + {0x1ec3, {1 | U, {0x1ec2}}}, + {0x1ec5, {1 | U, {0x1ec4}}}, + {0x1ec7, {1 | U, {0x1ec6}}}, + {0x1ec9, {1 | U, {0x1ec8}}}, + {0x1ecb, {1 | U, {0x1eca}}}, + {0x1ecd, {1 | U, {0x1ecc}}}, + {0x1ecf, {1 | U, {0x1ece}}}, + {0x1ed1, {1 | U, {0x1ed0}}}, + {0x1ed3, {1 | U, {0x1ed2}}}, + {0x1ed5, {1 | U, {0x1ed4}}}, + {0x1ed7, {1 | U, {0x1ed6}}}, + {0x1ed9, {1 | U, {0x1ed8}}}, + {0x1edb, {1 | U, {0x1eda}}}, + {0x1edd, {1 | U, {0x1edc}}}, + {0x1edf, {1 | U, {0x1ede}}}, + {0x1ee1, {1 | U, {0x1ee0}}}, + {0x1ee3, {1 | U, {0x1ee2}}}, + {0x1ee5, {1 | U, {0x1ee4}}}, + {0x1ee7, {1 | U, {0x1ee6}}}, + {0x1ee9, {1 | U, {0x1ee8}}}, + {0x1eeb, {1 | U, {0x1eea}}}, + {0x1eed, {1 | U, {0x1eec}}}, + {0x1eef, {1 | U, {0x1eee}}}, + {0x1ef1, {1 | U, {0x1ef0}}}, + {0x1ef3, {1 | U, {0x1ef2}}}, + {0x1ef5, {1 | U, {0x1ef4}}}, + {0x1ef7, {1 | U, {0x1ef6}}}, + {0x1ef9, {1 | U, {0x1ef8}}}, + {0x1efb, {1 | U, {0x1efa}}}, + {0x1efd, {1 | U, {0x1efc}}}, + {0x1eff, {1 | U, {0x1efe}}}, + {0x1f00, {1 | U, {0x1f08}}}, + {0x1f01, {1 | U, {0x1f09}}}, + {0x1f02, {1 | U, {0x1f0a}}}, + {0x1f03, {1 | U, {0x1f0b}}}, + {0x1f04, {1 | U, {0x1f0c}}}, + {0x1f05, {1 | U, {0x1f0d}}}, + {0x1f06, {1 | U, {0x1f0e}}}, + {0x1f07, {1 | U, {0x1f0f}}}, + {0x1f10, {1 | U, {0x1f18}}}, + {0x1f11, {1 | U, {0x1f19}}}, + {0x1f12, {1 | U, {0x1f1a}}}, + {0x1f13, {1 | U, {0x1f1b}}}, + {0x1f14, {1 | U, {0x1f1c}}}, + {0x1f15, {1 | U, {0x1f1d}}}, + {0x1f20, {1 | U, {0x1f28}}}, + {0x1f21, {1 | U, {0x1f29}}}, + {0x1f22, {1 | U, {0x1f2a}}}, + {0x1f23, {1 | U, {0x1f2b}}}, + {0x1f24, {1 | U, {0x1f2c}}}, + {0x1f25, {1 | U, {0x1f2d}}}, + {0x1f26, {1 | U, {0x1f2e}}}, + {0x1f27, {1 | U, {0x1f2f}}}, + {0x1f30, {1 | U, {0x1f38}}}, + {0x1f31, {1 | U, {0x1f39}}}, + {0x1f32, {1 | U, {0x1f3a}}}, + {0x1f33, {1 | U, {0x1f3b}}}, + {0x1f34, {1 | U, {0x1f3c}}}, + {0x1f35, {1 | U, {0x1f3d}}}, + {0x1f36, {1 | U, {0x1f3e}}}, + {0x1f37, {1 | U, {0x1f3f}}}, + {0x1f40, {1 | U, {0x1f48}}}, + {0x1f41, {1 | U, {0x1f49}}}, + {0x1f42, {1 | U, {0x1f4a}}}, + {0x1f43, {1 | U, {0x1f4b}}}, + {0x1f44, {1 | U, {0x1f4c}}}, + {0x1f45, {1 | U, {0x1f4d}}}, + {0x1f51, {1 | U, {0x1f59}}}, + {0x1f53, {1 | U, {0x1f5b}}}, + {0x1f55, {1 | U, {0x1f5d}}}, + {0x1f57, {1 | U, {0x1f5f}}}, + {0x1f60, {1 | U, {0x1f68}}}, + {0x1f61, {1 | U, {0x1f69}}}, + {0x1f62, {1 | U, {0x1f6a}}}, + {0x1f63, {1 | U, {0x1f6b}}}, + {0x1f64, {1 | U, {0x1f6c}}}, + {0x1f65, {1 | U, {0x1f6d}}}, + {0x1f66, {1 | U, {0x1f6e}}}, + {0x1f67, {1 | U, {0x1f6f}}}, + {0x1f70, {1 | U, {0x1fba}}}, + {0x1f71, {1 | U, {0x1fbb}}}, + {0x1f72, {1 | U, {0x1fc8}}}, + {0x1f73, {1 | U, {0x1fc9}}}, + {0x1f74, {1 | U, {0x1fca}}}, + {0x1f75, {1 | U, {0x1fcb}}}, + {0x1f76, {1 | U, {0x1fda}}}, + {0x1f77, {1 | U, {0x1fdb}}}, + {0x1f78, {1 | U, {0x1ff8}}}, + {0x1f79, {1 | U, {0x1ff9}}}, + {0x1f7a, {1 | U, {0x1fea}}}, + {0x1f7b, {1 | U, {0x1feb}}}, + {0x1f7c, {1 | U, {0x1ffa}}}, + {0x1f7d, {1 | U, {0x1ffb}}}, + {0x1fb0, {1 | U, {0x1fb8}}}, + {0x1fb1, {1 | U, {0x1fb9}}}, + {0x1fd0, {1 | U, {0x1fd8}}}, + {0x1fd1, {1 | U, {0x1fd9}}}, + {0x1fe0, {1 | U, {0x1fe8}}}, + {0x1fe1, {1 | U, {0x1fe9}}}, + {0x1fe5, {1 | U, {0x1fec}}}, + {0x214e, {1 | U, {0x2132}}}, + {0x2170, {1 | U, {0x2160}}}, + {0x2171, {1 | U, {0x2161}}}, + {0x2172, {1 | U, {0x2162}}}, + {0x2173, {1 | U, {0x2163}}}, + {0x2174, {1 | U, {0x2164}}}, + {0x2175, {1 | U, {0x2165}}}, + {0x2176, {1 | U, {0x2166}}}, + {0x2177, {1 | U, {0x2167}}}, + {0x2178, {1 | U, {0x2168}}}, + {0x2179, {1 | U, {0x2169}}}, + {0x217a, {1 | U, {0x216a}}}, + {0x217b, {1 | U, {0x216b}}}, + {0x217c, {1 | U, {0x216c}}}, + {0x217d, {1 | U, {0x216d}}}, + {0x217e, {1 | U, {0x216e}}}, + {0x217f, {1 | U, {0x216f}}}, + {0x2184, {1 | U, {0x2183}}}, + {0x24d0, {1 | U, {0x24b6}}}, + {0x24d1, {1 | U, {0x24b7}}}, + {0x24d2, {1 | U, {0x24b8}}}, + {0x24d3, {1 | U, {0x24b9}}}, + {0x24d4, {1 | U, {0x24ba}}}, + {0x24d5, {1 | U, {0x24bb}}}, + {0x24d6, {1 | U, {0x24bc}}}, + {0x24d7, {1 | U, {0x24bd}}}, + {0x24d8, {1 | U, {0x24be}}}, + {0x24d9, {1 | U, {0x24bf}}}, + {0x24da, {1 | U, {0x24c0}}}, + {0x24db, {1 | U, {0x24c1}}}, + {0x24dc, {1 | U, {0x24c2}}}, + {0x24dd, {1 | U, {0x24c3}}}, + {0x24de, {1 | U, {0x24c4}}}, + {0x24df, {1 | U, {0x24c5}}}, + {0x24e0, {1 | U, {0x24c6}}}, + {0x24e1, {1 | U, {0x24c7}}}, + {0x24e2, {1 | U, {0x24c8}}}, + {0x24e3, {1 | U, {0x24c9}}}, + {0x24e4, {1 | U, {0x24ca}}}, + {0x24e5, {1 | U, {0x24cb}}}, + {0x24e6, {1 | U, {0x24cc}}}, + {0x24e7, {1 | U, {0x24cd}}}, + {0x24e8, {1 | U, {0x24ce}}}, + {0x24e9, {1 | U, {0x24cf}}}, + {0x2c30, {1 | U, {0x2c00}}}, + {0x2c31, {1 | U, {0x2c01}}}, + {0x2c32, {1 | U, {0x2c02}}}, + {0x2c33, {1 | U, {0x2c03}}}, + {0x2c34, {1 | U, {0x2c04}}}, + {0x2c35, {1 | U, {0x2c05}}}, + {0x2c36, {1 | U, {0x2c06}}}, + {0x2c37, {1 | U, {0x2c07}}}, + {0x2c38, {1 | U, {0x2c08}}}, + {0x2c39, {1 | U, {0x2c09}}}, + {0x2c3a, {1 | U, {0x2c0a}}}, + {0x2c3b, {1 | U, {0x2c0b}}}, + {0x2c3c, {1 | U, {0x2c0c}}}, + {0x2c3d, {1 | U, {0x2c0d}}}, + {0x2c3e, {1 | U, {0x2c0e}}}, + {0x2c3f, {1 | U, {0x2c0f}}}, + {0x2c40, {1 | U, {0x2c10}}}, + {0x2c41, {1 | U, {0x2c11}}}, + {0x2c42, {1 | U, {0x2c12}}}, + {0x2c43, {1 | U, {0x2c13}}}, + {0x2c44, {1 | U, {0x2c14}}}, + {0x2c45, {1 | U, {0x2c15}}}, + {0x2c46, {1 | U, {0x2c16}}}, + {0x2c47, {1 | U, {0x2c17}}}, + {0x2c48, {1 | U, {0x2c18}}}, + {0x2c49, {1 | U, {0x2c19}}}, + {0x2c4a, {1 | U, {0x2c1a}}}, + {0x2c4b, {1 | U, {0x2c1b}}}, + {0x2c4c, {1 | U, {0x2c1c}}}, + {0x2c4d, {1 | U, {0x2c1d}}}, + {0x2c4e, {1 | U, {0x2c1e}}}, + {0x2c4f, {1 | U, {0x2c1f}}}, + {0x2c50, {1 | U, {0x2c20}}}, + {0x2c51, {1 | U, {0x2c21}}}, + {0x2c52, {1 | U, {0x2c22}}}, + {0x2c53, {1 | U, {0x2c23}}}, + {0x2c54, {1 | U, {0x2c24}}}, + {0x2c55, {1 | U, {0x2c25}}}, + {0x2c56, {1 | U, {0x2c26}}}, + {0x2c57, {1 | U, {0x2c27}}}, + {0x2c58, {1 | U, {0x2c28}}}, + {0x2c59, {1 | U, {0x2c29}}}, + {0x2c5a, {1 | U, {0x2c2a}}}, + {0x2c5b, {1 | U, {0x2c2b}}}, + {0x2c5c, {1 | U, {0x2c2c}}}, + {0x2c5d, {1 | U, {0x2c2d}}}, + {0x2c5e, {1 | U, {0x2c2e}}}, + {0x2c61, {1 | U, {0x2c60}}}, + {0x2c65, {1 | U, {0x023a}}}, + {0x2c66, {1 | U, {0x023e}}}, + {0x2c68, {1 | U, {0x2c67}}}, + {0x2c6a, {1 | U, {0x2c69}}}, + {0x2c6c, {1 | U, {0x2c6b}}}, + {0x2c73, {1 | U, {0x2c72}}}, + {0x2c76, {1 | U, {0x2c75}}}, + {0x2c81, {1 | U, {0x2c80}}}, + {0x2c83, {1 | U, {0x2c82}}}, + {0x2c85, {1 | U, {0x2c84}}}, + {0x2c87, {1 | U, {0x2c86}}}, + {0x2c89, {1 | U, {0x2c88}}}, + {0x2c8b, {1 | U, {0x2c8a}}}, + {0x2c8d, {1 | U, {0x2c8c}}}, + {0x2c8f, {1 | U, {0x2c8e}}}, + {0x2c91, {1 | U, {0x2c90}}}, + {0x2c93, {1 | U, {0x2c92}}}, + {0x2c95, {1 | U, {0x2c94}}}, + {0x2c97, {1 | U, {0x2c96}}}, + {0x2c99, {1 | U, {0x2c98}}}, + {0x2c9b, {1 | U, {0x2c9a}}}, + {0x2c9d, {1 | U, {0x2c9c}}}, + {0x2c9f, {1 | U, {0x2c9e}}}, + {0x2ca1, {1 | U, {0x2ca0}}}, + {0x2ca3, {1 | U, {0x2ca2}}}, + {0x2ca5, {1 | U, {0x2ca4}}}, + {0x2ca7, {1 | U, {0x2ca6}}}, + {0x2ca9, {1 | U, {0x2ca8}}}, + {0x2cab, {1 | U, {0x2caa}}}, + {0x2cad, {1 | U, {0x2cac}}}, + {0x2caf, {1 | U, {0x2cae}}}, + {0x2cb1, {1 | U, {0x2cb0}}}, + {0x2cb3, {1 | U, {0x2cb2}}}, + {0x2cb5, {1 | U, {0x2cb4}}}, + {0x2cb7, {1 | U, {0x2cb6}}}, + {0x2cb9, {1 | U, {0x2cb8}}}, + {0x2cbb, {1 | U, {0x2cba}}}, + {0x2cbd, {1 | U, {0x2cbc}}}, + {0x2cbf, {1 | U, {0x2cbe}}}, + {0x2cc1, {1 | U, {0x2cc0}}}, + {0x2cc3, {1 | U, {0x2cc2}}}, + {0x2cc5, {1 | U, {0x2cc4}}}, + {0x2cc7, {1 | U, {0x2cc6}}}, + {0x2cc9, {1 | U, {0x2cc8}}}, + {0x2ccb, {1 | U, {0x2cca}}}, + {0x2ccd, {1 | U, {0x2ccc}}}, + {0x2ccf, {1 | U, {0x2cce}}}, + {0x2cd1, {1 | U, {0x2cd0}}}, + {0x2cd3, {1 | U, {0x2cd2}}}, + {0x2cd5, {1 | U, {0x2cd4}}}, + {0x2cd7, {1 | U, {0x2cd6}}}, + {0x2cd9, {1 | U, {0x2cd8}}}, + {0x2cdb, {1 | U, {0x2cda}}}, + {0x2cdd, {1 | U, {0x2cdc}}}, + {0x2cdf, {1 | U, {0x2cde}}}, + {0x2ce1, {1 | U, {0x2ce0}}}, + {0x2ce3, {1 | U, {0x2ce2}}}, + {0x2cec, {1 | U, {0x2ceb}}}, + {0x2cee, {1 | U, {0x2ced}}}, + {0x2cf3, {1 | U, {0x2cf2}}}, + {0x2d00, {1 | U, {0x10a0}}}, + {0x2d01, {1 | U, {0x10a1}}}, + {0x2d02, {1 | U, {0x10a2}}}, + {0x2d03, {1 | U, {0x10a3}}}, + {0x2d04, {1 | U, {0x10a4}}}, + {0x2d05, {1 | U, {0x10a5}}}, + {0x2d06, {1 | U, {0x10a6}}}, + {0x2d07, {1 | U, {0x10a7}}}, + {0x2d08, {1 | U, {0x10a8}}}, + {0x2d09, {1 | U, {0x10a9}}}, + {0x2d0a, {1 | U, {0x10aa}}}, + {0x2d0b, {1 | U, {0x10ab}}}, + {0x2d0c, {1 | U, {0x10ac}}}, + {0x2d0d, {1 | U, {0x10ad}}}, + {0x2d0e, {1 | U, {0x10ae}}}, + {0x2d0f, {1 | U, {0x10af}}}, + {0x2d10, {1 | U, {0x10b0}}}, + {0x2d11, {1 | U, {0x10b1}}}, + {0x2d12, {1 | U, {0x10b2}}}, + {0x2d13, {1 | U, {0x10b3}}}, + {0x2d14, {1 | U, {0x10b4}}}, + {0x2d15, {1 | U, {0x10b5}}}, + {0x2d16, {1 | U, {0x10b6}}}, + {0x2d17, {1 | U, {0x10b7}}}, + {0x2d18, {1 | U, {0x10b8}}}, + {0x2d19, {1 | U, {0x10b9}}}, + {0x2d1a, {1 | U, {0x10ba}}}, + {0x2d1b, {1 | U, {0x10bb}}}, + {0x2d1c, {1 | U, {0x10bc}}}, + {0x2d1d, {1 | U, {0x10bd}}}, + {0x2d1e, {1 | U, {0x10be}}}, + {0x2d1f, {1 | U, {0x10bf}}}, + {0x2d20, {1 | U, {0x10c0}}}, + {0x2d21, {1 | U, {0x10c1}}}, + {0x2d22, {1 | U, {0x10c2}}}, + {0x2d23, {1 | U, {0x10c3}}}, + {0x2d24, {1 | U, {0x10c4}}}, + {0x2d25, {1 | U, {0x10c5}}}, + {0x2d27, {1 | U, {0x10c7}}}, + {0x2d2d, {1 | U, {0x10cd}}}, + {0xa641, {1 | U, {0xa640}}}, + {0xa643, {1 | U, {0xa642}}}, + {0xa645, {1 | U, {0xa644}}}, + {0xa647, {1 | U, {0xa646}}}, + {0xa649, {1 | U, {0xa648}}}, + {0xa64b, {2 | U, {0xa64a, 0x1c88}}}, + {0xa64d, {1 | U, {0xa64c}}}, + {0xa64f, {1 | U, {0xa64e}}}, + {0xa651, {1 | U, {0xa650}}}, + {0xa653, {1 | U, {0xa652}}}, + {0xa655, {1 | U, {0xa654}}}, + {0xa657, {1 | U, {0xa656}}}, + {0xa659, {1 | U, {0xa658}}}, + {0xa65b, {1 | U, {0xa65a}}}, + {0xa65d, {1 | U, {0xa65c}}}, + {0xa65f, {1 | U, {0xa65e}}}, + {0xa661, {1 | U, {0xa660}}}, + {0xa663, {1 | U, {0xa662}}}, + {0xa665, {1 | U, {0xa664}}}, + {0xa667, {1 | U, {0xa666}}}, + {0xa669, {1 | U, {0xa668}}}, + {0xa66b, {1 | U, {0xa66a}}}, + {0xa66d, {1 | U, {0xa66c}}}, + {0xa681, {1 | U, {0xa680}}}, + {0xa683, {1 | U, {0xa682}}}, + {0xa685, {1 | U, {0xa684}}}, + {0xa687, {1 | U, {0xa686}}}, + {0xa689, {1 | U, {0xa688}}}, + {0xa68b, {1 | U, {0xa68a}}}, + {0xa68d, {1 | U, {0xa68c}}}, + {0xa68f, {1 | U, {0xa68e}}}, + {0xa691, {1 | U, {0xa690}}}, + {0xa693, {1 | U, {0xa692}}}, + {0xa695, {1 | U, {0xa694}}}, + {0xa697, {1 | U, {0xa696}}}, + {0xa699, {1 | U, {0xa698}}}, + {0xa69b, {1 | U, {0xa69a}}}, + {0xa723, {1 | U, {0xa722}}}, + {0xa725, {1 | U, {0xa724}}}, + {0xa727, {1 | U, {0xa726}}}, + {0xa729, {1 | U, {0xa728}}}, + {0xa72b, {1 | U, {0xa72a}}}, + {0xa72d, {1 | U, {0xa72c}}}, + {0xa72f, {1 | U, {0xa72e}}}, + {0xa733, {1 | U, {0xa732}}}, + {0xa735, {1 | U, {0xa734}}}, + {0xa737, {1 | U, {0xa736}}}, + {0xa739, {1 | U, {0xa738}}}, + {0xa73b, {1 | U, {0xa73a}}}, + {0xa73d, {1 | U, {0xa73c}}}, + {0xa73f, {1 | U, {0xa73e}}}, + {0xa741, {1 | U, {0xa740}}}, + {0xa743, {1 | U, {0xa742}}}, + {0xa745, {1 | U, {0xa744}}}, + {0xa747, {1 | U, {0xa746}}}, + {0xa749, {1 | U, {0xa748}}}, + {0xa74b, {1 | U, {0xa74a}}}, + {0xa74d, {1 | U, {0xa74c}}}, + {0xa74f, {1 | U, {0xa74e}}}, + {0xa751, {1 | U, {0xa750}}}, + {0xa753, {1 | U, {0xa752}}}, + {0xa755, {1 | U, {0xa754}}}, + {0xa757, {1 | U, {0xa756}}}, + {0xa759, {1 | U, {0xa758}}}, + {0xa75b, {1 | U, {0xa75a}}}, + {0xa75d, {1 | U, {0xa75c}}}, + {0xa75f, {1 | U, {0xa75e}}}, + {0xa761, {1 | U, {0xa760}}}, + {0xa763, {1 | U, {0xa762}}}, + {0xa765, {1 | U, {0xa764}}}, + {0xa767, {1 | U, {0xa766}}}, + {0xa769, {1 | U, {0xa768}}}, + {0xa76b, {1 | U, {0xa76a}}}, + {0xa76d, {1 | U, {0xa76c}}}, + {0xa76f, {1 | U, {0xa76e}}}, + {0xa77a, {1 | U, {0xa779}}}, + {0xa77c, {1 | U, {0xa77b}}}, + {0xa77f, {1 | U, {0xa77e}}}, + {0xa781, {1 | U, {0xa780}}}, + {0xa783, {1 | U, {0xa782}}}, + {0xa785, {1 | U, {0xa784}}}, + {0xa787, {1 | U, {0xa786}}}, + {0xa78c, {1 | U, {0xa78b}}}, + {0xa791, {1 | U, {0xa790}}}, + {0xa793, {1 | U, {0xa792}}}, + {0xa797, {1 | U, {0xa796}}}, + {0xa799, {1 | U, {0xa798}}}, + {0xa79b, {1 | U, {0xa79a}}}, + {0xa79d, {1 | U, {0xa79c}}}, + {0xa79f, {1 | U, {0xa79e}}}, + {0xa7a1, {1 | U, {0xa7a0}}}, + {0xa7a3, {1 | U, {0xa7a2}}}, + {0xa7a5, {1 | U, {0xa7a4}}}, + {0xa7a7, {1 | U, {0xa7a6}}}, + {0xa7a9, {1 | U, {0xa7a8}}}, + {0xa7b5, {1 | U, {0xa7b4}}}, + {0xa7b7, {1 | U, {0xa7b6}}}, + {0xab53, {1 | U, {0xa7b3}}}, + {0xff41, {1 | U, {0xff21}}}, + {0xff42, {1 | U, {0xff22}}}, + {0xff43, {1 | U, {0xff23}}}, + {0xff44, {1 | U, {0xff24}}}, + {0xff45, {1 | U, {0xff25}}}, + {0xff46, {1 | U, {0xff26}}}, + {0xff47, {1 | U, {0xff27}}}, + {0xff48, {1 | U, {0xff28}}}, + {0xff49, {1 | U, {0xff29}}}, + {0xff4a, {1 | U, {0xff2a}}}, + {0xff4b, {1 | U, {0xff2b}}}, + {0xff4c, {1 | U, {0xff2c}}}, + {0xff4d, {1 | U, {0xff2d}}}, + {0xff4e, {1 | U, {0xff2e}}}, + {0xff4f, {1 | U, {0xff2f}}}, + {0xff50, {1 | U, {0xff30}}}, + {0xff51, {1 | U, {0xff31}}}, + {0xff52, {1 | U, {0xff32}}}, + {0xff53, {1 | U, {0xff33}}}, + {0xff54, {1 | U, {0xff34}}}, + {0xff55, {1 | U, {0xff35}}}, + {0xff56, {1 | U, {0xff36}}}, + {0xff57, {1 | U, {0xff37}}}, + {0xff58, {1 | U, {0xff38}}}, + {0xff59, {1 | U, {0xff39}}}, + {0xff5a, {1 | U, {0xff3a}}}, + {0x10428, {1 | U, {0x10400}}}, + {0x10429, {1 | U, {0x10401}}}, + {0x1042a, {1 | U, {0x10402}}}, + {0x1042b, {1 | U, {0x10403}}}, + {0x1042c, {1 | U, {0x10404}}}, + {0x1042d, {1 | U, {0x10405}}}, + {0x1042e, {1 | U, {0x10406}}}, + {0x1042f, {1 | U, {0x10407}}}, + {0x10430, {1 | U, {0x10408}}}, + {0x10431, {1 | U, {0x10409}}}, + {0x10432, {1 | U, {0x1040a}}}, + {0x10433, {1 | U, {0x1040b}}}, + {0x10434, {1 | U, {0x1040c}}}, + {0x10435, {1 | U, {0x1040d}}}, + {0x10436, {1 | U, {0x1040e}}}, + {0x10437, {1 | U, {0x1040f}}}, + {0x10438, {1 | U, {0x10410}}}, + {0x10439, {1 | U, {0x10411}}}, + {0x1043a, {1 | U, {0x10412}}}, + {0x1043b, {1 | U, {0x10413}}}, + {0x1043c, {1 | U, {0x10414}}}, + {0x1043d, {1 | U, {0x10415}}}, + {0x1043e, {1 | U, {0x10416}}}, + {0x1043f, {1 | U, {0x10417}}}, + {0x10440, {1 | U, {0x10418}}}, + {0x10441, {1 | U, {0x10419}}}, + {0x10442, {1 | U, {0x1041a}}}, + {0x10443, {1 | U, {0x1041b}}}, + {0x10444, {1 | U, {0x1041c}}}, + {0x10445, {1 | U, {0x1041d}}}, + {0x10446, {1 | U, {0x1041e}}}, + {0x10447, {1 | U, {0x1041f}}}, + {0x10448, {1 | U, {0x10420}}}, + {0x10449, {1 | U, {0x10421}}}, + {0x1044a, {1 | U, {0x10422}}}, + {0x1044b, {1 | U, {0x10423}}}, + {0x1044c, {1 | U, {0x10424}}}, + {0x1044d, {1 | U, {0x10425}}}, + {0x1044e, {1 | U, {0x10426}}}, + {0x1044f, {1 | U, {0x10427}}}, + {0x104d8, {1 | U, {0x104b0}}}, + {0x104d9, {1 | U, {0x104b1}}}, + {0x104da, {1 | U, {0x104b2}}}, + {0x104db, {1 | U, {0x104b3}}}, + {0x104dc, {1 | U, {0x104b4}}}, + {0x104dd, {1 | U, {0x104b5}}}, + {0x104de, {1 | U, {0x104b6}}}, + {0x104df, {1 | U, {0x104b7}}}, + {0x104e0, {1 | U, {0x104b8}}}, + {0x104e1, {1 | U, {0x104b9}}}, + {0x104e2, {1 | U, {0x104ba}}}, + {0x104e3, {1 | U, {0x104bb}}}, + {0x104e4, {1 | U, {0x104bc}}}, + {0x104e5, {1 | U, {0x104bd}}}, + {0x104e6, {1 | U, {0x104be}}}, + {0x104e7, {1 | U, {0x104bf}}}, + {0x104e8, {1 | U, {0x104c0}}}, + {0x104e9, {1 | U, {0x104c1}}}, + {0x104ea, {1 | U, {0x104c2}}}, + {0x104eb, {1 | U, {0x104c3}}}, + {0x104ec, {1 | U, {0x104c4}}}, + {0x104ed, {1 | U, {0x104c5}}}, + {0x104ee, {1 | U, {0x104c6}}}, + {0x104ef, {1 | U, {0x104c7}}}, + {0x104f0, {1 | U, {0x104c8}}}, + {0x104f1, {1 | U, {0x104c9}}}, + {0x104f2, {1 | U, {0x104ca}}}, + {0x104f3, {1 | U, {0x104cb}}}, + {0x104f4, {1 | U, {0x104cc}}}, + {0x104f5, {1 | U, {0x104cd}}}, + {0x104f6, {1 | U, {0x104ce}}}, + {0x104f7, {1 | U, {0x104cf}}}, + {0x104f8, {1 | U, {0x104d0}}}, + {0x104f9, {1 | U, {0x104d1}}}, + {0x104fa, {1 | U, {0x104d2}}}, + {0x104fb, {1 | U, {0x104d3}}}, + {0x10cc0, {1 | U, {0x10c80}}}, + {0x10cc1, {1 | U, {0x10c81}}}, + {0x10cc2, {1 | U, {0x10c82}}}, + {0x10cc3, {1 | U, {0x10c83}}}, + {0x10cc4, {1 | U, {0x10c84}}}, + {0x10cc5, {1 | U, {0x10c85}}}, + {0x10cc6, {1 | U, {0x10c86}}}, + {0x10cc7, {1 | U, {0x10c87}}}, + {0x10cc8, {1 | U, {0x10c88}}}, + {0x10cc9, {1 | U, {0x10c89}}}, + {0x10cca, {1 | U, {0x10c8a}}}, + {0x10ccb, {1 | U, {0x10c8b}}}, + {0x10ccc, {1 | U, {0x10c8c}}}, + {0x10ccd, {1 | U, {0x10c8d}}}, + {0x10cce, {1 | U, {0x10c8e}}}, + {0x10ccf, {1 | U, {0x10c8f}}}, + {0x10cd0, {1 | U, {0x10c90}}}, + {0x10cd1, {1 | U, {0x10c91}}}, + {0x10cd2, {1 | U, {0x10c92}}}, + {0x10cd3, {1 | U, {0x10c93}}}, + {0x10cd4, {1 | U, {0x10c94}}}, + {0x10cd5, {1 | U, {0x10c95}}}, + {0x10cd6, {1 | U, {0x10c96}}}, + {0x10cd7, {1 | U, {0x10c97}}}, + {0x10cd8, {1 | U, {0x10c98}}}, + {0x10cd9, {1 | U, {0x10c99}}}, + {0x10cda, {1 | U, {0x10c9a}}}, + {0x10cdb, {1 | U, {0x10c9b}}}, + {0x10cdc, {1 | U, {0x10c9c}}}, + {0x10cdd, {1 | U, {0x10c9d}}}, + {0x10cde, {1 | U, {0x10c9e}}}, + {0x10cdf, {1 | U, {0x10c9f}}}, + {0x10ce0, {1 | U, {0x10ca0}}}, + {0x10ce1, {1 | U, {0x10ca1}}}, + {0x10ce2, {1 | U, {0x10ca2}}}, + {0x10ce3, {1 | U, {0x10ca3}}}, + {0x10ce4, {1 | U, {0x10ca4}}}, + {0x10ce5, {1 | U, {0x10ca5}}}, + {0x10ce6, {1 | U, {0x10ca6}}}, + {0x10ce7, {1 | U, {0x10ca7}}}, + {0x10ce8, {1 | U, {0x10ca8}}}, + {0x10ce9, {1 | U, {0x10ca9}}}, + {0x10cea, {1 | U, {0x10caa}}}, + {0x10ceb, {1 | U, {0x10cab}}}, + {0x10cec, {1 | U, {0x10cac}}}, + {0x10ced, {1 | U, {0x10cad}}}, + {0x10cee, {1 | U, {0x10cae}}}, + {0x10cef, {1 | U, {0x10caf}}}, + {0x10cf0, {1 | U, {0x10cb0}}}, + {0x10cf1, {1 | U, {0x10cb1}}}, + {0x10cf2, {1 | U, {0x10cb2}}}, + {0x118c0, {1 | U, {0x118a0}}}, + {0x118c1, {1 | U, {0x118a1}}}, + {0x118c2, {1 | U, {0x118a2}}}, + {0x118c3, {1 | U, {0x118a3}}}, + {0x118c4, {1 | U, {0x118a4}}}, + {0x118c5, {1 | U, {0x118a5}}}, + {0x118c6, {1 | U, {0x118a6}}}, + {0x118c7, {1 | U, {0x118a7}}}, + {0x118c8, {1 | U, {0x118a8}}}, + {0x118c9, {1 | U, {0x118a9}}}, + {0x118ca, {1 | U, {0x118aa}}}, + {0x118cb, {1 | U, {0x118ab}}}, + {0x118cc, {1 | U, {0x118ac}}}, + {0x118cd, {1 | U, {0x118ad}}}, + {0x118ce, {1 | U, {0x118ae}}}, + {0x118cf, {1 | U, {0x118af}}}, + {0x118d0, {1 | U, {0x118b0}}}, + {0x118d1, {1 | U, {0x118b1}}}, + {0x118d2, {1 | U, {0x118b2}}}, + {0x118d3, {1 | U, {0x118b3}}}, + {0x118d4, {1 | U, {0x118b4}}}, + {0x118d5, {1 | U, {0x118b5}}}, + {0x118d6, {1 | U, {0x118b6}}}, + {0x118d7, {1 | U, {0x118b7}}}, + {0x118d8, {1 | U, {0x118b8}}}, + {0x118d9, {1 | U, {0x118b9}}}, + {0x118da, {1 | U, {0x118ba}}}, + {0x118db, {1 | U, {0x118bb}}}, + {0x118dc, {1 | U, {0x118bc}}}, + {0x118dd, {1 | U, {0x118bd}}}, + {0x118de, {1 | U, {0x118be}}}, + {0x118df, {1 | U, {0x118bf}}}, + {0x1e922, {1 | U, {0x1e900}}}, + {0x1e923, {1 | U, {0x1e901}}}, + {0x1e924, {1 | U, {0x1e902}}}, + {0x1e925, {1 | U, {0x1e903}}}, + {0x1e926, {1 | U, {0x1e904}}}, + {0x1e927, {1 | U, {0x1e905}}}, + {0x1e928, {1 | U, {0x1e906}}}, + {0x1e929, {1 | U, {0x1e907}}}, + {0x1e92a, {1 | U, {0x1e908}}}, + {0x1e92b, {1 | U, {0x1e909}}}, + {0x1e92c, {1 | U, {0x1e90a}}}, + {0x1e92d, {1 | U, {0x1e90b}}}, + {0x1e92e, {1 | U, {0x1e90c}}}, + {0x1e92f, {1 | U, {0x1e90d}}}, + {0x1e930, {1 | U, {0x1e90e}}}, + {0x1e931, {1 | U, {0x1e90f}}}, + {0x1e932, {1 | U, {0x1e910}}}, + {0x1e933, {1 | U, {0x1e911}}}, + {0x1e934, {1 | U, {0x1e912}}}, + {0x1e935, {1 | U, {0x1e913}}}, + {0x1e936, {1 | U, {0x1e914}}}, + {0x1e937, {1 | U, {0x1e915}}}, + {0x1e938, {1 | U, {0x1e916}}}, + {0x1e939, {1 | U, {0x1e917}}}, + {0x1e93a, {1 | U, {0x1e918}}}, + {0x1e93b, {1 | U, {0x1e919}}}, + {0x1e93c, {1 | U, {0x1e91a}}}, + {0x1e93d, {1 | U, {0x1e91b}}}, + {0x1e93e, {1 | U, {0x1e91c}}}, + {0x1e93f, {1 | U, {0x1e91d}}}, + {0x1e940, {1 | U, {0x1e91e}}}, + {0x1e941, {1 | U, {0x1e91f}}}, + {0x1e942, {1 | U, {0x1e920}}}, + {0x1e943, {1 | U, {0x1e921}}}, +#define CaseUnfold_11_Locale \ + (*(CaseUnfold_11_Type(*)[1])(CaseUnfold_11_Table + 1266)) + {0x0069, {1 | U, {0x0049}}}, +}; + +/* C code produced by gperf version 3.0.4 */ +/* Command-line: gperf -7 -k1,2,3 -F,-1 -c -j1 -i1 -t -T -E -C -H + * onigenc_unicode_CaseUnfold_11_hash -N onigenc_unicode_CaseUnfold_11_lookup -n + */ + +/* maximum key range = 2216, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +# ifdef __cplusplus +inline +# endif +#endif + /*ARGSUSED*/ + static unsigned int + onigenc_unicode_CaseUnfold_11_hash(const OnigCodePoint code) +{ + static const unsigned short asso_values[] + = {1, 2219, 2, 14, 4, 807, 9, 379, 10, 179, 70, 161, + 2, 3, 411, 4, 2219, 2219, 2219, 2219, 2219, 2219, 2219, 2219, + 2219, 2219, 2219, 2219, 2219, 80, 2219, 2219, 2219, 2219, 2219, 2219, + 2219, 2219, 2219, 2219, 2219, 2219, 2219, 1, 2219, 2219, 2219, 2219, + 2219, 2219, 2219, 2219, 2219, 210, 2219, 2219, 2219, 2219, 2219, 2219, + 2219, 2219, 53, 2219, 7, 8, 306, 607, 169, 844, 431, 722, + 125, 1047, 489, 1394, 15, 16, 324, 1361, 140, 521, 47, 461, + 221, 985, 70, 965, 9, 1085, 51, 1029, 223, 11, 430, 1168, + 122, 1457, 344, 930, 91, 711, 31, 651, 157, 772, 224, 876, + 262, 900, 254, 686, 221, 830, 1335, 755, 432, 623, 1382, 675, + 1275, 587, 99, 821, 1530, 958, 195, 810, 1518, 739, 330, 361, + 767, 313, 941, 400, 925, 384, 1142, 295, 1295, 242, 1103, 229, + 1082, 206, 1066, 104, 1317, 137, 1249, 263, 1229, 115, 1154, 71, + 135, 60, 1211, 158, 1472, 175, 1232, 1, 1345, 27, 1269, 38, + 1111, 87, 1189, 49, 1256, 503, 1157, 574, 1410, 556, 1200, 787, + 948, 486, 1316, 797, 1218, 1044, 1282, 1007, 1126, 996, 818, 1019, + 218, 1072}; + return asso_values[bits_of(code, 2) + 66] + asso_values[bits_of(code, 1) + 4] + + asso_values[bits_of(code, 0)]; +} + +#ifdef __GNUC__ +__inline +# if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ + __attribute__((__gnu_inline__)) +# endif +#endif + static const CodePointList3 * + onigenc_unicode_CaseUnfold_11_lookup(const OnigCodePoint code) +{ + enum + { + MIN_CODE_VALUE = 0x61, + MAX_CODE_VALUE = 0x1e943, + TOTAL_KEYWORDS = 1267, + MIN_WORD_LENGTH = 3, + MAX_WORD_LENGTH = 3, + MIN_HASH_VALUE = 3, + MAX_HASH_VALUE = 2218 + }; + + static const short wordlist[] = {-1, + -1, + -1, + /*0x13e1*/ 542, + /*0x0461*/ 339, + /*0x04e1*/ 399, + /*0x0061*/ 0, + -1, + /*0x104e1*/ 1122, + /*0x1e61*/ 613, + /*0x1ee1*/ 672, + /*0x0161*/ 102, + /*0x0261*/ 210, + /*0x2ce1*/ 904, + -1, + /*0x049b*/ 364, + -1, + -1, + /*0x24e1*/ 792, + /*0x1e1b*/ 578, + /*0x048b*/ 356, + /*0x011b*/ 69, + /*0x021b*/ 178, + /*0x2c9b*/ 869, + /*0x1e0b*/ 570, + /*0x1e8b*/ 634, + /*0x010b*/ 61, + /*0x020b*/ 170, + /*0x2c8b*/ 861, + /*0x13e3*/ 544, + /*0x0463*/ 340, + /*0x04e3*/ 400, + /*0x0063*/ 2, + /*0x13a4*/ 481, + /*0x104e3*/ 1124, + /*0x1e63*/ 614, + /*0x1ee3*/ 673, + /*0x0163*/ 103, + /*0x0263*/ 211, + /*0x2ce3*/ 905, + /*0x13e5*/ 546, + /*0x0465*/ 341, + /*0x04e5*/ 401, + /*0x0065*/ 4, + /*0x24e3*/ 794, + /*0x104e5*/ 1126, + /*0x1e65*/ 615, + /*0x1ee5*/ 674, + /*0x0165*/ 104, + /*0x0265*/ 212, + /*0xa761*/ 1016, + /*0x13e9*/ 550, + /*0x0469*/ 343, + /*0x04e9*/ 403, + /*0x0069*/ 1266, + /*0x24e5*/ 796, + /*0x104e9*/ 1130, + /*0x1e69*/ 617, + /*0x1ee9*/ 676, + /*0x0169*/ 106, + /*0x0269*/ 215, + -1, + /*0x13db*/ 536, + /*0x045b*/ 334, + /*0x04db*/ 396, + -1, + /*0x24e9*/ 800, + /*0x104db*/ 1116, + /*0x1e5b*/ 610, + /*0x1edb*/ 669, + /*0x015b*/ 99, + /*0x025b*/ 207, + /*0x2cdb*/ 901, + /*0x13d9*/ 534, + /*0x0459*/ 332, + /*0x04d9*/ 395, + /*0xa763*/ 1017, + /*0x24db*/ 786, + /*0x104d9*/ 1114, + /*0x1e59*/ 609, + /*0x1ed9*/ 668, + /*0x0159*/ 98, + /*0x0259*/ 206, + /*0x2cd9*/ 900, + -1, + /*0x10ce1*/ 1182, + -1, + /*0xa765*/ 1018, + /*0x24d9*/ 784, + /*0x13e7*/ 548, + /*0x0467*/ 342, + /*0x04e7*/ 402, + /*0x0067*/ 6, + /*0x13a2*/ 479, + /*0x104e7*/ 1128, + /*0x1e67*/ 616, + /*0x1ee7*/ 675, + /*0x0167*/ 105, + /*0xa769*/ 1020, + -1, + -1, + /*0x13b8*/ 501, + /*0x0438*/ 299, + -1, + /*0x24e7*/ 798, + /*0x10438*/ 1089, + /*0x13d1*/ 526, + /*0x0451*/ 324, + /*0x04d1*/ 391, + /*0xa75b*/ 1013, + -1, + /*0x10ce3*/ 1184, + /*0x1e51*/ 605, + /*0x1ed1*/ 664, + /*0x0151*/ 94, + /*0x0251*/ 200, + /*0x2cd1*/ 896, + /*0x13d7*/ 532, + /*0x0457*/ 330, + /*0x04d7*/ 394, + /*0xa759*/ 1012, + /*0x24d1*/ 776, + /*0x10ce5*/ 1186, + /*0x1e57*/ 608, + /*0x1ed7*/ 667, + /*0x0157*/ 97, + /*0x0257*/ 205, + /*0x2cd7*/ 899, + -1, + -1, + /*0x0586*/ 476, + -1, + /*0x24d7*/ 782, + /*0x10ce9*/ 1190, + -1, + -1, + /*0xa767*/ 1019, + /*0x13da*/ 535, + /*0x045a*/ 333, + /*0x13d3*/ 528, + /*0x0453*/ 326, + /*0x04d3*/ 392, + /*0x104da*/ 1115, + /*0xa661*/ 965, + /*0x10cdb*/ 1176, + /*0x1e53*/ 606, + /*0x1ed3*/ 665, + /*0x0153*/ 95, + /*0x0253*/ 202, + /*0x2cd3*/ 897, + -1, + -1, + /*0x24da*/ 785, + /*0xa751*/ 1008, + /*0x24d3*/ 778, + /*0x10cd9*/ 1174, + -1, + -1, + -1, + /*0x13a6*/ 483, + /*0x13dd*/ 538, + /*0x045d*/ 336, + /*0x04dd*/ 397, + /*0x03e1*/ 279, + /*0xa757*/ 1011, + /*0x104dd*/ 1118, + /*0x1e5d*/ 611, + /*0x1edd*/ 670, + /*0x015d*/ 100, + /*0xa663*/ 966, + /*0x2cdd*/ 902, + /*0x10ce7*/ 1188, + -1, + -1, + /*0x0582*/ 472, + /*0x24dd*/ 788, + -1, + /*0x13df*/ 540, + /*0x045f*/ 338, + /*0x04df*/ 398, + /*0xa665*/ 967, + -1, + /*0x104df*/ 1120, + /*0x1e5f*/ 612, + /*0x1edf*/ 671, + /*0x015f*/ 101, + /*0xa753*/ 1009, + /*0x2cdf*/ 903, + /*0x10cd1*/ 1166, + /*0x03e3*/ 280, + /*0xab53*/ 1046, + /*0xa669*/ 969, + /*0x24df*/ 790, + -1, + -1, + /*0x028a*/ 229, + /*0x028b*/ 230, + /*0x13bc*/ 505, + /*0x043c*/ 303, + /*0x10cd7*/ 1172, + /*0x03e5*/ 281, + /*0x1043c*/ 1093, + /*0xa65b*/ 962, + -1, + -1, + /*0x013c*/ 84, + /*0x023c*/ 190, + /*0xa75d*/ 1014, + /*0x13cf*/ 524, + /*0x044f*/ 322, + /*0x04cf*/ 390, + /*0x03e9*/ 283, + /*0x1044f*/ 1112, + /*0xa659*/ 961, + /*0x1e4f*/ 604, + /*0x1ecf*/ 663, + /*0x014f*/ 93, + /*0x024f*/ 198, + /*0x2ccf*/ 895, + /*0x10cda*/ 1175, + -1, + /*0x10cd3*/ 1168, + /*0x03db*/ 276, + /*0x13ae*/ 491, + /*0xa75f*/ 1015, + /*0x2c61*/ 848, + /*0x13a8*/ 485, + /*0x1042e*/ 1079, + /*0x017e*/ 116, + /*0xa667*/ 968, + /*0x10428*/ 1073, + /*0x13cd*/ 522, + /*0x044d*/ 320, + /*0x03d9*/ 275, + -1, + /*0x1044d*/ 1110, + -1, + /*0x1e4d*/ 603, + /*0x1ecd*/ 662, + /*0x014d*/ 92, + /*0x024d*/ 197, + /*0x2ccd*/ 894, + /*0x10cdd*/ 1178, + -1, + /*0x13cb*/ 520, + /*0x044b*/ 318, + /*0xa651*/ 957, + -1, + /*0x1044b*/ 1108, + /*0x03e7*/ 282, + /*0x1e4b*/ 602, + /*0x1ecb*/ 661, + /*0x014b*/ 91, + /*0x024b*/ 196, + /*0x2ccb*/ 893, + /*0xa74f*/ 1007, + /*0x13ac*/ 489, + /*0xa657*/ 960, + -1, + /*0x10cdf*/ 1180, + /*0x1042c*/ 1077, + /*0x03b8*/ 252, + /*0x2c65*/ 849, + -1, + /*0x13aa*/ 487, + /*0x13d5*/ 530, + /*0x0455*/ 328, + /*0x04d5*/ 393, + /*0x1042a*/ 1075, + -1, + -1, + /*0x1e55*/ 607, + /*0x1ed5*/ 666, + /*0x0155*/ 96, + /*0x118db*/ 1227, + /*0x2cd5*/ 898, + -1, + /*0x03d7*/ 274, + /*0xa74d*/ 1006, + /*0xa653*/ 958, + /*0x24d5*/ 780, + -1, + -1, + -1, + /*0x2c5b*/ 844, + /*0x118d9*/ 1225, + -1, + -1, + -1, + -1, + /*0x10ccf*/ 1164, + /*0xa74b*/ 1005, + -1, + -1, + -1, + /*0x2c59*/ 842, + -1, + /*0x13c9*/ 518, + /*0x0449*/ 316, + -1, + /*0xa65d*/ 963, + /*0x10449*/ 1106, + /*0x029e*/ 234, + /*0x1e49*/ 601, + /*0x1ec9*/ 660, + -1, + /*0x0249*/ 195, + /*0x2cc9*/ 892, + /*0x1f61*/ 729, + -1, + -1, + /*0x0580*/ 470, + /*0xa755*/ 1010, + /*0x10ccd*/ 1162, + -1, + /*0x13c3*/ 512, + /*0x0443*/ 310, + /*0xa65f*/ 964, + /*0x118d1*/ 1217, + /*0x10443*/ 1100, + /*0x03dd*/ 277, + /*0x1e43*/ 598, + /*0x1ec3*/ 657, + /*0x2c38*/ 809, + -1, + /*0x2cc3*/ 889, + /*0x10ccb*/ 1160, + -1, + /*0x2c51*/ 834, + /*0x118d7*/ 1223, + -1, + -1, + /*0x13c0*/ 509, + /*0x0440*/ 307, + /*0x1f63*/ 731, + -1, + /*0x10440*/ 1097, + /*0x03df*/ 278, + /*0x1f24*/ 706, + /*0x2c57*/ 840, + /*0x0140*/ 86, + /*0x0240*/ 192, + -1, + -1, + /*0xa749*/ 1004, + /*0x1f65*/ 733, + /*0x13a0*/ 477, + /*0x10cd5*/ 1170, + /*0xa64f*/ 956, + /*0x118da*/ 1226, + -1, + /*0x118d3*/ 1219, + -1, + -1, + /*0x1f10*/ 696, + -1, + -1, + /*0x03bc*/ 256, + -1, + /*0x2c5a*/ 843, + -1, + /*0x2c53*/ 836, + /*0xa743*/ 1001, + /*0x13c1*/ 510, + /*0x0441*/ 308, + -1, + -1, + /*0x10441*/ 1098, + -1, + /*0x1e41*/ 597, + /*0x1ec1*/ 656, + /*0xa64d*/ 955, + /*0x118dd*/ 1229, + /*0x2cc1*/ 888, + -1, + -1, + -1, + /*0x1f14*/ 700, + -1, + /*0x10cc9*/ 1158, + -1, + /*0x01e1*/ 151, + /*0x2c5d*/ 846, + /*0x03ae*/ 243, + /*0xa64b*/ 954, + -1, + /*0x13c7*/ 516, + /*0x0447*/ 314, + -1, + /*0x118df*/ 1231, + /*0x10447*/ 1104, + /*0x03cd*/ 272, + /*0x1e47*/ 600, + /*0x1ec7*/ 659, + /*0x1f67*/ 735, + /*0x0247*/ 194, + /*0x2cc7*/ 891, + /*0x10cc3*/ 1152, + /*0x1f22*/ 704, + -1, + -1, + /*0x0292*/ 232, + /*0x13c5*/ 514, + /*0x0445*/ 312, + /*0x03cb*/ 270, + /*0xa655*/ 959, + /*0x10445*/ 1102, + /*0x01e3*/ 152, + /*0x1e45*/ 599, + /*0x1ec5*/ 658, + /*0xa741*/ 1000, + /*0x1f51*/ 724, + /*0x2cc5*/ 890, + /*0x0561*/ 439, + /*0x10cc0*/ 1149, + /*0xff59*/ 1071, + /*0x03ac*/ 241, + -1, + /*0x01e5*/ 153, + /*0x2c3c*/ 813, + /*0x118cf*/ 1215, + -1, + /*0x1f57*/ 727, + /*0x051b*/ 428, + -1, + -1, + -1, + -1, + /*0x050b*/ 420, + /*0x01e9*/ 155, + /*0x2c4f*/ 832, + -1, + /*0x1f06*/ 694, + /*0xa747*/ 1003, + /*0x13b2*/ 495, + /*0x0432*/ 293, + /*0x0584*/ 474, + /*0xa649*/ 953, + /*0x10432*/ 1083, + /*0x0563*/ 441, + /*0x2d16*/ 931, + -1, + /*0x2d1b*/ 936, + /*0x118cd*/ 1213, + /*0x1f53*/ 725, + /*0x10cc1*/ 1150, + /*0x2d0a*/ 919, + /*0x2d0b*/ 920, + /*0xff51*/ 1063, + /*0xa745*/ 1002, + /*0x0565*/ 443, + -1, + -1, + /*0x2c4d*/ 830, + -1, + /*0xa643*/ 950, + /*0x118cb*/ 1211, + /*0x03c9*/ 268, + -1, + /*0xff57*/ 1069, + -1, + /*0x0569*/ 447, + /*0x2d24*/ 945, + -1, + /*0x1f26*/ 708, + /*0x0491*/ 359, + /*0x2c4b*/ 828, + /*0x01e7*/ 154, + /*0x10cc7*/ 1156, + /*0x1e11*/ 573, + /*0x1e91*/ 637, + /*0x0111*/ 64, + /*0x0211*/ 173, + /*0x2c91*/ 864, + /*0xa79b*/ 1036, + /*0x03c3*/ 262, + /*0x1f02*/ 690, + /*0x118d5*/ 1221, + /*0x2d10*/ 925, + /*0xff5a*/ 1072, + /*0x1e924*/ 1234, + /*0xff53*/ 1065, + /*0x2d18*/ 933, + -1, + /*0x10cc5*/ 1154, + -1, + /*0x0280*/ 224, + /*0x2c55*/ 838, + /*0x13f3*/ 560, + /*0x0473*/ 348, + /*0x04f3*/ 408, + /*0x0073*/ 17, + /*0x03c0*/ 260, + /*0x104f3*/ 1140, + /*0x1e73*/ 622, + /*0x1ef3*/ 681, + /*0x0173*/ 111, + -1, + /*0x2cf3*/ 908, + /*0x0567*/ 445, + -1, + /*0x2d14*/ 929, + /*0x019e*/ 126, + /*0xa641*/ 949, + /*0x028c*/ 231, + /*0x13eb*/ 552, + /*0x046b*/ 344, + /*0x04eb*/ 404, + /*0x006b*/ 9, + /*0x118c9*/ 1209, + /*0x104eb*/ 1132, + /*0x1e6b*/ 618, + /*0x1eeb*/ 677, + /*0x016b*/ 107, + /*0x026b*/ 217, + /*0x01da*/ 147, + -1, + -1, + -1, + /*0x2c49*/ 826, + -1, + -1, + /*0x2d22*/ 943, + /*0x03c1*/ 261, + -1, + /*0x048f*/ 358, + /*0xa647*/ 952, + /*0x118c3*/ 1203, + /*0x1f12*/ 698, + /*0x1e0f*/ 572, + /*0x1e8f*/ 636, + /*0x010f*/ 63, + /*0x020f*/ 172, + /*0x2c8f*/ 863, + /*0xa69b*/ 985, + -1, + -1, + /*0x2c43*/ 820, + /*0x01dd*/ 149, + /*0xa68b*/ 977, + /*0x1e922*/ 1232, + -1, + /*0xa645*/ 951, + -1, + /*0x118c0*/ 1200, + -1, + /*0x03c7*/ 266, + -1, + /*0x1e938*/ 1254, + -1, + /*0xff4f*/ 1061, + -1, + /*0xa76b*/ 1021, + /*0x2d1e*/ 939, + /*0x2c40*/ 817, + /*0x01df*/ 150, + /*0x2d06*/ 915, + /*0x0373*/ 236, + /*0x13ef*/ 556, + /*0x046f*/ 346, + /*0x04ef*/ 406, + /*0x006f*/ 13, + /*0x03c5*/ 264, + /*0x104ef*/ 1136, + /*0x1e6f*/ 620, + /*0x1eef*/ 679, + /*0x016f*/ 109, + /*0x026f*/ 219, + -1, + -1, + /*0x1f55*/ 726, + /*0x2d0e*/ 923, + -1, + /*0xff4d*/ 1059, + -1, + /*0x118c1*/ 1201, + /*0x13ed*/ 554, + /*0x046d*/ 345, + /*0x04ed*/ 405, + /*0x006d*/ 11, + -1, + /*0x104ed*/ 1134, + /*0x1e6d*/ 619, + /*0x1eed*/ 678, + /*0x016d*/ 108, + /*0x2c41*/ 818, + /*0xff4b*/ 1057, + /*0x10ceb*/ 1192, + -1, + /*0x13b7*/ 500, + /*0x0437*/ 298, + /*0x04b7*/ 378, + -1, + /*0x10437*/ 1088, + /*0x03b2*/ 246, + /*0x1e37*/ 592, + /*0x1eb7*/ 651, + /*0x0137*/ 82, + /*0x118c7*/ 1207, + /*0x2cb7*/ 883, + /*0x2d02*/ 911, + /*0x0192*/ 122, + -1, + /*0x019a*/ 125, + /*0x01a8*/ 130, + /*0xa76f*/ 1023, + /*0x1e926*/ 1236, + /*0xff55*/ 1067, + /*0x2c47*/ 824, + /*0x1fe1*/ 755, + -1, + /*0x0481*/ 355, + /*0x0581*/ 471, + /*0x1f00*/ 688, + /*0x118c5*/ 1205, + /*0x1e01*/ 565, + /*0x1e81*/ 629, + /*0x0101*/ 56, + /*0x0201*/ 165, + /*0x2c81*/ 856, + /*0x1f43*/ 721, + -1, + -1, + /*0xa76d*/ 1022, + /*0x2c45*/ 822, + /*0x13b3*/ 496, + /*0x0433*/ 294, + /*0x04b3*/ 376, + -1, + /*0x10433*/ 1084, + /*0x057e*/ 468, + /*0x1e33*/ 590, + /*0x1eb3*/ 649, + /*0x0133*/ 80, + /*0x0233*/ 189, + /*0x2cb3*/ 881, + /*0xa737*/ 995, + /*0x1f40*/ 718, + -1, + /*0xff49*/ 1055, + /*0x10cef*/ 1196, + -1, + -1, + -1, + /*0x1e93c*/ 1258, + /*0xa66b*/ 970, + /*0x1fe5*/ 756, + -1, + /*0x03f3*/ 288, + -1, + /*0x217e*/ 772, + /*0x1f20*/ 702, + /*0x2d12*/ 927, + /*0x13a5*/ 482, + /*0x2d1a*/ 935, + /*0x04a5*/ 369, + /*0x2c32*/ 803, + /*0xff43*/ 1049, + /*0x10ced*/ 1194, + /*0x1e25*/ 583, + /*0x1ea5*/ 642, + /*0x0125*/ 74, + /*0x0225*/ 182, + /*0x2ca5*/ 874, + -1, + /*0x03eb*/ 284, + -1, + -1, + /*0x1f41*/ 719, + /*0x0288*/ 227, + /*0x1e92e*/ 1244, + -1, + /*0xa733*/ 993, + /*0x1e928*/ 1238, + -1, + /*0x01c9*/ 139, + -1, + /*0x13b5*/ 498, + /*0x0435*/ 296, + /*0x04b5*/ 377, + -1, + /*0x10435*/ 1086, + -1, + /*0x1e35*/ 591, + /*0x1eb5*/ 650, + /*0x0135*/ 81, + /*0x0180*/ 117, + /*0x2cb5*/ 882, + /*0x13ad*/ 490, + -1, + /*0x04ad*/ 373, + -1, + /*0x1042d*/ 1078, + -1, + /*0x1e2d*/ 587, + /*0x1ead*/ 646, + /*0x012d*/ 78, + /*0x022d*/ 186, + /*0x2cad*/ 878, + -1, + /*0xa725*/ 987, + -1, + -1, + /*0x1e92c*/ 1242, + /*0x018c*/ 121, + /*0xff41*/ 1047, + -1, + /*0x1f45*/ 723, + -1, + -1, + /*0x2c73*/ 854, + /*0x1e92a*/ 1240, + /*0x1fd1*/ 753, + /*0x13a3*/ 480, + -1, + /*0x04a3*/ 368, + /*0xa66d*/ 971, + -1, + /*0x03ef*/ 286, + /*0x1e23*/ 582, + /*0x1ea3*/ 641, + /*0x0123*/ 73, + /*0x0223*/ 181, + /*0x2ca3*/ 873, + /*0xa735*/ 994, + -1, + -1, + /*0x0585*/ 475, + /*0xff47*/ 1053, + -1, + /*0x1e05*/ 567, + /*0x1e85*/ 631, + /*0x0105*/ 58, + /*0x0205*/ 167, + /*0x2c85*/ 858, + /*0xa72d*/ 991, + /*0x03ed*/ 285, + /*0x2d00*/ 909, + /*0x1f04*/ 692, + /*0x1f32*/ 712, + -1, + /*0x13bf*/ 508, + /*0x043f*/ 306, + /*0x04bf*/ 382, + /*0xff45*/ 1051, + /*0x1043f*/ 1096, + -1, + /*0x1e3f*/ 596, + /*0x1ebf*/ 655, + /*0x03b7*/ 251, + /*0x023f*/ 191, + /*0x2cbf*/ 887, + -1, + -1, + -1, + /*0x2d0c*/ 921, + -1, + /*0x13b1*/ 494, + /*0x0431*/ 292, + /*0x04b1*/ 375, + /*0xa723*/ 986, + /*0x10431*/ 1082, + /*0x1e943*/ 1265, + /*0x1e31*/ 589, + /*0x1eb1*/ 648, + -1, + /*0x0231*/ 188, + /*0x2cb1*/ 880, + /*0x1f11*/ 697, + /*0x13c2*/ 511, + /*0x0442*/ 309, + /*0x04c2*/ 383, + -1, + /*0x10442*/ 1099, + /*0x13a7*/ 484, + /*0x2d20*/ 941, + /*0x04a7*/ 370, + /*0x0142*/ 87, + /*0x0242*/ 193, + /*0x1e940*/ 1262, + /*0x1e27*/ 584, + /*0x1ea7*/ 643, + /*0x0127*/ 75, + /*0x0227*/ 183, + /*0x2ca7*/ 875, + /*0x03b3*/ 247, + -1, + /*0xa78c*/ 1031, + /*0xa73f*/ 999, + /*0x13f1*/ 558, + /*0x0471*/ 347, + /*0x04f1*/ 407, + /*0x0071*/ 15, + /*0x1f73*/ 739, + /*0x104f1*/ 1138, + /*0x1e71*/ 621, + /*0x1ef1*/ 680, + /*0x0171*/ 110, + /*0x0271*/ 220, + /*0x13f5*/ 562, + /*0x0475*/ 349, + /*0x04f5*/ 409, + /*0x0075*/ 19, + -1, + /*0x104f5*/ 1142, + /*0x1e75*/ 623, + /*0x1ef5*/ 682, + /*0x0175*/ 112, + /*0x0275*/ 222, + /*0x00e1*/ 26, + /*0x1e941*/ 1263, + /*0x2c37*/ 808, + /*0x13bd*/ 506, + /*0x043d*/ 304, + /*0x04bd*/ 381, + -1, + /*0x1043d*/ 1094, + -1, + /*0x1e3d*/ 595, + /*0x1ebd*/ 654, + -1, + /*0xa727*/ 988, + /*0x2cbd*/ 886, + /*0x13b9*/ 502, + /*0x0439*/ 300, + /*0x04b9*/ 379, + -1, + /*0x10439*/ 1090, + /*0x017c*/ 115, + /*0x1e39*/ 593, + /*0x1eb9*/ 652, + -1, + /*0x13af*/ 492, + /*0x2cb9*/ 884, + /*0x04af*/ 374, + /*0x00e3*/ 28, + /*0x1042f*/ 1080, + /*0x03b5*/ 249, + /*0x1e2f*/ 588, + /*0x1eaf*/ 647, + /*0x012f*/ 79, + /*0x022f*/ 187, + /*0x2caf*/ 879, + -1, + -1, + -1, + /*0x00e5*/ 30, + /*0x2c33*/ 804, + /*0x03ad*/ 242, + /*0x0583*/ 473, + -1, + /*0x10cc2*/ 1151, + /*0x1e03*/ 566, + /*0x1e83*/ 630, + /*0x0103*/ 57, + /*0x0203*/ 166, + /*0x2c83*/ 857, + /*0x00e9*/ 34, + /*0x0371*/ 235, + /*0xa73d*/ 998, + -1, + /*0x2d1c*/ 937, + /*0x2d04*/ 913, + -1, + -1, + -1, + /*0x01f3*/ 159, + /*0xa77c*/ 1025, + -1, + /*0x0188*/ 120, + /*0xa739*/ 996, + /*0x10cf1*/ 1198, + -1, + /*0x0511*/ 423, + -1, + -1, + -1, + -1, + /*0x13a9*/ 486, + /*0xa72f*/ 992, + /*0x04a9*/ 371, + /*0x1e932*/ 1248, + /*0x10429*/ 1074, + /*0x01eb*/ 156, + /*0x1e29*/ 585, + /*0x1ea9*/ 644, + /*0x0129*/ 76, + /*0x0229*/ 184, + /*0x2ca9*/ 876, + /*0x037c*/ 239, + -1, + -1, + /*0x2d11*/ 926, + -1, + /*0x1f37*/ 717, + /*0x00e7*/ 32, + -1, + -1, + /*0x0573*/ 457, + /*0x2c35*/ 806, + -1, + /*0x03bf*/ 259, + /*0x13ab*/ 488, + -1, + /*0x04ab*/ 372, + -1, + /*0x1042b*/ 1076, + -1, + /*0x1e2b*/ 586, + /*0x1eab*/ 645, + /*0x012b*/ 77, + /*0x022b*/ 185, + /*0x2cab*/ 877, + -1, + /*0x1f01*/ 689, + /*0x056b*/ 449, + -1, + /*0x03b1*/ 245, + /*0x2173*/ 761, + -1, + /*0x2d08*/ 917, + -1, + -1, + -1, + /*0xa791*/ 1032, + /*0xa729*/ 989, + -1, + /*0x13c6*/ 515, + /*0x0446*/ 313, + /*0x04c6*/ 385, + /*0x1f33*/ 713, + /*0x10446*/ 1103, + /*0x13a1*/ 478, + /*0x050f*/ 422, + /*0x04a1*/ 367, + /*0x0146*/ 89, + /*0x01ef*/ 158, + -1, + /*0x1e21*/ 581, + /*0x1ea1*/ 640, + /*0x0121*/ 72, + -1, + /*0x2ca1*/ 872, + /*0x13c4*/ 513, + /*0x0444*/ 311, + /*0x04c4*/ 384, + -1, + /*0x10444*/ 1101, + -1, + /*0xa72b*/ 990, + /*0x13f2*/ 559, + /*0x0144*/ 88, + /*0x2d0f*/ 924, + /*0x0072*/ 16, + /*0x01ed*/ 157, + /*0x104f2*/ 1139, + -1, + -1, + /*0x1f25*/ 707, + /*0x0272*/ 221, + /*0x13bb*/ 504, + /*0x043b*/ 302, + /*0x04bb*/ 380, + /*0x2c3f*/ 816, + /*0x1043b*/ 1092, + -1, + /*0x1e3b*/ 594, + /*0x1ebb*/ 653, + /*0x056f*/ 453, + /*0x0495*/ 361, + /*0x2cbb*/ 885, + -1, + /*0x03bd*/ 257, + /*0x1e15*/ 575, + /*0x1e95*/ 639, + /*0x0115*/ 66, + /*0x0215*/ 175, + /*0x2c95*/ 866, + -1, + /*0x2c31*/ 802, + -1, + /*0x118c2*/ 1202, + /*0x1f35*/ 715, + /*0x03b9*/ 253, + /*0xa691*/ 980, + -1, + /*0x056d*/ 451, + -1, + -1, + /*0x0493*/ 360, + -1, + /*0x2c42*/ 819, + /*0x03af*/ 244, + /*0x1e13*/ 574, + /*0x1e93*/ 638, + /*0x0113*/ 65, + /*0x0213*/ 174, + /*0x2c93*/ 865, + -1, + /*0x047b*/ 352, + /*0x04fb*/ 412, + -1, + -1, + /*0x104fb*/ 1148, + /*0x1e7b*/ 626, + /*0x1efb*/ 685, + -1, + /*0xa73b*/ 997, + -1, + /*0x10cc6*/ 1155, + /*0x0479*/ 351, + /*0x04f9*/ 411, + /*0x0079*/ 23, + -1, + /*0x104f9*/ 1146, + /*0x1e79*/ 625, + /*0x1ef9*/ 684, + -1, + /*0x1f23*/ 705, + /*0x0501*/ 415, + -1, + -1, + /*0x047d*/ 353, + /*0x04fd*/ 413, + /*0x0283*/ 225, + /*0x10cc4*/ 1153, + /*0x00fe*/ 54, + /*0x1e7d*/ 627, + /*0x1efd*/ 686, + /*0x1f05*/ 693, + /*0x027d*/ 223, + /*0x01a5*/ 129, + /*0x10cf2*/ 1199, + /*0x0499*/ 363, + /*0x2c3d*/ 814, + -1, + /*0x1e937*/ 1253, + /*0x1e19*/ 577, + /*0x2d01*/ 910, + /*0x0119*/ 68, + /*0x0219*/ 177, + /*0x2c99*/ 868, + -1, + -1, + /*0xa68f*/ 979, + /*0x2c39*/ 810, + -1, + /*0x0477*/ 350, + /*0x04f7*/ 410, + /*0x0077*/ 21, + /*0xa7b7*/ 1045, + /*0x104f7*/ 1144, + /*0x1e77*/ 624, + /*0x1ef7*/ 683, + /*0x0177*/ 113, + /*0x1e07*/ 568, + /*0x1e87*/ 632, + /*0x0107*/ 59, + /*0x0207*/ 168, + /*0x2c87*/ 859, + -1, + /*0x1d79*/ 563, + /*0x1f31*/ 711, + /*0x0525*/ 433, + -1, + -1, + /*0x01ad*/ 131, + /*0x037b*/ 238, + /*0x13d0*/ 525, + /*0x0450*/ 323, + /*0xa781*/ 1027, + -1, + /*0x1e933*/ 1249, + /*0x1d7d*/ 564, + /*0x1f42*/ 720, + /*0x047f*/ 354, + /*0x04ff*/ 414, + /*0x0250*/ 199, + -1, + /*0x1f27*/ 709, + /*0x1e7f*/ 628, + /*0x1eff*/ 687, + /*0x2d25*/ 946, + /*0x24d0*/ 775, + /*0x13ce*/ 523, + /*0x044e*/ 321, + /*0x04ce*/ 389, + /*0x03c6*/ 265, + /*0x1044e*/ 1111, + /*0x0497*/ 362, + /*0x037d*/ 240, + /*0x01a3*/ 128, + -1, + /*0x1e17*/ 576, + /*0x1f71*/ 737, + /*0x0117*/ 67, + /*0x0217*/ 176, + /*0x2c97*/ 867, + /*0x052d*/ 437, + -1, + /*0x1e925*/ 1235, + -1, + /*0x0185*/ 119, + /*0x03c4*/ 263, + /*0x1f75*/ 741, + /*0x13cc*/ 521, + /*0x044c*/ 319, + /*0x04cc*/ 388, + -1, + /*0x1044c*/ 1109, + /*0x03f2*/ 287, + /*0xff42*/ 1048, + -1, + /*0x13e6*/ 547, + /*0xa7a5*/ 1041, + /*0x0377*/ 237, + /*0x0066*/ 5, + /*0x2d2d*/ 948, + /*0x104e6*/ 1127, + /*0x01bf*/ 137, + /*0x03bb*/ 255, + /*0xa77f*/ 1026, + /*0x0266*/ 213, + /*0x0523*/ 432, + /*0x1e935*/ 1251, + /*0x1f7c*/ 748, + -1, + -1, + /*0x24e6*/ 797, + -1, + /*0xa681*/ 972, + /*0x007a*/ 24, + -1, + /*0x104fa*/ 1147, + /*0x0505*/ 417, + /*0x1e92d*/ 1243, + /*0x017a*/ 114, + -1, + /*0xa7b5*/ 1044, + /*0x118c6*/ 1206, + -1, + -1, + /*0x2d23*/ 944, + -1, + /*0x13c8*/ 517, + /*0x0448*/ 315, + /*0x04c8*/ 386, + -1, + /*0x10448*/ 1105, + /*0x2c46*/ 823, + /*0x10cd0*/ 1165, + /*0x1f03*/ 691, + /*0x0148*/ 90, + /*0x2d05*/ 914, + /*0x2184*/ 774, + /*0x118c4*/ 1204, + /*0x13d8*/ 533, + /*0x0458*/ 331, + /*0x03fb*/ 290, + /*0x13ec*/ 553, + /*0x1e923*/ 1233, + /*0x104d8*/ 1113, + /*0x006c*/ 10, + -1, + /*0x104ec*/ 1133, + /*0x2c44*/ 821, + /*0x10cce*/ 1163, + -1, + /*0x026c*/ 218, + /*0x2cec*/ 906, + -1, + /*0x24d8*/ 783, + /*0x049d*/ 365, + -1, + /*0xa7a3*/ 1040, + /*0xa77a*/ 1024, + /*0x1e1d*/ 579, + /*0x01f5*/ 160, + /*0x011d*/ 70, + /*0x021d*/ 179, + /*0x2c9d*/ 870, + -1, + /*0x2c3b*/ 812, + -1, + /*0x0527*/ 434, + /*0xa785*/ 1029, + -1, + /*0x10ccc*/ 1161, + /*0x1e93f*/ 1261, + -1, + /*0x01bd*/ 136, + /*0x13e8*/ 549, + -1, + -1, + /*0x0068*/ 7, + /*0x10ce6*/ 1187, + /*0x104e8*/ 1129, + -1, + -1, + /*0x0571*/ 455, + /*0x0268*/ 214, + /*0x01b9*/ 135, + /*0x13f0*/ 557, + /*0x2d27*/ 947, + /*0x1e931*/ 1247, + /*0x0070*/ 14, + /*0x24e8*/ 799, + /*0x104f0*/ 1137, + -1, + /*0x0575*/ 459, + -1, + -1, + -1, + /*0x13dc*/ 537, + /*0x045c*/ 335, + -1, + /*0x1e942*/ 1264, + -1, + /*0x104dc*/ 1117, + /*0x2171*/ 759, + -1, + /*0x1e927*/ 1237, + /*0x025c*/ 208, + /*0x0076*/ 20, + /*0x0183*/ 118, + /*0x104f6*/ 1143, + /*0x10cc8*/ 1157, + /*0x0287*/ 226, + /*0x24dc*/ 787, + /*0x2175*/ 763, + /*0x057c*/ 466, + /*0x13d6*/ 531, + /*0x0456*/ 329, + -1, + /*0x13e0*/ 541, + /*0xa7a7*/ 1042, + -1, + /*0x1f21*/ 703, + /*0x10cd8*/ 1173, + /*0x104e0*/ 1121, + /*0x0256*/ 204, + /*0x10cec*/ 1193, + /*0x052f*/ 438, + /*0x0260*/ 209, + /*0x03ce*/ 273, + /*0xa685*/ 974, + /*0x24d6*/ 781, + -1, + /*0x1f44*/ 722, + /*0x24e0*/ 791, + /*0x217c*/ 770, + /*0x13d4*/ 529, + /*0x0454*/ 327, + -1, + -1, + /*0x1f72*/ 738, + /*0x0503*/ 416, + -1, + /*0x13ea*/ 551, + /*0x1e93d*/ 1259, + /*0x0254*/ 203, + /*0x006a*/ 8, + -1, + /*0x104ea*/ 1131, + -1, + /*0x03cc*/ 271, + /*0x24d4*/ 779, + /*0x026a*/ 216, + -1, + /*0xff46*/ 1052, + /*0x1e939*/ 1255, + /*0x13e4*/ 545, + /*0x1f15*/ 701, + /*0x10ce8*/ 1189, + /*0x0064*/ 3, + /*0x2d03*/ 912, + /*0x104e4*/ 1125, + /*0x13b6*/ 499, + /*0x0436*/ 297, + /*0x1e92f*/ 1245, + /*0x118d0*/ 1216, + /*0x10436*/ 1087, + -1, + -1, + /*0x10cf0*/ 1197, + /*0xff44*/ 1050, + /*0x24e4*/ 795, + /*0x0078*/ 22, + /*0x0529*/ 435, + /*0x104f8*/ 1145, + /*0x2c50*/ 833, + -1, + /*0x1f13*/ 699, + -1, + /*0x00f3*/ 44, + /*0x10cdc*/ 1177, + /*0x118ce*/ 1214, + /*0x13ca*/ 519, + /*0x044a*/ 317, + /*0x04ca*/ 387, + -1, + /*0x1044a*/ 1107, + -1, + /*0x1f7b*/ 747, + /*0x03c8*/ 267, + /*0x01c6*/ 138, + /*0x2c4e*/ 831, + /*0xa783*/ 1028, + -1, + -1, + /*0x01a1*/ 127, + /*0x00eb*/ 36, + /*0x052b*/ 436, + /*0x10cd6*/ 1171, + /*0x1f79*/ 745, + -1, + /*0x10ce0*/ 1181, + /*0x118cc*/ 1212, + /*0x13f4*/ 561, + /*0x13d2*/ 527, + /*0x0452*/ 325, + /*0x0074*/ 18, + -1, + /*0x104f4*/ 1141, + -1, + /*0x1e929*/ 1239, + /*0x1f7d*/ 749, + /*0x2c4c*/ 829, + /*0x0252*/ 201, + -1, + -1, + -1, + -1, + /*0x10cd4*/ 1169, + /*0x24d2*/ 777, + /*0x2c66*/ 850, + -1, + /*0x13b0*/ 493, + /*0x0430*/ 291, + /*0xa7a9*/ 1043, + /*0x10cea*/ 1191, + /*0x10430*/ 1081, + /*0x0521*/ 431, + -1, + -1, + /*0x0195*/ 123, + -1, + /*0x13e2*/ 543, + /*0x029d*/ 233, + /*0x1e92b*/ 1241, + /*0x0062*/ 1, + /*0x1f77*/ 743, + /*0x104e2*/ 1123, + /*0x10ce4*/ 1185, + /*0x1f07*/ 695, + -1, + /*0x118c8*/ 1208, + -1, + -1, + -1, + /*0x0572*/ 456, + /*0x2d21*/ 942, + /*0x24e2*/ 793, + /*0x1fb1*/ 751, + /*0x00ef*/ 40, + /*0x048d*/ 357, + /*0x2c48*/ 825, + /*0xa683*/ 973, + /*0x118d8*/ 1224, + /*0x1e0d*/ 571, + /*0x1e8d*/ 635, + /*0x010d*/ 62, + /*0x020d*/ 171, + /*0x2c8d*/ 862, + -1, + -1, + /*0x01fb*/ 162, + /*0x0515*/ 425, + /*0x2c58*/ 841, + /*0x10cca*/ 1159, + /*0x2172*/ 760, + /*0x2c6c*/ 853, + /*0x00ed*/ 38, + -1, + /*0x13b4*/ 497, + /*0x0434*/ 295, + -1, + /*0x01f9*/ 161, + /*0x10434*/ 1085, + -1, + -1, + -1, + -1, + /*0xa7a1*/ 1039, + -1, + -1, + /*0x2d15*/ 930, + /*0x0513*/ 424, + -1, + /*0x01fd*/ 163, + -1, + /*0x10cd2*/ 1167, + /*0x1e09*/ 569, + /*0x1e89*/ 633, + /*0x0109*/ 60, + /*0x0209*/ 169, + /*0x2c89*/ 860, + /*0x1e93b*/ 1257, + /*0x057b*/ 465, + /*0x0199*/ 124, + /*0xff50*/ 1062, + -1, + /*0x13ee*/ 555, + /*0x2c68*/ 851, + -1, + /*0x006e*/ 12, + /*0x2d13*/ 928, + /*0x104ee*/ 1135, + /*0x1f66*/ 734, + /*0x0579*/ 463, + -1, + -1, + /*0x2cee*/ 907, + -1, + -1, + /*0x118dc*/ 1228, + /*0xff4e*/ 1060, + -1, + /*0x217b*/ 769, + /*0x10ce2*/ 1183, + -1, + /*0x057d*/ 467, + -1, + /*0x1f7a*/ 746, + -1, + /*0x2c5c*/ 845, + -1, + /*0x03b6*/ 250, + -1, + /*0x2179*/ 767, + -1, + /*0x0519*/ 427, + /*0x2c76*/ 855, + /*0x118d6*/ 1222, + /*0x03f8*/ 289, + -1, + /*0x01d0*/ 142, + /*0xff4c*/ 1058, + /*0xa793*/ 1033, + -1, + -1, + /*0x217d*/ 771, + /*0x01ff*/ 164, + /*0x2c56*/ 839, + -1, + -1, + /*0x0577*/ 461, + /*0x03ca*/ 269, + -1, + /*0x0507*/ 418, + /*0x2d19*/ 934, + /*0x049f*/ 366, + /*0x01ce*/ 141, + /*0x118d4*/ 1220, + -1, + /*0x1e1f*/ 580, + -1, + /*0x011f*/ 71, + /*0x021f*/ 180, + /*0x2c9f*/ 871, + -1, + -1, + -1, + /*0x2c54*/ 837, + /*0x13de*/ 539, + /*0x045e*/ 337, + /*0x2177*/ 765, + -1, + /*0x2d07*/ 916, + /*0x104de*/ 1119, + /*0x2c6a*/ 852, + -1, + -1, + /*0x01cc*/ 140, + /*0x057f*/ 469, + -1, + /*0xff48*/ 1054, + -1, + /*0xa695*/ 982, + /*0x24de*/ 789, + -1, + -1, + /*0xa799*/ 1035, + -1, + /*0x10cee*/ 1195, + -1, + -1, + /*0x0517*/ 426, + /*0xff58*/ 1070, + /*0x2c36*/ 807, + -1, + -1, + -1, + -1, + /*0x217f*/ 773, + -1, + -1, + /*0x1f70*/ 736, + /*0xa693*/ 981, + /*0x118ca*/ 1210, + /*0xa787*/ 1030, + -1, + -1, + -1, + /*0x214e*/ 757, + -1, + /*0x2d17*/ 932, + -1, + -1, + /*0x2c4a*/ 827, + /*0x13be*/ 507, + /*0x043e*/ 305, + -1, + /*0x0566*/ 444, + /*0x1043e*/ 1095, + /*0x1f76*/ 742, + -1, + -1, + /*0x013e*/ 85, + -1, + -1, + /*0x118d2*/ 1218, + /*0x13ba*/ 503, + /*0x043a*/ 301, + /*0x01d8*/ 146, + -1, + /*0x1043a*/ 1091, + -1, + /*0x057a*/ 464, + /*0x1f60*/ 728, + /*0x013a*/ 83, + /*0x2c52*/ 835, + -1, + -1, + /*0x03b4*/ 248, + -1, + -1, + -1, + /*0xa797*/ 1034, + -1, + -1, + -1, + /*0xa699*/ 984, + -1, + -1, + -1, + /*0x10cde*/ 1179, + -1, + /*0x217a*/ 768, + /*0x2c30*/ 801, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x056c*/ 450, + /*0xa687*/ 975, + -1, + -1, + /*0xff56*/ 1068, + /*0x0289*/ 228, + -1, + /*0x1f64*/ 732, + -1, + -1, + -1, + /*0x051d*/ 429, + -1, + /*0x1f36*/ 716, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x1f78*/ 744, + -1, + /*0x01dc*/ 148, + -1, + /*0xff54*/ 1066, + -1, + /*0x00f1*/ 42, + -1, + -1, + -1, + /*0x2d1d*/ 938, + -1, + /*0x0568*/ 446, + -1, + -1, + -1, + /*0x00f5*/ 46, + /*0x2c34*/ 805, + -1, + /*0xa697*/ 983, + /*0x01d6*/ 145, + -1, + -1, + /*0x0570*/ 454, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x1f74*/ 740, + -1, + -1, + /*0x00fc*/ 52, + -1, + -1, + /*0x01d4*/ 144, + /*0x0576*/ 460, + /*0xa79d*/ 1037, + /*0x2170*/ 758, + -1, + -1, + -1, + -1, + -1, + -1, + /*0xff4a*/ 1056, + -1, + -1, + /*0x1f30*/ 710, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x2176*/ 764, + -1, + /*0x1f62*/ 730, + -1, + -1, + /*0x01b6*/ 134, + -1, + -1, + -1, + -1, + -1, + /*0xff52*/ 1064, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x056a*/ 448, + -1, + -1, + -1, + -1, + -1, + /*0x1fd0*/ 752, + -1, + -1, + -1, + -1, + -1, + /*0x03be*/ 258, + /*0x0564*/ 442, + -1, + -1, + -1, + -1, + /*0x118de*/ 1230, + -1, + -1, + /*0x1f34*/ 714, + -1, + -1, + /*0x03ba*/ 254, + -1, + /*0x0578*/ 462, + -1, + /*0x2c5e*/ 847, + /*0x01d2*/ 143, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x2178*/ 766, + /*0x01b0*/ 132, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x1e936*/ 1252, + -1, + -1, + -1, + /*0x0574*/ 458, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x2c3e*/ 815, + -1, + -1, + -1, + -1, + -1, + /*0x2174*/ 762, + -1, + -1, + -1, + -1, + -1, + /*0x2c3a*/ 811, + -1, + /*0x00f2*/ 43, + /*0x0562*/ 440, + -1, + -1, + -1, + -1, + /*0x01b4*/ 133, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x050d*/ 421, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x1e930*/ 1246, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x2d0d*/ 922, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x00fb*/ 51, + -1, + /*0x0509*/ 419, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x00f9*/ 49, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x056e*/ 452, + -1, + -1, + /*0x2d09*/ 918, + -1, + /*0x00fd*/ 53, + -1, + -1, + -1, + /*0x1e934*/ 1250, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x1fe0*/ 754, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x051f*/ 430, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x00ff*/ 55, + -1, + -1, + -1, + /*0xa68d*/ 978, + -1, + -1, + -1, + /*0x2d1f*/ 940, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0xa689*/ 976, + -1, + /*0x00e6*/ 31, + /*0xa79f*/ 1038, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x00fa*/ 50, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x1fb0*/ 750, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x00ec*/ 37, + -1, + /*0x1e93e*/ 1260, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x1e93a*/ 1256, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x00e8*/ 33, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x00f0*/ 41, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x00f6*/ 47, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x00e0*/ 25, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x00ea*/ 35, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x00e4*/ 29, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x00f8*/ 48, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x00f4*/ 45, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x00e2*/ 27, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x00ee*/ 39}; + + if (code <= MAX_CODE_VALUE && code >= MIN_CODE_VALUE) + { + register int key = onigenc_unicode_CaseUnfold_11_hash(code); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register short s = wordlist[key]; + + if (s >= 0 && code1_equal(code, CaseUnfold_11_Table[s].from)) + return &CaseUnfold_11_Table[s].to; + } + } + return 0; +} + +static const CaseUnfold_12_Type CaseUnfold_12_Table[] = { +#define CaseUnfold_12 (*(CaseUnfold_12_Type(*)[58])(CaseUnfold_12_Table + 0)) + {{0x0061, 0x02be}, {1, {0x1e9a}}}, + {{0x0066, 0x0066}, {1, {0xfb00}}}, + {{0x0066, 0x0069}, {1, {0xfb01}}}, + {{0x0066, 0x006c}, {1, {0xfb02}}}, + {{0x0068, 0x0331}, {1, {0x1e96}}}, + {{0x006a, 0x030c}, {1, {0x01f0}}}, + {{0x0073, 0x0073}, {2, {0x00df, 0x1e9e}}}, + {{0x0073, 0x0074}, {2, {0xfb05, 0xfb06}}}, + {{0x0074, 0x0308}, {1, {0x1e97}}}, + {{0x0077, 0x030a}, {1, {0x1e98}}}, + {{0x0079, 0x030a}, {1, {0x1e99}}}, + {{0x02bc, 0x006e}, {1, {0x0149}}}, + {{0x03ac, 0x03b9}, {1, {0x1fb4}}}, + {{0x03ae, 0x03b9}, {1, {0x1fc4}}}, + {{0x03b1, 0x0342}, {1, {0x1fb6}}}, + {{0x03b1, 0x03b9}, {2, {0x1fb3, 0x1fbc}}}, + {{0x03b7, 0x0342}, {1, {0x1fc6}}}, + {{0x03b7, 0x03b9}, {2, {0x1fc3, 0x1fcc}}}, + {{0x03b9, 0x0342}, {1, {0x1fd6}}}, + {{0x03c1, 0x0313}, {1, {0x1fe4}}}, + {{0x03c5, 0x0313}, {1, {0x1f50}}}, + {{0x03c5, 0x0342}, {1, {0x1fe6}}}, + {{0x03c9, 0x0342}, {1, {0x1ff6}}}, + {{0x03c9, 0x03b9}, {2, {0x1ff3, 0x1ffc}}}, + {{0x03ce, 0x03b9}, {1, {0x1ff4}}}, + {{0x0565, 0x0582}, {1, {0x0587}}}, + {{0x0574, 0x0565}, {1, {0xfb14}}}, + {{0x0574, 0x056b}, {1, {0xfb15}}}, + {{0x0574, 0x056d}, {1, {0xfb17}}}, + {{0x0574, 0x0576}, {1, {0xfb13}}}, + {{0x057e, 0x0576}, {1, {0xfb16}}}, + {{0x1f00, 0x03b9}, {2, {0x1f80, 0x1f88}}}, + {{0x1f01, 0x03b9}, {2, {0x1f81, 0x1f89}}}, + {{0x1f02, 0x03b9}, {2, {0x1f82, 0x1f8a}}}, + {{0x1f03, 0x03b9}, {2, {0x1f83, 0x1f8b}}}, + {{0x1f04, 0x03b9}, {2, {0x1f84, 0x1f8c}}}, + {{0x1f05, 0x03b9}, {2, {0x1f85, 0x1f8d}}}, + {{0x1f06, 0x03b9}, {2, {0x1f86, 0x1f8e}}}, + {{0x1f07, 0x03b9}, {2, {0x1f87, 0x1f8f}}}, + {{0x1f20, 0x03b9}, {2, {0x1f90, 0x1f98}}}, + {{0x1f21, 0x03b9}, {2, {0x1f91, 0x1f99}}}, + {{0x1f22, 0x03b9}, {2, {0x1f92, 0x1f9a}}}, + {{0x1f23, 0x03b9}, {2, {0x1f93, 0x1f9b}}}, + {{0x1f24, 0x03b9}, {2, {0x1f94, 0x1f9c}}}, + {{0x1f25, 0x03b9}, {2, {0x1f95, 0x1f9d}}}, + {{0x1f26, 0x03b9}, {2, {0x1f96, 0x1f9e}}}, + {{0x1f27, 0x03b9}, {2, {0x1f97, 0x1f9f}}}, + {{0x1f60, 0x03b9}, {2, {0x1fa0, 0x1fa8}}}, + {{0x1f61, 0x03b9}, {2, {0x1fa1, 0x1fa9}}}, + {{0x1f62, 0x03b9}, {2, {0x1fa2, 0x1faa}}}, + {{0x1f63, 0x03b9}, {2, {0x1fa3, 0x1fab}}}, + {{0x1f64, 0x03b9}, {2, {0x1fa4, 0x1fac}}}, + {{0x1f65, 0x03b9}, {2, {0x1fa5, 0x1fad}}}, + {{0x1f66, 0x03b9}, {2, {0x1fa6, 0x1fae}}}, + {{0x1f67, 0x03b9}, {2, {0x1fa7, 0x1faf}}}, + {{0x1f70, 0x03b9}, {1, {0x1fb2}}}, + {{0x1f74, 0x03b9}, {1, {0x1fc2}}}, + {{0x1f7c, 0x03b9}, {1, {0x1ff2}}}, +#define CaseUnfold_12_Locale \ + (*(CaseUnfold_12_Type(*)[1])(CaseUnfold_12_Table + 58)) + {{0x0069, 0x0307}, {1, {0x0130}}}, +}; + +/* C code produced by gperf version 3.0.4 */ +/* Command-line: gperf -7 -k1,2,3,4,5,6 -F,-1 -c -j1 -i1 -t -T -E -C -H + * onigenc_unicode_CaseUnfold_12_hash -N onigenc_unicode_CaseUnfold_12_lookup -n + */ + +/* maximum key range = 71, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +# ifdef __cplusplus +inline +# endif +#endif + /*ARGSUSED*/ + static unsigned int + onigenc_unicode_CaseUnfold_12_hash(const OnigCodePoint *codes) +{ + static const unsigned char asso_values[] + = {3, 58, 54, 57, 56, 16, 8, 2, 43, 82, 3, 1, 23, 82, 82, 82, + 82, 82, 82, 4, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 52, 51, 50, 49, 48, 47, 46, 45, 82, 82, 82, 82, 43, 82, 42, 82, + 82, 13, 82, 82, 82, 82, 82, 11, 82, 1, 82, 82, 14, 82, 1, 82, + 82, 31, 3, 82, 82, 30, 82, 82, 82, 10, 82, 82, 82, 82, 37, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 37, 15, 36, 35, 34, 17, 1, 33, 12, 4, 23, 23, 26, 21, 13, 82, + 27, 82, 82, 2, 5, 82, 11, 16, 82, 15, 82, 82, 23, 82, 8, 82}; + return asso_values[bits_at(codes, 5)] + asso_values[bits_at(codes, 4)] + + asso_values[bits_at(codes, 3)] + asso_values[bits_at(codes, 2)] + + asso_values[bits_at(codes, 1)] + asso_values[bits_at(codes, 0)]; +} + +#ifdef __GNUC__ +__inline +# if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ + __attribute__((__gnu_inline__)) +# endif +#endif + static const CodePointList2 * + onigenc_unicode_CaseUnfold_12_lookup(const OnigCodePoint *codes) +{ + enum + { + MIN_CODE_VALUE = 0x61, + MAX_CODE_VALUE = 0x1f7c, + TOTAL_KEYWORDS = 59, + MIN_WORD_LENGTH = 6, + MAX_WORD_LENGTH = 6, + MIN_HASH_VALUE = 11, + MAX_HASH_VALUE = 81 + }; + + static const short wordlist[] = {-1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x1f66,0x03b9*/ 53, + /*0x1f07,0x03b9*/ 38, + /*0x1f00,0x03b9*/ 31, + /*0x0066,0x0066*/ 1, + /*0x1f74,0x03b9*/ 56, + /*0x0073,0x0073*/ 6, + /*0x0066,0x0069*/ 2, + /*0x1f06,0x03b9*/ 37, + /*0x0073,0x0074*/ 7, + /*0x03b9,0x0342*/ 18, + /*0x03c9,0x03b9*/ 23, + /*0x03b7,0x03b9*/ 17, + /*0x0069,0x0307*/ 58, + /*0x03b1,0x03b9*/ 15, + /*0x1f61,0x03b9*/ 48, + /*0x1f05,0x03b9*/ 36, + /*0x1f65,0x03b9*/ 52, + /*0x0574,0x0576*/ 29, + /*0x03c9,0x0342*/ 22, + /*0x03b7,0x0342*/ 16, + /*0x057e,0x0576*/ 30, + /*0x03b1,0x0342*/ 14, + /*0x1f7c,0x03b9*/ 57, + /*0x0574,0x0565*/ 26, + /*0x0079,0x030a*/ 10, + /*0x0077,0x030a*/ 9, + /*0x1f70,0x03b9*/ 55, + /*0x0574,0x056d*/ 28, + /*0x0066,0x006c*/ 3, + /*0x0574,0x056b*/ 27, + /*0x0061,0x02be*/ 0, + /*0x0068,0x0331*/ 4, + /*0x1f67,0x03b9*/ 54, + /*0x1f64,0x03b9*/ 51, + /*0x1f63,0x03b9*/ 50, + /*0x1f62,0x03b9*/ 49, + /*0x1f60,0x03b9*/ 47, + /*0x03ce,0x03b9*/ 24, + /*0x03c5,0x0342*/ 21, + /*0x03c5,0x0313*/ 20, + /*0x03c1,0x0313*/ 19, + /*0x02bc,0x006e*/ 11, + /*0x03ae,0x03b9*/ 13, + /*0x03ac,0x03b9*/ 12, + /*0x1f27,0x03b9*/ 46, + /*0x1f26,0x03b9*/ 45, + /*0x1f25,0x03b9*/ 44, + /*0x1f24,0x03b9*/ 43, + /*0x1f23,0x03b9*/ 42, + /*0x1f22,0x03b9*/ 41, + /*0x1f21,0x03b9*/ 40, + /*0x1f20,0x03b9*/ 39, + /*0x006a,0x030c*/ 5, + /*0x1f02,0x03b9*/ 33, + /*0x0074,0x0308*/ 8, + /*0x1f04,0x03b9*/ 35, + /*0x1f03,0x03b9*/ 34, + /*0x1f01,0x03b9*/ 32, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x0565,0x0582*/ 25}; + + if (codes[0] <= MAX_CODE_VALUE && codes[0] >= MIN_CODE_VALUE + && codes[1] <= MAX_CODE_VALUE && codes[1] >= MIN_CODE_VALUE) + { + register int key = onigenc_unicode_CaseUnfold_12_hash(codes); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register short s = wordlist[key]; + + if (s >= 0 && code2_equal(codes, CaseUnfold_12_Table[s].from)) + return &CaseUnfold_12_Table[s].to; + } + } + return 0; +} + +static const CaseUnfold_13_Type CaseUnfold_13_Table[] = { +#define CaseUnfold_13 (*(CaseUnfold_13_Type(*)[14])(CaseUnfold_13_Table + 0)) + {{0x0066, 0x0066, 0x0069}, {1, {0xfb03}}}, + {{0x0066, 0x0066, 0x006c}, {1, {0xfb04}}}, + {{0x03b1, 0x0342, 0x03b9}, {1, {0x1fb7}}}, + {{0x03b7, 0x0342, 0x03b9}, {1, {0x1fc7}}}, + {{0x03b9, 0x0308, 0x0300}, {1, {0x1fd2}}}, + {{0x03b9, 0x0308, 0x0301}, {2, {0x0390, 0x1fd3}}}, + {{0x03b9, 0x0308, 0x0342}, {1, {0x1fd7}}}, + {{0x03c5, 0x0308, 0x0300}, {1, {0x1fe2}}}, + {{0x03c5, 0x0308, 0x0301}, {2, {0x03b0, 0x1fe3}}}, + {{0x03c5, 0x0308, 0x0342}, {1, {0x1fe7}}}, + {{0x03c5, 0x0313, 0x0300}, {1, {0x1f52}}}, + {{0x03c5, 0x0313, 0x0301}, {1, {0x1f54}}}, + {{0x03c5, 0x0313, 0x0342}, {1, {0x1f56}}}, + {{0x03c9, 0x0342, 0x03b9}, {1, {0x1ff7}}}, +}; + +/* C code produced by gperf version 3.0.4 */ +/* Command-line: gperf -7 -k1,2,3,4,5,6,7,8,9 -F,-1 -c -j1 -i1 -t -T -E -C -H + * onigenc_unicode_CaseUnfold_13_hash -N onigenc_unicode_CaseUnfold_13_lookup -n + */ + +/* maximum key range = 20, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +# ifdef __cplusplus +inline +# endif +#endif + /*ARGSUSED*/ + static unsigned int + onigenc_unicode_CaseUnfold_13_hash(const OnigCodePoint *codes) +{ + static const unsigned char asso_values[] + = {7, 4, 47, 47, 47, 47, 1, 1, 2, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 1, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, + 47, 11, 47, 47, 47, 47, 47, 10, 47, 2, 47, 47, 47, 47, 47, 47, + 47, 47, 1, 47, 47, 1, 47, 47, 47, 9, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 1, 47, 47, 2, 47, 47, 1, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47}; + return asso_values[bits_at(codes, 8)] + asso_values[bits_at(codes, 7)] + + asso_values[bits_at(codes, 6)] + asso_values[bits_at(codes, 5)] + + asso_values[bits_at(codes, 4)] + asso_values[bits_at(codes, 3)] + + asso_values[bits_at(codes, 2)] + asso_values[bits_at(codes, 1)] + + asso_values[bits_at(codes, 0)]; +} + +#ifdef __GNUC__ +__inline +# if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ + __attribute__((__gnu_inline__)) +# endif +#endif + static const CodePointList2 * + onigenc_unicode_CaseUnfold_13_lookup(const OnigCodePoint *codes) +{ + enum + { + MIN_CODE_VALUE = 0x66, + MAX_CODE_VALUE = 0x3c9, + TOTAL_KEYWORDS = 14, + MIN_WORD_LENGTH = 9, + MAX_WORD_LENGTH = 9, + MIN_HASH_VALUE = 27, + MAX_HASH_VALUE = 46 + }; + + static const short wordlist[] = {-1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x03c5,0x0313,0x0342*/ 12, + /*0x03c5,0x0308,0x0342*/ 9, + /*0x03b9,0x0308,0x0342*/ 6, + /*0x03c5,0x0313,0x0301*/ 11, + /*0x03c5,0x0308,0x0301*/ 8, + /*0x03b9,0x0308,0x0301*/ 5, + /*0x03c5,0x0313,0x0300*/ 10, + /*0x03c5,0x0308,0x0300*/ 7, + /*0x03b9,0x0308,0x0300*/ 4, + /*0x03c9,0x0342,0x03b9*/ 13, + /*0x03b7,0x0342,0x03b9*/ 3, + /*0x03b1,0x0342,0x03b9*/ 2, + -1, + -1, + -1, + -1, + -1, + -1, + /*0x0066,0x0066,0x006c*/ 1, + /*0x0066,0x0066,0x0069*/ 0}; + + if (codes[0] <= MAX_CODE_VALUE && codes[0] >= MIN_CODE_VALUE + && codes[1] <= MAX_CODE_VALUE && codes[1] >= MIN_CODE_VALUE + && codes[2] <= MAX_CODE_VALUE && codes[2] >= MIN_CODE_VALUE) + { + register int key = onigenc_unicode_CaseUnfold_13_hash(codes); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register short s = wordlist[key]; + + if (s >= 0 && code3_equal(codes, CaseUnfold_13_Table[s].from)) + return &CaseUnfold_13_Table[s].to; + } + } + return 0; +} + +static const OnigCodePoint CaseMappingSpecials[] = { + L(1) | 0x039C, L(2) | 0x0053, 0x0073, L(2) | 0x0053, 0x0053, + L(2) | 0x02BC, 0x004E, L(1) | 0x0053, L(1) | 0x01C5, L(2) | 0x0064, + 0x017D, L(1) | 0x01C4, L(1) | 0x01C8, L(2) | 0x006C, 0x004A, + L(1) | 0x01C7, L(1) | 0x01CB, L(2) | 0x006E, 0x004A, L(1) | 0x01CA, + L(2) | 0x004A, 0x030C, L(1) | 0x01F2, L(2) | 0x0064, 0x005A, + L(1) | 0x01F1, L(1) | 0x0399, L(3) | 0x0399, 0x0308, 0x0301, + L(3) | 0x03A5, 0x0308, 0x0301, L(1) | 0x03A3, L(1) | 0x0392, + L(1) | 0x0398, L(1) | 0x03A6, L(1) | 0x03A0, L(1) | 0x039A, L(1) | 0x03A1, + L(1) | 0x0395, L(2) | 0x0535, 0x0582, L(2) | 0x0535, 0x0552, + L(1) | 0x0412, L(1) | 0x0414, L(1) | 0x041E, L(1) | 0x0421, L(1) | 0x0422, + L(1) | 0x0422, L(1) | 0x042A, L(1) | 0x0462, L(1) | 0xA64A, L(2) | 0x0048, + 0x0331, L(2) | 0x0054, 0x0308, L(2) | 0x0057, 0x030A, + L(2) | 0x0059, 0x030A, L(2) | 0x0041, 0x02BE, L(1) | 0x1E60, + L(1) | 0x00DF, L(2) | 0x03A5, 0x0313, L(3) | 0x03A5, 0x0313, + 0x0300, L(3) | 0x03A5, 0x0313, 0x0301, L(3) | 0x03A5, + 0x0313, 0x0342, L(1) | 0x1F88, L(2) | 0x1F08, 0x0399, + L(1) | 0x1F89, L(2) | 0x1F09, 0x0399, L(1) | 0x1F8A, L(2) | 0x1F0A, + 0x0399, L(1) | 0x1F8B, L(2) | 0x1F0B, 0x0399, L(1) | 0x1F8C, + L(2) | 0x1F0C, 0x0399, L(1) | 0x1F8D, L(2) | 0x1F0D, 0x0399, + L(1) | 0x1F8E, L(2) | 0x1F0E, 0x0399, L(1) | 0x1F8F, L(2) | 0x1F0F, + 0x0399, L(2) | 0x1F00, 0x0399, L(1) | 0x1F80, L(2) | 0x1F08, + 0x0399, L(2) | 0x1F01, 0x0399, L(1) | 0x1F81, L(2) | 0x1F09, + 0x0399, L(2) | 0x1F02, 0x0399, L(1) | 0x1F82, L(2) | 0x1F0A, + 0x0399, L(2) | 0x1F03, 0x0399, L(1) | 0x1F83, L(2) | 0x1F0B, + 0x0399, L(2) | 0x1F04, 0x0399, L(1) | 0x1F84, L(2) | 0x1F0C, + 0x0399, L(2) | 0x1F05, 0x0399, L(1) | 0x1F85, L(2) | 0x1F0D, + 0x0399, L(2) | 0x1F06, 0x0399, L(1) | 0x1F86, L(2) | 0x1F0E, + 0x0399, L(2) | 0x1F07, 0x0399, L(1) | 0x1F87, L(2) | 0x1F0F, + 0x0399, L(1) | 0x1F98, L(2) | 0x1F28, 0x0399, L(1) | 0x1F99, + L(2) | 0x1F29, 0x0399, L(1) | 0x1F9A, L(2) | 0x1F2A, 0x0399, + L(1) | 0x1F9B, L(2) | 0x1F2B, 0x0399, L(1) | 0x1F9C, L(2) | 0x1F2C, + 0x0399, L(1) | 0x1F9D, L(2) | 0x1F2D, 0x0399, L(1) | 0x1F9E, + L(2) | 0x1F2E, 0x0399, L(1) | 0x1F9F, L(2) | 0x1F2F, 0x0399, + L(2) | 0x1F20, 0x0399, L(1) | 0x1F90, L(2) | 0x1F28, 0x0399, + L(2) | 0x1F21, 0x0399, L(1) | 0x1F91, L(2) | 0x1F29, 0x0399, + L(2) | 0x1F22, 0x0399, L(1) | 0x1F92, L(2) | 0x1F2A, 0x0399, + L(2) | 0x1F23, 0x0399, L(1) | 0x1F93, L(2) | 0x1F2B, 0x0399, + L(2) | 0x1F24, 0x0399, L(1) | 0x1F94, L(2) | 0x1F2C, 0x0399, + L(2) | 0x1F25, 0x0399, L(1) | 0x1F95, L(2) | 0x1F2D, 0x0399, + L(2) | 0x1F26, 0x0399, L(1) | 0x1F96, L(2) | 0x1F2E, 0x0399, + L(2) | 0x1F27, 0x0399, L(1) | 0x1F97, L(2) | 0x1F2F, 0x0399, + L(1) | 0x1FA8, L(2) | 0x1F68, 0x0399, L(1) | 0x1FA9, L(2) | 0x1F69, + 0x0399, L(1) | 0x1FAA, L(2) | 0x1F6A, 0x0399, L(1) | 0x1FAB, + L(2) | 0x1F6B, 0x0399, L(1) | 0x1FAC, L(2) | 0x1F6C, 0x0399, + L(1) | 0x1FAD, L(2) | 0x1F6D, 0x0399, L(1) | 0x1FAE, L(2) | 0x1F6E, + 0x0399, L(1) | 0x1FAF, L(2) | 0x1F6F, 0x0399, L(2) | 0x1F60, + 0x0399, L(1) | 0x1FA0, L(2) | 0x1F68, 0x0399, L(2) | 0x1F61, + 0x0399, L(1) | 0x1FA1, L(2) | 0x1F69, 0x0399, L(2) | 0x1F62, + 0x0399, L(1) | 0x1FA2, L(2) | 0x1F6A, 0x0399, L(2) | 0x1F63, + 0x0399, L(1) | 0x1FA3, L(2) | 0x1F6B, 0x0399, L(2) | 0x1F64, + 0x0399, L(1) | 0x1FA4, L(2) | 0x1F6C, 0x0399, L(2) | 0x1F65, + 0x0399, L(1) | 0x1FA5, L(2) | 0x1F6D, 0x0399, L(2) | 0x1F66, + 0x0399, L(1) | 0x1FA6, L(2) | 0x1F6E, 0x0399, L(2) | 0x1F67, + 0x0399, L(1) | 0x1FA7, L(2) | 0x1F6F, 0x0399, L(2) | 0x1FBA, + 0x0345, L(2) | 0x1FBA, 0x0399, L(1) | 0x1FBC, L(2) | 0x0391, + 0x0399, L(2) | 0x0386, 0x0345, L(2) | 0x0386, 0x0399, + L(2) | 0x0391, 0x0342, L(3) | 0x0391, 0x0342, 0x0345, + L(3) | 0x0391, 0x0342, 0x0399, L(2) | 0x03B1, 0x0399, + L(1) | 0x1FB3, L(2) | 0x0391, 0x0399, L(1) | 0x0399, L(2) | 0x1FCA, + 0x0345, L(2) | 0x1FCA, 0x0399, L(1) | 0x1FCC, L(2) | 0x0397, + 0x0399, L(2) | 0x0389, 0x0345, L(2) | 0x0389, 0x0399, + L(2) | 0x0397, 0x0342, L(3) | 0x0397, 0x0342, 0x0345, + L(3) | 0x0397, 0x0342, 0x0399, L(2) | 0x03B7, 0x0399, + L(1) | 0x1FC3, L(2) | 0x0397, 0x0399, L(3) | 0x0399, 0x0308, + 0x0300, L(3) | 0x0399, 0x0308, 0x0301, L(2) | 0x0399, + 0x0342, L(3) | 0x0399, 0x0308, 0x0342, L(3) | 0x03A5, + 0x0308, 0x0300, L(3) | 0x03A5, 0x0308, 0x0301, + L(2) | 0x03A1, 0x0313, L(2) | 0x03A5, 0x0342, L(3) | 0x03A5, + 0x0308, 0x0342, L(2) | 0x1FFA, 0x0345, L(2) | 0x1FFA, + 0x0399, L(1) | 0x1FFC, L(2) | 0x03A9, 0x0399, L(2) | 0x038F, + 0x0345, L(2) | 0x038F, 0x0399, L(2) | 0x03A9, 0x0342, + L(3) | 0x03A9, 0x0342, 0x0345, L(3) | 0x03A9, 0x0342, + 0x0399, L(2) | 0x03C9, 0x0399, L(1) | 0x1FF3, L(2) | 0x03A9, + 0x0399, L(2) | 0x0046, 0x0066, L(2) | 0x0046, 0x0046, + L(2) | 0x0046, 0x0069, L(2) | 0x0046, 0x0049, L(2) | 0x0046, + 0x006C, L(2) | 0x0046, 0x004C, L(3) | 0x0046, 0x0066, + 0x0069, L(3) | 0x0046, 0x0046, 0x0049, L(3) | 0x0046, + 0x0066, 0x006C, L(3) | 0x0046, 0x0046, 0x004C, + L(2) | 0x0053, 0x0074, L(2) | 0x0053, 0x0054, L(2) | 0x0053, + 0x0074, L(2) | 0x0053, 0x0054, L(2) | 0x0544, 0x0576, + L(2) | 0x0544, 0x0546, L(2) | 0x0544, 0x0565, L(2) | 0x0544, + 0x0535, L(2) | 0x0544, 0x056B, L(2) | 0x0544, 0x053B, + L(2) | 0x054E, 0x0576, L(2) | 0x054E, 0x0546, L(2) | 0x0544, + 0x056D, L(2) | 0x0544, 0x053D, +}; diff --git a/lib/edbee-lib/vendor/onig/enc/unicode/name2ctype.h b/lib/edbee-lib/vendor/onig/enc/unicode/name2ctype.h new file mode 100644 index 00000000..a4a57caf --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/unicode/name2ctype.h @@ -0,0 +1,18367 @@ +/* C code produced by gperf version 3.0.4 */ +/* Command-line: gperf -7 -c -j1 -i1 -t -C -P -T -H uniname2ctype_hash -Q + * uniname2ctype_pool -N uniname2ctype_p */ +#ifndef USE_UNICODE_PROPERTIES +/* Computed positions: -k'1,3' */ +#else /* USE_UNICODE_PROPERTIES */ +/* Computed positions: -k'1-3,5-6,12,16,$' */ +#endif /* USE_UNICODE_PROPERTIES */ + +#if !( \ + (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) && ('%' == 37) \ + && ('&' == 38) && ('\'' == 39) && ('(' == 40) && (')' == 41) \ + && ('*' == 42) && ('+' == 43) && (',' == 44) && ('-' == 45) && ('.' == 46) \ + && ('/' == 47) && ('0' == 48) && ('1' == 49) && ('2' == 50) && ('3' == 51) \ + && ('4' == 52) && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) && ('=' == 61) \ + && ('>' == 62) && ('?' == 63) && ('A' == 65) && ('B' == 66) && ('C' == 67) \ + && ('D' == 68) && ('E' == 69) && ('F' == 70) && ('G' == 71) && ('H' == 72) \ + && ('I' == 73) && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) && ('R' == 82) \ + && ('S' == 83) && ('T' == 84) && ('U' == 85) && ('V' == 86) && ('W' == 87) \ + && ('X' == 88) && ('Y' == 89) && ('Z' == 90) && ('[' == 91) \ + && ('\\' == 92) && (']' == 93) && ('^' == 94) && ('_' == 95) \ + && ('a' == 97) && ('b' == 98) && ('c' == 99) && ('d' == 100) \ + && ('e' == 101) && ('f' == 102) && ('g' == 103) && ('h' == 104) \ + && ('i' == 105) && ('j' == 106) && ('k' == 107) && ('l' == 108) \ + && ('m' == 109) && ('n' == 110) && ('o' == 111) && ('p' == 112) \ + && ('q' == 113) && ('r' == 114) && ('s' == 115) && ('t' == 116) \ + && ('u' == 117) && ('v' == 118) && ('w' == 119) && ('x' == 120) \ + && ('y' == 121) && ('z' == 122) && ('{' == 123) && ('|' == 124) \ + && ('}' == 125) && ('~' == 126)) +/* The character set is not based on ISO-646. */ +error "gperf generated tables don't work with this execution character set. " + "Please report a bug to <bug-gnu-gperf@gnu.org>." +#endif + + /* 'NEWLINE': [[:NEWLINE:]] */ + static const OnigCodePoint CR_NEWLINE[] + = { + 1, + 0x000a, + 0x000a, +}; /* CR_NEWLINE */ + +/* 'Alpha': [[:Alpha:]] */ +static const OnigCodePoint CR_Alpha[] = { + 644, 0x0041, 0x005a, 0x0061, 0x007a, 0x00aa, 0x00aa, 0x00b5, + 0x00b5, 0x00ba, 0x00ba, 0x00c0, 0x00d6, 0x00d8, 0x00f6, 0x00f8, + 0x02c1, 0x02c6, 0x02d1, 0x02e0, 0x02e4, 0x02ec, 0x02ec, 0x02ee, + 0x02ee, 0x0345, 0x0345, 0x0370, 0x0374, 0x0376, 0x0377, 0x037a, + 0x037d, 0x037f, 0x037f, 0x0386, 0x0386, 0x0388, 0x038a, 0x038c, + 0x038c, 0x038e, 0x03a1, 0x03a3, 0x03f5, 0x03f7, 0x0481, 0x048a, + 0x052f, 0x0531, 0x0556, 0x0559, 0x0559, 0x0561, 0x0587, 0x05b0, + 0x05bd, 0x05bf, 0x05bf, 0x05c1, 0x05c2, 0x05c4, 0x05c5, 0x05c7, + 0x05c7, 0x05d0, 0x05ea, 0x05f0, 0x05f2, 0x0610, 0x061a, 0x0620, + 0x0657, 0x0659, 0x065f, 0x066e, 0x06d3, 0x06d5, 0x06dc, 0x06e1, + 0x06e8, 0x06ed, 0x06ef, 0x06fa, 0x06fc, 0x06ff, 0x06ff, 0x0710, + 0x073f, 0x074d, 0x07b1, 0x07ca, 0x07ea, 0x07f4, 0x07f5, 0x07fa, + 0x07fa, 0x0800, 0x0817, 0x081a, 0x082c, 0x0840, 0x0858, 0x08a0, + 0x08b4, 0x08b6, 0x08bd, 0x08d4, 0x08df, 0x08e3, 0x08e9, 0x08f0, + 0x093b, 0x093d, 0x094c, 0x094e, 0x0950, 0x0955, 0x0963, 0x0971, + 0x0983, 0x0985, 0x098c, 0x098f, 0x0990, 0x0993, 0x09a8, 0x09aa, + 0x09b0, 0x09b2, 0x09b2, 0x09b6, 0x09b9, 0x09bd, 0x09c4, 0x09c7, + 0x09c8, 0x09cb, 0x09cc, 0x09ce, 0x09ce, 0x09d7, 0x09d7, 0x09dc, + 0x09dd, 0x09df, 0x09e3, 0x09f0, 0x09f1, 0x0a01, 0x0a03, 0x0a05, + 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, 0x0a30, 0x0a32, + 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3e, 0x0a42, 0x0a47, + 0x0a48, 0x0a4b, 0x0a4c, 0x0a51, 0x0a51, 0x0a59, 0x0a5c, 0x0a5e, + 0x0a5e, 0x0a70, 0x0a75, 0x0a81, 0x0a83, 0x0a85, 0x0a8d, 0x0a8f, + 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, + 0x0ab9, 0x0abd, 0x0ac5, 0x0ac7, 0x0ac9, 0x0acb, 0x0acc, 0x0ad0, + 0x0ad0, 0x0ae0, 0x0ae3, 0x0af9, 0x0af9, 0x0b01, 0x0b03, 0x0b05, + 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, 0x0b28, 0x0b2a, 0x0b30, 0x0b32, + 0x0b33, 0x0b35, 0x0b39, 0x0b3d, 0x0b44, 0x0b47, 0x0b48, 0x0b4b, + 0x0b4c, 0x0b56, 0x0b57, 0x0b5c, 0x0b5d, 0x0b5f, 0x0b63, 0x0b71, + 0x0b71, 0x0b82, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, + 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, + 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, + 0x0bc8, 0x0bca, 0x0bcc, 0x0bd0, 0x0bd0, 0x0bd7, 0x0bd7, 0x0c00, + 0x0c03, 0x0c05, 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, 0x0c28, 0x0c2a, + 0x0c39, 0x0c3d, 0x0c44, 0x0c46, 0x0c48, 0x0c4a, 0x0c4c, 0x0c55, + 0x0c56, 0x0c58, 0x0c5a, 0x0c60, 0x0c63, 0x0c80, 0x0c83, 0x0c85, + 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, + 0x0cb9, 0x0cbd, 0x0cc4, 0x0cc6, 0x0cc8, 0x0cca, 0x0ccc, 0x0cd5, + 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, 0x0ce3, 0x0cf1, 0x0cf2, 0x0d01, + 0x0d03, 0x0d05, 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d3a, 0x0d3d, + 0x0d44, 0x0d46, 0x0d48, 0x0d4a, 0x0d4c, 0x0d4e, 0x0d4e, 0x0d54, + 0x0d57, 0x0d5f, 0x0d63, 0x0d7a, 0x0d7f, 0x0d82, 0x0d83, 0x0d85, + 0x0d96, 0x0d9a, 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, + 0x0dc6, 0x0dcf, 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, 0x0ddf, 0x0df2, + 0x0df3, 0x0e01, 0x0e3a, 0x0e40, 0x0e46, 0x0e4d, 0x0e4d, 0x0e81, + 0x0e82, 0x0e84, 0x0e84, 0x0e87, 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, + 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, + 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, + 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, 0x0ec6, 0x0ecd, 0x0ecd, 0x0edc, + 0x0edf, 0x0f00, 0x0f00, 0x0f40, 0x0f47, 0x0f49, 0x0f6c, 0x0f71, + 0x0f81, 0x0f88, 0x0f97, 0x0f99, 0x0fbc, 0x1000, 0x1036, 0x1038, + 0x1038, 0x103b, 0x103f, 0x1050, 0x1062, 0x1065, 0x1068, 0x106e, + 0x1086, 0x108e, 0x108e, 0x109c, 0x109d, 0x10a0, 0x10c5, 0x10c7, + 0x10c7, 0x10cd, 0x10cd, 0x10d0, 0x10fa, 0x10fc, 0x1248, 0x124a, + 0x124d, 0x1250, 0x1256, 0x1258, 0x1258, 0x125a, 0x125d, 0x1260, + 0x1288, 0x128a, 0x128d, 0x1290, 0x12b0, 0x12b2, 0x12b5, 0x12b8, + 0x12be, 0x12c0, 0x12c0, 0x12c2, 0x12c5, 0x12c8, 0x12d6, 0x12d8, + 0x1310, 0x1312, 0x1315, 0x1318, 0x135a, 0x135f, 0x135f, 0x1380, + 0x138f, 0x13a0, 0x13f5, 0x13f8, 0x13fd, 0x1401, 0x166c, 0x166f, + 0x167f, 0x1681, 0x169a, 0x16a0, 0x16ea, 0x16ee, 0x16f8, 0x1700, + 0x170c, 0x170e, 0x1713, 0x1720, 0x1733, 0x1740, 0x1753, 0x1760, + 0x176c, 0x176e, 0x1770, 0x1772, 0x1773, 0x1780, 0x17b3, 0x17b6, + 0x17c8, 0x17d7, 0x17d7, 0x17dc, 0x17dc, 0x1820, 0x1877, 0x1880, + 0x18aa, 0x18b0, 0x18f5, 0x1900, 0x191e, 0x1920, 0x192b, 0x1930, + 0x1938, 0x1950, 0x196d, 0x1970, 0x1974, 0x1980, 0x19ab, 0x19b0, + 0x19c9, 0x1a00, 0x1a1b, 0x1a20, 0x1a5e, 0x1a61, 0x1a74, 0x1aa7, + 0x1aa7, 0x1b00, 0x1b33, 0x1b35, 0x1b43, 0x1b45, 0x1b4b, 0x1b80, + 0x1ba9, 0x1bac, 0x1baf, 0x1bba, 0x1be5, 0x1be7, 0x1bf1, 0x1c00, + 0x1c35, 0x1c4d, 0x1c4f, 0x1c5a, 0x1c7d, 0x1c80, 0x1c88, 0x1ce9, + 0x1cec, 0x1cee, 0x1cf3, 0x1cf5, 0x1cf6, 0x1d00, 0x1dbf, 0x1de7, + 0x1df4, 0x1e00, 0x1f15, 0x1f18, 0x1f1d, 0x1f20, 0x1f45, 0x1f48, + 0x1f4d, 0x1f50, 0x1f57, 0x1f59, 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, + 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, 0x1fbc, 0x1fbe, + 0x1fbe, 0x1fc2, 0x1fc4, 0x1fc6, 0x1fcc, 0x1fd0, 0x1fd3, 0x1fd6, + 0x1fdb, 0x1fe0, 0x1fec, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ffc, 0x2071, + 0x2071, 0x207f, 0x207f, 0x2090, 0x209c, 0x2102, 0x2102, 0x2107, + 0x2107, 0x210a, 0x2113, 0x2115, 0x2115, 0x2119, 0x211d, 0x2124, + 0x2124, 0x2126, 0x2126, 0x2128, 0x2128, 0x212a, 0x212d, 0x212f, + 0x2139, 0x213c, 0x213f, 0x2145, 0x2149, 0x214e, 0x214e, 0x2160, + 0x2188, 0x24b6, 0x24e9, 0x2c00, 0x2c2e, 0x2c30, 0x2c5e, 0x2c60, + 0x2ce4, 0x2ceb, 0x2cee, 0x2cf2, 0x2cf3, 0x2d00, 0x2d25, 0x2d27, + 0x2d27, 0x2d2d, 0x2d2d, 0x2d30, 0x2d67, 0x2d6f, 0x2d6f, 0x2d80, + 0x2d96, 0x2da0, 0x2da6, 0x2da8, 0x2dae, 0x2db0, 0x2db6, 0x2db8, + 0x2dbe, 0x2dc0, 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, 0x2dd6, 0x2dd8, + 0x2dde, 0x2de0, 0x2dff, 0x2e2f, 0x2e2f, 0x3005, 0x3007, 0x3021, + 0x3029, 0x3031, 0x3035, 0x3038, 0x303c, 0x3041, 0x3096, 0x309d, + 0x309f, 0x30a1, 0x30fa, 0x30fc, 0x30ff, 0x3105, 0x312d, 0x3131, + 0x318e, 0x31a0, 0x31ba, 0x31f0, 0x31ff, 0x3400, 0x4db5, 0x4e00, + 0x9fd5, 0xa000, 0xa48c, 0xa4d0, 0xa4fd, 0xa500, 0xa60c, 0xa610, + 0xa61f, 0xa62a, 0xa62b, 0xa640, 0xa66e, 0xa674, 0xa67b, 0xa67f, + 0xa6ef, 0xa717, 0xa71f, 0xa722, 0xa788, 0xa78b, 0xa7ae, 0xa7b0, + 0xa7b7, 0xa7f7, 0xa801, 0xa803, 0xa805, 0xa807, 0xa80a, 0xa80c, + 0xa827, 0xa840, 0xa873, 0xa880, 0xa8c3, 0xa8c5, 0xa8c5, 0xa8f2, + 0xa8f7, 0xa8fb, 0xa8fb, 0xa8fd, 0xa8fd, 0xa90a, 0xa92a, 0xa930, + 0xa952, 0xa960, 0xa97c, 0xa980, 0xa9b2, 0xa9b4, 0xa9bf, 0xa9cf, + 0xa9cf, 0xa9e0, 0xa9e4, 0xa9e6, 0xa9ef, 0xa9fa, 0xa9fe, 0xaa00, + 0xaa36, 0xaa40, 0xaa4d, 0xaa60, 0xaa76, 0xaa7a, 0xaa7a, 0xaa7e, + 0xaabe, 0xaac0, 0xaac0, 0xaac2, 0xaac2, 0xaadb, 0xaadd, 0xaae0, + 0xaaef, 0xaaf2, 0xaaf5, 0xab01, 0xab06, 0xab09, 0xab0e, 0xab11, + 0xab16, 0xab20, 0xab26, 0xab28, 0xab2e, 0xab30, 0xab5a, 0xab5c, + 0xab65, 0xab70, 0xabea, 0xac00, 0xd7a3, 0xd7b0, 0xd7c6, 0xd7cb, + 0xd7fb, 0xf900, 0xfa6d, 0xfa70, 0xfad9, 0xfb00, 0xfb06, 0xfb13, + 0xfb17, 0xfb1d, 0xfb28, 0xfb2a, 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, + 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, 0xfbb1, 0xfbd3, + 0xfd3d, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdf0, 0xfdfb, 0xfe70, + 0xfe74, 0xfe76, 0xfefc, 0xff21, 0xff3a, 0xff41, 0xff5a, 0xff66, + 0xffbe, 0xffc2, 0xffc7, 0xffca, 0xffcf, 0xffd2, 0xffd7, 0xffda, + 0xffdc, 0x10000, 0x1000b, 0x1000d, 0x10026, 0x10028, 0x1003a, 0x1003c, + 0x1003d, 0x1003f, 0x1004d, 0x10050, 0x1005d, 0x10080, 0x100fa, 0x10140, + 0x10174, 0x10280, 0x1029c, 0x102a0, 0x102d0, 0x10300, 0x1031f, 0x10330, + 0x1034a, 0x10350, 0x1037a, 0x10380, 0x1039d, 0x103a0, 0x103c3, 0x103c8, + 0x103cf, 0x103d1, 0x103d5, 0x10400, 0x1049d, 0x104b0, 0x104d3, 0x104d8, + 0x104fb, 0x10500, 0x10527, 0x10530, 0x10563, 0x10600, 0x10736, 0x10740, + 0x10755, 0x10760, 0x10767, 0x10800, 0x10805, 0x10808, 0x10808, 0x1080a, + 0x10835, 0x10837, 0x10838, 0x1083c, 0x1083c, 0x1083f, 0x10855, 0x10860, + 0x10876, 0x10880, 0x1089e, 0x108e0, 0x108f2, 0x108f4, 0x108f5, 0x10900, + 0x10915, 0x10920, 0x10939, 0x10980, 0x109b7, 0x109be, 0x109bf, 0x10a00, + 0x10a03, 0x10a05, 0x10a06, 0x10a0c, 0x10a13, 0x10a15, 0x10a17, 0x10a19, + 0x10a33, 0x10a60, 0x10a7c, 0x10a80, 0x10a9c, 0x10ac0, 0x10ac7, 0x10ac9, + 0x10ae4, 0x10b00, 0x10b35, 0x10b40, 0x10b55, 0x10b60, 0x10b72, 0x10b80, + 0x10b91, 0x10c00, 0x10c48, 0x10c80, 0x10cb2, 0x10cc0, 0x10cf2, 0x11000, + 0x11045, 0x11082, 0x110b8, 0x110d0, 0x110e8, 0x11100, 0x11132, 0x11150, + 0x11172, 0x11176, 0x11176, 0x11180, 0x111bf, 0x111c1, 0x111c4, 0x111da, + 0x111da, 0x111dc, 0x111dc, 0x11200, 0x11211, 0x11213, 0x11234, 0x11237, + 0x11237, 0x1123e, 0x1123e, 0x11280, 0x11286, 0x11288, 0x11288, 0x1128a, + 0x1128d, 0x1128f, 0x1129d, 0x1129f, 0x112a8, 0x112b0, 0x112e8, 0x11300, + 0x11303, 0x11305, 0x1130c, 0x1130f, 0x11310, 0x11313, 0x11328, 0x1132a, + 0x11330, 0x11332, 0x11333, 0x11335, 0x11339, 0x1133d, 0x11344, 0x11347, + 0x11348, 0x1134b, 0x1134c, 0x11350, 0x11350, 0x11357, 0x11357, 0x1135d, + 0x11363, 0x11400, 0x11441, 0x11443, 0x11445, 0x11447, 0x1144a, 0x11480, + 0x114c1, 0x114c4, 0x114c5, 0x114c7, 0x114c7, 0x11580, 0x115b5, 0x115b8, + 0x115be, 0x115d8, 0x115dd, 0x11600, 0x1163e, 0x11640, 0x11640, 0x11644, + 0x11644, 0x11680, 0x116b5, 0x11700, 0x11719, 0x1171d, 0x1172a, 0x118a0, + 0x118df, 0x118ff, 0x118ff, 0x11ac0, 0x11af8, 0x11c00, 0x11c08, 0x11c0a, + 0x11c36, 0x11c38, 0x11c3e, 0x11c40, 0x11c40, 0x11c72, 0x11c8f, 0x11c92, + 0x11ca7, 0x11ca9, 0x11cb6, 0x12000, 0x12399, 0x12400, 0x1246e, 0x12480, + 0x12543, 0x13000, 0x1342e, 0x14400, 0x14646, 0x16800, 0x16a38, 0x16a40, + 0x16a5e, 0x16ad0, 0x16aed, 0x16b00, 0x16b36, 0x16b40, 0x16b43, 0x16b63, + 0x16b77, 0x16b7d, 0x16b8f, 0x16f00, 0x16f44, 0x16f50, 0x16f7e, 0x16f93, + 0x16f9f, 0x16fe0, 0x16fe0, 0x17000, 0x187ec, 0x18800, 0x18af2, 0x1b000, + 0x1b001, 0x1bc00, 0x1bc6a, 0x1bc70, 0x1bc7c, 0x1bc80, 0x1bc88, 0x1bc90, + 0x1bc99, 0x1bc9e, 0x1bc9e, 0x1d400, 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, + 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, + 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, + 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, + 0x1d53e, 0x1d540, 0x1d544, 0x1d546, 0x1d546, 0x1d54a, 0x1d550, 0x1d552, + 0x1d6a5, 0x1d6a8, 0x1d6c0, 0x1d6c2, 0x1d6da, 0x1d6dc, 0x1d6fa, 0x1d6fc, + 0x1d714, 0x1d716, 0x1d734, 0x1d736, 0x1d74e, 0x1d750, 0x1d76e, 0x1d770, + 0x1d788, 0x1d78a, 0x1d7a8, 0x1d7aa, 0x1d7c2, 0x1d7c4, 0x1d7cb, 0x1e000, + 0x1e006, 0x1e008, 0x1e018, 0x1e01b, 0x1e021, 0x1e023, 0x1e024, 0x1e026, + 0x1e02a, 0x1e800, 0x1e8c4, 0x1e900, 0x1e943, 0x1e947, 0x1e947, 0x1ee00, + 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, 0x1ee22, 0x1ee24, 0x1ee24, 0x1ee27, + 0x1ee27, 0x1ee29, 0x1ee32, 0x1ee34, 0x1ee37, 0x1ee39, 0x1ee39, 0x1ee3b, + 0x1ee3b, 0x1ee42, 0x1ee42, 0x1ee47, 0x1ee47, 0x1ee49, 0x1ee49, 0x1ee4b, + 0x1ee4b, 0x1ee4d, 0x1ee4f, 0x1ee51, 0x1ee52, 0x1ee54, 0x1ee54, 0x1ee57, + 0x1ee57, 0x1ee59, 0x1ee59, 0x1ee5b, 0x1ee5b, 0x1ee5d, 0x1ee5d, 0x1ee5f, + 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, 0x1ee64, 0x1ee67, 0x1ee6a, 0x1ee6c, + 0x1ee72, 0x1ee74, 0x1ee77, 0x1ee79, 0x1ee7c, 0x1ee7e, 0x1ee7e, 0x1ee80, + 0x1ee89, 0x1ee8b, 0x1ee9b, 0x1eea1, 0x1eea3, 0x1eea5, 0x1eea9, 0x1eeab, + 0x1eebb, 0x1f130, 0x1f149, 0x1f150, 0x1f169, 0x1f170, 0x1f189, 0x20000, + 0x2a6d6, 0x2a700, 0x2b734, 0x2b740, 0x2b81d, 0x2b820, 0x2cea1, 0x2f800, + 0x2fa1d, +}; /* CR_Alpha */ + +/* 'Blank': [[:Blank:]] */ +static const OnigCodePoint CR_Blank[] = { + 8, 0x0009, 0x0009, 0x0020, 0x0020, 0x00a0, 0x00a0, 0x1680, 0x1680, + 0x2000, 0x200a, 0x202f, 0x202f, 0x205f, 0x205f, 0x3000, 0x3000, +}; /* CR_Blank */ + +/* 'Cntrl': [[:Cntrl:]] */ +static const OnigCodePoint CR_Cntrl[] = { + 2, 0x0000, 0x001f, 0x007f, 0x009f, +}; /* CR_Cntrl */ + +/* 'Digit': [[:Digit:]] */ +static const OnigCodePoint CR_Digit[] = { + 54, 0x0030, 0x0039, 0x0660, 0x0669, 0x06f0, 0x06f9, 0x07c0, + 0x07c9, 0x0966, 0x096f, 0x09e6, 0x09ef, 0x0a66, 0x0a6f, 0x0ae6, + 0x0aef, 0x0b66, 0x0b6f, 0x0be6, 0x0bef, 0x0c66, 0x0c6f, 0x0ce6, + 0x0cef, 0x0d66, 0x0d6f, 0x0de6, 0x0def, 0x0e50, 0x0e59, 0x0ed0, + 0x0ed9, 0x0f20, 0x0f29, 0x1040, 0x1049, 0x1090, 0x1099, 0x17e0, + 0x17e9, 0x1810, 0x1819, 0x1946, 0x194f, 0x19d0, 0x19d9, 0x1a80, + 0x1a89, 0x1a90, 0x1a99, 0x1b50, 0x1b59, 0x1bb0, 0x1bb9, 0x1c40, + 0x1c49, 0x1c50, 0x1c59, 0xa620, 0xa629, 0xa8d0, 0xa8d9, 0xa900, + 0xa909, 0xa9d0, 0xa9d9, 0xa9f0, 0xa9f9, 0xaa50, 0xaa59, 0xabf0, + 0xabf9, 0xff10, 0xff19, 0x104a0, 0x104a9, 0x11066, 0x1106f, 0x110f0, + 0x110f9, 0x11136, 0x1113f, 0x111d0, 0x111d9, 0x112f0, 0x112f9, 0x11450, + 0x11459, 0x114d0, 0x114d9, 0x11650, 0x11659, 0x116c0, 0x116c9, 0x11730, + 0x11739, 0x118e0, 0x118e9, 0x11c50, 0x11c59, 0x16a60, 0x16a69, 0x16b50, + 0x16b59, 0x1d7ce, 0x1d7ff, 0x1e950, 0x1e959, +}; /* CR_Digit */ + +/* 'Graph': [[:Graph:]] */ +static const OnigCodePoint CR_Graph[] = { + 643, 0x0021, 0x007e, 0x00a1, 0x0377, 0x037a, 0x037f, 0x0384, + 0x038a, 0x038c, 0x038c, 0x038e, 0x03a1, 0x03a3, 0x052f, 0x0531, + 0x0556, 0x0559, 0x055f, 0x0561, 0x0587, 0x0589, 0x058a, 0x058d, + 0x058f, 0x0591, 0x05c7, 0x05d0, 0x05ea, 0x05f0, 0x05f4, 0x0600, + 0x061c, 0x061e, 0x070d, 0x070f, 0x074a, 0x074d, 0x07b1, 0x07c0, + 0x07fa, 0x0800, 0x082d, 0x0830, 0x083e, 0x0840, 0x085b, 0x085e, + 0x085e, 0x08a0, 0x08b4, 0x08b6, 0x08bd, 0x08d4, 0x0983, 0x0985, + 0x098c, 0x098f, 0x0990, 0x0993, 0x09a8, 0x09aa, 0x09b0, 0x09b2, + 0x09b2, 0x09b6, 0x09b9, 0x09bc, 0x09c4, 0x09c7, 0x09c8, 0x09cb, + 0x09ce, 0x09d7, 0x09d7, 0x09dc, 0x09dd, 0x09df, 0x09e3, 0x09e6, + 0x09fb, 0x0a01, 0x0a03, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, + 0x0a28, 0x0a2a, 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, + 0x0a39, 0x0a3c, 0x0a3c, 0x0a3e, 0x0a42, 0x0a47, 0x0a48, 0x0a4b, + 0x0a4d, 0x0a51, 0x0a51, 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, + 0x0a75, 0x0a81, 0x0a83, 0x0a85, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, + 0x0aa8, 0x0aaa, 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, + 0x0ac5, 0x0ac7, 0x0ac9, 0x0acb, 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, + 0x0ae3, 0x0ae6, 0x0af1, 0x0af9, 0x0af9, 0x0b01, 0x0b03, 0x0b05, + 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, 0x0b28, 0x0b2a, 0x0b30, 0x0b32, + 0x0b33, 0x0b35, 0x0b39, 0x0b3c, 0x0b44, 0x0b47, 0x0b48, 0x0b4b, + 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, 0x0b5d, 0x0b5f, 0x0b63, 0x0b66, + 0x0b77, 0x0b82, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, + 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, + 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, + 0x0bc8, 0x0bca, 0x0bcd, 0x0bd0, 0x0bd0, 0x0bd7, 0x0bd7, 0x0be6, + 0x0bfa, 0x0c00, 0x0c03, 0x0c05, 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, + 0x0c28, 0x0c2a, 0x0c39, 0x0c3d, 0x0c44, 0x0c46, 0x0c48, 0x0c4a, + 0x0c4d, 0x0c55, 0x0c56, 0x0c58, 0x0c5a, 0x0c60, 0x0c63, 0x0c66, + 0x0c6f, 0x0c78, 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, + 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbc, 0x0cc4, 0x0cc6, + 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, + 0x0ce3, 0x0ce6, 0x0cef, 0x0cf1, 0x0cf2, 0x0d01, 0x0d03, 0x0d05, + 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d3a, 0x0d3d, 0x0d44, 0x0d46, + 0x0d48, 0x0d4a, 0x0d4f, 0x0d54, 0x0d63, 0x0d66, 0x0d7f, 0x0d82, + 0x0d83, 0x0d85, 0x0d96, 0x0d9a, 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, + 0x0dbd, 0x0dc0, 0x0dc6, 0x0dca, 0x0dca, 0x0dcf, 0x0dd4, 0x0dd6, + 0x0dd6, 0x0dd8, 0x0ddf, 0x0de6, 0x0def, 0x0df2, 0x0df4, 0x0e01, + 0x0e3a, 0x0e3f, 0x0e5b, 0x0e81, 0x0e82, 0x0e84, 0x0e84, 0x0e87, + 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, 0x0e97, 0x0e99, + 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, + 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, + 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, 0x0ed9, 0x0edc, 0x0edf, 0x0f00, + 0x0f47, 0x0f49, 0x0f6c, 0x0f71, 0x0f97, 0x0f99, 0x0fbc, 0x0fbe, + 0x0fcc, 0x0fce, 0x0fda, 0x1000, 0x10c5, 0x10c7, 0x10c7, 0x10cd, + 0x10cd, 0x10d0, 0x1248, 0x124a, 0x124d, 0x1250, 0x1256, 0x1258, + 0x1258, 0x125a, 0x125d, 0x1260, 0x1288, 0x128a, 0x128d, 0x1290, + 0x12b0, 0x12b2, 0x12b5, 0x12b8, 0x12be, 0x12c0, 0x12c0, 0x12c2, + 0x12c5, 0x12c8, 0x12d6, 0x12d8, 0x1310, 0x1312, 0x1315, 0x1318, + 0x135a, 0x135d, 0x137c, 0x1380, 0x1399, 0x13a0, 0x13f5, 0x13f8, + 0x13fd, 0x1400, 0x167f, 0x1681, 0x169c, 0x16a0, 0x16f8, 0x1700, + 0x170c, 0x170e, 0x1714, 0x1720, 0x1736, 0x1740, 0x1753, 0x1760, + 0x176c, 0x176e, 0x1770, 0x1772, 0x1773, 0x1780, 0x17dd, 0x17e0, + 0x17e9, 0x17f0, 0x17f9, 0x1800, 0x180e, 0x1810, 0x1819, 0x1820, + 0x1877, 0x1880, 0x18aa, 0x18b0, 0x18f5, 0x1900, 0x191e, 0x1920, + 0x192b, 0x1930, 0x193b, 0x1940, 0x1940, 0x1944, 0x196d, 0x1970, + 0x1974, 0x1980, 0x19ab, 0x19b0, 0x19c9, 0x19d0, 0x19da, 0x19de, + 0x1a1b, 0x1a1e, 0x1a5e, 0x1a60, 0x1a7c, 0x1a7f, 0x1a89, 0x1a90, + 0x1a99, 0x1aa0, 0x1aad, 0x1ab0, 0x1abe, 0x1b00, 0x1b4b, 0x1b50, + 0x1b7c, 0x1b80, 0x1bf3, 0x1bfc, 0x1c37, 0x1c3b, 0x1c49, 0x1c4d, + 0x1c88, 0x1cc0, 0x1cc7, 0x1cd0, 0x1cf6, 0x1cf8, 0x1cf9, 0x1d00, + 0x1df5, 0x1dfb, 0x1f15, 0x1f18, 0x1f1d, 0x1f20, 0x1f45, 0x1f48, + 0x1f4d, 0x1f50, 0x1f57, 0x1f59, 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, + 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, 0x1fc4, 0x1fc6, + 0x1fd3, 0x1fd6, 0x1fdb, 0x1fdd, 0x1fef, 0x1ff2, 0x1ff4, 0x1ff6, + 0x1ffe, 0x200b, 0x2027, 0x202a, 0x202e, 0x2030, 0x205e, 0x2060, + 0x2064, 0x2066, 0x2071, 0x2074, 0x208e, 0x2090, 0x209c, 0x20a0, + 0x20be, 0x20d0, 0x20f0, 0x2100, 0x218b, 0x2190, 0x23fe, 0x2400, + 0x2426, 0x2440, 0x244a, 0x2460, 0x2b73, 0x2b76, 0x2b95, 0x2b98, + 0x2bb9, 0x2bbd, 0x2bc8, 0x2bca, 0x2bd1, 0x2bec, 0x2bef, 0x2c00, + 0x2c2e, 0x2c30, 0x2c5e, 0x2c60, 0x2cf3, 0x2cf9, 0x2d25, 0x2d27, + 0x2d27, 0x2d2d, 0x2d2d, 0x2d30, 0x2d67, 0x2d6f, 0x2d70, 0x2d7f, + 0x2d96, 0x2da0, 0x2da6, 0x2da8, 0x2dae, 0x2db0, 0x2db6, 0x2db8, + 0x2dbe, 0x2dc0, 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, 0x2dd6, 0x2dd8, + 0x2dde, 0x2de0, 0x2e44, 0x2e80, 0x2e99, 0x2e9b, 0x2ef3, 0x2f00, + 0x2fd5, 0x2ff0, 0x2ffb, 0x3001, 0x303f, 0x3041, 0x3096, 0x3099, + 0x30ff, 0x3105, 0x312d, 0x3131, 0x318e, 0x3190, 0x31ba, 0x31c0, + 0x31e3, 0x31f0, 0x321e, 0x3220, 0x32fe, 0x3300, 0x4db5, 0x4dc0, + 0x9fd5, 0xa000, 0xa48c, 0xa490, 0xa4c6, 0xa4d0, 0xa62b, 0xa640, + 0xa6f7, 0xa700, 0xa7ae, 0xa7b0, 0xa7b7, 0xa7f7, 0xa82b, 0xa830, + 0xa839, 0xa840, 0xa877, 0xa880, 0xa8c5, 0xa8ce, 0xa8d9, 0xa8e0, + 0xa8fd, 0xa900, 0xa953, 0xa95f, 0xa97c, 0xa980, 0xa9cd, 0xa9cf, + 0xa9d9, 0xa9de, 0xa9fe, 0xaa00, 0xaa36, 0xaa40, 0xaa4d, 0xaa50, + 0xaa59, 0xaa5c, 0xaac2, 0xaadb, 0xaaf6, 0xab01, 0xab06, 0xab09, + 0xab0e, 0xab11, 0xab16, 0xab20, 0xab26, 0xab28, 0xab2e, 0xab30, + 0xab65, 0xab70, 0xabed, 0xabf0, 0xabf9, 0xac00, 0xd7a3, 0xd7b0, + 0xd7c6, 0xd7cb, 0xd7fb, 0xe000, 0xfa6d, 0xfa70, 0xfad9, 0xfb00, + 0xfb06, 0xfb13, 0xfb17, 0xfb1d, 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, + 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, 0xfbc1, 0xfbd3, + 0xfd3f, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdf0, 0xfdfd, 0xfe00, + 0xfe19, 0xfe20, 0xfe52, 0xfe54, 0xfe66, 0xfe68, 0xfe6b, 0xfe70, + 0xfe74, 0xfe76, 0xfefc, 0xfeff, 0xfeff, 0xff01, 0xffbe, 0xffc2, + 0xffc7, 0xffca, 0xffcf, 0xffd2, 0xffd7, 0xffda, 0xffdc, 0xffe0, + 0xffe6, 0xffe8, 0xffee, 0xfff9, 0xfffd, 0x10000, 0x1000b, 0x1000d, + 0x10026, 0x10028, 0x1003a, 0x1003c, 0x1003d, 0x1003f, 0x1004d, 0x10050, + 0x1005d, 0x10080, 0x100fa, 0x10100, 0x10102, 0x10107, 0x10133, 0x10137, + 0x1018e, 0x10190, 0x1019b, 0x101a0, 0x101a0, 0x101d0, 0x101fd, 0x10280, + 0x1029c, 0x102a0, 0x102d0, 0x102e0, 0x102fb, 0x10300, 0x10323, 0x10330, + 0x1034a, 0x10350, 0x1037a, 0x10380, 0x1039d, 0x1039f, 0x103c3, 0x103c8, + 0x103d5, 0x10400, 0x1049d, 0x104a0, 0x104a9, 0x104b0, 0x104d3, 0x104d8, + 0x104fb, 0x10500, 0x10527, 0x10530, 0x10563, 0x1056f, 0x1056f, 0x10600, + 0x10736, 0x10740, 0x10755, 0x10760, 0x10767, 0x10800, 0x10805, 0x10808, + 0x10808, 0x1080a, 0x10835, 0x10837, 0x10838, 0x1083c, 0x1083c, 0x1083f, + 0x10855, 0x10857, 0x1089e, 0x108a7, 0x108af, 0x108e0, 0x108f2, 0x108f4, + 0x108f5, 0x108fb, 0x1091b, 0x1091f, 0x10939, 0x1093f, 0x1093f, 0x10980, + 0x109b7, 0x109bc, 0x109cf, 0x109d2, 0x10a03, 0x10a05, 0x10a06, 0x10a0c, + 0x10a13, 0x10a15, 0x10a17, 0x10a19, 0x10a33, 0x10a38, 0x10a3a, 0x10a3f, + 0x10a47, 0x10a50, 0x10a58, 0x10a60, 0x10a9f, 0x10ac0, 0x10ae6, 0x10aeb, + 0x10af6, 0x10b00, 0x10b35, 0x10b39, 0x10b55, 0x10b58, 0x10b72, 0x10b78, + 0x10b91, 0x10b99, 0x10b9c, 0x10ba9, 0x10baf, 0x10c00, 0x10c48, 0x10c80, + 0x10cb2, 0x10cc0, 0x10cf2, 0x10cfa, 0x10cff, 0x10e60, 0x10e7e, 0x11000, + 0x1104d, 0x11052, 0x1106f, 0x1107f, 0x110c1, 0x110d0, 0x110e8, 0x110f0, + 0x110f9, 0x11100, 0x11134, 0x11136, 0x11143, 0x11150, 0x11176, 0x11180, + 0x111cd, 0x111d0, 0x111df, 0x111e1, 0x111f4, 0x11200, 0x11211, 0x11213, + 0x1123e, 0x11280, 0x11286, 0x11288, 0x11288, 0x1128a, 0x1128d, 0x1128f, + 0x1129d, 0x1129f, 0x112a9, 0x112b0, 0x112ea, 0x112f0, 0x112f9, 0x11300, + 0x11303, 0x11305, 0x1130c, 0x1130f, 0x11310, 0x11313, 0x11328, 0x1132a, + 0x11330, 0x11332, 0x11333, 0x11335, 0x11339, 0x1133c, 0x11344, 0x11347, + 0x11348, 0x1134b, 0x1134d, 0x11350, 0x11350, 0x11357, 0x11357, 0x1135d, + 0x11363, 0x11366, 0x1136c, 0x11370, 0x11374, 0x11400, 0x11459, 0x1145b, + 0x1145b, 0x1145d, 0x1145d, 0x11480, 0x114c7, 0x114d0, 0x114d9, 0x11580, + 0x115b5, 0x115b8, 0x115dd, 0x11600, 0x11644, 0x11650, 0x11659, 0x11660, + 0x1166c, 0x11680, 0x116b7, 0x116c0, 0x116c9, 0x11700, 0x11719, 0x1171d, + 0x1172b, 0x11730, 0x1173f, 0x118a0, 0x118f2, 0x118ff, 0x118ff, 0x11ac0, + 0x11af8, 0x11c00, 0x11c08, 0x11c0a, 0x11c36, 0x11c38, 0x11c45, 0x11c50, + 0x11c6c, 0x11c70, 0x11c8f, 0x11c92, 0x11ca7, 0x11ca9, 0x11cb6, 0x12000, + 0x12399, 0x12400, 0x1246e, 0x12470, 0x12474, 0x12480, 0x12543, 0x13000, + 0x1342e, 0x14400, 0x14646, 0x16800, 0x16a38, 0x16a40, 0x16a5e, 0x16a60, + 0x16a69, 0x16a6e, 0x16a6f, 0x16ad0, 0x16aed, 0x16af0, 0x16af5, 0x16b00, + 0x16b45, 0x16b50, 0x16b59, 0x16b5b, 0x16b61, 0x16b63, 0x16b77, 0x16b7d, + 0x16b8f, 0x16f00, 0x16f44, 0x16f50, 0x16f7e, 0x16f8f, 0x16f9f, 0x16fe0, + 0x16fe0, 0x17000, 0x187ec, 0x18800, 0x18af2, 0x1b000, 0x1b001, 0x1bc00, + 0x1bc6a, 0x1bc70, 0x1bc7c, 0x1bc80, 0x1bc88, 0x1bc90, 0x1bc99, 0x1bc9c, + 0x1bca3, 0x1d000, 0x1d0f5, 0x1d100, 0x1d126, 0x1d129, 0x1d1e8, 0x1d200, + 0x1d245, 0x1d300, 0x1d356, 0x1d360, 0x1d371, 0x1d400, 0x1d454, 0x1d456, + 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, + 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, + 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, + 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, 0x1d544, 0x1d546, 0x1d546, 0x1d54a, + 0x1d550, 0x1d552, 0x1d6a5, 0x1d6a8, 0x1d7cb, 0x1d7ce, 0x1da8b, 0x1da9b, + 0x1da9f, 0x1daa1, 0x1daaf, 0x1e000, 0x1e006, 0x1e008, 0x1e018, 0x1e01b, + 0x1e021, 0x1e023, 0x1e024, 0x1e026, 0x1e02a, 0x1e800, 0x1e8c4, 0x1e8c7, + 0x1e8d6, 0x1e900, 0x1e94a, 0x1e950, 0x1e959, 0x1e95e, 0x1e95f, 0x1ee00, + 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, 0x1ee22, 0x1ee24, 0x1ee24, 0x1ee27, + 0x1ee27, 0x1ee29, 0x1ee32, 0x1ee34, 0x1ee37, 0x1ee39, 0x1ee39, 0x1ee3b, + 0x1ee3b, 0x1ee42, 0x1ee42, 0x1ee47, 0x1ee47, 0x1ee49, 0x1ee49, 0x1ee4b, + 0x1ee4b, 0x1ee4d, 0x1ee4f, 0x1ee51, 0x1ee52, 0x1ee54, 0x1ee54, 0x1ee57, + 0x1ee57, 0x1ee59, 0x1ee59, 0x1ee5b, 0x1ee5b, 0x1ee5d, 0x1ee5d, 0x1ee5f, + 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, 0x1ee64, 0x1ee67, 0x1ee6a, 0x1ee6c, + 0x1ee72, 0x1ee74, 0x1ee77, 0x1ee79, 0x1ee7c, 0x1ee7e, 0x1ee7e, 0x1ee80, + 0x1ee89, 0x1ee8b, 0x1ee9b, 0x1eea1, 0x1eea3, 0x1eea5, 0x1eea9, 0x1eeab, + 0x1eebb, 0x1eef0, 0x1eef1, 0x1f000, 0x1f02b, 0x1f030, 0x1f093, 0x1f0a0, + 0x1f0ae, 0x1f0b1, 0x1f0bf, 0x1f0c1, 0x1f0cf, 0x1f0d1, 0x1f0f5, 0x1f100, + 0x1f10c, 0x1f110, 0x1f12e, 0x1f130, 0x1f16b, 0x1f170, 0x1f1ac, 0x1f1e6, + 0x1f202, 0x1f210, 0x1f23b, 0x1f240, 0x1f248, 0x1f250, 0x1f251, 0x1f300, + 0x1f6d2, 0x1f6e0, 0x1f6ec, 0x1f6f0, 0x1f6f6, 0x1f700, 0x1f773, 0x1f780, + 0x1f7d4, 0x1f800, 0x1f80b, 0x1f810, 0x1f847, 0x1f850, 0x1f859, 0x1f860, + 0x1f887, 0x1f890, 0x1f8ad, 0x1f910, 0x1f91e, 0x1f920, 0x1f927, 0x1f930, + 0x1f930, 0x1f933, 0x1f93e, 0x1f940, 0x1f94b, 0x1f950, 0x1f95e, 0x1f980, + 0x1f991, 0x1f9c0, 0x1f9c0, 0x20000, 0x2a6d6, 0x2a700, 0x2b734, 0x2b740, + 0x2b81d, 0x2b820, 0x2cea1, 0x2f800, 0x2fa1d, 0xe0001, 0xe0001, 0xe0020, + 0xe007f, 0xe0100, 0xe01ef, 0xf0000, 0xffffd, 0x100000, 0x10fffd, +}; /* CR_Graph */ + +/* 'Lower': [[:Lower:]] */ +static const OnigCodePoint CR_Lower[] = { + 640, 0x0061, 0x007a, 0x00aa, 0x00aa, 0x00b5, 0x00b5, 0x00ba, + 0x00ba, 0x00df, 0x00f6, 0x00f8, 0x00ff, 0x0101, 0x0101, 0x0103, + 0x0103, 0x0105, 0x0105, 0x0107, 0x0107, 0x0109, 0x0109, 0x010b, + 0x010b, 0x010d, 0x010d, 0x010f, 0x010f, 0x0111, 0x0111, 0x0113, + 0x0113, 0x0115, 0x0115, 0x0117, 0x0117, 0x0119, 0x0119, 0x011b, + 0x011b, 0x011d, 0x011d, 0x011f, 0x011f, 0x0121, 0x0121, 0x0123, + 0x0123, 0x0125, 0x0125, 0x0127, 0x0127, 0x0129, 0x0129, 0x012b, + 0x012b, 0x012d, 0x012d, 0x012f, 0x012f, 0x0131, 0x0131, 0x0133, + 0x0133, 0x0135, 0x0135, 0x0137, 0x0138, 0x013a, 0x013a, 0x013c, + 0x013c, 0x013e, 0x013e, 0x0140, 0x0140, 0x0142, 0x0142, 0x0144, + 0x0144, 0x0146, 0x0146, 0x0148, 0x0149, 0x014b, 0x014b, 0x014d, + 0x014d, 0x014f, 0x014f, 0x0151, 0x0151, 0x0153, 0x0153, 0x0155, + 0x0155, 0x0157, 0x0157, 0x0159, 0x0159, 0x015b, 0x015b, 0x015d, + 0x015d, 0x015f, 0x015f, 0x0161, 0x0161, 0x0163, 0x0163, 0x0165, + 0x0165, 0x0167, 0x0167, 0x0169, 0x0169, 0x016b, 0x016b, 0x016d, + 0x016d, 0x016f, 0x016f, 0x0171, 0x0171, 0x0173, 0x0173, 0x0175, + 0x0175, 0x0177, 0x0177, 0x017a, 0x017a, 0x017c, 0x017c, 0x017e, + 0x0180, 0x0183, 0x0183, 0x0185, 0x0185, 0x0188, 0x0188, 0x018c, + 0x018d, 0x0192, 0x0192, 0x0195, 0x0195, 0x0199, 0x019b, 0x019e, + 0x019e, 0x01a1, 0x01a1, 0x01a3, 0x01a3, 0x01a5, 0x01a5, 0x01a8, + 0x01a8, 0x01aa, 0x01ab, 0x01ad, 0x01ad, 0x01b0, 0x01b0, 0x01b4, + 0x01b4, 0x01b6, 0x01b6, 0x01b9, 0x01ba, 0x01bd, 0x01bf, 0x01c6, + 0x01c6, 0x01c9, 0x01c9, 0x01cc, 0x01cc, 0x01ce, 0x01ce, 0x01d0, + 0x01d0, 0x01d2, 0x01d2, 0x01d4, 0x01d4, 0x01d6, 0x01d6, 0x01d8, + 0x01d8, 0x01da, 0x01da, 0x01dc, 0x01dd, 0x01df, 0x01df, 0x01e1, + 0x01e1, 0x01e3, 0x01e3, 0x01e5, 0x01e5, 0x01e7, 0x01e7, 0x01e9, + 0x01e9, 0x01eb, 0x01eb, 0x01ed, 0x01ed, 0x01ef, 0x01f0, 0x01f3, + 0x01f3, 0x01f5, 0x01f5, 0x01f9, 0x01f9, 0x01fb, 0x01fb, 0x01fd, + 0x01fd, 0x01ff, 0x01ff, 0x0201, 0x0201, 0x0203, 0x0203, 0x0205, + 0x0205, 0x0207, 0x0207, 0x0209, 0x0209, 0x020b, 0x020b, 0x020d, + 0x020d, 0x020f, 0x020f, 0x0211, 0x0211, 0x0213, 0x0213, 0x0215, + 0x0215, 0x0217, 0x0217, 0x0219, 0x0219, 0x021b, 0x021b, 0x021d, + 0x021d, 0x021f, 0x021f, 0x0221, 0x0221, 0x0223, 0x0223, 0x0225, + 0x0225, 0x0227, 0x0227, 0x0229, 0x0229, 0x022b, 0x022b, 0x022d, + 0x022d, 0x022f, 0x022f, 0x0231, 0x0231, 0x0233, 0x0239, 0x023c, + 0x023c, 0x023f, 0x0240, 0x0242, 0x0242, 0x0247, 0x0247, 0x0249, + 0x0249, 0x024b, 0x024b, 0x024d, 0x024d, 0x024f, 0x0293, 0x0295, + 0x02b8, 0x02c0, 0x02c1, 0x02e0, 0x02e4, 0x0345, 0x0345, 0x0371, + 0x0371, 0x0373, 0x0373, 0x0377, 0x0377, 0x037a, 0x037d, 0x0390, + 0x0390, 0x03ac, 0x03ce, 0x03d0, 0x03d1, 0x03d5, 0x03d7, 0x03d9, + 0x03d9, 0x03db, 0x03db, 0x03dd, 0x03dd, 0x03df, 0x03df, 0x03e1, + 0x03e1, 0x03e3, 0x03e3, 0x03e5, 0x03e5, 0x03e7, 0x03e7, 0x03e9, + 0x03e9, 0x03eb, 0x03eb, 0x03ed, 0x03ed, 0x03ef, 0x03f3, 0x03f5, + 0x03f5, 0x03f8, 0x03f8, 0x03fb, 0x03fc, 0x0430, 0x045f, 0x0461, + 0x0461, 0x0463, 0x0463, 0x0465, 0x0465, 0x0467, 0x0467, 0x0469, + 0x0469, 0x046b, 0x046b, 0x046d, 0x046d, 0x046f, 0x046f, 0x0471, + 0x0471, 0x0473, 0x0473, 0x0475, 0x0475, 0x0477, 0x0477, 0x0479, + 0x0479, 0x047b, 0x047b, 0x047d, 0x047d, 0x047f, 0x047f, 0x0481, + 0x0481, 0x048b, 0x048b, 0x048d, 0x048d, 0x048f, 0x048f, 0x0491, + 0x0491, 0x0493, 0x0493, 0x0495, 0x0495, 0x0497, 0x0497, 0x0499, + 0x0499, 0x049b, 0x049b, 0x049d, 0x049d, 0x049f, 0x049f, 0x04a1, + 0x04a1, 0x04a3, 0x04a3, 0x04a5, 0x04a5, 0x04a7, 0x04a7, 0x04a9, + 0x04a9, 0x04ab, 0x04ab, 0x04ad, 0x04ad, 0x04af, 0x04af, 0x04b1, + 0x04b1, 0x04b3, 0x04b3, 0x04b5, 0x04b5, 0x04b7, 0x04b7, 0x04b9, + 0x04b9, 0x04bb, 0x04bb, 0x04bd, 0x04bd, 0x04bf, 0x04bf, 0x04c2, + 0x04c2, 0x04c4, 0x04c4, 0x04c6, 0x04c6, 0x04c8, 0x04c8, 0x04ca, + 0x04ca, 0x04cc, 0x04cc, 0x04ce, 0x04cf, 0x04d1, 0x04d1, 0x04d3, + 0x04d3, 0x04d5, 0x04d5, 0x04d7, 0x04d7, 0x04d9, 0x04d9, 0x04db, + 0x04db, 0x04dd, 0x04dd, 0x04df, 0x04df, 0x04e1, 0x04e1, 0x04e3, + 0x04e3, 0x04e5, 0x04e5, 0x04e7, 0x04e7, 0x04e9, 0x04e9, 0x04eb, + 0x04eb, 0x04ed, 0x04ed, 0x04ef, 0x04ef, 0x04f1, 0x04f1, 0x04f3, + 0x04f3, 0x04f5, 0x04f5, 0x04f7, 0x04f7, 0x04f9, 0x04f9, 0x04fb, + 0x04fb, 0x04fd, 0x04fd, 0x04ff, 0x04ff, 0x0501, 0x0501, 0x0503, + 0x0503, 0x0505, 0x0505, 0x0507, 0x0507, 0x0509, 0x0509, 0x050b, + 0x050b, 0x050d, 0x050d, 0x050f, 0x050f, 0x0511, 0x0511, 0x0513, + 0x0513, 0x0515, 0x0515, 0x0517, 0x0517, 0x0519, 0x0519, 0x051b, + 0x051b, 0x051d, 0x051d, 0x051f, 0x051f, 0x0521, 0x0521, 0x0523, + 0x0523, 0x0525, 0x0525, 0x0527, 0x0527, 0x0529, 0x0529, 0x052b, + 0x052b, 0x052d, 0x052d, 0x052f, 0x052f, 0x0561, 0x0587, 0x13f8, + 0x13fd, 0x1c80, 0x1c88, 0x1d00, 0x1dbf, 0x1e01, 0x1e01, 0x1e03, + 0x1e03, 0x1e05, 0x1e05, 0x1e07, 0x1e07, 0x1e09, 0x1e09, 0x1e0b, + 0x1e0b, 0x1e0d, 0x1e0d, 0x1e0f, 0x1e0f, 0x1e11, 0x1e11, 0x1e13, + 0x1e13, 0x1e15, 0x1e15, 0x1e17, 0x1e17, 0x1e19, 0x1e19, 0x1e1b, + 0x1e1b, 0x1e1d, 0x1e1d, 0x1e1f, 0x1e1f, 0x1e21, 0x1e21, 0x1e23, + 0x1e23, 0x1e25, 0x1e25, 0x1e27, 0x1e27, 0x1e29, 0x1e29, 0x1e2b, + 0x1e2b, 0x1e2d, 0x1e2d, 0x1e2f, 0x1e2f, 0x1e31, 0x1e31, 0x1e33, + 0x1e33, 0x1e35, 0x1e35, 0x1e37, 0x1e37, 0x1e39, 0x1e39, 0x1e3b, + 0x1e3b, 0x1e3d, 0x1e3d, 0x1e3f, 0x1e3f, 0x1e41, 0x1e41, 0x1e43, + 0x1e43, 0x1e45, 0x1e45, 0x1e47, 0x1e47, 0x1e49, 0x1e49, 0x1e4b, + 0x1e4b, 0x1e4d, 0x1e4d, 0x1e4f, 0x1e4f, 0x1e51, 0x1e51, 0x1e53, + 0x1e53, 0x1e55, 0x1e55, 0x1e57, 0x1e57, 0x1e59, 0x1e59, 0x1e5b, + 0x1e5b, 0x1e5d, 0x1e5d, 0x1e5f, 0x1e5f, 0x1e61, 0x1e61, 0x1e63, + 0x1e63, 0x1e65, 0x1e65, 0x1e67, 0x1e67, 0x1e69, 0x1e69, 0x1e6b, + 0x1e6b, 0x1e6d, 0x1e6d, 0x1e6f, 0x1e6f, 0x1e71, 0x1e71, 0x1e73, + 0x1e73, 0x1e75, 0x1e75, 0x1e77, 0x1e77, 0x1e79, 0x1e79, 0x1e7b, + 0x1e7b, 0x1e7d, 0x1e7d, 0x1e7f, 0x1e7f, 0x1e81, 0x1e81, 0x1e83, + 0x1e83, 0x1e85, 0x1e85, 0x1e87, 0x1e87, 0x1e89, 0x1e89, 0x1e8b, + 0x1e8b, 0x1e8d, 0x1e8d, 0x1e8f, 0x1e8f, 0x1e91, 0x1e91, 0x1e93, + 0x1e93, 0x1e95, 0x1e9d, 0x1e9f, 0x1e9f, 0x1ea1, 0x1ea1, 0x1ea3, + 0x1ea3, 0x1ea5, 0x1ea5, 0x1ea7, 0x1ea7, 0x1ea9, 0x1ea9, 0x1eab, + 0x1eab, 0x1ead, 0x1ead, 0x1eaf, 0x1eaf, 0x1eb1, 0x1eb1, 0x1eb3, + 0x1eb3, 0x1eb5, 0x1eb5, 0x1eb7, 0x1eb7, 0x1eb9, 0x1eb9, 0x1ebb, + 0x1ebb, 0x1ebd, 0x1ebd, 0x1ebf, 0x1ebf, 0x1ec1, 0x1ec1, 0x1ec3, + 0x1ec3, 0x1ec5, 0x1ec5, 0x1ec7, 0x1ec7, 0x1ec9, 0x1ec9, 0x1ecb, + 0x1ecb, 0x1ecd, 0x1ecd, 0x1ecf, 0x1ecf, 0x1ed1, 0x1ed1, 0x1ed3, + 0x1ed3, 0x1ed5, 0x1ed5, 0x1ed7, 0x1ed7, 0x1ed9, 0x1ed9, 0x1edb, + 0x1edb, 0x1edd, 0x1edd, 0x1edf, 0x1edf, 0x1ee1, 0x1ee1, 0x1ee3, + 0x1ee3, 0x1ee5, 0x1ee5, 0x1ee7, 0x1ee7, 0x1ee9, 0x1ee9, 0x1eeb, + 0x1eeb, 0x1eed, 0x1eed, 0x1eef, 0x1eef, 0x1ef1, 0x1ef1, 0x1ef3, + 0x1ef3, 0x1ef5, 0x1ef5, 0x1ef7, 0x1ef7, 0x1ef9, 0x1ef9, 0x1efb, + 0x1efb, 0x1efd, 0x1efd, 0x1eff, 0x1f07, 0x1f10, 0x1f15, 0x1f20, + 0x1f27, 0x1f30, 0x1f37, 0x1f40, 0x1f45, 0x1f50, 0x1f57, 0x1f60, + 0x1f67, 0x1f70, 0x1f7d, 0x1f80, 0x1f87, 0x1f90, 0x1f97, 0x1fa0, + 0x1fa7, 0x1fb0, 0x1fb4, 0x1fb6, 0x1fb7, 0x1fbe, 0x1fbe, 0x1fc2, + 0x1fc4, 0x1fc6, 0x1fc7, 0x1fd0, 0x1fd3, 0x1fd6, 0x1fd7, 0x1fe0, + 0x1fe7, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ff7, 0x2071, 0x2071, 0x207f, + 0x207f, 0x2090, 0x209c, 0x210a, 0x210a, 0x210e, 0x210f, 0x2113, + 0x2113, 0x212f, 0x212f, 0x2134, 0x2134, 0x2139, 0x2139, 0x213c, + 0x213d, 0x2146, 0x2149, 0x214e, 0x214e, 0x2170, 0x217f, 0x2184, + 0x2184, 0x24d0, 0x24e9, 0x2c30, 0x2c5e, 0x2c61, 0x2c61, 0x2c65, + 0x2c66, 0x2c68, 0x2c68, 0x2c6a, 0x2c6a, 0x2c6c, 0x2c6c, 0x2c71, + 0x2c71, 0x2c73, 0x2c74, 0x2c76, 0x2c7d, 0x2c81, 0x2c81, 0x2c83, + 0x2c83, 0x2c85, 0x2c85, 0x2c87, 0x2c87, 0x2c89, 0x2c89, 0x2c8b, + 0x2c8b, 0x2c8d, 0x2c8d, 0x2c8f, 0x2c8f, 0x2c91, 0x2c91, 0x2c93, + 0x2c93, 0x2c95, 0x2c95, 0x2c97, 0x2c97, 0x2c99, 0x2c99, 0x2c9b, + 0x2c9b, 0x2c9d, 0x2c9d, 0x2c9f, 0x2c9f, 0x2ca1, 0x2ca1, 0x2ca3, + 0x2ca3, 0x2ca5, 0x2ca5, 0x2ca7, 0x2ca7, 0x2ca9, 0x2ca9, 0x2cab, + 0x2cab, 0x2cad, 0x2cad, 0x2caf, 0x2caf, 0x2cb1, 0x2cb1, 0x2cb3, + 0x2cb3, 0x2cb5, 0x2cb5, 0x2cb7, 0x2cb7, 0x2cb9, 0x2cb9, 0x2cbb, + 0x2cbb, 0x2cbd, 0x2cbd, 0x2cbf, 0x2cbf, 0x2cc1, 0x2cc1, 0x2cc3, + 0x2cc3, 0x2cc5, 0x2cc5, 0x2cc7, 0x2cc7, 0x2cc9, 0x2cc9, 0x2ccb, + 0x2ccb, 0x2ccd, 0x2ccd, 0x2ccf, 0x2ccf, 0x2cd1, 0x2cd1, 0x2cd3, + 0x2cd3, 0x2cd5, 0x2cd5, 0x2cd7, 0x2cd7, 0x2cd9, 0x2cd9, 0x2cdb, + 0x2cdb, 0x2cdd, 0x2cdd, 0x2cdf, 0x2cdf, 0x2ce1, 0x2ce1, 0x2ce3, + 0x2ce4, 0x2cec, 0x2cec, 0x2cee, 0x2cee, 0x2cf3, 0x2cf3, 0x2d00, + 0x2d25, 0x2d27, 0x2d27, 0x2d2d, 0x2d2d, 0xa641, 0xa641, 0xa643, + 0xa643, 0xa645, 0xa645, 0xa647, 0xa647, 0xa649, 0xa649, 0xa64b, + 0xa64b, 0xa64d, 0xa64d, 0xa64f, 0xa64f, 0xa651, 0xa651, 0xa653, + 0xa653, 0xa655, 0xa655, 0xa657, 0xa657, 0xa659, 0xa659, 0xa65b, + 0xa65b, 0xa65d, 0xa65d, 0xa65f, 0xa65f, 0xa661, 0xa661, 0xa663, + 0xa663, 0xa665, 0xa665, 0xa667, 0xa667, 0xa669, 0xa669, 0xa66b, + 0xa66b, 0xa66d, 0xa66d, 0xa681, 0xa681, 0xa683, 0xa683, 0xa685, + 0xa685, 0xa687, 0xa687, 0xa689, 0xa689, 0xa68b, 0xa68b, 0xa68d, + 0xa68d, 0xa68f, 0xa68f, 0xa691, 0xa691, 0xa693, 0xa693, 0xa695, + 0xa695, 0xa697, 0xa697, 0xa699, 0xa699, 0xa69b, 0xa69d, 0xa723, + 0xa723, 0xa725, 0xa725, 0xa727, 0xa727, 0xa729, 0xa729, 0xa72b, + 0xa72b, 0xa72d, 0xa72d, 0xa72f, 0xa731, 0xa733, 0xa733, 0xa735, + 0xa735, 0xa737, 0xa737, 0xa739, 0xa739, 0xa73b, 0xa73b, 0xa73d, + 0xa73d, 0xa73f, 0xa73f, 0xa741, 0xa741, 0xa743, 0xa743, 0xa745, + 0xa745, 0xa747, 0xa747, 0xa749, 0xa749, 0xa74b, 0xa74b, 0xa74d, + 0xa74d, 0xa74f, 0xa74f, 0xa751, 0xa751, 0xa753, 0xa753, 0xa755, + 0xa755, 0xa757, 0xa757, 0xa759, 0xa759, 0xa75b, 0xa75b, 0xa75d, + 0xa75d, 0xa75f, 0xa75f, 0xa761, 0xa761, 0xa763, 0xa763, 0xa765, + 0xa765, 0xa767, 0xa767, 0xa769, 0xa769, 0xa76b, 0xa76b, 0xa76d, + 0xa76d, 0xa76f, 0xa778, 0xa77a, 0xa77a, 0xa77c, 0xa77c, 0xa77f, + 0xa77f, 0xa781, 0xa781, 0xa783, 0xa783, 0xa785, 0xa785, 0xa787, + 0xa787, 0xa78c, 0xa78c, 0xa78e, 0xa78e, 0xa791, 0xa791, 0xa793, + 0xa795, 0xa797, 0xa797, 0xa799, 0xa799, 0xa79b, 0xa79b, 0xa79d, + 0xa79d, 0xa79f, 0xa79f, 0xa7a1, 0xa7a1, 0xa7a3, 0xa7a3, 0xa7a5, + 0xa7a5, 0xa7a7, 0xa7a7, 0xa7a9, 0xa7a9, 0xa7b5, 0xa7b5, 0xa7b7, + 0xa7b7, 0xa7f8, 0xa7fa, 0xab30, 0xab5a, 0xab5c, 0xab65, 0xab70, + 0xabbf, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xff41, 0xff5a, 0x10428, + 0x1044f, 0x104d8, 0x104fb, 0x10cc0, 0x10cf2, 0x118c0, 0x118df, 0x1d41a, + 0x1d433, 0x1d44e, 0x1d454, 0x1d456, 0x1d467, 0x1d482, 0x1d49b, 0x1d4b6, + 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, 0x1d4cf, 0x1d4ea, + 0x1d503, 0x1d51e, 0x1d537, 0x1d552, 0x1d56b, 0x1d586, 0x1d59f, 0x1d5ba, + 0x1d5d3, 0x1d5ee, 0x1d607, 0x1d622, 0x1d63b, 0x1d656, 0x1d66f, 0x1d68a, + 0x1d6a5, 0x1d6c2, 0x1d6da, 0x1d6dc, 0x1d6e1, 0x1d6fc, 0x1d714, 0x1d716, + 0x1d71b, 0x1d736, 0x1d74e, 0x1d750, 0x1d755, 0x1d770, 0x1d788, 0x1d78a, + 0x1d78f, 0x1d7aa, 0x1d7c2, 0x1d7c4, 0x1d7c9, 0x1d7cb, 0x1d7cb, 0x1e922, + 0x1e943, +}; /* CR_Lower */ + +/* 'Print': [[:Print:]] */ +static const OnigCodePoint CR_Print[] = { + 640, 0x0020, 0x007e, 0x00a0, 0x0377, 0x037a, 0x037f, 0x0384, + 0x038a, 0x038c, 0x038c, 0x038e, 0x03a1, 0x03a3, 0x052f, 0x0531, + 0x0556, 0x0559, 0x055f, 0x0561, 0x0587, 0x0589, 0x058a, 0x058d, + 0x058f, 0x0591, 0x05c7, 0x05d0, 0x05ea, 0x05f0, 0x05f4, 0x0600, + 0x061c, 0x061e, 0x070d, 0x070f, 0x074a, 0x074d, 0x07b1, 0x07c0, + 0x07fa, 0x0800, 0x082d, 0x0830, 0x083e, 0x0840, 0x085b, 0x085e, + 0x085e, 0x08a0, 0x08b4, 0x08b6, 0x08bd, 0x08d4, 0x0983, 0x0985, + 0x098c, 0x098f, 0x0990, 0x0993, 0x09a8, 0x09aa, 0x09b0, 0x09b2, + 0x09b2, 0x09b6, 0x09b9, 0x09bc, 0x09c4, 0x09c7, 0x09c8, 0x09cb, + 0x09ce, 0x09d7, 0x09d7, 0x09dc, 0x09dd, 0x09df, 0x09e3, 0x09e6, + 0x09fb, 0x0a01, 0x0a03, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, + 0x0a28, 0x0a2a, 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, + 0x0a39, 0x0a3c, 0x0a3c, 0x0a3e, 0x0a42, 0x0a47, 0x0a48, 0x0a4b, + 0x0a4d, 0x0a51, 0x0a51, 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, + 0x0a75, 0x0a81, 0x0a83, 0x0a85, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, + 0x0aa8, 0x0aaa, 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, + 0x0ac5, 0x0ac7, 0x0ac9, 0x0acb, 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, + 0x0ae3, 0x0ae6, 0x0af1, 0x0af9, 0x0af9, 0x0b01, 0x0b03, 0x0b05, + 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, 0x0b28, 0x0b2a, 0x0b30, 0x0b32, + 0x0b33, 0x0b35, 0x0b39, 0x0b3c, 0x0b44, 0x0b47, 0x0b48, 0x0b4b, + 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, 0x0b5d, 0x0b5f, 0x0b63, 0x0b66, + 0x0b77, 0x0b82, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, + 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, + 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, + 0x0bc8, 0x0bca, 0x0bcd, 0x0bd0, 0x0bd0, 0x0bd7, 0x0bd7, 0x0be6, + 0x0bfa, 0x0c00, 0x0c03, 0x0c05, 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, + 0x0c28, 0x0c2a, 0x0c39, 0x0c3d, 0x0c44, 0x0c46, 0x0c48, 0x0c4a, + 0x0c4d, 0x0c55, 0x0c56, 0x0c58, 0x0c5a, 0x0c60, 0x0c63, 0x0c66, + 0x0c6f, 0x0c78, 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, + 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbc, 0x0cc4, 0x0cc6, + 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, + 0x0ce3, 0x0ce6, 0x0cef, 0x0cf1, 0x0cf2, 0x0d01, 0x0d03, 0x0d05, + 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d3a, 0x0d3d, 0x0d44, 0x0d46, + 0x0d48, 0x0d4a, 0x0d4f, 0x0d54, 0x0d63, 0x0d66, 0x0d7f, 0x0d82, + 0x0d83, 0x0d85, 0x0d96, 0x0d9a, 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, + 0x0dbd, 0x0dc0, 0x0dc6, 0x0dca, 0x0dca, 0x0dcf, 0x0dd4, 0x0dd6, + 0x0dd6, 0x0dd8, 0x0ddf, 0x0de6, 0x0def, 0x0df2, 0x0df4, 0x0e01, + 0x0e3a, 0x0e3f, 0x0e5b, 0x0e81, 0x0e82, 0x0e84, 0x0e84, 0x0e87, + 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, 0x0e97, 0x0e99, + 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, + 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, + 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, 0x0ed9, 0x0edc, 0x0edf, 0x0f00, + 0x0f47, 0x0f49, 0x0f6c, 0x0f71, 0x0f97, 0x0f99, 0x0fbc, 0x0fbe, + 0x0fcc, 0x0fce, 0x0fda, 0x1000, 0x10c5, 0x10c7, 0x10c7, 0x10cd, + 0x10cd, 0x10d0, 0x1248, 0x124a, 0x124d, 0x1250, 0x1256, 0x1258, + 0x1258, 0x125a, 0x125d, 0x1260, 0x1288, 0x128a, 0x128d, 0x1290, + 0x12b0, 0x12b2, 0x12b5, 0x12b8, 0x12be, 0x12c0, 0x12c0, 0x12c2, + 0x12c5, 0x12c8, 0x12d6, 0x12d8, 0x1310, 0x1312, 0x1315, 0x1318, + 0x135a, 0x135d, 0x137c, 0x1380, 0x1399, 0x13a0, 0x13f5, 0x13f8, + 0x13fd, 0x1400, 0x169c, 0x16a0, 0x16f8, 0x1700, 0x170c, 0x170e, + 0x1714, 0x1720, 0x1736, 0x1740, 0x1753, 0x1760, 0x176c, 0x176e, + 0x1770, 0x1772, 0x1773, 0x1780, 0x17dd, 0x17e0, 0x17e9, 0x17f0, + 0x17f9, 0x1800, 0x180e, 0x1810, 0x1819, 0x1820, 0x1877, 0x1880, + 0x18aa, 0x18b0, 0x18f5, 0x1900, 0x191e, 0x1920, 0x192b, 0x1930, + 0x193b, 0x1940, 0x1940, 0x1944, 0x196d, 0x1970, 0x1974, 0x1980, + 0x19ab, 0x19b0, 0x19c9, 0x19d0, 0x19da, 0x19de, 0x1a1b, 0x1a1e, + 0x1a5e, 0x1a60, 0x1a7c, 0x1a7f, 0x1a89, 0x1a90, 0x1a99, 0x1aa0, + 0x1aad, 0x1ab0, 0x1abe, 0x1b00, 0x1b4b, 0x1b50, 0x1b7c, 0x1b80, + 0x1bf3, 0x1bfc, 0x1c37, 0x1c3b, 0x1c49, 0x1c4d, 0x1c88, 0x1cc0, + 0x1cc7, 0x1cd0, 0x1cf6, 0x1cf8, 0x1cf9, 0x1d00, 0x1df5, 0x1dfb, + 0x1f15, 0x1f18, 0x1f1d, 0x1f20, 0x1f45, 0x1f48, 0x1f4d, 0x1f50, + 0x1f57, 0x1f59, 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, + 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, 0x1fc4, 0x1fc6, 0x1fd3, 0x1fd6, + 0x1fdb, 0x1fdd, 0x1fef, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ffe, 0x2000, + 0x2027, 0x202a, 0x2064, 0x2066, 0x2071, 0x2074, 0x208e, 0x2090, + 0x209c, 0x20a0, 0x20be, 0x20d0, 0x20f0, 0x2100, 0x218b, 0x2190, + 0x23fe, 0x2400, 0x2426, 0x2440, 0x244a, 0x2460, 0x2b73, 0x2b76, + 0x2b95, 0x2b98, 0x2bb9, 0x2bbd, 0x2bc8, 0x2bca, 0x2bd1, 0x2bec, + 0x2bef, 0x2c00, 0x2c2e, 0x2c30, 0x2c5e, 0x2c60, 0x2cf3, 0x2cf9, + 0x2d25, 0x2d27, 0x2d27, 0x2d2d, 0x2d2d, 0x2d30, 0x2d67, 0x2d6f, + 0x2d70, 0x2d7f, 0x2d96, 0x2da0, 0x2da6, 0x2da8, 0x2dae, 0x2db0, + 0x2db6, 0x2db8, 0x2dbe, 0x2dc0, 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, + 0x2dd6, 0x2dd8, 0x2dde, 0x2de0, 0x2e44, 0x2e80, 0x2e99, 0x2e9b, + 0x2ef3, 0x2f00, 0x2fd5, 0x2ff0, 0x2ffb, 0x3000, 0x303f, 0x3041, + 0x3096, 0x3099, 0x30ff, 0x3105, 0x312d, 0x3131, 0x318e, 0x3190, + 0x31ba, 0x31c0, 0x31e3, 0x31f0, 0x321e, 0x3220, 0x32fe, 0x3300, + 0x4db5, 0x4dc0, 0x9fd5, 0xa000, 0xa48c, 0xa490, 0xa4c6, 0xa4d0, + 0xa62b, 0xa640, 0xa6f7, 0xa700, 0xa7ae, 0xa7b0, 0xa7b7, 0xa7f7, + 0xa82b, 0xa830, 0xa839, 0xa840, 0xa877, 0xa880, 0xa8c5, 0xa8ce, + 0xa8d9, 0xa8e0, 0xa8fd, 0xa900, 0xa953, 0xa95f, 0xa97c, 0xa980, + 0xa9cd, 0xa9cf, 0xa9d9, 0xa9de, 0xa9fe, 0xaa00, 0xaa36, 0xaa40, + 0xaa4d, 0xaa50, 0xaa59, 0xaa5c, 0xaac2, 0xaadb, 0xaaf6, 0xab01, + 0xab06, 0xab09, 0xab0e, 0xab11, 0xab16, 0xab20, 0xab26, 0xab28, + 0xab2e, 0xab30, 0xab65, 0xab70, 0xabed, 0xabf0, 0xabf9, 0xac00, + 0xd7a3, 0xd7b0, 0xd7c6, 0xd7cb, 0xd7fb, 0xe000, 0xfa6d, 0xfa70, + 0xfad9, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xfb1d, 0xfb36, 0xfb38, + 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, + 0xfbc1, 0xfbd3, 0xfd3f, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdf0, + 0xfdfd, 0xfe00, 0xfe19, 0xfe20, 0xfe52, 0xfe54, 0xfe66, 0xfe68, + 0xfe6b, 0xfe70, 0xfe74, 0xfe76, 0xfefc, 0xfeff, 0xfeff, 0xff01, + 0xffbe, 0xffc2, 0xffc7, 0xffca, 0xffcf, 0xffd2, 0xffd7, 0xffda, + 0xffdc, 0xffe0, 0xffe6, 0xffe8, 0xffee, 0xfff9, 0xfffd, 0x10000, + 0x1000b, 0x1000d, 0x10026, 0x10028, 0x1003a, 0x1003c, 0x1003d, 0x1003f, + 0x1004d, 0x10050, 0x1005d, 0x10080, 0x100fa, 0x10100, 0x10102, 0x10107, + 0x10133, 0x10137, 0x1018e, 0x10190, 0x1019b, 0x101a0, 0x101a0, 0x101d0, + 0x101fd, 0x10280, 0x1029c, 0x102a0, 0x102d0, 0x102e0, 0x102fb, 0x10300, + 0x10323, 0x10330, 0x1034a, 0x10350, 0x1037a, 0x10380, 0x1039d, 0x1039f, + 0x103c3, 0x103c8, 0x103d5, 0x10400, 0x1049d, 0x104a0, 0x104a9, 0x104b0, + 0x104d3, 0x104d8, 0x104fb, 0x10500, 0x10527, 0x10530, 0x10563, 0x1056f, + 0x1056f, 0x10600, 0x10736, 0x10740, 0x10755, 0x10760, 0x10767, 0x10800, + 0x10805, 0x10808, 0x10808, 0x1080a, 0x10835, 0x10837, 0x10838, 0x1083c, + 0x1083c, 0x1083f, 0x10855, 0x10857, 0x1089e, 0x108a7, 0x108af, 0x108e0, + 0x108f2, 0x108f4, 0x108f5, 0x108fb, 0x1091b, 0x1091f, 0x10939, 0x1093f, + 0x1093f, 0x10980, 0x109b7, 0x109bc, 0x109cf, 0x109d2, 0x10a03, 0x10a05, + 0x10a06, 0x10a0c, 0x10a13, 0x10a15, 0x10a17, 0x10a19, 0x10a33, 0x10a38, + 0x10a3a, 0x10a3f, 0x10a47, 0x10a50, 0x10a58, 0x10a60, 0x10a9f, 0x10ac0, + 0x10ae6, 0x10aeb, 0x10af6, 0x10b00, 0x10b35, 0x10b39, 0x10b55, 0x10b58, + 0x10b72, 0x10b78, 0x10b91, 0x10b99, 0x10b9c, 0x10ba9, 0x10baf, 0x10c00, + 0x10c48, 0x10c80, 0x10cb2, 0x10cc0, 0x10cf2, 0x10cfa, 0x10cff, 0x10e60, + 0x10e7e, 0x11000, 0x1104d, 0x11052, 0x1106f, 0x1107f, 0x110c1, 0x110d0, + 0x110e8, 0x110f0, 0x110f9, 0x11100, 0x11134, 0x11136, 0x11143, 0x11150, + 0x11176, 0x11180, 0x111cd, 0x111d0, 0x111df, 0x111e1, 0x111f4, 0x11200, + 0x11211, 0x11213, 0x1123e, 0x11280, 0x11286, 0x11288, 0x11288, 0x1128a, + 0x1128d, 0x1128f, 0x1129d, 0x1129f, 0x112a9, 0x112b0, 0x112ea, 0x112f0, + 0x112f9, 0x11300, 0x11303, 0x11305, 0x1130c, 0x1130f, 0x11310, 0x11313, + 0x11328, 0x1132a, 0x11330, 0x11332, 0x11333, 0x11335, 0x11339, 0x1133c, + 0x11344, 0x11347, 0x11348, 0x1134b, 0x1134d, 0x11350, 0x11350, 0x11357, + 0x11357, 0x1135d, 0x11363, 0x11366, 0x1136c, 0x11370, 0x11374, 0x11400, + 0x11459, 0x1145b, 0x1145b, 0x1145d, 0x1145d, 0x11480, 0x114c7, 0x114d0, + 0x114d9, 0x11580, 0x115b5, 0x115b8, 0x115dd, 0x11600, 0x11644, 0x11650, + 0x11659, 0x11660, 0x1166c, 0x11680, 0x116b7, 0x116c0, 0x116c9, 0x11700, + 0x11719, 0x1171d, 0x1172b, 0x11730, 0x1173f, 0x118a0, 0x118f2, 0x118ff, + 0x118ff, 0x11ac0, 0x11af8, 0x11c00, 0x11c08, 0x11c0a, 0x11c36, 0x11c38, + 0x11c45, 0x11c50, 0x11c6c, 0x11c70, 0x11c8f, 0x11c92, 0x11ca7, 0x11ca9, + 0x11cb6, 0x12000, 0x12399, 0x12400, 0x1246e, 0x12470, 0x12474, 0x12480, + 0x12543, 0x13000, 0x1342e, 0x14400, 0x14646, 0x16800, 0x16a38, 0x16a40, + 0x16a5e, 0x16a60, 0x16a69, 0x16a6e, 0x16a6f, 0x16ad0, 0x16aed, 0x16af0, + 0x16af5, 0x16b00, 0x16b45, 0x16b50, 0x16b59, 0x16b5b, 0x16b61, 0x16b63, + 0x16b77, 0x16b7d, 0x16b8f, 0x16f00, 0x16f44, 0x16f50, 0x16f7e, 0x16f8f, + 0x16f9f, 0x16fe0, 0x16fe0, 0x17000, 0x187ec, 0x18800, 0x18af2, 0x1b000, + 0x1b001, 0x1bc00, 0x1bc6a, 0x1bc70, 0x1bc7c, 0x1bc80, 0x1bc88, 0x1bc90, + 0x1bc99, 0x1bc9c, 0x1bca3, 0x1d000, 0x1d0f5, 0x1d100, 0x1d126, 0x1d129, + 0x1d1e8, 0x1d200, 0x1d245, 0x1d300, 0x1d356, 0x1d360, 0x1d371, 0x1d400, + 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, + 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, + 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, + 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, 0x1d544, 0x1d546, + 0x1d546, 0x1d54a, 0x1d550, 0x1d552, 0x1d6a5, 0x1d6a8, 0x1d7cb, 0x1d7ce, + 0x1da8b, 0x1da9b, 0x1da9f, 0x1daa1, 0x1daaf, 0x1e000, 0x1e006, 0x1e008, + 0x1e018, 0x1e01b, 0x1e021, 0x1e023, 0x1e024, 0x1e026, 0x1e02a, 0x1e800, + 0x1e8c4, 0x1e8c7, 0x1e8d6, 0x1e900, 0x1e94a, 0x1e950, 0x1e959, 0x1e95e, + 0x1e95f, 0x1ee00, 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, 0x1ee22, 0x1ee24, + 0x1ee24, 0x1ee27, 0x1ee27, 0x1ee29, 0x1ee32, 0x1ee34, 0x1ee37, 0x1ee39, + 0x1ee39, 0x1ee3b, 0x1ee3b, 0x1ee42, 0x1ee42, 0x1ee47, 0x1ee47, 0x1ee49, + 0x1ee49, 0x1ee4b, 0x1ee4b, 0x1ee4d, 0x1ee4f, 0x1ee51, 0x1ee52, 0x1ee54, + 0x1ee54, 0x1ee57, 0x1ee57, 0x1ee59, 0x1ee59, 0x1ee5b, 0x1ee5b, 0x1ee5d, + 0x1ee5d, 0x1ee5f, 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, 0x1ee64, 0x1ee67, + 0x1ee6a, 0x1ee6c, 0x1ee72, 0x1ee74, 0x1ee77, 0x1ee79, 0x1ee7c, 0x1ee7e, + 0x1ee7e, 0x1ee80, 0x1ee89, 0x1ee8b, 0x1ee9b, 0x1eea1, 0x1eea3, 0x1eea5, + 0x1eea9, 0x1eeab, 0x1eebb, 0x1eef0, 0x1eef1, 0x1f000, 0x1f02b, 0x1f030, + 0x1f093, 0x1f0a0, 0x1f0ae, 0x1f0b1, 0x1f0bf, 0x1f0c1, 0x1f0cf, 0x1f0d1, + 0x1f0f5, 0x1f100, 0x1f10c, 0x1f110, 0x1f12e, 0x1f130, 0x1f16b, 0x1f170, + 0x1f1ac, 0x1f1e6, 0x1f202, 0x1f210, 0x1f23b, 0x1f240, 0x1f248, 0x1f250, + 0x1f251, 0x1f300, 0x1f6d2, 0x1f6e0, 0x1f6ec, 0x1f6f0, 0x1f6f6, 0x1f700, + 0x1f773, 0x1f780, 0x1f7d4, 0x1f800, 0x1f80b, 0x1f810, 0x1f847, 0x1f850, + 0x1f859, 0x1f860, 0x1f887, 0x1f890, 0x1f8ad, 0x1f910, 0x1f91e, 0x1f920, + 0x1f927, 0x1f930, 0x1f930, 0x1f933, 0x1f93e, 0x1f940, 0x1f94b, 0x1f950, + 0x1f95e, 0x1f980, 0x1f991, 0x1f9c0, 0x1f9c0, 0x20000, 0x2a6d6, 0x2a700, + 0x2b734, 0x2b740, 0x2b81d, 0x2b820, 0x2cea1, 0x2f800, 0x2fa1d, 0xe0001, + 0xe0001, 0xe0020, 0xe007f, 0xe0100, 0xe01ef, 0xf0000, 0xffffd, 0x100000, + 0x10fffd, +}; /* CR_Print */ + +/* 'XPosixPunct': [[:Punct:]] */ +static const OnigCodePoint CR_XPosixPunct[] = { + 163, 0x0021, 0x002f, 0x003a, 0x0040, 0x005b, 0x0060, 0x007b, + 0x007e, 0x00a1, 0x00a1, 0x00a7, 0x00a7, 0x00ab, 0x00ab, 0x00b6, + 0x00b7, 0x00bb, 0x00bb, 0x00bf, 0x00bf, 0x037e, 0x037e, 0x0387, + 0x0387, 0x055a, 0x055f, 0x0589, 0x058a, 0x05be, 0x05be, 0x05c0, + 0x05c0, 0x05c3, 0x05c3, 0x05c6, 0x05c6, 0x05f3, 0x05f4, 0x0609, + 0x060a, 0x060c, 0x060d, 0x061b, 0x061b, 0x061e, 0x061f, 0x066a, + 0x066d, 0x06d4, 0x06d4, 0x0700, 0x070d, 0x07f7, 0x07f9, 0x0830, + 0x083e, 0x085e, 0x085e, 0x0964, 0x0965, 0x0970, 0x0970, 0x0af0, + 0x0af0, 0x0df4, 0x0df4, 0x0e4f, 0x0e4f, 0x0e5a, 0x0e5b, 0x0f04, + 0x0f12, 0x0f14, 0x0f14, 0x0f3a, 0x0f3d, 0x0f85, 0x0f85, 0x0fd0, + 0x0fd4, 0x0fd9, 0x0fda, 0x104a, 0x104f, 0x10fb, 0x10fb, 0x1360, + 0x1368, 0x1400, 0x1400, 0x166d, 0x166e, 0x169b, 0x169c, 0x16eb, + 0x16ed, 0x1735, 0x1736, 0x17d4, 0x17d6, 0x17d8, 0x17da, 0x1800, + 0x180a, 0x1944, 0x1945, 0x1a1e, 0x1a1f, 0x1aa0, 0x1aa6, 0x1aa8, + 0x1aad, 0x1b5a, 0x1b60, 0x1bfc, 0x1bff, 0x1c3b, 0x1c3f, 0x1c7e, + 0x1c7f, 0x1cc0, 0x1cc7, 0x1cd3, 0x1cd3, 0x2010, 0x2027, 0x2030, + 0x2043, 0x2045, 0x2051, 0x2053, 0x205e, 0x207d, 0x207e, 0x208d, + 0x208e, 0x2308, 0x230b, 0x2329, 0x232a, 0x2768, 0x2775, 0x27c5, + 0x27c6, 0x27e6, 0x27ef, 0x2983, 0x2998, 0x29d8, 0x29db, 0x29fc, + 0x29fd, 0x2cf9, 0x2cfc, 0x2cfe, 0x2cff, 0x2d70, 0x2d70, 0x2e00, + 0x2e2e, 0x2e30, 0x2e44, 0x3001, 0x3003, 0x3008, 0x3011, 0x3014, + 0x301f, 0x3030, 0x3030, 0x303d, 0x303d, 0x30a0, 0x30a0, 0x30fb, + 0x30fb, 0xa4fe, 0xa4ff, 0xa60d, 0xa60f, 0xa673, 0xa673, 0xa67e, + 0xa67e, 0xa6f2, 0xa6f7, 0xa874, 0xa877, 0xa8ce, 0xa8cf, 0xa8f8, + 0xa8fa, 0xa8fc, 0xa8fc, 0xa92e, 0xa92f, 0xa95f, 0xa95f, 0xa9c1, + 0xa9cd, 0xa9de, 0xa9df, 0xaa5c, 0xaa5f, 0xaade, 0xaadf, 0xaaf0, + 0xaaf1, 0xabeb, 0xabeb, 0xfd3e, 0xfd3f, 0xfe10, 0xfe19, 0xfe30, + 0xfe52, 0xfe54, 0xfe61, 0xfe63, 0xfe63, 0xfe68, 0xfe68, 0xfe6a, + 0xfe6b, 0xff01, 0xff03, 0xff05, 0xff0a, 0xff0c, 0xff0f, 0xff1a, + 0xff1b, 0xff1f, 0xff20, 0xff3b, 0xff3d, 0xff3f, 0xff3f, 0xff5b, + 0xff5b, 0xff5d, 0xff5d, 0xff5f, 0xff65, 0x10100, 0x10102, 0x1039f, + 0x1039f, 0x103d0, 0x103d0, 0x1056f, 0x1056f, 0x10857, 0x10857, 0x1091f, + 0x1091f, 0x1093f, 0x1093f, 0x10a50, 0x10a58, 0x10a7f, 0x10a7f, 0x10af0, + 0x10af6, 0x10b39, 0x10b3f, 0x10b99, 0x10b9c, 0x11047, 0x1104d, 0x110bb, + 0x110bc, 0x110be, 0x110c1, 0x11140, 0x11143, 0x11174, 0x11175, 0x111c5, + 0x111c9, 0x111cd, 0x111cd, 0x111db, 0x111db, 0x111dd, 0x111df, 0x11238, + 0x1123d, 0x112a9, 0x112a9, 0x1144b, 0x1144f, 0x1145b, 0x1145b, 0x1145d, + 0x1145d, 0x114c6, 0x114c6, 0x115c1, 0x115d7, 0x11641, 0x11643, 0x11660, + 0x1166c, 0x1173c, 0x1173e, 0x11c41, 0x11c45, 0x11c70, 0x11c71, 0x12470, + 0x12474, 0x16a6e, 0x16a6f, 0x16af5, 0x16af5, 0x16b37, 0x16b3b, 0x16b44, + 0x16b44, 0x1bc9f, 0x1bc9f, 0x1da87, 0x1da8b, 0x1e95e, 0x1e95f, +}; /* CR_XPosixPunct */ + +/* 'Space': [[:Space:]] */ +static const OnigCodePoint CR_Space[] = { + 10, 0x0009, 0x000d, 0x0020, 0x0020, 0x0085, 0x0085, + 0x00a0, 0x00a0, 0x1680, 0x1680, 0x2000, 0x200a, 0x2028, + 0x2029, 0x202f, 0x202f, 0x205f, 0x205f, 0x3000, 0x3000, +}; /* CR_Space */ + +/* 'Upper': [[:Upper:]] */ +static const OnigCodePoint CR_Upper[] = { + 632, 0x0041, 0x005a, 0x00c0, 0x00d6, 0x00d8, 0x00de, 0x0100, + 0x0100, 0x0102, 0x0102, 0x0104, 0x0104, 0x0106, 0x0106, 0x0108, + 0x0108, 0x010a, 0x010a, 0x010c, 0x010c, 0x010e, 0x010e, 0x0110, + 0x0110, 0x0112, 0x0112, 0x0114, 0x0114, 0x0116, 0x0116, 0x0118, + 0x0118, 0x011a, 0x011a, 0x011c, 0x011c, 0x011e, 0x011e, 0x0120, + 0x0120, 0x0122, 0x0122, 0x0124, 0x0124, 0x0126, 0x0126, 0x0128, + 0x0128, 0x012a, 0x012a, 0x012c, 0x012c, 0x012e, 0x012e, 0x0130, + 0x0130, 0x0132, 0x0132, 0x0134, 0x0134, 0x0136, 0x0136, 0x0139, + 0x0139, 0x013b, 0x013b, 0x013d, 0x013d, 0x013f, 0x013f, 0x0141, + 0x0141, 0x0143, 0x0143, 0x0145, 0x0145, 0x0147, 0x0147, 0x014a, + 0x014a, 0x014c, 0x014c, 0x014e, 0x014e, 0x0150, 0x0150, 0x0152, + 0x0152, 0x0154, 0x0154, 0x0156, 0x0156, 0x0158, 0x0158, 0x015a, + 0x015a, 0x015c, 0x015c, 0x015e, 0x015e, 0x0160, 0x0160, 0x0162, + 0x0162, 0x0164, 0x0164, 0x0166, 0x0166, 0x0168, 0x0168, 0x016a, + 0x016a, 0x016c, 0x016c, 0x016e, 0x016e, 0x0170, 0x0170, 0x0172, + 0x0172, 0x0174, 0x0174, 0x0176, 0x0176, 0x0178, 0x0179, 0x017b, + 0x017b, 0x017d, 0x017d, 0x0181, 0x0182, 0x0184, 0x0184, 0x0186, + 0x0187, 0x0189, 0x018b, 0x018e, 0x0191, 0x0193, 0x0194, 0x0196, + 0x0198, 0x019c, 0x019d, 0x019f, 0x01a0, 0x01a2, 0x01a2, 0x01a4, + 0x01a4, 0x01a6, 0x01a7, 0x01a9, 0x01a9, 0x01ac, 0x01ac, 0x01ae, + 0x01af, 0x01b1, 0x01b3, 0x01b5, 0x01b5, 0x01b7, 0x01b8, 0x01bc, + 0x01bc, 0x01c4, 0x01c4, 0x01c7, 0x01c7, 0x01ca, 0x01ca, 0x01cd, + 0x01cd, 0x01cf, 0x01cf, 0x01d1, 0x01d1, 0x01d3, 0x01d3, 0x01d5, + 0x01d5, 0x01d7, 0x01d7, 0x01d9, 0x01d9, 0x01db, 0x01db, 0x01de, + 0x01de, 0x01e0, 0x01e0, 0x01e2, 0x01e2, 0x01e4, 0x01e4, 0x01e6, + 0x01e6, 0x01e8, 0x01e8, 0x01ea, 0x01ea, 0x01ec, 0x01ec, 0x01ee, + 0x01ee, 0x01f1, 0x01f1, 0x01f4, 0x01f4, 0x01f6, 0x01f8, 0x01fa, + 0x01fa, 0x01fc, 0x01fc, 0x01fe, 0x01fe, 0x0200, 0x0200, 0x0202, + 0x0202, 0x0204, 0x0204, 0x0206, 0x0206, 0x0208, 0x0208, 0x020a, + 0x020a, 0x020c, 0x020c, 0x020e, 0x020e, 0x0210, 0x0210, 0x0212, + 0x0212, 0x0214, 0x0214, 0x0216, 0x0216, 0x0218, 0x0218, 0x021a, + 0x021a, 0x021c, 0x021c, 0x021e, 0x021e, 0x0220, 0x0220, 0x0222, + 0x0222, 0x0224, 0x0224, 0x0226, 0x0226, 0x0228, 0x0228, 0x022a, + 0x022a, 0x022c, 0x022c, 0x022e, 0x022e, 0x0230, 0x0230, 0x0232, + 0x0232, 0x023a, 0x023b, 0x023d, 0x023e, 0x0241, 0x0241, 0x0243, + 0x0246, 0x0248, 0x0248, 0x024a, 0x024a, 0x024c, 0x024c, 0x024e, + 0x024e, 0x0370, 0x0370, 0x0372, 0x0372, 0x0376, 0x0376, 0x037f, + 0x037f, 0x0386, 0x0386, 0x0388, 0x038a, 0x038c, 0x038c, 0x038e, + 0x038f, 0x0391, 0x03a1, 0x03a3, 0x03ab, 0x03cf, 0x03cf, 0x03d2, + 0x03d4, 0x03d8, 0x03d8, 0x03da, 0x03da, 0x03dc, 0x03dc, 0x03de, + 0x03de, 0x03e0, 0x03e0, 0x03e2, 0x03e2, 0x03e4, 0x03e4, 0x03e6, + 0x03e6, 0x03e8, 0x03e8, 0x03ea, 0x03ea, 0x03ec, 0x03ec, 0x03ee, + 0x03ee, 0x03f4, 0x03f4, 0x03f7, 0x03f7, 0x03f9, 0x03fa, 0x03fd, + 0x042f, 0x0460, 0x0460, 0x0462, 0x0462, 0x0464, 0x0464, 0x0466, + 0x0466, 0x0468, 0x0468, 0x046a, 0x046a, 0x046c, 0x046c, 0x046e, + 0x046e, 0x0470, 0x0470, 0x0472, 0x0472, 0x0474, 0x0474, 0x0476, + 0x0476, 0x0478, 0x0478, 0x047a, 0x047a, 0x047c, 0x047c, 0x047e, + 0x047e, 0x0480, 0x0480, 0x048a, 0x048a, 0x048c, 0x048c, 0x048e, + 0x048e, 0x0490, 0x0490, 0x0492, 0x0492, 0x0494, 0x0494, 0x0496, + 0x0496, 0x0498, 0x0498, 0x049a, 0x049a, 0x049c, 0x049c, 0x049e, + 0x049e, 0x04a0, 0x04a0, 0x04a2, 0x04a2, 0x04a4, 0x04a4, 0x04a6, + 0x04a6, 0x04a8, 0x04a8, 0x04aa, 0x04aa, 0x04ac, 0x04ac, 0x04ae, + 0x04ae, 0x04b0, 0x04b0, 0x04b2, 0x04b2, 0x04b4, 0x04b4, 0x04b6, + 0x04b6, 0x04b8, 0x04b8, 0x04ba, 0x04ba, 0x04bc, 0x04bc, 0x04be, + 0x04be, 0x04c0, 0x04c1, 0x04c3, 0x04c3, 0x04c5, 0x04c5, 0x04c7, + 0x04c7, 0x04c9, 0x04c9, 0x04cb, 0x04cb, 0x04cd, 0x04cd, 0x04d0, + 0x04d0, 0x04d2, 0x04d2, 0x04d4, 0x04d4, 0x04d6, 0x04d6, 0x04d8, + 0x04d8, 0x04da, 0x04da, 0x04dc, 0x04dc, 0x04de, 0x04de, 0x04e0, + 0x04e0, 0x04e2, 0x04e2, 0x04e4, 0x04e4, 0x04e6, 0x04e6, 0x04e8, + 0x04e8, 0x04ea, 0x04ea, 0x04ec, 0x04ec, 0x04ee, 0x04ee, 0x04f0, + 0x04f0, 0x04f2, 0x04f2, 0x04f4, 0x04f4, 0x04f6, 0x04f6, 0x04f8, + 0x04f8, 0x04fa, 0x04fa, 0x04fc, 0x04fc, 0x04fe, 0x04fe, 0x0500, + 0x0500, 0x0502, 0x0502, 0x0504, 0x0504, 0x0506, 0x0506, 0x0508, + 0x0508, 0x050a, 0x050a, 0x050c, 0x050c, 0x050e, 0x050e, 0x0510, + 0x0510, 0x0512, 0x0512, 0x0514, 0x0514, 0x0516, 0x0516, 0x0518, + 0x0518, 0x051a, 0x051a, 0x051c, 0x051c, 0x051e, 0x051e, 0x0520, + 0x0520, 0x0522, 0x0522, 0x0524, 0x0524, 0x0526, 0x0526, 0x0528, + 0x0528, 0x052a, 0x052a, 0x052c, 0x052c, 0x052e, 0x052e, 0x0531, + 0x0556, 0x10a0, 0x10c5, 0x10c7, 0x10c7, 0x10cd, 0x10cd, 0x13a0, + 0x13f5, 0x1e00, 0x1e00, 0x1e02, 0x1e02, 0x1e04, 0x1e04, 0x1e06, + 0x1e06, 0x1e08, 0x1e08, 0x1e0a, 0x1e0a, 0x1e0c, 0x1e0c, 0x1e0e, + 0x1e0e, 0x1e10, 0x1e10, 0x1e12, 0x1e12, 0x1e14, 0x1e14, 0x1e16, + 0x1e16, 0x1e18, 0x1e18, 0x1e1a, 0x1e1a, 0x1e1c, 0x1e1c, 0x1e1e, + 0x1e1e, 0x1e20, 0x1e20, 0x1e22, 0x1e22, 0x1e24, 0x1e24, 0x1e26, + 0x1e26, 0x1e28, 0x1e28, 0x1e2a, 0x1e2a, 0x1e2c, 0x1e2c, 0x1e2e, + 0x1e2e, 0x1e30, 0x1e30, 0x1e32, 0x1e32, 0x1e34, 0x1e34, 0x1e36, + 0x1e36, 0x1e38, 0x1e38, 0x1e3a, 0x1e3a, 0x1e3c, 0x1e3c, 0x1e3e, + 0x1e3e, 0x1e40, 0x1e40, 0x1e42, 0x1e42, 0x1e44, 0x1e44, 0x1e46, + 0x1e46, 0x1e48, 0x1e48, 0x1e4a, 0x1e4a, 0x1e4c, 0x1e4c, 0x1e4e, + 0x1e4e, 0x1e50, 0x1e50, 0x1e52, 0x1e52, 0x1e54, 0x1e54, 0x1e56, + 0x1e56, 0x1e58, 0x1e58, 0x1e5a, 0x1e5a, 0x1e5c, 0x1e5c, 0x1e5e, + 0x1e5e, 0x1e60, 0x1e60, 0x1e62, 0x1e62, 0x1e64, 0x1e64, 0x1e66, + 0x1e66, 0x1e68, 0x1e68, 0x1e6a, 0x1e6a, 0x1e6c, 0x1e6c, 0x1e6e, + 0x1e6e, 0x1e70, 0x1e70, 0x1e72, 0x1e72, 0x1e74, 0x1e74, 0x1e76, + 0x1e76, 0x1e78, 0x1e78, 0x1e7a, 0x1e7a, 0x1e7c, 0x1e7c, 0x1e7e, + 0x1e7e, 0x1e80, 0x1e80, 0x1e82, 0x1e82, 0x1e84, 0x1e84, 0x1e86, + 0x1e86, 0x1e88, 0x1e88, 0x1e8a, 0x1e8a, 0x1e8c, 0x1e8c, 0x1e8e, + 0x1e8e, 0x1e90, 0x1e90, 0x1e92, 0x1e92, 0x1e94, 0x1e94, 0x1e9e, + 0x1e9e, 0x1ea0, 0x1ea0, 0x1ea2, 0x1ea2, 0x1ea4, 0x1ea4, 0x1ea6, + 0x1ea6, 0x1ea8, 0x1ea8, 0x1eaa, 0x1eaa, 0x1eac, 0x1eac, 0x1eae, + 0x1eae, 0x1eb0, 0x1eb0, 0x1eb2, 0x1eb2, 0x1eb4, 0x1eb4, 0x1eb6, + 0x1eb6, 0x1eb8, 0x1eb8, 0x1eba, 0x1eba, 0x1ebc, 0x1ebc, 0x1ebe, + 0x1ebe, 0x1ec0, 0x1ec0, 0x1ec2, 0x1ec2, 0x1ec4, 0x1ec4, 0x1ec6, + 0x1ec6, 0x1ec8, 0x1ec8, 0x1eca, 0x1eca, 0x1ecc, 0x1ecc, 0x1ece, + 0x1ece, 0x1ed0, 0x1ed0, 0x1ed2, 0x1ed2, 0x1ed4, 0x1ed4, 0x1ed6, + 0x1ed6, 0x1ed8, 0x1ed8, 0x1eda, 0x1eda, 0x1edc, 0x1edc, 0x1ede, + 0x1ede, 0x1ee0, 0x1ee0, 0x1ee2, 0x1ee2, 0x1ee4, 0x1ee4, 0x1ee6, + 0x1ee6, 0x1ee8, 0x1ee8, 0x1eea, 0x1eea, 0x1eec, 0x1eec, 0x1eee, + 0x1eee, 0x1ef0, 0x1ef0, 0x1ef2, 0x1ef2, 0x1ef4, 0x1ef4, 0x1ef6, + 0x1ef6, 0x1ef8, 0x1ef8, 0x1efa, 0x1efa, 0x1efc, 0x1efc, 0x1efe, + 0x1efe, 0x1f08, 0x1f0f, 0x1f18, 0x1f1d, 0x1f28, 0x1f2f, 0x1f38, + 0x1f3f, 0x1f48, 0x1f4d, 0x1f59, 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, + 0x1f5d, 0x1f5f, 0x1f5f, 0x1f68, 0x1f6f, 0x1fb8, 0x1fbb, 0x1fc8, + 0x1fcb, 0x1fd8, 0x1fdb, 0x1fe8, 0x1fec, 0x1ff8, 0x1ffb, 0x2102, + 0x2102, 0x2107, 0x2107, 0x210b, 0x210d, 0x2110, 0x2112, 0x2115, + 0x2115, 0x2119, 0x211d, 0x2124, 0x2124, 0x2126, 0x2126, 0x2128, + 0x2128, 0x212a, 0x212d, 0x2130, 0x2133, 0x213e, 0x213f, 0x2145, + 0x2145, 0x2160, 0x216f, 0x2183, 0x2183, 0x24b6, 0x24cf, 0x2c00, + 0x2c2e, 0x2c60, 0x2c60, 0x2c62, 0x2c64, 0x2c67, 0x2c67, 0x2c69, + 0x2c69, 0x2c6b, 0x2c6b, 0x2c6d, 0x2c70, 0x2c72, 0x2c72, 0x2c75, + 0x2c75, 0x2c7e, 0x2c80, 0x2c82, 0x2c82, 0x2c84, 0x2c84, 0x2c86, + 0x2c86, 0x2c88, 0x2c88, 0x2c8a, 0x2c8a, 0x2c8c, 0x2c8c, 0x2c8e, + 0x2c8e, 0x2c90, 0x2c90, 0x2c92, 0x2c92, 0x2c94, 0x2c94, 0x2c96, + 0x2c96, 0x2c98, 0x2c98, 0x2c9a, 0x2c9a, 0x2c9c, 0x2c9c, 0x2c9e, + 0x2c9e, 0x2ca0, 0x2ca0, 0x2ca2, 0x2ca2, 0x2ca4, 0x2ca4, 0x2ca6, + 0x2ca6, 0x2ca8, 0x2ca8, 0x2caa, 0x2caa, 0x2cac, 0x2cac, 0x2cae, + 0x2cae, 0x2cb0, 0x2cb0, 0x2cb2, 0x2cb2, 0x2cb4, 0x2cb4, 0x2cb6, + 0x2cb6, 0x2cb8, 0x2cb8, 0x2cba, 0x2cba, 0x2cbc, 0x2cbc, 0x2cbe, + 0x2cbe, 0x2cc0, 0x2cc0, 0x2cc2, 0x2cc2, 0x2cc4, 0x2cc4, 0x2cc6, + 0x2cc6, 0x2cc8, 0x2cc8, 0x2cca, 0x2cca, 0x2ccc, 0x2ccc, 0x2cce, + 0x2cce, 0x2cd0, 0x2cd0, 0x2cd2, 0x2cd2, 0x2cd4, 0x2cd4, 0x2cd6, + 0x2cd6, 0x2cd8, 0x2cd8, 0x2cda, 0x2cda, 0x2cdc, 0x2cdc, 0x2cde, + 0x2cde, 0x2ce0, 0x2ce0, 0x2ce2, 0x2ce2, 0x2ceb, 0x2ceb, 0x2ced, + 0x2ced, 0x2cf2, 0x2cf2, 0xa640, 0xa640, 0xa642, 0xa642, 0xa644, + 0xa644, 0xa646, 0xa646, 0xa648, 0xa648, 0xa64a, 0xa64a, 0xa64c, + 0xa64c, 0xa64e, 0xa64e, 0xa650, 0xa650, 0xa652, 0xa652, 0xa654, + 0xa654, 0xa656, 0xa656, 0xa658, 0xa658, 0xa65a, 0xa65a, 0xa65c, + 0xa65c, 0xa65e, 0xa65e, 0xa660, 0xa660, 0xa662, 0xa662, 0xa664, + 0xa664, 0xa666, 0xa666, 0xa668, 0xa668, 0xa66a, 0xa66a, 0xa66c, + 0xa66c, 0xa680, 0xa680, 0xa682, 0xa682, 0xa684, 0xa684, 0xa686, + 0xa686, 0xa688, 0xa688, 0xa68a, 0xa68a, 0xa68c, 0xa68c, 0xa68e, + 0xa68e, 0xa690, 0xa690, 0xa692, 0xa692, 0xa694, 0xa694, 0xa696, + 0xa696, 0xa698, 0xa698, 0xa69a, 0xa69a, 0xa722, 0xa722, 0xa724, + 0xa724, 0xa726, 0xa726, 0xa728, 0xa728, 0xa72a, 0xa72a, 0xa72c, + 0xa72c, 0xa72e, 0xa72e, 0xa732, 0xa732, 0xa734, 0xa734, 0xa736, + 0xa736, 0xa738, 0xa738, 0xa73a, 0xa73a, 0xa73c, 0xa73c, 0xa73e, + 0xa73e, 0xa740, 0xa740, 0xa742, 0xa742, 0xa744, 0xa744, 0xa746, + 0xa746, 0xa748, 0xa748, 0xa74a, 0xa74a, 0xa74c, 0xa74c, 0xa74e, + 0xa74e, 0xa750, 0xa750, 0xa752, 0xa752, 0xa754, 0xa754, 0xa756, + 0xa756, 0xa758, 0xa758, 0xa75a, 0xa75a, 0xa75c, 0xa75c, 0xa75e, + 0xa75e, 0xa760, 0xa760, 0xa762, 0xa762, 0xa764, 0xa764, 0xa766, + 0xa766, 0xa768, 0xa768, 0xa76a, 0xa76a, 0xa76c, 0xa76c, 0xa76e, + 0xa76e, 0xa779, 0xa779, 0xa77b, 0xa77b, 0xa77d, 0xa77e, 0xa780, + 0xa780, 0xa782, 0xa782, 0xa784, 0xa784, 0xa786, 0xa786, 0xa78b, + 0xa78b, 0xa78d, 0xa78d, 0xa790, 0xa790, 0xa792, 0xa792, 0xa796, + 0xa796, 0xa798, 0xa798, 0xa79a, 0xa79a, 0xa79c, 0xa79c, 0xa79e, + 0xa79e, 0xa7a0, 0xa7a0, 0xa7a2, 0xa7a2, 0xa7a4, 0xa7a4, 0xa7a6, + 0xa7a6, 0xa7a8, 0xa7a8, 0xa7aa, 0xa7ae, 0xa7b0, 0xa7b4, 0xa7b6, + 0xa7b6, 0xff21, 0xff3a, 0x10400, 0x10427, 0x104b0, 0x104d3, 0x10c80, + 0x10cb2, 0x118a0, 0x118bf, 0x1d400, 0x1d419, 0x1d434, 0x1d44d, 0x1d468, + 0x1d481, 0x1d49c, 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, + 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, 0x1d4b5, 0x1d4d0, 0x1d4e9, 0x1d504, + 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, 0x1d51c, 0x1d538, + 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, 0x1d544, 0x1d546, 0x1d546, 0x1d54a, + 0x1d550, 0x1d56c, 0x1d585, 0x1d5a0, 0x1d5b9, 0x1d5d4, 0x1d5ed, 0x1d608, + 0x1d621, 0x1d63c, 0x1d655, 0x1d670, 0x1d689, 0x1d6a8, 0x1d6c0, 0x1d6e2, + 0x1d6fa, 0x1d71c, 0x1d734, 0x1d756, 0x1d76e, 0x1d790, 0x1d7a8, 0x1d7ca, + 0x1d7ca, 0x1e900, 0x1e921, 0x1f130, 0x1f149, 0x1f150, 0x1f169, 0x1f170, + 0x1f189, +}; /* CR_Upper */ + +/* 'XDigit': [[:XDigit:]] */ +static const OnigCodePoint CR_XDigit[] = { + 3, 0x0030, 0x0039, 0x0041, 0x0046, 0x0061, 0x0066, +}; /* CR_XDigit */ + +/* 'Word': [[:Word:]] */ +static const OnigCodePoint CR_Word[] = { + 679, 0x0030, 0x0039, 0x0041, 0x005a, 0x005f, 0x005f, 0x0061, + 0x007a, 0x00aa, 0x00aa, 0x00b5, 0x00b5, 0x00ba, 0x00ba, 0x00c0, + 0x00d6, 0x00d8, 0x00f6, 0x00f8, 0x02c1, 0x02c6, 0x02d1, 0x02e0, + 0x02e4, 0x02ec, 0x02ec, 0x02ee, 0x02ee, 0x0300, 0x0374, 0x0376, + 0x0377, 0x037a, 0x037d, 0x037f, 0x037f, 0x0386, 0x0386, 0x0388, + 0x038a, 0x038c, 0x038c, 0x038e, 0x03a1, 0x03a3, 0x03f5, 0x03f7, + 0x0481, 0x0483, 0x052f, 0x0531, 0x0556, 0x0559, 0x0559, 0x0561, + 0x0587, 0x0591, 0x05bd, 0x05bf, 0x05bf, 0x05c1, 0x05c2, 0x05c4, + 0x05c5, 0x05c7, 0x05c7, 0x05d0, 0x05ea, 0x05f0, 0x05f2, 0x0610, + 0x061a, 0x0620, 0x0669, 0x066e, 0x06d3, 0x06d5, 0x06dc, 0x06df, + 0x06e8, 0x06ea, 0x06fc, 0x06ff, 0x06ff, 0x0710, 0x074a, 0x074d, + 0x07b1, 0x07c0, 0x07f5, 0x07fa, 0x07fa, 0x0800, 0x082d, 0x0840, + 0x085b, 0x08a0, 0x08b4, 0x08b6, 0x08bd, 0x08d4, 0x08e1, 0x08e3, + 0x0963, 0x0966, 0x096f, 0x0971, 0x0983, 0x0985, 0x098c, 0x098f, + 0x0990, 0x0993, 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, + 0x09b9, 0x09bc, 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09ce, 0x09d7, + 0x09d7, 0x09dc, 0x09dd, 0x09df, 0x09e3, 0x09e6, 0x09f1, 0x0a01, + 0x0a03, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, + 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3c, + 0x0a3c, 0x0a3e, 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4d, 0x0a51, + 0x0a51, 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, 0x0a75, 0x0a81, + 0x0a83, 0x0a85, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, + 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, 0x0ac5, 0x0ac7, + 0x0ac9, 0x0acb, 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, 0x0ae3, 0x0ae6, + 0x0aef, 0x0af9, 0x0af9, 0x0b01, 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, + 0x0b10, 0x0b13, 0x0b28, 0x0b2a, 0x0b30, 0x0b32, 0x0b33, 0x0b35, + 0x0b39, 0x0b3c, 0x0b44, 0x0b47, 0x0b48, 0x0b4b, 0x0b4d, 0x0b56, + 0x0b57, 0x0b5c, 0x0b5d, 0x0b5f, 0x0b63, 0x0b66, 0x0b6f, 0x0b71, + 0x0b71, 0x0b82, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, + 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, + 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, + 0x0bc8, 0x0bca, 0x0bcd, 0x0bd0, 0x0bd0, 0x0bd7, 0x0bd7, 0x0be6, + 0x0bef, 0x0c00, 0x0c03, 0x0c05, 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, + 0x0c28, 0x0c2a, 0x0c39, 0x0c3d, 0x0c44, 0x0c46, 0x0c48, 0x0c4a, + 0x0c4d, 0x0c55, 0x0c56, 0x0c58, 0x0c5a, 0x0c60, 0x0c63, 0x0c66, + 0x0c6f, 0x0c80, 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, + 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbc, 0x0cc4, 0x0cc6, + 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, + 0x0ce3, 0x0ce6, 0x0cef, 0x0cf1, 0x0cf2, 0x0d01, 0x0d03, 0x0d05, + 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d3a, 0x0d3d, 0x0d44, 0x0d46, + 0x0d48, 0x0d4a, 0x0d4e, 0x0d54, 0x0d57, 0x0d5f, 0x0d63, 0x0d66, + 0x0d6f, 0x0d7a, 0x0d7f, 0x0d82, 0x0d83, 0x0d85, 0x0d96, 0x0d9a, + 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, 0x0dc6, 0x0dca, + 0x0dca, 0x0dcf, 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, 0x0ddf, 0x0de6, + 0x0def, 0x0df2, 0x0df3, 0x0e01, 0x0e3a, 0x0e40, 0x0e4e, 0x0e50, + 0x0e59, 0x0e81, 0x0e82, 0x0e84, 0x0e84, 0x0e87, 0x0e88, 0x0e8a, + 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, + 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, + 0x0eb9, 0x0ebb, 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, 0x0ec6, 0x0ec8, + 0x0ecd, 0x0ed0, 0x0ed9, 0x0edc, 0x0edf, 0x0f00, 0x0f00, 0x0f18, + 0x0f19, 0x0f20, 0x0f29, 0x0f35, 0x0f35, 0x0f37, 0x0f37, 0x0f39, + 0x0f39, 0x0f3e, 0x0f47, 0x0f49, 0x0f6c, 0x0f71, 0x0f84, 0x0f86, + 0x0f97, 0x0f99, 0x0fbc, 0x0fc6, 0x0fc6, 0x1000, 0x1049, 0x1050, + 0x109d, 0x10a0, 0x10c5, 0x10c7, 0x10c7, 0x10cd, 0x10cd, 0x10d0, + 0x10fa, 0x10fc, 0x1248, 0x124a, 0x124d, 0x1250, 0x1256, 0x1258, + 0x1258, 0x125a, 0x125d, 0x1260, 0x1288, 0x128a, 0x128d, 0x1290, + 0x12b0, 0x12b2, 0x12b5, 0x12b8, 0x12be, 0x12c0, 0x12c0, 0x12c2, + 0x12c5, 0x12c8, 0x12d6, 0x12d8, 0x1310, 0x1312, 0x1315, 0x1318, + 0x135a, 0x135d, 0x135f, 0x1380, 0x138f, 0x13a0, 0x13f5, 0x13f8, + 0x13fd, 0x1401, 0x166c, 0x166f, 0x167f, 0x1681, 0x169a, 0x16a0, + 0x16ea, 0x16ee, 0x16f8, 0x1700, 0x170c, 0x170e, 0x1714, 0x1720, + 0x1734, 0x1740, 0x1753, 0x1760, 0x176c, 0x176e, 0x1770, 0x1772, + 0x1773, 0x1780, 0x17d3, 0x17d7, 0x17d7, 0x17dc, 0x17dd, 0x17e0, + 0x17e9, 0x180b, 0x180d, 0x1810, 0x1819, 0x1820, 0x1877, 0x1880, + 0x18aa, 0x18b0, 0x18f5, 0x1900, 0x191e, 0x1920, 0x192b, 0x1930, + 0x193b, 0x1946, 0x196d, 0x1970, 0x1974, 0x1980, 0x19ab, 0x19b0, + 0x19c9, 0x19d0, 0x19d9, 0x1a00, 0x1a1b, 0x1a20, 0x1a5e, 0x1a60, + 0x1a7c, 0x1a7f, 0x1a89, 0x1a90, 0x1a99, 0x1aa7, 0x1aa7, 0x1ab0, + 0x1abe, 0x1b00, 0x1b4b, 0x1b50, 0x1b59, 0x1b6b, 0x1b73, 0x1b80, + 0x1bf3, 0x1c00, 0x1c37, 0x1c40, 0x1c49, 0x1c4d, 0x1c7d, 0x1c80, + 0x1c88, 0x1cd0, 0x1cd2, 0x1cd4, 0x1cf6, 0x1cf8, 0x1cf9, 0x1d00, + 0x1df5, 0x1dfb, 0x1f15, 0x1f18, 0x1f1d, 0x1f20, 0x1f45, 0x1f48, + 0x1f4d, 0x1f50, 0x1f57, 0x1f59, 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, + 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, 0x1fbc, 0x1fbe, + 0x1fbe, 0x1fc2, 0x1fc4, 0x1fc6, 0x1fcc, 0x1fd0, 0x1fd3, 0x1fd6, + 0x1fdb, 0x1fe0, 0x1fec, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ffc, 0x203f, + 0x2040, 0x2054, 0x2054, 0x2071, 0x2071, 0x207f, 0x207f, 0x2090, + 0x209c, 0x20d0, 0x20f0, 0x2102, 0x2102, 0x2107, 0x2107, 0x210a, + 0x2113, 0x2115, 0x2115, 0x2119, 0x211d, 0x2124, 0x2124, 0x2126, + 0x2126, 0x2128, 0x2128, 0x212a, 0x212d, 0x212f, 0x2139, 0x213c, + 0x213f, 0x2145, 0x2149, 0x214e, 0x214e, 0x2160, 0x2188, 0x24b6, + 0x24e9, 0x2c00, 0x2c2e, 0x2c30, 0x2c5e, 0x2c60, 0x2ce4, 0x2ceb, + 0x2cf3, 0x2d00, 0x2d25, 0x2d27, 0x2d27, 0x2d2d, 0x2d2d, 0x2d30, + 0x2d67, 0x2d6f, 0x2d6f, 0x2d7f, 0x2d96, 0x2da0, 0x2da6, 0x2da8, + 0x2dae, 0x2db0, 0x2db6, 0x2db8, 0x2dbe, 0x2dc0, 0x2dc6, 0x2dc8, + 0x2dce, 0x2dd0, 0x2dd6, 0x2dd8, 0x2dde, 0x2de0, 0x2dff, 0x2e2f, + 0x2e2f, 0x3005, 0x3007, 0x3021, 0x302f, 0x3031, 0x3035, 0x3038, + 0x303c, 0x3041, 0x3096, 0x3099, 0x309a, 0x309d, 0x309f, 0x30a1, + 0x30fa, 0x30fc, 0x30ff, 0x3105, 0x312d, 0x3131, 0x318e, 0x31a0, + 0x31ba, 0x31f0, 0x31ff, 0x3400, 0x4db5, 0x4e00, 0x9fd5, 0xa000, + 0xa48c, 0xa4d0, 0xa4fd, 0xa500, 0xa60c, 0xa610, 0xa62b, 0xa640, + 0xa672, 0xa674, 0xa67d, 0xa67f, 0xa6f1, 0xa717, 0xa71f, 0xa722, + 0xa788, 0xa78b, 0xa7ae, 0xa7b0, 0xa7b7, 0xa7f7, 0xa827, 0xa840, + 0xa873, 0xa880, 0xa8c5, 0xa8d0, 0xa8d9, 0xa8e0, 0xa8f7, 0xa8fb, + 0xa8fb, 0xa8fd, 0xa8fd, 0xa900, 0xa92d, 0xa930, 0xa953, 0xa960, + 0xa97c, 0xa980, 0xa9c0, 0xa9cf, 0xa9d9, 0xa9e0, 0xa9fe, 0xaa00, + 0xaa36, 0xaa40, 0xaa4d, 0xaa50, 0xaa59, 0xaa60, 0xaa76, 0xaa7a, + 0xaac2, 0xaadb, 0xaadd, 0xaae0, 0xaaef, 0xaaf2, 0xaaf6, 0xab01, + 0xab06, 0xab09, 0xab0e, 0xab11, 0xab16, 0xab20, 0xab26, 0xab28, + 0xab2e, 0xab30, 0xab5a, 0xab5c, 0xab65, 0xab70, 0xabea, 0xabec, + 0xabed, 0xabf0, 0xabf9, 0xac00, 0xd7a3, 0xd7b0, 0xd7c6, 0xd7cb, + 0xd7fb, 0xf900, 0xfa6d, 0xfa70, 0xfad9, 0xfb00, 0xfb06, 0xfb13, + 0xfb17, 0xfb1d, 0xfb28, 0xfb2a, 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, + 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, 0xfbb1, 0xfbd3, + 0xfd3d, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdf0, 0xfdfb, 0xfe00, + 0xfe0f, 0xfe20, 0xfe2f, 0xfe33, 0xfe34, 0xfe4d, 0xfe4f, 0xfe70, + 0xfe74, 0xfe76, 0xfefc, 0xff10, 0xff19, 0xff21, 0xff3a, 0xff3f, + 0xff3f, 0xff41, 0xff5a, 0xff66, 0xffbe, 0xffc2, 0xffc7, 0xffca, + 0xffcf, 0xffd2, 0xffd7, 0xffda, 0xffdc, 0x10000, 0x1000b, 0x1000d, + 0x10026, 0x10028, 0x1003a, 0x1003c, 0x1003d, 0x1003f, 0x1004d, 0x10050, + 0x1005d, 0x10080, 0x100fa, 0x10140, 0x10174, 0x101fd, 0x101fd, 0x10280, + 0x1029c, 0x102a0, 0x102d0, 0x102e0, 0x102e0, 0x10300, 0x1031f, 0x10330, + 0x1034a, 0x10350, 0x1037a, 0x10380, 0x1039d, 0x103a0, 0x103c3, 0x103c8, + 0x103cf, 0x103d1, 0x103d5, 0x10400, 0x1049d, 0x104a0, 0x104a9, 0x104b0, + 0x104d3, 0x104d8, 0x104fb, 0x10500, 0x10527, 0x10530, 0x10563, 0x10600, + 0x10736, 0x10740, 0x10755, 0x10760, 0x10767, 0x10800, 0x10805, 0x10808, + 0x10808, 0x1080a, 0x10835, 0x10837, 0x10838, 0x1083c, 0x1083c, 0x1083f, + 0x10855, 0x10860, 0x10876, 0x10880, 0x1089e, 0x108e0, 0x108f2, 0x108f4, + 0x108f5, 0x10900, 0x10915, 0x10920, 0x10939, 0x10980, 0x109b7, 0x109be, + 0x109bf, 0x10a00, 0x10a03, 0x10a05, 0x10a06, 0x10a0c, 0x10a13, 0x10a15, + 0x10a17, 0x10a19, 0x10a33, 0x10a38, 0x10a3a, 0x10a3f, 0x10a3f, 0x10a60, + 0x10a7c, 0x10a80, 0x10a9c, 0x10ac0, 0x10ac7, 0x10ac9, 0x10ae6, 0x10b00, + 0x10b35, 0x10b40, 0x10b55, 0x10b60, 0x10b72, 0x10b80, 0x10b91, 0x10c00, + 0x10c48, 0x10c80, 0x10cb2, 0x10cc0, 0x10cf2, 0x11000, 0x11046, 0x11066, + 0x1106f, 0x1107f, 0x110ba, 0x110d0, 0x110e8, 0x110f0, 0x110f9, 0x11100, + 0x11134, 0x11136, 0x1113f, 0x11150, 0x11173, 0x11176, 0x11176, 0x11180, + 0x111c4, 0x111ca, 0x111cc, 0x111d0, 0x111da, 0x111dc, 0x111dc, 0x11200, + 0x11211, 0x11213, 0x11237, 0x1123e, 0x1123e, 0x11280, 0x11286, 0x11288, + 0x11288, 0x1128a, 0x1128d, 0x1128f, 0x1129d, 0x1129f, 0x112a8, 0x112b0, + 0x112ea, 0x112f0, 0x112f9, 0x11300, 0x11303, 0x11305, 0x1130c, 0x1130f, + 0x11310, 0x11313, 0x11328, 0x1132a, 0x11330, 0x11332, 0x11333, 0x11335, + 0x11339, 0x1133c, 0x11344, 0x11347, 0x11348, 0x1134b, 0x1134d, 0x11350, + 0x11350, 0x11357, 0x11357, 0x1135d, 0x11363, 0x11366, 0x1136c, 0x11370, + 0x11374, 0x11400, 0x1144a, 0x11450, 0x11459, 0x11480, 0x114c5, 0x114c7, + 0x114c7, 0x114d0, 0x114d9, 0x11580, 0x115b5, 0x115b8, 0x115c0, 0x115d8, + 0x115dd, 0x11600, 0x11640, 0x11644, 0x11644, 0x11650, 0x11659, 0x11680, + 0x116b7, 0x116c0, 0x116c9, 0x11700, 0x11719, 0x1171d, 0x1172b, 0x11730, + 0x11739, 0x118a0, 0x118e9, 0x118ff, 0x118ff, 0x11ac0, 0x11af8, 0x11c00, + 0x11c08, 0x11c0a, 0x11c36, 0x11c38, 0x11c40, 0x11c50, 0x11c59, 0x11c72, + 0x11c8f, 0x11c92, 0x11ca7, 0x11ca9, 0x11cb6, 0x12000, 0x12399, 0x12400, + 0x1246e, 0x12480, 0x12543, 0x13000, 0x1342e, 0x14400, 0x14646, 0x16800, + 0x16a38, 0x16a40, 0x16a5e, 0x16a60, 0x16a69, 0x16ad0, 0x16aed, 0x16af0, + 0x16af4, 0x16b00, 0x16b36, 0x16b40, 0x16b43, 0x16b50, 0x16b59, 0x16b63, + 0x16b77, 0x16b7d, 0x16b8f, 0x16f00, 0x16f44, 0x16f50, 0x16f7e, 0x16f8f, + 0x16f9f, 0x16fe0, 0x16fe0, 0x17000, 0x187ec, 0x18800, 0x18af2, 0x1b000, + 0x1b001, 0x1bc00, 0x1bc6a, 0x1bc70, 0x1bc7c, 0x1bc80, 0x1bc88, 0x1bc90, + 0x1bc99, 0x1bc9d, 0x1bc9e, 0x1d165, 0x1d169, 0x1d16d, 0x1d172, 0x1d17b, + 0x1d182, 0x1d185, 0x1d18b, 0x1d1aa, 0x1d1ad, 0x1d242, 0x1d244, 0x1d400, + 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, + 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, + 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, + 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, 0x1d544, 0x1d546, + 0x1d546, 0x1d54a, 0x1d550, 0x1d552, 0x1d6a5, 0x1d6a8, 0x1d6c0, 0x1d6c2, + 0x1d6da, 0x1d6dc, 0x1d6fa, 0x1d6fc, 0x1d714, 0x1d716, 0x1d734, 0x1d736, + 0x1d74e, 0x1d750, 0x1d76e, 0x1d770, 0x1d788, 0x1d78a, 0x1d7a8, 0x1d7aa, + 0x1d7c2, 0x1d7c4, 0x1d7cb, 0x1d7ce, 0x1d7ff, 0x1da00, 0x1da36, 0x1da3b, + 0x1da6c, 0x1da75, 0x1da75, 0x1da84, 0x1da84, 0x1da9b, 0x1da9f, 0x1daa1, + 0x1daaf, 0x1e000, 0x1e006, 0x1e008, 0x1e018, 0x1e01b, 0x1e021, 0x1e023, + 0x1e024, 0x1e026, 0x1e02a, 0x1e800, 0x1e8c4, 0x1e8d0, 0x1e8d6, 0x1e900, + 0x1e94a, 0x1e950, 0x1e959, 0x1ee00, 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, + 0x1ee22, 0x1ee24, 0x1ee24, 0x1ee27, 0x1ee27, 0x1ee29, 0x1ee32, 0x1ee34, + 0x1ee37, 0x1ee39, 0x1ee39, 0x1ee3b, 0x1ee3b, 0x1ee42, 0x1ee42, 0x1ee47, + 0x1ee47, 0x1ee49, 0x1ee49, 0x1ee4b, 0x1ee4b, 0x1ee4d, 0x1ee4f, 0x1ee51, + 0x1ee52, 0x1ee54, 0x1ee54, 0x1ee57, 0x1ee57, 0x1ee59, 0x1ee59, 0x1ee5b, + 0x1ee5b, 0x1ee5d, 0x1ee5d, 0x1ee5f, 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, + 0x1ee64, 0x1ee67, 0x1ee6a, 0x1ee6c, 0x1ee72, 0x1ee74, 0x1ee77, 0x1ee79, + 0x1ee7c, 0x1ee7e, 0x1ee7e, 0x1ee80, 0x1ee89, 0x1ee8b, 0x1ee9b, 0x1eea1, + 0x1eea3, 0x1eea5, 0x1eea9, 0x1eeab, 0x1eebb, 0x1f130, 0x1f149, 0x1f150, + 0x1f169, 0x1f170, 0x1f189, 0x20000, 0x2a6d6, 0x2a700, 0x2b734, 0x2b740, + 0x2b81d, 0x2b820, 0x2cea1, 0x2f800, 0x2fa1d, 0xe0100, 0xe01ef, +}; /* CR_Word */ + +/* 'Alnum': [[:Alnum:]] */ +static const OnigCodePoint CR_Alnum[] = { + 678, 0x0030, 0x0039, 0x0041, 0x005a, 0x0061, 0x007a, 0x00aa, + 0x00aa, 0x00b5, 0x00b5, 0x00ba, 0x00ba, 0x00c0, 0x00d6, 0x00d8, + 0x00f6, 0x00f8, 0x02c1, 0x02c6, 0x02d1, 0x02e0, 0x02e4, 0x02ec, + 0x02ec, 0x02ee, 0x02ee, 0x0345, 0x0345, 0x0370, 0x0374, 0x0376, + 0x0377, 0x037a, 0x037d, 0x037f, 0x037f, 0x0386, 0x0386, 0x0388, + 0x038a, 0x038c, 0x038c, 0x038e, 0x03a1, 0x03a3, 0x03f5, 0x03f7, + 0x0481, 0x048a, 0x052f, 0x0531, 0x0556, 0x0559, 0x0559, 0x0561, + 0x0587, 0x05b0, 0x05bd, 0x05bf, 0x05bf, 0x05c1, 0x05c2, 0x05c4, + 0x05c5, 0x05c7, 0x05c7, 0x05d0, 0x05ea, 0x05f0, 0x05f2, 0x0610, + 0x061a, 0x0620, 0x0657, 0x0659, 0x0669, 0x066e, 0x06d3, 0x06d5, + 0x06dc, 0x06e1, 0x06e8, 0x06ed, 0x06fc, 0x06ff, 0x06ff, 0x0710, + 0x073f, 0x074d, 0x07b1, 0x07c0, 0x07ea, 0x07f4, 0x07f5, 0x07fa, + 0x07fa, 0x0800, 0x0817, 0x081a, 0x082c, 0x0840, 0x0858, 0x08a0, + 0x08b4, 0x08b6, 0x08bd, 0x08d4, 0x08df, 0x08e3, 0x08e9, 0x08f0, + 0x093b, 0x093d, 0x094c, 0x094e, 0x0950, 0x0955, 0x0963, 0x0966, + 0x096f, 0x0971, 0x0983, 0x0985, 0x098c, 0x098f, 0x0990, 0x0993, + 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, 0x09b9, 0x09bd, + 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09cc, 0x09ce, 0x09ce, 0x09d7, + 0x09d7, 0x09dc, 0x09dd, 0x09df, 0x09e3, 0x09e6, 0x09f1, 0x0a01, + 0x0a03, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, + 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3e, + 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4c, 0x0a51, 0x0a51, 0x0a59, + 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, 0x0a75, 0x0a81, 0x0a83, 0x0a85, + 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, 0x0ab0, 0x0ab2, + 0x0ab3, 0x0ab5, 0x0ab9, 0x0abd, 0x0ac5, 0x0ac7, 0x0ac9, 0x0acb, + 0x0acc, 0x0ad0, 0x0ad0, 0x0ae0, 0x0ae3, 0x0ae6, 0x0aef, 0x0af9, + 0x0af9, 0x0b01, 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, + 0x0b28, 0x0b2a, 0x0b30, 0x0b32, 0x0b33, 0x0b35, 0x0b39, 0x0b3d, + 0x0b44, 0x0b47, 0x0b48, 0x0b4b, 0x0b4c, 0x0b56, 0x0b57, 0x0b5c, + 0x0b5d, 0x0b5f, 0x0b63, 0x0b66, 0x0b6f, 0x0b71, 0x0b71, 0x0b82, + 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, 0x0b95, 0x0b99, + 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, + 0x0baa, 0x0bae, 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, + 0x0bcc, 0x0bd0, 0x0bd0, 0x0bd7, 0x0bd7, 0x0be6, 0x0bef, 0x0c00, + 0x0c03, 0x0c05, 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, 0x0c28, 0x0c2a, + 0x0c39, 0x0c3d, 0x0c44, 0x0c46, 0x0c48, 0x0c4a, 0x0c4c, 0x0c55, + 0x0c56, 0x0c58, 0x0c5a, 0x0c60, 0x0c63, 0x0c66, 0x0c6f, 0x0c80, + 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, 0x0ca8, 0x0caa, + 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbd, 0x0cc4, 0x0cc6, 0x0cc8, 0x0cca, + 0x0ccc, 0x0cd5, 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, 0x0ce3, 0x0ce6, + 0x0cef, 0x0cf1, 0x0cf2, 0x0d01, 0x0d03, 0x0d05, 0x0d0c, 0x0d0e, + 0x0d10, 0x0d12, 0x0d3a, 0x0d3d, 0x0d44, 0x0d46, 0x0d48, 0x0d4a, + 0x0d4c, 0x0d4e, 0x0d4e, 0x0d54, 0x0d57, 0x0d5f, 0x0d63, 0x0d66, + 0x0d6f, 0x0d7a, 0x0d7f, 0x0d82, 0x0d83, 0x0d85, 0x0d96, 0x0d9a, + 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, 0x0dc6, 0x0dcf, + 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, 0x0ddf, 0x0de6, 0x0def, 0x0df2, + 0x0df3, 0x0e01, 0x0e3a, 0x0e40, 0x0e46, 0x0e4d, 0x0e4d, 0x0e50, + 0x0e59, 0x0e81, 0x0e82, 0x0e84, 0x0e84, 0x0e87, 0x0e88, 0x0e8a, + 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, + 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, + 0x0eb9, 0x0ebb, 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, 0x0ec6, 0x0ecd, + 0x0ecd, 0x0ed0, 0x0ed9, 0x0edc, 0x0edf, 0x0f00, 0x0f00, 0x0f20, + 0x0f29, 0x0f40, 0x0f47, 0x0f49, 0x0f6c, 0x0f71, 0x0f81, 0x0f88, + 0x0f97, 0x0f99, 0x0fbc, 0x1000, 0x1036, 0x1038, 0x1038, 0x103b, + 0x1049, 0x1050, 0x1062, 0x1065, 0x1068, 0x106e, 0x1086, 0x108e, + 0x108e, 0x1090, 0x1099, 0x109c, 0x109d, 0x10a0, 0x10c5, 0x10c7, + 0x10c7, 0x10cd, 0x10cd, 0x10d0, 0x10fa, 0x10fc, 0x1248, 0x124a, + 0x124d, 0x1250, 0x1256, 0x1258, 0x1258, 0x125a, 0x125d, 0x1260, + 0x1288, 0x128a, 0x128d, 0x1290, 0x12b0, 0x12b2, 0x12b5, 0x12b8, + 0x12be, 0x12c0, 0x12c0, 0x12c2, 0x12c5, 0x12c8, 0x12d6, 0x12d8, + 0x1310, 0x1312, 0x1315, 0x1318, 0x135a, 0x135f, 0x135f, 0x1380, + 0x138f, 0x13a0, 0x13f5, 0x13f8, 0x13fd, 0x1401, 0x166c, 0x166f, + 0x167f, 0x1681, 0x169a, 0x16a0, 0x16ea, 0x16ee, 0x16f8, 0x1700, + 0x170c, 0x170e, 0x1713, 0x1720, 0x1733, 0x1740, 0x1753, 0x1760, + 0x176c, 0x176e, 0x1770, 0x1772, 0x1773, 0x1780, 0x17b3, 0x17b6, + 0x17c8, 0x17d7, 0x17d7, 0x17dc, 0x17dc, 0x17e0, 0x17e9, 0x1810, + 0x1819, 0x1820, 0x1877, 0x1880, 0x18aa, 0x18b0, 0x18f5, 0x1900, + 0x191e, 0x1920, 0x192b, 0x1930, 0x1938, 0x1946, 0x196d, 0x1970, + 0x1974, 0x1980, 0x19ab, 0x19b0, 0x19c9, 0x19d0, 0x19d9, 0x1a00, + 0x1a1b, 0x1a20, 0x1a5e, 0x1a61, 0x1a74, 0x1a80, 0x1a89, 0x1a90, + 0x1a99, 0x1aa7, 0x1aa7, 0x1b00, 0x1b33, 0x1b35, 0x1b43, 0x1b45, + 0x1b4b, 0x1b50, 0x1b59, 0x1b80, 0x1ba9, 0x1bac, 0x1be5, 0x1be7, + 0x1bf1, 0x1c00, 0x1c35, 0x1c40, 0x1c49, 0x1c4d, 0x1c7d, 0x1c80, + 0x1c88, 0x1ce9, 0x1cec, 0x1cee, 0x1cf3, 0x1cf5, 0x1cf6, 0x1d00, + 0x1dbf, 0x1de7, 0x1df4, 0x1e00, 0x1f15, 0x1f18, 0x1f1d, 0x1f20, + 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, 0x1f59, 0x1f5b, + 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, + 0x1fbc, 0x1fbe, 0x1fbe, 0x1fc2, 0x1fc4, 0x1fc6, 0x1fcc, 0x1fd0, + 0x1fd3, 0x1fd6, 0x1fdb, 0x1fe0, 0x1fec, 0x1ff2, 0x1ff4, 0x1ff6, + 0x1ffc, 0x2071, 0x2071, 0x207f, 0x207f, 0x2090, 0x209c, 0x2102, + 0x2102, 0x2107, 0x2107, 0x210a, 0x2113, 0x2115, 0x2115, 0x2119, + 0x211d, 0x2124, 0x2124, 0x2126, 0x2126, 0x2128, 0x2128, 0x212a, + 0x212d, 0x212f, 0x2139, 0x213c, 0x213f, 0x2145, 0x2149, 0x214e, + 0x214e, 0x2160, 0x2188, 0x24b6, 0x24e9, 0x2c00, 0x2c2e, 0x2c30, + 0x2c5e, 0x2c60, 0x2ce4, 0x2ceb, 0x2cee, 0x2cf2, 0x2cf3, 0x2d00, + 0x2d25, 0x2d27, 0x2d27, 0x2d2d, 0x2d2d, 0x2d30, 0x2d67, 0x2d6f, + 0x2d6f, 0x2d80, 0x2d96, 0x2da0, 0x2da6, 0x2da8, 0x2dae, 0x2db0, + 0x2db6, 0x2db8, 0x2dbe, 0x2dc0, 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, + 0x2dd6, 0x2dd8, 0x2dde, 0x2de0, 0x2dff, 0x2e2f, 0x2e2f, 0x3005, + 0x3007, 0x3021, 0x3029, 0x3031, 0x3035, 0x3038, 0x303c, 0x3041, + 0x3096, 0x309d, 0x309f, 0x30a1, 0x30fa, 0x30fc, 0x30ff, 0x3105, + 0x312d, 0x3131, 0x318e, 0x31a0, 0x31ba, 0x31f0, 0x31ff, 0x3400, + 0x4db5, 0x4e00, 0x9fd5, 0xa000, 0xa48c, 0xa4d0, 0xa4fd, 0xa500, + 0xa60c, 0xa610, 0xa62b, 0xa640, 0xa66e, 0xa674, 0xa67b, 0xa67f, + 0xa6ef, 0xa717, 0xa71f, 0xa722, 0xa788, 0xa78b, 0xa7ae, 0xa7b0, + 0xa7b7, 0xa7f7, 0xa801, 0xa803, 0xa805, 0xa807, 0xa80a, 0xa80c, + 0xa827, 0xa840, 0xa873, 0xa880, 0xa8c3, 0xa8c5, 0xa8c5, 0xa8d0, + 0xa8d9, 0xa8f2, 0xa8f7, 0xa8fb, 0xa8fb, 0xa8fd, 0xa8fd, 0xa900, + 0xa92a, 0xa930, 0xa952, 0xa960, 0xa97c, 0xa980, 0xa9b2, 0xa9b4, + 0xa9bf, 0xa9cf, 0xa9d9, 0xa9e0, 0xa9e4, 0xa9e6, 0xa9fe, 0xaa00, + 0xaa36, 0xaa40, 0xaa4d, 0xaa50, 0xaa59, 0xaa60, 0xaa76, 0xaa7a, + 0xaa7a, 0xaa7e, 0xaabe, 0xaac0, 0xaac0, 0xaac2, 0xaac2, 0xaadb, + 0xaadd, 0xaae0, 0xaaef, 0xaaf2, 0xaaf5, 0xab01, 0xab06, 0xab09, + 0xab0e, 0xab11, 0xab16, 0xab20, 0xab26, 0xab28, 0xab2e, 0xab30, + 0xab5a, 0xab5c, 0xab65, 0xab70, 0xabea, 0xabf0, 0xabf9, 0xac00, + 0xd7a3, 0xd7b0, 0xd7c6, 0xd7cb, 0xd7fb, 0xf900, 0xfa6d, 0xfa70, + 0xfad9, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xfb1d, 0xfb28, 0xfb2a, + 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, + 0xfb44, 0xfb46, 0xfbb1, 0xfbd3, 0xfd3d, 0xfd50, 0xfd8f, 0xfd92, + 0xfdc7, 0xfdf0, 0xfdfb, 0xfe70, 0xfe74, 0xfe76, 0xfefc, 0xff10, + 0xff19, 0xff21, 0xff3a, 0xff41, 0xff5a, 0xff66, 0xffbe, 0xffc2, + 0xffc7, 0xffca, 0xffcf, 0xffd2, 0xffd7, 0xffda, 0xffdc, 0x10000, + 0x1000b, 0x1000d, 0x10026, 0x10028, 0x1003a, 0x1003c, 0x1003d, 0x1003f, + 0x1004d, 0x10050, 0x1005d, 0x10080, 0x100fa, 0x10140, 0x10174, 0x10280, + 0x1029c, 0x102a0, 0x102d0, 0x10300, 0x1031f, 0x10330, 0x1034a, 0x10350, + 0x1037a, 0x10380, 0x1039d, 0x103a0, 0x103c3, 0x103c8, 0x103cf, 0x103d1, + 0x103d5, 0x10400, 0x1049d, 0x104a0, 0x104a9, 0x104b0, 0x104d3, 0x104d8, + 0x104fb, 0x10500, 0x10527, 0x10530, 0x10563, 0x10600, 0x10736, 0x10740, + 0x10755, 0x10760, 0x10767, 0x10800, 0x10805, 0x10808, 0x10808, 0x1080a, + 0x10835, 0x10837, 0x10838, 0x1083c, 0x1083c, 0x1083f, 0x10855, 0x10860, + 0x10876, 0x10880, 0x1089e, 0x108e0, 0x108f2, 0x108f4, 0x108f5, 0x10900, + 0x10915, 0x10920, 0x10939, 0x10980, 0x109b7, 0x109be, 0x109bf, 0x10a00, + 0x10a03, 0x10a05, 0x10a06, 0x10a0c, 0x10a13, 0x10a15, 0x10a17, 0x10a19, + 0x10a33, 0x10a60, 0x10a7c, 0x10a80, 0x10a9c, 0x10ac0, 0x10ac7, 0x10ac9, + 0x10ae4, 0x10b00, 0x10b35, 0x10b40, 0x10b55, 0x10b60, 0x10b72, 0x10b80, + 0x10b91, 0x10c00, 0x10c48, 0x10c80, 0x10cb2, 0x10cc0, 0x10cf2, 0x11000, + 0x11045, 0x11066, 0x1106f, 0x11082, 0x110b8, 0x110d0, 0x110e8, 0x110f0, + 0x110f9, 0x11100, 0x11132, 0x11136, 0x1113f, 0x11150, 0x11172, 0x11176, + 0x11176, 0x11180, 0x111bf, 0x111c1, 0x111c4, 0x111d0, 0x111da, 0x111dc, + 0x111dc, 0x11200, 0x11211, 0x11213, 0x11234, 0x11237, 0x11237, 0x1123e, + 0x1123e, 0x11280, 0x11286, 0x11288, 0x11288, 0x1128a, 0x1128d, 0x1128f, + 0x1129d, 0x1129f, 0x112a8, 0x112b0, 0x112e8, 0x112f0, 0x112f9, 0x11300, + 0x11303, 0x11305, 0x1130c, 0x1130f, 0x11310, 0x11313, 0x11328, 0x1132a, + 0x11330, 0x11332, 0x11333, 0x11335, 0x11339, 0x1133d, 0x11344, 0x11347, + 0x11348, 0x1134b, 0x1134c, 0x11350, 0x11350, 0x11357, 0x11357, 0x1135d, + 0x11363, 0x11400, 0x11441, 0x11443, 0x11445, 0x11447, 0x1144a, 0x11450, + 0x11459, 0x11480, 0x114c1, 0x114c4, 0x114c5, 0x114c7, 0x114c7, 0x114d0, + 0x114d9, 0x11580, 0x115b5, 0x115b8, 0x115be, 0x115d8, 0x115dd, 0x11600, + 0x1163e, 0x11640, 0x11640, 0x11644, 0x11644, 0x11650, 0x11659, 0x11680, + 0x116b5, 0x116c0, 0x116c9, 0x11700, 0x11719, 0x1171d, 0x1172a, 0x11730, + 0x11739, 0x118a0, 0x118e9, 0x118ff, 0x118ff, 0x11ac0, 0x11af8, 0x11c00, + 0x11c08, 0x11c0a, 0x11c36, 0x11c38, 0x11c3e, 0x11c40, 0x11c40, 0x11c50, + 0x11c59, 0x11c72, 0x11c8f, 0x11c92, 0x11ca7, 0x11ca9, 0x11cb6, 0x12000, + 0x12399, 0x12400, 0x1246e, 0x12480, 0x12543, 0x13000, 0x1342e, 0x14400, + 0x14646, 0x16800, 0x16a38, 0x16a40, 0x16a5e, 0x16a60, 0x16a69, 0x16ad0, + 0x16aed, 0x16b00, 0x16b36, 0x16b40, 0x16b43, 0x16b50, 0x16b59, 0x16b63, + 0x16b77, 0x16b7d, 0x16b8f, 0x16f00, 0x16f44, 0x16f50, 0x16f7e, 0x16f93, + 0x16f9f, 0x16fe0, 0x16fe0, 0x17000, 0x187ec, 0x18800, 0x18af2, 0x1b000, + 0x1b001, 0x1bc00, 0x1bc6a, 0x1bc70, 0x1bc7c, 0x1bc80, 0x1bc88, 0x1bc90, + 0x1bc99, 0x1bc9e, 0x1bc9e, 0x1d400, 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, + 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, + 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, + 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, + 0x1d53e, 0x1d540, 0x1d544, 0x1d546, 0x1d546, 0x1d54a, 0x1d550, 0x1d552, + 0x1d6a5, 0x1d6a8, 0x1d6c0, 0x1d6c2, 0x1d6da, 0x1d6dc, 0x1d6fa, 0x1d6fc, + 0x1d714, 0x1d716, 0x1d734, 0x1d736, 0x1d74e, 0x1d750, 0x1d76e, 0x1d770, + 0x1d788, 0x1d78a, 0x1d7a8, 0x1d7aa, 0x1d7c2, 0x1d7c4, 0x1d7cb, 0x1d7ce, + 0x1d7ff, 0x1e000, 0x1e006, 0x1e008, 0x1e018, 0x1e01b, 0x1e021, 0x1e023, + 0x1e024, 0x1e026, 0x1e02a, 0x1e800, 0x1e8c4, 0x1e900, 0x1e943, 0x1e947, + 0x1e947, 0x1e950, 0x1e959, 0x1ee00, 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, + 0x1ee22, 0x1ee24, 0x1ee24, 0x1ee27, 0x1ee27, 0x1ee29, 0x1ee32, 0x1ee34, + 0x1ee37, 0x1ee39, 0x1ee39, 0x1ee3b, 0x1ee3b, 0x1ee42, 0x1ee42, 0x1ee47, + 0x1ee47, 0x1ee49, 0x1ee49, 0x1ee4b, 0x1ee4b, 0x1ee4d, 0x1ee4f, 0x1ee51, + 0x1ee52, 0x1ee54, 0x1ee54, 0x1ee57, 0x1ee57, 0x1ee59, 0x1ee59, 0x1ee5b, + 0x1ee5b, 0x1ee5d, 0x1ee5d, 0x1ee5f, 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, + 0x1ee64, 0x1ee67, 0x1ee6a, 0x1ee6c, 0x1ee72, 0x1ee74, 0x1ee77, 0x1ee79, + 0x1ee7c, 0x1ee7e, 0x1ee7e, 0x1ee80, 0x1ee89, 0x1ee8b, 0x1ee9b, 0x1eea1, + 0x1eea3, 0x1eea5, 0x1eea9, 0x1eeab, 0x1eebb, 0x1f130, 0x1f149, 0x1f150, + 0x1f169, 0x1f170, 0x1f189, 0x20000, 0x2a6d6, 0x2a700, 0x2b734, 0x2b740, + 0x2b81d, 0x2b820, 0x2cea1, 0x2f800, 0x2fa1d, +}; /* CR_Alnum */ + +/* 'ASCII': [[:ASCII:]] */ +static const OnigCodePoint CR_ASCII[] = { + 1, + 0x0000, + 0x007f, +}; /* CR_ASCII */ + +/* 'Punct' */ +static const OnigCodePoint CR_Punct[] = { + 168, 0x0021, 0x0023, 0x0025, 0x002a, 0x002c, 0x002f, 0x003a, + 0x003b, 0x003f, 0x0040, 0x005b, 0x005d, 0x005f, 0x005f, 0x007b, + 0x007b, 0x007d, 0x007d, 0x00a1, 0x00a1, 0x00a7, 0x00a7, 0x00ab, + 0x00ab, 0x00b6, 0x00b7, 0x00bb, 0x00bb, 0x00bf, 0x00bf, 0x037e, + 0x037e, 0x0387, 0x0387, 0x055a, 0x055f, 0x0589, 0x058a, 0x05be, + 0x05be, 0x05c0, 0x05c0, 0x05c3, 0x05c3, 0x05c6, 0x05c6, 0x05f3, + 0x05f4, 0x0609, 0x060a, 0x060c, 0x060d, 0x061b, 0x061b, 0x061e, + 0x061f, 0x066a, 0x066d, 0x06d4, 0x06d4, 0x0700, 0x070d, 0x07f7, + 0x07f9, 0x0830, 0x083e, 0x085e, 0x085e, 0x0964, 0x0965, 0x0970, + 0x0970, 0x0af0, 0x0af0, 0x0df4, 0x0df4, 0x0e4f, 0x0e4f, 0x0e5a, + 0x0e5b, 0x0f04, 0x0f12, 0x0f14, 0x0f14, 0x0f3a, 0x0f3d, 0x0f85, + 0x0f85, 0x0fd0, 0x0fd4, 0x0fd9, 0x0fda, 0x104a, 0x104f, 0x10fb, + 0x10fb, 0x1360, 0x1368, 0x1400, 0x1400, 0x166d, 0x166e, 0x169b, + 0x169c, 0x16eb, 0x16ed, 0x1735, 0x1736, 0x17d4, 0x17d6, 0x17d8, + 0x17da, 0x1800, 0x180a, 0x1944, 0x1945, 0x1a1e, 0x1a1f, 0x1aa0, + 0x1aa6, 0x1aa8, 0x1aad, 0x1b5a, 0x1b60, 0x1bfc, 0x1bff, 0x1c3b, + 0x1c3f, 0x1c7e, 0x1c7f, 0x1cc0, 0x1cc7, 0x1cd3, 0x1cd3, 0x2010, + 0x2027, 0x2030, 0x2043, 0x2045, 0x2051, 0x2053, 0x205e, 0x207d, + 0x207e, 0x208d, 0x208e, 0x2308, 0x230b, 0x2329, 0x232a, 0x2768, + 0x2775, 0x27c5, 0x27c6, 0x27e6, 0x27ef, 0x2983, 0x2998, 0x29d8, + 0x29db, 0x29fc, 0x29fd, 0x2cf9, 0x2cfc, 0x2cfe, 0x2cff, 0x2d70, + 0x2d70, 0x2e00, 0x2e2e, 0x2e30, 0x2e44, 0x3001, 0x3003, 0x3008, + 0x3011, 0x3014, 0x301f, 0x3030, 0x3030, 0x303d, 0x303d, 0x30a0, + 0x30a0, 0x30fb, 0x30fb, 0xa4fe, 0xa4ff, 0xa60d, 0xa60f, 0xa673, + 0xa673, 0xa67e, 0xa67e, 0xa6f2, 0xa6f7, 0xa874, 0xa877, 0xa8ce, + 0xa8cf, 0xa8f8, 0xa8fa, 0xa8fc, 0xa8fc, 0xa92e, 0xa92f, 0xa95f, + 0xa95f, 0xa9c1, 0xa9cd, 0xa9de, 0xa9df, 0xaa5c, 0xaa5f, 0xaade, + 0xaadf, 0xaaf0, 0xaaf1, 0xabeb, 0xabeb, 0xfd3e, 0xfd3f, 0xfe10, + 0xfe19, 0xfe30, 0xfe52, 0xfe54, 0xfe61, 0xfe63, 0xfe63, 0xfe68, + 0xfe68, 0xfe6a, 0xfe6b, 0xff01, 0xff03, 0xff05, 0xff0a, 0xff0c, + 0xff0f, 0xff1a, 0xff1b, 0xff1f, 0xff20, 0xff3b, 0xff3d, 0xff3f, + 0xff3f, 0xff5b, 0xff5b, 0xff5d, 0xff5d, 0xff5f, 0xff65, 0x10100, + 0x10102, 0x1039f, 0x1039f, 0x103d0, 0x103d0, 0x1056f, 0x1056f, 0x10857, + 0x10857, 0x1091f, 0x1091f, 0x1093f, 0x1093f, 0x10a50, 0x10a58, 0x10a7f, + 0x10a7f, 0x10af0, 0x10af6, 0x10b39, 0x10b3f, 0x10b99, 0x10b9c, 0x11047, + 0x1104d, 0x110bb, 0x110bc, 0x110be, 0x110c1, 0x11140, 0x11143, 0x11174, + 0x11175, 0x111c5, 0x111c9, 0x111cd, 0x111cd, 0x111db, 0x111db, 0x111dd, + 0x111df, 0x11238, 0x1123d, 0x112a9, 0x112a9, 0x1144b, 0x1144f, 0x1145b, + 0x1145b, 0x1145d, 0x1145d, 0x114c6, 0x114c6, 0x115c1, 0x115d7, 0x11641, + 0x11643, 0x11660, 0x1166c, 0x1173c, 0x1173e, 0x11c41, 0x11c45, 0x11c70, + 0x11c71, 0x12470, 0x12474, 0x16a6e, 0x16a6f, 0x16af5, 0x16af5, 0x16b37, + 0x16b3b, 0x16b44, 0x16b44, 0x1bc9f, 0x1bc9f, 0x1da87, 0x1da8b, 0x1e95e, + 0x1e95f, +}; /* CR_Punct */ + +#ifdef USE_UNICODE_PROPERTIES +/* 'Any': - */ +static const OnigCodePoint CR_Any[] = { + 1, + 0x0000, + 0x10ffff, +}; /* CR_Any */ + +/* 'Assigned': - */ +static const OnigCodePoint CR_Assigned[] = { + 638, 0x0000, 0x0377, 0x037a, 0x037f, 0x0384, 0x038a, 0x038c, + 0x038c, 0x038e, 0x03a1, 0x03a3, 0x052f, 0x0531, 0x0556, 0x0559, + 0x055f, 0x0561, 0x0587, 0x0589, 0x058a, 0x058d, 0x058f, 0x0591, + 0x05c7, 0x05d0, 0x05ea, 0x05f0, 0x05f4, 0x0600, 0x061c, 0x061e, + 0x070d, 0x070f, 0x074a, 0x074d, 0x07b1, 0x07c0, 0x07fa, 0x0800, + 0x082d, 0x0830, 0x083e, 0x0840, 0x085b, 0x085e, 0x085e, 0x08a0, + 0x08b4, 0x08b6, 0x08bd, 0x08d4, 0x0983, 0x0985, 0x098c, 0x098f, + 0x0990, 0x0993, 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, + 0x09b9, 0x09bc, 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09ce, 0x09d7, + 0x09d7, 0x09dc, 0x09dd, 0x09df, 0x09e3, 0x09e6, 0x09fb, 0x0a01, + 0x0a03, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, + 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3c, + 0x0a3c, 0x0a3e, 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4d, 0x0a51, + 0x0a51, 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, 0x0a75, 0x0a81, + 0x0a83, 0x0a85, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, + 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, 0x0ac5, 0x0ac7, + 0x0ac9, 0x0acb, 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, 0x0ae3, 0x0ae6, + 0x0af1, 0x0af9, 0x0af9, 0x0b01, 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, + 0x0b10, 0x0b13, 0x0b28, 0x0b2a, 0x0b30, 0x0b32, 0x0b33, 0x0b35, + 0x0b39, 0x0b3c, 0x0b44, 0x0b47, 0x0b48, 0x0b4b, 0x0b4d, 0x0b56, + 0x0b57, 0x0b5c, 0x0b5d, 0x0b5f, 0x0b63, 0x0b66, 0x0b77, 0x0b82, + 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, 0x0b95, 0x0b99, + 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, + 0x0baa, 0x0bae, 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, + 0x0bcd, 0x0bd0, 0x0bd0, 0x0bd7, 0x0bd7, 0x0be6, 0x0bfa, 0x0c00, + 0x0c03, 0x0c05, 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, 0x0c28, 0x0c2a, + 0x0c39, 0x0c3d, 0x0c44, 0x0c46, 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, + 0x0c56, 0x0c58, 0x0c5a, 0x0c60, 0x0c63, 0x0c66, 0x0c6f, 0x0c78, + 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, 0x0ca8, 0x0caa, + 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbc, 0x0cc4, 0x0cc6, 0x0cc8, 0x0cca, + 0x0ccd, 0x0cd5, 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, 0x0ce3, 0x0ce6, + 0x0cef, 0x0cf1, 0x0cf2, 0x0d01, 0x0d03, 0x0d05, 0x0d0c, 0x0d0e, + 0x0d10, 0x0d12, 0x0d3a, 0x0d3d, 0x0d44, 0x0d46, 0x0d48, 0x0d4a, + 0x0d4f, 0x0d54, 0x0d63, 0x0d66, 0x0d7f, 0x0d82, 0x0d83, 0x0d85, + 0x0d96, 0x0d9a, 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, + 0x0dc6, 0x0dca, 0x0dca, 0x0dcf, 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, + 0x0ddf, 0x0de6, 0x0def, 0x0df2, 0x0df4, 0x0e01, 0x0e3a, 0x0e3f, + 0x0e5b, 0x0e81, 0x0e82, 0x0e84, 0x0e84, 0x0e87, 0x0e88, 0x0e8a, + 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, + 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, + 0x0eb9, 0x0ebb, 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, 0x0ec6, 0x0ec8, + 0x0ecd, 0x0ed0, 0x0ed9, 0x0edc, 0x0edf, 0x0f00, 0x0f47, 0x0f49, + 0x0f6c, 0x0f71, 0x0f97, 0x0f99, 0x0fbc, 0x0fbe, 0x0fcc, 0x0fce, + 0x0fda, 0x1000, 0x10c5, 0x10c7, 0x10c7, 0x10cd, 0x10cd, 0x10d0, + 0x1248, 0x124a, 0x124d, 0x1250, 0x1256, 0x1258, 0x1258, 0x125a, + 0x125d, 0x1260, 0x1288, 0x128a, 0x128d, 0x1290, 0x12b0, 0x12b2, + 0x12b5, 0x12b8, 0x12be, 0x12c0, 0x12c0, 0x12c2, 0x12c5, 0x12c8, + 0x12d6, 0x12d8, 0x1310, 0x1312, 0x1315, 0x1318, 0x135a, 0x135d, + 0x137c, 0x1380, 0x1399, 0x13a0, 0x13f5, 0x13f8, 0x13fd, 0x1400, + 0x169c, 0x16a0, 0x16f8, 0x1700, 0x170c, 0x170e, 0x1714, 0x1720, + 0x1736, 0x1740, 0x1753, 0x1760, 0x176c, 0x176e, 0x1770, 0x1772, + 0x1773, 0x1780, 0x17dd, 0x17e0, 0x17e9, 0x17f0, 0x17f9, 0x1800, + 0x180e, 0x1810, 0x1819, 0x1820, 0x1877, 0x1880, 0x18aa, 0x18b0, + 0x18f5, 0x1900, 0x191e, 0x1920, 0x192b, 0x1930, 0x193b, 0x1940, + 0x1940, 0x1944, 0x196d, 0x1970, 0x1974, 0x1980, 0x19ab, 0x19b0, + 0x19c9, 0x19d0, 0x19da, 0x19de, 0x1a1b, 0x1a1e, 0x1a5e, 0x1a60, + 0x1a7c, 0x1a7f, 0x1a89, 0x1a90, 0x1a99, 0x1aa0, 0x1aad, 0x1ab0, + 0x1abe, 0x1b00, 0x1b4b, 0x1b50, 0x1b7c, 0x1b80, 0x1bf3, 0x1bfc, + 0x1c37, 0x1c3b, 0x1c49, 0x1c4d, 0x1c88, 0x1cc0, 0x1cc7, 0x1cd0, + 0x1cf6, 0x1cf8, 0x1cf9, 0x1d00, 0x1df5, 0x1dfb, 0x1f15, 0x1f18, + 0x1f1d, 0x1f20, 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, + 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, + 0x1fb4, 0x1fb6, 0x1fc4, 0x1fc6, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fdd, + 0x1fef, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ffe, 0x2000, 0x2064, 0x2066, + 0x2071, 0x2074, 0x208e, 0x2090, 0x209c, 0x20a0, 0x20be, 0x20d0, + 0x20f0, 0x2100, 0x218b, 0x2190, 0x23fe, 0x2400, 0x2426, 0x2440, + 0x244a, 0x2460, 0x2b73, 0x2b76, 0x2b95, 0x2b98, 0x2bb9, 0x2bbd, + 0x2bc8, 0x2bca, 0x2bd1, 0x2bec, 0x2bef, 0x2c00, 0x2c2e, 0x2c30, + 0x2c5e, 0x2c60, 0x2cf3, 0x2cf9, 0x2d25, 0x2d27, 0x2d27, 0x2d2d, + 0x2d2d, 0x2d30, 0x2d67, 0x2d6f, 0x2d70, 0x2d7f, 0x2d96, 0x2da0, + 0x2da6, 0x2da8, 0x2dae, 0x2db0, 0x2db6, 0x2db8, 0x2dbe, 0x2dc0, + 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, 0x2dd6, 0x2dd8, 0x2dde, 0x2de0, + 0x2e44, 0x2e80, 0x2e99, 0x2e9b, 0x2ef3, 0x2f00, 0x2fd5, 0x2ff0, + 0x2ffb, 0x3000, 0x303f, 0x3041, 0x3096, 0x3099, 0x30ff, 0x3105, + 0x312d, 0x3131, 0x318e, 0x3190, 0x31ba, 0x31c0, 0x31e3, 0x31f0, + 0x321e, 0x3220, 0x32fe, 0x3300, 0x4db5, 0x4dc0, 0x9fd5, 0xa000, + 0xa48c, 0xa490, 0xa4c6, 0xa4d0, 0xa62b, 0xa640, 0xa6f7, 0xa700, + 0xa7ae, 0xa7b0, 0xa7b7, 0xa7f7, 0xa82b, 0xa830, 0xa839, 0xa840, + 0xa877, 0xa880, 0xa8c5, 0xa8ce, 0xa8d9, 0xa8e0, 0xa8fd, 0xa900, + 0xa953, 0xa95f, 0xa97c, 0xa980, 0xa9cd, 0xa9cf, 0xa9d9, 0xa9de, + 0xa9fe, 0xaa00, 0xaa36, 0xaa40, 0xaa4d, 0xaa50, 0xaa59, 0xaa5c, + 0xaac2, 0xaadb, 0xaaf6, 0xab01, 0xab06, 0xab09, 0xab0e, 0xab11, + 0xab16, 0xab20, 0xab26, 0xab28, 0xab2e, 0xab30, 0xab65, 0xab70, + 0xabed, 0xabf0, 0xabf9, 0xac00, 0xd7a3, 0xd7b0, 0xd7c6, 0xd7cb, + 0xd7fb, 0xd800, 0xfa6d, 0xfa70, 0xfad9, 0xfb00, 0xfb06, 0xfb13, + 0xfb17, 0xfb1d, 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, + 0xfb41, 0xfb43, 0xfb44, 0xfb46, 0xfbc1, 0xfbd3, 0xfd3f, 0xfd50, + 0xfd8f, 0xfd92, 0xfdc7, 0xfdf0, 0xfdfd, 0xfe00, 0xfe19, 0xfe20, + 0xfe52, 0xfe54, 0xfe66, 0xfe68, 0xfe6b, 0xfe70, 0xfe74, 0xfe76, + 0xfefc, 0xfeff, 0xfeff, 0xff01, 0xffbe, 0xffc2, 0xffc7, 0xffca, + 0xffcf, 0xffd2, 0xffd7, 0xffda, 0xffdc, 0xffe0, 0xffe6, 0xffe8, + 0xffee, 0xfff9, 0xfffd, 0x10000, 0x1000b, 0x1000d, 0x10026, 0x10028, + 0x1003a, 0x1003c, 0x1003d, 0x1003f, 0x1004d, 0x10050, 0x1005d, 0x10080, + 0x100fa, 0x10100, 0x10102, 0x10107, 0x10133, 0x10137, 0x1018e, 0x10190, + 0x1019b, 0x101a0, 0x101a0, 0x101d0, 0x101fd, 0x10280, 0x1029c, 0x102a0, + 0x102d0, 0x102e0, 0x102fb, 0x10300, 0x10323, 0x10330, 0x1034a, 0x10350, + 0x1037a, 0x10380, 0x1039d, 0x1039f, 0x103c3, 0x103c8, 0x103d5, 0x10400, + 0x1049d, 0x104a0, 0x104a9, 0x104b0, 0x104d3, 0x104d8, 0x104fb, 0x10500, + 0x10527, 0x10530, 0x10563, 0x1056f, 0x1056f, 0x10600, 0x10736, 0x10740, + 0x10755, 0x10760, 0x10767, 0x10800, 0x10805, 0x10808, 0x10808, 0x1080a, + 0x10835, 0x10837, 0x10838, 0x1083c, 0x1083c, 0x1083f, 0x10855, 0x10857, + 0x1089e, 0x108a7, 0x108af, 0x108e0, 0x108f2, 0x108f4, 0x108f5, 0x108fb, + 0x1091b, 0x1091f, 0x10939, 0x1093f, 0x1093f, 0x10980, 0x109b7, 0x109bc, + 0x109cf, 0x109d2, 0x10a03, 0x10a05, 0x10a06, 0x10a0c, 0x10a13, 0x10a15, + 0x10a17, 0x10a19, 0x10a33, 0x10a38, 0x10a3a, 0x10a3f, 0x10a47, 0x10a50, + 0x10a58, 0x10a60, 0x10a9f, 0x10ac0, 0x10ae6, 0x10aeb, 0x10af6, 0x10b00, + 0x10b35, 0x10b39, 0x10b55, 0x10b58, 0x10b72, 0x10b78, 0x10b91, 0x10b99, + 0x10b9c, 0x10ba9, 0x10baf, 0x10c00, 0x10c48, 0x10c80, 0x10cb2, 0x10cc0, + 0x10cf2, 0x10cfa, 0x10cff, 0x10e60, 0x10e7e, 0x11000, 0x1104d, 0x11052, + 0x1106f, 0x1107f, 0x110c1, 0x110d0, 0x110e8, 0x110f0, 0x110f9, 0x11100, + 0x11134, 0x11136, 0x11143, 0x11150, 0x11176, 0x11180, 0x111cd, 0x111d0, + 0x111df, 0x111e1, 0x111f4, 0x11200, 0x11211, 0x11213, 0x1123e, 0x11280, + 0x11286, 0x11288, 0x11288, 0x1128a, 0x1128d, 0x1128f, 0x1129d, 0x1129f, + 0x112a9, 0x112b0, 0x112ea, 0x112f0, 0x112f9, 0x11300, 0x11303, 0x11305, + 0x1130c, 0x1130f, 0x11310, 0x11313, 0x11328, 0x1132a, 0x11330, 0x11332, + 0x11333, 0x11335, 0x11339, 0x1133c, 0x11344, 0x11347, 0x11348, 0x1134b, + 0x1134d, 0x11350, 0x11350, 0x11357, 0x11357, 0x1135d, 0x11363, 0x11366, + 0x1136c, 0x11370, 0x11374, 0x11400, 0x11459, 0x1145b, 0x1145b, 0x1145d, + 0x1145d, 0x11480, 0x114c7, 0x114d0, 0x114d9, 0x11580, 0x115b5, 0x115b8, + 0x115dd, 0x11600, 0x11644, 0x11650, 0x11659, 0x11660, 0x1166c, 0x11680, + 0x116b7, 0x116c0, 0x116c9, 0x11700, 0x11719, 0x1171d, 0x1172b, 0x11730, + 0x1173f, 0x118a0, 0x118f2, 0x118ff, 0x118ff, 0x11ac0, 0x11af8, 0x11c00, + 0x11c08, 0x11c0a, 0x11c36, 0x11c38, 0x11c45, 0x11c50, 0x11c6c, 0x11c70, + 0x11c8f, 0x11c92, 0x11ca7, 0x11ca9, 0x11cb6, 0x12000, 0x12399, 0x12400, + 0x1246e, 0x12470, 0x12474, 0x12480, 0x12543, 0x13000, 0x1342e, 0x14400, + 0x14646, 0x16800, 0x16a38, 0x16a40, 0x16a5e, 0x16a60, 0x16a69, 0x16a6e, + 0x16a6f, 0x16ad0, 0x16aed, 0x16af0, 0x16af5, 0x16b00, 0x16b45, 0x16b50, + 0x16b59, 0x16b5b, 0x16b61, 0x16b63, 0x16b77, 0x16b7d, 0x16b8f, 0x16f00, + 0x16f44, 0x16f50, 0x16f7e, 0x16f8f, 0x16f9f, 0x16fe0, 0x16fe0, 0x17000, + 0x187ec, 0x18800, 0x18af2, 0x1b000, 0x1b001, 0x1bc00, 0x1bc6a, 0x1bc70, + 0x1bc7c, 0x1bc80, 0x1bc88, 0x1bc90, 0x1bc99, 0x1bc9c, 0x1bca3, 0x1d000, + 0x1d0f5, 0x1d100, 0x1d126, 0x1d129, 0x1d1e8, 0x1d200, 0x1d245, 0x1d300, + 0x1d356, 0x1d360, 0x1d371, 0x1d400, 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, + 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, + 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, + 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, + 0x1d53e, 0x1d540, 0x1d544, 0x1d546, 0x1d546, 0x1d54a, 0x1d550, 0x1d552, + 0x1d6a5, 0x1d6a8, 0x1d7cb, 0x1d7ce, 0x1da8b, 0x1da9b, 0x1da9f, 0x1daa1, + 0x1daaf, 0x1e000, 0x1e006, 0x1e008, 0x1e018, 0x1e01b, 0x1e021, 0x1e023, + 0x1e024, 0x1e026, 0x1e02a, 0x1e800, 0x1e8c4, 0x1e8c7, 0x1e8d6, 0x1e900, + 0x1e94a, 0x1e950, 0x1e959, 0x1e95e, 0x1e95f, 0x1ee00, 0x1ee03, 0x1ee05, + 0x1ee1f, 0x1ee21, 0x1ee22, 0x1ee24, 0x1ee24, 0x1ee27, 0x1ee27, 0x1ee29, + 0x1ee32, 0x1ee34, 0x1ee37, 0x1ee39, 0x1ee39, 0x1ee3b, 0x1ee3b, 0x1ee42, + 0x1ee42, 0x1ee47, 0x1ee47, 0x1ee49, 0x1ee49, 0x1ee4b, 0x1ee4b, 0x1ee4d, + 0x1ee4f, 0x1ee51, 0x1ee52, 0x1ee54, 0x1ee54, 0x1ee57, 0x1ee57, 0x1ee59, + 0x1ee59, 0x1ee5b, 0x1ee5b, 0x1ee5d, 0x1ee5d, 0x1ee5f, 0x1ee5f, 0x1ee61, + 0x1ee62, 0x1ee64, 0x1ee64, 0x1ee67, 0x1ee6a, 0x1ee6c, 0x1ee72, 0x1ee74, + 0x1ee77, 0x1ee79, 0x1ee7c, 0x1ee7e, 0x1ee7e, 0x1ee80, 0x1ee89, 0x1ee8b, + 0x1ee9b, 0x1eea1, 0x1eea3, 0x1eea5, 0x1eea9, 0x1eeab, 0x1eebb, 0x1eef0, + 0x1eef1, 0x1f000, 0x1f02b, 0x1f030, 0x1f093, 0x1f0a0, 0x1f0ae, 0x1f0b1, + 0x1f0bf, 0x1f0c1, 0x1f0cf, 0x1f0d1, 0x1f0f5, 0x1f100, 0x1f10c, 0x1f110, + 0x1f12e, 0x1f130, 0x1f16b, 0x1f170, 0x1f1ac, 0x1f1e6, 0x1f202, 0x1f210, + 0x1f23b, 0x1f240, 0x1f248, 0x1f250, 0x1f251, 0x1f300, 0x1f6d2, 0x1f6e0, + 0x1f6ec, 0x1f6f0, 0x1f6f6, 0x1f700, 0x1f773, 0x1f780, 0x1f7d4, 0x1f800, + 0x1f80b, 0x1f810, 0x1f847, 0x1f850, 0x1f859, 0x1f860, 0x1f887, 0x1f890, + 0x1f8ad, 0x1f910, 0x1f91e, 0x1f920, 0x1f927, 0x1f930, 0x1f930, 0x1f933, + 0x1f93e, 0x1f940, 0x1f94b, 0x1f950, 0x1f95e, 0x1f980, 0x1f991, 0x1f9c0, + 0x1f9c0, 0x20000, 0x2a6d6, 0x2a700, 0x2b734, 0x2b740, 0x2b81d, 0x2b820, + 0x2cea1, 0x2f800, 0x2fa1d, 0xe0001, 0xe0001, 0xe0020, 0xe007f, 0xe0100, + 0xe01ef, 0xf0000, 0xffffd, 0x100000, 0x10fffd, +}; /* CR_Assigned */ + +/* 'C': Major Category */ +static const OnigCodePoint CR_C[] = { + 642, 0x0000, 0x001f, 0x007f, 0x009f, 0x00ad, 0x00ad, 0x0378, + 0x0379, 0x0380, 0x0383, 0x038b, 0x038b, 0x038d, 0x038d, 0x03a2, + 0x03a2, 0x0530, 0x0530, 0x0557, 0x0558, 0x0560, 0x0560, 0x0588, + 0x0588, 0x058b, 0x058c, 0x0590, 0x0590, 0x05c8, 0x05cf, 0x05eb, + 0x05ef, 0x05f5, 0x0605, 0x061c, 0x061d, 0x06dd, 0x06dd, 0x070e, + 0x070f, 0x074b, 0x074c, 0x07b2, 0x07bf, 0x07fb, 0x07ff, 0x082e, + 0x082f, 0x083f, 0x083f, 0x085c, 0x085d, 0x085f, 0x089f, 0x08b5, + 0x08b5, 0x08be, 0x08d3, 0x08e2, 0x08e2, 0x0984, 0x0984, 0x098d, + 0x098e, 0x0991, 0x0992, 0x09a9, 0x09a9, 0x09b1, 0x09b1, 0x09b3, + 0x09b5, 0x09ba, 0x09bb, 0x09c5, 0x09c6, 0x09c9, 0x09ca, 0x09cf, + 0x09d6, 0x09d8, 0x09db, 0x09de, 0x09de, 0x09e4, 0x09e5, 0x09fc, + 0x0a00, 0x0a04, 0x0a04, 0x0a0b, 0x0a0e, 0x0a11, 0x0a12, 0x0a29, + 0x0a29, 0x0a31, 0x0a31, 0x0a34, 0x0a34, 0x0a37, 0x0a37, 0x0a3a, + 0x0a3b, 0x0a3d, 0x0a3d, 0x0a43, 0x0a46, 0x0a49, 0x0a4a, 0x0a4e, + 0x0a50, 0x0a52, 0x0a58, 0x0a5d, 0x0a5d, 0x0a5f, 0x0a65, 0x0a76, + 0x0a80, 0x0a84, 0x0a84, 0x0a8e, 0x0a8e, 0x0a92, 0x0a92, 0x0aa9, + 0x0aa9, 0x0ab1, 0x0ab1, 0x0ab4, 0x0ab4, 0x0aba, 0x0abb, 0x0ac6, + 0x0ac6, 0x0aca, 0x0aca, 0x0ace, 0x0acf, 0x0ad1, 0x0adf, 0x0ae4, + 0x0ae5, 0x0af2, 0x0af8, 0x0afa, 0x0b00, 0x0b04, 0x0b04, 0x0b0d, + 0x0b0e, 0x0b11, 0x0b12, 0x0b29, 0x0b29, 0x0b31, 0x0b31, 0x0b34, + 0x0b34, 0x0b3a, 0x0b3b, 0x0b45, 0x0b46, 0x0b49, 0x0b4a, 0x0b4e, + 0x0b55, 0x0b58, 0x0b5b, 0x0b5e, 0x0b5e, 0x0b64, 0x0b65, 0x0b78, + 0x0b81, 0x0b84, 0x0b84, 0x0b8b, 0x0b8d, 0x0b91, 0x0b91, 0x0b96, + 0x0b98, 0x0b9b, 0x0b9b, 0x0b9d, 0x0b9d, 0x0ba0, 0x0ba2, 0x0ba5, + 0x0ba7, 0x0bab, 0x0bad, 0x0bba, 0x0bbd, 0x0bc3, 0x0bc5, 0x0bc9, + 0x0bc9, 0x0bce, 0x0bcf, 0x0bd1, 0x0bd6, 0x0bd8, 0x0be5, 0x0bfb, + 0x0bff, 0x0c04, 0x0c04, 0x0c0d, 0x0c0d, 0x0c11, 0x0c11, 0x0c29, + 0x0c29, 0x0c3a, 0x0c3c, 0x0c45, 0x0c45, 0x0c49, 0x0c49, 0x0c4e, + 0x0c54, 0x0c57, 0x0c57, 0x0c5b, 0x0c5f, 0x0c64, 0x0c65, 0x0c70, + 0x0c77, 0x0c84, 0x0c84, 0x0c8d, 0x0c8d, 0x0c91, 0x0c91, 0x0ca9, + 0x0ca9, 0x0cb4, 0x0cb4, 0x0cba, 0x0cbb, 0x0cc5, 0x0cc5, 0x0cc9, + 0x0cc9, 0x0cce, 0x0cd4, 0x0cd7, 0x0cdd, 0x0cdf, 0x0cdf, 0x0ce4, + 0x0ce5, 0x0cf0, 0x0cf0, 0x0cf3, 0x0d00, 0x0d04, 0x0d04, 0x0d0d, + 0x0d0d, 0x0d11, 0x0d11, 0x0d3b, 0x0d3c, 0x0d45, 0x0d45, 0x0d49, + 0x0d49, 0x0d50, 0x0d53, 0x0d64, 0x0d65, 0x0d80, 0x0d81, 0x0d84, + 0x0d84, 0x0d97, 0x0d99, 0x0db2, 0x0db2, 0x0dbc, 0x0dbc, 0x0dbe, + 0x0dbf, 0x0dc7, 0x0dc9, 0x0dcb, 0x0dce, 0x0dd5, 0x0dd5, 0x0dd7, + 0x0dd7, 0x0de0, 0x0de5, 0x0df0, 0x0df1, 0x0df5, 0x0e00, 0x0e3b, + 0x0e3e, 0x0e5c, 0x0e80, 0x0e83, 0x0e83, 0x0e85, 0x0e86, 0x0e89, + 0x0e89, 0x0e8b, 0x0e8c, 0x0e8e, 0x0e93, 0x0e98, 0x0e98, 0x0ea0, + 0x0ea0, 0x0ea4, 0x0ea4, 0x0ea6, 0x0ea6, 0x0ea8, 0x0ea9, 0x0eac, + 0x0eac, 0x0eba, 0x0eba, 0x0ebe, 0x0ebf, 0x0ec5, 0x0ec5, 0x0ec7, + 0x0ec7, 0x0ece, 0x0ecf, 0x0eda, 0x0edb, 0x0ee0, 0x0eff, 0x0f48, + 0x0f48, 0x0f6d, 0x0f70, 0x0f98, 0x0f98, 0x0fbd, 0x0fbd, 0x0fcd, + 0x0fcd, 0x0fdb, 0x0fff, 0x10c6, 0x10c6, 0x10c8, 0x10cc, 0x10ce, + 0x10cf, 0x1249, 0x1249, 0x124e, 0x124f, 0x1257, 0x1257, 0x1259, + 0x1259, 0x125e, 0x125f, 0x1289, 0x1289, 0x128e, 0x128f, 0x12b1, + 0x12b1, 0x12b6, 0x12b7, 0x12bf, 0x12bf, 0x12c1, 0x12c1, 0x12c6, + 0x12c7, 0x12d7, 0x12d7, 0x1311, 0x1311, 0x1316, 0x1317, 0x135b, + 0x135c, 0x137d, 0x137f, 0x139a, 0x139f, 0x13f6, 0x13f7, 0x13fe, + 0x13ff, 0x169d, 0x169f, 0x16f9, 0x16ff, 0x170d, 0x170d, 0x1715, + 0x171f, 0x1737, 0x173f, 0x1754, 0x175f, 0x176d, 0x176d, 0x1771, + 0x1771, 0x1774, 0x177f, 0x17de, 0x17df, 0x17ea, 0x17ef, 0x17fa, + 0x17ff, 0x180e, 0x180f, 0x181a, 0x181f, 0x1878, 0x187f, 0x18ab, + 0x18af, 0x18f6, 0x18ff, 0x191f, 0x191f, 0x192c, 0x192f, 0x193c, + 0x193f, 0x1941, 0x1943, 0x196e, 0x196f, 0x1975, 0x197f, 0x19ac, + 0x19af, 0x19ca, 0x19cf, 0x19db, 0x19dd, 0x1a1c, 0x1a1d, 0x1a5f, + 0x1a5f, 0x1a7d, 0x1a7e, 0x1a8a, 0x1a8f, 0x1a9a, 0x1a9f, 0x1aae, + 0x1aaf, 0x1abf, 0x1aff, 0x1b4c, 0x1b4f, 0x1b7d, 0x1b7f, 0x1bf4, + 0x1bfb, 0x1c38, 0x1c3a, 0x1c4a, 0x1c4c, 0x1c89, 0x1cbf, 0x1cc8, + 0x1ccf, 0x1cf7, 0x1cf7, 0x1cfa, 0x1cff, 0x1df6, 0x1dfa, 0x1f16, + 0x1f17, 0x1f1e, 0x1f1f, 0x1f46, 0x1f47, 0x1f4e, 0x1f4f, 0x1f58, + 0x1f58, 0x1f5a, 0x1f5a, 0x1f5c, 0x1f5c, 0x1f5e, 0x1f5e, 0x1f7e, + 0x1f7f, 0x1fb5, 0x1fb5, 0x1fc5, 0x1fc5, 0x1fd4, 0x1fd5, 0x1fdc, + 0x1fdc, 0x1ff0, 0x1ff1, 0x1ff5, 0x1ff5, 0x1fff, 0x1fff, 0x200b, + 0x200f, 0x202a, 0x202e, 0x2060, 0x206f, 0x2072, 0x2073, 0x208f, + 0x208f, 0x209d, 0x209f, 0x20bf, 0x20cf, 0x20f1, 0x20ff, 0x218c, + 0x218f, 0x23ff, 0x23ff, 0x2427, 0x243f, 0x244b, 0x245f, 0x2b74, + 0x2b75, 0x2b96, 0x2b97, 0x2bba, 0x2bbc, 0x2bc9, 0x2bc9, 0x2bd2, + 0x2beb, 0x2bf0, 0x2bff, 0x2c2f, 0x2c2f, 0x2c5f, 0x2c5f, 0x2cf4, + 0x2cf8, 0x2d26, 0x2d26, 0x2d28, 0x2d2c, 0x2d2e, 0x2d2f, 0x2d68, + 0x2d6e, 0x2d71, 0x2d7e, 0x2d97, 0x2d9f, 0x2da7, 0x2da7, 0x2daf, + 0x2daf, 0x2db7, 0x2db7, 0x2dbf, 0x2dbf, 0x2dc7, 0x2dc7, 0x2dcf, + 0x2dcf, 0x2dd7, 0x2dd7, 0x2ddf, 0x2ddf, 0x2e45, 0x2e7f, 0x2e9a, + 0x2e9a, 0x2ef4, 0x2eff, 0x2fd6, 0x2fef, 0x2ffc, 0x2fff, 0x3040, + 0x3040, 0x3097, 0x3098, 0x3100, 0x3104, 0x312e, 0x3130, 0x318f, + 0x318f, 0x31bb, 0x31bf, 0x31e4, 0x31ef, 0x321f, 0x321f, 0x32ff, + 0x32ff, 0x4db6, 0x4dbf, 0x9fd6, 0x9fff, 0xa48d, 0xa48f, 0xa4c7, + 0xa4cf, 0xa62c, 0xa63f, 0xa6f8, 0xa6ff, 0xa7af, 0xa7af, 0xa7b8, + 0xa7f6, 0xa82c, 0xa82f, 0xa83a, 0xa83f, 0xa878, 0xa87f, 0xa8c6, + 0xa8cd, 0xa8da, 0xa8df, 0xa8fe, 0xa8ff, 0xa954, 0xa95e, 0xa97d, + 0xa97f, 0xa9ce, 0xa9ce, 0xa9da, 0xa9dd, 0xa9ff, 0xa9ff, 0xaa37, + 0xaa3f, 0xaa4e, 0xaa4f, 0xaa5a, 0xaa5b, 0xaac3, 0xaada, 0xaaf7, + 0xab00, 0xab07, 0xab08, 0xab0f, 0xab10, 0xab17, 0xab1f, 0xab27, + 0xab27, 0xab2f, 0xab2f, 0xab66, 0xab6f, 0xabee, 0xabef, 0xabfa, + 0xabff, 0xd7a4, 0xd7af, 0xd7c7, 0xd7ca, 0xd7fc, 0xf8ff, 0xfa6e, + 0xfa6f, 0xfada, 0xfaff, 0xfb07, 0xfb12, 0xfb18, 0xfb1c, 0xfb37, + 0xfb37, 0xfb3d, 0xfb3d, 0xfb3f, 0xfb3f, 0xfb42, 0xfb42, 0xfb45, + 0xfb45, 0xfbc2, 0xfbd2, 0xfd40, 0xfd4f, 0xfd90, 0xfd91, 0xfdc8, + 0xfdef, 0xfdfe, 0xfdff, 0xfe1a, 0xfe1f, 0xfe53, 0xfe53, 0xfe67, + 0xfe67, 0xfe6c, 0xfe6f, 0xfe75, 0xfe75, 0xfefd, 0xff00, 0xffbf, + 0xffc1, 0xffc8, 0xffc9, 0xffd0, 0xffd1, 0xffd8, 0xffd9, 0xffdd, + 0xffdf, 0xffe7, 0xffe7, 0xffef, 0xfffb, 0xfffe, 0xffff, 0x1000c, + 0x1000c, 0x10027, 0x10027, 0x1003b, 0x1003b, 0x1003e, 0x1003e, 0x1004e, + 0x1004f, 0x1005e, 0x1007f, 0x100fb, 0x100ff, 0x10103, 0x10106, 0x10134, + 0x10136, 0x1018f, 0x1018f, 0x1019c, 0x1019f, 0x101a1, 0x101cf, 0x101fe, + 0x1027f, 0x1029d, 0x1029f, 0x102d1, 0x102df, 0x102fc, 0x102ff, 0x10324, + 0x1032f, 0x1034b, 0x1034f, 0x1037b, 0x1037f, 0x1039e, 0x1039e, 0x103c4, + 0x103c7, 0x103d6, 0x103ff, 0x1049e, 0x1049f, 0x104aa, 0x104af, 0x104d4, + 0x104d7, 0x104fc, 0x104ff, 0x10528, 0x1052f, 0x10564, 0x1056e, 0x10570, + 0x105ff, 0x10737, 0x1073f, 0x10756, 0x1075f, 0x10768, 0x107ff, 0x10806, + 0x10807, 0x10809, 0x10809, 0x10836, 0x10836, 0x10839, 0x1083b, 0x1083d, + 0x1083e, 0x10856, 0x10856, 0x1089f, 0x108a6, 0x108b0, 0x108df, 0x108f3, + 0x108f3, 0x108f6, 0x108fa, 0x1091c, 0x1091e, 0x1093a, 0x1093e, 0x10940, + 0x1097f, 0x109b8, 0x109bb, 0x109d0, 0x109d1, 0x10a04, 0x10a04, 0x10a07, + 0x10a0b, 0x10a14, 0x10a14, 0x10a18, 0x10a18, 0x10a34, 0x10a37, 0x10a3b, + 0x10a3e, 0x10a48, 0x10a4f, 0x10a59, 0x10a5f, 0x10aa0, 0x10abf, 0x10ae7, + 0x10aea, 0x10af7, 0x10aff, 0x10b36, 0x10b38, 0x10b56, 0x10b57, 0x10b73, + 0x10b77, 0x10b92, 0x10b98, 0x10b9d, 0x10ba8, 0x10bb0, 0x10bff, 0x10c49, + 0x10c7f, 0x10cb3, 0x10cbf, 0x10cf3, 0x10cf9, 0x10d00, 0x10e5f, 0x10e7f, + 0x10fff, 0x1104e, 0x11051, 0x11070, 0x1107e, 0x110bd, 0x110bd, 0x110c2, + 0x110cf, 0x110e9, 0x110ef, 0x110fa, 0x110ff, 0x11135, 0x11135, 0x11144, + 0x1114f, 0x11177, 0x1117f, 0x111ce, 0x111cf, 0x111e0, 0x111e0, 0x111f5, + 0x111ff, 0x11212, 0x11212, 0x1123f, 0x1127f, 0x11287, 0x11287, 0x11289, + 0x11289, 0x1128e, 0x1128e, 0x1129e, 0x1129e, 0x112aa, 0x112af, 0x112eb, + 0x112ef, 0x112fa, 0x112ff, 0x11304, 0x11304, 0x1130d, 0x1130e, 0x11311, + 0x11312, 0x11329, 0x11329, 0x11331, 0x11331, 0x11334, 0x11334, 0x1133a, + 0x1133b, 0x11345, 0x11346, 0x11349, 0x1134a, 0x1134e, 0x1134f, 0x11351, + 0x11356, 0x11358, 0x1135c, 0x11364, 0x11365, 0x1136d, 0x1136f, 0x11375, + 0x113ff, 0x1145a, 0x1145a, 0x1145c, 0x1145c, 0x1145e, 0x1147f, 0x114c8, + 0x114cf, 0x114da, 0x1157f, 0x115b6, 0x115b7, 0x115de, 0x115ff, 0x11645, + 0x1164f, 0x1165a, 0x1165f, 0x1166d, 0x1167f, 0x116b8, 0x116bf, 0x116ca, + 0x116ff, 0x1171a, 0x1171c, 0x1172c, 0x1172f, 0x11740, 0x1189f, 0x118f3, + 0x118fe, 0x11900, 0x11abf, 0x11af9, 0x11bff, 0x11c09, 0x11c09, 0x11c37, + 0x11c37, 0x11c46, 0x11c4f, 0x11c6d, 0x11c6f, 0x11c90, 0x11c91, 0x11ca8, + 0x11ca8, 0x11cb7, 0x11fff, 0x1239a, 0x123ff, 0x1246f, 0x1246f, 0x12475, + 0x1247f, 0x12544, 0x12fff, 0x1342f, 0x143ff, 0x14647, 0x167ff, 0x16a39, + 0x16a3f, 0x16a5f, 0x16a5f, 0x16a6a, 0x16a6d, 0x16a70, 0x16acf, 0x16aee, + 0x16aef, 0x16af6, 0x16aff, 0x16b46, 0x16b4f, 0x16b5a, 0x16b5a, 0x16b62, + 0x16b62, 0x16b78, 0x16b7c, 0x16b90, 0x16eff, 0x16f45, 0x16f4f, 0x16f7f, + 0x16f8e, 0x16fa0, 0x16fdf, 0x16fe1, 0x16fff, 0x187ed, 0x187ff, 0x18af3, + 0x1afff, 0x1b002, 0x1bbff, 0x1bc6b, 0x1bc6f, 0x1bc7d, 0x1bc7f, 0x1bc89, + 0x1bc8f, 0x1bc9a, 0x1bc9b, 0x1bca0, 0x1cfff, 0x1d0f6, 0x1d0ff, 0x1d127, + 0x1d128, 0x1d173, 0x1d17a, 0x1d1e9, 0x1d1ff, 0x1d246, 0x1d2ff, 0x1d357, + 0x1d35f, 0x1d372, 0x1d3ff, 0x1d455, 0x1d455, 0x1d49d, 0x1d49d, 0x1d4a0, + 0x1d4a1, 0x1d4a3, 0x1d4a4, 0x1d4a7, 0x1d4a8, 0x1d4ad, 0x1d4ad, 0x1d4ba, + 0x1d4ba, 0x1d4bc, 0x1d4bc, 0x1d4c4, 0x1d4c4, 0x1d506, 0x1d506, 0x1d50b, + 0x1d50c, 0x1d515, 0x1d515, 0x1d51d, 0x1d51d, 0x1d53a, 0x1d53a, 0x1d53f, + 0x1d53f, 0x1d545, 0x1d545, 0x1d547, 0x1d549, 0x1d551, 0x1d551, 0x1d6a6, + 0x1d6a7, 0x1d7cc, 0x1d7cd, 0x1da8c, 0x1da9a, 0x1daa0, 0x1daa0, 0x1dab0, + 0x1dfff, 0x1e007, 0x1e007, 0x1e019, 0x1e01a, 0x1e022, 0x1e022, 0x1e025, + 0x1e025, 0x1e02b, 0x1e7ff, 0x1e8c5, 0x1e8c6, 0x1e8d7, 0x1e8ff, 0x1e94b, + 0x1e94f, 0x1e95a, 0x1e95d, 0x1e960, 0x1edff, 0x1ee04, 0x1ee04, 0x1ee20, + 0x1ee20, 0x1ee23, 0x1ee23, 0x1ee25, 0x1ee26, 0x1ee28, 0x1ee28, 0x1ee33, + 0x1ee33, 0x1ee38, 0x1ee38, 0x1ee3a, 0x1ee3a, 0x1ee3c, 0x1ee41, 0x1ee43, + 0x1ee46, 0x1ee48, 0x1ee48, 0x1ee4a, 0x1ee4a, 0x1ee4c, 0x1ee4c, 0x1ee50, + 0x1ee50, 0x1ee53, 0x1ee53, 0x1ee55, 0x1ee56, 0x1ee58, 0x1ee58, 0x1ee5a, + 0x1ee5a, 0x1ee5c, 0x1ee5c, 0x1ee5e, 0x1ee5e, 0x1ee60, 0x1ee60, 0x1ee63, + 0x1ee63, 0x1ee65, 0x1ee66, 0x1ee6b, 0x1ee6b, 0x1ee73, 0x1ee73, 0x1ee78, + 0x1ee78, 0x1ee7d, 0x1ee7d, 0x1ee7f, 0x1ee7f, 0x1ee8a, 0x1ee8a, 0x1ee9c, + 0x1eea0, 0x1eea4, 0x1eea4, 0x1eeaa, 0x1eeaa, 0x1eebc, 0x1eeef, 0x1eef2, + 0x1efff, 0x1f02c, 0x1f02f, 0x1f094, 0x1f09f, 0x1f0af, 0x1f0b0, 0x1f0c0, + 0x1f0c0, 0x1f0d0, 0x1f0d0, 0x1f0f6, 0x1f0ff, 0x1f10d, 0x1f10f, 0x1f12f, + 0x1f12f, 0x1f16c, 0x1f16f, 0x1f1ad, 0x1f1e5, 0x1f203, 0x1f20f, 0x1f23c, + 0x1f23f, 0x1f249, 0x1f24f, 0x1f252, 0x1f2ff, 0x1f6d3, 0x1f6df, 0x1f6ed, + 0x1f6ef, 0x1f6f7, 0x1f6ff, 0x1f774, 0x1f77f, 0x1f7d5, 0x1f7ff, 0x1f80c, + 0x1f80f, 0x1f848, 0x1f84f, 0x1f85a, 0x1f85f, 0x1f888, 0x1f88f, 0x1f8ae, + 0x1f90f, 0x1f91f, 0x1f91f, 0x1f928, 0x1f92f, 0x1f931, 0x1f932, 0x1f93f, + 0x1f93f, 0x1f94c, 0x1f94f, 0x1f95f, 0x1f97f, 0x1f992, 0x1f9bf, 0x1f9c1, + 0x1ffff, 0x2a6d7, 0x2a6ff, 0x2b735, 0x2b73f, 0x2b81e, 0x2b81f, 0x2cea2, + 0x2f7ff, 0x2fa1e, 0xe00ff, 0xe01f0, 0x10ffff, +}; /* CR_C */ + +/* 'Cc': General Category */ +# define CR_Cc CR_Cntrl + +/* 'Cf': General Category */ +static const OnigCodePoint CR_Cf[] = { + 18, 0x00ad, 0x00ad, 0x0600, 0x0605, 0x061c, 0x061c, 0x06dd, + 0x06dd, 0x070f, 0x070f, 0x08e2, 0x08e2, 0x180e, 0x180e, 0x200b, + 0x200f, 0x202a, 0x202e, 0x2060, 0x2064, 0x2066, 0x206f, 0xfeff, + 0xfeff, 0xfff9, 0xfffb, 0x110bd, 0x110bd, 0x1bca0, 0x1bca3, 0x1d173, + 0x1d17a, 0xe0001, 0xe0001, 0xe0020, 0xe007f, +}; /* CR_Cf */ + +/* 'Cn': General Category */ +static const OnigCodePoint CR_Cn[] = { + 638, 0x0378, 0x0379, 0x0380, 0x0383, 0x038b, 0x038b, 0x038d, + 0x038d, 0x03a2, 0x03a2, 0x0530, 0x0530, 0x0557, 0x0558, 0x0560, + 0x0560, 0x0588, 0x0588, 0x058b, 0x058c, 0x0590, 0x0590, 0x05c8, + 0x05cf, 0x05eb, 0x05ef, 0x05f5, 0x05ff, 0x061d, 0x061d, 0x070e, + 0x070e, 0x074b, 0x074c, 0x07b2, 0x07bf, 0x07fb, 0x07ff, 0x082e, + 0x082f, 0x083f, 0x083f, 0x085c, 0x085d, 0x085f, 0x089f, 0x08b5, + 0x08b5, 0x08be, 0x08d3, 0x0984, 0x0984, 0x098d, 0x098e, 0x0991, + 0x0992, 0x09a9, 0x09a9, 0x09b1, 0x09b1, 0x09b3, 0x09b5, 0x09ba, + 0x09bb, 0x09c5, 0x09c6, 0x09c9, 0x09ca, 0x09cf, 0x09d6, 0x09d8, + 0x09db, 0x09de, 0x09de, 0x09e4, 0x09e5, 0x09fc, 0x0a00, 0x0a04, + 0x0a04, 0x0a0b, 0x0a0e, 0x0a11, 0x0a12, 0x0a29, 0x0a29, 0x0a31, + 0x0a31, 0x0a34, 0x0a34, 0x0a37, 0x0a37, 0x0a3a, 0x0a3b, 0x0a3d, + 0x0a3d, 0x0a43, 0x0a46, 0x0a49, 0x0a4a, 0x0a4e, 0x0a50, 0x0a52, + 0x0a58, 0x0a5d, 0x0a5d, 0x0a5f, 0x0a65, 0x0a76, 0x0a80, 0x0a84, + 0x0a84, 0x0a8e, 0x0a8e, 0x0a92, 0x0a92, 0x0aa9, 0x0aa9, 0x0ab1, + 0x0ab1, 0x0ab4, 0x0ab4, 0x0aba, 0x0abb, 0x0ac6, 0x0ac6, 0x0aca, + 0x0aca, 0x0ace, 0x0acf, 0x0ad1, 0x0adf, 0x0ae4, 0x0ae5, 0x0af2, + 0x0af8, 0x0afa, 0x0b00, 0x0b04, 0x0b04, 0x0b0d, 0x0b0e, 0x0b11, + 0x0b12, 0x0b29, 0x0b29, 0x0b31, 0x0b31, 0x0b34, 0x0b34, 0x0b3a, + 0x0b3b, 0x0b45, 0x0b46, 0x0b49, 0x0b4a, 0x0b4e, 0x0b55, 0x0b58, + 0x0b5b, 0x0b5e, 0x0b5e, 0x0b64, 0x0b65, 0x0b78, 0x0b81, 0x0b84, + 0x0b84, 0x0b8b, 0x0b8d, 0x0b91, 0x0b91, 0x0b96, 0x0b98, 0x0b9b, + 0x0b9b, 0x0b9d, 0x0b9d, 0x0ba0, 0x0ba2, 0x0ba5, 0x0ba7, 0x0bab, + 0x0bad, 0x0bba, 0x0bbd, 0x0bc3, 0x0bc5, 0x0bc9, 0x0bc9, 0x0bce, + 0x0bcf, 0x0bd1, 0x0bd6, 0x0bd8, 0x0be5, 0x0bfb, 0x0bff, 0x0c04, + 0x0c04, 0x0c0d, 0x0c0d, 0x0c11, 0x0c11, 0x0c29, 0x0c29, 0x0c3a, + 0x0c3c, 0x0c45, 0x0c45, 0x0c49, 0x0c49, 0x0c4e, 0x0c54, 0x0c57, + 0x0c57, 0x0c5b, 0x0c5f, 0x0c64, 0x0c65, 0x0c70, 0x0c77, 0x0c84, + 0x0c84, 0x0c8d, 0x0c8d, 0x0c91, 0x0c91, 0x0ca9, 0x0ca9, 0x0cb4, + 0x0cb4, 0x0cba, 0x0cbb, 0x0cc5, 0x0cc5, 0x0cc9, 0x0cc9, 0x0cce, + 0x0cd4, 0x0cd7, 0x0cdd, 0x0cdf, 0x0cdf, 0x0ce4, 0x0ce5, 0x0cf0, + 0x0cf0, 0x0cf3, 0x0d00, 0x0d04, 0x0d04, 0x0d0d, 0x0d0d, 0x0d11, + 0x0d11, 0x0d3b, 0x0d3c, 0x0d45, 0x0d45, 0x0d49, 0x0d49, 0x0d50, + 0x0d53, 0x0d64, 0x0d65, 0x0d80, 0x0d81, 0x0d84, 0x0d84, 0x0d97, + 0x0d99, 0x0db2, 0x0db2, 0x0dbc, 0x0dbc, 0x0dbe, 0x0dbf, 0x0dc7, + 0x0dc9, 0x0dcb, 0x0dce, 0x0dd5, 0x0dd5, 0x0dd7, 0x0dd7, 0x0de0, + 0x0de5, 0x0df0, 0x0df1, 0x0df5, 0x0e00, 0x0e3b, 0x0e3e, 0x0e5c, + 0x0e80, 0x0e83, 0x0e83, 0x0e85, 0x0e86, 0x0e89, 0x0e89, 0x0e8b, + 0x0e8c, 0x0e8e, 0x0e93, 0x0e98, 0x0e98, 0x0ea0, 0x0ea0, 0x0ea4, + 0x0ea4, 0x0ea6, 0x0ea6, 0x0ea8, 0x0ea9, 0x0eac, 0x0eac, 0x0eba, + 0x0eba, 0x0ebe, 0x0ebf, 0x0ec5, 0x0ec5, 0x0ec7, 0x0ec7, 0x0ece, + 0x0ecf, 0x0eda, 0x0edb, 0x0ee0, 0x0eff, 0x0f48, 0x0f48, 0x0f6d, + 0x0f70, 0x0f98, 0x0f98, 0x0fbd, 0x0fbd, 0x0fcd, 0x0fcd, 0x0fdb, + 0x0fff, 0x10c6, 0x10c6, 0x10c8, 0x10cc, 0x10ce, 0x10cf, 0x1249, + 0x1249, 0x124e, 0x124f, 0x1257, 0x1257, 0x1259, 0x1259, 0x125e, + 0x125f, 0x1289, 0x1289, 0x128e, 0x128f, 0x12b1, 0x12b1, 0x12b6, + 0x12b7, 0x12bf, 0x12bf, 0x12c1, 0x12c1, 0x12c6, 0x12c7, 0x12d7, + 0x12d7, 0x1311, 0x1311, 0x1316, 0x1317, 0x135b, 0x135c, 0x137d, + 0x137f, 0x139a, 0x139f, 0x13f6, 0x13f7, 0x13fe, 0x13ff, 0x169d, + 0x169f, 0x16f9, 0x16ff, 0x170d, 0x170d, 0x1715, 0x171f, 0x1737, + 0x173f, 0x1754, 0x175f, 0x176d, 0x176d, 0x1771, 0x1771, 0x1774, + 0x177f, 0x17de, 0x17df, 0x17ea, 0x17ef, 0x17fa, 0x17ff, 0x180f, + 0x180f, 0x181a, 0x181f, 0x1878, 0x187f, 0x18ab, 0x18af, 0x18f6, + 0x18ff, 0x191f, 0x191f, 0x192c, 0x192f, 0x193c, 0x193f, 0x1941, + 0x1943, 0x196e, 0x196f, 0x1975, 0x197f, 0x19ac, 0x19af, 0x19ca, + 0x19cf, 0x19db, 0x19dd, 0x1a1c, 0x1a1d, 0x1a5f, 0x1a5f, 0x1a7d, + 0x1a7e, 0x1a8a, 0x1a8f, 0x1a9a, 0x1a9f, 0x1aae, 0x1aaf, 0x1abf, + 0x1aff, 0x1b4c, 0x1b4f, 0x1b7d, 0x1b7f, 0x1bf4, 0x1bfb, 0x1c38, + 0x1c3a, 0x1c4a, 0x1c4c, 0x1c89, 0x1cbf, 0x1cc8, 0x1ccf, 0x1cf7, + 0x1cf7, 0x1cfa, 0x1cff, 0x1df6, 0x1dfa, 0x1f16, 0x1f17, 0x1f1e, + 0x1f1f, 0x1f46, 0x1f47, 0x1f4e, 0x1f4f, 0x1f58, 0x1f58, 0x1f5a, + 0x1f5a, 0x1f5c, 0x1f5c, 0x1f5e, 0x1f5e, 0x1f7e, 0x1f7f, 0x1fb5, + 0x1fb5, 0x1fc5, 0x1fc5, 0x1fd4, 0x1fd5, 0x1fdc, 0x1fdc, 0x1ff0, + 0x1ff1, 0x1ff5, 0x1ff5, 0x1fff, 0x1fff, 0x2065, 0x2065, 0x2072, + 0x2073, 0x208f, 0x208f, 0x209d, 0x209f, 0x20bf, 0x20cf, 0x20f1, + 0x20ff, 0x218c, 0x218f, 0x23ff, 0x23ff, 0x2427, 0x243f, 0x244b, + 0x245f, 0x2b74, 0x2b75, 0x2b96, 0x2b97, 0x2bba, 0x2bbc, 0x2bc9, + 0x2bc9, 0x2bd2, 0x2beb, 0x2bf0, 0x2bff, 0x2c2f, 0x2c2f, 0x2c5f, + 0x2c5f, 0x2cf4, 0x2cf8, 0x2d26, 0x2d26, 0x2d28, 0x2d2c, 0x2d2e, + 0x2d2f, 0x2d68, 0x2d6e, 0x2d71, 0x2d7e, 0x2d97, 0x2d9f, 0x2da7, + 0x2da7, 0x2daf, 0x2daf, 0x2db7, 0x2db7, 0x2dbf, 0x2dbf, 0x2dc7, + 0x2dc7, 0x2dcf, 0x2dcf, 0x2dd7, 0x2dd7, 0x2ddf, 0x2ddf, 0x2e45, + 0x2e7f, 0x2e9a, 0x2e9a, 0x2ef4, 0x2eff, 0x2fd6, 0x2fef, 0x2ffc, + 0x2fff, 0x3040, 0x3040, 0x3097, 0x3098, 0x3100, 0x3104, 0x312e, + 0x3130, 0x318f, 0x318f, 0x31bb, 0x31bf, 0x31e4, 0x31ef, 0x321f, + 0x321f, 0x32ff, 0x32ff, 0x4db6, 0x4dbf, 0x9fd6, 0x9fff, 0xa48d, + 0xa48f, 0xa4c7, 0xa4cf, 0xa62c, 0xa63f, 0xa6f8, 0xa6ff, 0xa7af, + 0xa7af, 0xa7b8, 0xa7f6, 0xa82c, 0xa82f, 0xa83a, 0xa83f, 0xa878, + 0xa87f, 0xa8c6, 0xa8cd, 0xa8da, 0xa8df, 0xa8fe, 0xa8ff, 0xa954, + 0xa95e, 0xa97d, 0xa97f, 0xa9ce, 0xa9ce, 0xa9da, 0xa9dd, 0xa9ff, + 0xa9ff, 0xaa37, 0xaa3f, 0xaa4e, 0xaa4f, 0xaa5a, 0xaa5b, 0xaac3, + 0xaada, 0xaaf7, 0xab00, 0xab07, 0xab08, 0xab0f, 0xab10, 0xab17, + 0xab1f, 0xab27, 0xab27, 0xab2f, 0xab2f, 0xab66, 0xab6f, 0xabee, + 0xabef, 0xabfa, 0xabff, 0xd7a4, 0xd7af, 0xd7c7, 0xd7ca, 0xd7fc, + 0xd7ff, 0xfa6e, 0xfa6f, 0xfada, 0xfaff, 0xfb07, 0xfb12, 0xfb18, + 0xfb1c, 0xfb37, 0xfb37, 0xfb3d, 0xfb3d, 0xfb3f, 0xfb3f, 0xfb42, + 0xfb42, 0xfb45, 0xfb45, 0xfbc2, 0xfbd2, 0xfd40, 0xfd4f, 0xfd90, + 0xfd91, 0xfdc8, 0xfdef, 0xfdfe, 0xfdff, 0xfe1a, 0xfe1f, 0xfe53, + 0xfe53, 0xfe67, 0xfe67, 0xfe6c, 0xfe6f, 0xfe75, 0xfe75, 0xfefd, + 0xfefe, 0xff00, 0xff00, 0xffbf, 0xffc1, 0xffc8, 0xffc9, 0xffd0, + 0xffd1, 0xffd8, 0xffd9, 0xffdd, 0xffdf, 0xffe7, 0xffe7, 0xffef, + 0xfff8, 0xfffe, 0xffff, 0x1000c, 0x1000c, 0x10027, 0x10027, 0x1003b, + 0x1003b, 0x1003e, 0x1003e, 0x1004e, 0x1004f, 0x1005e, 0x1007f, 0x100fb, + 0x100ff, 0x10103, 0x10106, 0x10134, 0x10136, 0x1018f, 0x1018f, 0x1019c, + 0x1019f, 0x101a1, 0x101cf, 0x101fe, 0x1027f, 0x1029d, 0x1029f, 0x102d1, + 0x102df, 0x102fc, 0x102ff, 0x10324, 0x1032f, 0x1034b, 0x1034f, 0x1037b, + 0x1037f, 0x1039e, 0x1039e, 0x103c4, 0x103c7, 0x103d6, 0x103ff, 0x1049e, + 0x1049f, 0x104aa, 0x104af, 0x104d4, 0x104d7, 0x104fc, 0x104ff, 0x10528, + 0x1052f, 0x10564, 0x1056e, 0x10570, 0x105ff, 0x10737, 0x1073f, 0x10756, + 0x1075f, 0x10768, 0x107ff, 0x10806, 0x10807, 0x10809, 0x10809, 0x10836, + 0x10836, 0x10839, 0x1083b, 0x1083d, 0x1083e, 0x10856, 0x10856, 0x1089f, + 0x108a6, 0x108b0, 0x108df, 0x108f3, 0x108f3, 0x108f6, 0x108fa, 0x1091c, + 0x1091e, 0x1093a, 0x1093e, 0x10940, 0x1097f, 0x109b8, 0x109bb, 0x109d0, + 0x109d1, 0x10a04, 0x10a04, 0x10a07, 0x10a0b, 0x10a14, 0x10a14, 0x10a18, + 0x10a18, 0x10a34, 0x10a37, 0x10a3b, 0x10a3e, 0x10a48, 0x10a4f, 0x10a59, + 0x10a5f, 0x10aa0, 0x10abf, 0x10ae7, 0x10aea, 0x10af7, 0x10aff, 0x10b36, + 0x10b38, 0x10b56, 0x10b57, 0x10b73, 0x10b77, 0x10b92, 0x10b98, 0x10b9d, + 0x10ba8, 0x10bb0, 0x10bff, 0x10c49, 0x10c7f, 0x10cb3, 0x10cbf, 0x10cf3, + 0x10cf9, 0x10d00, 0x10e5f, 0x10e7f, 0x10fff, 0x1104e, 0x11051, 0x11070, + 0x1107e, 0x110c2, 0x110cf, 0x110e9, 0x110ef, 0x110fa, 0x110ff, 0x11135, + 0x11135, 0x11144, 0x1114f, 0x11177, 0x1117f, 0x111ce, 0x111cf, 0x111e0, + 0x111e0, 0x111f5, 0x111ff, 0x11212, 0x11212, 0x1123f, 0x1127f, 0x11287, + 0x11287, 0x11289, 0x11289, 0x1128e, 0x1128e, 0x1129e, 0x1129e, 0x112aa, + 0x112af, 0x112eb, 0x112ef, 0x112fa, 0x112ff, 0x11304, 0x11304, 0x1130d, + 0x1130e, 0x11311, 0x11312, 0x11329, 0x11329, 0x11331, 0x11331, 0x11334, + 0x11334, 0x1133a, 0x1133b, 0x11345, 0x11346, 0x11349, 0x1134a, 0x1134e, + 0x1134f, 0x11351, 0x11356, 0x11358, 0x1135c, 0x11364, 0x11365, 0x1136d, + 0x1136f, 0x11375, 0x113ff, 0x1145a, 0x1145a, 0x1145c, 0x1145c, 0x1145e, + 0x1147f, 0x114c8, 0x114cf, 0x114da, 0x1157f, 0x115b6, 0x115b7, 0x115de, + 0x115ff, 0x11645, 0x1164f, 0x1165a, 0x1165f, 0x1166d, 0x1167f, 0x116b8, + 0x116bf, 0x116ca, 0x116ff, 0x1171a, 0x1171c, 0x1172c, 0x1172f, 0x11740, + 0x1189f, 0x118f3, 0x118fe, 0x11900, 0x11abf, 0x11af9, 0x11bff, 0x11c09, + 0x11c09, 0x11c37, 0x11c37, 0x11c46, 0x11c4f, 0x11c6d, 0x11c6f, 0x11c90, + 0x11c91, 0x11ca8, 0x11ca8, 0x11cb7, 0x11fff, 0x1239a, 0x123ff, 0x1246f, + 0x1246f, 0x12475, 0x1247f, 0x12544, 0x12fff, 0x1342f, 0x143ff, 0x14647, + 0x167ff, 0x16a39, 0x16a3f, 0x16a5f, 0x16a5f, 0x16a6a, 0x16a6d, 0x16a70, + 0x16acf, 0x16aee, 0x16aef, 0x16af6, 0x16aff, 0x16b46, 0x16b4f, 0x16b5a, + 0x16b5a, 0x16b62, 0x16b62, 0x16b78, 0x16b7c, 0x16b90, 0x16eff, 0x16f45, + 0x16f4f, 0x16f7f, 0x16f8e, 0x16fa0, 0x16fdf, 0x16fe1, 0x16fff, 0x187ed, + 0x187ff, 0x18af3, 0x1afff, 0x1b002, 0x1bbff, 0x1bc6b, 0x1bc6f, 0x1bc7d, + 0x1bc7f, 0x1bc89, 0x1bc8f, 0x1bc9a, 0x1bc9b, 0x1bca4, 0x1cfff, 0x1d0f6, + 0x1d0ff, 0x1d127, 0x1d128, 0x1d1e9, 0x1d1ff, 0x1d246, 0x1d2ff, 0x1d357, + 0x1d35f, 0x1d372, 0x1d3ff, 0x1d455, 0x1d455, 0x1d49d, 0x1d49d, 0x1d4a0, + 0x1d4a1, 0x1d4a3, 0x1d4a4, 0x1d4a7, 0x1d4a8, 0x1d4ad, 0x1d4ad, 0x1d4ba, + 0x1d4ba, 0x1d4bc, 0x1d4bc, 0x1d4c4, 0x1d4c4, 0x1d506, 0x1d506, 0x1d50b, + 0x1d50c, 0x1d515, 0x1d515, 0x1d51d, 0x1d51d, 0x1d53a, 0x1d53a, 0x1d53f, + 0x1d53f, 0x1d545, 0x1d545, 0x1d547, 0x1d549, 0x1d551, 0x1d551, 0x1d6a6, + 0x1d6a7, 0x1d7cc, 0x1d7cd, 0x1da8c, 0x1da9a, 0x1daa0, 0x1daa0, 0x1dab0, + 0x1dfff, 0x1e007, 0x1e007, 0x1e019, 0x1e01a, 0x1e022, 0x1e022, 0x1e025, + 0x1e025, 0x1e02b, 0x1e7ff, 0x1e8c5, 0x1e8c6, 0x1e8d7, 0x1e8ff, 0x1e94b, + 0x1e94f, 0x1e95a, 0x1e95d, 0x1e960, 0x1edff, 0x1ee04, 0x1ee04, 0x1ee20, + 0x1ee20, 0x1ee23, 0x1ee23, 0x1ee25, 0x1ee26, 0x1ee28, 0x1ee28, 0x1ee33, + 0x1ee33, 0x1ee38, 0x1ee38, 0x1ee3a, 0x1ee3a, 0x1ee3c, 0x1ee41, 0x1ee43, + 0x1ee46, 0x1ee48, 0x1ee48, 0x1ee4a, 0x1ee4a, 0x1ee4c, 0x1ee4c, 0x1ee50, + 0x1ee50, 0x1ee53, 0x1ee53, 0x1ee55, 0x1ee56, 0x1ee58, 0x1ee58, 0x1ee5a, + 0x1ee5a, 0x1ee5c, 0x1ee5c, 0x1ee5e, 0x1ee5e, 0x1ee60, 0x1ee60, 0x1ee63, + 0x1ee63, 0x1ee65, 0x1ee66, 0x1ee6b, 0x1ee6b, 0x1ee73, 0x1ee73, 0x1ee78, + 0x1ee78, 0x1ee7d, 0x1ee7d, 0x1ee7f, 0x1ee7f, 0x1ee8a, 0x1ee8a, 0x1ee9c, + 0x1eea0, 0x1eea4, 0x1eea4, 0x1eeaa, 0x1eeaa, 0x1eebc, 0x1eeef, 0x1eef2, + 0x1efff, 0x1f02c, 0x1f02f, 0x1f094, 0x1f09f, 0x1f0af, 0x1f0b0, 0x1f0c0, + 0x1f0c0, 0x1f0d0, 0x1f0d0, 0x1f0f6, 0x1f0ff, 0x1f10d, 0x1f10f, 0x1f12f, + 0x1f12f, 0x1f16c, 0x1f16f, 0x1f1ad, 0x1f1e5, 0x1f203, 0x1f20f, 0x1f23c, + 0x1f23f, 0x1f249, 0x1f24f, 0x1f252, 0x1f2ff, 0x1f6d3, 0x1f6df, 0x1f6ed, + 0x1f6ef, 0x1f6f7, 0x1f6ff, 0x1f774, 0x1f77f, 0x1f7d5, 0x1f7ff, 0x1f80c, + 0x1f80f, 0x1f848, 0x1f84f, 0x1f85a, 0x1f85f, 0x1f888, 0x1f88f, 0x1f8ae, + 0x1f90f, 0x1f91f, 0x1f91f, 0x1f928, 0x1f92f, 0x1f931, 0x1f932, 0x1f93f, + 0x1f93f, 0x1f94c, 0x1f94f, 0x1f95f, 0x1f97f, 0x1f992, 0x1f9bf, 0x1f9c1, + 0x1ffff, 0x2a6d7, 0x2a6ff, 0x2b735, 0x2b73f, 0x2b81e, 0x2b81f, 0x2cea2, + 0x2f7ff, 0x2fa1e, 0xe0000, 0xe0002, 0xe001f, 0xe0080, 0xe00ff, 0xe01f0, + 0xeffff, 0xffffe, 0xfffff, 0x10fffe, 0x10ffff, +}; /* CR_Cn */ + +/* 'Co': General Category */ +static const OnigCodePoint CR_Co[] = { + 3, 0xe000, 0xf8ff, 0xf0000, 0xffffd, 0x100000, 0x10fffd, +}; /* CR_Co */ + +/* 'Cs': General Category */ +static const OnigCodePoint CR_Cs[] = { + 1, + 0xd800, + 0xdfff, +}; /* CR_Cs */ + +/* 'L': Major Category */ +static const OnigCodePoint CR_L[] = { + 571, 0x0041, 0x005a, 0x0061, 0x007a, 0x00aa, 0x00aa, 0x00b5, + 0x00b5, 0x00ba, 0x00ba, 0x00c0, 0x00d6, 0x00d8, 0x00f6, 0x00f8, + 0x02c1, 0x02c6, 0x02d1, 0x02e0, 0x02e4, 0x02ec, 0x02ec, 0x02ee, + 0x02ee, 0x0370, 0x0374, 0x0376, 0x0377, 0x037a, 0x037d, 0x037f, + 0x037f, 0x0386, 0x0386, 0x0388, 0x038a, 0x038c, 0x038c, 0x038e, + 0x03a1, 0x03a3, 0x03f5, 0x03f7, 0x0481, 0x048a, 0x052f, 0x0531, + 0x0556, 0x0559, 0x0559, 0x0561, 0x0587, 0x05d0, 0x05ea, 0x05f0, + 0x05f2, 0x0620, 0x064a, 0x066e, 0x066f, 0x0671, 0x06d3, 0x06d5, + 0x06d5, 0x06e5, 0x06e6, 0x06ee, 0x06ef, 0x06fa, 0x06fc, 0x06ff, + 0x06ff, 0x0710, 0x0710, 0x0712, 0x072f, 0x074d, 0x07a5, 0x07b1, + 0x07b1, 0x07ca, 0x07ea, 0x07f4, 0x07f5, 0x07fa, 0x07fa, 0x0800, + 0x0815, 0x081a, 0x081a, 0x0824, 0x0824, 0x0828, 0x0828, 0x0840, + 0x0858, 0x08a0, 0x08b4, 0x08b6, 0x08bd, 0x0904, 0x0939, 0x093d, + 0x093d, 0x0950, 0x0950, 0x0958, 0x0961, 0x0971, 0x0980, 0x0985, + 0x098c, 0x098f, 0x0990, 0x0993, 0x09a8, 0x09aa, 0x09b0, 0x09b2, + 0x09b2, 0x09b6, 0x09b9, 0x09bd, 0x09bd, 0x09ce, 0x09ce, 0x09dc, + 0x09dd, 0x09df, 0x09e1, 0x09f0, 0x09f1, 0x0a05, 0x0a0a, 0x0a0f, + 0x0a10, 0x0a13, 0x0a28, 0x0a2a, 0x0a30, 0x0a32, 0x0a33, 0x0a35, + 0x0a36, 0x0a38, 0x0a39, 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a72, + 0x0a74, 0x0a85, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, + 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abd, 0x0abd, 0x0ad0, + 0x0ad0, 0x0ae0, 0x0ae1, 0x0af9, 0x0af9, 0x0b05, 0x0b0c, 0x0b0f, + 0x0b10, 0x0b13, 0x0b28, 0x0b2a, 0x0b30, 0x0b32, 0x0b33, 0x0b35, + 0x0b39, 0x0b3d, 0x0b3d, 0x0b5c, 0x0b5d, 0x0b5f, 0x0b61, 0x0b71, + 0x0b71, 0x0b83, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, + 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, + 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, 0x0bb9, 0x0bd0, 0x0bd0, 0x0c05, + 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, 0x0c28, 0x0c2a, 0x0c39, 0x0c3d, + 0x0c3d, 0x0c58, 0x0c5a, 0x0c60, 0x0c61, 0x0c80, 0x0c80, 0x0c85, + 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, + 0x0cb9, 0x0cbd, 0x0cbd, 0x0cde, 0x0cde, 0x0ce0, 0x0ce1, 0x0cf1, + 0x0cf2, 0x0d05, 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d3a, 0x0d3d, + 0x0d3d, 0x0d4e, 0x0d4e, 0x0d54, 0x0d56, 0x0d5f, 0x0d61, 0x0d7a, + 0x0d7f, 0x0d85, 0x0d96, 0x0d9a, 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, + 0x0dbd, 0x0dc0, 0x0dc6, 0x0e01, 0x0e30, 0x0e32, 0x0e33, 0x0e40, + 0x0e46, 0x0e81, 0x0e82, 0x0e84, 0x0e84, 0x0e87, 0x0e88, 0x0e8a, + 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, + 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, + 0x0eb0, 0x0eb2, 0x0eb3, 0x0ebd, 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, + 0x0ec6, 0x0edc, 0x0edf, 0x0f00, 0x0f00, 0x0f40, 0x0f47, 0x0f49, + 0x0f6c, 0x0f88, 0x0f8c, 0x1000, 0x102a, 0x103f, 0x103f, 0x1050, + 0x1055, 0x105a, 0x105d, 0x1061, 0x1061, 0x1065, 0x1066, 0x106e, + 0x1070, 0x1075, 0x1081, 0x108e, 0x108e, 0x10a0, 0x10c5, 0x10c7, + 0x10c7, 0x10cd, 0x10cd, 0x10d0, 0x10fa, 0x10fc, 0x1248, 0x124a, + 0x124d, 0x1250, 0x1256, 0x1258, 0x1258, 0x125a, 0x125d, 0x1260, + 0x1288, 0x128a, 0x128d, 0x1290, 0x12b0, 0x12b2, 0x12b5, 0x12b8, + 0x12be, 0x12c0, 0x12c0, 0x12c2, 0x12c5, 0x12c8, 0x12d6, 0x12d8, + 0x1310, 0x1312, 0x1315, 0x1318, 0x135a, 0x1380, 0x138f, 0x13a0, + 0x13f5, 0x13f8, 0x13fd, 0x1401, 0x166c, 0x166f, 0x167f, 0x1681, + 0x169a, 0x16a0, 0x16ea, 0x16f1, 0x16f8, 0x1700, 0x170c, 0x170e, + 0x1711, 0x1720, 0x1731, 0x1740, 0x1751, 0x1760, 0x176c, 0x176e, + 0x1770, 0x1780, 0x17b3, 0x17d7, 0x17d7, 0x17dc, 0x17dc, 0x1820, + 0x1877, 0x1880, 0x1884, 0x1887, 0x18a8, 0x18aa, 0x18aa, 0x18b0, + 0x18f5, 0x1900, 0x191e, 0x1950, 0x196d, 0x1970, 0x1974, 0x1980, + 0x19ab, 0x19b0, 0x19c9, 0x1a00, 0x1a16, 0x1a20, 0x1a54, 0x1aa7, + 0x1aa7, 0x1b05, 0x1b33, 0x1b45, 0x1b4b, 0x1b83, 0x1ba0, 0x1bae, + 0x1baf, 0x1bba, 0x1be5, 0x1c00, 0x1c23, 0x1c4d, 0x1c4f, 0x1c5a, + 0x1c7d, 0x1c80, 0x1c88, 0x1ce9, 0x1cec, 0x1cee, 0x1cf1, 0x1cf5, + 0x1cf6, 0x1d00, 0x1dbf, 0x1e00, 0x1f15, 0x1f18, 0x1f1d, 0x1f20, + 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, 0x1f59, 0x1f5b, + 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, + 0x1fbc, 0x1fbe, 0x1fbe, 0x1fc2, 0x1fc4, 0x1fc6, 0x1fcc, 0x1fd0, + 0x1fd3, 0x1fd6, 0x1fdb, 0x1fe0, 0x1fec, 0x1ff2, 0x1ff4, 0x1ff6, + 0x1ffc, 0x2071, 0x2071, 0x207f, 0x207f, 0x2090, 0x209c, 0x2102, + 0x2102, 0x2107, 0x2107, 0x210a, 0x2113, 0x2115, 0x2115, 0x2119, + 0x211d, 0x2124, 0x2124, 0x2126, 0x2126, 0x2128, 0x2128, 0x212a, + 0x212d, 0x212f, 0x2139, 0x213c, 0x213f, 0x2145, 0x2149, 0x214e, + 0x214e, 0x2183, 0x2184, 0x2c00, 0x2c2e, 0x2c30, 0x2c5e, 0x2c60, + 0x2ce4, 0x2ceb, 0x2cee, 0x2cf2, 0x2cf3, 0x2d00, 0x2d25, 0x2d27, + 0x2d27, 0x2d2d, 0x2d2d, 0x2d30, 0x2d67, 0x2d6f, 0x2d6f, 0x2d80, + 0x2d96, 0x2da0, 0x2da6, 0x2da8, 0x2dae, 0x2db0, 0x2db6, 0x2db8, + 0x2dbe, 0x2dc0, 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, 0x2dd6, 0x2dd8, + 0x2dde, 0x2e2f, 0x2e2f, 0x3005, 0x3006, 0x3031, 0x3035, 0x303b, + 0x303c, 0x3041, 0x3096, 0x309d, 0x309f, 0x30a1, 0x30fa, 0x30fc, + 0x30ff, 0x3105, 0x312d, 0x3131, 0x318e, 0x31a0, 0x31ba, 0x31f0, + 0x31ff, 0x3400, 0x4db5, 0x4e00, 0x9fd5, 0xa000, 0xa48c, 0xa4d0, + 0xa4fd, 0xa500, 0xa60c, 0xa610, 0xa61f, 0xa62a, 0xa62b, 0xa640, + 0xa66e, 0xa67f, 0xa69d, 0xa6a0, 0xa6e5, 0xa717, 0xa71f, 0xa722, + 0xa788, 0xa78b, 0xa7ae, 0xa7b0, 0xa7b7, 0xa7f7, 0xa801, 0xa803, + 0xa805, 0xa807, 0xa80a, 0xa80c, 0xa822, 0xa840, 0xa873, 0xa882, + 0xa8b3, 0xa8f2, 0xa8f7, 0xa8fb, 0xa8fb, 0xa8fd, 0xa8fd, 0xa90a, + 0xa925, 0xa930, 0xa946, 0xa960, 0xa97c, 0xa984, 0xa9b2, 0xa9cf, + 0xa9cf, 0xa9e0, 0xa9e4, 0xa9e6, 0xa9ef, 0xa9fa, 0xa9fe, 0xaa00, + 0xaa28, 0xaa40, 0xaa42, 0xaa44, 0xaa4b, 0xaa60, 0xaa76, 0xaa7a, + 0xaa7a, 0xaa7e, 0xaaaf, 0xaab1, 0xaab1, 0xaab5, 0xaab6, 0xaab9, + 0xaabd, 0xaac0, 0xaac0, 0xaac2, 0xaac2, 0xaadb, 0xaadd, 0xaae0, + 0xaaea, 0xaaf2, 0xaaf4, 0xab01, 0xab06, 0xab09, 0xab0e, 0xab11, + 0xab16, 0xab20, 0xab26, 0xab28, 0xab2e, 0xab30, 0xab5a, 0xab5c, + 0xab65, 0xab70, 0xabe2, 0xac00, 0xd7a3, 0xd7b0, 0xd7c6, 0xd7cb, + 0xd7fb, 0xf900, 0xfa6d, 0xfa70, 0xfad9, 0xfb00, 0xfb06, 0xfb13, + 0xfb17, 0xfb1d, 0xfb1d, 0xfb1f, 0xfb28, 0xfb2a, 0xfb36, 0xfb38, + 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, + 0xfbb1, 0xfbd3, 0xfd3d, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdf0, + 0xfdfb, 0xfe70, 0xfe74, 0xfe76, 0xfefc, 0xff21, 0xff3a, 0xff41, + 0xff5a, 0xff66, 0xffbe, 0xffc2, 0xffc7, 0xffca, 0xffcf, 0xffd2, + 0xffd7, 0xffda, 0xffdc, 0x10000, 0x1000b, 0x1000d, 0x10026, 0x10028, + 0x1003a, 0x1003c, 0x1003d, 0x1003f, 0x1004d, 0x10050, 0x1005d, 0x10080, + 0x100fa, 0x10280, 0x1029c, 0x102a0, 0x102d0, 0x10300, 0x1031f, 0x10330, + 0x10340, 0x10342, 0x10349, 0x10350, 0x10375, 0x10380, 0x1039d, 0x103a0, + 0x103c3, 0x103c8, 0x103cf, 0x10400, 0x1049d, 0x104b0, 0x104d3, 0x104d8, + 0x104fb, 0x10500, 0x10527, 0x10530, 0x10563, 0x10600, 0x10736, 0x10740, + 0x10755, 0x10760, 0x10767, 0x10800, 0x10805, 0x10808, 0x10808, 0x1080a, + 0x10835, 0x10837, 0x10838, 0x1083c, 0x1083c, 0x1083f, 0x10855, 0x10860, + 0x10876, 0x10880, 0x1089e, 0x108e0, 0x108f2, 0x108f4, 0x108f5, 0x10900, + 0x10915, 0x10920, 0x10939, 0x10980, 0x109b7, 0x109be, 0x109bf, 0x10a00, + 0x10a00, 0x10a10, 0x10a13, 0x10a15, 0x10a17, 0x10a19, 0x10a33, 0x10a60, + 0x10a7c, 0x10a80, 0x10a9c, 0x10ac0, 0x10ac7, 0x10ac9, 0x10ae4, 0x10b00, + 0x10b35, 0x10b40, 0x10b55, 0x10b60, 0x10b72, 0x10b80, 0x10b91, 0x10c00, + 0x10c48, 0x10c80, 0x10cb2, 0x10cc0, 0x10cf2, 0x11003, 0x11037, 0x11083, + 0x110af, 0x110d0, 0x110e8, 0x11103, 0x11126, 0x11150, 0x11172, 0x11176, + 0x11176, 0x11183, 0x111b2, 0x111c1, 0x111c4, 0x111da, 0x111da, 0x111dc, + 0x111dc, 0x11200, 0x11211, 0x11213, 0x1122b, 0x11280, 0x11286, 0x11288, + 0x11288, 0x1128a, 0x1128d, 0x1128f, 0x1129d, 0x1129f, 0x112a8, 0x112b0, + 0x112de, 0x11305, 0x1130c, 0x1130f, 0x11310, 0x11313, 0x11328, 0x1132a, + 0x11330, 0x11332, 0x11333, 0x11335, 0x11339, 0x1133d, 0x1133d, 0x11350, + 0x11350, 0x1135d, 0x11361, 0x11400, 0x11434, 0x11447, 0x1144a, 0x11480, + 0x114af, 0x114c4, 0x114c5, 0x114c7, 0x114c7, 0x11580, 0x115ae, 0x115d8, + 0x115db, 0x11600, 0x1162f, 0x11644, 0x11644, 0x11680, 0x116aa, 0x11700, + 0x11719, 0x118a0, 0x118df, 0x118ff, 0x118ff, 0x11ac0, 0x11af8, 0x11c00, + 0x11c08, 0x11c0a, 0x11c2e, 0x11c40, 0x11c40, 0x11c72, 0x11c8f, 0x12000, + 0x12399, 0x12480, 0x12543, 0x13000, 0x1342e, 0x14400, 0x14646, 0x16800, + 0x16a38, 0x16a40, 0x16a5e, 0x16ad0, 0x16aed, 0x16b00, 0x16b2f, 0x16b40, + 0x16b43, 0x16b63, 0x16b77, 0x16b7d, 0x16b8f, 0x16f00, 0x16f44, 0x16f50, + 0x16f50, 0x16f93, 0x16f9f, 0x16fe0, 0x16fe0, 0x17000, 0x187ec, 0x18800, + 0x18af2, 0x1b000, 0x1b001, 0x1bc00, 0x1bc6a, 0x1bc70, 0x1bc7c, 0x1bc80, + 0x1bc88, 0x1bc90, 0x1bc99, 0x1d400, 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, + 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, + 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, + 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, + 0x1d53e, 0x1d540, 0x1d544, 0x1d546, 0x1d546, 0x1d54a, 0x1d550, 0x1d552, + 0x1d6a5, 0x1d6a8, 0x1d6c0, 0x1d6c2, 0x1d6da, 0x1d6dc, 0x1d6fa, 0x1d6fc, + 0x1d714, 0x1d716, 0x1d734, 0x1d736, 0x1d74e, 0x1d750, 0x1d76e, 0x1d770, + 0x1d788, 0x1d78a, 0x1d7a8, 0x1d7aa, 0x1d7c2, 0x1d7c4, 0x1d7cb, 0x1e800, + 0x1e8c4, 0x1e900, 0x1e943, 0x1ee00, 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, + 0x1ee22, 0x1ee24, 0x1ee24, 0x1ee27, 0x1ee27, 0x1ee29, 0x1ee32, 0x1ee34, + 0x1ee37, 0x1ee39, 0x1ee39, 0x1ee3b, 0x1ee3b, 0x1ee42, 0x1ee42, 0x1ee47, + 0x1ee47, 0x1ee49, 0x1ee49, 0x1ee4b, 0x1ee4b, 0x1ee4d, 0x1ee4f, 0x1ee51, + 0x1ee52, 0x1ee54, 0x1ee54, 0x1ee57, 0x1ee57, 0x1ee59, 0x1ee59, 0x1ee5b, + 0x1ee5b, 0x1ee5d, 0x1ee5d, 0x1ee5f, 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, + 0x1ee64, 0x1ee67, 0x1ee6a, 0x1ee6c, 0x1ee72, 0x1ee74, 0x1ee77, 0x1ee79, + 0x1ee7c, 0x1ee7e, 0x1ee7e, 0x1ee80, 0x1ee89, 0x1ee8b, 0x1ee9b, 0x1eea1, + 0x1eea3, 0x1eea5, 0x1eea9, 0x1eeab, 0x1eebb, 0x20000, 0x2a6d6, 0x2a700, + 0x2b734, 0x2b740, 0x2b81d, 0x2b820, 0x2cea1, 0x2f800, 0x2fa1d, +}; /* CR_L */ + +/* 'LC': General Category */ +static const OnigCodePoint CR_LC[] = { + 126, 0x0041, 0x005a, 0x0061, 0x007a, 0x00b5, 0x00b5, 0x00c0, + 0x00d6, 0x00d8, 0x00f6, 0x00f8, 0x01ba, 0x01bc, 0x01bf, 0x01c4, + 0x0293, 0x0295, 0x02af, 0x0370, 0x0373, 0x0376, 0x0377, 0x037b, + 0x037d, 0x037f, 0x037f, 0x0386, 0x0386, 0x0388, 0x038a, 0x038c, + 0x038c, 0x038e, 0x03a1, 0x03a3, 0x03f5, 0x03f7, 0x0481, 0x048a, + 0x052f, 0x0531, 0x0556, 0x0561, 0x0587, 0x10a0, 0x10c5, 0x10c7, + 0x10c7, 0x10cd, 0x10cd, 0x13a0, 0x13f5, 0x13f8, 0x13fd, 0x1c80, + 0x1c88, 0x1d00, 0x1d2b, 0x1d6b, 0x1d77, 0x1d79, 0x1d9a, 0x1e00, + 0x1f15, 0x1f18, 0x1f1d, 0x1f20, 0x1f45, 0x1f48, 0x1f4d, 0x1f50, + 0x1f57, 0x1f59, 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, + 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, 0x1fbc, 0x1fbe, 0x1fbe, 0x1fc2, + 0x1fc4, 0x1fc6, 0x1fcc, 0x1fd0, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fe0, + 0x1fec, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ffc, 0x2102, 0x2102, 0x2107, + 0x2107, 0x210a, 0x2113, 0x2115, 0x2115, 0x2119, 0x211d, 0x2124, + 0x2124, 0x2126, 0x2126, 0x2128, 0x2128, 0x212a, 0x212d, 0x212f, + 0x2134, 0x2139, 0x2139, 0x213c, 0x213f, 0x2145, 0x2149, 0x214e, + 0x214e, 0x2183, 0x2184, 0x2c00, 0x2c2e, 0x2c30, 0x2c5e, 0x2c60, + 0x2c7b, 0x2c7e, 0x2ce4, 0x2ceb, 0x2cee, 0x2cf2, 0x2cf3, 0x2d00, + 0x2d25, 0x2d27, 0x2d27, 0x2d2d, 0x2d2d, 0xa640, 0xa66d, 0xa680, + 0xa69b, 0xa722, 0xa76f, 0xa771, 0xa787, 0xa78b, 0xa78e, 0xa790, + 0xa7ae, 0xa7b0, 0xa7b7, 0xa7fa, 0xa7fa, 0xab30, 0xab5a, 0xab60, + 0xab65, 0xab70, 0xabbf, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xff21, + 0xff3a, 0xff41, 0xff5a, 0x10400, 0x1044f, 0x104b0, 0x104d3, 0x104d8, + 0x104fb, 0x10c80, 0x10cb2, 0x10cc0, 0x10cf2, 0x118a0, 0x118df, 0x1d400, + 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, + 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, + 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, + 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, 0x1d544, 0x1d546, + 0x1d546, 0x1d54a, 0x1d550, 0x1d552, 0x1d6a5, 0x1d6a8, 0x1d6c0, 0x1d6c2, + 0x1d6da, 0x1d6dc, 0x1d6fa, 0x1d6fc, 0x1d714, 0x1d716, 0x1d734, 0x1d736, + 0x1d74e, 0x1d750, 0x1d76e, 0x1d770, 0x1d788, 0x1d78a, 0x1d7a8, 0x1d7aa, + 0x1d7c2, 0x1d7c4, 0x1d7cb, 0x1e900, 0x1e943, +}; /* CR_LC */ + +/* 'Ll': General Category */ +static const OnigCodePoint CR_Ll[] = { + 633, 0x0061, 0x007a, 0x00b5, 0x00b5, 0x00df, 0x00f6, 0x00f8, + 0x00ff, 0x0101, 0x0101, 0x0103, 0x0103, 0x0105, 0x0105, 0x0107, + 0x0107, 0x0109, 0x0109, 0x010b, 0x010b, 0x010d, 0x010d, 0x010f, + 0x010f, 0x0111, 0x0111, 0x0113, 0x0113, 0x0115, 0x0115, 0x0117, + 0x0117, 0x0119, 0x0119, 0x011b, 0x011b, 0x011d, 0x011d, 0x011f, + 0x011f, 0x0121, 0x0121, 0x0123, 0x0123, 0x0125, 0x0125, 0x0127, + 0x0127, 0x0129, 0x0129, 0x012b, 0x012b, 0x012d, 0x012d, 0x012f, + 0x012f, 0x0131, 0x0131, 0x0133, 0x0133, 0x0135, 0x0135, 0x0137, + 0x0138, 0x013a, 0x013a, 0x013c, 0x013c, 0x013e, 0x013e, 0x0140, + 0x0140, 0x0142, 0x0142, 0x0144, 0x0144, 0x0146, 0x0146, 0x0148, + 0x0149, 0x014b, 0x014b, 0x014d, 0x014d, 0x014f, 0x014f, 0x0151, + 0x0151, 0x0153, 0x0153, 0x0155, 0x0155, 0x0157, 0x0157, 0x0159, + 0x0159, 0x015b, 0x015b, 0x015d, 0x015d, 0x015f, 0x015f, 0x0161, + 0x0161, 0x0163, 0x0163, 0x0165, 0x0165, 0x0167, 0x0167, 0x0169, + 0x0169, 0x016b, 0x016b, 0x016d, 0x016d, 0x016f, 0x016f, 0x0171, + 0x0171, 0x0173, 0x0173, 0x0175, 0x0175, 0x0177, 0x0177, 0x017a, + 0x017a, 0x017c, 0x017c, 0x017e, 0x0180, 0x0183, 0x0183, 0x0185, + 0x0185, 0x0188, 0x0188, 0x018c, 0x018d, 0x0192, 0x0192, 0x0195, + 0x0195, 0x0199, 0x019b, 0x019e, 0x019e, 0x01a1, 0x01a1, 0x01a3, + 0x01a3, 0x01a5, 0x01a5, 0x01a8, 0x01a8, 0x01aa, 0x01ab, 0x01ad, + 0x01ad, 0x01b0, 0x01b0, 0x01b4, 0x01b4, 0x01b6, 0x01b6, 0x01b9, + 0x01ba, 0x01bd, 0x01bf, 0x01c6, 0x01c6, 0x01c9, 0x01c9, 0x01cc, + 0x01cc, 0x01ce, 0x01ce, 0x01d0, 0x01d0, 0x01d2, 0x01d2, 0x01d4, + 0x01d4, 0x01d6, 0x01d6, 0x01d8, 0x01d8, 0x01da, 0x01da, 0x01dc, + 0x01dd, 0x01df, 0x01df, 0x01e1, 0x01e1, 0x01e3, 0x01e3, 0x01e5, + 0x01e5, 0x01e7, 0x01e7, 0x01e9, 0x01e9, 0x01eb, 0x01eb, 0x01ed, + 0x01ed, 0x01ef, 0x01f0, 0x01f3, 0x01f3, 0x01f5, 0x01f5, 0x01f9, + 0x01f9, 0x01fb, 0x01fb, 0x01fd, 0x01fd, 0x01ff, 0x01ff, 0x0201, + 0x0201, 0x0203, 0x0203, 0x0205, 0x0205, 0x0207, 0x0207, 0x0209, + 0x0209, 0x020b, 0x020b, 0x020d, 0x020d, 0x020f, 0x020f, 0x0211, + 0x0211, 0x0213, 0x0213, 0x0215, 0x0215, 0x0217, 0x0217, 0x0219, + 0x0219, 0x021b, 0x021b, 0x021d, 0x021d, 0x021f, 0x021f, 0x0221, + 0x0221, 0x0223, 0x0223, 0x0225, 0x0225, 0x0227, 0x0227, 0x0229, + 0x0229, 0x022b, 0x022b, 0x022d, 0x022d, 0x022f, 0x022f, 0x0231, + 0x0231, 0x0233, 0x0239, 0x023c, 0x023c, 0x023f, 0x0240, 0x0242, + 0x0242, 0x0247, 0x0247, 0x0249, 0x0249, 0x024b, 0x024b, 0x024d, + 0x024d, 0x024f, 0x0293, 0x0295, 0x02af, 0x0371, 0x0371, 0x0373, + 0x0373, 0x0377, 0x0377, 0x037b, 0x037d, 0x0390, 0x0390, 0x03ac, + 0x03ce, 0x03d0, 0x03d1, 0x03d5, 0x03d7, 0x03d9, 0x03d9, 0x03db, + 0x03db, 0x03dd, 0x03dd, 0x03df, 0x03df, 0x03e1, 0x03e1, 0x03e3, + 0x03e3, 0x03e5, 0x03e5, 0x03e7, 0x03e7, 0x03e9, 0x03e9, 0x03eb, + 0x03eb, 0x03ed, 0x03ed, 0x03ef, 0x03f3, 0x03f5, 0x03f5, 0x03f8, + 0x03f8, 0x03fb, 0x03fc, 0x0430, 0x045f, 0x0461, 0x0461, 0x0463, + 0x0463, 0x0465, 0x0465, 0x0467, 0x0467, 0x0469, 0x0469, 0x046b, + 0x046b, 0x046d, 0x046d, 0x046f, 0x046f, 0x0471, 0x0471, 0x0473, + 0x0473, 0x0475, 0x0475, 0x0477, 0x0477, 0x0479, 0x0479, 0x047b, + 0x047b, 0x047d, 0x047d, 0x047f, 0x047f, 0x0481, 0x0481, 0x048b, + 0x048b, 0x048d, 0x048d, 0x048f, 0x048f, 0x0491, 0x0491, 0x0493, + 0x0493, 0x0495, 0x0495, 0x0497, 0x0497, 0x0499, 0x0499, 0x049b, + 0x049b, 0x049d, 0x049d, 0x049f, 0x049f, 0x04a1, 0x04a1, 0x04a3, + 0x04a3, 0x04a5, 0x04a5, 0x04a7, 0x04a7, 0x04a9, 0x04a9, 0x04ab, + 0x04ab, 0x04ad, 0x04ad, 0x04af, 0x04af, 0x04b1, 0x04b1, 0x04b3, + 0x04b3, 0x04b5, 0x04b5, 0x04b7, 0x04b7, 0x04b9, 0x04b9, 0x04bb, + 0x04bb, 0x04bd, 0x04bd, 0x04bf, 0x04bf, 0x04c2, 0x04c2, 0x04c4, + 0x04c4, 0x04c6, 0x04c6, 0x04c8, 0x04c8, 0x04ca, 0x04ca, 0x04cc, + 0x04cc, 0x04ce, 0x04cf, 0x04d1, 0x04d1, 0x04d3, 0x04d3, 0x04d5, + 0x04d5, 0x04d7, 0x04d7, 0x04d9, 0x04d9, 0x04db, 0x04db, 0x04dd, + 0x04dd, 0x04df, 0x04df, 0x04e1, 0x04e1, 0x04e3, 0x04e3, 0x04e5, + 0x04e5, 0x04e7, 0x04e7, 0x04e9, 0x04e9, 0x04eb, 0x04eb, 0x04ed, + 0x04ed, 0x04ef, 0x04ef, 0x04f1, 0x04f1, 0x04f3, 0x04f3, 0x04f5, + 0x04f5, 0x04f7, 0x04f7, 0x04f9, 0x04f9, 0x04fb, 0x04fb, 0x04fd, + 0x04fd, 0x04ff, 0x04ff, 0x0501, 0x0501, 0x0503, 0x0503, 0x0505, + 0x0505, 0x0507, 0x0507, 0x0509, 0x0509, 0x050b, 0x050b, 0x050d, + 0x050d, 0x050f, 0x050f, 0x0511, 0x0511, 0x0513, 0x0513, 0x0515, + 0x0515, 0x0517, 0x0517, 0x0519, 0x0519, 0x051b, 0x051b, 0x051d, + 0x051d, 0x051f, 0x051f, 0x0521, 0x0521, 0x0523, 0x0523, 0x0525, + 0x0525, 0x0527, 0x0527, 0x0529, 0x0529, 0x052b, 0x052b, 0x052d, + 0x052d, 0x052f, 0x052f, 0x0561, 0x0587, 0x13f8, 0x13fd, 0x1c80, + 0x1c88, 0x1d00, 0x1d2b, 0x1d6b, 0x1d77, 0x1d79, 0x1d9a, 0x1e01, + 0x1e01, 0x1e03, 0x1e03, 0x1e05, 0x1e05, 0x1e07, 0x1e07, 0x1e09, + 0x1e09, 0x1e0b, 0x1e0b, 0x1e0d, 0x1e0d, 0x1e0f, 0x1e0f, 0x1e11, + 0x1e11, 0x1e13, 0x1e13, 0x1e15, 0x1e15, 0x1e17, 0x1e17, 0x1e19, + 0x1e19, 0x1e1b, 0x1e1b, 0x1e1d, 0x1e1d, 0x1e1f, 0x1e1f, 0x1e21, + 0x1e21, 0x1e23, 0x1e23, 0x1e25, 0x1e25, 0x1e27, 0x1e27, 0x1e29, + 0x1e29, 0x1e2b, 0x1e2b, 0x1e2d, 0x1e2d, 0x1e2f, 0x1e2f, 0x1e31, + 0x1e31, 0x1e33, 0x1e33, 0x1e35, 0x1e35, 0x1e37, 0x1e37, 0x1e39, + 0x1e39, 0x1e3b, 0x1e3b, 0x1e3d, 0x1e3d, 0x1e3f, 0x1e3f, 0x1e41, + 0x1e41, 0x1e43, 0x1e43, 0x1e45, 0x1e45, 0x1e47, 0x1e47, 0x1e49, + 0x1e49, 0x1e4b, 0x1e4b, 0x1e4d, 0x1e4d, 0x1e4f, 0x1e4f, 0x1e51, + 0x1e51, 0x1e53, 0x1e53, 0x1e55, 0x1e55, 0x1e57, 0x1e57, 0x1e59, + 0x1e59, 0x1e5b, 0x1e5b, 0x1e5d, 0x1e5d, 0x1e5f, 0x1e5f, 0x1e61, + 0x1e61, 0x1e63, 0x1e63, 0x1e65, 0x1e65, 0x1e67, 0x1e67, 0x1e69, + 0x1e69, 0x1e6b, 0x1e6b, 0x1e6d, 0x1e6d, 0x1e6f, 0x1e6f, 0x1e71, + 0x1e71, 0x1e73, 0x1e73, 0x1e75, 0x1e75, 0x1e77, 0x1e77, 0x1e79, + 0x1e79, 0x1e7b, 0x1e7b, 0x1e7d, 0x1e7d, 0x1e7f, 0x1e7f, 0x1e81, + 0x1e81, 0x1e83, 0x1e83, 0x1e85, 0x1e85, 0x1e87, 0x1e87, 0x1e89, + 0x1e89, 0x1e8b, 0x1e8b, 0x1e8d, 0x1e8d, 0x1e8f, 0x1e8f, 0x1e91, + 0x1e91, 0x1e93, 0x1e93, 0x1e95, 0x1e9d, 0x1e9f, 0x1e9f, 0x1ea1, + 0x1ea1, 0x1ea3, 0x1ea3, 0x1ea5, 0x1ea5, 0x1ea7, 0x1ea7, 0x1ea9, + 0x1ea9, 0x1eab, 0x1eab, 0x1ead, 0x1ead, 0x1eaf, 0x1eaf, 0x1eb1, + 0x1eb1, 0x1eb3, 0x1eb3, 0x1eb5, 0x1eb5, 0x1eb7, 0x1eb7, 0x1eb9, + 0x1eb9, 0x1ebb, 0x1ebb, 0x1ebd, 0x1ebd, 0x1ebf, 0x1ebf, 0x1ec1, + 0x1ec1, 0x1ec3, 0x1ec3, 0x1ec5, 0x1ec5, 0x1ec7, 0x1ec7, 0x1ec9, + 0x1ec9, 0x1ecb, 0x1ecb, 0x1ecd, 0x1ecd, 0x1ecf, 0x1ecf, 0x1ed1, + 0x1ed1, 0x1ed3, 0x1ed3, 0x1ed5, 0x1ed5, 0x1ed7, 0x1ed7, 0x1ed9, + 0x1ed9, 0x1edb, 0x1edb, 0x1edd, 0x1edd, 0x1edf, 0x1edf, 0x1ee1, + 0x1ee1, 0x1ee3, 0x1ee3, 0x1ee5, 0x1ee5, 0x1ee7, 0x1ee7, 0x1ee9, + 0x1ee9, 0x1eeb, 0x1eeb, 0x1eed, 0x1eed, 0x1eef, 0x1eef, 0x1ef1, + 0x1ef1, 0x1ef3, 0x1ef3, 0x1ef5, 0x1ef5, 0x1ef7, 0x1ef7, 0x1ef9, + 0x1ef9, 0x1efb, 0x1efb, 0x1efd, 0x1efd, 0x1eff, 0x1f07, 0x1f10, + 0x1f15, 0x1f20, 0x1f27, 0x1f30, 0x1f37, 0x1f40, 0x1f45, 0x1f50, + 0x1f57, 0x1f60, 0x1f67, 0x1f70, 0x1f7d, 0x1f80, 0x1f87, 0x1f90, + 0x1f97, 0x1fa0, 0x1fa7, 0x1fb0, 0x1fb4, 0x1fb6, 0x1fb7, 0x1fbe, + 0x1fbe, 0x1fc2, 0x1fc4, 0x1fc6, 0x1fc7, 0x1fd0, 0x1fd3, 0x1fd6, + 0x1fd7, 0x1fe0, 0x1fe7, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ff7, 0x210a, + 0x210a, 0x210e, 0x210f, 0x2113, 0x2113, 0x212f, 0x212f, 0x2134, + 0x2134, 0x2139, 0x2139, 0x213c, 0x213d, 0x2146, 0x2149, 0x214e, + 0x214e, 0x2184, 0x2184, 0x2c30, 0x2c5e, 0x2c61, 0x2c61, 0x2c65, + 0x2c66, 0x2c68, 0x2c68, 0x2c6a, 0x2c6a, 0x2c6c, 0x2c6c, 0x2c71, + 0x2c71, 0x2c73, 0x2c74, 0x2c76, 0x2c7b, 0x2c81, 0x2c81, 0x2c83, + 0x2c83, 0x2c85, 0x2c85, 0x2c87, 0x2c87, 0x2c89, 0x2c89, 0x2c8b, + 0x2c8b, 0x2c8d, 0x2c8d, 0x2c8f, 0x2c8f, 0x2c91, 0x2c91, 0x2c93, + 0x2c93, 0x2c95, 0x2c95, 0x2c97, 0x2c97, 0x2c99, 0x2c99, 0x2c9b, + 0x2c9b, 0x2c9d, 0x2c9d, 0x2c9f, 0x2c9f, 0x2ca1, 0x2ca1, 0x2ca3, + 0x2ca3, 0x2ca5, 0x2ca5, 0x2ca7, 0x2ca7, 0x2ca9, 0x2ca9, 0x2cab, + 0x2cab, 0x2cad, 0x2cad, 0x2caf, 0x2caf, 0x2cb1, 0x2cb1, 0x2cb3, + 0x2cb3, 0x2cb5, 0x2cb5, 0x2cb7, 0x2cb7, 0x2cb9, 0x2cb9, 0x2cbb, + 0x2cbb, 0x2cbd, 0x2cbd, 0x2cbf, 0x2cbf, 0x2cc1, 0x2cc1, 0x2cc3, + 0x2cc3, 0x2cc5, 0x2cc5, 0x2cc7, 0x2cc7, 0x2cc9, 0x2cc9, 0x2ccb, + 0x2ccb, 0x2ccd, 0x2ccd, 0x2ccf, 0x2ccf, 0x2cd1, 0x2cd1, 0x2cd3, + 0x2cd3, 0x2cd5, 0x2cd5, 0x2cd7, 0x2cd7, 0x2cd9, 0x2cd9, 0x2cdb, + 0x2cdb, 0x2cdd, 0x2cdd, 0x2cdf, 0x2cdf, 0x2ce1, 0x2ce1, 0x2ce3, + 0x2ce4, 0x2cec, 0x2cec, 0x2cee, 0x2cee, 0x2cf3, 0x2cf3, 0x2d00, + 0x2d25, 0x2d27, 0x2d27, 0x2d2d, 0x2d2d, 0xa641, 0xa641, 0xa643, + 0xa643, 0xa645, 0xa645, 0xa647, 0xa647, 0xa649, 0xa649, 0xa64b, + 0xa64b, 0xa64d, 0xa64d, 0xa64f, 0xa64f, 0xa651, 0xa651, 0xa653, + 0xa653, 0xa655, 0xa655, 0xa657, 0xa657, 0xa659, 0xa659, 0xa65b, + 0xa65b, 0xa65d, 0xa65d, 0xa65f, 0xa65f, 0xa661, 0xa661, 0xa663, + 0xa663, 0xa665, 0xa665, 0xa667, 0xa667, 0xa669, 0xa669, 0xa66b, + 0xa66b, 0xa66d, 0xa66d, 0xa681, 0xa681, 0xa683, 0xa683, 0xa685, + 0xa685, 0xa687, 0xa687, 0xa689, 0xa689, 0xa68b, 0xa68b, 0xa68d, + 0xa68d, 0xa68f, 0xa68f, 0xa691, 0xa691, 0xa693, 0xa693, 0xa695, + 0xa695, 0xa697, 0xa697, 0xa699, 0xa699, 0xa69b, 0xa69b, 0xa723, + 0xa723, 0xa725, 0xa725, 0xa727, 0xa727, 0xa729, 0xa729, 0xa72b, + 0xa72b, 0xa72d, 0xa72d, 0xa72f, 0xa731, 0xa733, 0xa733, 0xa735, + 0xa735, 0xa737, 0xa737, 0xa739, 0xa739, 0xa73b, 0xa73b, 0xa73d, + 0xa73d, 0xa73f, 0xa73f, 0xa741, 0xa741, 0xa743, 0xa743, 0xa745, + 0xa745, 0xa747, 0xa747, 0xa749, 0xa749, 0xa74b, 0xa74b, 0xa74d, + 0xa74d, 0xa74f, 0xa74f, 0xa751, 0xa751, 0xa753, 0xa753, 0xa755, + 0xa755, 0xa757, 0xa757, 0xa759, 0xa759, 0xa75b, 0xa75b, 0xa75d, + 0xa75d, 0xa75f, 0xa75f, 0xa761, 0xa761, 0xa763, 0xa763, 0xa765, + 0xa765, 0xa767, 0xa767, 0xa769, 0xa769, 0xa76b, 0xa76b, 0xa76d, + 0xa76d, 0xa76f, 0xa76f, 0xa771, 0xa778, 0xa77a, 0xa77a, 0xa77c, + 0xa77c, 0xa77f, 0xa77f, 0xa781, 0xa781, 0xa783, 0xa783, 0xa785, + 0xa785, 0xa787, 0xa787, 0xa78c, 0xa78c, 0xa78e, 0xa78e, 0xa791, + 0xa791, 0xa793, 0xa795, 0xa797, 0xa797, 0xa799, 0xa799, 0xa79b, + 0xa79b, 0xa79d, 0xa79d, 0xa79f, 0xa79f, 0xa7a1, 0xa7a1, 0xa7a3, + 0xa7a3, 0xa7a5, 0xa7a5, 0xa7a7, 0xa7a7, 0xa7a9, 0xa7a9, 0xa7b5, + 0xa7b5, 0xa7b7, 0xa7b7, 0xa7fa, 0xa7fa, 0xab30, 0xab5a, 0xab60, + 0xab65, 0xab70, 0xabbf, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xff41, + 0xff5a, 0x10428, 0x1044f, 0x104d8, 0x104fb, 0x10cc0, 0x10cf2, 0x118c0, + 0x118df, 0x1d41a, 0x1d433, 0x1d44e, 0x1d454, 0x1d456, 0x1d467, 0x1d482, + 0x1d49b, 0x1d4b6, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, + 0x1d4cf, 0x1d4ea, 0x1d503, 0x1d51e, 0x1d537, 0x1d552, 0x1d56b, 0x1d586, + 0x1d59f, 0x1d5ba, 0x1d5d3, 0x1d5ee, 0x1d607, 0x1d622, 0x1d63b, 0x1d656, + 0x1d66f, 0x1d68a, 0x1d6a5, 0x1d6c2, 0x1d6da, 0x1d6dc, 0x1d6e1, 0x1d6fc, + 0x1d714, 0x1d716, 0x1d71b, 0x1d736, 0x1d74e, 0x1d750, 0x1d755, 0x1d770, + 0x1d788, 0x1d78a, 0x1d78f, 0x1d7aa, 0x1d7c2, 0x1d7c4, 0x1d7c9, 0x1d7cb, + 0x1d7cb, 0x1e922, 0x1e943, +}; /* CR_Ll */ + +/* 'Lm': General Category */ +static const OnigCodePoint CR_Lm[] = { + 57, 0x02b0, 0x02c1, 0x02c6, 0x02d1, 0x02e0, 0x02e4, 0x02ec, + 0x02ec, 0x02ee, 0x02ee, 0x0374, 0x0374, 0x037a, 0x037a, 0x0559, + 0x0559, 0x0640, 0x0640, 0x06e5, 0x06e6, 0x07f4, 0x07f5, 0x07fa, + 0x07fa, 0x081a, 0x081a, 0x0824, 0x0824, 0x0828, 0x0828, 0x0971, + 0x0971, 0x0e46, 0x0e46, 0x0ec6, 0x0ec6, 0x10fc, 0x10fc, 0x17d7, + 0x17d7, 0x1843, 0x1843, 0x1aa7, 0x1aa7, 0x1c78, 0x1c7d, 0x1d2c, + 0x1d6a, 0x1d78, 0x1d78, 0x1d9b, 0x1dbf, 0x2071, 0x2071, 0x207f, + 0x207f, 0x2090, 0x209c, 0x2c7c, 0x2c7d, 0x2d6f, 0x2d6f, 0x2e2f, + 0x2e2f, 0x3005, 0x3005, 0x3031, 0x3035, 0x303b, 0x303b, 0x309d, + 0x309e, 0x30fc, 0x30fe, 0xa015, 0xa015, 0xa4f8, 0xa4fd, 0xa60c, + 0xa60c, 0xa67f, 0xa67f, 0xa69c, 0xa69d, 0xa717, 0xa71f, 0xa770, + 0xa770, 0xa788, 0xa788, 0xa7f8, 0xa7f9, 0xa9cf, 0xa9cf, 0xa9e6, + 0xa9e6, 0xaa70, 0xaa70, 0xaadd, 0xaadd, 0xaaf3, 0xaaf4, 0xab5c, + 0xab5f, 0xff70, 0xff70, 0xff9e, 0xff9f, 0x16b40, 0x16b43, 0x16f93, + 0x16f9f, 0x16fe0, 0x16fe0, +}; /* CR_Lm */ + +/* 'Lo': General Category */ +static const OnigCodePoint CR_Lo[] = { + 445, 0x00aa, 0x00aa, 0x00ba, 0x00ba, 0x01bb, 0x01bb, 0x01c0, + 0x01c3, 0x0294, 0x0294, 0x05d0, 0x05ea, 0x05f0, 0x05f2, 0x0620, + 0x063f, 0x0641, 0x064a, 0x066e, 0x066f, 0x0671, 0x06d3, 0x06d5, + 0x06d5, 0x06ee, 0x06ef, 0x06fa, 0x06fc, 0x06ff, 0x06ff, 0x0710, + 0x0710, 0x0712, 0x072f, 0x074d, 0x07a5, 0x07b1, 0x07b1, 0x07ca, + 0x07ea, 0x0800, 0x0815, 0x0840, 0x0858, 0x08a0, 0x08b4, 0x08b6, + 0x08bd, 0x0904, 0x0939, 0x093d, 0x093d, 0x0950, 0x0950, 0x0958, + 0x0961, 0x0972, 0x0980, 0x0985, 0x098c, 0x098f, 0x0990, 0x0993, + 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, 0x09b9, 0x09bd, + 0x09bd, 0x09ce, 0x09ce, 0x09dc, 0x09dd, 0x09df, 0x09e1, 0x09f0, + 0x09f1, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, + 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a59, + 0x0a5c, 0x0a5e, 0x0a5e, 0x0a72, 0x0a74, 0x0a85, 0x0a8d, 0x0a8f, + 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, + 0x0ab9, 0x0abd, 0x0abd, 0x0ad0, 0x0ad0, 0x0ae0, 0x0ae1, 0x0af9, + 0x0af9, 0x0b05, 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, 0x0b28, 0x0b2a, + 0x0b30, 0x0b32, 0x0b33, 0x0b35, 0x0b39, 0x0b3d, 0x0b3d, 0x0b5c, + 0x0b5d, 0x0b5f, 0x0b61, 0x0b71, 0x0b71, 0x0b83, 0x0b83, 0x0b85, + 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, + 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, + 0x0bb9, 0x0bd0, 0x0bd0, 0x0c05, 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, + 0x0c28, 0x0c2a, 0x0c39, 0x0c3d, 0x0c3d, 0x0c58, 0x0c5a, 0x0c60, + 0x0c61, 0x0c80, 0x0c80, 0x0c85, 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, + 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbd, 0x0cbd, 0x0cde, + 0x0cde, 0x0ce0, 0x0ce1, 0x0cf1, 0x0cf2, 0x0d05, 0x0d0c, 0x0d0e, + 0x0d10, 0x0d12, 0x0d3a, 0x0d3d, 0x0d3d, 0x0d4e, 0x0d4e, 0x0d54, + 0x0d56, 0x0d5f, 0x0d61, 0x0d7a, 0x0d7f, 0x0d85, 0x0d96, 0x0d9a, + 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, 0x0dc6, 0x0e01, + 0x0e30, 0x0e32, 0x0e33, 0x0e40, 0x0e45, 0x0e81, 0x0e82, 0x0e84, + 0x0e84, 0x0e87, 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, + 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, + 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, 0x0eb0, 0x0eb2, 0x0eb3, 0x0ebd, + 0x0ebd, 0x0ec0, 0x0ec4, 0x0edc, 0x0edf, 0x0f00, 0x0f00, 0x0f40, + 0x0f47, 0x0f49, 0x0f6c, 0x0f88, 0x0f8c, 0x1000, 0x102a, 0x103f, + 0x103f, 0x1050, 0x1055, 0x105a, 0x105d, 0x1061, 0x1061, 0x1065, + 0x1066, 0x106e, 0x1070, 0x1075, 0x1081, 0x108e, 0x108e, 0x10d0, + 0x10fa, 0x10fd, 0x1248, 0x124a, 0x124d, 0x1250, 0x1256, 0x1258, + 0x1258, 0x125a, 0x125d, 0x1260, 0x1288, 0x128a, 0x128d, 0x1290, + 0x12b0, 0x12b2, 0x12b5, 0x12b8, 0x12be, 0x12c0, 0x12c0, 0x12c2, + 0x12c5, 0x12c8, 0x12d6, 0x12d8, 0x1310, 0x1312, 0x1315, 0x1318, + 0x135a, 0x1380, 0x138f, 0x1401, 0x166c, 0x166f, 0x167f, 0x1681, + 0x169a, 0x16a0, 0x16ea, 0x16f1, 0x16f8, 0x1700, 0x170c, 0x170e, + 0x1711, 0x1720, 0x1731, 0x1740, 0x1751, 0x1760, 0x176c, 0x176e, + 0x1770, 0x1780, 0x17b3, 0x17dc, 0x17dc, 0x1820, 0x1842, 0x1844, + 0x1877, 0x1880, 0x1884, 0x1887, 0x18a8, 0x18aa, 0x18aa, 0x18b0, + 0x18f5, 0x1900, 0x191e, 0x1950, 0x196d, 0x1970, 0x1974, 0x1980, + 0x19ab, 0x19b0, 0x19c9, 0x1a00, 0x1a16, 0x1a20, 0x1a54, 0x1b05, + 0x1b33, 0x1b45, 0x1b4b, 0x1b83, 0x1ba0, 0x1bae, 0x1baf, 0x1bba, + 0x1be5, 0x1c00, 0x1c23, 0x1c4d, 0x1c4f, 0x1c5a, 0x1c77, 0x1ce9, + 0x1cec, 0x1cee, 0x1cf1, 0x1cf5, 0x1cf6, 0x2135, 0x2138, 0x2d30, + 0x2d67, 0x2d80, 0x2d96, 0x2da0, 0x2da6, 0x2da8, 0x2dae, 0x2db0, + 0x2db6, 0x2db8, 0x2dbe, 0x2dc0, 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, + 0x2dd6, 0x2dd8, 0x2dde, 0x3006, 0x3006, 0x303c, 0x303c, 0x3041, + 0x3096, 0x309f, 0x309f, 0x30a1, 0x30fa, 0x30ff, 0x30ff, 0x3105, + 0x312d, 0x3131, 0x318e, 0x31a0, 0x31ba, 0x31f0, 0x31ff, 0x3400, + 0x4db5, 0x4e00, 0x9fd5, 0xa000, 0xa014, 0xa016, 0xa48c, 0xa4d0, + 0xa4f7, 0xa500, 0xa60b, 0xa610, 0xa61f, 0xa62a, 0xa62b, 0xa66e, + 0xa66e, 0xa6a0, 0xa6e5, 0xa78f, 0xa78f, 0xa7f7, 0xa7f7, 0xa7fb, + 0xa801, 0xa803, 0xa805, 0xa807, 0xa80a, 0xa80c, 0xa822, 0xa840, + 0xa873, 0xa882, 0xa8b3, 0xa8f2, 0xa8f7, 0xa8fb, 0xa8fb, 0xa8fd, + 0xa8fd, 0xa90a, 0xa925, 0xa930, 0xa946, 0xa960, 0xa97c, 0xa984, + 0xa9b2, 0xa9e0, 0xa9e4, 0xa9e7, 0xa9ef, 0xa9fa, 0xa9fe, 0xaa00, + 0xaa28, 0xaa40, 0xaa42, 0xaa44, 0xaa4b, 0xaa60, 0xaa6f, 0xaa71, + 0xaa76, 0xaa7a, 0xaa7a, 0xaa7e, 0xaaaf, 0xaab1, 0xaab1, 0xaab5, + 0xaab6, 0xaab9, 0xaabd, 0xaac0, 0xaac0, 0xaac2, 0xaac2, 0xaadb, + 0xaadc, 0xaae0, 0xaaea, 0xaaf2, 0xaaf2, 0xab01, 0xab06, 0xab09, + 0xab0e, 0xab11, 0xab16, 0xab20, 0xab26, 0xab28, 0xab2e, 0xabc0, + 0xabe2, 0xac00, 0xd7a3, 0xd7b0, 0xd7c6, 0xd7cb, 0xd7fb, 0xf900, + 0xfa6d, 0xfa70, 0xfad9, 0xfb1d, 0xfb1d, 0xfb1f, 0xfb28, 0xfb2a, + 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, + 0xfb44, 0xfb46, 0xfbb1, 0xfbd3, 0xfd3d, 0xfd50, 0xfd8f, 0xfd92, + 0xfdc7, 0xfdf0, 0xfdfb, 0xfe70, 0xfe74, 0xfe76, 0xfefc, 0xff66, + 0xff6f, 0xff71, 0xff9d, 0xffa0, 0xffbe, 0xffc2, 0xffc7, 0xffca, + 0xffcf, 0xffd2, 0xffd7, 0xffda, 0xffdc, 0x10000, 0x1000b, 0x1000d, + 0x10026, 0x10028, 0x1003a, 0x1003c, 0x1003d, 0x1003f, 0x1004d, 0x10050, + 0x1005d, 0x10080, 0x100fa, 0x10280, 0x1029c, 0x102a0, 0x102d0, 0x10300, + 0x1031f, 0x10330, 0x10340, 0x10342, 0x10349, 0x10350, 0x10375, 0x10380, + 0x1039d, 0x103a0, 0x103c3, 0x103c8, 0x103cf, 0x10450, 0x1049d, 0x10500, + 0x10527, 0x10530, 0x10563, 0x10600, 0x10736, 0x10740, 0x10755, 0x10760, + 0x10767, 0x10800, 0x10805, 0x10808, 0x10808, 0x1080a, 0x10835, 0x10837, + 0x10838, 0x1083c, 0x1083c, 0x1083f, 0x10855, 0x10860, 0x10876, 0x10880, + 0x1089e, 0x108e0, 0x108f2, 0x108f4, 0x108f5, 0x10900, 0x10915, 0x10920, + 0x10939, 0x10980, 0x109b7, 0x109be, 0x109bf, 0x10a00, 0x10a00, 0x10a10, + 0x10a13, 0x10a15, 0x10a17, 0x10a19, 0x10a33, 0x10a60, 0x10a7c, 0x10a80, + 0x10a9c, 0x10ac0, 0x10ac7, 0x10ac9, 0x10ae4, 0x10b00, 0x10b35, 0x10b40, + 0x10b55, 0x10b60, 0x10b72, 0x10b80, 0x10b91, 0x10c00, 0x10c48, 0x11003, + 0x11037, 0x11083, 0x110af, 0x110d0, 0x110e8, 0x11103, 0x11126, 0x11150, + 0x11172, 0x11176, 0x11176, 0x11183, 0x111b2, 0x111c1, 0x111c4, 0x111da, + 0x111da, 0x111dc, 0x111dc, 0x11200, 0x11211, 0x11213, 0x1122b, 0x11280, + 0x11286, 0x11288, 0x11288, 0x1128a, 0x1128d, 0x1128f, 0x1129d, 0x1129f, + 0x112a8, 0x112b0, 0x112de, 0x11305, 0x1130c, 0x1130f, 0x11310, 0x11313, + 0x11328, 0x1132a, 0x11330, 0x11332, 0x11333, 0x11335, 0x11339, 0x1133d, + 0x1133d, 0x11350, 0x11350, 0x1135d, 0x11361, 0x11400, 0x11434, 0x11447, + 0x1144a, 0x11480, 0x114af, 0x114c4, 0x114c5, 0x114c7, 0x114c7, 0x11580, + 0x115ae, 0x115d8, 0x115db, 0x11600, 0x1162f, 0x11644, 0x11644, 0x11680, + 0x116aa, 0x11700, 0x11719, 0x118ff, 0x118ff, 0x11ac0, 0x11af8, 0x11c00, + 0x11c08, 0x11c0a, 0x11c2e, 0x11c40, 0x11c40, 0x11c72, 0x11c8f, 0x12000, + 0x12399, 0x12480, 0x12543, 0x13000, 0x1342e, 0x14400, 0x14646, 0x16800, + 0x16a38, 0x16a40, 0x16a5e, 0x16ad0, 0x16aed, 0x16b00, 0x16b2f, 0x16b63, + 0x16b77, 0x16b7d, 0x16b8f, 0x16f00, 0x16f44, 0x16f50, 0x16f50, 0x17000, + 0x187ec, 0x18800, 0x18af2, 0x1b000, 0x1b001, 0x1bc00, 0x1bc6a, 0x1bc70, + 0x1bc7c, 0x1bc80, 0x1bc88, 0x1bc90, 0x1bc99, 0x1e800, 0x1e8c4, 0x1ee00, + 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, 0x1ee22, 0x1ee24, 0x1ee24, 0x1ee27, + 0x1ee27, 0x1ee29, 0x1ee32, 0x1ee34, 0x1ee37, 0x1ee39, 0x1ee39, 0x1ee3b, + 0x1ee3b, 0x1ee42, 0x1ee42, 0x1ee47, 0x1ee47, 0x1ee49, 0x1ee49, 0x1ee4b, + 0x1ee4b, 0x1ee4d, 0x1ee4f, 0x1ee51, 0x1ee52, 0x1ee54, 0x1ee54, 0x1ee57, + 0x1ee57, 0x1ee59, 0x1ee59, 0x1ee5b, 0x1ee5b, 0x1ee5d, 0x1ee5d, 0x1ee5f, + 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, 0x1ee64, 0x1ee67, 0x1ee6a, 0x1ee6c, + 0x1ee72, 0x1ee74, 0x1ee77, 0x1ee79, 0x1ee7c, 0x1ee7e, 0x1ee7e, 0x1ee80, + 0x1ee89, 0x1ee8b, 0x1ee9b, 0x1eea1, 0x1eea3, 0x1eea5, 0x1eea9, 0x1eeab, + 0x1eebb, 0x20000, 0x2a6d6, 0x2a700, 0x2b734, 0x2b740, 0x2b81d, 0x2b820, + 0x2cea1, 0x2f800, 0x2fa1d, +}; /* CR_Lo */ + +/* 'Lt': General Category */ +static const OnigCodePoint CR_Lt[] = { + 10, 0x01c5, 0x01c5, 0x01c8, 0x01c8, 0x01cb, 0x01cb, + 0x01f2, 0x01f2, 0x1f88, 0x1f8f, 0x1f98, 0x1f9f, 0x1fa8, + 0x1faf, 0x1fbc, 0x1fbc, 0x1fcc, 0x1fcc, 0x1ffc, 0x1ffc, +}; /* CR_Lt */ + +/* 'Lu': General Category */ +static const OnigCodePoint CR_Lu[] = { + 627, 0x0041, 0x005a, 0x00c0, 0x00d6, 0x00d8, 0x00de, 0x0100, + 0x0100, 0x0102, 0x0102, 0x0104, 0x0104, 0x0106, 0x0106, 0x0108, + 0x0108, 0x010a, 0x010a, 0x010c, 0x010c, 0x010e, 0x010e, 0x0110, + 0x0110, 0x0112, 0x0112, 0x0114, 0x0114, 0x0116, 0x0116, 0x0118, + 0x0118, 0x011a, 0x011a, 0x011c, 0x011c, 0x011e, 0x011e, 0x0120, + 0x0120, 0x0122, 0x0122, 0x0124, 0x0124, 0x0126, 0x0126, 0x0128, + 0x0128, 0x012a, 0x012a, 0x012c, 0x012c, 0x012e, 0x012e, 0x0130, + 0x0130, 0x0132, 0x0132, 0x0134, 0x0134, 0x0136, 0x0136, 0x0139, + 0x0139, 0x013b, 0x013b, 0x013d, 0x013d, 0x013f, 0x013f, 0x0141, + 0x0141, 0x0143, 0x0143, 0x0145, 0x0145, 0x0147, 0x0147, 0x014a, + 0x014a, 0x014c, 0x014c, 0x014e, 0x014e, 0x0150, 0x0150, 0x0152, + 0x0152, 0x0154, 0x0154, 0x0156, 0x0156, 0x0158, 0x0158, 0x015a, + 0x015a, 0x015c, 0x015c, 0x015e, 0x015e, 0x0160, 0x0160, 0x0162, + 0x0162, 0x0164, 0x0164, 0x0166, 0x0166, 0x0168, 0x0168, 0x016a, + 0x016a, 0x016c, 0x016c, 0x016e, 0x016e, 0x0170, 0x0170, 0x0172, + 0x0172, 0x0174, 0x0174, 0x0176, 0x0176, 0x0178, 0x0179, 0x017b, + 0x017b, 0x017d, 0x017d, 0x0181, 0x0182, 0x0184, 0x0184, 0x0186, + 0x0187, 0x0189, 0x018b, 0x018e, 0x0191, 0x0193, 0x0194, 0x0196, + 0x0198, 0x019c, 0x019d, 0x019f, 0x01a0, 0x01a2, 0x01a2, 0x01a4, + 0x01a4, 0x01a6, 0x01a7, 0x01a9, 0x01a9, 0x01ac, 0x01ac, 0x01ae, + 0x01af, 0x01b1, 0x01b3, 0x01b5, 0x01b5, 0x01b7, 0x01b8, 0x01bc, + 0x01bc, 0x01c4, 0x01c4, 0x01c7, 0x01c7, 0x01ca, 0x01ca, 0x01cd, + 0x01cd, 0x01cf, 0x01cf, 0x01d1, 0x01d1, 0x01d3, 0x01d3, 0x01d5, + 0x01d5, 0x01d7, 0x01d7, 0x01d9, 0x01d9, 0x01db, 0x01db, 0x01de, + 0x01de, 0x01e0, 0x01e0, 0x01e2, 0x01e2, 0x01e4, 0x01e4, 0x01e6, + 0x01e6, 0x01e8, 0x01e8, 0x01ea, 0x01ea, 0x01ec, 0x01ec, 0x01ee, + 0x01ee, 0x01f1, 0x01f1, 0x01f4, 0x01f4, 0x01f6, 0x01f8, 0x01fa, + 0x01fa, 0x01fc, 0x01fc, 0x01fe, 0x01fe, 0x0200, 0x0200, 0x0202, + 0x0202, 0x0204, 0x0204, 0x0206, 0x0206, 0x0208, 0x0208, 0x020a, + 0x020a, 0x020c, 0x020c, 0x020e, 0x020e, 0x0210, 0x0210, 0x0212, + 0x0212, 0x0214, 0x0214, 0x0216, 0x0216, 0x0218, 0x0218, 0x021a, + 0x021a, 0x021c, 0x021c, 0x021e, 0x021e, 0x0220, 0x0220, 0x0222, + 0x0222, 0x0224, 0x0224, 0x0226, 0x0226, 0x0228, 0x0228, 0x022a, + 0x022a, 0x022c, 0x022c, 0x022e, 0x022e, 0x0230, 0x0230, 0x0232, + 0x0232, 0x023a, 0x023b, 0x023d, 0x023e, 0x0241, 0x0241, 0x0243, + 0x0246, 0x0248, 0x0248, 0x024a, 0x024a, 0x024c, 0x024c, 0x024e, + 0x024e, 0x0370, 0x0370, 0x0372, 0x0372, 0x0376, 0x0376, 0x037f, + 0x037f, 0x0386, 0x0386, 0x0388, 0x038a, 0x038c, 0x038c, 0x038e, + 0x038f, 0x0391, 0x03a1, 0x03a3, 0x03ab, 0x03cf, 0x03cf, 0x03d2, + 0x03d4, 0x03d8, 0x03d8, 0x03da, 0x03da, 0x03dc, 0x03dc, 0x03de, + 0x03de, 0x03e0, 0x03e0, 0x03e2, 0x03e2, 0x03e4, 0x03e4, 0x03e6, + 0x03e6, 0x03e8, 0x03e8, 0x03ea, 0x03ea, 0x03ec, 0x03ec, 0x03ee, + 0x03ee, 0x03f4, 0x03f4, 0x03f7, 0x03f7, 0x03f9, 0x03fa, 0x03fd, + 0x042f, 0x0460, 0x0460, 0x0462, 0x0462, 0x0464, 0x0464, 0x0466, + 0x0466, 0x0468, 0x0468, 0x046a, 0x046a, 0x046c, 0x046c, 0x046e, + 0x046e, 0x0470, 0x0470, 0x0472, 0x0472, 0x0474, 0x0474, 0x0476, + 0x0476, 0x0478, 0x0478, 0x047a, 0x047a, 0x047c, 0x047c, 0x047e, + 0x047e, 0x0480, 0x0480, 0x048a, 0x048a, 0x048c, 0x048c, 0x048e, + 0x048e, 0x0490, 0x0490, 0x0492, 0x0492, 0x0494, 0x0494, 0x0496, + 0x0496, 0x0498, 0x0498, 0x049a, 0x049a, 0x049c, 0x049c, 0x049e, + 0x049e, 0x04a0, 0x04a0, 0x04a2, 0x04a2, 0x04a4, 0x04a4, 0x04a6, + 0x04a6, 0x04a8, 0x04a8, 0x04aa, 0x04aa, 0x04ac, 0x04ac, 0x04ae, + 0x04ae, 0x04b0, 0x04b0, 0x04b2, 0x04b2, 0x04b4, 0x04b4, 0x04b6, + 0x04b6, 0x04b8, 0x04b8, 0x04ba, 0x04ba, 0x04bc, 0x04bc, 0x04be, + 0x04be, 0x04c0, 0x04c1, 0x04c3, 0x04c3, 0x04c5, 0x04c5, 0x04c7, + 0x04c7, 0x04c9, 0x04c9, 0x04cb, 0x04cb, 0x04cd, 0x04cd, 0x04d0, + 0x04d0, 0x04d2, 0x04d2, 0x04d4, 0x04d4, 0x04d6, 0x04d6, 0x04d8, + 0x04d8, 0x04da, 0x04da, 0x04dc, 0x04dc, 0x04de, 0x04de, 0x04e0, + 0x04e0, 0x04e2, 0x04e2, 0x04e4, 0x04e4, 0x04e6, 0x04e6, 0x04e8, + 0x04e8, 0x04ea, 0x04ea, 0x04ec, 0x04ec, 0x04ee, 0x04ee, 0x04f0, + 0x04f0, 0x04f2, 0x04f2, 0x04f4, 0x04f4, 0x04f6, 0x04f6, 0x04f8, + 0x04f8, 0x04fa, 0x04fa, 0x04fc, 0x04fc, 0x04fe, 0x04fe, 0x0500, + 0x0500, 0x0502, 0x0502, 0x0504, 0x0504, 0x0506, 0x0506, 0x0508, + 0x0508, 0x050a, 0x050a, 0x050c, 0x050c, 0x050e, 0x050e, 0x0510, + 0x0510, 0x0512, 0x0512, 0x0514, 0x0514, 0x0516, 0x0516, 0x0518, + 0x0518, 0x051a, 0x051a, 0x051c, 0x051c, 0x051e, 0x051e, 0x0520, + 0x0520, 0x0522, 0x0522, 0x0524, 0x0524, 0x0526, 0x0526, 0x0528, + 0x0528, 0x052a, 0x052a, 0x052c, 0x052c, 0x052e, 0x052e, 0x0531, + 0x0556, 0x10a0, 0x10c5, 0x10c7, 0x10c7, 0x10cd, 0x10cd, 0x13a0, + 0x13f5, 0x1e00, 0x1e00, 0x1e02, 0x1e02, 0x1e04, 0x1e04, 0x1e06, + 0x1e06, 0x1e08, 0x1e08, 0x1e0a, 0x1e0a, 0x1e0c, 0x1e0c, 0x1e0e, + 0x1e0e, 0x1e10, 0x1e10, 0x1e12, 0x1e12, 0x1e14, 0x1e14, 0x1e16, + 0x1e16, 0x1e18, 0x1e18, 0x1e1a, 0x1e1a, 0x1e1c, 0x1e1c, 0x1e1e, + 0x1e1e, 0x1e20, 0x1e20, 0x1e22, 0x1e22, 0x1e24, 0x1e24, 0x1e26, + 0x1e26, 0x1e28, 0x1e28, 0x1e2a, 0x1e2a, 0x1e2c, 0x1e2c, 0x1e2e, + 0x1e2e, 0x1e30, 0x1e30, 0x1e32, 0x1e32, 0x1e34, 0x1e34, 0x1e36, + 0x1e36, 0x1e38, 0x1e38, 0x1e3a, 0x1e3a, 0x1e3c, 0x1e3c, 0x1e3e, + 0x1e3e, 0x1e40, 0x1e40, 0x1e42, 0x1e42, 0x1e44, 0x1e44, 0x1e46, + 0x1e46, 0x1e48, 0x1e48, 0x1e4a, 0x1e4a, 0x1e4c, 0x1e4c, 0x1e4e, + 0x1e4e, 0x1e50, 0x1e50, 0x1e52, 0x1e52, 0x1e54, 0x1e54, 0x1e56, + 0x1e56, 0x1e58, 0x1e58, 0x1e5a, 0x1e5a, 0x1e5c, 0x1e5c, 0x1e5e, + 0x1e5e, 0x1e60, 0x1e60, 0x1e62, 0x1e62, 0x1e64, 0x1e64, 0x1e66, + 0x1e66, 0x1e68, 0x1e68, 0x1e6a, 0x1e6a, 0x1e6c, 0x1e6c, 0x1e6e, + 0x1e6e, 0x1e70, 0x1e70, 0x1e72, 0x1e72, 0x1e74, 0x1e74, 0x1e76, + 0x1e76, 0x1e78, 0x1e78, 0x1e7a, 0x1e7a, 0x1e7c, 0x1e7c, 0x1e7e, + 0x1e7e, 0x1e80, 0x1e80, 0x1e82, 0x1e82, 0x1e84, 0x1e84, 0x1e86, + 0x1e86, 0x1e88, 0x1e88, 0x1e8a, 0x1e8a, 0x1e8c, 0x1e8c, 0x1e8e, + 0x1e8e, 0x1e90, 0x1e90, 0x1e92, 0x1e92, 0x1e94, 0x1e94, 0x1e9e, + 0x1e9e, 0x1ea0, 0x1ea0, 0x1ea2, 0x1ea2, 0x1ea4, 0x1ea4, 0x1ea6, + 0x1ea6, 0x1ea8, 0x1ea8, 0x1eaa, 0x1eaa, 0x1eac, 0x1eac, 0x1eae, + 0x1eae, 0x1eb0, 0x1eb0, 0x1eb2, 0x1eb2, 0x1eb4, 0x1eb4, 0x1eb6, + 0x1eb6, 0x1eb8, 0x1eb8, 0x1eba, 0x1eba, 0x1ebc, 0x1ebc, 0x1ebe, + 0x1ebe, 0x1ec0, 0x1ec0, 0x1ec2, 0x1ec2, 0x1ec4, 0x1ec4, 0x1ec6, + 0x1ec6, 0x1ec8, 0x1ec8, 0x1eca, 0x1eca, 0x1ecc, 0x1ecc, 0x1ece, + 0x1ece, 0x1ed0, 0x1ed0, 0x1ed2, 0x1ed2, 0x1ed4, 0x1ed4, 0x1ed6, + 0x1ed6, 0x1ed8, 0x1ed8, 0x1eda, 0x1eda, 0x1edc, 0x1edc, 0x1ede, + 0x1ede, 0x1ee0, 0x1ee0, 0x1ee2, 0x1ee2, 0x1ee4, 0x1ee4, 0x1ee6, + 0x1ee6, 0x1ee8, 0x1ee8, 0x1eea, 0x1eea, 0x1eec, 0x1eec, 0x1eee, + 0x1eee, 0x1ef0, 0x1ef0, 0x1ef2, 0x1ef2, 0x1ef4, 0x1ef4, 0x1ef6, + 0x1ef6, 0x1ef8, 0x1ef8, 0x1efa, 0x1efa, 0x1efc, 0x1efc, 0x1efe, + 0x1efe, 0x1f08, 0x1f0f, 0x1f18, 0x1f1d, 0x1f28, 0x1f2f, 0x1f38, + 0x1f3f, 0x1f48, 0x1f4d, 0x1f59, 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, + 0x1f5d, 0x1f5f, 0x1f5f, 0x1f68, 0x1f6f, 0x1fb8, 0x1fbb, 0x1fc8, + 0x1fcb, 0x1fd8, 0x1fdb, 0x1fe8, 0x1fec, 0x1ff8, 0x1ffb, 0x2102, + 0x2102, 0x2107, 0x2107, 0x210b, 0x210d, 0x2110, 0x2112, 0x2115, + 0x2115, 0x2119, 0x211d, 0x2124, 0x2124, 0x2126, 0x2126, 0x2128, + 0x2128, 0x212a, 0x212d, 0x2130, 0x2133, 0x213e, 0x213f, 0x2145, + 0x2145, 0x2183, 0x2183, 0x2c00, 0x2c2e, 0x2c60, 0x2c60, 0x2c62, + 0x2c64, 0x2c67, 0x2c67, 0x2c69, 0x2c69, 0x2c6b, 0x2c6b, 0x2c6d, + 0x2c70, 0x2c72, 0x2c72, 0x2c75, 0x2c75, 0x2c7e, 0x2c80, 0x2c82, + 0x2c82, 0x2c84, 0x2c84, 0x2c86, 0x2c86, 0x2c88, 0x2c88, 0x2c8a, + 0x2c8a, 0x2c8c, 0x2c8c, 0x2c8e, 0x2c8e, 0x2c90, 0x2c90, 0x2c92, + 0x2c92, 0x2c94, 0x2c94, 0x2c96, 0x2c96, 0x2c98, 0x2c98, 0x2c9a, + 0x2c9a, 0x2c9c, 0x2c9c, 0x2c9e, 0x2c9e, 0x2ca0, 0x2ca0, 0x2ca2, + 0x2ca2, 0x2ca4, 0x2ca4, 0x2ca6, 0x2ca6, 0x2ca8, 0x2ca8, 0x2caa, + 0x2caa, 0x2cac, 0x2cac, 0x2cae, 0x2cae, 0x2cb0, 0x2cb0, 0x2cb2, + 0x2cb2, 0x2cb4, 0x2cb4, 0x2cb6, 0x2cb6, 0x2cb8, 0x2cb8, 0x2cba, + 0x2cba, 0x2cbc, 0x2cbc, 0x2cbe, 0x2cbe, 0x2cc0, 0x2cc0, 0x2cc2, + 0x2cc2, 0x2cc4, 0x2cc4, 0x2cc6, 0x2cc6, 0x2cc8, 0x2cc8, 0x2cca, + 0x2cca, 0x2ccc, 0x2ccc, 0x2cce, 0x2cce, 0x2cd0, 0x2cd0, 0x2cd2, + 0x2cd2, 0x2cd4, 0x2cd4, 0x2cd6, 0x2cd6, 0x2cd8, 0x2cd8, 0x2cda, + 0x2cda, 0x2cdc, 0x2cdc, 0x2cde, 0x2cde, 0x2ce0, 0x2ce0, 0x2ce2, + 0x2ce2, 0x2ceb, 0x2ceb, 0x2ced, 0x2ced, 0x2cf2, 0x2cf2, 0xa640, + 0xa640, 0xa642, 0xa642, 0xa644, 0xa644, 0xa646, 0xa646, 0xa648, + 0xa648, 0xa64a, 0xa64a, 0xa64c, 0xa64c, 0xa64e, 0xa64e, 0xa650, + 0xa650, 0xa652, 0xa652, 0xa654, 0xa654, 0xa656, 0xa656, 0xa658, + 0xa658, 0xa65a, 0xa65a, 0xa65c, 0xa65c, 0xa65e, 0xa65e, 0xa660, + 0xa660, 0xa662, 0xa662, 0xa664, 0xa664, 0xa666, 0xa666, 0xa668, + 0xa668, 0xa66a, 0xa66a, 0xa66c, 0xa66c, 0xa680, 0xa680, 0xa682, + 0xa682, 0xa684, 0xa684, 0xa686, 0xa686, 0xa688, 0xa688, 0xa68a, + 0xa68a, 0xa68c, 0xa68c, 0xa68e, 0xa68e, 0xa690, 0xa690, 0xa692, + 0xa692, 0xa694, 0xa694, 0xa696, 0xa696, 0xa698, 0xa698, 0xa69a, + 0xa69a, 0xa722, 0xa722, 0xa724, 0xa724, 0xa726, 0xa726, 0xa728, + 0xa728, 0xa72a, 0xa72a, 0xa72c, 0xa72c, 0xa72e, 0xa72e, 0xa732, + 0xa732, 0xa734, 0xa734, 0xa736, 0xa736, 0xa738, 0xa738, 0xa73a, + 0xa73a, 0xa73c, 0xa73c, 0xa73e, 0xa73e, 0xa740, 0xa740, 0xa742, + 0xa742, 0xa744, 0xa744, 0xa746, 0xa746, 0xa748, 0xa748, 0xa74a, + 0xa74a, 0xa74c, 0xa74c, 0xa74e, 0xa74e, 0xa750, 0xa750, 0xa752, + 0xa752, 0xa754, 0xa754, 0xa756, 0xa756, 0xa758, 0xa758, 0xa75a, + 0xa75a, 0xa75c, 0xa75c, 0xa75e, 0xa75e, 0xa760, 0xa760, 0xa762, + 0xa762, 0xa764, 0xa764, 0xa766, 0xa766, 0xa768, 0xa768, 0xa76a, + 0xa76a, 0xa76c, 0xa76c, 0xa76e, 0xa76e, 0xa779, 0xa779, 0xa77b, + 0xa77b, 0xa77d, 0xa77e, 0xa780, 0xa780, 0xa782, 0xa782, 0xa784, + 0xa784, 0xa786, 0xa786, 0xa78b, 0xa78b, 0xa78d, 0xa78d, 0xa790, + 0xa790, 0xa792, 0xa792, 0xa796, 0xa796, 0xa798, 0xa798, 0xa79a, + 0xa79a, 0xa79c, 0xa79c, 0xa79e, 0xa79e, 0xa7a0, 0xa7a0, 0xa7a2, + 0xa7a2, 0xa7a4, 0xa7a4, 0xa7a6, 0xa7a6, 0xa7a8, 0xa7a8, 0xa7aa, + 0xa7ae, 0xa7b0, 0xa7b4, 0xa7b6, 0xa7b6, 0xff21, 0xff3a, 0x10400, + 0x10427, 0x104b0, 0x104d3, 0x10c80, 0x10cb2, 0x118a0, 0x118bf, 0x1d400, + 0x1d419, 0x1d434, 0x1d44d, 0x1d468, 0x1d481, 0x1d49c, 0x1d49c, 0x1d49e, + 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, + 0x1d4b5, 0x1d4d0, 0x1d4e9, 0x1d504, 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, + 0x1d514, 0x1d516, 0x1d51c, 0x1d538, 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, + 0x1d544, 0x1d546, 0x1d546, 0x1d54a, 0x1d550, 0x1d56c, 0x1d585, 0x1d5a0, + 0x1d5b9, 0x1d5d4, 0x1d5ed, 0x1d608, 0x1d621, 0x1d63c, 0x1d655, 0x1d670, + 0x1d689, 0x1d6a8, 0x1d6c0, 0x1d6e2, 0x1d6fa, 0x1d71c, 0x1d734, 0x1d756, + 0x1d76e, 0x1d790, 0x1d7a8, 0x1d7ca, 0x1d7ca, 0x1e900, 0x1e921, +}; /* CR_Lu */ + +/* 'M': Major Category */ +static const OnigCodePoint CR_M[] = { + 250, 0x0300, 0x036f, 0x0483, 0x0489, 0x0591, 0x05bd, 0x05bf, + 0x05bf, 0x05c1, 0x05c2, 0x05c4, 0x05c5, 0x05c7, 0x05c7, 0x0610, + 0x061a, 0x064b, 0x065f, 0x0670, 0x0670, 0x06d6, 0x06dc, 0x06df, + 0x06e4, 0x06e7, 0x06e8, 0x06ea, 0x06ed, 0x0711, 0x0711, 0x0730, + 0x074a, 0x07a6, 0x07b0, 0x07eb, 0x07f3, 0x0816, 0x0819, 0x081b, + 0x0823, 0x0825, 0x0827, 0x0829, 0x082d, 0x0859, 0x085b, 0x08d4, + 0x08e1, 0x08e3, 0x0903, 0x093a, 0x093c, 0x093e, 0x094f, 0x0951, + 0x0957, 0x0962, 0x0963, 0x0981, 0x0983, 0x09bc, 0x09bc, 0x09be, + 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09cd, 0x09d7, 0x09d7, 0x09e2, + 0x09e3, 0x0a01, 0x0a03, 0x0a3c, 0x0a3c, 0x0a3e, 0x0a42, 0x0a47, + 0x0a48, 0x0a4b, 0x0a4d, 0x0a51, 0x0a51, 0x0a70, 0x0a71, 0x0a75, + 0x0a75, 0x0a81, 0x0a83, 0x0abc, 0x0abc, 0x0abe, 0x0ac5, 0x0ac7, + 0x0ac9, 0x0acb, 0x0acd, 0x0ae2, 0x0ae3, 0x0b01, 0x0b03, 0x0b3c, + 0x0b3c, 0x0b3e, 0x0b44, 0x0b47, 0x0b48, 0x0b4b, 0x0b4d, 0x0b56, + 0x0b57, 0x0b62, 0x0b63, 0x0b82, 0x0b82, 0x0bbe, 0x0bc2, 0x0bc6, + 0x0bc8, 0x0bca, 0x0bcd, 0x0bd7, 0x0bd7, 0x0c00, 0x0c03, 0x0c3e, + 0x0c44, 0x0c46, 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, 0x0c56, 0x0c62, + 0x0c63, 0x0c81, 0x0c83, 0x0cbc, 0x0cbc, 0x0cbe, 0x0cc4, 0x0cc6, + 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, 0x0cd6, 0x0ce2, 0x0ce3, 0x0d01, + 0x0d03, 0x0d3e, 0x0d44, 0x0d46, 0x0d48, 0x0d4a, 0x0d4d, 0x0d57, + 0x0d57, 0x0d62, 0x0d63, 0x0d82, 0x0d83, 0x0dca, 0x0dca, 0x0dcf, + 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, 0x0ddf, 0x0df2, 0x0df3, 0x0e31, + 0x0e31, 0x0e34, 0x0e3a, 0x0e47, 0x0e4e, 0x0eb1, 0x0eb1, 0x0eb4, + 0x0eb9, 0x0ebb, 0x0ebc, 0x0ec8, 0x0ecd, 0x0f18, 0x0f19, 0x0f35, + 0x0f35, 0x0f37, 0x0f37, 0x0f39, 0x0f39, 0x0f3e, 0x0f3f, 0x0f71, + 0x0f84, 0x0f86, 0x0f87, 0x0f8d, 0x0f97, 0x0f99, 0x0fbc, 0x0fc6, + 0x0fc6, 0x102b, 0x103e, 0x1056, 0x1059, 0x105e, 0x1060, 0x1062, + 0x1064, 0x1067, 0x106d, 0x1071, 0x1074, 0x1082, 0x108d, 0x108f, + 0x108f, 0x109a, 0x109d, 0x135d, 0x135f, 0x1712, 0x1714, 0x1732, + 0x1734, 0x1752, 0x1753, 0x1772, 0x1773, 0x17b4, 0x17d3, 0x17dd, + 0x17dd, 0x180b, 0x180d, 0x1885, 0x1886, 0x18a9, 0x18a9, 0x1920, + 0x192b, 0x1930, 0x193b, 0x1a17, 0x1a1b, 0x1a55, 0x1a5e, 0x1a60, + 0x1a7c, 0x1a7f, 0x1a7f, 0x1ab0, 0x1abe, 0x1b00, 0x1b04, 0x1b34, + 0x1b44, 0x1b6b, 0x1b73, 0x1b80, 0x1b82, 0x1ba1, 0x1bad, 0x1be6, + 0x1bf3, 0x1c24, 0x1c37, 0x1cd0, 0x1cd2, 0x1cd4, 0x1ce8, 0x1ced, + 0x1ced, 0x1cf2, 0x1cf4, 0x1cf8, 0x1cf9, 0x1dc0, 0x1df5, 0x1dfb, + 0x1dff, 0x20d0, 0x20f0, 0x2cef, 0x2cf1, 0x2d7f, 0x2d7f, 0x2de0, + 0x2dff, 0x302a, 0x302f, 0x3099, 0x309a, 0xa66f, 0xa672, 0xa674, + 0xa67d, 0xa69e, 0xa69f, 0xa6f0, 0xa6f1, 0xa802, 0xa802, 0xa806, + 0xa806, 0xa80b, 0xa80b, 0xa823, 0xa827, 0xa880, 0xa881, 0xa8b4, + 0xa8c5, 0xa8e0, 0xa8f1, 0xa926, 0xa92d, 0xa947, 0xa953, 0xa980, + 0xa983, 0xa9b3, 0xa9c0, 0xa9e5, 0xa9e5, 0xaa29, 0xaa36, 0xaa43, + 0xaa43, 0xaa4c, 0xaa4d, 0xaa7b, 0xaa7d, 0xaab0, 0xaab0, 0xaab2, + 0xaab4, 0xaab7, 0xaab8, 0xaabe, 0xaabf, 0xaac1, 0xaac1, 0xaaeb, + 0xaaef, 0xaaf5, 0xaaf6, 0xabe3, 0xabea, 0xabec, 0xabed, 0xfb1e, + 0xfb1e, 0xfe00, 0xfe0f, 0xfe20, 0xfe2f, 0x101fd, 0x101fd, 0x102e0, + 0x102e0, 0x10376, 0x1037a, 0x10a01, 0x10a03, 0x10a05, 0x10a06, 0x10a0c, + 0x10a0f, 0x10a38, 0x10a3a, 0x10a3f, 0x10a3f, 0x10ae5, 0x10ae6, 0x11000, + 0x11002, 0x11038, 0x11046, 0x1107f, 0x11082, 0x110b0, 0x110ba, 0x11100, + 0x11102, 0x11127, 0x11134, 0x11173, 0x11173, 0x11180, 0x11182, 0x111b3, + 0x111c0, 0x111ca, 0x111cc, 0x1122c, 0x11237, 0x1123e, 0x1123e, 0x112df, + 0x112ea, 0x11300, 0x11303, 0x1133c, 0x1133c, 0x1133e, 0x11344, 0x11347, + 0x11348, 0x1134b, 0x1134d, 0x11357, 0x11357, 0x11362, 0x11363, 0x11366, + 0x1136c, 0x11370, 0x11374, 0x11435, 0x11446, 0x114b0, 0x114c3, 0x115af, + 0x115b5, 0x115b8, 0x115c0, 0x115dc, 0x115dd, 0x11630, 0x11640, 0x116ab, + 0x116b7, 0x1171d, 0x1172b, 0x11c2f, 0x11c36, 0x11c38, 0x11c3f, 0x11c92, + 0x11ca7, 0x11ca9, 0x11cb6, 0x16af0, 0x16af4, 0x16b30, 0x16b36, 0x16f51, + 0x16f7e, 0x16f8f, 0x16f92, 0x1bc9d, 0x1bc9e, 0x1d165, 0x1d169, 0x1d16d, + 0x1d172, 0x1d17b, 0x1d182, 0x1d185, 0x1d18b, 0x1d1aa, 0x1d1ad, 0x1d242, + 0x1d244, 0x1da00, 0x1da36, 0x1da3b, 0x1da6c, 0x1da75, 0x1da75, 0x1da84, + 0x1da84, 0x1da9b, 0x1da9f, 0x1daa1, 0x1daaf, 0x1e000, 0x1e006, 0x1e008, + 0x1e018, 0x1e01b, 0x1e021, 0x1e023, 0x1e024, 0x1e026, 0x1e02a, 0x1e8d0, + 0x1e8d6, 0x1e944, 0x1e94a, 0xe0100, 0xe01ef, +}; /* CR_M */ + +/* 'Mc': General Category */ +static const OnigCodePoint CR_Mc[] = { + 155, 0x0903, 0x0903, 0x093b, 0x093b, 0x093e, 0x0940, 0x0949, + 0x094c, 0x094e, 0x094f, 0x0982, 0x0983, 0x09be, 0x09c0, 0x09c7, + 0x09c8, 0x09cb, 0x09cc, 0x09d7, 0x09d7, 0x0a03, 0x0a03, 0x0a3e, + 0x0a40, 0x0a83, 0x0a83, 0x0abe, 0x0ac0, 0x0ac9, 0x0ac9, 0x0acb, + 0x0acc, 0x0b02, 0x0b03, 0x0b3e, 0x0b3e, 0x0b40, 0x0b40, 0x0b47, + 0x0b48, 0x0b4b, 0x0b4c, 0x0b57, 0x0b57, 0x0bbe, 0x0bbf, 0x0bc1, + 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, 0x0bcc, 0x0bd7, 0x0bd7, 0x0c01, + 0x0c03, 0x0c41, 0x0c44, 0x0c82, 0x0c83, 0x0cbe, 0x0cbe, 0x0cc0, + 0x0cc4, 0x0cc7, 0x0cc8, 0x0cca, 0x0ccb, 0x0cd5, 0x0cd6, 0x0d02, + 0x0d03, 0x0d3e, 0x0d40, 0x0d46, 0x0d48, 0x0d4a, 0x0d4c, 0x0d57, + 0x0d57, 0x0d82, 0x0d83, 0x0dcf, 0x0dd1, 0x0dd8, 0x0ddf, 0x0df2, + 0x0df3, 0x0f3e, 0x0f3f, 0x0f7f, 0x0f7f, 0x102b, 0x102c, 0x1031, + 0x1031, 0x1038, 0x1038, 0x103b, 0x103c, 0x1056, 0x1057, 0x1062, + 0x1064, 0x1067, 0x106d, 0x1083, 0x1084, 0x1087, 0x108c, 0x108f, + 0x108f, 0x109a, 0x109c, 0x17b6, 0x17b6, 0x17be, 0x17c5, 0x17c7, + 0x17c8, 0x1923, 0x1926, 0x1929, 0x192b, 0x1930, 0x1931, 0x1933, + 0x1938, 0x1a19, 0x1a1a, 0x1a55, 0x1a55, 0x1a57, 0x1a57, 0x1a61, + 0x1a61, 0x1a63, 0x1a64, 0x1a6d, 0x1a72, 0x1b04, 0x1b04, 0x1b35, + 0x1b35, 0x1b3b, 0x1b3b, 0x1b3d, 0x1b41, 0x1b43, 0x1b44, 0x1b82, + 0x1b82, 0x1ba1, 0x1ba1, 0x1ba6, 0x1ba7, 0x1baa, 0x1baa, 0x1be7, + 0x1be7, 0x1bea, 0x1bec, 0x1bee, 0x1bee, 0x1bf2, 0x1bf3, 0x1c24, + 0x1c2b, 0x1c34, 0x1c35, 0x1ce1, 0x1ce1, 0x1cf2, 0x1cf3, 0x302e, + 0x302f, 0xa823, 0xa824, 0xa827, 0xa827, 0xa880, 0xa881, 0xa8b4, + 0xa8c3, 0xa952, 0xa953, 0xa983, 0xa983, 0xa9b4, 0xa9b5, 0xa9ba, + 0xa9bb, 0xa9bd, 0xa9c0, 0xaa2f, 0xaa30, 0xaa33, 0xaa34, 0xaa4d, + 0xaa4d, 0xaa7b, 0xaa7b, 0xaa7d, 0xaa7d, 0xaaeb, 0xaaeb, 0xaaee, + 0xaaef, 0xaaf5, 0xaaf5, 0xabe3, 0xabe4, 0xabe6, 0xabe7, 0xabe9, + 0xabea, 0xabec, 0xabec, 0x11000, 0x11000, 0x11002, 0x11002, 0x11082, + 0x11082, 0x110b0, 0x110b2, 0x110b7, 0x110b8, 0x1112c, 0x1112c, 0x11182, + 0x11182, 0x111b3, 0x111b5, 0x111bf, 0x111c0, 0x1122c, 0x1122e, 0x11232, + 0x11233, 0x11235, 0x11235, 0x112e0, 0x112e2, 0x11302, 0x11303, 0x1133e, + 0x1133f, 0x11341, 0x11344, 0x11347, 0x11348, 0x1134b, 0x1134d, 0x11357, + 0x11357, 0x11362, 0x11363, 0x11435, 0x11437, 0x11440, 0x11441, 0x11445, + 0x11445, 0x114b0, 0x114b2, 0x114b9, 0x114b9, 0x114bb, 0x114be, 0x114c1, + 0x114c1, 0x115af, 0x115b1, 0x115b8, 0x115bb, 0x115be, 0x115be, 0x11630, + 0x11632, 0x1163b, 0x1163c, 0x1163e, 0x1163e, 0x116ac, 0x116ac, 0x116ae, + 0x116af, 0x116b6, 0x116b6, 0x11720, 0x11721, 0x11726, 0x11726, 0x11c2f, + 0x11c2f, 0x11c3e, 0x11c3e, 0x11ca9, 0x11ca9, 0x11cb1, 0x11cb1, 0x11cb4, + 0x11cb4, 0x16f51, 0x16f7e, 0x1d165, 0x1d166, 0x1d16d, 0x1d172, +}; /* CR_Mc */ + +/* 'Me': General Category */ +static const OnigCodePoint CR_Me[] = { + 5, 0x0488, 0x0489, 0x1abe, 0x1abe, 0x20dd, + 0x20e0, 0x20e2, 0x20e4, 0xa670, 0xa672, +}; /* CR_Me */ + +/* 'Mn': General Category */ +static const OnigCodePoint CR_Mn[] = { + 285, 0x0300, 0x036f, 0x0483, 0x0487, 0x0591, 0x05bd, 0x05bf, + 0x05bf, 0x05c1, 0x05c2, 0x05c4, 0x05c5, 0x05c7, 0x05c7, 0x0610, + 0x061a, 0x064b, 0x065f, 0x0670, 0x0670, 0x06d6, 0x06dc, 0x06df, + 0x06e4, 0x06e7, 0x06e8, 0x06ea, 0x06ed, 0x0711, 0x0711, 0x0730, + 0x074a, 0x07a6, 0x07b0, 0x07eb, 0x07f3, 0x0816, 0x0819, 0x081b, + 0x0823, 0x0825, 0x0827, 0x0829, 0x082d, 0x0859, 0x085b, 0x08d4, + 0x08e1, 0x08e3, 0x0902, 0x093a, 0x093a, 0x093c, 0x093c, 0x0941, + 0x0948, 0x094d, 0x094d, 0x0951, 0x0957, 0x0962, 0x0963, 0x0981, + 0x0981, 0x09bc, 0x09bc, 0x09c1, 0x09c4, 0x09cd, 0x09cd, 0x09e2, + 0x09e3, 0x0a01, 0x0a02, 0x0a3c, 0x0a3c, 0x0a41, 0x0a42, 0x0a47, + 0x0a48, 0x0a4b, 0x0a4d, 0x0a51, 0x0a51, 0x0a70, 0x0a71, 0x0a75, + 0x0a75, 0x0a81, 0x0a82, 0x0abc, 0x0abc, 0x0ac1, 0x0ac5, 0x0ac7, + 0x0ac8, 0x0acd, 0x0acd, 0x0ae2, 0x0ae3, 0x0b01, 0x0b01, 0x0b3c, + 0x0b3c, 0x0b3f, 0x0b3f, 0x0b41, 0x0b44, 0x0b4d, 0x0b4d, 0x0b56, + 0x0b56, 0x0b62, 0x0b63, 0x0b82, 0x0b82, 0x0bc0, 0x0bc0, 0x0bcd, + 0x0bcd, 0x0c00, 0x0c00, 0x0c3e, 0x0c40, 0x0c46, 0x0c48, 0x0c4a, + 0x0c4d, 0x0c55, 0x0c56, 0x0c62, 0x0c63, 0x0c81, 0x0c81, 0x0cbc, + 0x0cbc, 0x0cbf, 0x0cbf, 0x0cc6, 0x0cc6, 0x0ccc, 0x0ccd, 0x0ce2, + 0x0ce3, 0x0d01, 0x0d01, 0x0d41, 0x0d44, 0x0d4d, 0x0d4d, 0x0d62, + 0x0d63, 0x0dca, 0x0dca, 0x0dd2, 0x0dd4, 0x0dd6, 0x0dd6, 0x0e31, + 0x0e31, 0x0e34, 0x0e3a, 0x0e47, 0x0e4e, 0x0eb1, 0x0eb1, 0x0eb4, + 0x0eb9, 0x0ebb, 0x0ebc, 0x0ec8, 0x0ecd, 0x0f18, 0x0f19, 0x0f35, + 0x0f35, 0x0f37, 0x0f37, 0x0f39, 0x0f39, 0x0f71, 0x0f7e, 0x0f80, + 0x0f84, 0x0f86, 0x0f87, 0x0f8d, 0x0f97, 0x0f99, 0x0fbc, 0x0fc6, + 0x0fc6, 0x102d, 0x1030, 0x1032, 0x1037, 0x1039, 0x103a, 0x103d, + 0x103e, 0x1058, 0x1059, 0x105e, 0x1060, 0x1071, 0x1074, 0x1082, + 0x1082, 0x1085, 0x1086, 0x108d, 0x108d, 0x109d, 0x109d, 0x135d, + 0x135f, 0x1712, 0x1714, 0x1732, 0x1734, 0x1752, 0x1753, 0x1772, + 0x1773, 0x17b4, 0x17b5, 0x17b7, 0x17bd, 0x17c6, 0x17c6, 0x17c9, + 0x17d3, 0x17dd, 0x17dd, 0x180b, 0x180d, 0x1885, 0x1886, 0x18a9, + 0x18a9, 0x1920, 0x1922, 0x1927, 0x1928, 0x1932, 0x1932, 0x1939, + 0x193b, 0x1a17, 0x1a18, 0x1a1b, 0x1a1b, 0x1a56, 0x1a56, 0x1a58, + 0x1a5e, 0x1a60, 0x1a60, 0x1a62, 0x1a62, 0x1a65, 0x1a6c, 0x1a73, + 0x1a7c, 0x1a7f, 0x1a7f, 0x1ab0, 0x1abd, 0x1b00, 0x1b03, 0x1b34, + 0x1b34, 0x1b36, 0x1b3a, 0x1b3c, 0x1b3c, 0x1b42, 0x1b42, 0x1b6b, + 0x1b73, 0x1b80, 0x1b81, 0x1ba2, 0x1ba5, 0x1ba8, 0x1ba9, 0x1bab, + 0x1bad, 0x1be6, 0x1be6, 0x1be8, 0x1be9, 0x1bed, 0x1bed, 0x1bef, + 0x1bf1, 0x1c2c, 0x1c33, 0x1c36, 0x1c37, 0x1cd0, 0x1cd2, 0x1cd4, + 0x1ce0, 0x1ce2, 0x1ce8, 0x1ced, 0x1ced, 0x1cf4, 0x1cf4, 0x1cf8, + 0x1cf9, 0x1dc0, 0x1df5, 0x1dfb, 0x1dff, 0x20d0, 0x20dc, 0x20e1, + 0x20e1, 0x20e5, 0x20f0, 0x2cef, 0x2cf1, 0x2d7f, 0x2d7f, 0x2de0, + 0x2dff, 0x302a, 0x302d, 0x3099, 0x309a, 0xa66f, 0xa66f, 0xa674, + 0xa67d, 0xa69e, 0xa69f, 0xa6f0, 0xa6f1, 0xa802, 0xa802, 0xa806, + 0xa806, 0xa80b, 0xa80b, 0xa825, 0xa826, 0xa8c4, 0xa8c5, 0xa8e0, + 0xa8f1, 0xa926, 0xa92d, 0xa947, 0xa951, 0xa980, 0xa982, 0xa9b3, + 0xa9b3, 0xa9b6, 0xa9b9, 0xa9bc, 0xa9bc, 0xa9e5, 0xa9e5, 0xaa29, + 0xaa2e, 0xaa31, 0xaa32, 0xaa35, 0xaa36, 0xaa43, 0xaa43, 0xaa4c, + 0xaa4c, 0xaa7c, 0xaa7c, 0xaab0, 0xaab0, 0xaab2, 0xaab4, 0xaab7, + 0xaab8, 0xaabe, 0xaabf, 0xaac1, 0xaac1, 0xaaec, 0xaaed, 0xaaf6, + 0xaaf6, 0xabe5, 0xabe5, 0xabe8, 0xabe8, 0xabed, 0xabed, 0xfb1e, + 0xfb1e, 0xfe00, 0xfe0f, 0xfe20, 0xfe2f, 0x101fd, 0x101fd, 0x102e0, + 0x102e0, 0x10376, 0x1037a, 0x10a01, 0x10a03, 0x10a05, 0x10a06, 0x10a0c, + 0x10a0f, 0x10a38, 0x10a3a, 0x10a3f, 0x10a3f, 0x10ae5, 0x10ae6, 0x11001, + 0x11001, 0x11038, 0x11046, 0x1107f, 0x11081, 0x110b3, 0x110b6, 0x110b9, + 0x110ba, 0x11100, 0x11102, 0x11127, 0x1112b, 0x1112d, 0x11134, 0x11173, + 0x11173, 0x11180, 0x11181, 0x111b6, 0x111be, 0x111ca, 0x111cc, 0x1122f, + 0x11231, 0x11234, 0x11234, 0x11236, 0x11237, 0x1123e, 0x1123e, 0x112df, + 0x112df, 0x112e3, 0x112ea, 0x11300, 0x11301, 0x1133c, 0x1133c, 0x11340, + 0x11340, 0x11366, 0x1136c, 0x11370, 0x11374, 0x11438, 0x1143f, 0x11442, + 0x11444, 0x11446, 0x11446, 0x114b3, 0x114b8, 0x114ba, 0x114ba, 0x114bf, + 0x114c0, 0x114c2, 0x114c3, 0x115b2, 0x115b5, 0x115bc, 0x115bd, 0x115bf, + 0x115c0, 0x115dc, 0x115dd, 0x11633, 0x1163a, 0x1163d, 0x1163d, 0x1163f, + 0x11640, 0x116ab, 0x116ab, 0x116ad, 0x116ad, 0x116b0, 0x116b5, 0x116b7, + 0x116b7, 0x1171d, 0x1171f, 0x11722, 0x11725, 0x11727, 0x1172b, 0x11c30, + 0x11c36, 0x11c38, 0x11c3d, 0x11c3f, 0x11c3f, 0x11c92, 0x11ca7, 0x11caa, + 0x11cb0, 0x11cb2, 0x11cb3, 0x11cb5, 0x11cb6, 0x16af0, 0x16af4, 0x16b30, + 0x16b36, 0x16f8f, 0x16f92, 0x1bc9d, 0x1bc9e, 0x1d167, 0x1d169, 0x1d17b, + 0x1d182, 0x1d185, 0x1d18b, 0x1d1aa, 0x1d1ad, 0x1d242, 0x1d244, 0x1da00, + 0x1da36, 0x1da3b, 0x1da6c, 0x1da75, 0x1da75, 0x1da84, 0x1da84, 0x1da9b, + 0x1da9f, 0x1daa1, 0x1daaf, 0x1e000, 0x1e006, 0x1e008, 0x1e018, 0x1e01b, + 0x1e021, 0x1e023, 0x1e024, 0x1e026, 0x1e02a, 0x1e8d0, 0x1e8d6, 0x1e944, + 0x1e94a, 0xe0100, 0xe01ef, +}; /* CR_Mn */ + +/* 'N': Major Category */ +static const OnigCodePoint CR_N[] = { + 115, 0x0030, 0x0039, 0x00b2, 0x00b3, 0x00b9, 0x00b9, 0x00bc, + 0x00be, 0x0660, 0x0669, 0x06f0, 0x06f9, 0x07c0, 0x07c9, 0x0966, + 0x096f, 0x09e6, 0x09ef, 0x09f4, 0x09f9, 0x0a66, 0x0a6f, 0x0ae6, + 0x0aef, 0x0b66, 0x0b6f, 0x0b72, 0x0b77, 0x0be6, 0x0bf2, 0x0c66, + 0x0c6f, 0x0c78, 0x0c7e, 0x0ce6, 0x0cef, 0x0d58, 0x0d5e, 0x0d66, + 0x0d78, 0x0de6, 0x0def, 0x0e50, 0x0e59, 0x0ed0, 0x0ed9, 0x0f20, + 0x0f33, 0x1040, 0x1049, 0x1090, 0x1099, 0x1369, 0x137c, 0x16ee, + 0x16f0, 0x17e0, 0x17e9, 0x17f0, 0x17f9, 0x1810, 0x1819, 0x1946, + 0x194f, 0x19d0, 0x19da, 0x1a80, 0x1a89, 0x1a90, 0x1a99, 0x1b50, + 0x1b59, 0x1bb0, 0x1bb9, 0x1c40, 0x1c49, 0x1c50, 0x1c59, 0x2070, + 0x2070, 0x2074, 0x2079, 0x2080, 0x2089, 0x2150, 0x2182, 0x2185, + 0x2189, 0x2460, 0x249b, 0x24ea, 0x24ff, 0x2776, 0x2793, 0x2cfd, + 0x2cfd, 0x3007, 0x3007, 0x3021, 0x3029, 0x3038, 0x303a, 0x3192, + 0x3195, 0x3220, 0x3229, 0x3248, 0x324f, 0x3251, 0x325f, 0x3280, + 0x3289, 0x32b1, 0x32bf, 0xa620, 0xa629, 0xa6e6, 0xa6ef, 0xa830, + 0xa835, 0xa8d0, 0xa8d9, 0xa900, 0xa909, 0xa9d0, 0xa9d9, 0xa9f0, + 0xa9f9, 0xaa50, 0xaa59, 0xabf0, 0xabf9, 0xff10, 0xff19, 0x10107, + 0x10133, 0x10140, 0x10178, 0x1018a, 0x1018b, 0x102e1, 0x102fb, 0x10320, + 0x10323, 0x10341, 0x10341, 0x1034a, 0x1034a, 0x103d1, 0x103d5, 0x104a0, + 0x104a9, 0x10858, 0x1085f, 0x10879, 0x1087f, 0x108a7, 0x108af, 0x108fb, + 0x108ff, 0x10916, 0x1091b, 0x109bc, 0x109bd, 0x109c0, 0x109cf, 0x109d2, + 0x109ff, 0x10a40, 0x10a47, 0x10a7d, 0x10a7e, 0x10a9d, 0x10a9f, 0x10aeb, + 0x10aef, 0x10b58, 0x10b5f, 0x10b78, 0x10b7f, 0x10ba9, 0x10baf, 0x10cfa, + 0x10cff, 0x10e60, 0x10e7e, 0x11052, 0x1106f, 0x110f0, 0x110f9, 0x11136, + 0x1113f, 0x111d0, 0x111d9, 0x111e1, 0x111f4, 0x112f0, 0x112f9, 0x11450, + 0x11459, 0x114d0, 0x114d9, 0x11650, 0x11659, 0x116c0, 0x116c9, 0x11730, + 0x1173b, 0x118e0, 0x118f2, 0x11c50, 0x11c6c, 0x12400, 0x1246e, 0x16a60, + 0x16a69, 0x16b50, 0x16b59, 0x16b5b, 0x16b61, 0x1d360, 0x1d371, 0x1d7ce, + 0x1d7ff, 0x1e8c7, 0x1e8cf, 0x1e950, 0x1e959, 0x1f100, 0x1f10c, +}; /* CR_N */ + +/* 'Nd': General Category */ +# define CR_Nd CR_Digit + +/* 'Nl': General Category */ +static const OnigCodePoint CR_Nl[] = { + 12, 0x16ee, 0x16f0, 0x2160, 0x2182, 0x2185, 0x2188, + 0x3007, 0x3007, 0x3021, 0x3029, 0x3038, 0x303a, 0xa6e6, + 0xa6ef, 0x10140, 0x10174, 0x10341, 0x10341, 0x1034a, 0x1034a, + 0x103d1, 0x103d5, 0x12400, 0x1246e, +}; /* CR_Nl */ + +/* 'No': General Category */ +static const OnigCodePoint CR_No[] = { + 60, 0x00b2, 0x00b3, 0x00b9, 0x00b9, 0x00bc, 0x00be, 0x09f4, + 0x09f9, 0x0b72, 0x0b77, 0x0bf0, 0x0bf2, 0x0c78, 0x0c7e, 0x0d58, + 0x0d5e, 0x0d70, 0x0d78, 0x0f2a, 0x0f33, 0x1369, 0x137c, 0x17f0, + 0x17f9, 0x19da, 0x19da, 0x2070, 0x2070, 0x2074, 0x2079, 0x2080, + 0x2089, 0x2150, 0x215f, 0x2189, 0x2189, 0x2460, 0x249b, 0x24ea, + 0x24ff, 0x2776, 0x2793, 0x2cfd, 0x2cfd, 0x3192, 0x3195, 0x3220, + 0x3229, 0x3248, 0x324f, 0x3251, 0x325f, 0x3280, 0x3289, 0x32b1, + 0x32bf, 0xa830, 0xa835, 0x10107, 0x10133, 0x10175, 0x10178, 0x1018a, + 0x1018b, 0x102e1, 0x102fb, 0x10320, 0x10323, 0x10858, 0x1085f, 0x10879, + 0x1087f, 0x108a7, 0x108af, 0x108fb, 0x108ff, 0x10916, 0x1091b, 0x109bc, + 0x109bd, 0x109c0, 0x109cf, 0x109d2, 0x109ff, 0x10a40, 0x10a47, 0x10a7d, + 0x10a7e, 0x10a9d, 0x10a9f, 0x10aeb, 0x10aef, 0x10b58, 0x10b5f, 0x10b78, + 0x10b7f, 0x10ba9, 0x10baf, 0x10cfa, 0x10cff, 0x10e60, 0x10e7e, 0x11052, + 0x11065, 0x111e1, 0x111f4, 0x1173a, 0x1173b, 0x118ea, 0x118f2, 0x11c5a, + 0x11c6c, 0x16b5b, 0x16b61, 0x1d360, 0x1d371, 0x1e8c7, 0x1e8cf, 0x1f100, + 0x1f10c, +}; /* CR_No */ + +/* 'P': Major Category */ +# define CR_P CR_Punct + +/* 'Pc': General Category */ +static const OnigCodePoint CR_Pc[] = { + 6, 0x005f, 0x005f, 0x203f, 0x2040, 0x2054, 0x2054, + 0xfe33, 0xfe34, 0xfe4d, 0xfe4f, 0xff3f, 0xff3f, +}; /* CR_Pc */ + +/* 'Pd': General Category */ +static const OnigCodePoint CR_Pd[] = { + 17, 0x002d, 0x002d, 0x058a, 0x058a, 0x05be, 0x05be, 0x1400, 0x1400, + 0x1806, 0x1806, 0x2010, 0x2015, 0x2e17, 0x2e17, 0x2e1a, 0x2e1a, 0x2e3a, + 0x2e3b, 0x2e40, 0x2e40, 0x301c, 0x301c, 0x3030, 0x3030, 0x30a0, 0x30a0, + 0xfe31, 0xfe32, 0xfe58, 0xfe58, 0xfe63, 0xfe63, 0xff0d, 0xff0d, +}; /* CR_Pd */ + +/* 'Pe': General Category */ +static const OnigCodePoint CR_Pe[] = { + 72, 0x0029, 0x0029, 0x005d, 0x005d, 0x007d, 0x007d, 0x0f3b, 0x0f3b, + 0x0f3d, 0x0f3d, 0x169c, 0x169c, 0x2046, 0x2046, 0x207e, 0x207e, 0x208e, + 0x208e, 0x2309, 0x2309, 0x230b, 0x230b, 0x232a, 0x232a, 0x2769, 0x2769, + 0x276b, 0x276b, 0x276d, 0x276d, 0x276f, 0x276f, 0x2771, 0x2771, 0x2773, + 0x2773, 0x2775, 0x2775, 0x27c6, 0x27c6, 0x27e7, 0x27e7, 0x27e9, 0x27e9, + 0x27eb, 0x27eb, 0x27ed, 0x27ed, 0x27ef, 0x27ef, 0x2984, 0x2984, 0x2986, + 0x2986, 0x2988, 0x2988, 0x298a, 0x298a, 0x298c, 0x298c, 0x298e, 0x298e, + 0x2990, 0x2990, 0x2992, 0x2992, 0x2994, 0x2994, 0x2996, 0x2996, 0x2998, + 0x2998, 0x29d9, 0x29d9, 0x29db, 0x29db, 0x29fd, 0x29fd, 0x2e23, 0x2e23, + 0x2e25, 0x2e25, 0x2e27, 0x2e27, 0x2e29, 0x2e29, 0x3009, 0x3009, 0x300b, + 0x300b, 0x300d, 0x300d, 0x300f, 0x300f, 0x3011, 0x3011, 0x3015, 0x3015, + 0x3017, 0x3017, 0x3019, 0x3019, 0x301b, 0x301b, 0x301e, 0x301f, 0xfd3e, + 0xfd3e, 0xfe18, 0xfe18, 0xfe36, 0xfe36, 0xfe38, 0xfe38, 0xfe3a, 0xfe3a, + 0xfe3c, 0xfe3c, 0xfe3e, 0xfe3e, 0xfe40, 0xfe40, 0xfe42, 0xfe42, 0xfe44, + 0xfe44, 0xfe48, 0xfe48, 0xfe5a, 0xfe5a, 0xfe5c, 0xfe5c, 0xfe5e, 0xfe5e, + 0xff09, 0xff09, 0xff3d, 0xff3d, 0xff5d, 0xff5d, 0xff60, 0xff60, 0xff63, + 0xff63, +}; /* CR_Pe */ + +/* 'Pf': General Category */ +static const OnigCodePoint CR_Pf[] = { + 10, 0x00bb, 0x00bb, 0x2019, 0x2019, 0x201d, 0x201d, + 0x203a, 0x203a, 0x2e03, 0x2e03, 0x2e05, 0x2e05, 0x2e0a, + 0x2e0a, 0x2e0d, 0x2e0d, 0x2e1d, 0x2e1d, 0x2e21, 0x2e21, +}; /* CR_Pf */ + +/* 'Pi': General Category */ +static const OnigCodePoint CR_Pi[] = { + 11, 0x00ab, 0x00ab, 0x2018, 0x2018, 0x201b, 0x201c, 0x201f, + 0x201f, 0x2039, 0x2039, 0x2e02, 0x2e02, 0x2e04, 0x2e04, 0x2e09, + 0x2e09, 0x2e0c, 0x2e0c, 0x2e1c, 0x2e1c, 0x2e20, 0x2e20, +}; /* CR_Pi */ + +/* 'Po': General Category */ +static const OnigCodePoint CR_Po[] = { + 165, 0x0021, 0x0023, 0x0025, 0x0027, 0x002a, 0x002a, 0x002c, + 0x002c, 0x002e, 0x002f, 0x003a, 0x003b, 0x003f, 0x0040, 0x005c, + 0x005c, 0x00a1, 0x00a1, 0x00a7, 0x00a7, 0x00b6, 0x00b7, 0x00bf, + 0x00bf, 0x037e, 0x037e, 0x0387, 0x0387, 0x055a, 0x055f, 0x0589, + 0x0589, 0x05c0, 0x05c0, 0x05c3, 0x05c3, 0x05c6, 0x05c6, 0x05f3, + 0x05f4, 0x0609, 0x060a, 0x060c, 0x060d, 0x061b, 0x061b, 0x061e, + 0x061f, 0x066a, 0x066d, 0x06d4, 0x06d4, 0x0700, 0x070d, 0x07f7, + 0x07f9, 0x0830, 0x083e, 0x085e, 0x085e, 0x0964, 0x0965, 0x0970, + 0x0970, 0x0af0, 0x0af0, 0x0df4, 0x0df4, 0x0e4f, 0x0e4f, 0x0e5a, + 0x0e5b, 0x0f04, 0x0f12, 0x0f14, 0x0f14, 0x0f85, 0x0f85, 0x0fd0, + 0x0fd4, 0x0fd9, 0x0fda, 0x104a, 0x104f, 0x10fb, 0x10fb, 0x1360, + 0x1368, 0x166d, 0x166e, 0x16eb, 0x16ed, 0x1735, 0x1736, 0x17d4, + 0x17d6, 0x17d8, 0x17da, 0x1800, 0x1805, 0x1807, 0x180a, 0x1944, + 0x1945, 0x1a1e, 0x1a1f, 0x1aa0, 0x1aa6, 0x1aa8, 0x1aad, 0x1b5a, + 0x1b60, 0x1bfc, 0x1bff, 0x1c3b, 0x1c3f, 0x1c7e, 0x1c7f, 0x1cc0, + 0x1cc7, 0x1cd3, 0x1cd3, 0x2016, 0x2017, 0x2020, 0x2027, 0x2030, + 0x2038, 0x203b, 0x203e, 0x2041, 0x2043, 0x2047, 0x2051, 0x2053, + 0x2053, 0x2055, 0x205e, 0x2cf9, 0x2cfc, 0x2cfe, 0x2cff, 0x2d70, + 0x2d70, 0x2e00, 0x2e01, 0x2e06, 0x2e08, 0x2e0b, 0x2e0b, 0x2e0e, + 0x2e16, 0x2e18, 0x2e19, 0x2e1b, 0x2e1b, 0x2e1e, 0x2e1f, 0x2e2a, + 0x2e2e, 0x2e30, 0x2e39, 0x2e3c, 0x2e3f, 0x2e41, 0x2e41, 0x2e43, + 0x2e44, 0x3001, 0x3003, 0x303d, 0x303d, 0x30fb, 0x30fb, 0xa4fe, + 0xa4ff, 0xa60d, 0xa60f, 0xa673, 0xa673, 0xa67e, 0xa67e, 0xa6f2, + 0xa6f7, 0xa874, 0xa877, 0xa8ce, 0xa8cf, 0xa8f8, 0xa8fa, 0xa8fc, + 0xa8fc, 0xa92e, 0xa92f, 0xa95f, 0xa95f, 0xa9c1, 0xa9cd, 0xa9de, + 0xa9df, 0xaa5c, 0xaa5f, 0xaade, 0xaadf, 0xaaf0, 0xaaf1, 0xabeb, + 0xabeb, 0xfe10, 0xfe16, 0xfe19, 0xfe19, 0xfe30, 0xfe30, 0xfe45, + 0xfe46, 0xfe49, 0xfe4c, 0xfe50, 0xfe52, 0xfe54, 0xfe57, 0xfe5f, + 0xfe61, 0xfe68, 0xfe68, 0xfe6a, 0xfe6b, 0xff01, 0xff03, 0xff05, + 0xff07, 0xff0a, 0xff0a, 0xff0c, 0xff0c, 0xff0e, 0xff0f, 0xff1a, + 0xff1b, 0xff1f, 0xff20, 0xff3c, 0xff3c, 0xff61, 0xff61, 0xff64, + 0xff65, 0x10100, 0x10102, 0x1039f, 0x1039f, 0x103d0, 0x103d0, 0x1056f, + 0x1056f, 0x10857, 0x10857, 0x1091f, 0x1091f, 0x1093f, 0x1093f, 0x10a50, + 0x10a58, 0x10a7f, 0x10a7f, 0x10af0, 0x10af6, 0x10b39, 0x10b3f, 0x10b99, + 0x10b9c, 0x11047, 0x1104d, 0x110bb, 0x110bc, 0x110be, 0x110c1, 0x11140, + 0x11143, 0x11174, 0x11175, 0x111c5, 0x111c9, 0x111cd, 0x111cd, 0x111db, + 0x111db, 0x111dd, 0x111df, 0x11238, 0x1123d, 0x112a9, 0x112a9, 0x1144b, + 0x1144f, 0x1145b, 0x1145b, 0x1145d, 0x1145d, 0x114c6, 0x114c6, 0x115c1, + 0x115d7, 0x11641, 0x11643, 0x11660, 0x1166c, 0x1173c, 0x1173e, 0x11c41, + 0x11c45, 0x11c70, 0x11c71, 0x12470, 0x12474, 0x16a6e, 0x16a6f, 0x16af5, + 0x16af5, 0x16b37, 0x16b3b, 0x16b44, 0x16b44, 0x1bc9f, 0x1bc9f, 0x1da87, + 0x1da8b, 0x1e95e, 0x1e95f, +}; /* CR_Po */ + +/* 'Ps': General Category */ +static const OnigCodePoint CR_Ps[] = { + 75, 0x0028, 0x0028, 0x005b, 0x005b, 0x007b, 0x007b, 0x0f3a, 0x0f3a, + 0x0f3c, 0x0f3c, 0x169b, 0x169b, 0x201a, 0x201a, 0x201e, 0x201e, 0x2045, + 0x2045, 0x207d, 0x207d, 0x208d, 0x208d, 0x2308, 0x2308, 0x230a, 0x230a, + 0x2329, 0x2329, 0x2768, 0x2768, 0x276a, 0x276a, 0x276c, 0x276c, 0x276e, + 0x276e, 0x2770, 0x2770, 0x2772, 0x2772, 0x2774, 0x2774, 0x27c5, 0x27c5, + 0x27e6, 0x27e6, 0x27e8, 0x27e8, 0x27ea, 0x27ea, 0x27ec, 0x27ec, 0x27ee, + 0x27ee, 0x2983, 0x2983, 0x2985, 0x2985, 0x2987, 0x2987, 0x2989, 0x2989, + 0x298b, 0x298b, 0x298d, 0x298d, 0x298f, 0x298f, 0x2991, 0x2991, 0x2993, + 0x2993, 0x2995, 0x2995, 0x2997, 0x2997, 0x29d8, 0x29d8, 0x29da, 0x29da, + 0x29fc, 0x29fc, 0x2e22, 0x2e22, 0x2e24, 0x2e24, 0x2e26, 0x2e26, 0x2e28, + 0x2e28, 0x2e42, 0x2e42, 0x3008, 0x3008, 0x300a, 0x300a, 0x300c, 0x300c, + 0x300e, 0x300e, 0x3010, 0x3010, 0x3014, 0x3014, 0x3016, 0x3016, 0x3018, + 0x3018, 0x301a, 0x301a, 0x301d, 0x301d, 0xfd3f, 0xfd3f, 0xfe17, 0xfe17, + 0xfe35, 0xfe35, 0xfe37, 0xfe37, 0xfe39, 0xfe39, 0xfe3b, 0xfe3b, 0xfe3d, + 0xfe3d, 0xfe3f, 0xfe3f, 0xfe41, 0xfe41, 0xfe43, 0xfe43, 0xfe47, 0xfe47, + 0xfe59, 0xfe59, 0xfe5b, 0xfe5b, 0xfe5d, 0xfe5d, 0xff08, 0xff08, 0xff3b, + 0xff3b, 0xff5b, 0xff5b, 0xff5f, 0xff5f, 0xff62, 0xff62, +}; /* CR_Ps */ + +/* 'S': Major Category */ +static const OnigCodePoint CR_S[] = { + 218, 0x0024, 0x0024, 0x002b, 0x002b, 0x003c, 0x003e, 0x005e, + 0x005e, 0x0060, 0x0060, 0x007c, 0x007c, 0x007e, 0x007e, 0x00a2, + 0x00a6, 0x00a8, 0x00a9, 0x00ac, 0x00ac, 0x00ae, 0x00b1, 0x00b4, + 0x00b4, 0x00b8, 0x00b8, 0x00d7, 0x00d7, 0x00f7, 0x00f7, 0x02c2, + 0x02c5, 0x02d2, 0x02df, 0x02e5, 0x02eb, 0x02ed, 0x02ed, 0x02ef, + 0x02ff, 0x0375, 0x0375, 0x0384, 0x0385, 0x03f6, 0x03f6, 0x0482, + 0x0482, 0x058d, 0x058f, 0x0606, 0x0608, 0x060b, 0x060b, 0x060e, + 0x060f, 0x06de, 0x06de, 0x06e9, 0x06e9, 0x06fd, 0x06fe, 0x07f6, + 0x07f6, 0x09f2, 0x09f3, 0x09fa, 0x09fb, 0x0af1, 0x0af1, 0x0b70, + 0x0b70, 0x0bf3, 0x0bfa, 0x0c7f, 0x0c7f, 0x0d4f, 0x0d4f, 0x0d79, + 0x0d79, 0x0e3f, 0x0e3f, 0x0f01, 0x0f03, 0x0f13, 0x0f13, 0x0f15, + 0x0f17, 0x0f1a, 0x0f1f, 0x0f34, 0x0f34, 0x0f36, 0x0f36, 0x0f38, + 0x0f38, 0x0fbe, 0x0fc5, 0x0fc7, 0x0fcc, 0x0fce, 0x0fcf, 0x0fd5, + 0x0fd8, 0x109e, 0x109f, 0x1390, 0x1399, 0x17db, 0x17db, 0x1940, + 0x1940, 0x19de, 0x19ff, 0x1b61, 0x1b6a, 0x1b74, 0x1b7c, 0x1fbd, + 0x1fbd, 0x1fbf, 0x1fc1, 0x1fcd, 0x1fcf, 0x1fdd, 0x1fdf, 0x1fed, + 0x1fef, 0x1ffd, 0x1ffe, 0x2044, 0x2044, 0x2052, 0x2052, 0x207a, + 0x207c, 0x208a, 0x208c, 0x20a0, 0x20be, 0x2100, 0x2101, 0x2103, + 0x2106, 0x2108, 0x2109, 0x2114, 0x2114, 0x2116, 0x2118, 0x211e, + 0x2123, 0x2125, 0x2125, 0x2127, 0x2127, 0x2129, 0x2129, 0x212e, + 0x212e, 0x213a, 0x213b, 0x2140, 0x2144, 0x214a, 0x214d, 0x214f, + 0x214f, 0x218a, 0x218b, 0x2190, 0x2307, 0x230c, 0x2328, 0x232b, + 0x23fe, 0x2400, 0x2426, 0x2440, 0x244a, 0x249c, 0x24e9, 0x2500, + 0x2767, 0x2794, 0x27c4, 0x27c7, 0x27e5, 0x27f0, 0x2982, 0x2999, + 0x29d7, 0x29dc, 0x29fb, 0x29fe, 0x2b73, 0x2b76, 0x2b95, 0x2b98, + 0x2bb9, 0x2bbd, 0x2bc8, 0x2bca, 0x2bd1, 0x2bec, 0x2bef, 0x2ce5, + 0x2cea, 0x2e80, 0x2e99, 0x2e9b, 0x2ef3, 0x2f00, 0x2fd5, 0x2ff0, + 0x2ffb, 0x3004, 0x3004, 0x3012, 0x3013, 0x3020, 0x3020, 0x3036, + 0x3037, 0x303e, 0x303f, 0x309b, 0x309c, 0x3190, 0x3191, 0x3196, + 0x319f, 0x31c0, 0x31e3, 0x3200, 0x321e, 0x322a, 0x3247, 0x3250, + 0x3250, 0x3260, 0x327f, 0x328a, 0x32b0, 0x32c0, 0x32fe, 0x3300, + 0x33ff, 0x4dc0, 0x4dff, 0xa490, 0xa4c6, 0xa700, 0xa716, 0xa720, + 0xa721, 0xa789, 0xa78a, 0xa828, 0xa82b, 0xa836, 0xa839, 0xaa77, + 0xaa79, 0xab5b, 0xab5b, 0xfb29, 0xfb29, 0xfbb2, 0xfbc1, 0xfdfc, + 0xfdfd, 0xfe62, 0xfe62, 0xfe64, 0xfe66, 0xfe69, 0xfe69, 0xff04, + 0xff04, 0xff0b, 0xff0b, 0xff1c, 0xff1e, 0xff3e, 0xff3e, 0xff40, + 0xff40, 0xff5c, 0xff5c, 0xff5e, 0xff5e, 0xffe0, 0xffe6, 0xffe8, + 0xffee, 0xfffc, 0xfffd, 0x10137, 0x1013f, 0x10179, 0x10189, 0x1018c, + 0x1018e, 0x10190, 0x1019b, 0x101a0, 0x101a0, 0x101d0, 0x101fc, 0x10877, + 0x10878, 0x10ac8, 0x10ac8, 0x1173f, 0x1173f, 0x16b3c, 0x16b3f, 0x16b45, + 0x16b45, 0x1bc9c, 0x1bc9c, 0x1d000, 0x1d0f5, 0x1d100, 0x1d126, 0x1d129, + 0x1d164, 0x1d16a, 0x1d16c, 0x1d183, 0x1d184, 0x1d18c, 0x1d1a9, 0x1d1ae, + 0x1d1e8, 0x1d200, 0x1d241, 0x1d245, 0x1d245, 0x1d300, 0x1d356, 0x1d6c1, + 0x1d6c1, 0x1d6db, 0x1d6db, 0x1d6fb, 0x1d6fb, 0x1d715, 0x1d715, 0x1d735, + 0x1d735, 0x1d74f, 0x1d74f, 0x1d76f, 0x1d76f, 0x1d789, 0x1d789, 0x1d7a9, + 0x1d7a9, 0x1d7c3, 0x1d7c3, 0x1d800, 0x1d9ff, 0x1da37, 0x1da3a, 0x1da6d, + 0x1da74, 0x1da76, 0x1da83, 0x1da85, 0x1da86, 0x1eef0, 0x1eef1, 0x1f000, + 0x1f02b, 0x1f030, 0x1f093, 0x1f0a0, 0x1f0ae, 0x1f0b1, 0x1f0bf, 0x1f0c1, + 0x1f0cf, 0x1f0d1, 0x1f0f5, 0x1f110, 0x1f12e, 0x1f130, 0x1f16b, 0x1f170, + 0x1f1ac, 0x1f1e6, 0x1f202, 0x1f210, 0x1f23b, 0x1f240, 0x1f248, 0x1f250, + 0x1f251, 0x1f300, 0x1f6d2, 0x1f6e0, 0x1f6ec, 0x1f6f0, 0x1f6f6, 0x1f700, + 0x1f773, 0x1f780, 0x1f7d4, 0x1f800, 0x1f80b, 0x1f810, 0x1f847, 0x1f850, + 0x1f859, 0x1f860, 0x1f887, 0x1f890, 0x1f8ad, 0x1f910, 0x1f91e, 0x1f920, + 0x1f927, 0x1f930, 0x1f930, 0x1f933, 0x1f93e, 0x1f940, 0x1f94b, 0x1f950, + 0x1f95e, 0x1f980, 0x1f991, 0x1f9c0, 0x1f9c0, +}; /* CR_S */ + +/* 'Sc': General Category */ +static const OnigCodePoint CR_Sc[] = { + 17, 0x0024, 0x0024, 0x00a2, 0x00a5, 0x058f, 0x058f, 0x060b, 0x060b, + 0x09f2, 0x09f3, 0x09fb, 0x09fb, 0x0af1, 0x0af1, 0x0bf9, 0x0bf9, 0x0e3f, + 0x0e3f, 0x17db, 0x17db, 0x20a0, 0x20be, 0xa838, 0xa838, 0xfdfc, 0xfdfc, + 0xfe69, 0xfe69, 0xff04, 0xff04, 0xffe0, 0xffe1, 0xffe5, 0xffe6, +}; /* CR_Sc */ + +/* 'Sk': General Category */ +static const OnigCodePoint CR_Sk[] = { + 29, 0x005e, 0x005e, 0x0060, 0x0060, 0x00a8, 0x00a8, 0x00af, 0x00af, + 0x00b4, 0x00b4, 0x00b8, 0x00b8, 0x02c2, 0x02c5, 0x02d2, 0x02df, 0x02e5, + 0x02eb, 0x02ed, 0x02ed, 0x02ef, 0x02ff, 0x0375, 0x0375, 0x0384, 0x0385, + 0x1fbd, 0x1fbd, 0x1fbf, 0x1fc1, 0x1fcd, 0x1fcf, 0x1fdd, 0x1fdf, 0x1fed, + 0x1fef, 0x1ffd, 0x1ffe, 0x309b, 0x309c, 0xa700, 0xa716, 0xa720, 0xa721, + 0xa789, 0xa78a, 0xab5b, 0xab5b, 0xfbb2, 0xfbc1, 0xff3e, 0xff3e, 0xff40, + 0xff40, 0xffe3, 0xffe3, 0x1f3fb, 0x1f3ff, +}; /* CR_Sk */ + +/* 'Sm': General Category */ +static const OnigCodePoint CR_Sm[] = { + 64, 0x002b, 0x002b, 0x003c, 0x003e, 0x007c, 0x007c, 0x007e, + 0x007e, 0x00ac, 0x00ac, 0x00b1, 0x00b1, 0x00d7, 0x00d7, 0x00f7, + 0x00f7, 0x03f6, 0x03f6, 0x0606, 0x0608, 0x2044, 0x2044, 0x2052, + 0x2052, 0x207a, 0x207c, 0x208a, 0x208c, 0x2118, 0x2118, 0x2140, + 0x2144, 0x214b, 0x214b, 0x2190, 0x2194, 0x219a, 0x219b, 0x21a0, + 0x21a0, 0x21a3, 0x21a3, 0x21a6, 0x21a6, 0x21ae, 0x21ae, 0x21ce, + 0x21cf, 0x21d2, 0x21d2, 0x21d4, 0x21d4, 0x21f4, 0x22ff, 0x2320, + 0x2321, 0x237c, 0x237c, 0x239b, 0x23b3, 0x23dc, 0x23e1, 0x25b7, + 0x25b7, 0x25c1, 0x25c1, 0x25f8, 0x25ff, 0x266f, 0x266f, 0x27c0, + 0x27c4, 0x27c7, 0x27e5, 0x27f0, 0x27ff, 0x2900, 0x2982, 0x2999, + 0x29d7, 0x29dc, 0x29fb, 0x29fe, 0x2aff, 0x2b30, 0x2b44, 0x2b47, + 0x2b4c, 0xfb29, 0xfb29, 0xfe62, 0xfe62, 0xfe64, 0xfe66, 0xff0b, + 0xff0b, 0xff1c, 0xff1e, 0xff5c, 0xff5c, 0xff5e, 0xff5e, 0xffe2, + 0xffe2, 0xffe9, 0xffec, 0x1d6c1, 0x1d6c1, 0x1d6db, 0x1d6db, 0x1d6fb, + 0x1d6fb, 0x1d715, 0x1d715, 0x1d735, 0x1d735, 0x1d74f, 0x1d74f, 0x1d76f, + 0x1d76f, 0x1d789, 0x1d789, 0x1d7a9, 0x1d7a9, 0x1d7c3, 0x1d7c3, 0x1eef0, + 0x1eef1, +}; /* CR_Sm */ + +/* 'So': General Category */ +static const OnigCodePoint CR_So[] = { + 174, 0x00a6, 0x00a6, 0x00a9, 0x00a9, 0x00ae, 0x00ae, 0x00b0, + 0x00b0, 0x0482, 0x0482, 0x058d, 0x058e, 0x060e, 0x060f, 0x06de, + 0x06de, 0x06e9, 0x06e9, 0x06fd, 0x06fe, 0x07f6, 0x07f6, 0x09fa, + 0x09fa, 0x0b70, 0x0b70, 0x0bf3, 0x0bf8, 0x0bfa, 0x0bfa, 0x0c7f, + 0x0c7f, 0x0d4f, 0x0d4f, 0x0d79, 0x0d79, 0x0f01, 0x0f03, 0x0f13, + 0x0f13, 0x0f15, 0x0f17, 0x0f1a, 0x0f1f, 0x0f34, 0x0f34, 0x0f36, + 0x0f36, 0x0f38, 0x0f38, 0x0fbe, 0x0fc5, 0x0fc7, 0x0fcc, 0x0fce, + 0x0fcf, 0x0fd5, 0x0fd8, 0x109e, 0x109f, 0x1390, 0x1399, 0x1940, + 0x1940, 0x19de, 0x19ff, 0x1b61, 0x1b6a, 0x1b74, 0x1b7c, 0x2100, + 0x2101, 0x2103, 0x2106, 0x2108, 0x2109, 0x2114, 0x2114, 0x2116, + 0x2117, 0x211e, 0x2123, 0x2125, 0x2125, 0x2127, 0x2127, 0x2129, + 0x2129, 0x212e, 0x212e, 0x213a, 0x213b, 0x214a, 0x214a, 0x214c, + 0x214d, 0x214f, 0x214f, 0x218a, 0x218b, 0x2195, 0x2199, 0x219c, + 0x219f, 0x21a1, 0x21a2, 0x21a4, 0x21a5, 0x21a7, 0x21ad, 0x21af, + 0x21cd, 0x21d0, 0x21d1, 0x21d3, 0x21d3, 0x21d5, 0x21f3, 0x2300, + 0x2307, 0x230c, 0x231f, 0x2322, 0x2328, 0x232b, 0x237b, 0x237d, + 0x239a, 0x23b4, 0x23db, 0x23e2, 0x23fe, 0x2400, 0x2426, 0x2440, + 0x244a, 0x249c, 0x24e9, 0x2500, 0x25b6, 0x25b8, 0x25c0, 0x25c2, + 0x25f7, 0x2600, 0x266e, 0x2670, 0x2767, 0x2794, 0x27bf, 0x2800, + 0x28ff, 0x2b00, 0x2b2f, 0x2b45, 0x2b46, 0x2b4d, 0x2b73, 0x2b76, + 0x2b95, 0x2b98, 0x2bb9, 0x2bbd, 0x2bc8, 0x2bca, 0x2bd1, 0x2bec, + 0x2bef, 0x2ce5, 0x2cea, 0x2e80, 0x2e99, 0x2e9b, 0x2ef3, 0x2f00, + 0x2fd5, 0x2ff0, 0x2ffb, 0x3004, 0x3004, 0x3012, 0x3013, 0x3020, + 0x3020, 0x3036, 0x3037, 0x303e, 0x303f, 0x3190, 0x3191, 0x3196, + 0x319f, 0x31c0, 0x31e3, 0x3200, 0x321e, 0x322a, 0x3247, 0x3250, + 0x3250, 0x3260, 0x327f, 0x328a, 0x32b0, 0x32c0, 0x32fe, 0x3300, + 0x33ff, 0x4dc0, 0x4dff, 0xa490, 0xa4c6, 0xa828, 0xa82b, 0xa836, + 0xa837, 0xa839, 0xa839, 0xaa77, 0xaa79, 0xfdfd, 0xfdfd, 0xffe4, + 0xffe4, 0xffe8, 0xffe8, 0xffed, 0xffee, 0xfffc, 0xfffd, 0x10137, + 0x1013f, 0x10179, 0x10189, 0x1018c, 0x1018e, 0x10190, 0x1019b, 0x101a0, + 0x101a0, 0x101d0, 0x101fc, 0x10877, 0x10878, 0x10ac8, 0x10ac8, 0x1173f, + 0x1173f, 0x16b3c, 0x16b3f, 0x16b45, 0x16b45, 0x1bc9c, 0x1bc9c, 0x1d000, + 0x1d0f5, 0x1d100, 0x1d126, 0x1d129, 0x1d164, 0x1d16a, 0x1d16c, 0x1d183, + 0x1d184, 0x1d18c, 0x1d1a9, 0x1d1ae, 0x1d1e8, 0x1d200, 0x1d241, 0x1d245, + 0x1d245, 0x1d300, 0x1d356, 0x1d800, 0x1d9ff, 0x1da37, 0x1da3a, 0x1da6d, + 0x1da74, 0x1da76, 0x1da83, 0x1da85, 0x1da86, 0x1f000, 0x1f02b, 0x1f030, + 0x1f093, 0x1f0a0, 0x1f0ae, 0x1f0b1, 0x1f0bf, 0x1f0c1, 0x1f0cf, 0x1f0d1, + 0x1f0f5, 0x1f110, 0x1f12e, 0x1f130, 0x1f16b, 0x1f170, 0x1f1ac, 0x1f1e6, + 0x1f202, 0x1f210, 0x1f23b, 0x1f240, 0x1f248, 0x1f250, 0x1f251, 0x1f300, + 0x1f3fa, 0x1f400, 0x1f6d2, 0x1f6e0, 0x1f6ec, 0x1f6f0, 0x1f6f6, 0x1f700, + 0x1f773, 0x1f780, 0x1f7d4, 0x1f800, 0x1f80b, 0x1f810, 0x1f847, 0x1f850, + 0x1f859, 0x1f860, 0x1f887, 0x1f890, 0x1f8ad, 0x1f910, 0x1f91e, 0x1f920, + 0x1f927, 0x1f930, 0x1f930, 0x1f933, 0x1f93e, 0x1f940, 0x1f94b, 0x1f950, + 0x1f95e, 0x1f980, 0x1f991, 0x1f9c0, 0x1f9c0, +}; /* CR_So */ + +/* 'Z': Major Category */ +static const OnigCodePoint CR_Z[] = { + 8, 0x0020, 0x0020, 0x00a0, 0x00a0, 0x1680, 0x1680, 0x2000, 0x200a, + 0x2028, 0x2029, 0x202f, 0x202f, 0x205f, 0x205f, 0x3000, 0x3000, +}; /* CR_Z */ + +/* 'Zl': General Category */ +static const OnigCodePoint CR_Zl[] = { + 1, + 0x2028, + 0x2028, +}; /* CR_Zl */ + +/* 'Zp': General Category */ +static const OnigCodePoint CR_Zp[] = { + 1, + 0x2029, + 0x2029, +}; /* CR_Zp */ + +/* 'Zs': General Category */ +static const OnigCodePoint CR_Zs[] = { + 7, 0x0020, 0x0020, 0x00a0, 0x00a0, 0x1680, 0x1680, 0x2000, + 0x200a, 0x202f, 0x202f, 0x205f, 0x205f, 0x3000, 0x3000, +}; /* CR_Zs */ + +/* 'Math': Derived Property */ +static const OnigCodePoint CR_Math[] = { + 138, 0x002b, 0x002b, 0x003c, 0x003e, 0x005e, 0x005e, 0x007c, + 0x007c, 0x007e, 0x007e, 0x00ac, 0x00ac, 0x00b1, 0x00b1, 0x00d7, + 0x00d7, 0x00f7, 0x00f7, 0x03d0, 0x03d2, 0x03d5, 0x03d5, 0x03f0, + 0x03f1, 0x03f4, 0x03f6, 0x0606, 0x0608, 0x2016, 0x2016, 0x2032, + 0x2034, 0x2040, 0x2040, 0x2044, 0x2044, 0x2052, 0x2052, 0x2061, + 0x2064, 0x207a, 0x207e, 0x208a, 0x208e, 0x20d0, 0x20dc, 0x20e1, + 0x20e1, 0x20e5, 0x20e6, 0x20eb, 0x20ef, 0x2102, 0x2102, 0x2107, + 0x2107, 0x210a, 0x2113, 0x2115, 0x2115, 0x2118, 0x211d, 0x2124, + 0x2124, 0x2128, 0x2129, 0x212c, 0x212d, 0x212f, 0x2131, 0x2133, + 0x2138, 0x213c, 0x2149, 0x214b, 0x214b, 0x2190, 0x21a7, 0x21a9, + 0x21ae, 0x21b0, 0x21b1, 0x21b6, 0x21b7, 0x21bc, 0x21db, 0x21dd, + 0x21dd, 0x21e4, 0x21e5, 0x21f4, 0x22ff, 0x2308, 0x230b, 0x2320, + 0x2321, 0x237c, 0x237c, 0x239b, 0x23b5, 0x23b7, 0x23b7, 0x23d0, + 0x23d0, 0x23dc, 0x23e2, 0x25a0, 0x25a1, 0x25ae, 0x25b7, 0x25bc, + 0x25c1, 0x25c6, 0x25c7, 0x25ca, 0x25cb, 0x25cf, 0x25d3, 0x25e2, + 0x25e2, 0x25e4, 0x25e4, 0x25e7, 0x25ec, 0x25f8, 0x25ff, 0x2605, + 0x2606, 0x2640, 0x2640, 0x2642, 0x2642, 0x2660, 0x2663, 0x266d, + 0x266f, 0x27c0, 0x27ff, 0x2900, 0x2aff, 0x2b30, 0x2b44, 0x2b47, + 0x2b4c, 0xfb29, 0xfb29, 0xfe61, 0xfe66, 0xfe68, 0xfe68, 0xff0b, + 0xff0b, 0xff1c, 0xff1e, 0xff3c, 0xff3c, 0xff3e, 0xff3e, 0xff5c, + 0xff5c, 0xff5e, 0xff5e, 0xffe2, 0xffe2, 0xffe9, 0xffec, 0x1d400, + 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, + 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, + 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, + 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, 0x1d544, 0x1d546, + 0x1d546, 0x1d54a, 0x1d550, 0x1d552, 0x1d6a5, 0x1d6a8, 0x1d7cb, 0x1d7ce, + 0x1d7ff, 0x1ee00, 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, 0x1ee22, 0x1ee24, + 0x1ee24, 0x1ee27, 0x1ee27, 0x1ee29, 0x1ee32, 0x1ee34, 0x1ee37, 0x1ee39, + 0x1ee39, 0x1ee3b, 0x1ee3b, 0x1ee42, 0x1ee42, 0x1ee47, 0x1ee47, 0x1ee49, + 0x1ee49, 0x1ee4b, 0x1ee4b, 0x1ee4d, 0x1ee4f, 0x1ee51, 0x1ee52, 0x1ee54, + 0x1ee54, 0x1ee57, 0x1ee57, 0x1ee59, 0x1ee59, 0x1ee5b, 0x1ee5b, 0x1ee5d, + 0x1ee5d, 0x1ee5f, 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, 0x1ee64, 0x1ee67, + 0x1ee6a, 0x1ee6c, 0x1ee72, 0x1ee74, 0x1ee77, 0x1ee79, 0x1ee7c, 0x1ee7e, + 0x1ee7e, 0x1ee80, 0x1ee89, 0x1ee8b, 0x1ee9b, 0x1eea1, 0x1eea3, 0x1eea5, + 0x1eea9, 0x1eeab, 0x1eebb, 0x1eef0, 0x1eef1, +}; /* CR_Math */ + +/* 'Alphabetic': Derived Property */ +# define CR_Alphabetic CR_Alpha + +/* 'Lowercase': Derived Property */ +# define CR_Lowercase CR_Lower + +/* 'Uppercase': Derived Property */ +# define CR_Uppercase CR_Upper + +/* 'Cased': Derived Property */ +static const OnigCodePoint CR_Cased[] = { + 135, 0x0041, 0x005a, 0x0061, 0x007a, 0x00aa, 0x00aa, 0x00b5, + 0x00b5, 0x00ba, 0x00ba, 0x00c0, 0x00d6, 0x00d8, 0x00f6, 0x00f8, + 0x01ba, 0x01bc, 0x01bf, 0x01c4, 0x0293, 0x0295, 0x02b8, 0x02c0, + 0x02c1, 0x02e0, 0x02e4, 0x0345, 0x0345, 0x0370, 0x0373, 0x0376, + 0x0377, 0x037a, 0x037d, 0x037f, 0x037f, 0x0386, 0x0386, 0x0388, + 0x038a, 0x038c, 0x038c, 0x038e, 0x03a1, 0x03a3, 0x03f5, 0x03f7, + 0x0481, 0x048a, 0x052f, 0x0531, 0x0556, 0x0561, 0x0587, 0x10a0, + 0x10c5, 0x10c7, 0x10c7, 0x10cd, 0x10cd, 0x13a0, 0x13f5, 0x13f8, + 0x13fd, 0x1c80, 0x1c88, 0x1d00, 0x1dbf, 0x1e00, 0x1f15, 0x1f18, + 0x1f1d, 0x1f20, 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, + 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, + 0x1fb4, 0x1fb6, 0x1fbc, 0x1fbe, 0x1fbe, 0x1fc2, 0x1fc4, 0x1fc6, + 0x1fcc, 0x1fd0, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fe0, 0x1fec, 0x1ff2, + 0x1ff4, 0x1ff6, 0x1ffc, 0x2071, 0x2071, 0x207f, 0x207f, 0x2090, + 0x209c, 0x2102, 0x2102, 0x2107, 0x2107, 0x210a, 0x2113, 0x2115, + 0x2115, 0x2119, 0x211d, 0x2124, 0x2124, 0x2126, 0x2126, 0x2128, + 0x2128, 0x212a, 0x212d, 0x212f, 0x2134, 0x2139, 0x2139, 0x213c, + 0x213f, 0x2145, 0x2149, 0x214e, 0x214e, 0x2160, 0x217f, 0x2183, + 0x2184, 0x24b6, 0x24e9, 0x2c00, 0x2c2e, 0x2c30, 0x2c5e, 0x2c60, + 0x2ce4, 0x2ceb, 0x2cee, 0x2cf2, 0x2cf3, 0x2d00, 0x2d25, 0x2d27, + 0x2d27, 0x2d2d, 0x2d2d, 0xa640, 0xa66d, 0xa680, 0xa69d, 0xa722, + 0xa787, 0xa78b, 0xa78e, 0xa790, 0xa7ae, 0xa7b0, 0xa7b7, 0xa7f8, + 0xa7fa, 0xab30, 0xab5a, 0xab5c, 0xab65, 0xab70, 0xabbf, 0xfb00, + 0xfb06, 0xfb13, 0xfb17, 0xff21, 0xff3a, 0xff41, 0xff5a, 0x10400, + 0x1044f, 0x104b0, 0x104d3, 0x104d8, 0x104fb, 0x10c80, 0x10cb2, 0x10cc0, + 0x10cf2, 0x118a0, 0x118df, 0x1d400, 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, + 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, + 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, + 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, + 0x1d53e, 0x1d540, 0x1d544, 0x1d546, 0x1d546, 0x1d54a, 0x1d550, 0x1d552, + 0x1d6a5, 0x1d6a8, 0x1d6c0, 0x1d6c2, 0x1d6da, 0x1d6dc, 0x1d6fa, 0x1d6fc, + 0x1d714, 0x1d716, 0x1d734, 0x1d736, 0x1d74e, 0x1d750, 0x1d76e, 0x1d770, + 0x1d788, 0x1d78a, 0x1d7a8, 0x1d7aa, 0x1d7c2, 0x1d7c4, 0x1d7cb, 0x1e900, + 0x1e943, 0x1f130, 0x1f149, 0x1f150, 0x1f169, 0x1f170, 0x1f189, +}; /* CR_Cased */ + +/* 'Case_Ignorable': Derived Property */ +static const OnigCodePoint CR_Case_Ignorable[] = { + 365, 0x0027, 0x0027, 0x002e, 0x002e, 0x003a, 0x003a, 0x005e, + 0x005e, 0x0060, 0x0060, 0x00a8, 0x00a8, 0x00ad, 0x00ad, 0x00af, + 0x00af, 0x00b4, 0x00b4, 0x00b7, 0x00b8, 0x02b0, 0x036f, 0x0374, + 0x0375, 0x037a, 0x037a, 0x0384, 0x0385, 0x0387, 0x0387, 0x0483, + 0x0489, 0x0559, 0x0559, 0x0591, 0x05bd, 0x05bf, 0x05bf, 0x05c1, + 0x05c2, 0x05c4, 0x05c5, 0x05c7, 0x05c7, 0x05f4, 0x05f4, 0x0600, + 0x0605, 0x0610, 0x061a, 0x061c, 0x061c, 0x0640, 0x0640, 0x064b, + 0x065f, 0x0670, 0x0670, 0x06d6, 0x06dd, 0x06df, 0x06e8, 0x06ea, + 0x06ed, 0x070f, 0x070f, 0x0711, 0x0711, 0x0730, 0x074a, 0x07a6, + 0x07b0, 0x07eb, 0x07f5, 0x07fa, 0x07fa, 0x0816, 0x082d, 0x0859, + 0x085b, 0x08d4, 0x0902, 0x093a, 0x093a, 0x093c, 0x093c, 0x0941, + 0x0948, 0x094d, 0x094d, 0x0951, 0x0957, 0x0962, 0x0963, 0x0971, + 0x0971, 0x0981, 0x0981, 0x09bc, 0x09bc, 0x09c1, 0x09c4, 0x09cd, + 0x09cd, 0x09e2, 0x09e3, 0x0a01, 0x0a02, 0x0a3c, 0x0a3c, 0x0a41, + 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4d, 0x0a51, 0x0a51, 0x0a70, + 0x0a71, 0x0a75, 0x0a75, 0x0a81, 0x0a82, 0x0abc, 0x0abc, 0x0ac1, + 0x0ac5, 0x0ac7, 0x0ac8, 0x0acd, 0x0acd, 0x0ae2, 0x0ae3, 0x0b01, + 0x0b01, 0x0b3c, 0x0b3c, 0x0b3f, 0x0b3f, 0x0b41, 0x0b44, 0x0b4d, + 0x0b4d, 0x0b56, 0x0b56, 0x0b62, 0x0b63, 0x0b82, 0x0b82, 0x0bc0, + 0x0bc0, 0x0bcd, 0x0bcd, 0x0c00, 0x0c00, 0x0c3e, 0x0c40, 0x0c46, + 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, 0x0c56, 0x0c62, 0x0c63, 0x0c81, + 0x0c81, 0x0cbc, 0x0cbc, 0x0cbf, 0x0cbf, 0x0cc6, 0x0cc6, 0x0ccc, + 0x0ccd, 0x0ce2, 0x0ce3, 0x0d01, 0x0d01, 0x0d41, 0x0d44, 0x0d4d, + 0x0d4d, 0x0d62, 0x0d63, 0x0dca, 0x0dca, 0x0dd2, 0x0dd4, 0x0dd6, + 0x0dd6, 0x0e31, 0x0e31, 0x0e34, 0x0e3a, 0x0e46, 0x0e4e, 0x0eb1, + 0x0eb1, 0x0eb4, 0x0eb9, 0x0ebb, 0x0ebc, 0x0ec6, 0x0ec6, 0x0ec8, + 0x0ecd, 0x0f18, 0x0f19, 0x0f35, 0x0f35, 0x0f37, 0x0f37, 0x0f39, + 0x0f39, 0x0f71, 0x0f7e, 0x0f80, 0x0f84, 0x0f86, 0x0f87, 0x0f8d, + 0x0f97, 0x0f99, 0x0fbc, 0x0fc6, 0x0fc6, 0x102d, 0x1030, 0x1032, + 0x1037, 0x1039, 0x103a, 0x103d, 0x103e, 0x1058, 0x1059, 0x105e, + 0x1060, 0x1071, 0x1074, 0x1082, 0x1082, 0x1085, 0x1086, 0x108d, + 0x108d, 0x109d, 0x109d, 0x10fc, 0x10fc, 0x135d, 0x135f, 0x1712, + 0x1714, 0x1732, 0x1734, 0x1752, 0x1753, 0x1772, 0x1773, 0x17b4, + 0x17b5, 0x17b7, 0x17bd, 0x17c6, 0x17c6, 0x17c9, 0x17d3, 0x17d7, + 0x17d7, 0x17dd, 0x17dd, 0x180b, 0x180e, 0x1843, 0x1843, 0x1885, + 0x1886, 0x18a9, 0x18a9, 0x1920, 0x1922, 0x1927, 0x1928, 0x1932, + 0x1932, 0x1939, 0x193b, 0x1a17, 0x1a18, 0x1a1b, 0x1a1b, 0x1a56, + 0x1a56, 0x1a58, 0x1a5e, 0x1a60, 0x1a60, 0x1a62, 0x1a62, 0x1a65, + 0x1a6c, 0x1a73, 0x1a7c, 0x1a7f, 0x1a7f, 0x1aa7, 0x1aa7, 0x1ab0, + 0x1abe, 0x1b00, 0x1b03, 0x1b34, 0x1b34, 0x1b36, 0x1b3a, 0x1b3c, + 0x1b3c, 0x1b42, 0x1b42, 0x1b6b, 0x1b73, 0x1b80, 0x1b81, 0x1ba2, + 0x1ba5, 0x1ba8, 0x1ba9, 0x1bab, 0x1bad, 0x1be6, 0x1be6, 0x1be8, + 0x1be9, 0x1bed, 0x1bed, 0x1bef, 0x1bf1, 0x1c2c, 0x1c33, 0x1c36, + 0x1c37, 0x1c78, 0x1c7d, 0x1cd0, 0x1cd2, 0x1cd4, 0x1ce0, 0x1ce2, + 0x1ce8, 0x1ced, 0x1ced, 0x1cf4, 0x1cf4, 0x1cf8, 0x1cf9, 0x1d2c, + 0x1d6a, 0x1d78, 0x1d78, 0x1d9b, 0x1df5, 0x1dfb, 0x1dff, 0x1fbd, + 0x1fbd, 0x1fbf, 0x1fc1, 0x1fcd, 0x1fcf, 0x1fdd, 0x1fdf, 0x1fed, + 0x1fef, 0x1ffd, 0x1ffe, 0x200b, 0x200f, 0x2018, 0x2019, 0x2024, + 0x2024, 0x2027, 0x2027, 0x202a, 0x202e, 0x2060, 0x2064, 0x2066, + 0x206f, 0x2071, 0x2071, 0x207f, 0x207f, 0x2090, 0x209c, 0x20d0, + 0x20f0, 0x2c7c, 0x2c7d, 0x2cef, 0x2cf1, 0x2d6f, 0x2d6f, 0x2d7f, + 0x2d7f, 0x2de0, 0x2dff, 0x2e2f, 0x2e2f, 0x3005, 0x3005, 0x302a, + 0x302d, 0x3031, 0x3035, 0x303b, 0x303b, 0x3099, 0x309e, 0x30fc, + 0x30fe, 0xa015, 0xa015, 0xa4f8, 0xa4fd, 0xa60c, 0xa60c, 0xa66f, + 0xa672, 0xa674, 0xa67d, 0xa67f, 0xa67f, 0xa69c, 0xa69f, 0xa6f0, + 0xa6f1, 0xa700, 0xa721, 0xa770, 0xa770, 0xa788, 0xa78a, 0xa7f8, + 0xa7f9, 0xa802, 0xa802, 0xa806, 0xa806, 0xa80b, 0xa80b, 0xa825, + 0xa826, 0xa8c4, 0xa8c5, 0xa8e0, 0xa8f1, 0xa926, 0xa92d, 0xa947, + 0xa951, 0xa980, 0xa982, 0xa9b3, 0xa9b3, 0xa9b6, 0xa9b9, 0xa9bc, + 0xa9bc, 0xa9cf, 0xa9cf, 0xa9e5, 0xa9e6, 0xaa29, 0xaa2e, 0xaa31, + 0xaa32, 0xaa35, 0xaa36, 0xaa43, 0xaa43, 0xaa4c, 0xaa4c, 0xaa70, + 0xaa70, 0xaa7c, 0xaa7c, 0xaab0, 0xaab0, 0xaab2, 0xaab4, 0xaab7, + 0xaab8, 0xaabe, 0xaabf, 0xaac1, 0xaac1, 0xaadd, 0xaadd, 0xaaec, + 0xaaed, 0xaaf3, 0xaaf4, 0xaaf6, 0xaaf6, 0xab5b, 0xab5f, 0xabe5, + 0xabe5, 0xabe8, 0xabe8, 0xabed, 0xabed, 0xfb1e, 0xfb1e, 0xfbb2, + 0xfbc1, 0xfe00, 0xfe0f, 0xfe13, 0xfe13, 0xfe20, 0xfe2f, 0xfe52, + 0xfe52, 0xfe55, 0xfe55, 0xfeff, 0xfeff, 0xff07, 0xff07, 0xff0e, + 0xff0e, 0xff1a, 0xff1a, 0xff3e, 0xff3e, 0xff40, 0xff40, 0xff70, + 0xff70, 0xff9e, 0xff9f, 0xffe3, 0xffe3, 0xfff9, 0xfffb, 0x101fd, + 0x101fd, 0x102e0, 0x102e0, 0x10376, 0x1037a, 0x10a01, 0x10a03, 0x10a05, + 0x10a06, 0x10a0c, 0x10a0f, 0x10a38, 0x10a3a, 0x10a3f, 0x10a3f, 0x10ae5, + 0x10ae6, 0x11001, 0x11001, 0x11038, 0x11046, 0x1107f, 0x11081, 0x110b3, + 0x110b6, 0x110b9, 0x110ba, 0x110bd, 0x110bd, 0x11100, 0x11102, 0x11127, + 0x1112b, 0x1112d, 0x11134, 0x11173, 0x11173, 0x11180, 0x11181, 0x111b6, + 0x111be, 0x111ca, 0x111cc, 0x1122f, 0x11231, 0x11234, 0x11234, 0x11236, + 0x11237, 0x1123e, 0x1123e, 0x112df, 0x112df, 0x112e3, 0x112ea, 0x11300, + 0x11301, 0x1133c, 0x1133c, 0x11340, 0x11340, 0x11366, 0x1136c, 0x11370, + 0x11374, 0x11438, 0x1143f, 0x11442, 0x11444, 0x11446, 0x11446, 0x114b3, + 0x114b8, 0x114ba, 0x114ba, 0x114bf, 0x114c0, 0x114c2, 0x114c3, 0x115b2, + 0x115b5, 0x115bc, 0x115bd, 0x115bf, 0x115c0, 0x115dc, 0x115dd, 0x11633, + 0x1163a, 0x1163d, 0x1163d, 0x1163f, 0x11640, 0x116ab, 0x116ab, 0x116ad, + 0x116ad, 0x116b0, 0x116b5, 0x116b7, 0x116b7, 0x1171d, 0x1171f, 0x11722, + 0x11725, 0x11727, 0x1172b, 0x11c30, 0x11c36, 0x11c38, 0x11c3d, 0x11c3f, + 0x11c3f, 0x11c92, 0x11ca7, 0x11caa, 0x11cb0, 0x11cb2, 0x11cb3, 0x11cb5, + 0x11cb6, 0x16af0, 0x16af4, 0x16b30, 0x16b36, 0x16b40, 0x16b43, 0x16f8f, + 0x16f9f, 0x16fe0, 0x16fe0, 0x1bc9d, 0x1bc9e, 0x1bca0, 0x1bca3, 0x1d167, + 0x1d169, 0x1d173, 0x1d182, 0x1d185, 0x1d18b, 0x1d1aa, 0x1d1ad, 0x1d242, + 0x1d244, 0x1da00, 0x1da36, 0x1da3b, 0x1da6c, 0x1da75, 0x1da75, 0x1da84, + 0x1da84, 0x1da9b, 0x1da9f, 0x1daa1, 0x1daaf, 0x1e000, 0x1e006, 0x1e008, + 0x1e018, 0x1e01b, 0x1e021, 0x1e023, 0x1e024, 0x1e026, 0x1e02a, 0x1e8d0, + 0x1e8d6, 0x1e944, 0x1e94a, 0x1f3fb, 0x1f3ff, 0xe0001, 0xe0001, 0xe0020, + 0xe007f, 0xe0100, 0xe01ef, +}; /* CR_Case_Ignorable */ + +/* 'Changes_When_Lowercased': Derived Property */ +static const OnigCodePoint CR_Changes_When_Lowercased[] = { + 590, 0x0041, 0x005a, 0x00c0, 0x00d6, 0x00d8, 0x00de, 0x0100, + 0x0100, 0x0102, 0x0102, 0x0104, 0x0104, 0x0106, 0x0106, 0x0108, + 0x0108, 0x010a, 0x010a, 0x010c, 0x010c, 0x010e, 0x010e, 0x0110, + 0x0110, 0x0112, 0x0112, 0x0114, 0x0114, 0x0116, 0x0116, 0x0118, + 0x0118, 0x011a, 0x011a, 0x011c, 0x011c, 0x011e, 0x011e, 0x0120, + 0x0120, 0x0122, 0x0122, 0x0124, 0x0124, 0x0126, 0x0126, 0x0128, + 0x0128, 0x012a, 0x012a, 0x012c, 0x012c, 0x012e, 0x012e, 0x0130, + 0x0130, 0x0132, 0x0132, 0x0134, 0x0134, 0x0136, 0x0136, 0x0139, + 0x0139, 0x013b, 0x013b, 0x013d, 0x013d, 0x013f, 0x013f, 0x0141, + 0x0141, 0x0143, 0x0143, 0x0145, 0x0145, 0x0147, 0x0147, 0x014a, + 0x014a, 0x014c, 0x014c, 0x014e, 0x014e, 0x0150, 0x0150, 0x0152, + 0x0152, 0x0154, 0x0154, 0x0156, 0x0156, 0x0158, 0x0158, 0x015a, + 0x015a, 0x015c, 0x015c, 0x015e, 0x015e, 0x0160, 0x0160, 0x0162, + 0x0162, 0x0164, 0x0164, 0x0166, 0x0166, 0x0168, 0x0168, 0x016a, + 0x016a, 0x016c, 0x016c, 0x016e, 0x016e, 0x0170, 0x0170, 0x0172, + 0x0172, 0x0174, 0x0174, 0x0176, 0x0176, 0x0178, 0x0179, 0x017b, + 0x017b, 0x017d, 0x017d, 0x0181, 0x0182, 0x0184, 0x0184, 0x0186, + 0x0187, 0x0189, 0x018b, 0x018e, 0x0191, 0x0193, 0x0194, 0x0196, + 0x0198, 0x019c, 0x019d, 0x019f, 0x01a0, 0x01a2, 0x01a2, 0x01a4, + 0x01a4, 0x01a6, 0x01a7, 0x01a9, 0x01a9, 0x01ac, 0x01ac, 0x01ae, + 0x01af, 0x01b1, 0x01b3, 0x01b5, 0x01b5, 0x01b7, 0x01b8, 0x01bc, + 0x01bc, 0x01c4, 0x01c5, 0x01c7, 0x01c8, 0x01ca, 0x01cb, 0x01cd, + 0x01cd, 0x01cf, 0x01cf, 0x01d1, 0x01d1, 0x01d3, 0x01d3, 0x01d5, + 0x01d5, 0x01d7, 0x01d7, 0x01d9, 0x01d9, 0x01db, 0x01db, 0x01de, + 0x01de, 0x01e0, 0x01e0, 0x01e2, 0x01e2, 0x01e4, 0x01e4, 0x01e6, + 0x01e6, 0x01e8, 0x01e8, 0x01ea, 0x01ea, 0x01ec, 0x01ec, 0x01ee, + 0x01ee, 0x01f1, 0x01f2, 0x01f4, 0x01f4, 0x01f6, 0x01f8, 0x01fa, + 0x01fa, 0x01fc, 0x01fc, 0x01fe, 0x01fe, 0x0200, 0x0200, 0x0202, + 0x0202, 0x0204, 0x0204, 0x0206, 0x0206, 0x0208, 0x0208, 0x020a, + 0x020a, 0x020c, 0x020c, 0x020e, 0x020e, 0x0210, 0x0210, 0x0212, + 0x0212, 0x0214, 0x0214, 0x0216, 0x0216, 0x0218, 0x0218, 0x021a, + 0x021a, 0x021c, 0x021c, 0x021e, 0x021e, 0x0220, 0x0220, 0x0222, + 0x0222, 0x0224, 0x0224, 0x0226, 0x0226, 0x0228, 0x0228, 0x022a, + 0x022a, 0x022c, 0x022c, 0x022e, 0x022e, 0x0230, 0x0230, 0x0232, + 0x0232, 0x023a, 0x023b, 0x023d, 0x023e, 0x0241, 0x0241, 0x0243, + 0x0246, 0x0248, 0x0248, 0x024a, 0x024a, 0x024c, 0x024c, 0x024e, + 0x024e, 0x0370, 0x0370, 0x0372, 0x0372, 0x0376, 0x0376, 0x037f, + 0x037f, 0x0386, 0x0386, 0x0388, 0x038a, 0x038c, 0x038c, 0x038e, + 0x038f, 0x0391, 0x03a1, 0x03a3, 0x03ab, 0x03cf, 0x03cf, 0x03d8, + 0x03d8, 0x03da, 0x03da, 0x03dc, 0x03dc, 0x03de, 0x03de, 0x03e0, + 0x03e0, 0x03e2, 0x03e2, 0x03e4, 0x03e4, 0x03e6, 0x03e6, 0x03e8, + 0x03e8, 0x03ea, 0x03ea, 0x03ec, 0x03ec, 0x03ee, 0x03ee, 0x03f4, + 0x03f4, 0x03f7, 0x03f7, 0x03f9, 0x03fa, 0x03fd, 0x042f, 0x0460, + 0x0460, 0x0462, 0x0462, 0x0464, 0x0464, 0x0466, 0x0466, 0x0468, + 0x0468, 0x046a, 0x046a, 0x046c, 0x046c, 0x046e, 0x046e, 0x0470, + 0x0470, 0x0472, 0x0472, 0x0474, 0x0474, 0x0476, 0x0476, 0x0478, + 0x0478, 0x047a, 0x047a, 0x047c, 0x047c, 0x047e, 0x047e, 0x0480, + 0x0480, 0x048a, 0x048a, 0x048c, 0x048c, 0x048e, 0x048e, 0x0490, + 0x0490, 0x0492, 0x0492, 0x0494, 0x0494, 0x0496, 0x0496, 0x0498, + 0x0498, 0x049a, 0x049a, 0x049c, 0x049c, 0x049e, 0x049e, 0x04a0, + 0x04a0, 0x04a2, 0x04a2, 0x04a4, 0x04a4, 0x04a6, 0x04a6, 0x04a8, + 0x04a8, 0x04aa, 0x04aa, 0x04ac, 0x04ac, 0x04ae, 0x04ae, 0x04b0, + 0x04b0, 0x04b2, 0x04b2, 0x04b4, 0x04b4, 0x04b6, 0x04b6, 0x04b8, + 0x04b8, 0x04ba, 0x04ba, 0x04bc, 0x04bc, 0x04be, 0x04be, 0x04c0, + 0x04c1, 0x04c3, 0x04c3, 0x04c5, 0x04c5, 0x04c7, 0x04c7, 0x04c9, + 0x04c9, 0x04cb, 0x04cb, 0x04cd, 0x04cd, 0x04d0, 0x04d0, 0x04d2, + 0x04d2, 0x04d4, 0x04d4, 0x04d6, 0x04d6, 0x04d8, 0x04d8, 0x04da, + 0x04da, 0x04dc, 0x04dc, 0x04de, 0x04de, 0x04e0, 0x04e0, 0x04e2, + 0x04e2, 0x04e4, 0x04e4, 0x04e6, 0x04e6, 0x04e8, 0x04e8, 0x04ea, + 0x04ea, 0x04ec, 0x04ec, 0x04ee, 0x04ee, 0x04f0, 0x04f0, 0x04f2, + 0x04f2, 0x04f4, 0x04f4, 0x04f6, 0x04f6, 0x04f8, 0x04f8, 0x04fa, + 0x04fa, 0x04fc, 0x04fc, 0x04fe, 0x04fe, 0x0500, 0x0500, 0x0502, + 0x0502, 0x0504, 0x0504, 0x0506, 0x0506, 0x0508, 0x0508, 0x050a, + 0x050a, 0x050c, 0x050c, 0x050e, 0x050e, 0x0510, 0x0510, 0x0512, + 0x0512, 0x0514, 0x0514, 0x0516, 0x0516, 0x0518, 0x0518, 0x051a, + 0x051a, 0x051c, 0x051c, 0x051e, 0x051e, 0x0520, 0x0520, 0x0522, + 0x0522, 0x0524, 0x0524, 0x0526, 0x0526, 0x0528, 0x0528, 0x052a, + 0x052a, 0x052c, 0x052c, 0x052e, 0x052e, 0x0531, 0x0556, 0x10a0, + 0x10c5, 0x10c7, 0x10c7, 0x10cd, 0x10cd, 0x13a0, 0x13f5, 0x1e00, + 0x1e00, 0x1e02, 0x1e02, 0x1e04, 0x1e04, 0x1e06, 0x1e06, 0x1e08, + 0x1e08, 0x1e0a, 0x1e0a, 0x1e0c, 0x1e0c, 0x1e0e, 0x1e0e, 0x1e10, + 0x1e10, 0x1e12, 0x1e12, 0x1e14, 0x1e14, 0x1e16, 0x1e16, 0x1e18, + 0x1e18, 0x1e1a, 0x1e1a, 0x1e1c, 0x1e1c, 0x1e1e, 0x1e1e, 0x1e20, + 0x1e20, 0x1e22, 0x1e22, 0x1e24, 0x1e24, 0x1e26, 0x1e26, 0x1e28, + 0x1e28, 0x1e2a, 0x1e2a, 0x1e2c, 0x1e2c, 0x1e2e, 0x1e2e, 0x1e30, + 0x1e30, 0x1e32, 0x1e32, 0x1e34, 0x1e34, 0x1e36, 0x1e36, 0x1e38, + 0x1e38, 0x1e3a, 0x1e3a, 0x1e3c, 0x1e3c, 0x1e3e, 0x1e3e, 0x1e40, + 0x1e40, 0x1e42, 0x1e42, 0x1e44, 0x1e44, 0x1e46, 0x1e46, 0x1e48, + 0x1e48, 0x1e4a, 0x1e4a, 0x1e4c, 0x1e4c, 0x1e4e, 0x1e4e, 0x1e50, + 0x1e50, 0x1e52, 0x1e52, 0x1e54, 0x1e54, 0x1e56, 0x1e56, 0x1e58, + 0x1e58, 0x1e5a, 0x1e5a, 0x1e5c, 0x1e5c, 0x1e5e, 0x1e5e, 0x1e60, + 0x1e60, 0x1e62, 0x1e62, 0x1e64, 0x1e64, 0x1e66, 0x1e66, 0x1e68, + 0x1e68, 0x1e6a, 0x1e6a, 0x1e6c, 0x1e6c, 0x1e6e, 0x1e6e, 0x1e70, + 0x1e70, 0x1e72, 0x1e72, 0x1e74, 0x1e74, 0x1e76, 0x1e76, 0x1e78, + 0x1e78, 0x1e7a, 0x1e7a, 0x1e7c, 0x1e7c, 0x1e7e, 0x1e7e, 0x1e80, + 0x1e80, 0x1e82, 0x1e82, 0x1e84, 0x1e84, 0x1e86, 0x1e86, 0x1e88, + 0x1e88, 0x1e8a, 0x1e8a, 0x1e8c, 0x1e8c, 0x1e8e, 0x1e8e, 0x1e90, + 0x1e90, 0x1e92, 0x1e92, 0x1e94, 0x1e94, 0x1e9e, 0x1e9e, 0x1ea0, + 0x1ea0, 0x1ea2, 0x1ea2, 0x1ea4, 0x1ea4, 0x1ea6, 0x1ea6, 0x1ea8, + 0x1ea8, 0x1eaa, 0x1eaa, 0x1eac, 0x1eac, 0x1eae, 0x1eae, 0x1eb0, + 0x1eb0, 0x1eb2, 0x1eb2, 0x1eb4, 0x1eb4, 0x1eb6, 0x1eb6, 0x1eb8, + 0x1eb8, 0x1eba, 0x1eba, 0x1ebc, 0x1ebc, 0x1ebe, 0x1ebe, 0x1ec0, + 0x1ec0, 0x1ec2, 0x1ec2, 0x1ec4, 0x1ec4, 0x1ec6, 0x1ec6, 0x1ec8, + 0x1ec8, 0x1eca, 0x1eca, 0x1ecc, 0x1ecc, 0x1ece, 0x1ece, 0x1ed0, + 0x1ed0, 0x1ed2, 0x1ed2, 0x1ed4, 0x1ed4, 0x1ed6, 0x1ed6, 0x1ed8, + 0x1ed8, 0x1eda, 0x1eda, 0x1edc, 0x1edc, 0x1ede, 0x1ede, 0x1ee0, + 0x1ee0, 0x1ee2, 0x1ee2, 0x1ee4, 0x1ee4, 0x1ee6, 0x1ee6, 0x1ee8, + 0x1ee8, 0x1eea, 0x1eea, 0x1eec, 0x1eec, 0x1eee, 0x1eee, 0x1ef0, + 0x1ef0, 0x1ef2, 0x1ef2, 0x1ef4, 0x1ef4, 0x1ef6, 0x1ef6, 0x1ef8, + 0x1ef8, 0x1efa, 0x1efa, 0x1efc, 0x1efc, 0x1efe, 0x1efe, 0x1f08, + 0x1f0f, 0x1f18, 0x1f1d, 0x1f28, 0x1f2f, 0x1f38, 0x1f3f, 0x1f48, + 0x1f4d, 0x1f59, 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, + 0x1f5f, 0x1f68, 0x1f6f, 0x1f88, 0x1f8f, 0x1f98, 0x1f9f, 0x1fa8, + 0x1faf, 0x1fb8, 0x1fbc, 0x1fc8, 0x1fcc, 0x1fd8, 0x1fdb, 0x1fe8, + 0x1fec, 0x1ff8, 0x1ffc, 0x2126, 0x2126, 0x212a, 0x212b, 0x2132, + 0x2132, 0x2160, 0x216f, 0x2183, 0x2183, 0x24b6, 0x24cf, 0x2c00, + 0x2c2e, 0x2c60, 0x2c60, 0x2c62, 0x2c64, 0x2c67, 0x2c67, 0x2c69, + 0x2c69, 0x2c6b, 0x2c6b, 0x2c6d, 0x2c70, 0x2c72, 0x2c72, 0x2c75, + 0x2c75, 0x2c7e, 0x2c80, 0x2c82, 0x2c82, 0x2c84, 0x2c84, 0x2c86, + 0x2c86, 0x2c88, 0x2c88, 0x2c8a, 0x2c8a, 0x2c8c, 0x2c8c, 0x2c8e, + 0x2c8e, 0x2c90, 0x2c90, 0x2c92, 0x2c92, 0x2c94, 0x2c94, 0x2c96, + 0x2c96, 0x2c98, 0x2c98, 0x2c9a, 0x2c9a, 0x2c9c, 0x2c9c, 0x2c9e, + 0x2c9e, 0x2ca0, 0x2ca0, 0x2ca2, 0x2ca2, 0x2ca4, 0x2ca4, 0x2ca6, + 0x2ca6, 0x2ca8, 0x2ca8, 0x2caa, 0x2caa, 0x2cac, 0x2cac, 0x2cae, + 0x2cae, 0x2cb0, 0x2cb0, 0x2cb2, 0x2cb2, 0x2cb4, 0x2cb4, 0x2cb6, + 0x2cb6, 0x2cb8, 0x2cb8, 0x2cba, 0x2cba, 0x2cbc, 0x2cbc, 0x2cbe, + 0x2cbe, 0x2cc0, 0x2cc0, 0x2cc2, 0x2cc2, 0x2cc4, 0x2cc4, 0x2cc6, + 0x2cc6, 0x2cc8, 0x2cc8, 0x2cca, 0x2cca, 0x2ccc, 0x2ccc, 0x2cce, + 0x2cce, 0x2cd0, 0x2cd0, 0x2cd2, 0x2cd2, 0x2cd4, 0x2cd4, 0x2cd6, + 0x2cd6, 0x2cd8, 0x2cd8, 0x2cda, 0x2cda, 0x2cdc, 0x2cdc, 0x2cde, + 0x2cde, 0x2ce0, 0x2ce0, 0x2ce2, 0x2ce2, 0x2ceb, 0x2ceb, 0x2ced, + 0x2ced, 0x2cf2, 0x2cf2, 0xa640, 0xa640, 0xa642, 0xa642, 0xa644, + 0xa644, 0xa646, 0xa646, 0xa648, 0xa648, 0xa64a, 0xa64a, 0xa64c, + 0xa64c, 0xa64e, 0xa64e, 0xa650, 0xa650, 0xa652, 0xa652, 0xa654, + 0xa654, 0xa656, 0xa656, 0xa658, 0xa658, 0xa65a, 0xa65a, 0xa65c, + 0xa65c, 0xa65e, 0xa65e, 0xa660, 0xa660, 0xa662, 0xa662, 0xa664, + 0xa664, 0xa666, 0xa666, 0xa668, 0xa668, 0xa66a, 0xa66a, 0xa66c, + 0xa66c, 0xa680, 0xa680, 0xa682, 0xa682, 0xa684, 0xa684, 0xa686, + 0xa686, 0xa688, 0xa688, 0xa68a, 0xa68a, 0xa68c, 0xa68c, 0xa68e, + 0xa68e, 0xa690, 0xa690, 0xa692, 0xa692, 0xa694, 0xa694, 0xa696, + 0xa696, 0xa698, 0xa698, 0xa69a, 0xa69a, 0xa722, 0xa722, 0xa724, + 0xa724, 0xa726, 0xa726, 0xa728, 0xa728, 0xa72a, 0xa72a, 0xa72c, + 0xa72c, 0xa72e, 0xa72e, 0xa732, 0xa732, 0xa734, 0xa734, 0xa736, + 0xa736, 0xa738, 0xa738, 0xa73a, 0xa73a, 0xa73c, 0xa73c, 0xa73e, + 0xa73e, 0xa740, 0xa740, 0xa742, 0xa742, 0xa744, 0xa744, 0xa746, + 0xa746, 0xa748, 0xa748, 0xa74a, 0xa74a, 0xa74c, 0xa74c, 0xa74e, + 0xa74e, 0xa750, 0xa750, 0xa752, 0xa752, 0xa754, 0xa754, 0xa756, + 0xa756, 0xa758, 0xa758, 0xa75a, 0xa75a, 0xa75c, 0xa75c, 0xa75e, + 0xa75e, 0xa760, 0xa760, 0xa762, 0xa762, 0xa764, 0xa764, 0xa766, + 0xa766, 0xa768, 0xa768, 0xa76a, 0xa76a, 0xa76c, 0xa76c, 0xa76e, + 0xa76e, 0xa779, 0xa779, 0xa77b, 0xa77b, 0xa77d, 0xa77e, 0xa780, + 0xa780, 0xa782, 0xa782, 0xa784, 0xa784, 0xa786, 0xa786, 0xa78b, + 0xa78b, 0xa78d, 0xa78d, 0xa790, 0xa790, 0xa792, 0xa792, 0xa796, + 0xa796, 0xa798, 0xa798, 0xa79a, 0xa79a, 0xa79c, 0xa79c, 0xa79e, + 0xa79e, 0xa7a0, 0xa7a0, 0xa7a2, 0xa7a2, 0xa7a4, 0xa7a4, 0xa7a6, + 0xa7a6, 0xa7a8, 0xa7a8, 0xa7aa, 0xa7ae, 0xa7b0, 0xa7b4, 0xa7b6, + 0xa7b6, 0xff21, 0xff3a, 0x10400, 0x10427, 0x104b0, 0x104d3, 0x10c80, + 0x10cb2, 0x118a0, 0x118bf, 0x1e900, 0x1e921, +}; /* CR_Changes_When_Lowercased */ + +/* 'Changes_When_Uppercased': Derived Property */ +static const OnigCodePoint CR_Changes_When_Uppercased[] = { + 607, 0x0061, 0x007a, 0x00b5, 0x00b5, 0x00df, 0x00f6, 0x00f8, + 0x00ff, 0x0101, 0x0101, 0x0103, 0x0103, 0x0105, 0x0105, 0x0107, + 0x0107, 0x0109, 0x0109, 0x010b, 0x010b, 0x010d, 0x010d, 0x010f, + 0x010f, 0x0111, 0x0111, 0x0113, 0x0113, 0x0115, 0x0115, 0x0117, + 0x0117, 0x0119, 0x0119, 0x011b, 0x011b, 0x011d, 0x011d, 0x011f, + 0x011f, 0x0121, 0x0121, 0x0123, 0x0123, 0x0125, 0x0125, 0x0127, + 0x0127, 0x0129, 0x0129, 0x012b, 0x012b, 0x012d, 0x012d, 0x012f, + 0x012f, 0x0131, 0x0131, 0x0133, 0x0133, 0x0135, 0x0135, 0x0137, + 0x0137, 0x013a, 0x013a, 0x013c, 0x013c, 0x013e, 0x013e, 0x0140, + 0x0140, 0x0142, 0x0142, 0x0144, 0x0144, 0x0146, 0x0146, 0x0148, + 0x0149, 0x014b, 0x014b, 0x014d, 0x014d, 0x014f, 0x014f, 0x0151, + 0x0151, 0x0153, 0x0153, 0x0155, 0x0155, 0x0157, 0x0157, 0x0159, + 0x0159, 0x015b, 0x015b, 0x015d, 0x015d, 0x015f, 0x015f, 0x0161, + 0x0161, 0x0163, 0x0163, 0x0165, 0x0165, 0x0167, 0x0167, 0x0169, + 0x0169, 0x016b, 0x016b, 0x016d, 0x016d, 0x016f, 0x016f, 0x0171, + 0x0171, 0x0173, 0x0173, 0x0175, 0x0175, 0x0177, 0x0177, 0x017a, + 0x017a, 0x017c, 0x017c, 0x017e, 0x0180, 0x0183, 0x0183, 0x0185, + 0x0185, 0x0188, 0x0188, 0x018c, 0x018c, 0x0192, 0x0192, 0x0195, + 0x0195, 0x0199, 0x019a, 0x019e, 0x019e, 0x01a1, 0x01a1, 0x01a3, + 0x01a3, 0x01a5, 0x01a5, 0x01a8, 0x01a8, 0x01ad, 0x01ad, 0x01b0, + 0x01b0, 0x01b4, 0x01b4, 0x01b6, 0x01b6, 0x01b9, 0x01b9, 0x01bd, + 0x01bd, 0x01bf, 0x01bf, 0x01c5, 0x01c6, 0x01c8, 0x01c9, 0x01cb, + 0x01cc, 0x01ce, 0x01ce, 0x01d0, 0x01d0, 0x01d2, 0x01d2, 0x01d4, + 0x01d4, 0x01d6, 0x01d6, 0x01d8, 0x01d8, 0x01da, 0x01da, 0x01dc, + 0x01dd, 0x01df, 0x01df, 0x01e1, 0x01e1, 0x01e3, 0x01e3, 0x01e5, + 0x01e5, 0x01e7, 0x01e7, 0x01e9, 0x01e9, 0x01eb, 0x01eb, 0x01ed, + 0x01ed, 0x01ef, 0x01f0, 0x01f2, 0x01f3, 0x01f5, 0x01f5, 0x01f9, + 0x01f9, 0x01fb, 0x01fb, 0x01fd, 0x01fd, 0x01ff, 0x01ff, 0x0201, + 0x0201, 0x0203, 0x0203, 0x0205, 0x0205, 0x0207, 0x0207, 0x0209, + 0x0209, 0x020b, 0x020b, 0x020d, 0x020d, 0x020f, 0x020f, 0x0211, + 0x0211, 0x0213, 0x0213, 0x0215, 0x0215, 0x0217, 0x0217, 0x0219, + 0x0219, 0x021b, 0x021b, 0x021d, 0x021d, 0x021f, 0x021f, 0x0223, + 0x0223, 0x0225, 0x0225, 0x0227, 0x0227, 0x0229, 0x0229, 0x022b, + 0x022b, 0x022d, 0x022d, 0x022f, 0x022f, 0x0231, 0x0231, 0x0233, + 0x0233, 0x023c, 0x023c, 0x023f, 0x0240, 0x0242, 0x0242, 0x0247, + 0x0247, 0x0249, 0x0249, 0x024b, 0x024b, 0x024d, 0x024d, 0x024f, + 0x0254, 0x0256, 0x0257, 0x0259, 0x0259, 0x025b, 0x025c, 0x0260, + 0x0261, 0x0263, 0x0263, 0x0265, 0x0266, 0x0268, 0x026c, 0x026f, + 0x026f, 0x0271, 0x0272, 0x0275, 0x0275, 0x027d, 0x027d, 0x0280, + 0x0280, 0x0283, 0x0283, 0x0287, 0x028c, 0x0292, 0x0292, 0x029d, + 0x029e, 0x0345, 0x0345, 0x0371, 0x0371, 0x0373, 0x0373, 0x0377, + 0x0377, 0x037b, 0x037d, 0x0390, 0x0390, 0x03ac, 0x03ce, 0x03d0, + 0x03d1, 0x03d5, 0x03d7, 0x03d9, 0x03d9, 0x03db, 0x03db, 0x03dd, + 0x03dd, 0x03df, 0x03df, 0x03e1, 0x03e1, 0x03e3, 0x03e3, 0x03e5, + 0x03e5, 0x03e7, 0x03e7, 0x03e9, 0x03e9, 0x03eb, 0x03eb, 0x03ed, + 0x03ed, 0x03ef, 0x03f3, 0x03f5, 0x03f5, 0x03f8, 0x03f8, 0x03fb, + 0x03fb, 0x0430, 0x045f, 0x0461, 0x0461, 0x0463, 0x0463, 0x0465, + 0x0465, 0x0467, 0x0467, 0x0469, 0x0469, 0x046b, 0x046b, 0x046d, + 0x046d, 0x046f, 0x046f, 0x0471, 0x0471, 0x0473, 0x0473, 0x0475, + 0x0475, 0x0477, 0x0477, 0x0479, 0x0479, 0x047b, 0x047b, 0x047d, + 0x047d, 0x047f, 0x047f, 0x0481, 0x0481, 0x048b, 0x048b, 0x048d, + 0x048d, 0x048f, 0x048f, 0x0491, 0x0491, 0x0493, 0x0493, 0x0495, + 0x0495, 0x0497, 0x0497, 0x0499, 0x0499, 0x049b, 0x049b, 0x049d, + 0x049d, 0x049f, 0x049f, 0x04a1, 0x04a1, 0x04a3, 0x04a3, 0x04a5, + 0x04a5, 0x04a7, 0x04a7, 0x04a9, 0x04a9, 0x04ab, 0x04ab, 0x04ad, + 0x04ad, 0x04af, 0x04af, 0x04b1, 0x04b1, 0x04b3, 0x04b3, 0x04b5, + 0x04b5, 0x04b7, 0x04b7, 0x04b9, 0x04b9, 0x04bb, 0x04bb, 0x04bd, + 0x04bd, 0x04bf, 0x04bf, 0x04c2, 0x04c2, 0x04c4, 0x04c4, 0x04c6, + 0x04c6, 0x04c8, 0x04c8, 0x04ca, 0x04ca, 0x04cc, 0x04cc, 0x04ce, + 0x04cf, 0x04d1, 0x04d1, 0x04d3, 0x04d3, 0x04d5, 0x04d5, 0x04d7, + 0x04d7, 0x04d9, 0x04d9, 0x04db, 0x04db, 0x04dd, 0x04dd, 0x04df, + 0x04df, 0x04e1, 0x04e1, 0x04e3, 0x04e3, 0x04e5, 0x04e5, 0x04e7, + 0x04e7, 0x04e9, 0x04e9, 0x04eb, 0x04eb, 0x04ed, 0x04ed, 0x04ef, + 0x04ef, 0x04f1, 0x04f1, 0x04f3, 0x04f3, 0x04f5, 0x04f5, 0x04f7, + 0x04f7, 0x04f9, 0x04f9, 0x04fb, 0x04fb, 0x04fd, 0x04fd, 0x04ff, + 0x04ff, 0x0501, 0x0501, 0x0503, 0x0503, 0x0505, 0x0505, 0x0507, + 0x0507, 0x0509, 0x0509, 0x050b, 0x050b, 0x050d, 0x050d, 0x050f, + 0x050f, 0x0511, 0x0511, 0x0513, 0x0513, 0x0515, 0x0515, 0x0517, + 0x0517, 0x0519, 0x0519, 0x051b, 0x051b, 0x051d, 0x051d, 0x051f, + 0x051f, 0x0521, 0x0521, 0x0523, 0x0523, 0x0525, 0x0525, 0x0527, + 0x0527, 0x0529, 0x0529, 0x052b, 0x052b, 0x052d, 0x052d, 0x052f, + 0x052f, 0x0561, 0x0587, 0x13f8, 0x13fd, 0x1c80, 0x1c88, 0x1d79, + 0x1d79, 0x1d7d, 0x1d7d, 0x1e01, 0x1e01, 0x1e03, 0x1e03, 0x1e05, + 0x1e05, 0x1e07, 0x1e07, 0x1e09, 0x1e09, 0x1e0b, 0x1e0b, 0x1e0d, + 0x1e0d, 0x1e0f, 0x1e0f, 0x1e11, 0x1e11, 0x1e13, 0x1e13, 0x1e15, + 0x1e15, 0x1e17, 0x1e17, 0x1e19, 0x1e19, 0x1e1b, 0x1e1b, 0x1e1d, + 0x1e1d, 0x1e1f, 0x1e1f, 0x1e21, 0x1e21, 0x1e23, 0x1e23, 0x1e25, + 0x1e25, 0x1e27, 0x1e27, 0x1e29, 0x1e29, 0x1e2b, 0x1e2b, 0x1e2d, + 0x1e2d, 0x1e2f, 0x1e2f, 0x1e31, 0x1e31, 0x1e33, 0x1e33, 0x1e35, + 0x1e35, 0x1e37, 0x1e37, 0x1e39, 0x1e39, 0x1e3b, 0x1e3b, 0x1e3d, + 0x1e3d, 0x1e3f, 0x1e3f, 0x1e41, 0x1e41, 0x1e43, 0x1e43, 0x1e45, + 0x1e45, 0x1e47, 0x1e47, 0x1e49, 0x1e49, 0x1e4b, 0x1e4b, 0x1e4d, + 0x1e4d, 0x1e4f, 0x1e4f, 0x1e51, 0x1e51, 0x1e53, 0x1e53, 0x1e55, + 0x1e55, 0x1e57, 0x1e57, 0x1e59, 0x1e59, 0x1e5b, 0x1e5b, 0x1e5d, + 0x1e5d, 0x1e5f, 0x1e5f, 0x1e61, 0x1e61, 0x1e63, 0x1e63, 0x1e65, + 0x1e65, 0x1e67, 0x1e67, 0x1e69, 0x1e69, 0x1e6b, 0x1e6b, 0x1e6d, + 0x1e6d, 0x1e6f, 0x1e6f, 0x1e71, 0x1e71, 0x1e73, 0x1e73, 0x1e75, + 0x1e75, 0x1e77, 0x1e77, 0x1e79, 0x1e79, 0x1e7b, 0x1e7b, 0x1e7d, + 0x1e7d, 0x1e7f, 0x1e7f, 0x1e81, 0x1e81, 0x1e83, 0x1e83, 0x1e85, + 0x1e85, 0x1e87, 0x1e87, 0x1e89, 0x1e89, 0x1e8b, 0x1e8b, 0x1e8d, + 0x1e8d, 0x1e8f, 0x1e8f, 0x1e91, 0x1e91, 0x1e93, 0x1e93, 0x1e95, + 0x1e9b, 0x1ea1, 0x1ea1, 0x1ea3, 0x1ea3, 0x1ea5, 0x1ea5, 0x1ea7, + 0x1ea7, 0x1ea9, 0x1ea9, 0x1eab, 0x1eab, 0x1ead, 0x1ead, 0x1eaf, + 0x1eaf, 0x1eb1, 0x1eb1, 0x1eb3, 0x1eb3, 0x1eb5, 0x1eb5, 0x1eb7, + 0x1eb7, 0x1eb9, 0x1eb9, 0x1ebb, 0x1ebb, 0x1ebd, 0x1ebd, 0x1ebf, + 0x1ebf, 0x1ec1, 0x1ec1, 0x1ec3, 0x1ec3, 0x1ec5, 0x1ec5, 0x1ec7, + 0x1ec7, 0x1ec9, 0x1ec9, 0x1ecb, 0x1ecb, 0x1ecd, 0x1ecd, 0x1ecf, + 0x1ecf, 0x1ed1, 0x1ed1, 0x1ed3, 0x1ed3, 0x1ed5, 0x1ed5, 0x1ed7, + 0x1ed7, 0x1ed9, 0x1ed9, 0x1edb, 0x1edb, 0x1edd, 0x1edd, 0x1edf, + 0x1edf, 0x1ee1, 0x1ee1, 0x1ee3, 0x1ee3, 0x1ee5, 0x1ee5, 0x1ee7, + 0x1ee7, 0x1ee9, 0x1ee9, 0x1eeb, 0x1eeb, 0x1eed, 0x1eed, 0x1eef, + 0x1eef, 0x1ef1, 0x1ef1, 0x1ef3, 0x1ef3, 0x1ef5, 0x1ef5, 0x1ef7, + 0x1ef7, 0x1ef9, 0x1ef9, 0x1efb, 0x1efb, 0x1efd, 0x1efd, 0x1eff, + 0x1f07, 0x1f10, 0x1f15, 0x1f20, 0x1f27, 0x1f30, 0x1f37, 0x1f40, + 0x1f45, 0x1f50, 0x1f57, 0x1f60, 0x1f67, 0x1f70, 0x1f7d, 0x1f80, + 0x1fb4, 0x1fb6, 0x1fb7, 0x1fbc, 0x1fbc, 0x1fbe, 0x1fbe, 0x1fc2, + 0x1fc4, 0x1fc6, 0x1fc7, 0x1fcc, 0x1fcc, 0x1fd0, 0x1fd3, 0x1fd6, + 0x1fd7, 0x1fe0, 0x1fe7, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ff7, 0x1ffc, + 0x1ffc, 0x214e, 0x214e, 0x2170, 0x217f, 0x2184, 0x2184, 0x24d0, + 0x24e9, 0x2c30, 0x2c5e, 0x2c61, 0x2c61, 0x2c65, 0x2c66, 0x2c68, + 0x2c68, 0x2c6a, 0x2c6a, 0x2c6c, 0x2c6c, 0x2c73, 0x2c73, 0x2c76, + 0x2c76, 0x2c81, 0x2c81, 0x2c83, 0x2c83, 0x2c85, 0x2c85, 0x2c87, + 0x2c87, 0x2c89, 0x2c89, 0x2c8b, 0x2c8b, 0x2c8d, 0x2c8d, 0x2c8f, + 0x2c8f, 0x2c91, 0x2c91, 0x2c93, 0x2c93, 0x2c95, 0x2c95, 0x2c97, + 0x2c97, 0x2c99, 0x2c99, 0x2c9b, 0x2c9b, 0x2c9d, 0x2c9d, 0x2c9f, + 0x2c9f, 0x2ca1, 0x2ca1, 0x2ca3, 0x2ca3, 0x2ca5, 0x2ca5, 0x2ca7, + 0x2ca7, 0x2ca9, 0x2ca9, 0x2cab, 0x2cab, 0x2cad, 0x2cad, 0x2caf, + 0x2caf, 0x2cb1, 0x2cb1, 0x2cb3, 0x2cb3, 0x2cb5, 0x2cb5, 0x2cb7, + 0x2cb7, 0x2cb9, 0x2cb9, 0x2cbb, 0x2cbb, 0x2cbd, 0x2cbd, 0x2cbf, + 0x2cbf, 0x2cc1, 0x2cc1, 0x2cc3, 0x2cc3, 0x2cc5, 0x2cc5, 0x2cc7, + 0x2cc7, 0x2cc9, 0x2cc9, 0x2ccb, 0x2ccb, 0x2ccd, 0x2ccd, 0x2ccf, + 0x2ccf, 0x2cd1, 0x2cd1, 0x2cd3, 0x2cd3, 0x2cd5, 0x2cd5, 0x2cd7, + 0x2cd7, 0x2cd9, 0x2cd9, 0x2cdb, 0x2cdb, 0x2cdd, 0x2cdd, 0x2cdf, + 0x2cdf, 0x2ce1, 0x2ce1, 0x2ce3, 0x2ce3, 0x2cec, 0x2cec, 0x2cee, + 0x2cee, 0x2cf3, 0x2cf3, 0x2d00, 0x2d25, 0x2d27, 0x2d27, 0x2d2d, + 0x2d2d, 0xa641, 0xa641, 0xa643, 0xa643, 0xa645, 0xa645, 0xa647, + 0xa647, 0xa649, 0xa649, 0xa64b, 0xa64b, 0xa64d, 0xa64d, 0xa64f, + 0xa64f, 0xa651, 0xa651, 0xa653, 0xa653, 0xa655, 0xa655, 0xa657, + 0xa657, 0xa659, 0xa659, 0xa65b, 0xa65b, 0xa65d, 0xa65d, 0xa65f, + 0xa65f, 0xa661, 0xa661, 0xa663, 0xa663, 0xa665, 0xa665, 0xa667, + 0xa667, 0xa669, 0xa669, 0xa66b, 0xa66b, 0xa66d, 0xa66d, 0xa681, + 0xa681, 0xa683, 0xa683, 0xa685, 0xa685, 0xa687, 0xa687, 0xa689, + 0xa689, 0xa68b, 0xa68b, 0xa68d, 0xa68d, 0xa68f, 0xa68f, 0xa691, + 0xa691, 0xa693, 0xa693, 0xa695, 0xa695, 0xa697, 0xa697, 0xa699, + 0xa699, 0xa69b, 0xa69b, 0xa723, 0xa723, 0xa725, 0xa725, 0xa727, + 0xa727, 0xa729, 0xa729, 0xa72b, 0xa72b, 0xa72d, 0xa72d, 0xa72f, + 0xa72f, 0xa733, 0xa733, 0xa735, 0xa735, 0xa737, 0xa737, 0xa739, + 0xa739, 0xa73b, 0xa73b, 0xa73d, 0xa73d, 0xa73f, 0xa73f, 0xa741, + 0xa741, 0xa743, 0xa743, 0xa745, 0xa745, 0xa747, 0xa747, 0xa749, + 0xa749, 0xa74b, 0xa74b, 0xa74d, 0xa74d, 0xa74f, 0xa74f, 0xa751, + 0xa751, 0xa753, 0xa753, 0xa755, 0xa755, 0xa757, 0xa757, 0xa759, + 0xa759, 0xa75b, 0xa75b, 0xa75d, 0xa75d, 0xa75f, 0xa75f, 0xa761, + 0xa761, 0xa763, 0xa763, 0xa765, 0xa765, 0xa767, 0xa767, 0xa769, + 0xa769, 0xa76b, 0xa76b, 0xa76d, 0xa76d, 0xa76f, 0xa76f, 0xa77a, + 0xa77a, 0xa77c, 0xa77c, 0xa77f, 0xa77f, 0xa781, 0xa781, 0xa783, + 0xa783, 0xa785, 0xa785, 0xa787, 0xa787, 0xa78c, 0xa78c, 0xa791, + 0xa791, 0xa793, 0xa793, 0xa797, 0xa797, 0xa799, 0xa799, 0xa79b, + 0xa79b, 0xa79d, 0xa79d, 0xa79f, 0xa79f, 0xa7a1, 0xa7a1, 0xa7a3, + 0xa7a3, 0xa7a5, 0xa7a5, 0xa7a7, 0xa7a7, 0xa7a9, 0xa7a9, 0xa7b5, + 0xa7b5, 0xa7b7, 0xa7b7, 0xab53, 0xab53, 0xab70, 0xabbf, 0xfb00, + 0xfb06, 0xfb13, 0xfb17, 0xff41, 0xff5a, 0x10428, 0x1044f, 0x104d8, + 0x104fb, 0x10cc0, 0x10cf2, 0x118c0, 0x118df, 0x1e922, 0x1e943, +}; /* CR_Changes_When_Uppercased */ + +/* 'Changes_When_Titlecased': Derived Property */ +static const OnigCodePoint CR_Changes_When_Titlecased[] = { + 608, 0x0061, 0x007a, 0x00b5, 0x00b5, 0x00df, 0x00f6, 0x00f8, + 0x00ff, 0x0101, 0x0101, 0x0103, 0x0103, 0x0105, 0x0105, 0x0107, + 0x0107, 0x0109, 0x0109, 0x010b, 0x010b, 0x010d, 0x010d, 0x010f, + 0x010f, 0x0111, 0x0111, 0x0113, 0x0113, 0x0115, 0x0115, 0x0117, + 0x0117, 0x0119, 0x0119, 0x011b, 0x011b, 0x011d, 0x011d, 0x011f, + 0x011f, 0x0121, 0x0121, 0x0123, 0x0123, 0x0125, 0x0125, 0x0127, + 0x0127, 0x0129, 0x0129, 0x012b, 0x012b, 0x012d, 0x012d, 0x012f, + 0x012f, 0x0131, 0x0131, 0x0133, 0x0133, 0x0135, 0x0135, 0x0137, + 0x0137, 0x013a, 0x013a, 0x013c, 0x013c, 0x013e, 0x013e, 0x0140, + 0x0140, 0x0142, 0x0142, 0x0144, 0x0144, 0x0146, 0x0146, 0x0148, + 0x0149, 0x014b, 0x014b, 0x014d, 0x014d, 0x014f, 0x014f, 0x0151, + 0x0151, 0x0153, 0x0153, 0x0155, 0x0155, 0x0157, 0x0157, 0x0159, + 0x0159, 0x015b, 0x015b, 0x015d, 0x015d, 0x015f, 0x015f, 0x0161, + 0x0161, 0x0163, 0x0163, 0x0165, 0x0165, 0x0167, 0x0167, 0x0169, + 0x0169, 0x016b, 0x016b, 0x016d, 0x016d, 0x016f, 0x016f, 0x0171, + 0x0171, 0x0173, 0x0173, 0x0175, 0x0175, 0x0177, 0x0177, 0x017a, + 0x017a, 0x017c, 0x017c, 0x017e, 0x0180, 0x0183, 0x0183, 0x0185, + 0x0185, 0x0188, 0x0188, 0x018c, 0x018c, 0x0192, 0x0192, 0x0195, + 0x0195, 0x0199, 0x019a, 0x019e, 0x019e, 0x01a1, 0x01a1, 0x01a3, + 0x01a3, 0x01a5, 0x01a5, 0x01a8, 0x01a8, 0x01ad, 0x01ad, 0x01b0, + 0x01b0, 0x01b4, 0x01b4, 0x01b6, 0x01b6, 0x01b9, 0x01b9, 0x01bd, + 0x01bd, 0x01bf, 0x01bf, 0x01c4, 0x01c4, 0x01c6, 0x01c7, 0x01c9, + 0x01ca, 0x01cc, 0x01cc, 0x01ce, 0x01ce, 0x01d0, 0x01d0, 0x01d2, + 0x01d2, 0x01d4, 0x01d4, 0x01d6, 0x01d6, 0x01d8, 0x01d8, 0x01da, + 0x01da, 0x01dc, 0x01dd, 0x01df, 0x01df, 0x01e1, 0x01e1, 0x01e3, + 0x01e3, 0x01e5, 0x01e5, 0x01e7, 0x01e7, 0x01e9, 0x01e9, 0x01eb, + 0x01eb, 0x01ed, 0x01ed, 0x01ef, 0x01f1, 0x01f3, 0x01f3, 0x01f5, + 0x01f5, 0x01f9, 0x01f9, 0x01fb, 0x01fb, 0x01fd, 0x01fd, 0x01ff, + 0x01ff, 0x0201, 0x0201, 0x0203, 0x0203, 0x0205, 0x0205, 0x0207, + 0x0207, 0x0209, 0x0209, 0x020b, 0x020b, 0x020d, 0x020d, 0x020f, + 0x020f, 0x0211, 0x0211, 0x0213, 0x0213, 0x0215, 0x0215, 0x0217, + 0x0217, 0x0219, 0x0219, 0x021b, 0x021b, 0x021d, 0x021d, 0x021f, + 0x021f, 0x0223, 0x0223, 0x0225, 0x0225, 0x0227, 0x0227, 0x0229, + 0x0229, 0x022b, 0x022b, 0x022d, 0x022d, 0x022f, 0x022f, 0x0231, + 0x0231, 0x0233, 0x0233, 0x023c, 0x023c, 0x023f, 0x0240, 0x0242, + 0x0242, 0x0247, 0x0247, 0x0249, 0x0249, 0x024b, 0x024b, 0x024d, + 0x024d, 0x024f, 0x0254, 0x0256, 0x0257, 0x0259, 0x0259, 0x025b, + 0x025c, 0x0260, 0x0261, 0x0263, 0x0263, 0x0265, 0x0266, 0x0268, + 0x026c, 0x026f, 0x026f, 0x0271, 0x0272, 0x0275, 0x0275, 0x027d, + 0x027d, 0x0280, 0x0280, 0x0283, 0x0283, 0x0287, 0x028c, 0x0292, + 0x0292, 0x029d, 0x029e, 0x0345, 0x0345, 0x0371, 0x0371, 0x0373, + 0x0373, 0x0377, 0x0377, 0x037b, 0x037d, 0x0390, 0x0390, 0x03ac, + 0x03ce, 0x03d0, 0x03d1, 0x03d5, 0x03d7, 0x03d9, 0x03d9, 0x03db, + 0x03db, 0x03dd, 0x03dd, 0x03df, 0x03df, 0x03e1, 0x03e1, 0x03e3, + 0x03e3, 0x03e5, 0x03e5, 0x03e7, 0x03e7, 0x03e9, 0x03e9, 0x03eb, + 0x03eb, 0x03ed, 0x03ed, 0x03ef, 0x03f3, 0x03f5, 0x03f5, 0x03f8, + 0x03f8, 0x03fb, 0x03fb, 0x0430, 0x045f, 0x0461, 0x0461, 0x0463, + 0x0463, 0x0465, 0x0465, 0x0467, 0x0467, 0x0469, 0x0469, 0x046b, + 0x046b, 0x046d, 0x046d, 0x046f, 0x046f, 0x0471, 0x0471, 0x0473, + 0x0473, 0x0475, 0x0475, 0x0477, 0x0477, 0x0479, 0x0479, 0x047b, + 0x047b, 0x047d, 0x047d, 0x047f, 0x047f, 0x0481, 0x0481, 0x048b, + 0x048b, 0x048d, 0x048d, 0x048f, 0x048f, 0x0491, 0x0491, 0x0493, + 0x0493, 0x0495, 0x0495, 0x0497, 0x0497, 0x0499, 0x0499, 0x049b, + 0x049b, 0x049d, 0x049d, 0x049f, 0x049f, 0x04a1, 0x04a1, 0x04a3, + 0x04a3, 0x04a5, 0x04a5, 0x04a7, 0x04a7, 0x04a9, 0x04a9, 0x04ab, + 0x04ab, 0x04ad, 0x04ad, 0x04af, 0x04af, 0x04b1, 0x04b1, 0x04b3, + 0x04b3, 0x04b5, 0x04b5, 0x04b7, 0x04b7, 0x04b9, 0x04b9, 0x04bb, + 0x04bb, 0x04bd, 0x04bd, 0x04bf, 0x04bf, 0x04c2, 0x04c2, 0x04c4, + 0x04c4, 0x04c6, 0x04c6, 0x04c8, 0x04c8, 0x04ca, 0x04ca, 0x04cc, + 0x04cc, 0x04ce, 0x04cf, 0x04d1, 0x04d1, 0x04d3, 0x04d3, 0x04d5, + 0x04d5, 0x04d7, 0x04d7, 0x04d9, 0x04d9, 0x04db, 0x04db, 0x04dd, + 0x04dd, 0x04df, 0x04df, 0x04e1, 0x04e1, 0x04e3, 0x04e3, 0x04e5, + 0x04e5, 0x04e7, 0x04e7, 0x04e9, 0x04e9, 0x04eb, 0x04eb, 0x04ed, + 0x04ed, 0x04ef, 0x04ef, 0x04f1, 0x04f1, 0x04f3, 0x04f3, 0x04f5, + 0x04f5, 0x04f7, 0x04f7, 0x04f9, 0x04f9, 0x04fb, 0x04fb, 0x04fd, + 0x04fd, 0x04ff, 0x04ff, 0x0501, 0x0501, 0x0503, 0x0503, 0x0505, + 0x0505, 0x0507, 0x0507, 0x0509, 0x0509, 0x050b, 0x050b, 0x050d, + 0x050d, 0x050f, 0x050f, 0x0511, 0x0511, 0x0513, 0x0513, 0x0515, + 0x0515, 0x0517, 0x0517, 0x0519, 0x0519, 0x051b, 0x051b, 0x051d, + 0x051d, 0x051f, 0x051f, 0x0521, 0x0521, 0x0523, 0x0523, 0x0525, + 0x0525, 0x0527, 0x0527, 0x0529, 0x0529, 0x052b, 0x052b, 0x052d, + 0x052d, 0x052f, 0x052f, 0x0561, 0x0587, 0x13f8, 0x13fd, 0x1c80, + 0x1c88, 0x1d79, 0x1d79, 0x1d7d, 0x1d7d, 0x1e01, 0x1e01, 0x1e03, + 0x1e03, 0x1e05, 0x1e05, 0x1e07, 0x1e07, 0x1e09, 0x1e09, 0x1e0b, + 0x1e0b, 0x1e0d, 0x1e0d, 0x1e0f, 0x1e0f, 0x1e11, 0x1e11, 0x1e13, + 0x1e13, 0x1e15, 0x1e15, 0x1e17, 0x1e17, 0x1e19, 0x1e19, 0x1e1b, + 0x1e1b, 0x1e1d, 0x1e1d, 0x1e1f, 0x1e1f, 0x1e21, 0x1e21, 0x1e23, + 0x1e23, 0x1e25, 0x1e25, 0x1e27, 0x1e27, 0x1e29, 0x1e29, 0x1e2b, + 0x1e2b, 0x1e2d, 0x1e2d, 0x1e2f, 0x1e2f, 0x1e31, 0x1e31, 0x1e33, + 0x1e33, 0x1e35, 0x1e35, 0x1e37, 0x1e37, 0x1e39, 0x1e39, 0x1e3b, + 0x1e3b, 0x1e3d, 0x1e3d, 0x1e3f, 0x1e3f, 0x1e41, 0x1e41, 0x1e43, + 0x1e43, 0x1e45, 0x1e45, 0x1e47, 0x1e47, 0x1e49, 0x1e49, 0x1e4b, + 0x1e4b, 0x1e4d, 0x1e4d, 0x1e4f, 0x1e4f, 0x1e51, 0x1e51, 0x1e53, + 0x1e53, 0x1e55, 0x1e55, 0x1e57, 0x1e57, 0x1e59, 0x1e59, 0x1e5b, + 0x1e5b, 0x1e5d, 0x1e5d, 0x1e5f, 0x1e5f, 0x1e61, 0x1e61, 0x1e63, + 0x1e63, 0x1e65, 0x1e65, 0x1e67, 0x1e67, 0x1e69, 0x1e69, 0x1e6b, + 0x1e6b, 0x1e6d, 0x1e6d, 0x1e6f, 0x1e6f, 0x1e71, 0x1e71, 0x1e73, + 0x1e73, 0x1e75, 0x1e75, 0x1e77, 0x1e77, 0x1e79, 0x1e79, 0x1e7b, + 0x1e7b, 0x1e7d, 0x1e7d, 0x1e7f, 0x1e7f, 0x1e81, 0x1e81, 0x1e83, + 0x1e83, 0x1e85, 0x1e85, 0x1e87, 0x1e87, 0x1e89, 0x1e89, 0x1e8b, + 0x1e8b, 0x1e8d, 0x1e8d, 0x1e8f, 0x1e8f, 0x1e91, 0x1e91, 0x1e93, + 0x1e93, 0x1e95, 0x1e9b, 0x1ea1, 0x1ea1, 0x1ea3, 0x1ea3, 0x1ea5, + 0x1ea5, 0x1ea7, 0x1ea7, 0x1ea9, 0x1ea9, 0x1eab, 0x1eab, 0x1ead, + 0x1ead, 0x1eaf, 0x1eaf, 0x1eb1, 0x1eb1, 0x1eb3, 0x1eb3, 0x1eb5, + 0x1eb5, 0x1eb7, 0x1eb7, 0x1eb9, 0x1eb9, 0x1ebb, 0x1ebb, 0x1ebd, + 0x1ebd, 0x1ebf, 0x1ebf, 0x1ec1, 0x1ec1, 0x1ec3, 0x1ec3, 0x1ec5, + 0x1ec5, 0x1ec7, 0x1ec7, 0x1ec9, 0x1ec9, 0x1ecb, 0x1ecb, 0x1ecd, + 0x1ecd, 0x1ecf, 0x1ecf, 0x1ed1, 0x1ed1, 0x1ed3, 0x1ed3, 0x1ed5, + 0x1ed5, 0x1ed7, 0x1ed7, 0x1ed9, 0x1ed9, 0x1edb, 0x1edb, 0x1edd, + 0x1edd, 0x1edf, 0x1edf, 0x1ee1, 0x1ee1, 0x1ee3, 0x1ee3, 0x1ee5, + 0x1ee5, 0x1ee7, 0x1ee7, 0x1ee9, 0x1ee9, 0x1eeb, 0x1eeb, 0x1eed, + 0x1eed, 0x1eef, 0x1eef, 0x1ef1, 0x1ef1, 0x1ef3, 0x1ef3, 0x1ef5, + 0x1ef5, 0x1ef7, 0x1ef7, 0x1ef9, 0x1ef9, 0x1efb, 0x1efb, 0x1efd, + 0x1efd, 0x1eff, 0x1f07, 0x1f10, 0x1f15, 0x1f20, 0x1f27, 0x1f30, + 0x1f37, 0x1f40, 0x1f45, 0x1f50, 0x1f57, 0x1f60, 0x1f67, 0x1f70, + 0x1f7d, 0x1f80, 0x1f87, 0x1f90, 0x1f97, 0x1fa0, 0x1fa7, 0x1fb0, + 0x1fb4, 0x1fb6, 0x1fb7, 0x1fbe, 0x1fbe, 0x1fc2, 0x1fc4, 0x1fc6, + 0x1fc7, 0x1fd0, 0x1fd3, 0x1fd6, 0x1fd7, 0x1fe0, 0x1fe7, 0x1ff2, + 0x1ff4, 0x1ff6, 0x1ff7, 0x214e, 0x214e, 0x2170, 0x217f, 0x2184, + 0x2184, 0x24d0, 0x24e9, 0x2c30, 0x2c5e, 0x2c61, 0x2c61, 0x2c65, + 0x2c66, 0x2c68, 0x2c68, 0x2c6a, 0x2c6a, 0x2c6c, 0x2c6c, 0x2c73, + 0x2c73, 0x2c76, 0x2c76, 0x2c81, 0x2c81, 0x2c83, 0x2c83, 0x2c85, + 0x2c85, 0x2c87, 0x2c87, 0x2c89, 0x2c89, 0x2c8b, 0x2c8b, 0x2c8d, + 0x2c8d, 0x2c8f, 0x2c8f, 0x2c91, 0x2c91, 0x2c93, 0x2c93, 0x2c95, + 0x2c95, 0x2c97, 0x2c97, 0x2c99, 0x2c99, 0x2c9b, 0x2c9b, 0x2c9d, + 0x2c9d, 0x2c9f, 0x2c9f, 0x2ca1, 0x2ca1, 0x2ca3, 0x2ca3, 0x2ca5, + 0x2ca5, 0x2ca7, 0x2ca7, 0x2ca9, 0x2ca9, 0x2cab, 0x2cab, 0x2cad, + 0x2cad, 0x2caf, 0x2caf, 0x2cb1, 0x2cb1, 0x2cb3, 0x2cb3, 0x2cb5, + 0x2cb5, 0x2cb7, 0x2cb7, 0x2cb9, 0x2cb9, 0x2cbb, 0x2cbb, 0x2cbd, + 0x2cbd, 0x2cbf, 0x2cbf, 0x2cc1, 0x2cc1, 0x2cc3, 0x2cc3, 0x2cc5, + 0x2cc5, 0x2cc7, 0x2cc7, 0x2cc9, 0x2cc9, 0x2ccb, 0x2ccb, 0x2ccd, + 0x2ccd, 0x2ccf, 0x2ccf, 0x2cd1, 0x2cd1, 0x2cd3, 0x2cd3, 0x2cd5, + 0x2cd5, 0x2cd7, 0x2cd7, 0x2cd9, 0x2cd9, 0x2cdb, 0x2cdb, 0x2cdd, + 0x2cdd, 0x2cdf, 0x2cdf, 0x2ce1, 0x2ce1, 0x2ce3, 0x2ce3, 0x2cec, + 0x2cec, 0x2cee, 0x2cee, 0x2cf3, 0x2cf3, 0x2d00, 0x2d25, 0x2d27, + 0x2d27, 0x2d2d, 0x2d2d, 0xa641, 0xa641, 0xa643, 0xa643, 0xa645, + 0xa645, 0xa647, 0xa647, 0xa649, 0xa649, 0xa64b, 0xa64b, 0xa64d, + 0xa64d, 0xa64f, 0xa64f, 0xa651, 0xa651, 0xa653, 0xa653, 0xa655, + 0xa655, 0xa657, 0xa657, 0xa659, 0xa659, 0xa65b, 0xa65b, 0xa65d, + 0xa65d, 0xa65f, 0xa65f, 0xa661, 0xa661, 0xa663, 0xa663, 0xa665, + 0xa665, 0xa667, 0xa667, 0xa669, 0xa669, 0xa66b, 0xa66b, 0xa66d, + 0xa66d, 0xa681, 0xa681, 0xa683, 0xa683, 0xa685, 0xa685, 0xa687, + 0xa687, 0xa689, 0xa689, 0xa68b, 0xa68b, 0xa68d, 0xa68d, 0xa68f, + 0xa68f, 0xa691, 0xa691, 0xa693, 0xa693, 0xa695, 0xa695, 0xa697, + 0xa697, 0xa699, 0xa699, 0xa69b, 0xa69b, 0xa723, 0xa723, 0xa725, + 0xa725, 0xa727, 0xa727, 0xa729, 0xa729, 0xa72b, 0xa72b, 0xa72d, + 0xa72d, 0xa72f, 0xa72f, 0xa733, 0xa733, 0xa735, 0xa735, 0xa737, + 0xa737, 0xa739, 0xa739, 0xa73b, 0xa73b, 0xa73d, 0xa73d, 0xa73f, + 0xa73f, 0xa741, 0xa741, 0xa743, 0xa743, 0xa745, 0xa745, 0xa747, + 0xa747, 0xa749, 0xa749, 0xa74b, 0xa74b, 0xa74d, 0xa74d, 0xa74f, + 0xa74f, 0xa751, 0xa751, 0xa753, 0xa753, 0xa755, 0xa755, 0xa757, + 0xa757, 0xa759, 0xa759, 0xa75b, 0xa75b, 0xa75d, 0xa75d, 0xa75f, + 0xa75f, 0xa761, 0xa761, 0xa763, 0xa763, 0xa765, 0xa765, 0xa767, + 0xa767, 0xa769, 0xa769, 0xa76b, 0xa76b, 0xa76d, 0xa76d, 0xa76f, + 0xa76f, 0xa77a, 0xa77a, 0xa77c, 0xa77c, 0xa77f, 0xa77f, 0xa781, + 0xa781, 0xa783, 0xa783, 0xa785, 0xa785, 0xa787, 0xa787, 0xa78c, + 0xa78c, 0xa791, 0xa791, 0xa793, 0xa793, 0xa797, 0xa797, 0xa799, + 0xa799, 0xa79b, 0xa79b, 0xa79d, 0xa79d, 0xa79f, 0xa79f, 0xa7a1, + 0xa7a1, 0xa7a3, 0xa7a3, 0xa7a5, 0xa7a5, 0xa7a7, 0xa7a7, 0xa7a9, + 0xa7a9, 0xa7b5, 0xa7b5, 0xa7b7, 0xa7b7, 0xab53, 0xab53, 0xab70, + 0xabbf, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xff41, 0xff5a, 0x10428, + 0x1044f, 0x104d8, 0x104fb, 0x10cc0, 0x10cf2, 0x118c0, 0x118df, 0x1e922, + 0x1e943, +}; /* CR_Changes_When_Titlecased */ + +/* 'Changes_When_Casefolded': Derived Property */ +static const OnigCodePoint CR_Changes_When_Casefolded[] = { + 603, 0x0041, 0x005a, 0x00b5, 0x00b5, 0x00c0, 0x00d6, 0x00d8, + 0x00df, 0x0100, 0x0100, 0x0102, 0x0102, 0x0104, 0x0104, 0x0106, + 0x0106, 0x0108, 0x0108, 0x010a, 0x010a, 0x010c, 0x010c, 0x010e, + 0x010e, 0x0110, 0x0110, 0x0112, 0x0112, 0x0114, 0x0114, 0x0116, + 0x0116, 0x0118, 0x0118, 0x011a, 0x011a, 0x011c, 0x011c, 0x011e, + 0x011e, 0x0120, 0x0120, 0x0122, 0x0122, 0x0124, 0x0124, 0x0126, + 0x0126, 0x0128, 0x0128, 0x012a, 0x012a, 0x012c, 0x012c, 0x012e, + 0x012e, 0x0130, 0x0130, 0x0132, 0x0132, 0x0134, 0x0134, 0x0136, + 0x0136, 0x0139, 0x0139, 0x013b, 0x013b, 0x013d, 0x013d, 0x013f, + 0x013f, 0x0141, 0x0141, 0x0143, 0x0143, 0x0145, 0x0145, 0x0147, + 0x0147, 0x0149, 0x014a, 0x014c, 0x014c, 0x014e, 0x014e, 0x0150, + 0x0150, 0x0152, 0x0152, 0x0154, 0x0154, 0x0156, 0x0156, 0x0158, + 0x0158, 0x015a, 0x015a, 0x015c, 0x015c, 0x015e, 0x015e, 0x0160, + 0x0160, 0x0162, 0x0162, 0x0164, 0x0164, 0x0166, 0x0166, 0x0168, + 0x0168, 0x016a, 0x016a, 0x016c, 0x016c, 0x016e, 0x016e, 0x0170, + 0x0170, 0x0172, 0x0172, 0x0174, 0x0174, 0x0176, 0x0176, 0x0178, + 0x0179, 0x017b, 0x017b, 0x017d, 0x017d, 0x017f, 0x017f, 0x0181, + 0x0182, 0x0184, 0x0184, 0x0186, 0x0187, 0x0189, 0x018b, 0x018e, + 0x0191, 0x0193, 0x0194, 0x0196, 0x0198, 0x019c, 0x019d, 0x019f, + 0x01a0, 0x01a2, 0x01a2, 0x01a4, 0x01a4, 0x01a6, 0x01a7, 0x01a9, + 0x01a9, 0x01ac, 0x01ac, 0x01ae, 0x01af, 0x01b1, 0x01b3, 0x01b5, + 0x01b5, 0x01b7, 0x01b8, 0x01bc, 0x01bc, 0x01c4, 0x01c5, 0x01c7, + 0x01c8, 0x01ca, 0x01cb, 0x01cd, 0x01cd, 0x01cf, 0x01cf, 0x01d1, + 0x01d1, 0x01d3, 0x01d3, 0x01d5, 0x01d5, 0x01d7, 0x01d7, 0x01d9, + 0x01d9, 0x01db, 0x01db, 0x01de, 0x01de, 0x01e0, 0x01e0, 0x01e2, + 0x01e2, 0x01e4, 0x01e4, 0x01e6, 0x01e6, 0x01e8, 0x01e8, 0x01ea, + 0x01ea, 0x01ec, 0x01ec, 0x01ee, 0x01ee, 0x01f1, 0x01f2, 0x01f4, + 0x01f4, 0x01f6, 0x01f8, 0x01fa, 0x01fa, 0x01fc, 0x01fc, 0x01fe, + 0x01fe, 0x0200, 0x0200, 0x0202, 0x0202, 0x0204, 0x0204, 0x0206, + 0x0206, 0x0208, 0x0208, 0x020a, 0x020a, 0x020c, 0x020c, 0x020e, + 0x020e, 0x0210, 0x0210, 0x0212, 0x0212, 0x0214, 0x0214, 0x0216, + 0x0216, 0x0218, 0x0218, 0x021a, 0x021a, 0x021c, 0x021c, 0x021e, + 0x021e, 0x0220, 0x0220, 0x0222, 0x0222, 0x0224, 0x0224, 0x0226, + 0x0226, 0x0228, 0x0228, 0x022a, 0x022a, 0x022c, 0x022c, 0x022e, + 0x022e, 0x0230, 0x0230, 0x0232, 0x0232, 0x023a, 0x023b, 0x023d, + 0x023e, 0x0241, 0x0241, 0x0243, 0x0246, 0x0248, 0x0248, 0x024a, + 0x024a, 0x024c, 0x024c, 0x024e, 0x024e, 0x0345, 0x0345, 0x0370, + 0x0370, 0x0372, 0x0372, 0x0376, 0x0376, 0x037f, 0x037f, 0x0386, + 0x0386, 0x0388, 0x038a, 0x038c, 0x038c, 0x038e, 0x038f, 0x0391, + 0x03a1, 0x03a3, 0x03ab, 0x03c2, 0x03c2, 0x03cf, 0x03d1, 0x03d5, + 0x03d6, 0x03d8, 0x03d8, 0x03da, 0x03da, 0x03dc, 0x03dc, 0x03de, + 0x03de, 0x03e0, 0x03e0, 0x03e2, 0x03e2, 0x03e4, 0x03e4, 0x03e6, + 0x03e6, 0x03e8, 0x03e8, 0x03ea, 0x03ea, 0x03ec, 0x03ec, 0x03ee, + 0x03ee, 0x03f0, 0x03f1, 0x03f4, 0x03f5, 0x03f7, 0x03f7, 0x03f9, + 0x03fa, 0x03fd, 0x042f, 0x0460, 0x0460, 0x0462, 0x0462, 0x0464, + 0x0464, 0x0466, 0x0466, 0x0468, 0x0468, 0x046a, 0x046a, 0x046c, + 0x046c, 0x046e, 0x046e, 0x0470, 0x0470, 0x0472, 0x0472, 0x0474, + 0x0474, 0x0476, 0x0476, 0x0478, 0x0478, 0x047a, 0x047a, 0x047c, + 0x047c, 0x047e, 0x047e, 0x0480, 0x0480, 0x048a, 0x048a, 0x048c, + 0x048c, 0x048e, 0x048e, 0x0490, 0x0490, 0x0492, 0x0492, 0x0494, + 0x0494, 0x0496, 0x0496, 0x0498, 0x0498, 0x049a, 0x049a, 0x049c, + 0x049c, 0x049e, 0x049e, 0x04a0, 0x04a0, 0x04a2, 0x04a2, 0x04a4, + 0x04a4, 0x04a6, 0x04a6, 0x04a8, 0x04a8, 0x04aa, 0x04aa, 0x04ac, + 0x04ac, 0x04ae, 0x04ae, 0x04b0, 0x04b0, 0x04b2, 0x04b2, 0x04b4, + 0x04b4, 0x04b6, 0x04b6, 0x04b8, 0x04b8, 0x04ba, 0x04ba, 0x04bc, + 0x04bc, 0x04be, 0x04be, 0x04c0, 0x04c1, 0x04c3, 0x04c3, 0x04c5, + 0x04c5, 0x04c7, 0x04c7, 0x04c9, 0x04c9, 0x04cb, 0x04cb, 0x04cd, + 0x04cd, 0x04d0, 0x04d0, 0x04d2, 0x04d2, 0x04d4, 0x04d4, 0x04d6, + 0x04d6, 0x04d8, 0x04d8, 0x04da, 0x04da, 0x04dc, 0x04dc, 0x04de, + 0x04de, 0x04e0, 0x04e0, 0x04e2, 0x04e2, 0x04e4, 0x04e4, 0x04e6, + 0x04e6, 0x04e8, 0x04e8, 0x04ea, 0x04ea, 0x04ec, 0x04ec, 0x04ee, + 0x04ee, 0x04f0, 0x04f0, 0x04f2, 0x04f2, 0x04f4, 0x04f4, 0x04f6, + 0x04f6, 0x04f8, 0x04f8, 0x04fa, 0x04fa, 0x04fc, 0x04fc, 0x04fe, + 0x04fe, 0x0500, 0x0500, 0x0502, 0x0502, 0x0504, 0x0504, 0x0506, + 0x0506, 0x0508, 0x0508, 0x050a, 0x050a, 0x050c, 0x050c, 0x050e, + 0x050e, 0x0510, 0x0510, 0x0512, 0x0512, 0x0514, 0x0514, 0x0516, + 0x0516, 0x0518, 0x0518, 0x051a, 0x051a, 0x051c, 0x051c, 0x051e, + 0x051e, 0x0520, 0x0520, 0x0522, 0x0522, 0x0524, 0x0524, 0x0526, + 0x0526, 0x0528, 0x0528, 0x052a, 0x052a, 0x052c, 0x052c, 0x052e, + 0x052e, 0x0531, 0x0556, 0x0587, 0x0587, 0x10a0, 0x10c5, 0x10c7, + 0x10c7, 0x10cd, 0x10cd, 0x13f8, 0x13fd, 0x1c80, 0x1c88, 0x1e00, + 0x1e00, 0x1e02, 0x1e02, 0x1e04, 0x1e04, 0x1e06, 0x1e06, 0x1e08, + 0x1e08, 0x1e0a, 0x1e0a, 0x1e0c, 0x1e0c, 0x1e0e, 0x1e0e, 0x1e10, + 0x1e10, 0x1e12, 0x1e12, 0x1e14, 0x1e14, 0x1e16, 0x1e16, 0x1e18, + 0x1e18, 0x1e1a, 0x1e1a, 0x1e1c, 0x1e1c, 0x1e1e, 0x1e1e, 0x1e20, + 0x1e20, 0x1e22, 0x1e22, 0x1e24, 0x1e24, 0x1e26, 0x1e26, 0x1e28, + 0x1e28, 0x1e2a, 0x1e2a, 0x1e2c, 0x1e2c, 0x1e2e, 0x1e2e, 0x1e30, + 0x1e30, 0x1e32, 0x1e32, 0x1e34, 0x1e34, 0x1e36, 0x1e36, 0x1e38, + 0x1e38, 0x1e3a, 0x1e3a, 0x1e3c, 0x1e3c, 0x1e3e, 0x1e3e, 0x1e40, + 0x1e40, 0x1e42, 0x1e42, 0x1e44, 0x1e44, 0x1e46, 0x1e46, 0x1e48, + 0x1e48, 0x1e4a, 0x1e4a, 0x1e4c, 0x1e4c, 0x1e4e, 0x1e4e, 0x1e50, + 0x1e50, 0x1e52, 0x1e52, 0x1e54, 0x1e54, 0x1e56, 0x1e56, 0x1e58, + 0x1e58, 0x1e5a, 0x1e5a, 0x1e5c, 0x1e5c, 0x1e5e, 0x1e5e, 0x1e60, + 0x1e60, 0x1e62, 0x1e62, 0x1e64, 0x1e64, 0x1e66, 0x1e66, 0x1e68, + 0x1e68, 0x1e6a, 0x1e6a, 0x1e6c, 0x1e6c, 0x1e6e, 0x1e6e, 0x1e70, + 0x1e70, 0x1e72, 0x1e72, 0x1e74, 0x1e74, 0x1e76, 0x1e76, 0x1e78, + 0x1e78, 0x1e7a, 0x1e7a, 0x1e7c, 0x1e7c, 0x1e7e, 0x1e7e, 0x1e80, + 0x1e80, 0x1e82, 0x1e82, 0x1e84, 0x1e84, 0x1e86, 0x1e86, 0x1e88, + 0x1e88, 0x1e8a, 0x1e8a, 0x1e8c, 0x1e8c, 0x1e8e, 0x1e8e, 0x1e90, + 0x1e90, 0x1e92, 0x1e92, 0x1e94, 0x1e94, 0x1e9a, 0x1e9b, 0x1e9e, + 0x1e9e, 0x1ea0, 0x1ea0, 0x1ea2, 0x1ea2, 0x1ea4, 0x1ea4, 0x1ea6, + 0x1ea6, 0x1ea8, 0x1ea8, 0x1eaa, 0x1eaa, 0x1eac, 0x1eac, 0x1eae, + 0x1eae, 0x1eb0, 0x1eb0, 0x1eb2, 0x1eb2, 0x1eb4, 0x1eb4, 0x1eb6, + 0x1eb6, 0x1eb8, 0x1eb8, 0x1eba, 0x1eba, 0x1ebc, 0x1ebc, 0x1ebe, + 0x1ebe, 0x1ec0, 0x1ec0, 0x1ec2, 0x1ec2, 0x1ec4, 0x1ec4, 0x1ec6, + 0x1ec6, 0x1ec8, 0x1ec8, 0x1eca, 0x1eca, 0x1ecc, 0x1ecc, 0x1ece, + 0x1ece, 0x1ed0, 0x1ed0, 0x1ed2, 0x1ed2, 0x1ed4, 0x1ed4, 0x1ed6, + 0x1ed6, 0x1ed8, 0x1ed8, 0x1eda, 0x1eda, 0x1edc, 0x1edc, 0x1ede, + 0x1ede, 0x1ee0, 0x1ee0, 0x1ee2, 0x1ee2, 0x1ee4, 0x1ee4, 0x1ee6, + 0x1ee6, 0x1ee8, 0x1ee8, 0x1eea, 0x1eea, 0x1eec, 0x1eec, 0x1eee, + 0x1eee, 0x1ef0, 0x1ef0, 0x1ef2, 0x1ef2, 0x1ef4, 0x1ef4, 0x1ef6, + 0x1ef6, 0x1ef8, 0x1ef8, 0x1efa, 0x1efa, 0x1efc, 0x1efc, 0x1efe, + 0x1efe, 0x1f08, 0x1f0f, 0x1f18, 0x1f1d, 0x1f28, 0x1f2f, 0x1f38, + 0x1f3f, 0x1f48, 0x1f4d, 0x1f59, 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, + 0x1f5d, 0x1f5f, 0x1f5f, 0x1f68, 0x1f6f, 0x1f80, 0x1faf, 0x1fb2, + 0x1fb4, 0x1fb7, 0x1fbc, 0x1fc2, 0x1fc4, 0x1fc7, 0x1fcc, 0x1fd8, + 0x1fdb, 0x1fe8, 0x1fec, 0x1ff2, 0x1ff4, 0x1ff7, 0x1ffc, 0x2126, + 0x2126, 0x212a, 0x212b, 0x2132, 0x2132, 0x2160, 0x216f, 0x2183, + 0x2183, 0x24b6, 0x24cf, 0x2c00, 0x2c2e, 0x2c60, 0x2c60, 0x2c62, + 0x2c64, 0x2c67, 0x2c67, 0x2c69, 0x2c69, 0x2c6b, 0x2c6b, 0x2c6d, + 0x2c70, 0x2c72, 0x2c72, 0x2c75, 0x2c75, 0x2c7e, 0x2c80, 0x2c82, + 0x2c82, 0x2c84, 0x2c84, 0x2c86, 0x2c86, 0x2c88, 0x2c88, 0x2c8a, + 0x2c8a, 0x2c8c, 0x2c8c, 0x2c8e, 0x2c8e, 0x2c90, 0x2c90, 0x2c92, + 0x2c92, 0x2c94, 0x2c94, 0x2c96, 0x2c96, 0x2c98, 0x2c98, 0x2c9a, + 0x2c9a, 0x2c9c, 0x2c9c, 0x2c9e, 0x2c9e, 0x2ca0, 0x2ca0, 0x2ca2, + 0x2ca2, 0x2ca4, 0x2ca4, 0x2ca6, 0x2ca6, 0x2ca8, 0x2ca8, 0x2caa, + 0x2caa, 0x2cac, 0x2cac, 0x2cae, 0x2cae, 0x2cb0, 0x2cb0, 0x2cb2, + 0x2cb2, 0x2cb4, 0x2cb4, 0x2cb6, 0x2cb6, 0x2cb8, 0x2cb8, 0x2cba, + 0x2cba, 0x2cbc, 0x2cbc, 0x2cbe, 0x2cbe, 0x2cc0, 0x2cc0, 0x2cc2, + 0x2cc2, 0x2cc4, 0x2cc4, 0x2cc6, 0x2cc6, 0x2cc8, 0x2cc8, 0x2cca, + 0x2cca, 0x2ccc, 0x2ccc, 0x2cce, 0x2cce, 0x2cd0, 0x2cd0, 0x2cd2, + 0x2cd2, 0x2cd4, 0x2cd4, 0x2cd6, 0x2cd6, 0x2cd8, 0x2cd8, 0x2cda, + 0x2cda, 0x2cdc, 0x2cdc, 0x2cde, 0x2cde, 0x2ce0, 0x2ce0, 0x2ce2, + 0x2ce2, 0x2ceb, 0x2ceb, 0x2ced, 0x2ced, 0x2cf2, 0x2cf2, 0xa640, + 0xa640, 0xa642, 0xa642, 0xa644, 0xa644, 0xa646, 0xa646, 0xa648, + 0xa648, 0xa64a, 0xa64a, 0xa64c, 0xa64c, 0xa64e, 0xa64e, 0xa650, + 0xa650, 0xa652, 0xa652, 0xa654, 0xa654, 0xa656, 0xa656, 0xa658, + 0xa658, 0xa65a, 0xa65a, 0xa65c, 0xa65c, 0xa65e, 0xa65e, 0xa660, + 0xa660, 0xa662, 0xa662, 0xa664, 0xa664, 0xa666, 0xa666, 0xa668, + 0xa668, 0xa66a, 0xa66a, 0xa66c, 0xa66c, 0xa680, 0xa680, 0xa682, + 0xa682, 0xa684, 0xa684, 0xa686, 0xa686, 0xa688, 0xa688, 0xa68a, + 0xa68a, 0xa68c, 0xa68c, 0xa68e, 0xa68e, 0xa690, 0xa690, 0xa692, + 0xa692, 0xa694, 0xa694, 0xa696, 0xa696, 0xa698, 0xa698, 0xa69a, + 0xa69a, 0xa722, 0xa722, 0xa724, 0xa724, 0xa726, 0xa726, 0xa728, + 0xa728, 0xa72a, 0xa72a, 0xa72c, 0xa72c, 0xa72e, 0xa72e, 0xa732, + 0xa732, 0xa734, 0xa734, 0xa736, 0xa736, 0xa738, 0xa738, 0xa73a, + 0xa73a, 0xa73c, 0xa73c, 0xa73e, 0xa73e, 0xa740, 0xa740, 0xa742, + 0xa742, 0xa744, 0xa744, 0xa746, 0xa746, 0xa748, 0xa748, 0xa74a, + 0xa74a, 0xa74c, 0xa74c, 0xa74e, 0xa74e, 0xa750, 0xa750, 0xa752, + 0xa752, 0xa754, 0xa754, 0xa756, 0xa756, 0xa758, 0xa758, 0xa75a, + 0xa75a, 0xa75c, 0xa75c, 0xa75e, 0xa75e, 0xa760, 0xa760, 0xa762, + 0xa762, 0xa764, 0xa764, 0xa766, 0xa766, 0xa768, 0xa768, 0xa76a, + 0xa76a, 0xa76c, 0xa76c, 0xa76e, 0xa76e, 0xa779, 0xa779, 0xa77b, + 0xa77b, 0xa77d, 0xa77e, 0xa780, 0xa780, 0xa782, 0xa782, 0xa784, + 0xa784, 0xa786, 0xa786, 0xa78b, 0xa78b, 0xa78d, 0xa78d, 0xa790, + 0xa790, 0xa792, 0xa792, 0xa796, 0xa796, 0xa798, 0xa798, 0xa79a, + 0xa79a, 0xa79c, 0xa79c, 0xa79e, 0xa79e, 0xa7a0, 0xa7a0, 0xa7a2, + 0xa7a2, 0xa7a4, 0xa7a4, 0xa7a6, 0xa7a6, 0xa7a8, 0xa7a8, 0xa7aa, + 0xa7ae, 0xa7b0, 0xa7b4, 0xa7b6, 0xa7b6, 0xab70, 0xabbf, 0xfb00, + 0xfb06, 0xfb13, 0xfb17, 0xff21, 0xff3a, 0x10400, 0x10427, 0x104b0, + 0x104d3, 0x10c80, 0x10cb2, 0x118a0, 0x118bf, 0x1e900, 0x1e921, +}; /* CR_Changes_When_Casefolded */ + +/* 'Changes_When_Casemapped': Derived Property */ +static const OnigCodePoint CR_Changes_When_Casemapped[] = { + 116, 0x0041, 0x005a, 0x0061, 0x007a, 0x00b5, 0x00b5, 0x00c0, + 0x00d6, 0x00d8, 0x00f6, 0x00f8, 0x0137, 0x0139, 0x018c, 0x018e, + 0x019a, 0x019c, 0x01a9, 0x01ac, 0x01b9, 0x01bc, 0x01bd, 0x01bf, + 0x01bf, 0x01c4, 0x0220, 0x0222, 0x0233, 0x023a, 0x0254, 0x0256, + 0x0257, 0x0259, 0x0259, 0x025b, 0x025c, 0x0260, 0x0261, 0x0263, + 0x0263, 0x0265, 0x0266, 0x0268, 0x026c, 0x026f, 0x026f, 0x0271, + 0x0272, 0x0275, 0x0275, 0x027d, 0x027d, 0x0280, 0x0280, 0x0283, + 0x0283, 0x0287, 0x028c, 0x0292, 0x0292, 0x029d, 0x029e, 0x0345, + 0x0345, 0x0370, 0x0373, 0x0376, 0x0377, 0x037b, 0x037d, 0x037f, + 0x037f, 0x0386, 0x0386, 0x0388, 0x038a, 0x038c, 0x038c, 0x038e, + 0x03a1, 0x03a3, 0x03d1, 0x03d5, 0x03f5, 0x03f7, 0x03fb, 0x03fd, + 0x0481, 0x048a, 0x052f, 0x0531, 0x0556, 0x0561, 0x0587, 0x10a0, + 0x10c5, 0x10c7, 0x10c7, 0x10cd, 0x10cd, 0x13a0, 0x13f5, 0x13f8, + 0x13fd, 0x1c80, 0x1c88, 0x1d79, 0x1d79, 0x1d7d, 0x1d7d, 0x1e00, + 0x1e9b, 0x1e9e, 0x1e9e, 0x1ea0, 0x1f15, 0x1f18, 0x1f1d, 0x1f20, + 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, 0x1f59, 0x1f5b, + 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, + 0x1fbc, 0x1fbe, 0x1fbe, 0x1fc2, 0x1fc4, 0x1fc6, 0x1fcc, 0x1fd0, + 0x1fd3, 0x1fd6, 0x1fdb, 0x1fe0, 0x1fec, 0x1ff2, 0x1ff4, 0x1ff6, + 0x1ffc, 0x2126, 0x2126, 0x212a, 0x212b, 0x2132, 0x2132, 0x214e, + 0x214e, 0x2160, 0x217f, 0x2183, 0x2184, 0x24b6, 0x24e9, 0x2c00, + 0x2c2e, 0x2c30, 0x2c5e, 0x2c60, 0x2c70, 0x2c72, 0x2c73, 0x2c75, + 0x2c76, 0x2c7e, 0x2ce3, 0x2ceb, 0x2cee, 0x2cf2, 0x2cf3, 0x2d00, + 0x2d25, 0x2d27, 0x2d27, 0x2d2d, 0x2d2d, 0xa640, 0xa66d, 0xa680, + 0xa69b, 0xa722, 0xa72f, 0xa732, 0xa76f, 0xa779, 0xa787, 0xa78b, + 0xa78d, 0xa790, 0xa793, 0xa796, 0xa7ae, 0xa7b0, 0xa7b7, 0xab53, + 0xab53, 0xab70, 0xabbf, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xff21, + 0xff3a, 0xff41, 0xff5a, 0x10400, 0x1044f, 0x104b0, 0x104d3, 0x104d8, + 0x104fb, 0x10c80, 0x10cb2, 0x10cc0, 0x10cf2, 0x118a0, 0x118df, 0x1e900, + 0x1e943, +}; /* CR_Changes_When_Casemapped */ + +/* 'ID_Start': Derived Property */ +static const OnigCodePoint CR_ID_Start[] = { + 571, 0x0041, 0x005a, 0x0061, 0x007a, 0x00aa, 0x00aa, 0x00b5, + 0x00b5, 0x00ba, 0x00ba, 0x00c0, 0x00d6, 0x00d8, 0x00f6, 0x00f8, + 0x02c1, 0x02c6, 0x02d1, 0x02e0, 0x02e4, 0x02ec, 0x02ec, 0x02ee, + 0x02ee, 0x0370, 0x0374, 0x0376, 0x0377, 0x037a, 0x037d, 0x037f, + 0x037f, 0x0386, 0x0386, 0x0388, 0x038a, 0x038c, 0x038c, 0x038e, + 0x03a1, 0x03a3, 0x03f5, 0x03f7, 0x0481, 0x048a, 0x052f, 0x0531, + 0x0556, 0x0559, 0x0559, 0x0561, 0x0587, 0x05d0, 0x05ea, 0x05f0, + 0x05f2, 0x0620, 0x064a, 0x066e, 0x066f, 0x0671, 0x06d3, 0x06d5, + 0x06d5, 0x06e5, 0x06e6, 0x06ee, 0x06ef, 0x06fa, 0x06fc, 0x06ff, + 0x06ff, 0x0710, 0x0710, 0x0712, 0x072f, 0x074d, 0x07a5, 0x07b1, + 0x07b1, 0x07ca, 0x07ea, 0x07f4, 0x07f5, 0x07fa, 0x07fa, 0x0800, + 0x0815, 0x081a, 0x081a, 0x0824, 0x0824, 0x0828, 0x0828, 0x0840, + 0x0858, 0x08a0, 0x08b4, 0x08b6, 0x08bd, 0x0904, 0x0939, 0x093d, + 0x093d, 0x0950, 0x0950, 0x0958, 0x0961, 0x0971, 0x0980, 0x0985, + 0x098c, 0x098f, 0x0990, 0x0993, 0x09a8, 0x09aa, 0x09b0, 0x09b2, + 0x09b2, 0x09b6, 0x09b9, 0x09bd, 0x09bd, 0x09ce, 0x09ce, 0x09dc, + 0x09dd, 0x09df, 0x09e1, 0x09f0, 0x09f1, 0x0a05, 0x0a0a, 0x0a0f, + 0x0a10, 0x0a13, 0x0a28, 0x0a2a, 0x0a30, 0x0a32, 0x0a33, 0x0a35, + 0x0a36, 0x0a38, 0x0a39, 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a72, + 0x0a74, 0x0a85, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, + 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abd, 0x0abd, 0x0ad0, + 0x0ad0, 0x0ae0, 0x0ae1, 0x0af9, 0x0af9, 0x0b05, 0x0b0c, 0x0b0f, + 0x0b10, 0x0b13, 0x0b28, 0x0b2a, 0x0b30, 0x0b32, 0x0b33, 0x0b35, + 0x0b39, 0x0b3d, 0x0b3d, 0x0b5c, 0x0b5d, 0x0b5f, 0x0b61, 0x0b71, + 0x0b71, 0x0b83, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, + 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, + 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, 0x0bb9, 0x0bd0, 0x0bd0, 0x0c05, + 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, 0x0c28, 0x0c2a, 0x0c39, 0x0c3d, + 0x0c3d, 0x0c58, 0x0c5a, 0x0c60, 0x0c61, 0x0c80, 0x0c80, 0x0c85, + 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, + 0x0cb9, 0x0cbd, 0x0cbd, 0x0cde, 0x0cde, 0x0ce0, 0x0ce1, 0x0cf1, + 0x0cf2, 0x0d05, 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d3a, 0x0d3d, + 0x0d3d, 0x0d4e, 0x0d4e, 0x0d54, 0x0d56, 0x0d5f, 0x0d61, 0x0d7a, + 0x0d7f, 0x0d85, 0x0d96, 0x0d9a, 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, + 0x0dbd, 0x0dc0, 0x0dc6, 0x0e01, 0x0e30, 0x0e32, 0x0e33, 0x0e40, + 0x0e46, 0x0e81, 0x0e82, 0x0e84, 0x0e84, 0x0e87, 0x0e88, 0x0e8a, + 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, + 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, + 0x0eb0, 0x0eb2, 0x0eb3, 0x0ebd, 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, + 0x0ec6, 0x0edc, 0x0edf, 0x0f00, 0x0f00, 0x0f40, 0x0f47, 0x0f49, + 0x0f6c, 0x0f88, 0x0f8c, 0x1000, 0x102a, 0x103f, 0x103f, 0x1050, + 0x1055, 0x105a, 0x105d, 0x1061, 0x1061, 0x1065, 0x1066, 0x106e, + 0x1070, 0x1075, 0x1081, 0x108e, 0x108e, 0x10a0, 0x10c5, 0x10c7, + 0x10c7, 0x10cd, 0x10cd, 0x10d0, 0x10fa, 0x10fc, 0x1248, 0x124a, + 0x124d, 0x1250, 0x1256, 0x1258, 0x1258, 0x125a, 0x125d, 0x1260, + 0x1288, 0x128a, 0x128d, 0x1290, 0x12b0, 0x12b2, 0x12b5, 0x12b8, + 0x12be, 0x12c0, 0x12c0, 0x12c2, 0x12c5, 0x12c8, 0x12d6, 0x12d8, + 0x1310, 0x1312, 0x1315, 0x1318, 0x135a, 0x1380, 0x138f, 0x13a0, + 0x13f5, 0x13f8, 0x13fd, 0x1401, 0x166c, 0x166f, 0x167f, 0x1681, + 0x169a, 0x16a0, 0x16ea, 0x16ee, 0x16f8, 0x1700, 0x170c, 0x170e, + 0x1711, 0x1720, 0x1731, 0x1740, 0x1751, 0x1760, 0x176c, 0x176e, + 0x1770, 0x1780, 0x17b3, 0x17d7, 0x17d7, 0x17dc, 0x17dc, 0x1820, + 0x1877, 0x1880, 0x18a8, 0x18aa, 0x18aa, 0x18b0, 0x18f5, 0x1900, + 0x191e, 0x1950, 0x196d, 0x1970, 0x1974, 0x1980, 0x19ab, 0x19b0, + 0x19c9, 0x1a00, 0x1a16, 0x1a20, 0x1a54, 0x1aa7, 0x1aa7, 0x1b05, + 0x1b33, 0x1b45, 0x1b4b, 0x1b83, 0x1ba0, 0x1bae, 0x1baf, 0x1bba, + 0x1be5, 0x1c00, 0x1c23, 0x1c4d, 0x1c4f, 0x1c5a, 0x1c7d, 0x1c80, + 0x1c88, 0x1ce9, 0x1cec, 0x1cee, 0x1cf1, 0x1cf5, 0x1cf6, 0x1d00, + 0x1dbf, 0x1e00, 0x1f15, 0x1f18, 0x1f1d, 0x1f20, 0x1f45, 0x1f48, + 0x1f4d, 0x1f50, 0x1f57, 0x1f59, 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, + 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, 0x1fbc, 0x1fbe, + 0x1fbe, 0x1fc2, 0x1fc4, 0x1fc6, 0x1fcc, 0x1fd0, 0x1fd3, 0x1fd6, + 0x1fdb, 0x1fe0, 0x1fec, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ffc, 0x2071, + 0x2071, 0x207f, 0x207f, 0x2090, 0x209c, 0x2102, 0x2102, 0x2107, + 0x2107, 0x210a, 0x2113, 0x2115, 0x2115, 0x2118, 0x211d, 0x2124, + 0x2124, 0x2126, 0x2126, 0x2128, 0x2128, 0x212a, 0x2139, 0x213c, + 0x213f, 0x2145, 0x2149, 0x214e, 0x214e, 0x2160, 0x2188, 0x2c00, + 0x2c2e, 0x2c30, 0x2c5e, 0x2c60, 0x2ce4, 0x2ceb, 0x2cee, 0x2cf2, + 0x2cf3, 0x2d00, 0x2d25, 0x2d27, 0x2d27, 0x2d2d, 0x2d2d, 0x2d30, + 0x2d67, 0x2d6f, 0x2d6f, 0x2d80, 0x2d96, 0x2da0, 0x2da6, 0x2da8, + 0x2dae, 0x2db0, 0x2db6, 0x2db8, 0x2dbe, 0x2dc0, 0x2dc6, 0x2dc8, + 0x2dce, 0x2dd0, 0x2dd6, 0x2dd8, 0x2dde, 0x3005, 0x3007, 0x3021, + 0x3029, 0x3031, 0x3035, 0x3038, 0x303c, 0x3041, 0x3096, 0x309b, + 0x309f, 0x30a1, 0x30fa, 0x30fc, 0x30ff, 0x3105, 0x312d, 0x3131, + 0x318e, 0x31a0, 0x31ba, 0x31f0, 0x31ff, 0x3400, 0x4db5, 0x4e00, + 0x9fd5, 0xa000, 0xa48c, 0xa4d0, 0xa4fd, 0xa500, 0xa60c, 0xa610, + 0xa61f, 0xa62a, 0xa62b, 0xa640, 0xa66e, 0xa67f, 0xa69d, 0xa6a0, + 0xa6ef, 0xa717, 0xa71f, 0xa722, 0xa788, 0xa78b, 0xa7ae, 0xa7b0, + 0xa7b7, 0xa7f7, 0xa801, 0xa803, 0xa805, 0xa807, 0xa80a, 0xa80c, + 0xa822, 0xa840, 0xa873, 0xa882, 0xa8b3, 0xa8f2, 0xa8f7, 0xa8fb, + 0xa8fb, 0xa8fd, 0xa8fd, 0xa90a, 0xa925, 0xa930, 0xa946, 0xa960, + 0xa97c, 0xa984, 0xa9b2, 0xa9cf, 0xa9cf, 0xa9e0, 0xa9e4, 0xa9e6, + 0xa9ef, 0xa9fa, 0xa9fe, 0xaa00, 0xaa28, 0xaa40, 0xaa42, 0xaa44, + 0xaa4b, 0xaa60, 0xaa76, 0xaa7a, 0xaa7a, 0xaa7e, 0xaaaf, 0xaab1, + 0xaab1, 0xaab5, 0xaab6, 0xaab9, 0xaabd, 0xaac0, 0xaac0, 0xaac2, + 0xaac2, 0xaadb, 0xaadd, 0xaae0, 0xaaea, 0xaaf2, 0xaaf4, 0xab01, + 0xab06, 0xab09, 0xab0e, 0xab11, 0xab16, 0xab20, 0xab26, 0xab28, + 0xab2e, 0xab30, 0xab5a, 0xab5c, 0xab65, 0xab70, 0xabe2, 0xac00, + 0xd7a3, 0xd7b0, 0xd7c6, 0xd7cb, 0xd7fb, 0xf900, 0xfa6d, 0xfa70, + 0xfad9, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xfb1d, 0xfb1d, 0xfb1f, + 0xfb28, 0xfb2a, 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, + 0xfb41, 0xfb43, 0xfb44, 0xfb46, 0xfbb1, 0xfbd3, 0xfd3d, 0xfd50, + 0xfd8f, 0xfd92, 0xfdc7, 0xfdf0, 0xfdfb, 0xfe70, 0xfe74, 0xfe76, + 0xfefc, 0xff21, 0xff3a, 0xff41, 0xff5a, 0xff66, 0xffbe, 0xffc2, + 0xffc7, 0xffca, 0xffcf, 0xffd2, 0xffd7, 0xffda, 0xffdc, 0x10000, + 0x1000b, 0x1000d, 0x10026, 0x10028, 0x1003a, 0x1003c, 0x1003d, 0x1003f, + 0x1004d, 0x10050, 0x1005d, 0x10080, 0x100fa, 0x10140, 0x10174, 0x10280, + 0x1029c, 0x102a0, 0x102d0, 0x10300, 0x1031f, 0x10330, 0x1034a, 0x10350, + 0x10375, 0x10380, 0x1039d, 0x103a0, 0x103c3, 0x103c8, 0x103cf, 0x103d1, + 0x103d5, 0x10400, 0x1049d, 0x104b0, 0x104d3, 0x104d8, 0x104fb, 0x10500, + 0x10527, 0x10530, 0x10563, 0x10600, 0x10736, 0x10740, 0x10755, 0x10760, + 0x10767, 0x10800, 0x10805, 0x10808, 0x10808, 0x1080a, 0x10835, 0x10837, + 0x10838, 0x1083c, 0x1083c, 0x1083f, 0x10855, 0x10860, 0x10876, 0x10880, + 0x1089e, 0x108e0, 0x108f2, 0x108f4, 0x108f5, 0x10900, 0x10915, 0x10920, + 0x10939, 0x10980, 0x109b7, 0x109be, 0x109bf, 0x10a00, 0x10a00, 0x10a10, + 0x10a13, 0x10a15, 0x10a17, 0x10a19, 0x10a33, 0x10a60, 0x10a7c, 0x10a80, + 0x10a9c, 0x10ac0, 0x10ac7, 0x10ac9, 0x10ae4, 0x10b00, 0x10b35, 0x10b40, + 0x10b55, 0x10b60, 0x10b72, 0x10b80, 0x10b91, 0x10c00, 0x10c48, 0x10c80, + 0x10cb2, 0x10cc0, 0x10cf2, 0x11003, 0x11037, 0x11083, 0x110af, 0x110d0, + 0x110e8, 0x11103, 0x11126, 0x11150, 0x11172, 0x11176, 0x11176, 0x11183, + 0x111b2, 0x111c1, 0x111c4, 0x111da, 0x111da, 0x111dc, 0x111dc, 0x11200, + 0x11211, 0x11213, 0x1122b, 0x11280, 0x11286, 0x11288, 0x11288, 0x1128a, + 0x1128d, 0x1128f, 0x1129d, 0x1129f, 0x112a8, 0x112b0, 0x112de, 0x11305, + 0x1130c, 0x1130f, 0x11310, 0x11313, 0x11328, 0x1132a, 0x11330, 0x11332, + 0x11333, 0x11335, 0x11339, 0x1133d, 0x1133d, 0x11350, 0x11350, 0x1135d, + 0x11361, 0x11400, 0x11434, 0x11447, 0x1144a, 0x11480, 0x114af, 0x114c4, + 0x114c5, 0x114c7, 0x114c7, 0x11580, 0x115ae, 0x115d8, 0x115db, 0x11600, + 0x1162f, 0x11644, 0x11644, 0x11680, 0x116aa, 0x11700, 0x11719, 0x118a0, + 0x118df, 0x118ff, 0x118ff, 0x11ac0, 0x11af8, 0x11c00, 0x11c08, 0x11c0a, + 0x11c2e, 0x11c40, 0x11c40, 0x11c72, 0x11c8f, 0x12000, 0x12399, 0x12400, + 0x1246e, 0x12480, 0x12543, 0x13000, 0x1342e, 0x14400, 0x14646, 0x16800, + 0x16a38, 0x16a40, 0x16a5e, 0x16ad0, 0x16aed, 0x16b00, 0x16b2f, 0x16b40, + 0x16b43, 0x16b63, 0x16b77, 0x16b7d, 0x16b8f, 0x16f00, 0x16f44, 0x16f50, + 0x16f50, 0x16f93, 0x16f9f, 0x16fe0, 0x16fe0, 0x17000, 0x187ec, 0x18800, + 0x18af2, 0x1b000, 0x1b001, 0x1bc00, 0x1bc6a, 0x1bc70, 0x1bc7c, 0x1bc80, + 0x1bc88, 0x1bc90, 0x1bc99, 0x1d400, 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, + 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, + 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, + 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, + 0x1d53e, 0x1d540, 0x1d544, 0x1d546, 0x1d546, 0x1d54a, 0x1d550, 0x1d552, + 0x1d6a5, 0x1d6a8, 0x1d6c0, 0x1d6c2, 0x1d6da, 0x1d6dc, 0x1d6fa, 0x1d6fc, + 0x1d714, 0x1d716, 0x1d734, 0x1d736, 0x1d74e, 0x1d750, 0x1d76e, 0x1d770, + 0x1d788, 0x1d78a, 0x1d7a8, 0x1d7aa, 0x1d7c2, 0x1d7c4, 0x1d7cb, 0x1e800, + 0x1e8c4, 0x1e900, 0x1e943, 0x1ee00, 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, + 0x1ee22, 0x1ee24, 0x1ee24, 0x1ee27, 0x1ee27, 0x1ee29, 0x1ee32, 0x1ee34, + 0x1ee37, 0x1ee39, 0x1ee39, 0x1ee3b, 0x1ee3b, 0x1ee42, 0x1ee42, 0x1ee47, + 0x1ee47, 0x1ee49, 0x1ee49, 0x1ee4b, 0x1ee4b, 0x1ee4d, 0x1ee4f, 0x1ee51, + 0x1ee52, 0x1ee54, 0x1ee54, 0x1ee57, 0x1ee57, 0x1ee59, 0x1ee59, 0x1ee5b, + 0x1ee5b, 0x1ee5d, 0x1ee5d, 0x1ee5f, 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, + 0x1ee64, 0x1ee67, 0x1ee6a, 0x1ee6c, 0x1ee72, 0x1ee74, 0x1ee77, 0x1ee79, + 0x1ee7c, 0x1ee7e, 0x1ee7e, 0x1ee80, 0x1ee89, 0x1ee8b, 0x1ee9b, 0x1eea1, + 0x1eea3, 0x1eea5, 0x1eea9, 0x1eeab, 0x1eebb, 0x20000, 0x2a6d6, 0x2a700, + 0x2b734, 0x2b740, 0x2b81d, 0x2b820, 0x2cea1, 0x2f800, 0x2fa1d, +}; /* CR_ID_Start */ + +/* 'ID_Continue': Derived Property */ +static const OnigCodePoint CR_ID_Continue[] = { + 676, 0x0030, 0x0039, 0x0041, 0x005a, 0x005f, 0x005f, 0x0061, + 0x007a, 0x00aa, 0x00aa, 0x00b5, 0x00b5, 0x00b7, 0x00b7, 0x00ba, + 0x00ba, 0x00c0, 0x00d6, 0x00d8, 0x00f6, 0x00f8, 0x02c1, 0x02c6, + 0x02d1, 0x02e0, 0x02e4, 0x02ec, 0x02ec, 0x02ee, 0x02ee, 0x0300, + 0x0374, 0x0376, 0x0377, 0x037a, 0x037d, 0x037f, 0x037f, 0x0386, + 0x038a, 0x038c, 0x038c, 0x038e, 0x03a1, 0x03a3, 0x03f5, 0x03f7, + 0x0481, 0x0483, 0x0487, 0x048a, 0x052f, 0x0531, 0x0556, 0x0559, + 0x0559, 0x0561, 0x0587, 0x0591, 0x05bd, 0x05bf, 0x05bf, 0x05c1, + 0x05c2, 0x05c4, 0x05c5, 0x05c7, 0x05c7, 0x05d0, 0x05ea, 0x05f0, + 0x05f2, 0x0610, 0x061a, 0x0620, 0x0669, 0x066e, 0x06d3, 0x06d5, + 0x06dc, 0x06df, 0x06e8, 0x06ea, 0x06fc, 0x06ff, 0x06ff, 0x0710, + 0x074a, 0x074d, 0x07b1, 0x07c0, 0x07f5, 0x07fa, 0x07fa, 0x0800, + 0x082d, 0x0840, 0x085b, 0x08a0, 0x08b4, 0x08b6, 0x08bd, 0x08d4, + 0x08e1, 0x08e3, 0x0963, 0x0966, 0x096f, 0x0971, 0x0983, 0x0985, + 0x098c, 0x098f, 0x0990, 0x0993, 0x09a8, 0x09aa, 0x09b0, 0x09b2, + 0x09b2, 0x09b6, 0x09b9, 0x09bc, 0x09c4, 0x09c7, 0x09c8, 0x09cb, + 0x09ce, 0x09d7, 0x09d7, 0x09dc, 0x09dd, 0x09df, 0x09e3, 0x09e6, + 0x09f1, 0x0a01, 0x0a03, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, + 0x0a28, 0x0a2a, 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, + 0x0a39, 0x0a3c, 0x0a3c, 0x0a3e, 0x0a42, 0x0a47, 0x0a48, 0x0a4b, + 0x0a4d, 0x0a51, 0x0a51, 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, + 0x0a75, 0x0a81, 0x0a83, 0x0a85, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, + 0x0aa8, 0x0aaa, 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, + 0x0ac5, 0x0ac7, 0x0ac9, 0x0acb, 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, + 0x0ae3, 0x0ae6, 0x0aef, 0x0af9, 0x0af9, 0x0b01, 0x0b03, 0x0b05, + 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, 0x0b28, 0x0b2a, 0x0b30, 0x0b32, + 0x0b33, 0x0b35, 0x0b39, 0x0b3c, 0x0b44, 0x0b47, 0x0b48, 0x0b4b, + 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, 0x0b5d, 0x0b5f, 0x0b63, 0x0b66, + 0x0b6f, 0x0b71, 0x0b71, 0x0b82, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, + 0x0b90, 0x0b92, 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, + 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, 0x0bb9, 0x0bbe, + 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, 0x0bcd, 0x0bd0, 0x0bd0, 0x0bd7, + 0x0bd7, 0x0be6, 0x0bef, 0x0c00, 0x0c03, 0x0c05, 0x0c0c, 0x0c0e, + 0x0c10, 0x0c12, 0x0c28, 0x0c2a, 0x0c39, 0x0c3d, 0x0c44, 0x0c46, + 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, 0x0c56, 0x0c58, 0x0c5a, 0x0c60, + 0x0c63, 0x0c66, 0x0c6f, 0x0c80, 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, + 0x0c90, 0x0c92, 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbc, + 0x0cc4, 0x0cc6, 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, 0x0cd6, 0x0cde, + 0x0cde, 0x0ce0, 0x0ce3, 0x0ce6, 0x0cef, 0x0cf1, 0x0cf2, 0x0d01, + 0x0d03, 0x0d05, 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d3a, 0x0d3d, + 0x0d44, 0x0d46, 0x0d48, 0x0d4a, 0x0d4e, 0x0d54, 0x0d57, 0x0d5f, + 0x0d63, 0x0d66, 0x0d6f, 0x0d7a, 0x0d7f, 0x0d82, 0x0d83, 0x0d85, + 0x0d96, 0x0d9a, 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, + 0x0dc6, 0x0dca, 0x0dca, 0x0dcf, 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, + 0x0ddf, 0x0de6, 0x0def, 0x0df2, 0x0df3, 0x0e01, 0x0e3a, 0x0e40, + 0x0e4e, 0x0e50, 0x0e59, 0x0e81, 0x0e82, 0x0e84, 0x0e84, 0x0e87, + 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, 0x0e97, 0x0e99, + 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, + 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, + 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, 0x0ed9, 0x0edc, 0x0edf, 0x0f00, + 0x0f00, 0x0f18, 0x0f19, 0x0f20, 0x0f29, 0x0f35, 0x0f35, 0x0f37, + 0x0f37, 0x0f39, 0x0f39, 0x0f3e, 0x0f47, 0x0f49, 0x0f6c, 0x0f71, + 0x0f84, 0x0f86, 0x0f97, 0x0f99, 0x0fbc, 0x0fc6, 0x0fc6, 0x1000, + 0x1049, 0x1050, 0x109d, 0x10a0, 0x10c5, 0x10c7, 0x10c7, 0x10cd, + 0x10cd, 0x10d0, 0x10fa, 0x10fc, 0x1248, 0x124a, 0x124d, 0x1250, + 0x1256, 0x1258, 0x1258, 0x125a, 0x125d, 0x1260, 0x1288, 0x128a, + 0x128d, 0x1290, 0x12b0, 0x12b2, 0x12b5, 0x12b8, 0x12be, 0x12c0, + 0x12c0, 0x12c2, 0x12c5, 0x12c8, 0x12d6, 0x12d8, 0x1310, 0x1312, + 0x1315, 0x1318, 0x135a, 0x135d, 0x135f, 0x1369, 0x1371, 0x1380, + 0x138f, 0x13a0, 0x13f5, 0x13f8, 0x13fd, 0x1401, 0x166c, 0x166f, + 0x167f, 0x1681, 0x169a, 0x16a0, 0x16ea, 0x16ee, 0x16f8, 0x1700, + 0x170c, 0x170e, 0x1714, 0x1720, 0x1734, 0x1740, 0x1753, 0x1760, + 0x176c, 0x176e, 0x1770, 0x1772, 0x1773, 0x1780, 0x17d3, 0x17d7, + 0x17d7, 0x17dc, 0x17dd, 0x17e0, 0x17e9, 0x180b, 0x180d, 0x1810, + 0x1819, 0x1820, 0x1877, 0x1880, 0x18aa, 0x18b0, 0x18f5, 0x1900, + 0x191e, 0x1920, 0x192b, 0x1930, 0x193b, 0x1946, 0x196d, 0x1970, + 0x1974, 0x1980, 0x19ab, 0x19b0, 0x19c9, 0x19d0, 0x19da, 0x1a00, + 0x1a1b, 0x1a20, 0x1a5e, 0x1a60, 0x1a7c, 0x1a7f, 0x1a89, 0x1a90, + 0x1a99, 0x1aa7, 0x1aa7, 0x1ab0, 0x1abd, 0x1b00, 0x1b4b, 0x1b50, + 0x1b59, 0x1b6b, 0x1b73, 0x1b80, 0x1bf3, 0x1c00, 0x1c37, 0x1c40, + 0x1c49, 0x1c4d, 0x1c7d, 0x1c80, 0x1c88, 0x1cd0, 0x1cd2, 0x1cd4, + 0x1cf6, 0x1cf8, 0x1cf9, 0x1d00, 0x1df5, 0x1dfb, 0x1f15, 0x1f18, + 0x1f1d, 0x1f20, 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, + 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, + 0x1fb4, 0x1fb6, 0x1fbc, 0x1fbe, 0x1fbe, 0x1fc2, 0x1fc4, 0x1fc6, + 0x1fcc, 0x1fd0, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fe0, 0x1fec, 0x1ff2, + 0x1ff4, 0x1ff6, 0x1ffc, 0x203f, 0x2040, 0x2054, 0x2054, 0x2071, + 0x2071, 0x207f, 0x207f, 0x2090, 0x209c, 0x20d0, 0x20dc, 0x20e1, + 0x20e1, 0x20e5, 0x20f0, 0x2102, 0x2102, 0x2107, 0x2107, 0x210a, + 0x2113, 0x2115, 0x2115, 0x2118, 0x211d, 0x2124, 0x2124, 0x2126, + 0x2126, 0x2128, 0x2128, 0x212a, 0x2139, 0x213c, 0x213f, 0x2145, + 0x2149, 0x214e, 0x214e, 0x2160, 0x2188, 0x2c00, 0x2c2e, 0x2c30, + 0x2c5e, 0x2c60, 0x2ce4, 0x2ceb, 0x2cf3, 0x2d00, 0x2d25, 0x2d27, + 0x2d27, 0x2d2d, 0x2d2d, 0x2d30, 0x2d67, 0x2d6f, 0x2d6f, 0x2d7f, + 0x2d96, 0x2da0, 0x2da6, 0x2da8, 0x2dae, 0x2db0, 0x2db6, 0x2db8, + 0x2dbe, 0x2dc0, 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, 0x2dd6, 0x2dd8, + 0x2dde, 0x2de0, 0x2dff, 0x3005, 0x3007, 0x3021, 0x302f, 0x3031, + 0x3035, 0x3038, 0x303c, 0x3041, 0x3096, 0x3099, 0x309f, 0x30a1, + 0x30fa, 0x30fc, 0x30ff, 0x3105, 0x312d, 0x3131, 0x318e, 0x31a0, + 0x31ba, 0x31f0, 0x31ff, 0x3400, 0x4db5, 0x4e00, 0x9fd5, 0xa000, + 0xa48c, 0xa4d0, 0xa4fd, 0xa500, 0xa60c, 0xa610, 0xa62b, 0xa640, + 0xa66f, 0xa674, 0xa67d, 0xa67f, 0xa6f1, 0xa717, 0xa71f, 0xa722, + 0xa788, 0xa78b, 0xa7ae, 0xa7b0, 0xa7b7, 0xa7f7, 0xa827, 0xa840, + 0xa873, 0xa880, 0xa8c5, 0xa8d0, 0xa8d9, 0xa8e0, 0xa8f7, 0xa8fb, + 0xa8fb, 0xa8fd, 0xa8fd, 0xa900, 0xa92d, 0xa930, 0xa953, 0xa960, + 0xa97c, 0xa980, 0xa9c0, 0xa9cf, 0xa9d9, 0xa9e0, 0xa9fe, 0xaa00, + 0xaa36, 0xaa40, 0xaa4d, 0xaa50, 0xaa59, 0xaa60, 0xaa76, 0xaa7a, + 0xaac2, 0xaadb, 0xaadd, 0xaae0, 0xaaef, 0xaaf2, 0xaaf6, 0xab01, + 0xab06, 0xab09, 0xab0e, 0xab11, 0xab16, 0xab20, 0xab26, 0xab28, + 0xab2e, 0xab30, 0xab5a, 0xab5c, 0xab65, 0xab70, 0xabea, 0xabec, + 0xabed, 0xabf0, 0xabf9, 0xac00, 0xd7a3, 0xd7b0, 0xd7c6, 0xd7cb, + 0xd7fb, 0xf900, 0xfa6d, 0xfa70, 0xfad9, 0xfb00, 0xfb06, 0xfb13, + 0xfb17, 0xfb1d, 0xfb28, 0xfb2a, 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, + 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, 0xfbb1, 0xfbd3, + 0xfd3d, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdf0, 0xfdfb, 0xfe00, + 0xfe0f, 0xfe20, 0xfe2f, 0xfe33, 0xfe34, 0xfe4d, 0xfe4f, 0xfe70, + 0xfe74, 0xfe76, 0xfefc, 0xff10, 0xff19, 0xff21, 0xff3a, 0xff3f, + 0xff3f, 0xff41, 0xff5a, 0xff66, 0xffbe, 0xffc2, 0xffc7, 0xffca, + 0xffcf, 0xffd2, 0xffd7, 0xffda, 0xffdc, 0x10000, 0x1000b, 0x1000d, + 0x10026, 0x10028, 0x1003a, 0x1003c, 0x1003d, 0x1003f, 0x1004d, 0x10050, + 0x1005d, 0x10080, 0x100fa, 0x10140, 0x10174, 0x101fd, 0x101fd, 0x10280, + 0x1029c, 0x102a0, 0x102d0, 0x102e0, 0x102e0, 0x10300, 0x1031f, 0x10330, + 0x1034a, 0x10350, 0x1037a, 0x10380, 0x1039d, 0x103a0, 0x103c3, 0x103c8, + 0x103cf, 0x103d1, 0x103d5, 0x10400, 0x1049d, 0x104a0, 0x104a9, 0x104b0, + 0x104d3, 0x104d8, 0x104fb, 0x10500, 0x10527, 0x10530, 0x10563, 0x10600, + 0x10736, 0x10740, 0x10755, 0x10760, 0x10767, 0x10800, 0x10805, 0x10808, + 0x10808, 0x1080a, 0x10835, 0x10837, 0x10838, 0x1083c, 0x1083c, 0x1083f, + 0x10855, 0x10860, 0x10876, 0x10880, 0x1089e, 0x108e0, 0x108f2, 0x108f4, + 0x108f5, 0x10900, 0x10915, 0x10920, 0x10939, 0x10980, 0x109b7, 0x109be, + 0x109bf, 0x10a00, 0x10a03, 0x10a05, 0x10a06, 0x10a0c, 0x10a13, 0x10a15, + 0x10a17, 0x10a19, 0x10a33, 0x10a38, 0x10a3a, 0x10a3f, 0x10a3f, 0x10a60, + 0x10a7c, 0x10a80, 0x10a9c, 0x10ac0, 0x10ac7, 0x10ac9, 0x10ae6, 0x10b00, + 0x10b35, 0x10b40, 0x10b55, 0x10b60, 0x10b72, 0x10b80, 0x10b91, 0x10c00, + 0x10c48, 0x10c80, 0x10cb2, 0x10cc0, 0x10cf2, 0x11000, 0x11046, 0x11066, + 0x1106f, 0x1107f, 0x110ba, 0x110d0, 0x110e8, 0x110f0, 0x110f9, 0x11100, + 0x11134, 0x11136, 0x1113f, 0x11150, 0x11173, 0x11176, 0x11176, 0x11180, + 0x111c4, 0x111ca, 0x111cc, 0x111d0, 0x111da, 0x111dc, 0x111dc, 0x11200, + 0x11211, 0x11213, 0x11237, 0x1123e, 0x1123e, 0x11280, 0x11286, 0x11288, + 0x11288, 0x1128a, 0x1128d, 0x1128f, 0x1129d, 0x1129f, 0x112a8, 0x112b0, + 0x112ea, 0x112f0, 0x112f9, 0x11300, 0x11303, 0x11305, 0x1130c, 0x1130f, + 0x11310, 0x11313, 0x11328, 0x1132a, 0x11330, 0x11332, 0x11333, 0x11335, + 0x11339, 0x1133c, 0x11344, 0x11347, 0x11348, 0x1134b, 0x1134d, 0x11350, + 0x11350, 0x11357, 0x11357, 0x1135d, 0x11363, 0x11366, 0x1136c, 0x11370, + 0x11374, 0x11400, 0x1144a, 0x11450, 0x11459, 0x11480, 0x114c5, 0x114c7, + 0x114c7, 0x114d0, 0x114d9, 0x11580, 0x115b5, 0x115b8, 0x115c0, 0x115d8, + 0x115dd, 0x11600, 0x11640, 0x11644, 0x11644, 0x11650, 0x11659, 0x11680, + 0x116b7, 0x116c0, 0x116c9, 0x11700, 0x11719, 0x1171d, 0x1172b, 0x11730, + 0x11739, 0x118a0, 0x118e9, 0x118ff, 0x118ff, 0x11ac0, 0x11af8, 0x11c00, + 0x11c08, 0x11c0a, 0x11c36, 0x11c38, 0x11c40, 0x11c50, 0x11c59, 0x11c72, + 0x11c8f, 0x11c92, 0x11ca7, 0x11ca9, 0x11cb6, 0x12000, 0x12399, 0x12400, + 0x1246e, 0x12480, 0x12543, 0x13000, 0x1342e, 0x14400, 0x14646, 0x16800, + 0x16a38, 0x16a40, 0x16a5e, 0x16a60, 0x16a69, 0x16ad0, 0x16aed, 0x16af0, + 0x16af4, 0x16b00, 0x16b36, 0x16b40, 0x16b43, 0x16b50, 0x16b59, 0x16b63, + 0x16b77, 0x16b7d, 0x16b8f, 0x16f00, 0x16f44, 0x16f50, 0x16f7e, 0x16f8f, + 0x16f9f, 0x16fe0, 0x16fe0, 0x17000, 0x187ec, 0x18800, 0x18af2, 0x1b000, + 0x1b001, 0x1bc00, 0x1bc6a, 0x1bc70, 0x1bc7c, 0x1bc80, 0x1bc88, 0x1bc90, + 0x1bc99, 0x1bc9d, 0x1bc9e, 0x1d165, 0x1d169, 0x1d16d, 0x1d172, 0x1d17b, + 0x1d182, 0x1d185, 0x1d18b, 0x1d1aa, 0x1d1ad, 0x1d242, 0x1d244, 0x1d400, + 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, + 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, + 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, + 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, 0x1d544, 0x1d546, + 0x1d546, 0x1d54a, 0x1d550, 0x1d552, 0x1d6a5, 0x1d6a8, 0x1d6c0, 0x1d6c2, + 0x1d6da, 0x1d6dc, 0x1d6fa, 0x1d6fc, 0x1d714, 0x1d716, 0x1d734, 0x1d736, + 0x1d74e, 0x1d750, 0x1d76e, 0x1d770, 0x1d788, 0x1d78a, 0x1d7a8, 0x1d7aa, + 0x1d7c2, 0x1d7c4, 0x1d7cb, 0x1d7ce, 0x1d7ff, 0x1da00, 0x1da36, 0x1da3b, + 0x1da6c, 0x1da75, 0x1da75, 0x1da84, 0x1da84, 0x1da9b, 0x1da9f, 0x1daa1, + 0x1daaf, 0x1e000, 0x1e006, 0x1e008, 0x1e018, 0x1e01b, 0x1e021, 0x1e023, + 0x1e024, 0x1e026, 0x1e02a, 0x1e800, 0x1e8c4, 0x1e8d0, 0x1e8d6, 0x1e900, + 0x1e94a, 0x1e950, 0x1e959, 0x1ee00, 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, + 0x1ee22, 0x1ee24, 0x1ee24, 0x1ee27, 0x1ee27, 0x1ee29, 0x1ee32, 0x1ee34, + 0x1ee37, 0x1ee39, 0x1ee39, 0x1ee3b, 0x1ee3b, 0x1ee42, 0x1ee42, 0x1ee47, + 0x1ee47, 0x1ee49, 0x1ee49, 0x1ee4b, 0x1ee4b, 0x1ee4d, 0x1ee4f, 0x1ee51, + 0x1ee52, 0x1ee54, 0x1ee54, 0x1ee57, 0x1ee57, 0x1ee59, 0x1ee59, 0x1ee5b, + 0x1ee5b, 0x1ee5d, 0x1ee5d, 0x1ee5f, 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, + 0x1ee64, 0x1ee67, 0x1ee6a, 0x1ee6c, 0x1ee72, 0x1ee74, 0x1ee77, 0x1ee79, + 0x1ee7c, 0x1ee7e, 0x1ee7e, 0x1ee80, 0x1ee89, 0x1ee8b, 0x1ee9b, 0x1eea1, + 0x1eea3, 0x1eea5, 0x1eea9, 0x1eeab, 0x1eebb, 0x20000, 0x2a6d6, 0x2a700, + 0x2b734, 0x2b740, 0x2b81d, 0x2b820, 0x2cea1, 0x2f800, 0x2fa1d, 0xe0100, + 0xe01ef, +}; /* CR_ID_Continue */ + +/* 'XID_Start': Derived Property */ +static const OnigCodePoint CR_XID_Start[] = { + 578, 0x0041, 0x005a, 0x0061, 0x007a, 0x00aa, 0x00aa, 0x00b5, + 0x00b5, 0x00ba, 0x00ba, 0x00c0, 0x00d6, 0x00d8, 0x00f6, 0x00f8, + 0x02c1, 0x02c6, 0x02d1, 0x02e0, 0x02e4, 0x02ec, 0x02ec, 0x02ee, + 0x02ee, 0x0370, 0x0374, 0x0376, 0x0377, 0x037b, 0x037d, 0x037f, + 0x037f, 0x0386, 0x0386, 0x0388, 0x038a, 0x038c, 0x038c, 0x038e, + 0x03a1, 0x03a3, 0x03f5, 0x03f7, 0x0481, 0x048a, 0x052f, 0x0531, + 0x0556, 0x0559, 0x0559, 0x0561, 0x0587, 0x05d0, 0x05ea, 0x05f0, + 0x05f2, 0x0620, 0x064a, 0x066e, 0x066f, 0x0671, 0x06d3, 0x06d5, + 0x06d5, 0x06e5, 0x06e6, 0x06ee, 0x06ef, 0x06fa, 0x06fc, 0x06ff, + 0x06ff, 0x0710, 0x0710, 0x0712, 0x072f, 0x074d, 0x07a5, 0x07b1, + 0x07b1, 0x07ca, 0x07ea, 0x07f4, 0x07f5, 0x07fa, 0x07fa, 0x0800, + 0x0815, 0x081a, 0x081a, 0x0824, 0x0824, 0x0828, 0x0828, 0x0840, + 0x0858, 0x08a0, 0x08b4, 0x08b6, 0x08bd, 0x0904, 0x0939, 0x093d, + 0x093d, 0x0950, 0x0950, 0x0958, 0x0961, 0x0971, 0x0980, 0x0985, + 0x098c, 0x098f, 0x0990, 0x0993, 0x09a8, 0x09aa, 0x09b0, 0x09b2, + 0x09b2, 0x09b6, 0x09b9, 0x09bd, 0x09bd, 0x09ce, 0x09ce, 0x09dc, + 0x09dd, 0x09df, 0x09e1, 0x09f0, 0x09f1, 0x0a05, 0x0a0a, 0x0a0f, + 0x0a10, 0x0a13, 0x0a28, 0x0a2a, 0x0a30, 0x0a32, 0x0a33, 0x0a35, + 0x0a36, 0x0a38, 0x0a39, 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a72, + 0x0a74, 0x0a85, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, + 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abd, 0x0abd, 0x0ad0, + 0x0ad0, 0x0ae0, 0x0ae1, 0x0af9, 0x0af9, 0x0b05, 0x0b0c, 0x0b0f, + 0x0b10, 0x0b13, 0x0b28, 0x0b2a, 0x0b30, 0x0b32, 0x0b33, 0x0b35, + 0x0b39, 0x0b3d, 0x0b3d, 0x0b5c, 0x0b5d, 0x0b5f, 0x0b61, 0x0b71, + 0x0b71, 0x0b83, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, + 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, + 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, 0x0bb9, 0x0bd0, 0x0bd0, 0x0c05, + 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, 0x0c28, 0x0c2a, 0x0c39, 0x0c3d, + 0x0c3d, 0x0c58, 0x0c5a, 0x0c60, 0x0c61, 0x0c80, 0x0c80, 0x0c85, + 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, + 0x0cb9, 0x0cbd, 0x0cbd, 0x0cde, 0x0cde, 0x0ce0, 0x0ce1, 0x0cf1, + 0x0cf2, 0x0d05, 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d3a, 0x0d3d, + 0x0d3d, 0x0d4e, 0x0d4e, 0x0d54, 0x0d56, 0x0d5f, 0x0d61, 0x0d7a, + 0x0d7f, 0x0d85, 0x0d96, 0x0d9a, 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, + 0x0dbd, 0x0dc0, 0x0dc6, 0x0e01, 0x0e30, 0x0e32, 0x0e32, 0x0e40, + 0x0e46, 0x0e81, 0x0e82, 0x0e84, 0x0e84, 0x0e87, 0x0e88, 0x0e8a, + 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, + 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, + 0x0eb0, 0x0eb2, 0x0eb2, 0x0ebd, 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, + 0x0ec6, 0x0edc, 0x0edf, 0x0f00, 0x0f00, 0x0f40, 0x0f47, 0x0f49, + 0x0f6c, 0x0f88, 0x0f8c, 0x1000, 0x102a, 0x103f, 0x103f, 0x1050, + 0x1055, 0x105a, 0x105d, 0x1061, 0x1061, 0x1065, 0x1066, 0x106e, + 0x1070, 0x1075, 0x1081, 0x108e, 0x108e, 0x10a0, 0x10c5, 0x10c7, + 0x10c7, 0x10cd, 0x10cd, 0x10d0, 0x10fa, 0x10fc, 0x1248, 0x124a, + 0x124d, 0x1250, 0x1256, 0x1258, 0x1258, 0x125a, 0x125d, 0x1260, + 0x1288, 0x128a, 0x128d, 0x1290, 0x12b0, 0x12b2, 0x12b5, 0x12b8, + 0x12be, 0x12c0, 0x12c0, 0x12c2, 0x12c5, 0x12c8, 0x12d6, 0x12d8, + 0x1310, 0x1312, 0x1315, 0x1318, 0x135a, 0x1380, 0x138f, 0x13a0, + 0x13f5, 0x13f8, 0x13fd, 0x1401, 0x166c, 0x166f, 0x167f, 0x1681, + 0x169a, 0x16a0, 0x16ea, 0x16ee, 0x16f8, 0x1700, 0x170c, 0x170e, + 0x1711, 0x1720, 0x1731, 0x1740, 0x1751, 0x1760, 0x176c, 0x176e, + 0x1770, 0x1780, 0x17b3, 0x17d7, 0x17d7, 0x17dc, 0x17dc, 0x1820, + 0x1877, 0x1880, 0x18a8, 0x18aa, 0x18aa, 0x18b0, 0x18f5, 0x1900, + 0x191e, 0x1950, 0x196d, 0x1970, 0x1974, 0x1980, 0x19ab, 0x19b0, + 0x19c9, 0x1a00, 0x1a16, 0x1a20, 0x1a54, 0x1aa7, 0x1aa7, 0x1b05, + 0x1b33, 0x1b45, 0x1b4b, 0x1b83, 0x1ba0, 0x1bae, 0x1baf, 0x1bba, + 0x1be5, 0x1c00, 0x1c23, 0x1c4d, 0x1c4f, 0x1c5a, 0x1c7d, 0x1c80, + 0x1c88, 0x1ce9, 0x1cec, 0x1cee, 0x1cf1, 0x1cf5, 0x1cf6, 0x1d00, + 0x1dbf, 0x1e00, 0x1f15, 0x1f18, 0x1f1d, 0x1f20, 0x1f45, 0x1f48, + 0x1f4d, 0x1f50, 0x1f57, 0x1f59, 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, + 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, 0x1fbc, 0x1fbe, + 0x1fbe, 0x1fc2, 0x1fc4, 0x1fc6, 0x1fcc, 0x1fd0, 0x1fd3, 0x1fd6, + 0x1fdb, 0x1fe0, 0x1fec, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ffc, 0x2071, + 0x2071, 0x207f, 0x207f, 0x2090, 0x209c, 0x2102, 0x2102, 0x2107, + 0x2107, 0x210a, 0x2113, 0x2115, 0x2115, 0x2118, 0x211d, 0x2124, + 0x2124, 0x2126, 0x2126, 0x2128, 0x2128, 0x212a, 0x2139, 0x213c, + 0x213f, 0x2145, 0x2149, 0x214e, 0x214e, 0x2160, 0x2188, 0x2c00, + 0x2c2e, 0x2c30, 0x2c5e, 0x2c60, 0x2ce4, 0x2ceb, 0x2cee, 0x2cf2, + 0x2cf3, 0x2d00, 0x2d25, 0x2d27, 0x2d27, 0x2d2d, 0x2d2d, 0x2d30, + 0x2d67, 0x2d6f, 0x2d6f, 0x2d80, 0x2d96, 0x2da0, 0x2da6, 0x2da8, + 0x2dae, 0x2db0, 0x2db6, 0x2db8, 0x2dbe, 0x2dc0, 0x2dc6, 0x2dc8, + 0x2dce, 0x2dd0, 0x2dd6, 0x2dd8, 0x2dde, 0x3005, 0x3007, 0x3021, + 0x3029, 0x3031, 0x3035, 0x3038, 0x303c, 0x3041, 0x3096, 0x309d, + 0x309f, 0x30a1, 0x30fa, 0x30fc, 0x30ff, 0x3105, 0x312d, 0x3131, + 0x318e, 0x31a0, 0x31ba, 0x31f0, 0x31ff, 0x3400, 0x4db5, 0x4e00, + 0x9fd5, 0xa000, 0xa48c, 0xa4d0, 0xa4fd, 0xa500, 0xa60c, 0xa610, + 0xa61f, 0xa62a, 0xa62b, 0xa640, 0xa66e, 0xa67f, 0xa69d, 0xa6a0, + 0xa6ef, 0xa717, 0xa71f, 0xa722, 0xa788, 0xa78b, 0xa7ae, 0xa7b0, + 0xa7b7, 0xa7f7, 0xa801, 0xa803, 0xa805, 0xa807, 0xa80a, 0xa80c, + 0xa822, 0xa840, 0xa873, 0xa882, 0xa8b3, 0xa8f2, 0xa8f7, 0xa8fb, + 0xa8fb, 0xa8fd, 0xa8fd, 0xa90a, 0xa925, 0xa930, 0xa946, 0xa960, + 0xa97c, 0xa984, 0xa9b2, 0xa9cf, 0xa9cf, 0xa9e0, 0xa9e4, 0xa9e6, + 0xa9ef, 0xa9fa, 0xa9fe, 0xaa00, 0xaa28, 0xaa40, 0xaa42, 0xaa44, + 0xaa4b, 0xaa60, 0xaa76, 0xaa7a, 0xaa7a, 0xaa7e, 0xaaaf, 0xaab1, + 0xaab1, 0xaab5, 0xaab6, 0xaab9, 0xaabd, 0xaac0, 0xaac0, 0xaac2, + 0xaac2, 0xaadb, 0xaadd, 0xaae0, 0xaaea, 0xaaf2, 0xaaf4, 0xab01, + 0xab06, 0xab09, 0xab0e, 0xab11, 0xab16, 0xab20, 0xab26, 0xab28, + 0xab2e, 0xab30, 0xab5a, 0xab5c, 0xab65, 0xab70, 0xabe2, 0xac00, + 0xd7a3, 0xd7b0, 0xd7c6, 0xd7cb, 0xd7fb, 0xf900, 0xfa6d, 0xfa70, + 0xfad9, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xfb1d, 0xfb1d, 0xfb1f, + 0xfb28, 0xfb2a, 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, + 0xfb41, 0xfb43, 0xfb44, 0xfb46, 0xfbb1, 0xfbd3, 0xfc5d, 0xfc64, + 0xfd3d, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdf0, 0xfdf9, 0xfe71, + 0xfe71, 0xfe73, 0xfe73, 0xfe77, 0xfe77, 0xfe79, 0xfe79, 0xfe7b, + 0xfe7b, 0xfe7d, 0xfe7d, 0xfe7f, 0xfefc, 0xff21, 0xff3a, 0xff41, + 0xff5a, 0xff66, 0xff9d, 0xffa0, 0xffbe, 0xffc2, 0xffc7, 0xffca, + 0xffcf, 0xffd2, 0xffd7, 0xffda, 0xffdc, 0x10000, 0x1000b, 0x1000d, + 0x10026, 0x10028, 0x1003a, 0x1003c, 0x1003d, 0x1003f, 0x1004d, 0x10050, + 0x1005d, 0x10080, 0x100fa, 0x10140, 0x10174, 0x10280, 0x1029c, 0x102a0, + 0x102d0, 0x10300, 0x1031f, 0x10330, 0x1034a, 0x10350, 0x10375, 0x10380, + 0x1039d, 0x103a0, 0x103c3, 0x103c8, 0x103cf, 0x103d1, 0x103d5, 0x10400, + 0x1049d, 0x104b0, 0x104d3, 0x104d8, 0x104fb, 0x10500, 0x10527, 0x10530, + 0x10563, 0x10600, 0x10736, 0x10740, 0x10755, 0x10760, 0x10767, 0x10800, + 0x10805, 0x10808, 0x10808, 0x1080a, 0x10835, 0x10837, 0x10838, 0x1083c, + 0x1083c, 0x1083f, 0x10855, 0x10860, 0x10876, 0x10880, 0x1089e, 0x108e0, + 0x108f2, 0x108f4, 0x108f5, 0x10900, 0x10915, 0x10920, 0x10939, 0x10980, + 0x109b7, 0x109be, 0x109bf, 0x10a00, 0x10a00, 0x10a10, 0x10a13, 0x10a15, + 0x10a17, 0x10a19, 0x10a33, 0x10a60, 0x10a7c, 0x10a80, 0x10a9c, 0x10ac0, + 0x10ac7, 0x10ac9, 0x10ae4, 0x10b00, 0x10b35, 0x10b40, 0x10b55, 0x10b60, + 0x10b72, 0x10b80, 0x10b91, 0x10c00, 0x10c48, 0x10c80, 0x10cb2, 0x10cc0, + 0x10cf2, 0x11003, 0x11037, 0x11083, 0x110af, 0x110d0, 0x110e8, 0x11103, + 0x11126, 0x11150, 0x11172, 0x11176, 0x11176, 0x11183, 0x111b2, 0x111c1, + 0x111c4, 0x111da, 0x111da, 0x111dc, 0x111dc, 0x11200, 0x11211, 0x11213, + 0x1122b, 0x11280, 0x11286, 0x11288, 0x11288, 0x1128a, 0x1128d, 0x1128f, + 0x1129d, 0x1129f, 0x112a8, 0x112b0, 0x112de, 0x11305, 0x1130c, 0x1130f, + 0x11310, 0x11313, 0x11328, 0x1132a, 0x11330, 0x11332, 0x11333, 0x11335, + 0x11339, 0x1133d, 0x1133d, 0x11350, 0x11350, 0x1135d, 0x11361, 0x11400, + 0x11434, 0x11447, 0x1144a, 0x11480, 0x114af, 0x114c4, 0x114c5, 0x114c7, + 0x114c7, 0x11580, 0x115ae, 0x115d8, 0x115db, 0x11600, 0x1162f, 0x11644, + 0x11644, 0x11680, 0x116aa, 0x11700, 0x11719, 0x118a0, 0x118df, 0x118ff, + 0x118ff, 0x11ac0, 0x11af8, 0x11c00, 0x11c08, 0x11c0a, 0x11c2e, 0x11c40, + 0x11c40, 0x11c72, 0x11c8f, 0x12000, 0x12399, 0x12400, 0x1246e, 0x12480, + 0x12543, 0x13000, 0x1342e, 0x14400, 0x14646, 0x16800, 0x16a38, 0x16a40, + 0x16a5e, 0x16ad0, 0x16aed, 0x16b00, 0x16b2f, 0x16b40, 0x16b43, 0x16b63, + 0x16b77, 0x16b7d, 0x16b8f, 0x16f00, 0x16f44, 0x16f50, 0x16f50, 0x16f93, + 0x16f9f, 0x16fe0, 0x16fe0, 0x17000, 0x187ec, 0x18800, 0x18af2, 0x1b000, + 0x1b001, 0x1bc00, 0x1bc6a, 0x1bc70, 0x1bc7c, 0x1bc80, 0x1bc88, 0x1bc90, + 0x1bc99, 0x1d400, 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, + 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, + 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, + 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, + 0x1d544, 0x1d546, 0x1d546, 0x1d54a, 0x1d550, 0x1d552, 0x1d6a5, 0x1d6a8, + 0x1d6c0, 0x1d6c2, 0x1d6da, 0x1d6dc, 0x1d6fa, 0x1d6fc, 0x1d714, 0x1d716, + 0x1d734, 0x1d736, 0x1d74e, 0x1d750, 0x1d76e, 0x1d770, 0x1d788, 0x1d78a, + 0x1d7a8, 0x1d7aa, 0x1d7c2, 0x1d7c4, 0x1d7cb, 0x1e800, 0x1e8c4, 0x1e900, + 0x1e943, 0x1ee00, 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, 0x1ee22, 0x1ee24, + 0x1ee24, 0x1ee27, 0x1ee27, 0x1ee29, 0x1ee32, 0x1ee34, 0x1ee37, 0x1ee39, + 0x1ee39, 0x1ee3b, 0x1ee3b, 0x1ee42, 0x1ee42, 0x1ee47, 0x1ee47, 0x1ee49, + 0x1ee49, 0x1ee4b, 0x1ee4b, 0x1ee4d, 0x1ee4f, 0x1ee51, 0x1ee52, 0x1ee54, + 0x1ee54, 0x1ee57, 0x1ee57, 0x1ee59, 0x1ee59, 0x1ee5b, 0x1ee5b, 0x1ee5d, + 0x1ee5d, 0x1ee5f, 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, 0x1ee64, 0x1ee67, + 0x1ee6a, 0x1ee6c, 0x1ee72, 0x1ee74, 0x1ee77, 0x1ee79, 0x1ee7c, 0x1ee7e, + 0x1ee7e, 0x1ee80, 0x1ee89, 0x1ee8b, 0x1ee9b, 0x1eea1, 0x1eea3, 0x1eea5, + 0x1eea9, 0x1eeab, 0x1eebb, 0x20000, 0x2a6d6, 0x2a700, 0x2b734, 0x2b740, + 0x2b81d, 0x2b820, 0x2cea1, 0x2f800, 0x2fa1d, +}; /* CR_XID_Start */ + +/* 'XID_Continue': Derived Property */ +static const OnigCodePoint CR_XID_Continue[] = { + 683, 0x0030, 0x0039, 0x0041, 0x005a, 0x005f, 0x005f, 0x0061, + 0x007a, 0x00aa, 0x00aa, 0x00b5, 0x00b5, 0x00b7, 0x00b7, 0x00ba, + 0x00ba, 0x00c0, 0x00d6, 0x00d8, 0x00f6, 0x00f8, 0x02c1, 0x02c6, + 0x02d1, 0x02e0, 0x02e4, 0x02ec, 0x02ec, 0x02ee, 0x02ee, 0x0300, + 0x0374, 0x0376, 0x0377, 0x037b, 0x037d, 0x037f, 0x037f, 0x0386, + 0x038a, 0x038c, 0x038c, 0x038e, 0x03a1, 0x03a3, 0x03f5, 0x03f7, + 0x0481, 0x0483, 0x0487, 0x048a, 0x052f, 0x0531, 0x0556, 0x0559, + 0x0559, 0x0561, 0x0587, 0x0591, 0x05bd, 0x05bf, 0x05bf, 0x05c1, + 0x05c2, 0x05c4, 0x05c5, 0x05c7, 0x05c7, 0x05d0, 0x05ea, 0x05f0, + 0x05f2, 0x0610, 0x061a, 0x0620, 0x0669, 0x066e, 0x06d3, 0x06d5, + 0x06dc, 0x06df, 0x06e8, 0x06ea, 0x06fc, 0x06ff, 0x06ff, 0x0710, + 0x074a, 0x074d, 0x07b1, 0x07c0, 0x07f5, 0x07fa, 0x07fa, 0x0800, + 0x082d, 0x0840, 0x085b, 0x08a0, 0x08b4, 0x08b6, 0x08bd, 0x08d4, + 0x08e1, 0x08e3, 0x0963, 0x0966, 0x096f, 0x0971, 0x0983, 0x0985, + 0x098c, 0x098f, 0x0990, 0x0993, 0x09a8, 0x09aa, 0x09b0, 0x09b2, + 0x09b2, 0x09b6, 0x09b9, 0x09bc, 0x09c4, 0x09c7, 0x09c8, 0x09cb, + 0x09ce, 0x09d7, 0x09d7, 0x09dc, 0x09dd, 0x09df, 0x09e3, 0x09e6, + 0x09f1, 0x0a01, 0x0a03, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, + 0x0a28, 0x0a2a, 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, + 0x0a39, 0x0a3c, 0x0a3c, 0x0a3e, 0x0a42, 0x0a47, 0x0a48, 0x0a4b, + 0x0a4d, 0x0a51, 0x0a51, 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, + 0x0a75, 0x0a81, 0x0a83, 0x0a85, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, + 0x0aa8, 0x0aaa, 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, + 0x0ac5, 0x0ac7, 0x0ac9, 0x0acb, 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, + 0x0ae3, 0x0ae6, 0x0aef, 0x0af9, 0x0af9, 0x0b01, 0x0b03, 0x0b05, + 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, 0x0b28, 0x0b2a, 0x0b30, 0x0b32, + 0x0b33, 0x0b35, 0x0b39, 0x0b3c, 0x0b44, 0x0b47, 0x0b48, 0x0b4b, + 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, 0x0b5d, 0x0b5f, 0x0b63, 0x0b66, + 0x0b6f, 0x0b71, 0x0b71, 0x0b82, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, + 0x0b90, 0x0b92, 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, + 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, 0x0bb9, 0x0bbe, + 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, 0x0bcd, 0x0bd0, 0x0bd0, 0x0bd7, + 0x0bd7, 0x0be6, 0x0bef, 0x0c00, 0x0c03, 0x0c05, 0x0c0c, 0x0c0e, + 0x0c10, 0x0c12, 0x0c28, 0x0c2a, 0x0c39, 0x0c3d, 0x0c44, 0x0c46, + 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, 0x0c56, 0x0c58, 0x0c5a, 0x0c60, + 0x0c63, 0x0c66, 0x0c6f, 0x0c80, 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, + 0x0c90, 0x0c92, 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbc, + 0x0cc4, 0x0cc6, 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, 0x0cd6, 0x0cde, + 0x0cde, 0x0ce0, 0x0ce3, 0x0ce6, 0x0cef, 0x0cf1, 0x0cf2, 0x0d01, + 0x0d03, 0x0d05, 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d3a, 0x0d3d, + 0x0d44, 0x0d46, 0x0d48, 0x0d4a, 0x0d4e, 0x0d54, 0x0d57, 0x0d5f, + 0x0d63, 0x0d66, 0x0d6f, 0x0d7a, 0x0d7f, 0x0d82, 0x0d83, 0x0d85, + 0x0d96, 0x0d9a, 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, + 0x0dc6, 0x0dca, 0x0dca, 0x0dcf, 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, + 0x0ddf, 0x0de6, 0x0def, 0x0df2, 0x0df3, 0x0e01, 0x0e3a, 0x0e40, + 0x0e4e, 0x0e50, 0x0e59, 0x0e81, 0x0e82, 0x0e84, 0x0e84, 0x0e87, + 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, 0x0e97, 0x0e99, + 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, + 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, + 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, 0x0ed9, 0x0edc, 0x0edf, 0x0f00, + 0x0f00, 0x0f18, 0x0f19, 0x0f20, 0x0f29, 0x0f35, 0x0f35, 0x0f37, + 0x0f37, 0x0f39, 0x0f39, 0x0f3e, 0x0f47, 0x0f49, 0x0f6c, 0x0f71, + 0x0f84, 0x0f86, 0x0f97, 0x0f99, 0x0fbc, 0x0fc6, 0x0fc6, 0x1000, + 0x1049, 0x1050, 0x109d, 0x10a0, 0x10c5, 0x10c7, 0x10c7, 0x10cd, + 0x10cd, 0x10d0, 0x10fa, 0x10fc, 0x1248, 0x124a, 0x124d, 0x1250, + 0x1256, 0x1258, 0x1258, 0x125a, 0x125d, 0x1260, 0x1288, 0x128a, + 0x128d, 0x1290, 0x12b0, 0x12b2, 0x12b5, 0x12b8, 0x12be, 0x12c0, + 0x12c0, 0x12c2, 0x12c5, 0x12c8, 0x12d6, 0x12d8, 0x1310, 0x1312, + 0x1315, 0x1318, 0x135a, 0x135d, 0x135f, 0x1369, 0x1371, 0x1380, + 0x138f, 0x13a0, 0x13f5, 0x13f8, 0x13fd, 0x1401, 0x166c, 0x166f, + 0x167f, 0x1681, 0x169a, 0x16a0, 0x16ea, 0x16ee, 0x16f8, 0x1700, + 0x170c, 0x170e, 0x1714, 0x1720, 0x1734, 0x1740, 0x1753, 0x1760, + 0x176c, 0x176e, 0x1770, 0x1772, 0x1773, 0x1780, 0x17d3, 0x17d7, + 0x17d7, 0x17dc, 0x17dd, 0x17e0, 0x17e9, 0x180b, 0x180d, 0x1810, + 0x1819, 0x1820, 0x1877, 0x1880, 0x18aa, 0x18b0, 0x18f5, 0x1900, + 0x191e, 0x1920, 0x192b, 0x1930, 0x193b, 0x1946, 0x196d, 0x1970, + 0x1974, 0x1980, 0x19ab, 0x19b0, 0x19c9, 0x19d0, 0x19da, 0x1a00, + 0x1a1b, 0x1a20, 0x1a5e, 0x1a60, 0x1a7c, 0x1a7f, 0x1a89, 0x1a90, + 0x1a99, 0x1aa7, 0x1aa7, 0x1ab0, 0x1abd, 0x1b00, 0x1b4b, 0x1b50, + 0x1b59, 0x1b6b, 0x1b73, 0x1b80, 0x1bf3, 0x1c00, 0x1c37, 0x1c40, + 0x1c49, 0x1c4d, 0x1c7d, 0x1c80, 0x1c88, 0x1cd0, 0x1cd2, 0x1cd4, + 0x1cf6, 0x1cf8, 0x1cf9, 0x1d00, 0x1df5, 0x1dfb, 0x1f15, 0x1f18, + 0x1f1d, 0x1f20, 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, + 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, + 0x1fb4, 0x1fb6, 0x1fbc, 0x1fbe, 0x1fbe, 0x1fc2, 0x1fc4, 0x1fc6, + 0x1fcc, 0x1fd0, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fe0, 0x1fec, 0x1ff2, + 0x1ff4, 0x1ff6, 0x1ffc, 0x203f, 0x2040, 0x2054, 0x2054, 0x2071, + 0x2071, 0x207f, 0x207f, 0x2090, 0x209c, 0x20d0, 0x20dc, 0x20e1, + 0x20e1, 0x20e5, 0x20f0, 0x2102, 0x2102, 0x2107, 0x2107, 0x210a, + 0x2113, 0x2115, 0x2115, 0x2118, 0x211d, 0x2124, 0x2124, 0x2126, + 0x2126, 0x2128, 0x2128, 0x212a, 0x2139, 0x213c, 0x213f, 0x2145, + 0x2149, 0x214e, 0x214e, 0x2160, 0x2188, 0x2c00, 0x2c2e, 0x2c30, + 0x2c5e, 0x2c60, 0x2ce4, 0x2ceb, 0x2cf3, 0x2d00, 0x2d25, 0x2d27, + 0x2d27, 0x2d2d, 0x2d2d, 0x2d30, 0x2d67, 0x2d6f, 0x2d6f, 0x2d7f, + 0x2d96, 0x2da0, 0x2da6, 0x2da8, 0x2dae, 0x2db0, 0x2db6, 0x2db8, + 0x2dbe, 0x2dc0, 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, 0x2dd6, 0x2dd8, + 0x2dde, 0x2de0, 0x2dff, 0x3005, 0x3007, 0x3021, 0x302f, 0x3031, + 0x3035, 0x3038, 0x303c, 0x3041, 0x3096, 0x3099, 0x309a, 0x309d, + 0x309f, 0x30a1, 0x30fa, 0x30fc, 0x30ff, 0x3105, 0x312d, 0x3131, + 0x318e, 0x31a0, 0x31ba, 0x31f0, 0x31ff, 0x3400, 0x4db5, 0x4e00, + 0x9fd5, 0xa000, 0xa48c, 0xa4d0, 0xa4fd, 0xa500, 0xa60c, 0xa610, + 0xa62b, 0xa640, 0xa66f, 0xa674, 0xa67d, 0xa67f, 0xa6f1, 0xa717, + 0xa71f, 0xa722, 0xa788, 0xa78b, 0xa7ae, 0xa7b0, 0xa7b7, 0xa7f7, + 0xa827, 0xa840, 0xa873, 0xa880, 0xa8c5, 0xa8d0, 0xa8d9, 0xa8e0, + 0xa8f7, 0xa8fb, 0xa8fb, 0xa8fd, 0xa8fd, 0xa900, 0xa92d, 0xa930, + 0xa953, 0xa960, 0xa97c, 0xa980, 0xa9c0, 0xa9cf, 0xa9d9, 0xa9e0, + 0xa9fe, 0xaa00, 0xaa36, 0xaa40, 0xaa4d, 0xaa50, 0xaa59, 0xaa60, + 0xaa76, 0xaa7a, 0xaac2, 0xaadb, 0xaadd, 0xaae0, 0xaaef, 0xaaf2, + 0xaaf6, 0xab01, 0xab06, 0xab09, 0xab0e, 0xab11, 0xab16, 0xab20, + 0xab26, 0xab28, 0xab2e, 0xab30, 0xab5a, 0xab5c, 0xab65, 0xab70, + 0xabea, 0xabec, 0xabed, 0xabf0, 0xabf9, 0xac00, 0xd7a3, 0xd7b0, + 0xd7c6, 0xd7cb, 0xd7fb, 0xf900, 0xfa6d, 0xfa70, 0xfad9, 0xfb00, + 0xfb06, 0xfb13, 0xfb17, 0xfb1d, 0xfb28, 0xfb2a, 0xfb36, 0xfb38, + 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, + 0xfbb1, 0xfbd3, 0xfc5d, 0xfc64, 0xfd3d, 0xfd50, 0xfd8f, 0xfd92, + 0xfdc7, 0xfdf0, 0xfdf9, 0xfe00, 0xfe0f, 0xfe20, 0xfe2f, 0xfe33, + 0xfe34, 0xfe4d, 0xfe4f, 0xfe71, 0xfe71, 0xfe73, 0xfe73, 0xfe77, + 0xfe77, 0xfe79, 0xfe79, 0xfe7b, 0xfe7b, 0xfe7d, 0xfe7d, 0xfe7f, + 0xfefc, 0xff10, 0xff19, 0xff21, 0xff3a, 0xff3f, 0xff3f, 0xff41, + 0xff5a, 0xff66, 0xffbe, 0xffc2, 0xffc7, 0xffca, 0xffcf, 0xffd2, + 0xffd7, 0xffda, 0xffdc, 0x10000, 0x1000b, 0x1000d, 0x10026, 0x10028, + 0x1003a, 0x1003c, 0x1003d, 0x1003f, 0x1004d, 0x10050, 0x1005d, 0x10080, + 0x100fa, 0x10140, 0x10174, 0x101fd, 0x101fd, 0x10280, 0x1029c, 0x102a0, + 0x102d0, 0x102e0, 0x102e0, 0x10300, 0x1031f, 0x10330, 0x1034a, 0x10350, + 0x1037a, 0x10380, 0x1039d, 0x103a0, 0x103c3, 0x103c8, 0x103cf, 0x103d1, + 0x103d5, 0x10400, 0x1049d, 0x104a0, 0x104a9, 0x104b0, 0x104d3, 0x104d8, + 0x104fb, 0x10500, 0x10527, 0x10530, 0x10563, 0x10600, 0x10736, 0x10740, + 0x10755, 0x10760, 0x10767, 0x10800, 0x10805, 0x10808, 0x10808, 0x1080a, + 0x10835, 0x10837, 0x10838, 0x1083c, 0x1083c, 0x1083f, 0x10855, 0x10860, + 0x10876, 0x10880, 0x1089e, 0x108e0, 0x108f2, 0x108f4, 0x108f5, 0x10900, + 0x10915, 0x10920, 0x10939, 0x10980, 0x109b7, 0x109be, 0x109bf, 0x10a00, + 0x10a03, 0x10a05, 0x10a06, 0x10a0c, 0x10a13, 0x10a15, 0x10a17, 0x10a19, + 0x10a33, 0x10a38, 0x10a3a, 0x10a3f, 0x10a3f, 0x10a60, 0x10a7c, 0x10a80, + 0x10a9c, 0x10ac0, 0x10ac7, 0x10ac9, 0x10ae6, 0x10b00, 0x10b35, 0x10b40, + 0x10b55, 0x10b60, 0x10b72, 0x10b80, 0x10b91, 0x10c00, 0x10c48, 0x10c80, + 0x10cb2, 0x10cc0, 0x10cf2, 0x11000, 0x11046, 0x11066, 0x1106f, 0x1107f, + 0x110ba, 0x110d0, 0x110e8, 0x110f0, 0x110f9, 0x11100, 0x11134, 0x11136, + 0x1113f, 0x11150, 0x11173, 0x11176, 0x11176, 0x11180, 0x111c4, 0x111ca, + 0x111cc, 0x111d0, 0x111da, 0x111dc, 0x111dc, 0x11200, 0x11211, 0x11213, + 0x11237, 0x1123e, 0x1123e, 0x11280, 0x11286, 0x11288, 0x11288, 0x1128a, + 0x1128d, 0x1128f, 0x1129d, 0x1129f, 0x112a8, 0x112b0, 0x112ea, 0x112f0, + 0x112f9, 0x11300, 0x11303, 0x11305, 0x1130c, 0x1130f, 0x11310, 0x11313, + 0x11328, 0x1132a, 0x11330, 0x11332, 0x11333, 0x11335, 0x11339, 0x1133c, + 0x11344, 0x11347, 0x11348, 0x1134b, 0x1134d, 0x11350, 0x11350, 0x11357, + 0x11357, 0x1135d, 0x11363, 0x11366, 0x1136c, 0x11370, 0x11374, 0x11400, + 0x1144a, 0x11450, 0x11459, 0x11480, 0x114c5, 0x114c7, 0x114c7, 0x114d0, + 0x114d9, 0x11580, 0x115b5, 0x115b8, 0x115c0, 0x115d8, 0x115dd, 0x11600, + 0x11640, 0x11644, 0x11644, 0x11650, 0x11659, 0x11680, 0x116b7, 0x116c0, + 0x116c9, 0x11700, 0x11719, 0x1171d, 0x1172b, 0x11730, 0x11739, 0x118a0, + 0x118e9, 0x118ff, 0x118ff, 0x11ac0, 0x11af8, 0x11c00, 0x11c08, 0x11c0a, + 0x11c36, 0x11c38, 0x11c40, 0x11c50, 0x11c59, 0x11c72, 0x11c8f, 0x11c92, + 0x11ca7, 0x11ca9, 0x11cb6, 0x12000, 0x12399, 0x12400, 0x1246e, 0x12480, + 0x12543, 0x13000, 0x1342e, 0x14400, 0x14646, 0x16800, 0x16a38, 0x16a40, + 0x16a5e, 0x16a60, 0x16a69, 0x16ad0, 0x16aed, 0x16af0, 0x16af4, 0x16b00, + 0x16b36, 0x16b40, 0x16b43, 0x16b50, 0x16b59, 0x16b63, 0x16b77, 0x16b7d, + 0x16b8f, 0x16f00, 0x16f44, 0x16f50, 0x16f7e, 0x16f8f, 0x16f9f, 0x16fe0, + 0x16fe0, 0x17000, 0x187ec, 0x18800, 0x18af2, 0x1b000, 0x1b001, 0x1bc00, + 0x1bc6a, 0x1bc70, 0x1bc7c, 0x1bc80, 0x1bc88, 0x1bc90, 0x1bc99, 0x1bc9d, + 0x1bc9e, 0x1d165, 0x1d169, 0x1d16d, 0x1d172, 0x1d17b, 0x1d182, 0x1d185, + 0x1d18b, 0x1d1aa, 0x1d1ad, 0x1d242, 0x1d244, 0x1d400, 0x1d454, 0x1d456, + 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, + 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, + 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, + 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, 0x1d544, 0x1d546, 0x1d546, 0x1d54a, + 0x1d550, 0x1d552, 0x1d6a5, 0x1d6a8, 0x1d6c0, 0x1d6c2, 0x1d6da, 0x1d6dc, + 0x1d6fa, 0x1d6fc, 0x1d714, 0x1d716, 0x1d734, 0x1d736, 0x1d74e, 0x1d750, + 0x1d76e, 0x1d770, 0x1d788, 0x1d78a, 0x1d7a8, 0x1d7aa, 0x1d7c2, 0x1d7c4, + 0x1d7cb, 0x1d7ce, 0x1d7ff, 0x1da00, 0x1da36, 0x1da3b, 0x1da6c, 0x1da75, + 0x1da75, 0x1da84, 0x1da84, 0x1da9b, 0x1da9f, 0x1daa1, 0x1daaf, 0x1e000, + 0x1e006, 0x1e008, 0x1e018, 0x1e01b, 0x1e021, 0x1e023, 0x1e024, 0x1e026, + 0x1e02a, 0x1e800, 0x1e8c4, 0x1e8d0, 0x1e8d6, 0x1e900, 0x1e94a, 0x1e950, + 0x1e959, 0x1ee00, 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, 0x1ee22, 0x1ee24, + 0x1ee24, 0x1ee27, 0x1ee27, 0x1ee29, 0x1ee32, 0x1ee34, 0x1ee37, 0x1ee39, + 0x1ee39, 0x1ee3b, 0x1ee3b, 0x1ee42, 0x1ee42, 0x1ee47, 0x1ee47, 0x1ee49, + 0x1ee49, 0x1ee4b, 0x1ee4b, 0x1ee4d, 0x1ee4f, 0x1ee51, 0x1ee52, 0x1ee54, + 0x1ee54, 0x1ee57, 0x1ee57, 0x1ee59, 0x1ee59, 0x1ee5b, 0x1ee5b, 0x1ee5d, + 0x1ee5d, 0x1ee5f, 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, 0x1ee64, 0x1ee67, + 0x1ee6a, 0x1ee6c, 0x1ee72, 0x1ee74, 0x1ee77, 0x1ee79, 0x1ee7c, 0x1ee7e, + 0x1ee7e, 0x1ee80, 0x1ee89, 0x1ee8b, 0x1ee9b, 0x1eea1, 0x1eea3, 0x1eea5, + 0x1eea9, 0x1eeab, 0x1eebb, 0x20000, 0x2a6d6, 0x2a700, 0x2b734, 0x2b740, + 0x2b81d, 0x2b820, 0x2cea1, 0x2f800, 0x2fa1d, 0xe0100, 0xe01ef, +}; /* CR_XID_Continue */ + +/* 'Default_Ignorable_Code_Point': Derived Property */ +static const OnigCodePoint CR_Default_Ignorable_Code_Point[] = { + 17, 0x00ad, 0x00ad, 0x034f, 0x034f, 0x061c, 0x061c, + 0x115f, 0x1160, 0x17b4, 0x17b5, 0x180b, 0x180e, 0x200b, + 0x200f, 0x202a, 0x202e, 0x2060, 0x206f, 0x3164, 0x3164, + 0xfe00, 0xfe0f, 0xfeff, 0xfeff, 0xffa0, 0xffa0, 0xfff0, + 0xfff8, 0x1bca0, 0x1bca3, 0x1d173, 0x1d17a, 0xe0000, 0xe0fff, +}; /* CR_Default_Ignorable_Code_Point */ + +/* 'Grapheme_Extend': Derived Property */ +static const OnigCodePoint CR_Grapheme_Extend[] = { + 303, 0x0300, 0x036f, 0x0483, 0x0489, 0x0591, 0x05bd, 0x05bf, + 0x05bf, 0x05c1, 0x05c2, 0x05c4, 0x05c5, 0x05c7, 0x05c7, 0x0610, + 0x061a, 0x064b, 0x065f, 0x0670, 0x0670, 0x06d6, 0x06dc, 0x06df, + 0x06e4, 0x06e7, 0x06e8, 0x06ea, 0x06ed, 0x0711, 0x0711, 0x0730, + 0x074a, 0x07a6, 0x07b0, 0x07eb, 0x07f3, 0x0816, 0x0819, 0x081b, + 0x0823, 0x0825, 0x0827, 0x0829, 0x082d, 0x0859, 0x085b, 0x08d4, + 0x08e1, 0x08e3, 0x0902, 0x093a, 0x093a, 0x093c, 0x093c, 0x0941, + 0x0948, 0x094d, 0x094d, 0x0951, 0x0957, 0x0962, 0x0963, 0x0981, + 0x0981, 0x09bc, 0x09bc, 0x09be, 0x09be, 0x09c1, 0x09c4, 0x09cd, + 0x09cd, 0x09d7, 0x09d7, 0x09e2, 0x09e3, 0x0a01, 0x0a02, 0x0a3c, + 0x0a3c, 0x0a41, 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4d, 0x0a51, + 0x0a51, 0x0a70, 0x0a71, 0x0a75, 0x0a75, 0x0a81, 0x0a82, 0x0abc, + 0x0abc, 0x0ac1, 0x0ac5, 0x0ac7, 0x0ac8, 0x0acd, 0x0acd, 0x0ae2, + 0x0ae3, 0x0b01, 0x0b01, 0x0b3c, 0x0b3c, 0x0b3e, 0x0b3f, 0x0b41, + 0x0b44, 0x0b4d, 0x0b4d, 0x0b56, 0x0b57, 0x0b62, 0x0b63, 0x0b82, + 0x0b82, 0x0bbe, 0x0bbe, 0x0bc0, 0x0bc0, 0x0bcd, 0x0bcd, 0x0bd7, + 0x0bd7, 0x0c00, 0x0c00, 0x0c3e, 0x0c40, 0x0c46, 0x0c48, 0x0c4a, + 0x0c4d, 0x0c55, 0x0c56, 0x0c62, 0x0c63, 0x0c81, 0x0c81, 0x0cbc, + 0x0cbc, 0x0cbf, 0x0cbf, 0x0cc2, 0x0cc2, 0x0cc6, 0x0cc6, 0x0ccc, + 0x0ccd, 0x0cd5, 0x0cd6, 0x0ce2, 0x0ce3, 0x0d01, 0x0d01, 0x0d3e, + 0x0d3e, 0x0d41, 0x0d44, 0x0d4d, 0x0d4d, 0x0d57, 0x0d57, 0x0d62, + 0x0d63, 0x0dca, 0x0dca, 0x0dcf, 0x0dcf, 0x0dd2, 0x0dd4, 0x0dd6, + 0x0dd6, 0x0ddf, 0x0ddf, 0x0e31, 0x0e31, 0x0e34, 0x0e3a, 0x0e47, + 0x0e4e, 0x0eb1, 0x0eb1, 0x0eb4, 0x0eb9, 0x0ebb, 0x0ebc, 0x0ec8, + 0x0ecd, 0x0f18, 0x0f19, 0x0f35, 0x0f35, 0x0f37, 0x0f37, 0x0f39, + 0x0f39, 0x0f71, 0x0f7e, 0x0f80, 0x0f84, 0x0f86, 0x0f87, 0x0f8d, + 0x0f97, 0x0f99, 0x0fbc, 0x0fc6, 0x0fc6, 0x102d, 0x1030, 0x1032, + 0x1037, 0x1039, 0x103a, 0x103d, 0x103e, 0x1058, 0x1059, 0x105e, + 0x1060, 0x1071, 0x1074, 0x1082, 0x1082, 0x1085, 0x1086, 0x108d, + 0x108d, 0x109d, 0x109d, 0x135d, 0x135f, 0x1712, 0x1714, 0x1732, + 0x1734, 0x1752, 0x1753, 0x1772, 0x1773, 0x17b4, 0x17b5, 0x17b7, + 0x17bd, 0x17c6, 0x17c6, 0x17c9, 0x17d3, 0x17dd, 0x17dd, 0x180b, + 0x180d, 0x1885, 0x1886, 0x18a9, 0x18a9, 0x1920, 0x1922, 0x1927, + 0x1928, 0x1932, 0x1932, 0x1939, 0x193b, 0x1a17, 0x1a18, 0x1a1b, + 0x1a1b, 0x1a56, 0x1a56, 0x1a58, 0x1a5e, 0x1a60, 0x1a60, 0x1a62, + 0x1a62, 0x1a65, 0x1a6c, 0x1a73, 0x1a7c, 0x1a7f, 0x1a7f, 0x1ab0, + 0x1abe, 0x1b00, 0x1b03, 0x1b34, 0x1b34, 0x1b36, 0x1b3a, 0x1b3c, + 0x1b3c, 0x1b42, 0x1b42, 0x1b6b, 0x1b73, 0x1b80, 0x1b81, 0x1ba2, + 0x1ba5, 0x1ba8, 0x1ba9, 0x1bab, 0x1bad, 0x1be6, 0x1be6, 0x1be8, + 0x1be9, 0x1bed, 0x1bed, 0x1bef, 0x1bf1, 0x1c2c, 0x1c33, 0x1c36, + 0x1c37, 0x1cd0, 0x1cd2, 0x1cd4, 0x1ce0, 0x1ce2, 0x1ce8, 0x1ced, + 0x1ced, 0x1cf4, 0x1cf4, 0x1cf8, 0x1cf9, 0x1dc0, 0x1df5, 0x1dfb, + 0x1dff, 0x200c, 0x200c, 0x20d0, 0x20f0, 0x2cef, 0x2cf1, 0x2d7f, + 0x2d7f, 0x2de0, 0x2dff, 0x302a, 0x302f, 0x3099, 0x309a, 0xa66f, + 0xa672, 0xa674, 0xa67d, 0xa69e, 0xa69f, 0xa6f0, 0xa6f1, 0xa802, + 0xa802, 0xa806, 0xa806, 0xa80b, 0xa80b, 0xa825, 0xa826, 0xa8c4, + 0xa8c5, 0xa8e0, 0xa8f1, 0xa926, 0xa92d, 0xa947, 0xa951, 0xa980, + 0xa982, 0xa9b3, 0xa9b3, 0xa9b6, 0xa9b9, 0xa9bc, 0xa9bc, 0xa9e5, + 0xa9e5, 0xaa29, 0xaa2e, 0xaa31, 0xaa32, 0xaa35, 0xaa36, 0xaa43, + 0xaa43, 0xaa4c, 0xaa4c, 0xaa7c, 0xaa7c, 0xaab0, 0xaab0, 0xaab2, + 0xaab4, 0xaab7, 0xaab8, 0xaabe, 0xaabf, 0xaac1, 0xaac1, 0xaaec, + 0xaaed, 0xaaf6, 0xaaf6, 0xabe5, 0xabe5, 0xabe8, 0xabe8, 0xabed, + 0xabed, 0xfb1e, 0xfb1e, 0xfe00, 0xfe0f, 0xfe20, 0xfe2f, 0xff9e, + 0xff9f, 0x101fd, 0x101fd, 0x102e0, 0x102e0, 0x10376, 0x1037a, 0x10a01, + 0x10a03, 0x10a05, 0x10a06, 0x10a0c, 0x10a0f, 0x10a38, 0x10a3a, 0x10a3f, + 0x10a3f, 0x10ae5, 0x10ae6, 0x11001, 0x11001, 0x11038, 0x11046, 0x1107f, + 0x11081, 0x110b3, 0x110b6, 0x110b9, 0x110ba, 0x11100, 0x11102, 0x11127, + 0x1112b, 0x1112d, 0x11134, 0x11173, 0x11173, 0x11180, 0x11181, 0x111b6, + 0x111be, 0x111ca, 0x111cc, 0x1122f, 0x11231, 0x11234, 0x11234, 0x11236, + 0x11237, 0x1123e, 0x1123e, 0x112df, 0x112df, 0x112e3, 0x112ea, 0x11300, + 0x11301, 0x1133c, 0x1133c, 0x1133e, 0x1133e, 0x11340, 0x11340, 0x11357, + 0x11357, 0x11366, 0x1136c, 0x11370, 0x11374, 0x11438, 0x1143f, 0x11442, + 0x11444, 0x11446, 0x11446, 0x114b0, 0x114b0, 0x114b3, 0x114b8, 0x114ba, + 0x114ba, 0x114bd, 0x114bd, 0x114bf, 0x114c0, 0x114c2, 0x114c3, 0x115af, + 0x115af, 0x115b2, 0x115b5, 0x115bc, 0x115bd, 0x115bf, 0x115c0, 0x115dc, + 0x115dd, 0x11633, 0x1163a, 0x1163d, 0x1163d, 0x1163f, 0x11640, 0x116ab, + 0x116ab, 0x116ad, 0x116ad, 0x116b0, 0x116b5, 0x116b7, 0x116b7, 0x1171d, + 0x1171f, 0x11722, 0x11725, 0x11727, 0x1172b, 0x11c30, 0x11c36, 0x11c38, + 0x11c3d, 0x11c3f, 0x11c3f, 0x11c92, 0x11ca7, 0x11caa, 0x11cb0, 0x11cb2, + 0x11cb3, 0x11cb5, 0x11cb6, 0x16af0, 0x16af4, 0x16b30, 0x16b36, 0x16f8f, + 0x16f92, 0x1bc9d, 0x1bc9e, 0x1d165, 0x1d165, 0x1d167, 0x1d169, 0x1d16e, + 0x1d172, 0x1d17b, 0x1d182, 0x1d185, 0x1d18b, 0x1d1aa, 0x1d1ad, 0x1d242, + 0x1d244, 0x1da00, 0x1da36, 0x1da3b, 0x1da6c, 0x1da75, 0x1da75, 0x1da84, + 0x1da84, 0x1da9b, 0x1da9f, 0x1daa1, 0x1daaf, 0x1e000, 0x1e006, 0x1e008, + 0x1e018, 0x1e01b, 0x1e021, 0x1e023, 0x1e024, 0x1e026, 0x1e02a, 0x1e8d0, + 0x1e8d6, 0x1e944, 0x1e94a, 0xe0020, 0xe007f, 0xe0100, 0xe01ef, +}; /* CR_Grapheme_Extend */ + +/* 'Grapheme_Base': Derived Property */ +static const OnigCodePoint CR_Grapheme_Base[] = { + 772, 0x0020, 0x007e, 0x00a0, 0x00ac, 0x00ae, 0x02ff, 0x0370, + 0x0377, 0x037a, 0x037f, 0x0384, 0x038a, 0x038c, 0x038c, 0x038e, + 0x03a1, 0x03a3, 0x0482, 0x048a, 0x052f, 0x0531, 0x0556, 0x0559, + 0x055f, 0x0561, 0x0587, 0x0589, 0x058a, 0x058d, 0x058f, 0x05be, + 0x05be, 0x05c0, 0x05c0, 0x05c3, 0x05c3, 0x05c6, 0x05c6, 0x05d0, + 0x05ea, 0x05f0, 0x05f4, 0x0606, 0x060f, 0x061b, 0x061b, 0x061e, + 0x064a, 0x0660, 0x066f, 0x0671, 0x06d5, 0x06de, 0x06de, 0x06e5, + 0x06e6, 0x06e9, 0x06e9, 0x06ee, 0x070d, 0x0710, 0x0710, 0x0712, + 0x072f, 0x074d, 0x07a5, 0x07b1, 0x07b1, 0x07c0, 0x07ea, 0x07f4, + 0x07fa, 0x0800, 0x0815, 0x081a, 0x081a, 0x0824, 0x0824, 0x0828, + 0x0828, 0x0830, 0x083e, 0x0840, 0x0858, 0x085e, 0x085e, 0x08a0, + 0x08b4, 0x08b6, 0x08bd, 0x0903, 0x0939, 0x093b, 0x093b, 0x093d, + 0x0940, 0x0949, 0x094c, 0x094e, 0x0950, 0x0958, 0x0961, 0x0964, + 0x0980, 0x0982, 0x0983, 0x0985, 0x098c, 0x098f, 0x0990, 0x0993, + 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, 0x09b9, 0x09bd, + 0x09bd, 0x09bf, 0x09c0, 0x09c7, 0x09c8, 0x09cb, 0x09cc, 0x09ce, + 0x09ce, 0x09dc, 0x09dd, 0x09df, 0x09e1, 0x09e6, 0x09fb, 0x0a03, + 0x0a03, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, + 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3e, + 0x0a40, 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, 0x0a6f, 0x0a72, + 0x0a74, 0x0a83, 0x0a83, 0x0a85, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, + 0x0aa8, 0x0aaa, 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abd, + 0x0ac0, 0x0ac9, 0x0ac9, 0x0acb, 0x0acc, 0x0ad0, 0x0ad0, 0x0ae0, + 0x0ae1, 0x0ae6, 0x0af1, 0x0af9, 0x0af9, 0x0b02, 0x0b03, 0x0b05, + 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, 0x0b28, 0x0b2a, 0x0b30, 0x0b32, + 0x0b33, 0x0b35, 0x0b39, 0x0b3d, 0x0b3d, 0x0b40, 0x0b40, 0x0b47, + 0x0b48, 0x0b4b, 0x0b4c, 0x0b5c, 0x0b5d, 0x0b5f, 0x0b61, 0x0b66, + 0x0b77, 0x0b83, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, + 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, + 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, 0x0bb9, 0x0bbf, 0x0bbf, 0x0bc1, + 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, 0x0bcc, 0x0bd0, 0x0bd0, 0x0be6, + 0x0bfa, 0x0c01, 0x0c03, 0x0c05, 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, + 0x0c28, 0x0c2a, 0x0c39, 0x0c3d, 0x0c3d, 0x0c41, 0x0c44, 0x0c58, + 0x0c5a, 0x0c60, 0x0c61, 0x0c66, 0x0c6f, 0x0c78, 0x0c80, 0x0c82, + 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, 0x0ca8, 0x0caa, + 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbd, 0x0cbe, 0x0cc0, 0x0cc1, 0x0cc3, + 0x0cc4, 0x0cc7, 0x0cc8, 0x0cca, 0x0ccb, 0x0cde, 0x0cde, 0x0ce0, + 0x0ce1, 0x0ce6, 0x0cef, 0x0cf1, 0x0cf2, 0x0d02, 0x0d03, 0x0d05, + 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d3a, 0x0d3d, 0x0d3d, 0x0d3f, + 0x0d40, 0x0d46, 0x0d48, 0x0d4a, 0x0d4c, 0x0d4e, 0x0d4f, 0x0d54, + 0x0d56, 0x0d58, 0x0d61, 0x0d66, 0x0d7f, 0x0d82, 0x0d83, 0x0d85, + 0x0d96, 0x0d9a, 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, + 0x0dc6, 0x0dd0, 0x0dd1, 0x0dd8, 0x0dde, 0x0de6, 0x0def, 0x0df2, + 0x0df4, 0x0e01, 0x0e30, 0x0e32, 0x0e33, 0x0e3f, 0x0e46, 0x0e4f, + 0x0e5b, 0x0e81, 0x0e82, 0x0e84, 0x0e84, 0x0e87, 0x0e88, 0x0e8a, + 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, + 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, + 0x0eb0, 0x0eb2, 0x0eb3, 0x0ebd, 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, + 0x0ec6, 0x0ed0, 0x0ed9, 0x0edc, 0x0edf, 0x0f00, 0x0f17, 0x0f1a, + 0x0f34, 0x0f36, 0x0f36, 0x0f38, 0x0f38, 0x0f3a, 0x0f47, 0x0f49, + 0x0f6c, 0x0f7f, 0x0f7f, 0x0f85, 0x0f85, 0x0f88, 0x0f8c, 0x0fbe, + 0x0fc5, 0x0fc7, 0x0fcc, 0x0fce, 0x0fda, 0x1000, 0x102c, 0x1031, + 0x1031, 0x1038, 0x1038, 0x103b, 0x103c, 0x103f, 0x1057, 0x105a, + 0x105d, 0x1061, 0x1070, 0x1075, 0x1081, 0x1083, 0x1084, 0x1087, + 0x108c, 0x108e, 0x109c, 0x109e, 0x10c5, 0x10c7, 0x10c7, 0x10cd, + 0x10cd, 0x10d0, 0x1248, 0x124a, 0x124d, 0x1250, 0x1256, 0x1258, + 0x1258, 0x125a, 0x125d, 0x1260, 0x1288, 0x128a, 0x128d, 0x1290, + 0x12b0, 0x12b2, 0x12b5, 0x12b8, 0x12be, 0x12c0, 0x12c0, 0x12c2, + 0x12c5, 0x12c8, 0x12d6, 0x12d8, 0x1310, 0x1312, 0x1315, 0x1318, + 0x135a, 0x1360, 0x137c, 0x1380, 0x1399, 0x13a0, 0x13f5, 0x13f8, + 0x13fd, 0x1400, 0x169c, 0x16a0, 0x16f8, 0x1700, 0x170c, 0x170e, + 0x1711, 0x1720, 0x1731, 0x1735, 0x1736, 0x1740, 0x1751, 0x1760, + 0x176c, 0x176e, 0x1770, 0x1780, 0x17b3, 0x17b6, 0x17b6, 0x17be, + 0x17c5, 0x17c7, 0x17c8, 0x17d4, 0x17dc, 0x17e0, 0x17e9, 0x17f0, + 0x17f9, 0x1800, 0x180a, 0x1810, 0x1819, 0x1820, 0x1877, 0x1880, + 0x1884, 0x1887, 0x18a8, 0x18aa, 0x18aa, 0x18b0, 0x18f5, 0x1900, + 0x191e, 0x1923, 0x1926, 0x1929, 0x192b, 0x1930, 0x1931, 0x1933, + 0x1938, 0x1940, 0x1940, 0x1944, 0x196d, 0x1970, 0x1974, 0x1980, + 0x19ab, 0x19b0, 0x19c9, 0x19d0, 0x19da, 0x19de, 0x1a16, 0x1a19, + 0x1a1a, 0x1a1e, 0x1a55, 0x1a57, 0x1a57, 0x1a61, 0x1a61, 0x1a63, + 0x1a64, 0x1a6d, 0x1a72, 0x1a80, 0x1a89, 0x1a90, 0x1a99, 0x1aa0, + 0x1aad, 0x1b04, 0x1b33, 0x1b35, 0x1b35, 0x1b3b, 0x1b3b, 0x1b3d, + 0x1b41, 0x1b43, 0x1b4b, 0x1b50, 0x1b6a, 0x1b74, 0x1b7c, 0x1b82, + 0x1ba1, 0x1ba6, 0x1ba7, 0x1baa, 0x1baa, 0x1bae, 0x1be5, 0x1be7, + 0x1be7, 0x1bea, 0x1bec, 0x1bee, 0x1bee, 0x1bf2, 0x1bf3, 0x1bfc, + 0x1c2b, 0x1c34, 0x1c35, 0x1c3b, 0x1c49, 0x1c4d, 0x1c88, 0x1cc0, + 0x1cc7, 0x1cd3, 0x1cd3, 0x1ce1, 0x1ce1, 0x1ce9, 0x1cec, 0x1cee, + 0x1cf3, 0x1cf5, 0x1cf6, 0x1d00, 0x1dbf, 0x1e00, 0x1f15, 0x1f18, + 0x1f1d, 0x1f20, 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, + 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, + 0x1fb4, 0x1fb6, 0x1fc4, 0x1fc6, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fdd, + 0x1fef, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ffe, 0x2000, 0x200a, 0x2010, + 0x2027, 0x202f, 0x205f, 0x2070, 0x2071, 0x2074, 0x208e, 0x2090, + 0x209c, 0x20a0, 0x20be, 0x2100, 0x218b, 0x2190, 0x23fe, 0x2400, + 0x2426, 0x2440, 0x244a, 0x2460, 0x2b73, 0x2b76, 0x2b95, 0x2b98, + 0x2bb9, 0x2bbd, 0x2bc8, 0x2bca, 0x2bd1, 0x2bec, 0x2bef, 0x2c00, + 0x2c2e, 0x2c30, 0x2c5e, 0x2c60, 0x2cee, 0x2cf2, 0x2cf3, 0x2cf9, + 0x2d25, 0x2d27, 0x2d27, 0x2d2d, 0x2d2d, 0x2d30, 0x2d67, 0x2d6f, + 0x2d70, 0x2d80, 0x2d96, 0x2da0, 0x2da6, 0x2da8, 0x2dae, 0x2db0, + 0x2db6, 0x2db8, 0x2dbe, 0x2dc0, 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, + 0x2dd6, 0x2dd8, 0x2dde, 0x2e00, 0x2e44, 0x2e80, 0x2e99, 0x2e9b, + 0x2ef3, 0x2f00, 0x2fd5, 0x2ff0, 0x2ffb, 0x3000, 0x3029, 0x3030, + 0x303f, 0x3041, 0x3096, 0x309b, 0x30ff, 0x3105, 0x312d, 0x3131, + 0x318e, 0x3190, 0x31ba, 0x31c0, 0x31e3, 0x31f0, 0x321e, 0x3220, + 0x32fe, 0x3300, 0x4db5, 0x4dc0, 0x9fd5, 0xa000, 0xa48c, 0xa490, + 0xa4c6, 0xa4d0, 0xa62b, 0xa640, 0xa66e, 0xa673, 0xa673, 0xa67e, + 0xa69d, 0xa6a0, 0xa6ef, 0xa6f2, 0xa6f7, 0xa700, 0xa7ae, 0xa7b0, + 0xa7b7, 0xa7f7, 0xa801, 0xa803, 0xa805, 0xa807, 0xa80a, 0xa80c, + 0xa824, 0xa827, 0xa82b, 0xa830, 0xa839, 0xa840, 0xa877, 0xa880, + 0xa8c3, 0xa8ce, 0xa8d9, 0xa8f2, 0xa8fd, 0xa900, 0xa925, 0xa92e, + 0xa946, 0xa952, 0xa953, 0xa95f, 0xa97c, 0xa983, 0xa9b2, 0xa9b4, + 0xa9b5, 0xa9ba, 0xa9bb, 0xa9bd, 0xa9cd, 0xa9cf, 0xa9d9, 0xa9de, + 0xa9e4, 0xa9e6, 0xa9fe, 0xaa00, 0xaa28, 0xaa2f, 0xaa30, 0xaa33, + 0xaa34, 0xaa40, 0xaa42, 0xaa44, 0xaa4b, 0xaa4d, 0xaa4d, 0xaa50, + 0xaa59, 0xaa5c, 0xaa7b, 0xaa7d, 0xaaaf, 0xaab1, 0xaab1, 0xaab5, + 0xaab6, 0xaab9, 0xaabd, 0xaac0, 0xaac0, 0xaac2, 0xaac2, 0xaadb, + 0xaaeb, 0xaaee, 0xaaf5, 0xab01, 0xab06, 0xab09, 0xab0e, 0xab11, + 0xab16, 0xab20, 0xab26, 0xab28, 0xab2e, 0xab30, 0xab65, 0xab70, + 0xabe4, 0xabe6, 0xabe7, 0xabe9, 0xabec, 0xabf0, 0xabf9, 0xac00, + 0xd7a3, 0xd7b0, 0xd7c6, 0xd7cb, 0xd7fb, 0xf900, 0xfa6d, 0xfa70, + 0xfad9, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xfb1d, 0xfb1d, 0xfb1f, + 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, + 0xfb44, 0xfb46, 0xfbc1, 0xfbd3, 0xfd3f, 0xfd50, 0xfd8f, 0xfd92, + 0xfdc7, 0xfdf0, 0xfdfd, 0xfe10, 0xfe19, 0xfe30, 0xfe52, 0xfe54, + 0xfe66, 0xfe68, 0xfe6b, 0xfe70, 0xfe74, 0xfe76, 0xfefc, 0xff01, + 0xff9d, 0xffa0, 0xffbe, 0xffc2, 0xffc7, 0xffca, 0xffcf, 0xffd2, + 0xffd7, 0xffda, 0xffdc, 0xffe0, 0xffe6, 0xffe8, 0xffee, 0xfffc, + 0xfffd, 0x10000, 0x1000b, 0x1000d, 0x10026, 0x10028, 0x1003a, 0x1003c, + 0x1003d, 0x1003f, 0x1004d, 0x10050, 0x1005d, 0x10080, 0x100fa, 0x10100, + 0x10102, 0x10107, 0x10133, 0x10137, 0x1018e, 0x10190, 0x1019b, 0x101a0, + 0x101a0, 0x101d0, 0x101fc, 0x10280, 0x1029c, 0x102a0, 0x102d0, 0x102e1, + 0x102fb, 0x10300, 0x10323, 0x10330, 0x1034a, 0x10350, 0x10375, 0x10380, + 0x1039d, 0x1039f, 0x103c3, 0x103c8, 0x103d5, 0x10400, 0x1049d, 0x104a0, + 0x104a9, 0x104b0, 0x104d3, 0x104d8, 0x104fb, 0x10500, 0x10527, 0x10530, + 0x10563, 0x1056f, 0x1056f, 0x10600, 0x10736, 0x10740, 0x10755, 0x10760, + 0x10767, 0x10800, 0x10805, 0x10808, 0x10808, 0x1080a, 0x10835, 0x10837, + 0x10838, 0x1083c, 0x1083c, 0x1083f, 0x10855, 0x10857, 0x1089e, 0x108a7, + 0x108af, 0x108e0, 0x108f2, 0x108f4, 0x108f5, 0x108fb, 0x1091b, 0x1091f, + 0x10939, 0x1093f, 0x1093f, 0x10980, 0x109b7, 0x109bc, 0x109cf, 0x109d2, + 0x10a00, 0x10a10, 0x10a13, 0x10a15, 0x10a17, 0x10a19, 0x10a33, 0x10a40, + 0x10a47, 0x10a50, 0x10a58, 0x10a60, 0x10a9f, 0x10ac0, 0x10ae4, 0x10aeb, + 0x10af6, 0x10b00, 0x10b35, 0x10b39, 0x10b55, 0x10b58, 0x10b72, 0x10b78, + 0x10b91, 0x10b99, 0x10b9c, 0x10ba9, 0x10baf, 0x10c00, 0x10c48, 0x10c80, + 0x10cb2, 0x10cc0, 0x10cf2, 0x10cfa, 0x10cff, 0x10e60, 0x10e7e, 0x11000, + 0x11000, 0x11002, 0x11037, 0x11047, 0x1104d, 0x11052, 0x1106f, 0x11082, + 0x110b2, 0x110b7, 0x110b8, 0x110bb, 0x110bc, 0x110be, 0x110c1, 0x110d0, + 0x110e8, 0x110f0, 0x110f9, 0x11103, 0x11126, 0x1112c, 0x1112c, 0x11136, + 0x11143, 0x11150, 0x11172, 0x11174, 0x11176, 0x11182, 0x111b5, 0x111bf, + 0x111c9, 0x111cd, 0x111cd, 0x111d0, 0x111df, 0x111e1, 0x111f4, 0x11200, + 0x11211, 0x11213, 0x1122e, 0x11232, 0x11233, 0x11235, 0x11235, 0x11238, + 0x1123d, 0x11280, 0x11286, 0x11288, 0x11288, 0x1128a, 0x1128d, 0x1128f, + 0x1129d, 0x1129f, 0x112a9, 0x112b0, 0x112de, 0x112e0, 0x112e2, 0x112f0, + 0x112f9, 0x11302, 0x11303, 0x11305, 0x1130c, 0x1130f, 0x11310, 0x11313, + 0x11328, 0x1132a, 0x11330, 0x11332, 0x11333, 0x11335, 0x11339, 0x1133d, + 0x1133d, 0x1133f, 0x1133f, 0x11341, 0x11344, 0x11347, 0x11348, 0x1134b, + 0x1134d, 0x11350, 0x11350, 0x1135d, 0x11363, 0x11400, 0x11437, 0x11440, + 0x11441, 0x11445, 0x11445, 0x11447, 0x11459, 0x1145b, 0x1145b, 0x1145d, + 0x1145d, 0x11480, 0x114af, 0x114b1, 0x114b2, 0x114b9, 0x114b9, 0x114bb, + 0x114bc, 0x114be, 0x114be, 0x114c1, 0x114c1, 0x114c4, 0x114c7, 0x114d0, + 0x114d9, 0x11580, 0x115ae, 0x115b0, 0x115b1, 0x115b8, 0x115bb, 0x115be, + 0x115be, 0x115c1, 0x115db, 0x11600, 0x11632, 0x1163b, 0x1163c, 0x1163e, + 0x1163e, 0x11641, 0x11644, 0x11650, 0x11659, 0x11660, 0x1166c, 0x11680, + 0x116aa, 0x116ac, 0x116ac, 0x116ae, 0x116af, 0x116b6, 0x116b6, 0x116c0, + 0x116c9, 0x11700, 0x11719, 0x11720, 0x11721, 0x11726, 0x11726, 0x11730, + 0x1173f, 0x118a0, 0x118f2, 0x118ff, 0x118ff, 0x11ac0, 0x11af8, 0x11c00, + 0x11c08, 0x11c0a, 0x11c2f, 0x11c3e, 0x11c3e, 0x11c40, 0x11c45, 0x11c50, + 0x11c6c, 0x11c70, 0x11c8f, 0x11ca9, 0x11ca9, 0x11cb1, 0x11cb1, 0x11cb4, + 0x11cb4, 0x12000, 0x12399, 0x12400, 0x1246e, 0x12470, 0x12474, 0x12480, + 0x12543, 0x13000, 0x1342e, 0x14400, 0x14646, 0x16800, 0x16a38, 0x16a40, + 0x16a5e, 0x16a60, 0x16a69, 0x16a6e, 0x16a6f, 0x16ad0, 0x16aed, 0x16af5, + 0x16af5, 0x16b00, 0x16b2f, 0x16b37, 0x16b45, 0x16b50, 0x16b59, 0x16b5b, + 0x16b61, 0x16b63, 0x16b77, 0x16b7d, 0x16b8f, 0x16f00, 0x16f44, 0x16f50, + 0x16f7e, 0x16f93, 0x16f9f, 0x16fe0, 0x16fe0, 0x17000, 0x187ec, 0x18800, + 0x18af2, 0x1b000, 0x1b001, 0x1bc00, 0x1bc6a, 0x1bc70, 0x1bc7c, 0x1bc80, + 0x1bc88, 0x1bc90, 0x1bc99, 0x1bc9c, 0x1bc9c, 0x1bc9f, 0x1bc9f, 0x1d000, + 0x1d0f5, 0x1d100, 0x1d126, 0x1d129, 0x1d164, 0x1d166, 0x1d166, 0x1d16a, + 0x1d16d, 0x1d183, 0x1d184, 0x1d18c, 0x1d1a9, 0x1d1ae, 0x1d1e8, 0x1d200, + 0x1d241, 0x1d245, 0x1d245, 0x1d300, 0x1d356, 0x1d360, 0x1d371, 0x1d400, + 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, + 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, + 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, + 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, 0x1d544, 0x1d546, + 0x1d546, 0x1d54a, 0x1d550, 0x1d552, 0x1d6a5, 0x1d6a8, 0x1d7cb, 0x1d7ce, + 0x1d9ff, 0x1da37, 0x1da3a, 0x1da6d, 0x1da74, 0x1da76, 0x1da83, 0x1da85, + 0x1da8b, 0x1e800, 0x1e8c4, 0x1e8c7, 0x1e8cf, 0x1e900, 0x1e943, 0x1e950, + 0x1e959, 0x1e95e, 0x1e95f, 0x1ee00, 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, + 0x1ee22, 0x1ee24, 0x1ee24, 0x1ee27, 0x1ee27, 0x1ee29, 0x1ee32, 0x1ee34, + 0x1ee37, 0x1ee39, 0x1ee39, 0x1ee3b, 0x1ee3b, 0x1ee42, 0x1ee42, 0x1ee47, + 0x1ee47, 0x1ee49, 0x1ee49, 0x1ee4b, 0x1ee4b, 0x1ee4d, 0x1ee4f, 0x1ee51, + 0x1ee52, 0x1ee54, 0x1ee54, 0x1ee57, 0x1ee57, 0x1ee59, 0x1ee59, 0x1ee5b, + 0x1ee5b, 0x1ee5d, 0x1ee5d, 0x1ee5f, 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, + 0x1ee64, 0x1ee67, 0x1ee6a, 0x1ee6c, 0x1ee72, 0x1ee74, 0x1ee77, 0x1ee79, + 0x1ee7c, 0x1ee7e, 0x1ee7e, 0x1ee80, 0x1ee89, 0x1ee8b, 0x1ee9b, 0x1eea1, + 0x1eea3, 0x1eea5, 0x1eea9, 0x1eeab, 0x1eebb, 0x1eef0, 0x1eef1, 0x1f000, + 0x1f02b, 0x1f030, 0x1f093, 0x1f0a0, 0x1f0ae, 0x1f0b1, 0x1f0bf, 0x1f0c1, + 0x1f0cf, 0x1f0d1, 0x1f0f5, 0x1f100, 0x1f10c, 0x1f110, 0x1f12e, 0x1f130, + 0x1f16b, 0x1f170, 0x1f1ac, 0x1f1e6, 0x1f202, 0x1f210, 0x1f23b, 0x1f240, + 0x1f248, 0x1f250, 0x1f251, 0x1f300, 0x1f6d2, 0x1f6e0, 0x1f6ec, 0x1f6f0, + 0x1f6f6, 0x1f700, 0x1f773, 0x1f780, 0x1f7d4, 0x1f800, 0x1f80b, 0x1f810, + 0x1f847, 0x1f850, 0x1f859, 0x1f860, 0x1f887, 0x1f890, 0x1f8ad, 0x1f910, + 0x1f91e, 0x1f920, 0x1f927, 0x1f930, 0x1f930, 0x1f933, 0x1f93e, 0x1f940, + 0x1f94b, 0x1f950, 0x1f95e, 0x1f980, 0x1f991, 0x1f9c0, 0x1f9c0, 0x20000, + 0x2a6d6, 0x2a700, 0x2b734, 0x2b740, 0x2b81d, 0x2b820, 0x2cea1, 0x2f800, + 0x2fa1d, +}; /* CR_Grapheme_Base */ + +/* 'Grapheme_Link': Derived Property */ +static const OnigCodePoint CR_Grapheme_Link[] = { + 43, 0x094d, 0x094d, 0x09cd, 0x09cd, 0x0a4d, 0x0a4d, 0x0acd, + 0x0acd, 0x0b4d, 0x0b4d, 0x0bcd, 0x0bcd, 0x0c4d, 0x0c4d, 0x0ccd, + 0x0ccd, 0x0d4d, 0x0d4d, 0x0dca, 0x0dca, 0x0e3a, 0x0e3a, 0x0f84, + 0x0f84, 0x1039, 0x103a, 0x1714, 0x1714, 0x1734, 0x1734, 0x17d2, + 0x17d2, 0x1a60, 0x1a60, 0x1b44, 0x1b44, 0x1baa, 0x1bab, 0x1bf2, + 0x1bf3, 0x2d7f, 0x2d7f, 0xa806, 0xa806, 0xa8c4, 0xa8c4, 0xa953, + 0xa953, 0xa9c0, 0xa9c0, 0xaaf6, 0xaaf6, 0xabed, 0xabed, 0x10a3f, + 0x10a3f, 0x11046, 0x11046, 0x1107f, 0x1107f, 0x110b9, 0x110b9, 0x11133, + 0x11134, 0x111c0, 0x111c0, 0x11235, 0x11235, 0x112ea, 0x112ea, 0x1134d, + 0x1134d, 0x11442, 0x11442, 0x114c2, 0x114c2, 0x115bf, 0x115bf, 0x1163f, + 0x1163f, 0x116b6, 0x116b6, 0x1172b, 0x1172b, 0x11c3f, 0x11c3f, +}; /* CR_Grapheme_Link */ + +/* 'Common': Script */ +static const OnigCodePoint CR_Common[] = { + 165, 0x0000, 0x0040, 0x005b, 0x0060, 0x007b, 0x00a9, 0x00ab, + 0x00b9, 0x00bb, 0x00bf, 0x00d7, 0x00d7, 0x00f7, 0x00f7, 0x02b9, + 0x02df, 0x02e5, 0x02e9, 0x02ec, 0x02ff, 0x0374, 0x0374, 0x037e, + 0x037e, 0x0385, 0x0385, 0x0387, 0x0387, 0x0589, 0x0589, 0x0605, + 0x0605, 0x060c, 0x060c, 0x061b, 0x061c, 0x061f, 0x061f, 0x0640, + 0x0640, 0x06dd, 0x06dd, 0x08e2, 0x08e2, 0x0964, 0x0965, 0x0e3f, + 0x0e3f, 0x0fd5, 0x0fd8, 0x10fb, 0x10fb, 0x16eb, 0x16ed, 0x1735, + 0x1736, 0x1802, 0x1803, 0x1805, 0x1805, 0x1cd3, 0x1cd3, 0x1ce1, + 0x1ce1, 0x1ce9, 0x1cec, 0x1cee, 0x1cf3, 0x1cf5, 0x1cf6, 0x2000, + 0x200b, 0x200e, 0x2064, 0x2066, 0x2070, 0x2074, 0x207e, 0x2080, + 0x208e, 0x20a0, 0x20be, 0x2100, 0x2125, 0x2127, 0x2129, 0x212c, + 0x2131, 0x2133, 0x214d, 0x214f, 0x215f, 0x2189, 0x218b, 0x2190, + 0x23fe, 0x2400, 0x2426, 0x2440, 0x244a, 0x2460, 0x27ff, 0x2900, + 0x2b73, 0x2b76, 0x2b95, 0x2b98, 0x2bb9, 0x2bbd, 0x2bc8, 0x2bca, + 0x2bd1, 0x2bec, 0x2bef, 0x2e00, 0x2e44, 0x2ff0, 0x2ffb, 0x3000, + 0x3004, 0x3006, 0x3006, 0x3008, 0x3020, 0x3030, 0x3037, 0x303c, + 0x303f, 0x309b, 0x309c, 0x30a0, 0x30a0, 0x30fb, 0x30fc, 0x3190, + 0x319f, 0x31c0, 0x31e3, 0x3220, 0x325f, 0x327f, 0x32cf, 0x3358, + 0x33ff, 0x4dc0, 0x4dff, 0xa700, 0xa721, 0xa788, 0xa78a, 0xa830, + 0xa839, 0xa92e, 0xa92e, 0xa9cf, 0xa9cf, 0xab5b, 0xab5b, 0xfd3e, + 0xfd3f, 0xfe10, 0xfe19, 0xfe30, 0xfe52, 0xfe54, 0xfe66, 0xfe68, + 0xfe6b, 0xfeff, 0xfeff, 0xff01, 0xff20, 0xff3b, 0xff40, 0xff5b, + 0xff65, 0xff70, 0xff70, 0xff9e, 0xff9f, 0xffe0, 0xffe6, 0xffe8, + 0xffee, 0xfff9, 0xfffd, 0x10100, 0x10102, 0x10107, 0x10133, 0x10137, + 0x1013f, 0x10190, 0x1019b, 0x101d0, 0x101fc, 0x102e1, 0x102fb, 0x1bca0, + 0x1bca3, 0x1d000, 0x1d0f5, 0x1d100, 0x1d126, 0x1d129, 0x1d166, 0x1d16a, + 0x1d17a, 0x1d183, 0x1d184, 0x1d18c, 0x1d1a9, 0x1d1ae, 0x1d1e8, 0x1d300, + 0x1d356, 0x1d360, 0x1d371, 0x1d400, 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, + 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, + 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, + 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, + 0x1d53e, 0x1d540, 0x1d544, 0x1d546, 0x1d546, 0x1d54a, 0x1d550, 0x1d552, + 0x1d6a5, 0x1d6a8, 0x1d7cb, 0x1d7ce, 0x1d7ff, 0x1f000, 0x1f02b, 0x1f030, + 0x1f093, 0x1f0a0, 0x1f0ae, 0x1f0b1, 0x1f0bf, 0x1f0c1, 0x1f0cf, 0x1f0d1, + 0x1f0f5, 0x1f100, 0x1f10c, 0x1f110, 0x1f12e, 0x1f130, 0x1f16b, 0x1f170, + 0x1f1ac, 0x1f1e6, 0x1f1ff, 0x1f201, 0x1f202, 0x1f210, 0x1f23b, 0x1f240, + 0x1f248, 0x1f250, 0x1f251, 0x1f300, 0x1f6d2, 0x1f6e0, 0x1f6ec, 0x1f6f0, + 0x1f6f6, 0x1f700, 0x1f773, 0x1f780, 0x1f7d4, 0x1f800, 0x1f80b, 0x1f810, + 0x1f847, 0x1f850, 0x1f859, 0x1f860, 0x1f887, 0x1f890, 0x1f8ad, 0x1f910, + 0x1f91e, 0x1f920, 0x1f927, 0x1f930, 0x1f930, 0x1f933, 0x1f93e, 0x1f940, + 0x1f94b, 0x1f950, 0x1f95e, 0x1f980, 0x1f991, 0x1f9c0, 0x1f9c0, 0xe0001, + 0xe0001, 0xe0020, 0xe007f, +}; /* CR_Common */ + +/* 'Latin': Script */ +static const OnigCodePoint CR_Latin[] = { + 31, 0x0041, 0x005a, 0x0061, 0x007a, 0x00aa, 0x00aa, 0x00ba, 0x00ba, + 0x00c0, 0x00d6, 0x00d8, 0x00f6, 0x00f8, 0x02b8, 0x02e0, 0x02e4, 0x1d00, + 0x1d25, 0x1d2c, 0x1d5c, 0x1d62, 0x1d65, 0x1d6b, 0x1d77, 0x1d79, 0x1dbe, + 0x1e00, 0x1eff, 0x2071, 0x2071, 0x207f, 0x207f, 0x2090, 0x209c, 0x212a, + 0x212b, 0x2132, 0x2132, 0x214e, 0x214e, 0x2160, 0x2188, 0x2c60, 0x2c7f, + 0xa722, 0xa787, 0xa78b, 0xa7ae, 0xa7b0, 0xa7b7, 0xa7f7, 0xa7ff, 0xab30, + 0xab5a, 0xab5c, 0xab64, 0xfb00, 0xfb06, 0xff21, 0xff3a, 0xff41, 0xff5a, +}; /* CR_Latin */ + +/* 'Greek': Script */ +static const OnigCodePoint CR_Greek[] = { + 36, 0x0370, 0x0373, 0x0375, 0x0377, 0x037a, 0x037d, 0x037f, + 0x037f, 0x0384, 0x0384, 0x0386, 0x0386, 0x0388, 0x038a, 0x038c, + 0x038c, 0x038e, 0x03a1, 0x03a3, 0x03e1, 0x03f0, 0x03ff, 0x1d26, + 0x1d2a, 0x1d5d, 0x1d61, 0x1d66, 0x1d6a, 0x1dbf, 0x1dbf, 0x1f00, + 0x1f15, 0x1f18, 0x1f1d, 0x1f20, 0x1f45, 0x1f48, 0x1f4d, 0x1f50, + 0x1f57, 0x1f59, 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, + 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, 0x1fc4, 0x1fc6, 0x1fd3, 0x1fd6, + 0x1fdb, 0x1fdd, 0x1fef, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ffe, 0x2126, + 0x2126, 0xab65, 0xab65, 0x10140, 0x1018e, 0x101a0, 0x101a0, 0x1d200, + 0x1d245, +}; /* CR_Greek */ + +/* 'Cyrillic': Script */ +static const OnigCodePoint CR_Cyrillic[] = { + 8, 0x0400, 0x0484, 0x0487, 0x052f, 0x1c80, 0x1c88, 0x1d2b, 0x1d2b, + 0x1d78, 0x1d78, 0x2de0, 0x2dff, 0xa640, 0xa69f, 0xfe2e, 0xfe2f, +}; /* CR_Cyrillic */ + +/* 'Armenian': Script */ +static const OnigCodePoint CR_Armenian[] = { + 6, 0x0531, 0x0556, 0x0559, 0x055f, 0x0561, 0x0587, + 0x058a, 0x058a, 0x058d, 0x058f, 0xfb13, 0xfb17, +}; /* CR_Armenian */ + +/* 'Hebrew': Script */ +static const OnigCodePoint CR_Hebrew[] = { + 9, 0x0591, 0x05c7, 0x05d0, 0x05ea, 0x05f0, 0x05f4, + 0xfb1d, 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, + 0xfb41, 0xfb43, 0xfb44, 0xfb46, 0xfb4f, +}; /* CR_Hebrew */ + +/* 'Arabic': Script */ +static const OnigCodePoint CR_Arabic[] = { + 56, 0x0600, 0x0604, 0x0606, 0x060b, 0x060d, 0x061a, 0x061e, + 0x061e, 0x0620, 0x063f, 0x0641, 0x064a, 0x0656, 0x066f, 0x0671, + 0x06dc, 0x06de, 0x06ff, 0x0750, 0x077f, 0x08a0, 0x08b4, 0x08b6, + 0x08bd, 0x08d4, 0x08e1, 0x08e3, 0x08ff, 0xfb50, 0xfbc1, 0xfbd3, + 0xfd3d, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdf0, 0xfdfd, 0xfe70, + 0xfe74, 0xfe76, 0xfefc, 0x10e60, 0x10e7e, 0x1ee00, 0x1ee03, 0x1ee05, + 0x1ee1f, 0x1ee21, 0x1ee22, 0x1ee24, 0x1ee24, 0x1ee27, 0x1ee27, 0x1ee29, + 0x1ee32, 0x1ee34, 0x1ee37, 0x1ee39, 0x1ee39, 0x1ee3b, 0x1ee3b, 0x1ee42, + 0x1ee42, 0x1ee47, 0x1ee47, 0x1ee49, 0x1ee49, 0x1ee4b, 0x1ee4b, 0x1ee4d, + 0x1ee4f, 0x1ee51, 0x1ee52, 0x1ee54, 0x1ee54, 0x1ee57, 0x1ee57, 0x1ee59, + 0x1ee59, 0x1ee5b, 0x1ee5b, 0x1ee5d, 0x1ee5d, 0x1ee5f, 0x1ee5f, 0x1ee61, + 0x1ee62, 0x1ee64, 0x1ee64, 0x1ee67, 0x1ee6a, 0x1ee6c, 0x1ee72, 0x1ee74, + 0x1ee77, 0x1ee79, 0x1ee7c, 0x1ee7e, 0x1ee7e, 0x1ee80, 0x1ee89, 0x1ee8b, + 0x1ee9b, 0x1eea1, 0x1eea3, 0x1eea5, 0x1eea9, 0x1eeab, 0x1eebb, 0x1eef0, + 0x1eef1, +}; /* CR_Arabic */ + +/* 'Syriac': Script */ +static const OnigCodePoint CR_Syriac[] = { + 3, 0x0700, 0x070d, 0x070f, 0x074a, 0x074d, 0x074f, +}; /* CR_Syriac */ + +/* 'Thaana': Script */ +static const OnigCodePoint CR_Thaana[] = { + 1, + 0x0780, + 0x07b1, +}; /* CR_Thaana */ + +/* 'Devanagari': Script */ +static const OnigCodePoint CR_Devanagari[] = { + 4, 0x0900, 0x0950, 0x0953, 0x0963, 0x0966, 0x097f, 0xa8e0, 0xa8fd, +}; /* CR_Devanagari */ + +/* 'Bengali': Script */ +static const OnigCodePoint CR_Bengali[] = { + 14, 0x0980, 0x0983, 0x0985, 0x098c, 0x098f, 0x0990, 0x0993, + 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, 0x09b9, 0x09bc, + 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09ce, 0x09d7, 0x09d7, 0x09dc, + 0x09dd, 0x09df, 0x09e3, 0x09e6, 0x09fb, +}; /* CR_Bengali */ + +/* 'Gurmukhi': Script */ +static const OnigCodePoint CR_Gurmukhi[] = { + 16, 0x0a01, 0x0a03, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, + 0x0a2a, 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3c, + 0x0a3c, 0x0a3e, 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4d, 0x0a51, 0x0a51, + 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, 0x0a75, +}; /* CR_Gurmukhi */ + +/* 'Gujarati': Script */ +static const OnigCodePoint CR_Gujarati[] = { + 14, 0x0a81, 0x0a83, 0x0a85, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, + 0x0aa8, 0x0aaa, 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, + 0x0ac5, 0x0ac7, 0x0ac9, 0x0acb, 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, + 0x0ae3, 0x0ae6, 0x0af1, 0x0af9, 0x0af9, +}; /* CR_Gujarati */ + +/* 'Oriya': Script */ +static const OnigCodePoint CR_Oriya[] = { + 14, 0x0b01, 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, + 0x0b28, 0x0b2a, 0x0b30, 0x0b32, 0x0b33, 0x0b35, 0x0b39, 0x0b3c, + 0x0b44, 0x0b47, 0x0b48, 0x0b4b, 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, + 0x0b5d, 0x0b5f, 0x0b63, 0x0b66, 0x0b77, +}; /* CR_Oriya */ + +/* 'Tamil': Script */ +static const OnigCodePoint CR_Tamil[] = { + 16, 0x0b82, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, 0x0b95, + 0x0b99, 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, + 0x0baa, 0x0bae, 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, 0x0bcd, + 0x0bd0, 0x0bd0, 0x0bd7, 0x0bd7, 0x0be6, 0x0bfa, +}; /* CR_Tamil */ + +/* 'Telugu': Script */ +static const OnigCodePoint CR_Telugu[] = { + 13, 0x0c00, 0x0c03, 0x0c05, 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, 0x0c28, + 0x0c2a, 0x0c39, 0x0c3d, 0x0c44, 0x0c46, 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, + 0x0c56, 0x0c58, 0x0c5a, 0x0c60, 0x0c63, 0x0c66, 0x0c6f, 0x0c78, 0x0c7f, +}; /* CR_Telugu */ + +/* 'Kannada': Script */ +static const OnigCodePoint CR_Kannada[] = { + 14, 0x0c80, 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, + 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbc, 0x0cc4, 0x0cc6, + 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, + 0x0ce3, 0x0ce6, 0x0cef, 0x0cf1, 0x0cf2, +}; /* CR_Kannada */ + +/* 'Malayalam': Script */ +static const OnigCodePoint CR_Malayalam[] = { + 9, 0x0d01, 0x0d03, 0x0d05, 0x0d0c, 0x0d0e, 0x0d10, + 0x0d12, 0x0d3a, 0x0d3d, 0x0d44, 0x0d46, 0x0d48, 0x0d4a, + 0x0d4f, 0x0d54, 0x0d63, 0x0d66, 0x0d7f, +}; /* CR_Malayalam */ + +/* 'Sinhala': Script */ +static const OnigCodePoint CR_Sinhala[] = { + 13, 0x0d82, 0x0d83, 0x0d85, 0x0d96, 0x0d9a, 0x0db1, 0x0db3, 0x0dbb, + 0x0dbd, 0x0dbd, 0x0dc0, 0x0dc6, 0x0dca, 0x0dca, 0x0dcf, 0x0dd4, 0x0dd6, + 0x0dd6, 0x0dd8, 0x0ddf, 0x0de6, 0x0def, 0x0df2, 0x0df4, 0x111e1, 0x111f4, +}; /* CR_Sinhala */ + +/* 'Thai': Script */ +static const OnigCodePoint CR_Thai[] = { + 2, 0x0e01, 0x0e3a, 0x0e40, 0x0e5b, +}; /* CR_Thai */ + +/* 'Lao': Script */ +static const OnigCodePoint CR_Lao[] = { + 18, 0x0e81, 0x0e82, 0x0e84, 0x0e84, 0x0e87, 0x0e88, 0x0e8a, + 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, + 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, + 0x0eb9, 0x0ebb, 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, 0x0ec6, 0x0ec8, + 0x0ecd, 0x0ed0, 0x0ed9, 0x0edc, 0x0edf, +}; /* CR_Lao */ + +/* 'Tibetan': Script */ +static const OnigCodePoint CR_Tibetan[] = { + 7, 0x0f00, 0x0f47, 0x0f49, 0x0f6c, 0x0f71, 0x0f97, 0x0f99, + 0x0fbc, 0x0fbe, 0x0fcc, 0x0fce, 0x0fd4, 0x0fd9, 0x0fda, +}; /* CR_Tibetan */ + +/* 'Myanmar': Script */ +static const OnigCodePoint CR_Myanmar[] = { + 3, 0x1000, 0x109f, 0xa9e0, 0xa9fe, 0xaa60, 0xaa7f, +}; /* CR_Myanmar */ + +/* 'Georgian': Script */ +static const OnigCodePoint CR_Georgian[] = { + 8, 0x10a0, 0x10c5, 0x10c7, 0x10c7, 0x10cd, 0x10cd, 0x10d0, 0x10fa, + 0x10fc, 0x10ff, 0x2d00, 0x2d25, 0x2d27, 0x2d27, 0x2d2d, 0x2d2d, +}; /* CR_Georgian */ + +/* 'Hangul': Script */ +static const OnigCodePoint CR_Hangul[] = { + 14, 0x1100, 0x11ff, 0x302e, 0x302f, 0x3131, 0x318e, 0x3200, + 0x321e, 0x3260, 0x327e, 0xa960, 0xa97c, 0xac00, 0xd7a3, 0xd7b0, + 0xd7c6, 0xd7cb, 0xd7fb, 0xffa0, 0xffbe, 0xffc2, 0xffc7, 0xffca, + 0xffcf, 0xffd2, 0xffd7, 0xffda, 0xffdc, +}; /* CR_Hangul */ + +/* 'Ethiopic': Script */ +static const OnigCodePoint CR_Ethiopic[] = { + 32, 0x1200, 0x1248, 0x124a, 0x124d, 0x1250, 0x1256, 0x1258, 0x1258, + 0x125a, 0x125d, 0x1260, 0x1288, 0x128a, 0x128d, 0x1290, 0x12b0, 0x12b2, + 0x12b5, 0x12b8, 0x12be, 0x12c0, 0x12c0, 0x12c2, 0x12c5, 0x12c8, 0x12d6, + 0x12d8, 0x1310, 0x1312, 0x1315, 0x1318, 0x135a, 0x135d, 0x137c, 0x1380, + 0x1399, 0x2d80, 0x2d96, 0x2da0, 0x2da6, 0x2da8, 0x2dae, 0x2db0, 0x2db6, + 0x2db8, 0x2dbe, 0x2dc0, 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, 0x2dd6, 0x2dd8, + 0x2dde, 0xab01, 0xab06, 0xab09, 0xab0e, 0xab11, 0xab16, 0xab20, 0xab26, + 0xab28, 0xab2e, +}; /* CR_Ethiopic */ + +/* 'Cherokee': Script */ +static const OnigCodePoint CR_Cherokee[] = { + 3, 0x13a0, 0x13f5, 0x13f8, 0x13fd, 0xab70, 0xabbf, +}; /* CR_Cherokee */ + +/* 'Canadian_Aboriginal': Script */ +static const OnigCodePoint CR_Canadian_Aboriginal[] = { + 2, 0x1400, 0x167f, 0x18b0, 0x18f5, +}; /* CR_Canadian_Aboriginal */ + +/* 'Ogham': Script */ +static const OnigCodePoint CR_Ogham[] = { + 1, + 0x1680, + 0x169c, +}; /* CR_Ogham */ + +/* 'Runic': Script */ +static const OnigCodePoint CR_Runic[] = { + 2, 0x16a0, 0x16ea, 0x16ee, 0x16f8, +}; /* CR_Runic */ + +/* 'Khmer': Script */ +static const OnigCodePoint CR_Khmer[] = { + 4, 0x1780, 0x17dd, 0x17e0, 0x17e9, 0x17f0, 0x17f9, 0x19e0, 0x19ff, +}; /* CR_Khmer */ + +/* 'Mongolian': Script */ +static const OnigCodePoint CR_Mongolian[] = { + 7, 0x1800, 0x1801, 0x1804, 0x1804, 0x1806, 0x180e, 0x1810, + 0x1819, 0x1820, 0x1877, 0x1880, 0x18aa, 0x11660, 0x1166c, +}; /* CR_Mongolian */ + +/* 'Hiragana': Script */ +static const OnigCodePoint CR_Hiragana[] = { + 4, 0x3041, 0x3096, 0x309d, 0x309f, 0x1b001, 0x1b001, 0x1f200, 0x1f200, +}; /* CR_Hiragana */ + +/* 'Katakana': Script */ +static const OnigCodePoint CR_Katakana[] = { + 8, 0x30a1, 0x30fa, 0x30fd, 0x30ff, 0x31f0, 0x31ff, 0x32d0, 0x32fe, + 0x3300, 0x3357, 0xff66, 0xff6f, 0xff71, 0xff9d, 0x1b000, 0x1b000, +}; /* CR_Katakana */ + +/* 'Bopomofo': Script */ +static const OnigCodePoint CR_Bopomofo[] = { + 3, 0x02ea, 0x02eb, 0x3105, 0x312d, 0x31a0, 0x31ba, +}; /* CR_Bopomofo */ + +/* 'Han': Script */ +static const OnigCodePoint CR_Han[] = { + 16, 0x2e80, 0x2e99, 0x2e9b, 0x2ef3, 0x2f00, 0x2fd5, + 0x3005, 0x3005, 0x3007, 0x3007, 0x3021, 0x3029, 0x3038, + 0x303b, 0x3400, 0x4db5, 0x4e00, 0x9fd5, 0xf900, 0xfa6d, + 0xfa70, 0xfad9, 0x20000, 0x2a6d6, 0x2a700, 0x2b734, 0x2b740, + 0x2b81d, 0x2b820, 0x2cea1, 0x2f800, 0x2fa1d, +}; /* CR_Han */ + +/* 'Yi': Script */ +static const OnigCodePoint CR_Yi[] = { + 2, 0xa000, 0xa48c, 0xa490, 0xa4c6, +}; /* CR_Yi */ + +/* 'Old_Italic': Script */ +static const OnigCodePoint CR_Old_Italic[] = { + 1, + 0x10300, + 0x10323, +}; /* CR_Old_Italic */ + +/* 'Gothic': Script */ +static const OnigCodePoint CR_Gothic[] = { + 1, + 0x10330, + 0x1034a, +}; /* CR_Gothic */ + +/* 'Deseret': Script */ +static const OnigCodePoint CR_Deseret[] = { + 1, + 0x10400, + 0x1044f, +}; /* CR_Deseret */ + +/* 'Inherited': Script */ +static const OnigCodePoint CR_Inherited[] = { + 27, 0x0300, 0x036f, 0x0485, 0x0486, 0x064b, 0x0655, 0x0670, + 0x0670, 0x0951, 0x0952, 0x1ab0, 0x1abe, 0x1cd0, 0x1cd2, 0x1cd4, + 0x1ce0, 0x1ce2, 0x1ce8, 0x1ced, 0x1ced, 0x1cf4, 0x1cf4, 0x1cf8, + 0x1cf9, 0x1dc0, 0x1df5, 0x1dfb, 0x1dff, 0x200c, 0x200d, 0x20d0, + 0x20f0, 0x302a, 0x302d, 0x3099, 0x309a, 0xfe00, 0xfe0f, 0xfe20, + 0xfe2d, 0x101fd, 0x101fd, 0x102e0, 0x102e0, 0x1d167, 0x1d169, 0x1d17b, + 0x1d182, 0x1d185, 0x1d18b, 0x1d1aa, 0x1d1ad, 0xe0100, 0xe01ef, +}; /* CR_Inherited */ + +/* 'Tagalog': Script */ +static const OnigCodePoint CR_Tagalog[] = { + 2, 0x1700, 0x170c, 0x170e, 0x1714, +}; /* CR_Tagalog */ + +/* 'Hanunoo': Script */ +static const OnigCodePoint CR_Hanunoo[] = { + 1, + 0x1720, + 0x1734, +}; /* CR_Hanunoo */ + +/* 'Buhid': Script */ +static const OnigCodePoint CR_Buhid[] = { + 1, + 0x1740, + 0x1753, +}; /* CR_Buhid */ + +/* 'Tagbanwa': Script */ +static const OnigCodePoint CR_Tagbanwa[] = { + 3, 0x1760, 0x176c, 0x176e, 0x1770, 0x1772, 0x1773, +}; /* CR_Tagbanwa */ + +/* 'Limbu': Script */ +static const OnigCodePoint CR_Limbu[] = { + 5, 0x1900, 0x191e, 0x1920, 0x192b, 0x1930, + 0x193b, 0x1940, 0x1940, 0x1944, 0x194f, +}; /* CR_Limbu */ + +/* 'Tai_Le': Script */ +static const OnigCodePoint CR_Tai_Le[] = { + 2, 0x1950, 0x196d, 0x1970, 0x1974, +}; /* CR_Tai_Le */ + +/* 'Linear_B': Script */ +static const OnigCodePoint CR_Linear_B[] = { + 7, 0x10000, 0x1000b, 0x1000d, 0x10026, 0x10028, 0x1003a, 0x1003c, + 0x1003d, 0x1003f, 0x1004d, 0x10050, 0x1005d, 0x10080, 0x100fa, +}; /* CR_Linear_B */ + +/* 'Ugaritic': Script */ +static const OnigCodePoint CR_Ugaritic[] = { + 2, 0x10380, 0x1039d, 0x1039f, 0x1039f, +}; /* CR_Ugaritic */ + +/* 'Shavian': Script */ +static const OnigCodePoint CR_Shavian[] = { + 1, + 0x10450, + 0x1047f, +}; /* CR_Shavian */ + +/* 'Osmanya': Script */ +static const OnigCodePoint CR_Osmanya[] = { + 2, 0x10480, 0x1049d, 0x104a0, 0x104a9, +}; /* CR_Osmanya */ + +/* 'Cypriot': Script */ +static const OnigCodePoint CR_Cypriot[] = { + 6, 0x10800, 0x10805, 0x10808, 0x10808, 0x1080a, 0x10835, + 0x10837, 0x10838, 0x1083c, 0x1083c, 0x1083f, 0x1083f, +}; /* CR_Cypriot */ + +/* 'Braille': Script */ +static const OnigCodePoint CR_Braille[] = { + 1, + 0x2800, + 0x28ff, +}; /* CR_Braille */ + +/* 'Buginese': Script */ +static const OnigCodePoint CR_Buginese[] = { + 2, 0x1a00, 0x1a1b, 0x1a1e, 0x1a1f, +}; /* CR_Buginese */ + +/* 'Coptic': Script */ +static const OnigCodePoint CR_Coptic[] = { + 3, 0x03e2, 0x03ef, 0x2c80, 0x2cf3, 0x2cf9, 0x2cff, +}; /* CR_Coptic */ + +/* 'New_Tai_Lue': Script */ +static const OnigCodePoint CR_New_Tai_Lue[] = { + 4, 0x1980, 0x19ab, 0x19b0, 0x19c9, 0x19d0, 0x19da, 0x19de, 0x19df, +}; /* CR_New_Tai_Lue */ + +/* 'Glagolitic': Script */ +static const OnigCodePoint CR_Glagolitic[] = { + 7, 0x2c00, 0x2c2e, 0x2c30, 0x2c5e, 0x1e000, 0x1e006, 0x1e008, + 0x1e018, 0x1e01b, 0x1e021, 0x1e023, 0x1e024, 0x1e026, 0x1e02a, +}; /* CR_Glagolitic */ + +/* 'Tifinagh': Script */ +static const OnigCodePoint CR_Tifinagh[] = { + 3, 0x2d30, 0x2d67, 0x2d6f, 0x2d70, 0x2d7f, 0x2d7f, +}; /* CR_Tifinagh */ + +/* 'Syloti_Nagri': Script */ +static const OnigCodePoint CR_Syloti_Nagri[] = { + 1, + 0xa800, + 0xa82b, +}; /* CR_Syloti_Nagri */ + +/* 'Old_Persian': Script */ +static const OnigCodePoint CR_Old_Persian[] = { + 2, 0x103a0, 0x103c3, 0x103c8, 0x103d5, +}; /* CR_Old_Persian */ + +/* 'Kharoshthi': Script */ +static const OnigCodePoint CR_Kharoshthi[] = { + 8, 0x10a00, 0x10a03, 0x10a05, 0x10a06, 0x10a0c, + 0x10a13, 0x10a15, 0x10a17, 0x10a19, 0x10a33, 0x10a38, + 0x10a3a, 0x10a3f, 0x10a47, 0x10a50, 0x10a58, +}; /* CR_Kharoshthi */ + +/* 'Balinese': Script */ +static const OnigCodePoint CR_Balinese[] = { + 2, 0x1b00, 0x1b4b, 0x1b50, 0x1b7c, +}; /* CR_Balinese */ + +/* 'Cuneiform': Script */ +static const OnigCodePoint CR_Cuneiform[] = { + 4, 0x12000, 0x12399, 0x12400, 0x1246e, 0x12470, 0x12474, 0x12480, 0x12543, +}; /* CR_Cuneiform */ + +/* 'Phoenician': Script */ +static const OnigCodePoint CR_Phoenician[] = { + 2, 0x10900, 0x1091b, 0x1091f, 0x1091f, +}; /* CR_Phoenician */ + +/* 'Phags_Pa': Script */ +static const OnigCodePoint CR_Phags_Pa[] = { + 1, + 0xa840, + 0xa877, +}; /* CR_Phags_Pa */ + +/* 'Nko': Script */ +static const OnigCodePoint CR_Nko[] = { + 1, + 0x07c0, + 0x07fa, +}; /* CR_Nko */ + +/* 'Sundanese': Script */ +static const OnigCodePoint CR_Sundanese[] = { + 2, 0x1b80, 0x1bbf, 0x1cc0, 0x1cc7, +}; /* CR_Sundanese */ + +/* 'Lepcha': Script */ +static const OnigCodePoint CR_Lepcha[] = { + 3, 0x1c00, 0x1c37, 0x1c3b, 0x1c49, 0x1c4d, 0x1c4f, +}; /* CR_Lepcha */ + +/* 'Ol_Chiki': Script */ +static const OnigCodePoint CR_Ol_Chiki[] = { + 1, + 0x1c50, + 0x1c7f, +}; /* CR_Ol_Chiki */ + +/* 'Vai': Script */ +static const OnigCodePoint CR_Vai[] = { + 1, + 0xa500, + 0xa62b, +}; /* CR_Vai */ + +/* 'Saurashtra': Script */ +static const OnigCodePoint CR_Saurashtra[] = { + 2, 0xa880, 0xa8c5, 0xa8ce, 0xa8d9, +}; /* CR_Saurashtra */ + +/* 'Kayah_Li': Script */ +static const OnigCodePoint CR_Kayah_Li[] = { + 2, 0xa900, 0xa92d, 0xa92f, 0xa92f, +}; /* CR_Kayah_Li */ + +/* 'Rejang': Script */ +static const OnigCodePoint CR_Rejang[] = { + 2, 0xa930, 0xa953, 0xa95f, 0xa95f, +}; /* CR_Rejang */ + +/* 'Lycian': Script */ +static const OnigCodePoint CR_Lycian[] = { + 1, + 0x10280, + 0x1029c, +}; /* CR_Lycian */ + +/* 'Carian': Script */ +static const OnigCodePoint CR_Carian[] = { + 1, + 0x102a0, + 0x102d0, +}; /* CR_Carian */ + +/* 'Lydian': Script */ +static const OnigCodePoint CR_Lydian[] = { + 2, 0x10920, 0x10939, 0x1093f, 0x1093f, +}; /* CR_Lydian */ + +/* 'Cham': Script */ +static const OnigCodePoint CR_Cham[] = { + 4, 0xaa00, 0xaa36, 0xaa40, 0xaa4d, 0xaa50, 0xaa59, 0xaa5c, 0xaa5f, +}; /* CR_Cham */ + +/* 'Tai_Tham': Script */ +static const OnigCodePoint CR_Tai_Tham[] = { + 5, 0x1a20, 0x1a5e, 0x1a60, 0x1a7c, 0x1a7f, + 0x1a89, 0x1a90, 0x1a99, 0x1aa0, 0x1aad, +}; /* CR_Tai_Tham */ + +/* 'Tai_Viet': Script */ +static const OnigCodePoint CR_Tai_Viet[] = { + 2, 0xaa80, 0xaac2, 0xaadb, 0xaadf, +}; /* CR_Tai_Viet */ + +/* 'Avestan': Script */ +static const OnigCodePoint CR_Avestan[] = { + 2, 0x10b00, 0x10b35, 0x10b39, 0x10b3f, +}; /* CR_Avestan */ + +/* 'Egyptian_Hieroglyphs': Script */ +static const OnigCodePoint CR_Egyptian_Hieroglyphs[] = { + 1, + 0x13000, + 0x1342e, +}; /* CR_Egyptian_Hieroglyphs */ + +/* 'Samaritan': Script */ +static const OnigCodePoint CR_Samaritan[] = { + 2, 0x0800, 0x082d, 0x0830, 0x083e, +}; /* CR_Samaritan */ + +/* 'Lisu': Script */ +static const OnigCodePoint CR_Lisu[] = { + 1, + 0xa4d0, + 0xa4ff, +}; /* CR_Lisu */ + +/* 'Bamum': Script */ +static const OnigCodePoint CR_Bamum[] = { + 2, 0xa6a0, 0xa6f7, 0x16800, 0x16a38, +}; /* CR_Bamum */ + +/* 'Javanese': Script */ +static const OnigCodePoint CR_Javanese[] = { + 3, 0xa980, 0xa9cd, 0xa9d0, 0xa9d9, 0xa9de, 0xa9df, +}; /* CR_Javanese */ + +/* 'Meetei_Mayek': Script */ +static const OnigCodePoint CR_Meetei_Mayek[] = { + 3, 0xaae0, 0xaaf6, 0xabc0, 0xabed, 0xabf0, 0xabf9, +}; /* CR_Meetei_Mayek */ + +/* 'Imperial_Aramaic': Script */ +static const OnigCodePoint CR_Imperial_Aramaic[] = { + 2, 0x10840, 0x10855, 0x10857, 0x1085f, +}; /* CR_Imperial_Aramaic */ + +/* 'Old_South_Arabian': Script */ +static const OnigCodePoint CR_Old_South_Arabian[] = { + 1, + 0x10a60, + 0x10a7f, +}; /* CR_Old_South_Arabian */ + +/* 'Inscriptional_Parthian': Script */ +static const OnigCodePoint CR_Inscriptional_Parthian[] = { + 2, 0x10b40, 0x10b55, 0x10b58, 0x10b5f, +}; /* CR_Inscriptional_Parthian */ + +/* 'Inscriptional_Pahlavi': Script */ +static const OnigCodePoint CR_Inscriptional_Pahlavi[] = { + 2, 0x10b60, 0x10b72, 0x10b78, 0x10b7f, +}; /* CR_Inscriptional_Pahlavi */ + +/* 'Old_Turkic': Script */ +static const OnigCodePoint CR_Old_Turkic[] = { + 1, + 0x10c00, + 0x10c48, +}; /* CR_Old_Turkic */ + +/* 'Kaithi': Script */ +static const OnigCodePoint CR_Kaithi[] = { + 1, + 0x11080, + 0x110c1, +}; /* CR_Kaithi */ + +/* 'Batak': Script */ +static const OnigCodePoint CR_Batak[] = { + 2, 0x1bc0, 0x1bf3, 0x1bfc, 0x1bff, +}; /* CR_Batak */ + +/* 'Brahmi': Script */ +static const OnigCodePoint CR_Brahmi[] = { + 3, 0x11000, 0x1104d, 0x11052, 0x1106f, 0x1107f, 0x1107f, +}; /* CR_Brahmi */ + +/* 'Mandaic': Script */ +static const OnigCodePoint CR_Mandaic[] = { + 2, 0x0840, 0x085b, 0x085e, 0x085e, +}; /* CR_Mandaic */ + +/* 'Chakma': Script */ +static const OnigCodePoint CR_Chakma[] = { + 2, 0x11100, 0x11134, 0x11136, 0x11143, +}; /* CR_Chakma */ + +/* 'Meroitic_Cursive': Script */ +static const OnigCodePoint CR_Meroitic_Cursive[] = { + 3, 0x109a0, 0x109b7, 0x109bc, 0x109cf, 0x109d2, 0x109ff, +}; /* CR_Meroitic_Cursive */ + +/* 'Meroitic_Hieroglyphs': Script */ +static const OnigCodePoint CR_Meroitic_Hieroglyphs[] = { + 1, + 0x10980, + 0x1099f, +}; /* CR_Meroitic_Hieroglyphs */ + +/* 'Miao': Script */ +static const OnigCodePoint CR_Miao[] = { + 3, 0x16f00, 0x16f44, 0x16f50, 0x16f7e, 0x16f8f, 0x16f9f, +}; /* CR_Miao */ + +/* 'Sharada': Script */ +static const OnigCodePoint CR_Sharada[] = { + 2, 0x11180, 0x111cd, 0x111d0, 0x111df, +}; /* CR_Sharada */ + +/* 'Sora_Sompeng': Script */ +static const OnigCodePoint CR_Sora_Sompeng[] = { + 2, 0x110d0, 0x110e8, 0x110f0, 0x110f9, +}; /* CR_Sora_Sompeng */ + +/* 'Takri': Script */ +static const OnigCodePoint CR_Takri[] = { + 2, 0x11680, 0x116b7, 0x116c0, 0x116c9, +}; /* CR_Takri */ + +/* 'Caucasian_Albanian': Script */ +static const OnigCodePoint CR_Caucasian_Albanian[] = { + 2, 0x10530, 0x10563, 0x1056f, 0x1056f, +}; /* CR_Caucasian_Albanian */ + +/* 'Bassa_Vah': Script */ +static const OnigCodePoint CR_Bassa_Vah[] = { + 2, 0x16ad0, 0x16aed, 0x16af0, 0x16af5, +}; /* CR_Bassa_Vah */ + +/* 'Duployan': Script */ +static const OnigCodePoint CR_Duployan[] = { + 5, 0x1bc00, 0x1bc6a, 0x1bc70, 0x1bc7c, 0x1bc80, + 0x1bc88, 0x1bc90, 0x1bc99, 0x1bc9c, 0x1bc9f, +}; /* CR_Duployan */ + +/* 'Elbasan': Script */ +static const OnigCodePoint CR_Elbasan[] = { + 1, + 0x10500, + 0x10527, +}; /* CR_Elbasan */ + +/* 'Grantha': Script */ +static const OnigCodePoint CR_Grantha[] = { + 15, 0x11300, 0x11303, 0x11305, 0x1130c, 0x1130f, 0x11310, 0x11313, + 0x11328, 0x1132a, 0x11330, 0x11332, 0x11333, 0x11335, 0x11339, 0x1133c, + 0x11344, 0x11347, 0x11348, 0x1134b, 0x1134d, 0x11350, 0x11350, 0x11357, + 0x11357, 0x1135d, 0x11363, 0x11366, 0x1136c, 0x11370, 0x11374, +}; /* CR_Grantha */ + +/* 'Pahawh_Hmong': Script */ +static const OnigCodePoint CR_Pahawh_Hmong[] = { + 5, 0x16b00, 0x16b45, 0x16b50, 0x16b59, 0x16b5b, + 0x16b61, 0x16b63, 0x16b77, 0x16b7d, 0x16b8f, +}; /* CR_Pahawh_Hmong */ + +/* 'Khojki': Script */ +static const OnigCodePoint CR_Khojki[] = { + 2, 0x11200, 0x11211, 0x11213, 0x1123e, +}; /* CR_Khojki */ + +/* 'Linear_A': Script */ +static const OnigCodePoint CR_Linear_A[] = { + 3, 0x10600, 0x10736, 0x10740, 0x10755, 0x10760, 0x10767, +}; /* CR_Linear_A */ + +/* 'Mahajani': Script */ +static const OnigCodePoint CR_Mahajani[] = { + 1, + 0x11150, + 0x11176, +}; /* CR_Mahajani */ + +/* 'Manichaean': Script */ +static const OnigCodePoint CR_Manichaean[] = { + 2, 0x10ac0, 0x10ae6, 0x10aeb, 0x10af6, +}; /* CR_Manichaean */ + +/* 'Mende_Kikakui': Script */ +static const OnigCodePoint CR_Mende_Kikakui[] = { + 2, 0x1e800, 0x1e8c4, 0x1e8c7, 0x1e8d6, +}; /* CR_Mende_Kikakui */ + +/* 'Modi': Script */ +static const OnigCodePoint CR_Modi[] = { + 2, 0x11600, 0x11644, 0x11650, 0x11659, +}; /* CR_Modi */ + +/* 'Mro': Script */ +static const OnigCodePoint CR_Mro[] = { + 3, 0x16a40, 0x16a5e, 0x16a60, 0x16a69, 0x16a6e, 0x16a6f, +}; /* CR_Mro */ + +/* 'Old_North_Arabian': Script */ +static const OnigCodePoint CR_Old_North_Arabian[] = { + 1, + 0x10a80, + 0x10a9f, +}; /* CR_Old_North_Arabian */ + +/* 'Nabataean': Script */ +static const OnigCodePoint CR_Nabataean[] = { + 2, 0x10880, 0x1089e, 0x108a7, 0x108af, +}; /* CR_Nabataean */ + +/* 'Palmyrene': Script */ +static const OnigCodePoint CR_Palmyrene[] = { + 1, + 0x10860, + 0x1087f, +}; /* CR_Palmyrene */ + +/* 'Pau_Cin_Hau': Script */ +static const OnigCodePoint CR_Pau_Cin_Hau[] = { + 1, + 0x11ac0, + 0x11af8, +}; /* CR_Pau_Cin_Hau */ + +/* 'Old_Permic': Script */ +static const OnigCodePoint CR_Old_Permic[] = { + 1, + 0x10350, + 0x1037a, +}; /* CR_Old_Permic */ + +/* 'Psalter_Pahlavi': Script */ +static const OnigCodePoint CR_Psalter_Pahlavi[] = { + 3, 0x10b80, 0x10b91, 0x10b99, 0x10b9c, 0x10ba9, 0x10baf, +}; /* CR_Psalter_Pahlavi */ + +/* 'Siddham': Script */ +static const OnigCodePoint CR_Siddham[] = { + 2, 0x11580, 0x115b5, 0x115b8, 0x115dd, +}; /* CR_Siddham */ + +/* 'Khudawadi': Script */ +static const OnigCodePoint CR_Khudawadi[] = { + 2, 0x112b0, 0x112ea, 0x112f0, 0x112f9, +}; /* CR_Khudawadi */ + +/* 'Tirhuta': Script */ +static const OnigCodePoint CR_Tirhuta[] = { + 2, 0x11480, 0x114c7, 0x114d0, 0x114d9, +}; /* CR_Tirhuta */ + +/* 'Warang_Citi': Script */ +static const OnigCodePoint CR_Warang_Citi[] = { + 2, 0x118a0, 0x118f2, 0x118ff, 0x118ff, +}; /* CR_Warang_Citi */ + +/* 'Ahom': Script */ +static const OnigCodePoint CR_Ahom[] = { + 3, 0x11700, 0x11719, 0x1171d, 0x1172b, 0x11730, 0x1173f, +}; /* CR_Ahom */ + +/* 'Anatolian_Hieroglyphs': Script */ +static const OnigCodePoint CR_Anatolian_Hieroglyphs[] = { + 1, + 0x14400, + 0x14646, +}; /* CR_Anatolian_Hieroglyphs */ + +/* 'Hatran': Script */ +static const OnigCodePoint CR_Hatran[] = { + 3, 0x108e0, 0x108f2, 0x108f4, 0x108f5, 0x108fb, 0x108ff, +}; /* CR_Hatran */ + +/* 'Multani': Script */ +static const OnigCodePoint CR_Multani[] = { + 5, 0x11280, 0x11286, 0x11288, 0x11288, 0x1128a, + 0x1128d, 0x1128f, 0x1129d, 0x1129f, 0x112a9, +}; /* CR_Multani */ + +/* 'Old_Hungarian': Script */ +static const OnigCodePoint CR_Old_Hungarian[] = { + 3, 0x10c80, 0x10cb2, 0x10cc0, 0x10cf2, 0x10cfa, 0x10cff, +}; /* CR_Old_Hungarian */ + +/* 'SignWriting': Script */ +static const OnigCodePoint CR_SignWriting[] = { + 3, 0x1d800, 0x1da8b, 0x1da9b, 0x1da9f, 0x1daa1, 0x1daaf, +}; /* CR_SignWriting */ + +/* 'Adlam': Script */ +static const OnigCodePoint CR_Adlam[] = { + 3, 0x1e900, 0x1e94a, 0x1e950, 0x1e959, 0x1e95e, 0x1e95f, +}; /* CR_Adlam */ + +/* 'Bhaiksuki': Script */ +static const OnigCodePoint CR_Bhaiksuki[] = { + 4, 0x11c00, 0x11c08, 0x11c0a, 0x11c36, 0x11c38, 0x11c45, 0x11c50, 0x11c6c, +}; /* CR_Bhaiksuki */ + +/* 'Marchen': Script */ +static const OnigCodePoint CR_Marchen[] = { + 3, 0x11c70, 0x11c8f, 0x11c92, 0x11ca7, 0x11ca9, 0x11cb6, +}; /* CR_Marchen */ + +/* 'Newa': Script */ +static const OnigCodePoint CR_Newa[] = { + 3, 0x11400, 0x11459, 0x1145b, 0x1145b, 0x1145d, 0x1145d, +}; /* CR_Newa */ + +/* 'Osage': Script */ +static const OnigCodePoint CR_Osage[] = { + 2, 0x104b0, 0x104d3, 0x104d8, 0x104fb, +}; /* CR_Osage */ + +/* 'Tangut': Script */ +static const OnigCodePoint CR_Tangut[] = { + 3, 0x16fe0, 0x16fe0, 0x17000, 0x187ec, 0x18800, 0x18af2, +}; /* CR_Tangut */ + +/* 'White_Space': Binary Property */ +# define CR_White_Space CR_Space + +/* 'Bidi_Control': Binary Property */ +static const OnigCodePoint CR_Bidi_Control[] = { + 4, 0x061c, 0x061c, 0x200e, 0x200f, 0x202a, 0x202e, 0x2066, 0x2069, +}; /* CR_Bidi_Control */ + +/* 'Join_Control': Binary Property */ +static const OnigCodePoint CR_Join_Control[] = { + 1, + 0x200c, + 0x200d, +}; /* CR_Join_Control */ + +/* 'Dash': Binary Property */ +static const OnigCodePoint CR_Dash[] = { + 21, 0x002d, 0x002d, 0x058a, 0x058a, 0x05be, 0x05be, 0x1400, 0x1400, + 0x1806, 0x1806, 0x2010, 0x2015, 0x2053, 0x2053, 0x207b, 0x207b, 0x208b, + 0x208b, 0x2212, 0x2212, 0x2e17, 0x2e17, 0x2e1a, 0x2e1a, 0x2e3a, 0x2e3b, + 0x2e40, 0x2e40, 0x301c, 0x301c, 0x3030, 0x3030, 0x30a0, 0x30a0, 0xfe31, + 0xfe32, 0xfe58, 0xfe58, 0xfe63, 0xfe63, 0xff0d, 0xff0d, +}; /* CR_Dash */ + +/* 'Hyphen': Binary Property */ +static const OnigCodePoint CR_Hyphen[] = { + 10, 0x002d, 0x002d, 0x00ad, 0x00ad, 0x058a, 0x058a, + 0x1806, 0x1806, 0x2010, 0x2011, 0x2e17, 0x2e17, 0x30fb, + 0x30fb, 0xfe63, 0xfe63, 0xff0d, 0xff0d, 0xff65, 0xff65, +}; /* CR_Hyphen */ + +/* 'Quotation_Mark': Binary Property */ +static const OnigCodePoint CR_Quotation_Mark[] = { + 13, 0x0022, 0x0022, 0x0027, 0x0027, 0x00ab, 0x00ab, 0x00bb, 0x00bb, + 0x2018, 0x201f, 0x2039, 0x203a, 0x2e42, 0x2e42, 0x300c, 0x300f, 0x301d, + 0x301f, 0xfe41, 0xfe44, 0xff02, 0xff02, 0xff07, 0xff07, 0xff62, 0xff63, +}; /* CR_Quotation_Mark */ + +/* 'Terminal_Punctuation': Binary Property */ +static const OnigCodePoint CR_Terminal_Punctuation[] = { + 94, 0x0021, 0x0021, 0x002c, 0x002c, 0x002e, 0x002e, 0x003a, + 0x003b, 0x003f, 0x003f, 0x037e, 0x037e, 0x0387, 0x0387, 0x0589, + 0x0589, 0x05c3, 0x05c3, 0x060c, 0x060c, 0x061b, 0x061b, 0x061f, + 0x061f, 0x06d4, 0x06d4, 0x0700, 0x070a, 0x070c, 0x070c, 0x07f8, + 0x07f9, 0x0830, 0x083e, 0x085e, 0x085e, 0x0964, 0x0965, 0x0e5a, + 0x0e5b, 0x0f08, 0x0f08, 0x0f0d, 0x0f12, 0x104a, 0x104b, 0x1361, + 0x1368, 0x166d, 0x166e, 0x16eb, 0x16ed, 0x1735, 0x1736, 0x17d4, + 0x17d6, 0x17da, 0x17da, 0x1802, 0x1805, 0x1808, 0x1809, 0x1944, + 0x1945, 0x1aa8, 0x1aab, 0x1b5a, 0x1b5b, 0x1b5d, 0x1b5f, 0x1c3b, + 0x1c3f, 0x1c7e, 0x1c7f, 0x203c, 0x203d, 0x2047, 0x2049, 0x2e2e, + 0x2e2e, 0x2e3c, 0x2e3c, 0x2e41, 0x2e41, 0x3001, 0x3002, 0xa4fe, + 0xa4ff, 0xa60d, 0xa60f, 0xa6f3, 0xa6f7, 0xa876, 0xa877, 0xa8ce, + 0xa8cf, 0xa92f, 0xa92f, 0xa9c7, 0xa9c9, 0xaa5d, 0xaa5f, 0xaadf, + 0xaadf, 0xaaf0, 0xaaf1, 0xabeb, 0xabeb, 0xfe50, 0xfe52, 0xfe54, + 0xfe57, 0xff01, 0xff01, 0xff0c, 0xff0c, 0xff0e, 0xff0e, 0xff1a, + 0xff1b, 0xff1f, 0xff1f, 0xff61, 0xff61, 0xff64, 0xff64, 0x1039f, + 0x1039f, 0x103d0, 0x103d0, 0x10857, 0x10857, 0x1091f, 0x1091f, 0x10a56, + 0x10a57, 0x10af0, 0x10af5, 0x10b3a, 0x10b3f, 0x10b99, 0x10b9c, 0x11047, + 0x1104d, 0x110be, 0x110c1, 0x11141, 0x11143, 0x111c5, 0x111c6, 0x111cd, + 0x111cd, 0x111de, 0x111df, 0x11238, 0x1123c, 0x112a9, 0x112a9, 0x1144b, + 0x1144d, 0x1145b, 0x1145b, 0x115c2, 0x115c5, 0x115c9, 0x115d7, 0x11641, + 0x11642, 0x1173c, 0x1173e, 0x11c41, 0x11c43, 0x11c71, 0x11c71, 0x12470, + 0x12474, 0x16a6e, 0x16a6f, 0x16af5, 0x16af5, 0x16b37, 0x16b39, 0x16b44, + 0x16b44, 0x1bc9f, 0x1bc9f, 0x1da87, 0x1da8a, +}; /* CR_Terminal_Punctuation */ + +/* 'Other_Math': Binary Property */ +static const OnigCodePoint CR_Other_Math[] = { + 134, 0x005e, 0x005e, 0x03d0, 0x03d2, 0x03d5, 0x03d5, 0x03f0, + 0x03f1, 0x03f4, 0x03f5, 0x2016, 0x2016, 0x2032, 0x2034, 0x2040, + 0x2040, 0x2061, 0x2064, 0x207d, 0x207e, 0x208d, 0x208e, 0x20d0, + 0x20dc, 0x20e1, 0x20e1, 0x20e5, 0x20e6, 0x20eb, 0x20ef, 0x2102, + 0x2102, 0x2107, 0x2107, 0x210a, 0x2113, 0x2115, 0x2115, 0x2119, + 0x211d, 0x2124, 0x2124, 0x2128, 0x2129, 0x212c, 0x212d, 0x212f, + 0x2131, 0x2133, 0x2138, 0x213c, 0x213f, 0x2145, 0x2149, 0x2195, + 0x2199, 0x219c, 0x219f, 0x21a1, 0x21a2, 0x21a4, 0x21a5, 0x21a7, + 0x21a7, 0x21a9, 0x21ad, 0x21b0, 0x21b1, 0x21b6, 0x21b7, 0x21bc, + 0x21cd, 0x21d0, 0x21d1, 0x21d3, 0x21d3, 0x21d5, 0x21db, 0x21dd, + 0x21dd, 0x21e4, 0x21e5, 0x2308, 0x230b, 0x23b4, 0x23b5, 0x23b7, + 0x23b7, 0x23d0, 0x23d0, 0x23e2, 0x23e2, 0x25a0, 0x25a1, 0x25ae, + 0x25b6, 0x25bc, 0x25c0, 0x25c6, 0x25c7, 0x25ca, 0x25cb, 0x25cf, + 0x25d3, 0x25e2, 0x25e2, 0x25e4, 0x25e4, 0x25e7, 0x25ec, 0x2605, + 0x2606, 0x2640, 0x2640, 0x2642, 0x2642, 0x2660, 0x2663, 0x266d, + 0x266e, 0x27c5, 0x27c6, 0x27e6, 0x27ef, 0x2983, 0x2998, 0x29d8, + 0x29db, 0x29fc, 0x29fd, 0xfe61, 0xfe61, 0xfe63, 0xfe63, 0xfe68, + 0xfe68, 0xff3c, 0xff3c, 0xff3e, 0xff3e, 0x1d400, 0x1d454, 0x1d456, + 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, + 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, + 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, + 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, 0x1d544, 0x1d546, 0x1d546, 0x1d54a, + 0x1d550, 0x1d552, 0x1d6a5, 0x1d6a8, 0x1d6c0, 0x1d6c2, 0x1d6da, 0x1d6dc, + 0x1d6fa, 0x1d6fc, 0x1d714, 0x1d716, 0x1d734, 0x1d736, 0x1d74e, 0x1d750, + 0x1d76e, 0x1d770, 0x1d788, 0x1d78a, 0x1d7a8, 0x1d7aa, 0x1d7c2, 0x1d7c4, + 0x1d7cb, 0x1d7ce, 0x1d7ff, 0x1ee00, 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, + 0x1ee22, 0x1ee24, 0x1ee24, 0x1ee27, 0x1ee27, 0x1ee29, 0x1ee32, 0x1ee34, + 0x1ee37, 0x1ee39, 0x1ee39, 0x1ee3b, 0x1ee3b, 0x1ee42, 0x1ee42, 0x1ee47, + 0x1ee47, 0x1ee49, 0x1ee49, 0x1ee4b, 0x1ee4b, 0x1ee4d, 0x1ee4f, 0x1ee51, + 0x1ee52, 0x1ee54, 0x1ee54, 0x1ee57, 0x1ee57, 0x1ee59, 0x1ee59, 0x1ee5b, + 0x1ee5b, 0x1ee5d, 0x1ee5d, 0x1ee5f, 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, + 0x1ee64, 0x1ee67, 0x1ee6a, 0x1ee6c, 0x1ee72, 0x1ee74, 0x1ee77, 0x1ee79, + 0x1ee7c, 0x1ee7e, 0x1ee7e, 0x1ee80, 0x1ee89, 0x1ee8b, 0x1ee9b, 0x1eea1, + 0x1eea3, 0x1eea5, 0x1eea9, 0x1eeab, 0x1eebb, +}; /* CR_Other_Math */ + +/* 'Hex_Digit': Binary Property */ +static const OnigCodePoint CR_Hex_Digit[] = { + 6, 0x0030, 0x0039, 0x0041, 0x0046, 0x0061, 0x0066, + 0xff10, 0xff19, 0xff21, 0xff26, 0xff41, 0xff46, +}; /* CR_Hex_Digit */ + +/* 'ASCII_Hex_Digit': Binary Property */ +# define CR_ASCII_Hex_Digit CR_XDigit + +/* 'Other_Alphabetic': Binary Property */ +static const OnigCodePoint CR_Other_Alphabetic[] = { + 194, 0x0345, 0x0345, 0x05b0, 0x05bd, 0x05bf, 0x05bf, 0x05c1, + 0x05c2, 0x05c4, 0x05c5, 0x05c7, 0x05c7, 0x0610, 0x061a, 0x064b, + 0x0657, 0x0659, 0x065f, 0x0670, 0x0670, 0x06d6, 0x06dc, 0x06e1, + 0x06e4, 0x06e7, 0x06e8, 0x06ed, 0x06ed, 0x0711, 0x0711, 0x0730, + 0x073f, 0x07a6, 0x07b0, 0x0816, 0x0817, 0x081b, 0x0823, 0x0825, + 0x0827, 0x0829, 0x082c, 0x08d4, 0x08df, 0x08e3, 0x08e9, 0x08f0, + 0x0903, 0x093a, 0x093b, 0x093e, 0x094c, 0x094e, 0x094f, 0x0955, + 0x0957, 0x0962, 0x0963, 0x0981, 0x0983, 0x09be, 0x09c4, 0x09c7, + 0x09c8, 0x09cb, 0x09cc, 0x09d7, 0x09d7, 0x09e2, 0x09e3, 0x0a01, + 0x0a03, 0x0a3e, 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4c, 0x0a51, + 0x0a51, 0x0a70, 0x0a71, 0x0a75, 0x0a75, 0x0a81, 0x0a83, 0x0abe, + 0x0ac5, 0x0ac7, 0x0ac9, 0x0acb, 0x0acc, 0x0ae2, 0x0ae3, 0x0b01, + 0x0b03, 0x0b3e, 0x0b44, 0x0b47, 0x0b48, 0x0b4b, 0x0b4c, 0x0b56, + 0x0b57, 0x0b62, 0x0b63, 0x0b82, 0x0b82, 0x0bbe, 0x0bc2, 0x0bc6, + 0x0bc8, 0x0bca, 0x0bcc, 0x0bd7, 0x0bd7, 0x0c00, 0x0c03, 0x0c3e, + 0x0c44, 0x0c46, 0x0c48, 0x0c4a, 0x0c4c, 0x0c55, 0x0c56, 0x0c62, + 0x0c63, 0x0c81, 0x0c83, 0x0cbe, 0x0cc4, 0x0cc6, 0x0cc8, 0x0cca, + 0x0ccc, 0x0cd5, 0x0cd6, 0x0ce2, 0x0ce3, 0x0d01, 0x0d03, 0x0d3e, + 0x0d44, 0x0d46, 0x0d48, 0x0d4a, 0x0d4c, 0x0d57, 0x0d57, 0x0d62, + 0x0d63, 0x0d82, 0x0d83, 0x0dcf, 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, + 0x0ddf, 0x0df2, 0x0df3, 0x0e31, 0x0e31, 0x0e34, 0x0e3a, 0x0e4d, + 0x0e4d, 0x0eb1, 0x0eb1, 0x0eb4, 0x0eb9, 0x0ebb, 0x0ebc, 0x0ecd, + 0x0ecd, 0x0f71, 0x0f81, 0x0f8d, 0x0f97, 0x0f99, 0x0fbc, 0x102b, + 0x1036, 0x1038, 0x1038, 0x103b, 0x103e, 0x1056, 0x1059, 0x105e, + 0x1060, 0x1062, 0x1062, 0x1067, 0x1068, 0x1071, 0x1074, 0x1082, + 0x1086, 0x109c, 0x109d, 0x135f, 0x135f, 0x1712, 0x1713, 0x1732, + 0x1733, 0x1752, 0x1753, 0x1772, 0x1773, 0x17b6, 0x17c8, 0x1885, + 0x1886, 0x18a9, 0x18a9, 0x1920, 0x192b, 0x1930, 0x1938, 0x1a17, + 0x1a1b, 0x1a55, 0x1a5e, 0x1a61, 0x1a74, 0x1b00, 0x1b04, 0x1b35, + 0x1b43, 0x1b80, 0x1b82, 0x1ba1, 0x1ba9, 0x1bac, 0x1bad, 0x1be7, + 0x1bf1, 0x1c24, 0x1c35, 0x1cf2, 0x1cf3, 0x1de7, 0x1df4, 0x24b6, + 0x24e9, 0x2de0, 0x2dff, 0xa674, 0xa67b, 0xa69e, 0xa69f, 0xa823, + 0xa827, 0xa880, 0xa881, 0xa8b4, 0xa8c3, 0xa8c5, 0xa8c5, 0xa926, + 0xa92a, 0xa947, 0xa952, 0xa980, 0xa983, 0xa9b4, 0xa9bf, 0xaa29, + 0xaa36, 0xaa43, 0xaa43, 0xaa4c, 0xaa4d, 0xaab0, 0xaab0, 0xaab2, + 0xaab4, 0xaab7, 0xaab8, 0xaabe, 0xaabe, 0xaaeb, 0xaaef, 0xaaf5, + 0xaaf5, 0xabe3, 0xabea, 0xfb1e, 0xfb1e, 0x10376, 0x1037a, 0x10a01, + 0x10a03, 0x10a05, 0x10a06, 0x10a0c, 0x10a0f, 0x11000, 0x11002, 0x11038, + 0x11045, 0x11082, 0x11082, 0x110b0, 0x110b8, 0x11100, 0x11102, 0x11127, + 0x11132, 0x11180, 0x11182, 0x111b3, 0x111bf, 0x1122c, 0x11234, 0x11237, + 0x11237, 0x1123e, 0x1123e, 0x112df, 0x112e8, 0x11300, 0x11303, 0x1133e, + 0x11344, 0x11347, 0x11348, 0x1134b, 0x1134c, 0x11357, 0x11357, 0x11362, + 0x11363, 0x11435, 0x11441, 0x11443, 0x11445, 0x114b0, 0x114c1, 0x115af, + 0x115b5, 0x115b8, 0x115be, 0x115dc, 0x115dd, 0x11630, 0x1163e, 0x11640, + 0x11640, 0x116ab, 0x116b5, 0x1171d, 0x1172a, 0x11c2f, 0x11c36, 0x11c38, + 0x11c3e, 0x11c92, 0x11ca7, 0x11ca9, 0x11cb6, 0x16b30, 0x16b36, 0x16f51, + 0x16f7e, 0x1bc9e, 0x1bc9e, 0x1e000, 0x1e006, 0x1e008, 0x1e018, 0x1e01b, + 0x1e021, 0x1e023, 0x1e024, 0x1e026, 0x1e02a, 0x1e947, 0x1e947, 0x1f130, + 0x1f149, 0x1f150, 0x1f169, 0x1f170, 0x1f189, +}; /* CR_Other_Alphabetic */ + +/* 'Ideographic': Binary Property */ +static const OnigCodePoint CR_Ideographic[] = { + 14, 0x3006, 0x3007, 0x3021, 0x3029, 0x3038, 0x303a, 0x3400, + 0x4db5, 0x4e00, 0x9fd5, 0xf900, 0xfa6d, 0xfa70, 0xfad9, 0x17000, + 0x187ec, 0x18800, 0x18af2, 0x20000, 0x2a6d6, 0x2a700, 0x2b734, 0x2b740, + 0x2b81d, 0x2b820, 0x2cea1, 0x2f800, 0x2fa1d, +}; /* CR_Ideographic */ + +/* 'Diacritic': Binary Property */ +static const OnigCodePoint CR_Diacritic[] = { + 152, 0x005e, 0x005e, 0x0060, 0x0060, 0x00a8, 0x00a8, 0x00af, + 0x00af, 0x00b4, 0x00b4, 0x00b7, 0x00b8, 0x02b0, 0x034e, 0x0350, + 0x0357, 0x035d, 0x0362, 0x0374, 0x0375, 0x037a, 0x037a, 0x0384, + 0x0385, 0x0483, 0x0487, 0x0559, 0x0559, 0x0591, 0x05a1, 0x05a3, + 0x05bd, 0x05bf, 0x05bf, 0x05c1, 0x05c2, 0x05c4, 0x05c4, 0x064b, + 0x0652, 0x0657, 0x0658, 0x06df, 0x06e0, 0x06e5, 0x06e6, 0x06ea, + 0x06ec, 0x0730, 0x074a, 0x07a6, 0x07b0, 0x07eb, 0x07f5, 0x0818, + 0x0819, 0x08e3, 0x08fe, 0x093c, 0x093c, 0x094d, 0x094d, 0x0951, + 0x0954, 0x0971, 0x0971, 0x09bc, 0x09bc, 0x09cd, 0x09cd, 0x0a3c, + 0x0a3c, 0x0a4d, 0x0a4d, 0x0abc, 0x0abc, 0x0acd, 0x0acd, 0x0b3c, + 0x0b3c, 0x0b4d, 0x0b4d, 0x0bcd, 0x0bcd, 0x0c4d, 0x0c4d, 0x0cbc, + 0x0cbc, 0x0ccd, 0x0ccd, 0x0d4d, 0x0d4d, 0x0dca, 0x0dca, 0x0e47, + 0x0e4c, 0x0e4e, 0x0e4e, 0x0ec8, 0x0ecc, 0x0f18, 0x0f19, 0x0f35, + 0x0f35, 0x0f37, 0x0f37, 0x0f39, 0x0f39, 0x0f3e, 0x0f3f, 0x0f82, + 0x0f84, 0x0f86, 0x0f87, 0x0fc6, 0x0fc6, 0x1037, 0x1037, 0x1039, + 0x103a, 0x1087, 0x108d, 0x108f, 0x108f, 0x109a, 0x109b, 0x17c9, + 0x17d3, 0x17dd, 0x17dd, 0x1939, 0x193b, 0x1a75, 0x1a7c, 0x1a7f, + 0x1a7f, 0x1ab0, 0x1abd, 0x1b34, 0x1b34, 0x1b44, 0x1b44, 0x1b6b, + 0x1b73, 0x1baa, 0x1bab, 0x1c36, 0x1c37, 0x1c78, 0x1c7d, 0x1cd0, + 0x1ce8, 0x1ced, 0x1ced, 0x1cf4, 0x1cf4, 0x1cf8, 0x1cf9, 0x1d2c, + 0x1d6a, 0x1dc4, 0x1dcf, 0x1df5, 0x1df5, 0x1dfd, 0x1dff, 0x1fbd, + 0x1fbd, 0x1fbf, 0x1fc1, 0x1fcd, 0x1fcf, 0x1fdd, 0x1fdf, 0x1fed, + 0x1fef, 0x1ffd, 0x1ffe, 0x2cef, 0x2cf1, 0x2e2f, 0x2e2f, 0x302a, + 0x302f, 0x3099, 0x309c, 0x30fc, 0x30fc, 0xa66f, 0xa66f, 0xa67c, + 0xa67d, 0xa67f, 0xa67f, 0xa69c, 0xa69d, 0xa6f0, 0xa6f1, 0xa717, + 0xa721, 0xa788, 0xa788, 0xa7f8, 0xa7f9, 0xa8c4, 0xa8c4, 0xa8e0, + 0xa8f1, 0xa92b, 0xa92e, 0xa953, 0xa953, 0xa9b3, 0xa9b3, 0xa9c0, + 0xa9c0, 0xa9e5, 0xa9e5, 0xaa7b, 0xaa7d, 0xaabf, 0xaac2, 0xaaf6, + 0xaaf6, 0xab5b, 0xab5f, 0xabec, 0xabed, 0xfb1e, 0xfb1e, 0xfe20, + 0xfe2f, 0xff3e, 0xff3e, 0xff40, 0xff40, 0xff70, 0xff70, 0xff9e, + 0xff9f, 0xffe3, 0xffe3, 0x102e0, 0x102e0, 0x10ae5, 0x10ae6, 0x110b9, + 0x110ba, 0x11133, 0x11134, 0x11173, 0x11173, 0x111c0, 0x111c0, 0x111ca, + 0x111cc, 0x11235, 0x11236, 0x112e9, 0x112ea, 0x1133c, 0x1133c, 0x1134d, + 0x1134d, 0x11366, 0x1136c, 0x11370, 0x11374, 0x11442, 0x11442, 0x11446, + 0x11446, 0x114c2, 0x114c3, 0x115bf, 0x115c0, 0x1163f, 0x1163f, 0x116b6, + 0x116b7, 0x1172b, 0x1172b, 0x11c3f, 0x11c3f, 0x16af0, 0x16af4, 0x16f8f, + 0x16f9f, 0x1d167, 0x1d169, 0x1d16d, 0x1d172, 0x1d17b, 0x1d182, 0x1d185, + 0x1d18b, 0x1d1aa, 0x1d1ad, 0x1e8d0, 0x1e8d6, 0x1e944, 0x1e946, 0x1e948, + 0x1e94a, +}; /* CR_Diacritic */ + +/* 'Extender': Binary Property */ +static const OnigCodePoint CR_Extender[] = { + 28, 0x00b7, 0x00b7, 0x02d0, 0x02d1, 0x0640, 0x0640, 0x07fa, + 0x07fa, 0x0e46, 0x0e46, 0x0ec6, 0x0ec6, 0x180a, 0x180a, 0x1843, + 0x1843, 0x1aa7, 0x1aa7, 0x1c36, 0x1c36, 0x1c7b, 0x1c7b, 0x3005, + 0x3005, 0x3031, 0x3035, 0x309d, 0x309e, 0x30fc, 0x30fe, 0xa015, + 0xa015, 0xa60c, 0xa60c, 0xa9cf, 0xa9cf, 0xa9e6, 0xa9e6, 0xaa70, + 0xaa70, 0xaadd, 0xaadd, 0xaaf3, 0xaaf4, 0xff70, 0xff70, 0x1135d, + 0x1135d, 0x115c6, 0x115c8, 0x16b42, 0x16b43, 0x16fe0, 0x16fe0, 0x1e944, + 0x1e946, +}; /* CR_Extender */ + +/* 'Other_Lowercase': Binary Property */ +static const OnigCodePoint CR_Other_Lowercase[] = { + 20, 0x00aa, 0x00aa, 0x00ba, 0x00ba, 0x02b0, 0x02b8, 0x02c0, 0x02c1, + 0x02e0, 0x02e4, 0x0345, 0x0345, 0x037a, 0x037a, 0x1d2c, 0x1d6a, 0x1d78, + 0x1d78, 0x1d9b, 0x1dbf, 0x2071, 0x2071, 0x207f, 0x207f, 0x2090, 0x209c, + 0x2170, 0x217f, 0x24d0, 0x24e9, 0x2c7c, 0x2c7d, 0xa69c, 0xa69d, 0xa770, + 0xa770, 0xa7f8, 0xa7f9, 0xab5c, 0xab5f, +}; /* CR_Other_Lowercase */ + +/* 'Other_Uppercase': Binary Property */ +static const OnigCodePoint CR_Other_Uppercase[] = { + 5, 0x2160, 0x216f, 0x24b6, 0x24cf, 0x1f130, + 0x1f149, 0x1f150, 0x1f169, 0x1f170, 0x1f189, +}; /* CR_Other_Uppercase */ + +/* 'Noncharacter_Code_Point': Binary Property */ +static const OnigCodePoint CR_Noncharacter_Code_Point[] = { + 18, 0xfdd0, 0xfdef, 0xfffe, 0xffff, 0x1fffe, 0x1ffff, 0x2fffe, + 0x2ffff, 0x3fffe, 0x3ffff, 0x4fffe, 0x4ffff, 0x5fffe, 0x5ffff, 0x6fffe, + 0x6ffff, 0x7fffe, 0x7ffff, 0x8fffe, 0x8ffff, 0x9fffe, 0x9ffff, 0xafffe, + 0xaffff, 0xbfffe, 0xbffff, 0xcfffe, 0xcffff, 0xdfffe, 0xdffff, 0xefffe, + 0xeffff, 0xffffe, 0xfffff, 0x10fffe, 0x10ffff, +}; /* CR_Noncharacter_Code_Point */ + +/* 'Other_Grapheme_Extend': Binary Property */ +static const OnigCodePoint CR_Other_Grapheme_Extend[] = { + 23, 0x09be, 0x09be, 0x09d7, 0x09d7, 0x0b3e, 0x0b3e, 0x0b57, + 0x0b57, 0x0bbe, 0x0bbe, 0x0bd7, 0x0bd7, 0x0cc2, 0x0cc2, 0x0cd5, + 0x0cd6, 0x0d3e, 0x0d3e, 0x0d57, 0x0d57, 0x0dcf, 0x0dcf, 0x0ddf, + 0x0ddf, 0x200c, 0x200c, 0x302e, 0x302f, 0xff9e, 0xff9f, 0x1133e, + 0x1133e, 0x11357, 0x11357, 0x114b0, 0x114b0, 0x114bd, 0x114bd, 0x115af, + 0x115af, 0x1d165, 0x1d165, 0x1d16e, 0x1d172, 0xe0020, 0xe007f, +}; /* CR_Other_Grapheme_Extend */ + +/* 'IDS_Binary_Operator': Binary Property */ +static const OnigCodePoint CR_IDS_Binary_Operator[] = { + 2, 0x2ff0, 0x2ff1, 0x2ff4, 0x2ffb, +}; /* CR_IDS_Binary_Operator */ + +/* 'IDS_Trinary_Operator': Binary Property */ +static const OnigCodePoint CR_IDS_Trinary_Operator[] = { + 1, + 0x2ff2, + 0x2ff3, +}; /* CR_IDS_Trinary_Operator */ + +/* 'Radical': Binary Property */ +static const OnigCodePoint CR_Radical[] = { + 3, 0x2e80, 0x2e99, 0x2e9b, 0x2ef3, 0x2f00, 0x2fd5, +}; /* CR_Radical */ + +/* 'Unified_Ideograph': Binary Property */ +static const OnigCodePoint CR_Unified_Ideograph[] = { + 13, 0x3400, 0x4db5, 0x4e00, 0x9fd5, 0xfa0e, 0xfa0f, + 0xfa11, 0xfa11, 0xfa13, 0xfa14, 0xfa1f, 0xfa1f, 0xfa21, + 0xfa21, 0xfa23, 0xfa24, 0xfa27, 0xfa29, 0x20000, 0x2a6d6, + 0x2a700, 0x2b734, 0x2b740, 0x2b81d, 0x2b820, 0x2cea1, +}; /* CR_Unified_Ideograph */ + +/* 'Other_Default_Ignorable_Code_Point': Binary Property */ +static const OnigCodePoint CR_Other_Default_Ignorable_Code_Point[] = { + 11, 0x034f, 0x034f, 0x115f, 0x1160, 0x17b4, 0x17b5, 0x2065, + 0x2065, 0x3164, 0x3164, 0xffa0, 0xffa0, 0xfff0, 0xfff8, 0xe0000, + 0xe0000, 0xe0002, 0xe001f, 0xe0080, 0xe00ff, 0xe01f0, 0xe0fff, +}; /* CR_Other_Default_Ignorable_Code_Point */ + +/* 'Deprecated': Binary Property */ +static const OnigCodePoint CR_Deprecated[] = { + 8, 0x0149, 0x0149, 0x0673, 0x0673, 0x0f77, 0x0f77, 0x0f79, 0x0f79, + 0x17a3, 0x17a4, 0x206a, 0x206f, 0x2329, 0x232a, 0xe0001, 0xe0001, +}; /* CR_Deprecated */ + +/* 'Soft_Dotted': Binary Property */ +static const OnigCodePoint CR_Soft_Dotted[] = { + 31, 0x0069, 0x006a, 0x012f, 0x012f, 0x0249, 0x0249, 0x0268, + 0x0268, 0x029d, 0x029d, 0x02b2, 0x02b2, 0x03f3, 0x03f3, 0x0456, + 0x0456, 0x0458, 0x0458, 0x1d62, 0x1d62, 0x1d96, 0x1d96, 0x1da4, + 0x1da4, 0x1da8, 0x1da8, 0x1e2d, 0x1e2d, 0x1ecb, 0x1ecb, 0x2071, + 0x2071, 0x2148, 0x2149, 0x2c7c, 0x2c7c, 0x1d422, 0x1d423, 0x1d456, + 0x1d457, 0x1d48a, 0x1d48b, 0x1d4be, 0x1d4bf, 0x1d4f2, 0x1d4f3, 0x1d526, + 0x1d527, 0x1d55a, 0x1d55b, 0x1d58e, 0x1d58f, 0x1d5c2, 0x1d5c3, 0x1d5f6, + 0x1d5f7, 0x1d62a, 0x1d62b, 0x1d65e, 0x1d65f, 0x1d692, 0x1d693, +}; /* CR_Soft_Dotted */ + +/* 'Logical_Order_Exception': Binary Property */ +static const OnigCodePoint CR_Logical_Order_Exception[] = { + 7, 0x0e40, 0x0e44, 0x0ec0, 0x0ec4, 0x19b5, 0x19b7, 0x19ba, + 0x19ba, 0xaab5, 0xaab6, 0xaab9, 0xaab9, 0xaabb, 0xaabc, +}; /* CR_Logical_Order_Exception */ + +/* 'Other_ID_Start': Binary Property */ +static const OnigCodePoint CR_Other_ID_Start[] = { + 4, 0x1885, 0x1886, 0x2118, 0x2118, 0x212e, 0x212e, 0x309b, 0x309c, +}; /* CR_Other_ID_Start */ + +/* 'Other_ID_Continue': Binary Property */ +static const OnigCodePoint CR_Other_ID_Continue[] = { + 4, 0x00b7, 0x00b7, 0x0387, 0x0387, 0x1369, 0x1371, 0x19da, 0x19da, +}; /* CR_Other_ID_Continue */ + +/* 'Sentence_Terminal': Binary Property */ +static const OnigCodePoint CR_Sentence_Terminal[] = { + 66, 0x0021, 0x0021, 0x002e, 0x002e, 0x003f, 0x003f, 0x0589, + 0x0589, 0x061f, 0x061f, 0x06d4, 0x06d4, 0x0700, 0x0702, 0x07f9, + 0x07f9, 0x0964, 0x0965, 0x104a, 0x104b, 0x1362, 0x1362, 0x1367, + 0x1368, 0x166e, 0x166e, 0x1735, 0x1736, 0x1803, 0x1803, 0x1809, + 0x1809, 0x1944, 0x1945, 0x1aa8, 0x1aab, 0x1b5a, 0x1b5b, 0x1b5e, + 0x1b5f, 0x1c3b, 0x1c3c, 0x1c7e, 0x1c7f, 0x203c, 0x203d, 0x2047, + 0x2049, 0x2e2e, 0x2e2e, 0x2e3c, 0x2e3c, 0x3002, 0x3002, 0xa4ff, + 0xa4ff, 0xa60e, 0xa60f, 0xa6f3, 0xa6f3, 0xa6f7, 0xa6f7, 0xa876, + 0xa877, 0xa8ce, 0xa8cf, 0xa92f, 0xa92f, 0xa9c8, 0xa9c9, 0xaa5d, + 0xaa5f, 0xaaf0, 0xaaf1, 0xabeb, 0xabeb, 0xfe52, 0xfe52, 0xfe56, + 0xfe57, 0xff01, 0xff01, 0xff0e, 0xff0e, 0xff1f, 0xff1f, 0xff61, + 0xff61, 0x10a56, 0x10a57, 0x11047, 0x11048, 0x110be, 0x110c1, 0x11141, + 0x11143, 0x111c5, 0x111c6, 0x111cd, 0x111cd, 0x111de, 0x111df, 0x11238, + 0x11239, 0x1123b, 0x1123c, 0x112a9, 0x112a9, 0x1144b, 0x1144c, 0x115c2, + 0x115c3, 0x115c9, 0x115d7, 0x11641, 0x11642, 0x1173c, 0x1173e, 0x11c41, + 0x11c42, 0x16a6e, 0x16a6f, 0x16af5, 0x16af5, 0x16b37, 0x16b38, 0x16b44, + 0x16b44, 0x1bc9f, 0x1bc9f, 0x1da88, 0x1da88, +}; /* CR_Sentence_Terminal */ + +/* 'Variation_Selector': Binary Property */ +static const OnigCodePoint CR_Variation_Selector[] = { + 3, 0x180b, 0x180d, 0xfe00, 0xfe0f, 0xe0100, 0xe01ef, +}; /* CR_Variation_Selector */ + +/* 'Pattern_White_Space': Binary Property */ +static const OnigCodePoint CR_Pattern_White_Space[] = { + 5, 0x0009, 0x000d, 0x0020, 0x0020, 0x0085, + 0x0085, 0x200e, 0x200f, 0x2028, 0x2029, +}; /* CR_Pattern_White_Space */ + +/* 'Pattern_Syntax': Binary Property */ +static const OnigCodePoint CR_Pattern_Syntax[] = { + 28, 0x0021, 0x002f, 0x003a, 0x0040, 0x005b, 0x005e, 0x0060, 0x0060, + 0x007b, 0x007e, 0x00a1, 0x00a7, 0x00a9, 0x00a9, 0x00ab, 0x00ac, 0x00ae, + 0x00ae, 0x00b0, 0x00b1, 0x00b6, 0x00b6, 0x00bb, 0x00bb, 0x00bf, 0x00bf, + 0x00d7, 0x00d7, 0x00f7, 0x00f7, 0x2010, 0x2027, 0x2030, 0x203e, 0x2041, + 0x2053, 0x2055, 0x205e, 0x2190, 0x245f, 0x2500, 0x2775, 0x2794, 0x2bff, + 0x2e00, 0x2e7f, 0x3001, 0x3003, 0x3008, 0x3020, 0x3030, 0x3030, 0xfd3e, + 0xfd3f, 0xfe45, 0xfe46, +}; /* CR_Pattern_Syntax */ + +/* 'Prepended_Concatenation_Mark': Binary Property */ +static const OnigCodePoint CR_Prepended_Concatenation_Mark[] = { + 5, 0x0600, 0x0605, 0x06dd, 0x06dd, 0x070f, + 0x070f, 0x08e2, 0x08e2, 0x110bd, 0x110bd, +}; /* CR_Prepended_Concatenation_Mark */ + +/* 'Unknown': Script */ +static const OnigCodePoint CR_Unknown[] = { + 636, 0x0378, 0x0379, 0x0380, 0x0383, 0x038b, 0x038b, 0x038d, + 0x038d, 0x03a2, 0x03a2, 0x0530, 0x0530, 0x0557, 0x0558, 0x0560, + 0x0560, 0x0588, 0x0588, 0x058b, 0x058c, 0x0590, 0x0590, 0x05c8, + 0x05cf, 0x05eb, 0x05ef, 0x05f5, 0x05ff, 0x061d, 0x061d, 0x070e, + 0x070e, 0x074b, 0x074c, 0x07b2, 0x07bf, 0x07fb, 0x07ff, 0x082e, + 0x082f, 0x083f, 0x083f, 0x085c, 0x085d, 0x085f, 0x089f, 0x08b5, + 0x08b5, 0x08be, 0x08d3, 0x0984, 0x0984, 0x098d, 0x098e, 0x0991, + 0x0992, 0x09a9, 0x09a9, 0x09b1, 0x09b1, 0x09b3, 0x09b5, 0x09ba, + 0x09bb, 0x09c5, 0x09c6, 0x09c9, 0x09ca, 0x09cf, 0x09d6, 0x09d8, + 0x09db, 0x09de, 0x09de, 0x09e4, 0x09e5, 0x09fc, 0x0a00, 0x0a04, + 0x0a04, 0x0a0b, 0x0a0e, 0x0a11, 0x0a12, 0x0a29, 0x0a29, 0x0a31, + 0x0a31, 0x0a34, 0x0a34, 0x0a37, 0x0a37, 0x0a3a, 0x0a3b, 0x0a3d, + 0x0a3d, 0x0a43, 0x0a46, 0x0a49, 0x0a4a, 0x0a4e, 0x0a50, 0x0a52, + 0x0a58, 0x0a5d, 0x0a5d, 0x0a5f, 0x0a65, 0x0a76, 0x0a80, 0x0a84, + 0x0a84, 0x0a8e, 0x0a8e, 0x0a92, 0x0a92, 0x0aa9, 0x0aa9, 0x0ab1, + 0x0ab1, 0x0ab4, 0x0ab4, 0x0aba, 0x0abb, 0x0ac6, 0x0ac6, 0x0aca, + 0x0aca, 0x0ace, 0x0acf, 0x0ad1, 0x0adf, 0x0ae4, 0x0ae5, 0x0af2, + 0x0af8, 0x0afa, 0x0b00, 0x0b04, 0x0b04, 0x0b0d, 0x0b0e, 0x0b11, + 0x0b12, 0x0b29, 0x0b29, 0x0b31, 0x0b31, 0x0b34, 0x0b34, 0x0b3a, + 0x0b3b, 0x0b45, 0x0b46, 0x0b49, 0x0b4a, 0x0b4e, 0x0b55, 0x0b58, + 0x0b5b, 0x0b5e, 0x0b5e, 0x0b64, 0x0b65, 0x0b78, 0x0b81, 0x0b84, + 0x0b84, 0x0b8b, 0x0b8d, 0x0b91, 0x0b91, 0x0b96, 0x0b98, 0x0b9b, + 0x0b9b, 0x0b9d, 0x0b9d, 0x0ba0, 0x0ba2, 0x0ba5, 0x0ba7, 0x0bab, + 0x0bad, 0x0bba, 0x0bbd, 0x0bc3, 0x0bc5, 0x0bc9, 0x0bc9, 0x0bce, + 0x0bcf, 0x0bd1, 0x0bd6, 0x0bd8, 0x0be5, 0x0bfb, 0x0bff, 0x0c04, + 0x0c04, 0x0c0d, 0x0c0d, 0x0c11, 0x0c11, 0x0c29, 0x0c29, 0x0c3a, + 0x0c3c, 0x0c45, 0x0c45, 0x0c49, 0x0c49, 0x0c4e, 0x0c54, 0x0c57, + 0x0c57, 0x0c5b, 0x0c5f, 0x0c64, 0x0c65, 0x0c70, 0x0c77, 0x0c84, + 0x0c84, 0x0c8d, 0x0c8d, 0x0c91, 0x0c91, 0x0ca9, 0x0ca9, 0x0cb4, + 0x0cb4, 0x0cba, 0x0cbb, 0x0cc5, 0x0cc5, 0x0cc9, 0x0cc9, 0x0cce, + 0x0cd4, 0x0cd7, 0x0cdd, 0x0cdf, 0x0cdf, 0x0ce4, 0x0ce5, 0x0cf0, + 0x0cf0, 0x0cf3, 0x0d00, 0x0d04, 0x0d04, 0x0d0d, 0x0d0d, 0x0d11, + 0x0d11, 0x0d3b, 0x0d3c, 0x0d45, 0x0d45, 0x0d49, 0x0d49, 0x0d50, + 0x0d53, 0x0d64, 0x0d65, 0x0d80, 0x0d81, 0x0d84, 0x0d84, 0x0d97, + 0x0d99, 0x0db2, 0x0db2, 0x0dbc, 0x0dbc, 0x0dbe, 0x0dbf, 0x0dc7, + 0x0dc9, 0x0dcb, 0x0dce, 0x0dd5, 0x0dd5, 0x0dd7, 0x0dd7, 0x0de0, + 0x0de5, 0x0df0, 0x0df1, 0x0df5, 0x0e00, 0x0e3b, 0x0e3e, 0x0e5c, + 0x0e80, 0x0e83, 0x0e83, 0x0e85, 0x0e86, 0x0e89, 0x0e89, 0x0e8b, + 0x0e8c, 0x0e8e, 0x0e93, 0x0e98, 0x0e98, 0x0ea0, 0x0ea0, 0x0ea4, + 0x0ea4, 0x0ea6, 0x0ea6, 0x0ea8, 0x0ea9, 0x0eac, 0x0eac, 0x0eba, + 0x0eba, 0x0ebe, 0x0ebf, 0x0ec5, 0x0ec5, 0x0ec7, 0x0ec7, 0x0ece, + 0x0ecf, 0x0eda, 0x0edb, 0x0ee0, 0x0eff, 0x0f48, 0x0f48, 0x0f6d, + 0x0f70, 0x0f98, 0x0f98, 0x0fbd, 0x0fbd, 0x0fcd, 0x0fcd, 0x0fdb, + 0x0fff, 0x10c6, 0x10c6, 0x10c8, 0x10cc, 0x10ce, 0x10cf, 0x1249, + 0x1249, 0x124e, 0x124f, 0x1257, 0x1257, 0x1259, 0x1259, 0x125e, + 0x125f, 0x1289, 0x1289, 0x128e, 0x128f, 0x12b1, 0x12b1, 0x12b6, + 0x12b7, 0x12bf, 0x12bf, 0x12c1, 0x12c1, 0x12c6, 0x12c7, 0x12d7, + 0x12d7, 0x1311, 0x1311, 0x1316, 0x1317, 0x135b, 0x135c, 0x137d, + 0x137f, 0x139a, 0x139f, 0x13f6, 0x13f7, 0x13fe, 0x13ff, 0x169d, + 0x169f, 0x16f9, 0x16ff, 0x170d, 0x170d, 0x1715, 0x171f, 0x1737, + 0x173f, 0x1754, 0x175f, 0x176d, 0x176d, 0x1771, 0x1771, 0x1774, + 0x177f, 0x17de, 0x17df, 0x17ea, 0x17ef, 0x17fa, 0x17ff, 0x180f, + 0x180f, 0x181a, 0x181f, 0x1878, 0x187f, 0x18ab, 0x18af, 0x18f6, + 0x18ff, 0x191f, 0x191f, 0x192c, 0x192f, 0x193c, 0x193f, 0x1941, + 0x1943, 0x196e, 0x196f, 0x1975, 0x197f, 0x19ac, 0x19af, 0x19ca, + 0x19cf, 0x19db, 0x19dd, 0x1a1c, 0x1a1d, 0x1a5f, 0x1a5f, 0x1a7d, + 0x1a7e, 0x1a8a, 0x1a8f, 0x1a9a, 0x1a9f, 0x1aae, 0x1aaf, 0x1abf, + 0x1aff, 0x1b4c, 0x1b4f, 0x1b7d, 0x1b7f, 0x1bf4, 0x1bfb, 0x1c38, + 0x1c3a, 0x1c4a, 0x1c4c, 0x1c89, 0x1cbf, 0x1cc8, 0x1ccf, 0x1cf7, + 0x1cf7, 0x1cfa, 0x1cff, 0x1df6, 0x1dfa, 0x1f16, 0x1f17, 0x1f1e, + 0x1f1f, 0x1f46, 0x1f47, 0x1f4e, 0x1f4f, 0x1f58, 0x1f58, 0x1f5a, + 0x1f5a, 0x1f5c, 0x1f5c, 0x1f5e, 0x1f5e, 0x1f7e, 0x1f7f, 0x1fb5, + 0x1fb5, 0x1fc5, 0x1fc5, 0x1fd4, 0x1fd5, 0x1fdc, 0x1fdc, 0x1ff0, + 0x1ff1, 0x1ff5, 0x1ff5, 0x1fff, 0x1fff, 0x2065, 0x2065, 0x2072, + 0x2073, 0x208f, 0x208f, 0x209d, 0x209f, 0x20bf, 0x20cf, 0x20f1, + 0x20ff, 0x218c, 0x218f, 0x23ff, 0x23ff, 0x2427, 0x243f, 0x244b, + 0x245f, 0x2b74, 0x2b75, 0x2b96, 0x2b97, 0x2bba, 0x2bbc, 0x2bc9, + 0x2bc9, 0x2bd2, 0x2beb, 0x2bf0, 0x2bff, 0x2c2f, 0x2c2f, 0x2c5f, + 0x2c5f, 0x2cf4, 0x2cf8, 0x2d26, 0x2d26, 0x2d28, 0x2d2c, 0x2d2e, + 0x2d2f, 0x2d68, 0x2d6e, 0x2d71, 0x2d7e, 0x2d97, 0x2d9f, 0x2da7, + 0x2da7, 0x2daf, 0x2daf, 0x2db7, 0x2db7, 0x2dbf, 0x2dbf, 0x2dc7, + 0x2dc7, 0x2dcf, 0x2dcf, 0x2dd7, 0x2dd7, 0x2ddf, 0x2ddf, 0x2e45, + 0x2e7f, 0x2e9a, 0x2e9a, 0x2ef4, 0x2eff, 0x2fd6, 0x2fef, 0x2ffc, + 0x2fff, 0x3040, 0x3040, 0x3097, 0x3098, 0x3100, 0x3104, 0x312e, + 0x3130, 0x318f, 0x318f, 0x31bb, 0x31bf, 0x31e4, 0x31ef, 0x321f, + 0x321f, 0x32ff, 0x32ff, 0x4db6, 0x4dbf, 0x9fd6, 0x9fff, 0xa48d, + 0xa48f, 0xa4c7, 0xa4cf, 0xa62c, 0xa63f, 0xa6f8, 0xa6ff, 0xa7af, + 0xa7af, 0xa7b8, 0xa7f6, 0xa82c, 0xa82f, 0xa83a, 0xa83f, 0xa878, + 0xa87f, 0xa8c6, 0xa8cd, 0xa8da, 0xa8df, 0xa8fe, 0xa8ff, 0xa954, + 0xa95e, 0xa97d, 0xa97f, 0xa9ce, 0xa9ce, 0xa9da, 0xa9dd, 0xa9ff, + 0xa9ff, 0xaa37, 0xaa3f, 0xaa4e, 0xaa4f, 0xaa5a, 0xaa5b, 0xaac3, + 0xaada, 0xaaf7, 0xab00, 0xab07, 0xab08, 0xab0f, 0xab10, 0xab17, + 0xab1f, 0xab27, 0xab27, 0xab2f, 0xab2f, 0xab66, 0xab6f, 0xabee, + 0xabef, 0xabfa, 0xabff, 0xd7a4, 0xd7af, 0xd7c7, 0xd7ca, 0xd7fc, + 0xf8ff, 0xfa6e, 0xfa6f, 0xfada, 0xfaff, 0xfb07, 0xfb12, 0xfb18, + 0xfb1c, 0xfb37, 0xfb37, 0xfb3d, 0xfb3d, 0xfb3f, 0xfb3f, 0xfb42, + 0xfb42, 0xfb45, 0xfb45, 0xfbc2, 0xfbd2, 0xfd40, 0xfd4f, 0xfd90, + 0xfd91, 0xfdc8, 0xfdef, 0xfdfe, 0xfdff, 0xfe1a, 0xfe1f, 0xfe53, + 0xfe53, 0xfe67, 0xfe67, 0xfe6c, 0xfe6f, 0xfe75, 0xfe75, 0xfefd, + 0xfefe, 0xff00, 0xff00, 0xffbf, 0xffc1, 0xffc8, 0xffc9, 0xffd0, + 0xffd1, 0xffd8, 0xffd9, 0xffdd, 0xffdf, 0xffe7, 0xffe7, 0xffef, + 0xfff8, 0xfffe, 0xffff, 0x1000c, 0x1000c, 0x10027, 0x10027, 0x1003b, + 0x1003b, 0x1003e, 0x1003e, 0x1004e, 0x1004f, 0x1005e, 0x1007f, 0x100fb, + 0x100ff, 0x10103, 0x10106, 0x10134, 0x10136, 0x1018f, 0x1018f, 0x1019c, + 0x1019f, 0x101a1, 0x101cf, 0x101fe, 0x1027f, 0x1029d, 0x1029f, 0x102d1, + 0x102df, 0x102fc, 0x102ff, 0x10324, 0x1032f, 0x1034b, 0x1034f, 0x1037b, + 0x1037f, 0x1039e, 0x1039e, 0x103c4, 0x103c7, 0x103d6, 0x103ff, 0x1049e, + 0x1049f, 0x104aa, 0x104af, 0x104d4, 0x104d7, 0x104fc, 0x104ff, 0x10528, + 0x1052f, 0x10564, 0x1056e, 0x10570, 0x105ff, 0x10737, 0x1073f, 0x10756, + 0x1075f, 0x10768, 0x107ff, 0x10806, 0x10807, 0x10809, 0x10809, 0x10836, + 0x10836, 0x10839, 0x1083b, 0x1083d, 0x1083e, 0x10856, 0x10856, 0x1089f, + 0x108a6, 0x108b0, 0x108df, 0x108f3, 0x108f3, 0x108f6, 0x108fa, 0x1091c, + 0x1091e, 0x1093a, 0x1093e, 0x10940, 0x1097f, 0x109b8, 0x109bb, 0x109d0, + 0x109d1, 0x10a04, 0x10a04, 0x10a07, 0x10a0b, 0x10a14, 0x10a14, 0x10a18, + 0x10a18, 0x10a34, 0x10a37, 0x10a3b, 0x10a3e, 0x10a48, 0x10a4f, 0x10a59, + 0x10a5f, 0x10aa0, 0x10abf, 0x10ae7, 0x10aea, 0x10af7, 0x10aff, 0x10b36, + 0x10b38, 0x10b56, 0x10b57, 0x10b73, 0x10b77, 0x10b92, 0x10b98, 0x10b9d, + 0x10ba8, 0x10bb0, 0x10bff, 0x10c49, 0x10c7f, 0x10cb3, 0x10cbf, 0x10cf3, + 0x10cf9, 0x10d00, 0x10e5f, 0x10e7f, 0x10fff, 0x1104e, 0x11051, 0x11070, + 0x1107e, 0x110c2, 0x110cf, 0x110e9, 0x110ef, 0x110fa, 0x110ff, 0x11135, + 0x11135, 0x11144, 0x1114f, 0x11177, 0x1117f, 0x111ce, 0x111cf, 0x111e0, + 0x111e0, 0x111f5, 0x111ff, 0x11212, 0x11212, 0x1123f, 0x1127f, 0x11287, + 0x11287, 0x11289, 0x11289, 0x1128e, 0x1128e, 0x1129e, 0x1129e, 0x112aa, + 0x112af, 0x112eb, 0x112ef, 0x112fa, 0x112ff, 0x11304, 0x11304, 0x1130d, + 0x1130e, 0x11311, 0x11312, 0x11329, 0x11329, 0x11331, 0x11331, 0x11334, + 0x11334, 0x1133a, 0x1133b, 0x11345, 0x11346, 0x11349, 0x1134a, 0x1134e, + 0x1134f, 0x11351, 0x11356, 0x11358, 0x1135c, 0x11364, 0x11365, 0x1136d, + 0x1136f, 0x11375, 0x113ff, 0x1145a, 0x1145a, 0x1145c, 0x1145c, 0x1145e, + 0x1147f, 0x114c8, 0x114cf, 0x114da, 0x1157f, 0x115b6, 0x115b7, 0x115de, + 0x115ff, 0x11645, 0x1164f, 0x1165a, 0x1165f, 0x1166d, 0x1167f, 0x116b8, + 0x116bf, 0x116ca, 0x116ff, 0x1171a, 0x1171c, 0x1172c, 0x1172f, 0x11740, + 0x1189f, 0x118f3, 0x118fe, 0x11900, 0x11abf, 0x11af9, 0x11bff, 0x11c09, + 0x11c09, 0x11c37, 0x11c37, 0x11c46, 0x11c4f, 0x11c6d, 0x11c6f, 0x11c90, + 0x11c91, 0x11ca8, 0x11ca8, 0x11cb7, 0x11fff, 0x1239a, 0x123ff, 0x1246f, + 0x1246f, 0x12475, 0x1247f, 0x12544, 0x12fff, 0x1342f, 0x143ff, 0x14647, + 0x167ff, 0x16a39, 0x16a3f, 0x16a5f, 0x16a5f, 0x16a6a, 0x16a6d, 0x16a70, + 0x16acf, 0x16aee, 0x16aef, 0x16af6, 0x16aff, 0x16b46, 0x16b4f, 0x16b5a, + 0x16b5a, 0x16b62, 0x16b62, 0x16b78, 0x16b7c, 0x16b90, 0x16eff, 0x16f45, + 0x16f4f, 0x16f7f, 0x16f8e, 0x16fa0, 0x16fdf, 0x16fe1, 0x16fff, 0x187ed, + 0x187ff, 0x18af3, 0x1afff, 0x1b002, 0x1bbff, 0x1bc6b, 0x1bc6f, 0x1bc7d, + 0x1bc7f, 0x1bc89, 0x1bc8f, 0x1bc9a, 0x1bc9b, 0x1bca4, 0x1cfff, 0x1d0f6, + 0x1d0ff, 0x1d127, 0x1d128, 0x1d1e9, 0x1d1ff, 0x1d246, 0x1d2ff, 0x1d357, + 0x1d35f, 0x1d372, 0x1d3ff, 0x1d455, 0x1d455, 0x1d49d, 0x1d49d, 0x1d4a0, + 0x1d4a1, 0x1d4a3, 0x1d4a4, 0x1d4a7, 0x1d4a8, 0x1d4ad, 0x1d4ad, 0x1d4ba, + 0x1d4ba, 0x1d4bc, 0x1d4bc, 0x1d4c4, 0x1d4c4, 0x1d506, 0x1d506, 0x1d50b, + 0x1d50c, 0x1d515, 0x1d515, 0x1d51d, 0x1d51d, 0x1d53a, 0x1d53a, 0x1d53f, + 0x1d53f, 0x1d545, 0x1d545, 0x1d547, 0x1d549, 0x1d551, 0x1d551, 0x1d6a6, + 0x1d6a7, 0x1d7cc, 0x1d7cd, 0x1da8c, 0x1da9a, 0x1daa0, 0x1daa0, 0x1dab0, + 0x1dfff, 0x1e007, 0x1e007, 0x1e019, 0x1e01a, 0x1e022, 0x1e022, 0x1e025, + 0x1e025, 0x1e02b, 0x1e7ff, 0x1e8c5, 0x1e8c6, 0x1e8d7, 0x1e8ff, 0x1e94b, + 0x1e94f, 0x1e95a, 0x1e95d, 0x1e960, 0x1edff, 0x1ee04, 0x1ee04, 0x1ee20, + 0x1ee20, 0x1ee23, 0x1ee23, 0x1ee25, 0x1ee26, 0x1ee28, 0x1ee28, 0x1ee33, + 0x1ee33, 0x1ee38, 0x1ee38, 0x1ee3a, 0x1ee3a, 0x1ee3c, 0x1ee41, 0x1ee43, + 0x1ee46, 0x1ee48, 0x1ee48, 0x1ee4a, 0x1ee4a, 0x1ee4c, 0x1ee4c, 0x1ee50, + 0x1ee50, 0x1ee53, 0x1ee53, 0x1ee55, 0x1ee56, 0x1ee58, 0x1ee58, 0x1ee5a, + 0x1ee5a, 0x1ee5c, 0x1ee5c, 0x1ee5e, 0x1ee5e, 0x1ee60, 0x1ee60, 0x1ee63, + 0x1ee63, 0x1ee65, 0x1ee66, 0x1ee6b, 0x1ee6b, 0x1ee73, 0x1ee73, 0x1ee78, + 0x1ee78, 0x1ee7d, 0x1ee7d, 0x1ee7f, 0x1ee7f, 0x1ee8a, 0x1ee8a, 0x1ee9c, + 0x1eea0, 0x1eea4, 0x1eea4, 0x1eeaa, 0x1eeaa, 0x1eebc, 0x1eeef, 0x1eef2, + 0x1efff, 0x1f02c, 0x1f02f, 0x1f094, 0x1f09f, 0x1f0af, 0x1f0b0, 0x1f0c0, + 0x1f0c0, 0x1f0d0, 0x1f0d0, 0x1f0f6, 0x1f0ff, 0x1f10d, 0x1f10f, 0x1f12f, + 0x1f12f, 0x1f16c, 0x1f16f, 0x1f1ad, 0x1f1e5, 0x1f203, 0x1f20f, 0x1f23c, + 0x1f23f, 0x1f249, 0x1f24f, 0x1f252, 0x1f2ff, 0x1f6d3, 0x1f6df, 0x1f6ed, + 0x1f6ef, 0x1f6f7, 0x1f6ff, 0x1f774, 0x1f77f, 0x1f7d5, 0x1f7ff, 0x1f80c, + 0x1f80f, 0x1f848, 0x1f84f, 0x1f85a, 0x1f85f, 0x1f888, 0x1f88f, 0x1f8ae, + 0x1f90f, 0x1f91f, 0x1f91f, 0x1f928, 0x1f92f, 0x1f931, 0x1f932, 0x1f93f, + 0x1f93f, 0x1f94c, 0x1f94f, 0x1f95f, 0x1f97f, 0x1f992, 0x1f9bf, 0x1f9c1, + 0x1ffff, 0x2a6d7, 0x2a6ff, 0x2b735, 0x2b73f, 0x2b81e, 0x2b81f, 0x2cea2, + 0x2f7ff, 0x2fa1e, 0xe0000, 0xe0002, 0xe001f, 0xe0080, 0xe00ff, 0xe01f0, + 0x10ffff, +}; /* CR_Unknown */ + +# ifdef USE_UNICODE_AGE_PROPERTIES +/* 'Age_1_1': Derived Age 1.1 */ +static const OnigCodePoint CR_Age_1_1[] = { + 288, 0x0000, 0x01f5, 0x01fa, 0x0217, 0x0250, 0x02a8, 0x02b0, 0x02de, + 0x02e0, 0x02e9, 0x0300, 0x0345, 0x0360, 0x0361, 0x0374, 0x0375, 0x037a, + 0x037a, 0x037e, 0x037e, 0x0384, 0x038a, 0x038c, 0x038c, 0x038e, 0x03a1, + 0x03a3, 0x03ce, 0x03d0, 0x03d6, 0x03da, 0x03da, 0x03dc, 0x03dc, 0x03de, + 0x03de, 0x03e0, 0x03e0, 0x03e2, 0x03f3, 0x0401, 0x040c, 0x040e, 0x044f, + 0x0451, 0x045c, 0x045e, 0x0486, 0x0490, 0x04c4, 0x04c7, 0x04c8, 0x04cb, + 0x04cc, 0x04d0, 0x04eb, 0x04ee, 0x04f5, 0x04f8, 0x04f9, 0x0531, 0x0556, + 0x0559, 0x055f, 0x0561, 0x0587, 0x0589, 0x0589, 0x05b0, 0x05b9, 0x05bb, + 0x05c3, 0x05d0, 0x05ea, 0x05f0, 0x05f4, 0x060c, 0x060c, 0x061b, 0x061b, + 0x061f, 0x061f, 0x0621, 0x063a, 0x0640, 0x0652, 0x0660, 0x066d, 0x0670, + 0x06b7, 0x06ba, 0x06be, 0x06c0, 0x06ce, 0x06d0, 0x06ed, 0x06f0, 0x06f9, + 0x0901, 0x0903, 0x0905, 0x0939, 0x093c, 0x094d, 0x0950, 0x0954, 0x0958, + 0x0970, 0x0981, 0x0983, 0x0985, 0x098c, 0x098f, 0x0990, 0x0993, 0x09a8, + 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, 0x09b9, 0x09bc, 0x09bc, 0x09be, + 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09cd, 0x09d7, 0x09d7, 0x09dc, 0x09dd, + 0x09df, 0x09e3, 0x09e6, 0x09fa, 0x0a02, 0x0a02, 0x0a05, 0x0a0a, 0x0a0f, + 0x0a10, 0x0a13, 0x0a28, 0x0a2a, 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, + 0x0a38, 0x0a39, 0x0a3c, 0x0a3c, 0x0a3e, 0x0a42, 0x0a47, 0x0a48, 0x0a4b, + 0x0a4d, 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, 0x0a74, 0x0a81, 0x0a83, + 0x0a85, 0x0a8b, 0x0a8d, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, + 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, 0x0ac5, 0x0ac7, 0x0ac9, + 0x0acb, 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, 0x0ae0, 0x0ae6, 0x0aef, 0x0b01, + 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, 0x0b28, 0x0b2a, 0x0b30, + 0x0b32, 0x0b33, 0x0b36, 0x0b39, 0x0b3c, 0x0b43, 0x0b47, 0x0b48, 0x0b4b, + 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, 0x0b5d, 0x0b5f, 0x0b61, 0x0b66, 0x0b70, + 0x0b82, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, 0x0b95, 0x0b99, + 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, 0x0baa, + 0x0bae, 0x0bb5, 0x0bb7, 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, + 0x0bcd, 0x0bd7, 0x0bd7, 0x0be7, 0x0bf2, 0x0c01, 0x0c03, 0x0c05, 0x0c0c, + 0x0c0e, 0x0c10, 0x0c12, 0x0c28, 0x0c2a, 0x0c33, 0x0c35, 0x0c39, 0x0c3e, + 0x0c44, 0x0c46, 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, 0x0c56, 0x0c60, 0x0c61, + 0x0c66, 0x0c6f, 0x0c82, 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, + 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbe, 0x0cc4, 0x0cc6, 0x0cc8, + 0x0cca, 0x0ccd, 0x0cd5, 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, 0x0ce1, 0x0ce6, + 0x0cef, 0x0d02, 0x0d03, 0x0d05, 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d28, + 0x0d2a, 0x0d39, 0x0d3e, 0x0d43, 0x0d46, 0x0d48, 0x0d4a, 0x0d4d, 0x0d57, + 0x0d57, 0x0d60, 0x0d61, 0x0d66, 0x0d6f, 0x0e01, 0x0e3a, 0x0e3f, 0x0e5b, + 0x0e81, 0x0e82, 0x0e84, 0x0e84, 0x0e87, 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, + 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, 0x0ea5, + 0x0ea7, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, 0x0ebd, 0x0ec0, + 0x0ec4, 0x0ec6, 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, 0x0ed9, 0x0edc, 0x0edd, + 0x10a0, 0x10c5, 0x10d0, 0x10f6, 0x10fb, 0x10fb, 0x1100, 0x1159, 0x115f, + 0x11a2, 0x11a8, 0x11f9, 0x1e00, 0x1e9a, 0x1ea0, 0x1ef9, 0x1f00, 0x1f15, + 0x1f18, 0x1f1d, 0x1f20, 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, + 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, 0x1fb4, + 0x1fb6, 0x1fc4, 0x1fc6, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fdd, 0x1fef, 0x1ff2, + 0x1ff4, 0x1ff6, 0x1ffe, 0x2000, 0x202e, 0x2030, 0x2046, 0x206a, 0x2070, + 0x2074, 0x208e, 0x20a0, 0x20aa, 0x20d0, 0x20e1, 0x2100, 0x2138, 0x2153, + 0x2182, 0x2190, 0x21ea, 0x2200, 0x22f1, 0x2300, 0x2300, 0x2302, 0x237a, + 0x2400, 0x2424, 0x2440, 0x244a, 0x2460, 0x24ea, 0x2500, 0x2595, 0x25a0, + 0x25ef, 0x2600, 0x2613, 0x261a, 0x266f, 0x2701, 0x2704, 0x2706, 0x2709, + 0x270c, 0x2727, 0x2729, 0x274b, 0x274d, 0x274d, 0x274f, 0x2752, 0x2756, + 0x2756, 0x2758, 0x275e, 0x2761, 0x2767, 0x2776, 0x2794, 0x2798, 0x27af, + 0x27b1, 0x27be, 0x3000, 0x3037, 0x303f, 0x303f, 0x3041, 0x3094, 0x3099, + 0x309e, 0x30a1, 0x30fe, 0x3105, 0x312c, 0x3131, 0x318e, 0x3190, 0x319f, + 0x3200, 0x321c, 0x3220, 0x3243, 0x3260, 0x327b, 0x327f, 0x32b0, 0x32c0, + 0x32cb, 0x32d0, 0x32fe, 0x3300, 0x3376, 0x337b, 0x33dd, 0x33e0, 0x33fe, + 0x4e00, 0x9fa5, 0xe000, 0xfa2d, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xfb1e, + 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, + 0xfb46, 0xfbb1, 0xfbd3, 0xfd3f, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdf0, + 0xfdfb, 0xfe20, 0xfe23, 0xfe30, 0xfe44, 0xfe49, 0xfe52, 0xfe54, 0xfe66, + 0xfe68, 0xfe6b, 0xfe70, 0xfe72, 0xfe74, 0xfe74, 0xfe76, 0xfefc, 0xfeff, + 0xfeff, 0xff01, 0xff5e, 0xff61, 0xffbe, 0xffc2, 0xffc7, 0xffca, 0xffcf, + 0xffd2, 0xffd7, 0xffda, 0xffdc, 0xffe0, 0xffe6, 0xffe8, 0xffee, 0xfffd, + 0xffff, +}; /* CR_Age_1_1 */ + +/* 'Age_2_0': Derived Age 2.0 */ +static const OnigCodePoint CR_Age_2_0[] = { + 312, 0x0000, 0x01f5, 0x01fa, 0x0217, 0x0250, 0x02a8, 0x02b0, + 0x02de, 0x02e0, 0x02e9, 0x0300, 0x0345, 0x0360, 0x0361, 0x0374, + 0x0375, 0x037a, 0x037a, 0x037e, 0x037e, 0x0384, 0x038a, 0x038c, + 0x038c, 0x038e, 0x03a1, 0x03a3, 0x03ce, 0x03d0, 0x03d6, 0x03da, + 0x03da, 0x03dc, 0x03dc, 0x03de, 0x03de, 0x03e0, 0x03e0, 0x03e2, + 0x03f3, 0x0401, 0x040c, 0x040e, 0x044f, 0x0451, 0x045c, 0x045e, + 0x0486, 0x0490, 0x04c4, 0x04c7, 0x04c8, 0x04cb, 0x04cc, 0x04d0, + 0x04eb, 0x04ee, 0x04f5, 0x04f8, 0x04f9, 0x0531, 0x0556, 0x0559, + 0x055f, 0x0561, 0x0587, 0x0589, 0x0589, 0x0591, 0x05a1, 0x05a3, + 0x05b9, 0x05bb, 0x05c4, 0x05d0, 0x05ea, 0x05f0, 0x05f4, 0x060c, + 0x060c, 0x061b, 0x061b, 0x061f, 0x061f, 0x0621, 0x063a, 0x0640, + 0x0652, 0x0660, 0x066d, 0x0670, 0x06b7, 0x06ba, 0x06be, 0x06c0, + 0x06ce, 0x06d0, 0x06ed, 0x06f0, 0x06f9, 0x0901, 0x0903, 0x0905, + 0x0939, 0x093c, 0x094d, 0x0950, 0x0954, 0x0958, 0x0970, 0x0981, + 0x0983, 0x0985, 0x098c, 0x098f, 0x0990, 0x0993, 0x09a8, 0x09aa, + 0x09b0, 0x09b2, 0x09b2, 0x09b6, 0x09b9, 0x09bc, 0x09bc, 0x09be, + 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09cd, 0x09d7, 0x09d7, 0x09dc, + 0x09dd, 0x09df, 0x09e3, 0x09e6, 0x09fa, 0x0a02, 0x0a02, 0x0a05, + 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, 0x0a30, 0x0a32, + 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3c, 0x0a3c, 0x0a3e, + 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4d, 0x0a59, 0x0a5c, 0x0a5e, + 0x0a5e, 0x0a66, 0x0a74, 0x0a81, 0x0a83, 0x0a85, 0x0a8b, 0x0a8d, + 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, 0x0ab0, 0x0ab2, + 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, 0x0ac5, 0x0ac7, 0x0ac9, 0x0acb, + 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, 0x0ae0, 0x0ae6, 0x0aef, 0x0b01, + 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, 0x0b28, 0x0b2a, + 0x0b30, 0x0b32, 0x0b33, 0x0b36, 0x0b39, 0x0b3c, 0x0b43, 0x0b47, + 0x0b48, 0x0b4b, 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, 0x0b5d, 0x0b5f, + 0x0b61, 0x0b66, 0x0b70, 0x0b82, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, + 0x0b90, 0x0b92, 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, + 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, 0x0bb5, 0x0bb7, + 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, 0x0bcd, 0x0bd7, + 0x0bd7, 0x0be7, 0x0bf2, 0x0c01, 0x0c03, 0x0c05, 0x0c0c, 0x0c0e, + 0x0c10, 0x0c12, 0x0c28, 0x0c2a, 0x0c33, 0x0c35, 0x0c39, 0x0c3e, + 0x0c44, 0x0c46, 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, 0x0c56, 0x0c60, + 0x0c61, 0x0c66, 0x0c6f, 0x0c82, 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, + 0x0c90, 0x0c92, 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbe, + 0x0cc4, 0x0cc6, 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, 0x0cd6, 0x0cde, + 0x0cde, 0x0ce0, 0x0ce1, 0x0ce6, 0x0cef, 0x0d02, 0x0d03, 0x0d05, + 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d28, 0x0d2a, 0x0d39, 0x0d3e, + 0x0d43, 0x0d46, 0x0d48, 0x0d4a, 0x0d4d, 0x0d57, 0x0d57, 0x0d60, + 0x0d61, 0x0d66, 0x0d6f, 0x0e01, 0x0e3a, 0x0e3f, 0x0e5b, 0x0e81, + 0x0e82, 0x0e84, 0x0e84, 0x0e87, 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, + 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, + 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, + 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, + 0x0ed9, 0x0edc, 0x0edd, 0x0f00, 0x0f47, 0x0f49, 0x0f69, 0x0f71, + 0x0f8b, 0x0f90, 0x0f95, 0x0f97, 0x0f97, 0x0f99, 0x0fad, 0x0fb1, + 0x0fb7, 0x0fb9, 0x0fb9, 0x10a0, 0x10c5, 0x10d0, 0x10f6, 0x10fb, + 0x10fb, 0x1100, 0x1159, 0x115f, 0x11a2, 0x11a8, 0x11f9, 0x1e00, + 0x1e9b, 0x1ea0, 0x1ef9, 0x1f00, 0x1f15, 0x1f18, 0x1f1d, 0x1f20, + 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, 0x1f59, 0x1f5b, + 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, + 0x1fc4, 0x1fc6, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fdd, 0x1fef, 0x1ff2, + 0x1ff4, 0x1ff6, 0x1ffe, 0x2000, 0x202e, 0x2030, 0x2046, 0x206a, + 0x2070, 0x2074, 0x208e, 0x20a0, 0x20ab, 0x20d0, 0x20e1, 0x2100, + 0x2138, 0x2153, 0x2182, 0x2190, 0x21ea, 0x2200, 0x22f1, 0x2300, + 0x2300, 0x2302, 0x237a, 0x2400, 0x2424, 0x2440, 0x244a, 0x2460, + 0x24ea, 0x2500, 0x2595, 0x25a0, 0x25ef, 0x2600, 0x2613, 0x261a, + 0x266f, 0x2701, 0x2704, 0x2706, 0x2709, 0x270c, 0x2727, 0x2729, + 0x274b, 0x274d, 0x274d, 0x274f, 0x2752, 0x2756, 0x2756, 0x2758, + 0x275e, 0x2761, 0x2767, 0x2776, 0x2794, 0x2798, 0x27af, 0x27b1, + 0x27be, 0x3000, 0x3037, 0x303f, 0x303f, 0x3041, 0x3094, 0x3099, + 0x309e, 0x30a1, 0x30fe, 0x3105, 0x312c, 0x3131, 0x318e, 0x3190, + 0x319f, 0x3200, 0x321c, 0x3220, 0x3243, 0x3260, 0x327b, 0x327f, + 0x32b0, 0x32c0, 0x32cb, 0x32d0, 0x32fe, 0x3300, 0x3376, 0x337b, + 0x33dd, 0x33e0, 0x33fe, 0x4e00, 0x9fa5, 0xac00, 0xd7a3, 0xd800, + 0xfa2d, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xfb1e, 0xfb36, 0xfb38, + 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, + 0xfbb1, 0xfbd3, 0xfd3f, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdf0, + 0xfdfb, 0xfe20, 0xfe23, 0xfe30, 0xfe44, 0xfe49, 0xfe52, 0xfe54, + 0xfe66, 0xfe68, 0xfe6b, 0xfe70, 0xfe72, 0xfe74, 0xfe74, 0xfe76, + 0xfefc, 0xfeff, 0xfeff, 0xff01, 0xff5e, 0xff61, 0xffbe, 0xffc2, + 0xffc7, 0xffca, 0xffcf, 0xffd2, 0xffd7, 0xffda, 0xffdc, 0xffe0, + 0xffe6, 0xffe8, 0xffee, 0xfffd, 0xffff, 0x1fffe, 0x1ffff, 0x2fffe, + 0x2ffff, 0x3fffe, 0x3ffff, 0x4fffe, 0x4ffff, 0x5fffe, 0x5ffff, 0x6fffe, + 0x6ffff, 0x7fffe, 0x7ffff, 0x8fffe, 0x8ffff, 0x9fffe, 0x9ffff, 0xafffe, + 0xaffff, 0xbfffe, 0xbffff, 0xcfffe, 0xcffff, 0xdfffe, 0xdffff, 0xefffe, + 0x10ffff, +}; /* CR_Age_2_0 */ + +/* 'Age_2_1': Derived Age 2.1 */ +static const OnigCodePoint CR_Age_2_1[] = { + 312, 0x0000, 0x01f5, 0x01fa, 0x0217, 0x0250, 0x02a8, 0x02b0, + 0x02de, 0x02e0, 0x02e9, 0x0300, 0x0345, 0x0360, 0x0361, 0x0374, + 0x0375, 0x037a, 0x037a, 0x037e, 0x037e, 0x0384, 0x038a, 0x038c, + 0x038c, 0x038e, 0x03a1, 0x03a3, 0x03ce, 0x03d0, 0x03d6, 0x03da, + 0x03da, 0x03dc, 0x03dc, 0x03de, 0x03de, 0x03e0, 0x03e0, 0x03e2, + 0x03f3, 0x0401, 0x040c, 0x040e, 0x044f, 0x0451, 0x045c, 0x045e, + 0x0486, 0x0490, 0x04c4, 0x04c7, 0x04c8, 0x04cb, 0x04cc, 0x04d0, + 0x04eb, 0x04ee, 0x04f5, 0x04f8, 0x04f9, 0x0531, 0x0556, 0x0559, + 0x055f, 0x0561, 0x0587, 0x0589, 0x0589, 0x0591, 0x05a1, 0x05a3, + 0x05b9, 0x05bb, 0x05c4, 0x05d0, 0x05ea, 0x05f0, 0x05f4, 0x060c, + 0x060c, 0x061b, 0x061b, 0x061f, 0x061f, 0x0621, 0x063a, 0x0640, + 0x0652, 0x0660, 0x066d, 0x0670, 0x06b7, 0x06ba, 0x06be, 0x06c0, + 0x06ce, 0x06d0, 0x06ed, 0x06f0, 0x06f9, 0x0901, 0x0903, 0x0905, + 0x0939, 0x093c, 0x094d, 0x0950, 0x0954, 0x0958, 0x0970, 0x0981, + 0x0983, 0x0985, 0x098c, 0x098f, 0x0990, 0x0993, 0x09a8, 0x09aa, + 0x09b0, 0x09b2, 0x09b2, 0x09b6, 0x09b9, 0x09bc, 0x09bc, 0x09be, + 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09cd, 0x09d7, 0x09d7, 0x09dc, + 0x09dd, 0x09df, 0x09e3, 0x09e6, 0x09fa, 0x0a02, 0x0a02, 0x0a05, + 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, 0x0a30, 0x0a32, + 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3c, 0x0a3c, 0x0a3e, + 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4d, 0x0a59, 0x0a5c, 0x0a5e, + 0x0a5e, 0x0a66, 0x0a74, 0x0a81, 0x0a83, 0x0a85, 0x0a8b, 0x0a8d, + 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, 0x0ab0, 0x0ab2, + 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, 0x0ac5, 0x0ac7, 0x0ac9, 0x0acb, + 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, 0x0ae0, 0x0ae6, 0x0aef, 0x0b01, + 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, 0x0b28, 0x0b2a, + 0x0b30, 0x0b32, 0x0b33, 0x0b36, 0x0b39, 0x0b3c, 0x0b43, 0x0b47, + 0x0b48, 0x0b4b, 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, 0x0b5d, 0x0b5f, + 0x0b61, 0x0b66, 0x0b70, 0x0b82, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, + 0x0b90, 0x0b92, 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, + 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, 0x0bb5, 0x0bb7, + 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, 0x0bcd, 0x0bd7, + 0x0bd7, 0x0be7, 0x0bf2, 0x0c01, 0x0c03, 0x0c05, 0x0c0c, 0x0c0e, + 0x0c10, 0x0c12, 0x0c28, 0x0c2a, 0x0c33, 0x0c35, 0x0c39, 0x0c3e, + 0x0c44, 0x0c46, 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, 0x0c56, 0x0c60, + 0x0c61, 0x0c66, 0x0c6f, 0x0c82, 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, + 0x0c90, 0x0c92, 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbe, + 0x0cc4, 0x0cc6, 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, 0x0cd6, 0x0cde, + 0x0cde, 0x0ce0, 0x0ce1, 0x0ce6, 0x0cef, 0x0d02, 0x0d03, 0x0d05, + 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d28, 0x0d2a, 0x0d39, 0x0d3e, + 0x0d43, 0x0d46, 0x0d48, 0x0d4a, 0x0d4d, 0x0d57, 0x0d57, 0x0d60, + 0x0d61, 0x0d66, 0x0d6f, 0x0e01, 0x0e3a, 0x0e3f, 0x0e5b, 0x0e81, + 0x0e82, 0x0e84, 0x0e84, 0x0e87, 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, + 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, + 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, + 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, + 0x0ed9, 0x0edc, 0x0edd, 0x0f00, 0x0f47, 0x0f49, 0x0f69, 0x0f71, + 0x0f8b, 0x0f90, 0x0f95, 0x0f97, 0x0f97, 0x0f99, 0x0fad, 0x0fb1, + 0x0fb7, 0x0fb9, 0x0fb9, 0x10a0, 0x10c5, 0x10d0, 0x10f6, 0x10fb, + 0x10fb, 0x1100, 0x1159, 0x115f, 0x11a2, 0x11a8, 0x11f9, 0x1e00, + 0x1e9b, 0x1ea0, 0x1ef9, 0x1f00, 0x1f15, 0x1f18, 0x1f1d, 0x1f20, + 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, 0x1f59, 0x1f5b, + 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, + 0x1fc4, 0x1fc6, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fdd, 0x1fef, 0x1ff2, + 0x1ff4, 0x1ff6, 0x1ffe, 0x2000, 0x202e, 0x2030, 0x2046, 0x206a, + 0x2070, 0x2074, 0x208e, 0x20a0, 0x20ac, 0x20d0, 0x20e1, 0x2100, + 0x2138, 0x2153, 0x2182, 0x2190, 0x21ea, 0x2200, 0x22f1, 0x2300, + 0x2300, 0x2302, 0x237a, 0x2400, 0x2424, 0x2440, 0x244a, 0x2460, + 0x24ea, 0x2500, 0x2595, 0x25a0, 0x25ef, 0x2600, 0x2613, 0x261a, + 0x266f, 0x2701, 0x2704, 0x2706, 0x2709, 0x270c, 0x2727, 0x2729, + 0x274b, 0x274d, 0x274d, 0x274f, 0x2752, 0x2756, 0x2756, 0x2758, + 0x275e, 0x2761, 0x2767, 0x2776, 0x2794, 0x2798, 0x27af, 0x27b1, + 0x27be, 0x3000, 0x3037, 0x303f, 0x303f, 0x3041, 0x3094, 0x3099, + 0x309e, 0x30a1, 0x30fe, 0x3105, 0x312c, 0x3131, 0x318e, 0x3190, + 0x319f, 0x3200, 0x321c, 0x3220, 0x3243, 0x3260, 0x327b, 0x327f, + 0x32b0, 0x32c0, 0x32cb, 0x32d0, 0x32fe, 0x3300, 0x3376, 0x337b, + 0x33dd, 0x33e0, 0x33fe, 0x4e00, 0x9fa5, 0xac00, 0xd7a3, 0xd800, + 0xfa2d, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xfb1e, 0xfb36, 0xfb38, + 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, + 0xfbb1, 0xfbd3, 0xfd3f, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdf0, + 0xfdfb, 0xfe20, 0xfe23, 0xfe30, 0xfe44, 0xfe49, 0xfe52, 0xfe54, + 0xfe66, 0xfe68, 0xfe6b, 0xfe70, 0xfe72, 0xfe74, 0xfe74, 0xfe76, + 0xfefc, 0xfeff, 0xfeff, 0xff01, 0xff5e, 0xff61, 0xffbe, 0xffc2, + 0xffc7, 0xffca, 0xffcf, 0xffd2, 0xffd7, 0xffda, 0xffdc, 0xffe0, + 0xffe6, 0xffe8, 0xffee, 0xfffc, 0xffff, 0x1fffe, 0x1ffff, 0x2fffe, + 0x2ffff, 0x3fffe, 0x3ffff, 0x4fffe, 0x4ffff, 0x5fffe, 0x5ffff, 0x6fffe, + 0x6ffff, 0x7fffe, 0x7ffff, 0x8fffe, 0x8ffff, 0x9fffe, 0x9ffff, 0xafffe, + 0xaffff, 0xbfffe, 0xbffff, 0xcfffe, 0xcffff, 0xdfffe, 0xdffff, 0xefffe, + 0x10ffff, +}; /* CR_Age_2_1 */ + +/* 'Age_3_0': Derived Age 3.0 */ +static const OnigCodePoint CR_Age_3_0[] = { + 369, 0x0000, 0x021f, 0x0222, 0x0233, 0x0250, 0x02ad, 0x02b0, + 0x02ee, 0x0300, 0x034e, 0x0360, 0x0362, 0x0374, 0x0375, 0x037a, + 0x037a, 0x037e, 0x037e, 0x0384, 0x038a, 0x038c, 0x038c, 0x038e, + 0x03a1, 0x03a3, 0x03ce, 0x03d0, 0x03d7, 0x03da, 0x03f3, 0x0400, + 0x0486, 0x0488, 0x0489, 0x048c, 0x04c4, 0x04c7, 0x04c8, 0x04cb, + 0x04cc, 0x04d0, 0x04f5, 0x04f8, 0x04f9, 0x0531, 0x0556, 0x0559, + 0x055f, 0x0561, 0x0587, 0x0589, 0x058a, 0x0591, 0x05a1, 0x05a3, + 0x05b9, 0x05bb, 0x05c4, 0x05d0, 0x05ea, 0x05f0, 0x05f4, 0x060c, + 0x060c, 0x061b, 0x061b, 0x061f, 0x061f, 0x0621, 0x063a, 0x0640, + 0x0655, 0x0660, 0x066d, 0x0670, 0x06ed, 0x06f0, 0x06fe, 0x0700, + 0x070d, 0x070f, 0x072c, 0x0730, 0x074a, 0x0780, 0x07b0, 0x0901, + 0x0903, 0x0905, 0x0939, 0x093c, 0x094d, 0x0950, 0x0954, 0x0958, + 0x0970, 0x0981, 0x0983, 0x0985, 0x098c, 0x098f, 0x0990, 0x0993, + 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, 0x09b9, 0x09bc, + 0x09bc, 0x09be, 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09cd, 0x09d7, + 0x09d7, 0x09dc, 0x09dd, 0x09df, 0x09e3, 0x09e6, 0x09fa, 0x0a02, + 0x0a02, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, + 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3c, + 0x0a3c, 0x0a3e, 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4d, 0x0a59, + 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, 0x0a74, 0x0a81, 0x0a83, 0x0a85, + 0x0a8b, 0x0a8d, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, + 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, 0x0ac5, 0x0ac7, + 0x0ac9, 0x0acb, 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, 0x0ae0, 0x0ae6, + 0x0aef, 0x0b01, 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, + 0x0b28, 0x0b2a, 0x0b30, 0x0b32, 0x0b33, 0x0b36, 0x0b39, 0x0b3c, + 0x0b43, 0x0b47, 0x0b48, 0x0b4b, 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, + 0x0b5d, 0x0b5f, 0x0b61, 0x0b66, 0x0b70, 0x0b82, 0x0b83, 0x0b85, + 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, + 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, + 0x0bb5, 0x0bb7, 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, + 0x0bcd, 0x0bd7, 0x0bd7, 0x0be7, 0x0bf2, 0x0c01, 0x0c03, 0x0c05, + 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, 0x0c28, 0x0c2a, 0x0c33, 0x0c35, + 0x0c39, 0x0c3e, 0x0c44, 0x0c46, 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, + 0x0c56, 0x0c60, 0x0c61, 0x0c66, 0x0c6f, 0x0c82, 0x0c83, 0x0c85, + 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, + 0x0cb9, 0x0cbe, 0x0cc4, 0x0cc6, 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, + 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, 0x0ce1, 0x0ce6, 0x0cef, 0x0d02, + 0x0d03, 0x0d05, 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d28, 0x0d2a, + 0x0d39, 0x0d3e, 0x0d43, 0x0d46, 0x0d48, 0x0d4a, 0x0d4d, 0x0d57, + 0x0d57, 0x0d60, 0x0d61, 0x0d66, 0x0d6f, 0x0d82, 0x0d83, 0x0d85, + 0x0d96, 0x0d9a, 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, + 0x0dc6, 0x0dca, 0x0dca, 0x0dcf, 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, + 0x0ddf, 0x0df2, 0x0df4, 0x0e01, 0x0e3a, 0x0e3f, 0x0e5b, 0x0e81, + 0x0e82, 0x0e84, 0x0e84, 0x0e87, 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, + 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, + 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, + 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, + 0x0ed9, 0x0edc, 0x0edd, 0x0f00, 0x0f47, 0x0f49, 0x0f6a, 0x0f71, + 0x0f8b, 0x0f90, 0x0f97, 0x0f99, 0x0fbc, 0x0fbe, 0x0fcc, 0x0fcf, + 0x0fcf, 0x1000, 0x1021, 0x1023, 0x1027, 0x1029, 0x102a, 0x102c, + 0x1032, 0x1036, 0x1039, 0x1040, 0x1059, 0x10a0, 0x10c5, 0x10d0, + 0x10f6, 0x10fb, 0x10fb, 0x1100, 0x1159, 0x115f, 0x11a2, 0x11a8, + 0x11f9, 0x1200, 0x1206, 0x1208, 0x1246, 0x1248, 0x1248, 0x124a, + 0x124d, 0x1250, 0x1256, 0x1258, 0x1258, 0x125a, 0x125d, 0x1260, + 0x1286, 0x1288, 0x1288, 0x128a, 0x128d, 0x1290, 0x12ae, 0x12b0, + 0x12b0, 0x12b2, 0x12b5, 0x12b8, 0x12be, 0x12c0, 0x12c0, 0x12c2, + 0x12c5, 0x12c8, 0x12ce, 0x12d0, 0x12d6, 0x12d8, 0x12ee, 0x12f0, + 0x130e, 0x1310, 0x1310, 0x1312, 0x1315, 0x1318, 0x131e, 0x1320, + 0x1346, 0x1348, 0x135a, 0x1361, 0x137c, 0x13a0, 0x13f4, 0x1401, + 0x1676, 0x1680, 0x169c, 0x16a0, 0x16f0, 0x1780, 0x17dc, 0x17e0, + 0x17e9, 0x1800, 0x180e, 0x1810, 0x1819, 0x1820, 0x1877, 0x1880, + 0x18a9, 0x1e00, 0x1e9b, 0x1ea0, 0x1ef9, 0x1f00, 0x1f15, 0x1f18, + 0x1f1d, 0x1f20, 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, + 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, + 0x1fb4, 0x1fb6, 0x1fc4, 0x1fc6, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fdd, + 0x1fef, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ffe, 0x2000, 0x2046, 0x2048, + 0x204d, 0x206a, 0x2070, 0x2074, 0x208e, 0x20a0, 0x20af, 0x20d0, + 0x20e3, 0x2100, 0x213a, 0x2153, 0x2183, 0x2190, 0x21f3, 0x2200, + 0x22f1, 0x2300, 0x237b, 0x237d, 0x239a, 0x2400, 0x2426, 0x2440, + 0x244a, 0x2460, 0x24ea, 0x2500, 0x2595, 0x25a0, 0x25f7, 0x2600, + 0x2613, 0x2619, 0x2671, 0x2701, 0x2704, 0x2706, 0x2709, 0x270c, + 0x2727, 0x2729, 0x274b, 0x274d, 0x274d, 0x274f, 0x2752, 0x2756, + 0x2756, 0x2758, 0x275e, 0x2761, 0x2767, 0x2776, 0x2794, 0x2798, + 0x27af, 0x27b1, 0x27be, 0x2800, 0x28ff, 0x2e80, 0x2e99, 0x2e9b, + 0x2ef3, 0x2f00, 0x2fd5, 0x2ff0, 0x2ffb, 0x3000, 0x303a, 0x303e, + 0x303f, 0x3041, 0x3094, 0x3099, 0x309e, 0x30a1, 0x30fe, 0x3105, + 0x312c, 0x3131, 0x318e, 0x3190, 0x31b7, 0x3200, 0x321c, 0x3220, + 0x3243, 0x3260, 0x327b, 0x327f, 0x32b0, 0x32c0, 0x32cb, 0x32d0, + 0x32fe, 0x3300, 0x3376, 0x337b, 0x33dd, 0x33e0, 0x33fe, 0x3400, + 0x4db5, 0x4e00, 0x9fa5, 0xa000, 0xa48c, 0xa490, 0xa4a1, 0xa4a4, + 0xa4b3, 0xa4b5, 0xa4c0, 0xa4c2, 0xa4c4, 0xa4c6, 0xa4c6, 0xac00, + 0xd7a3, 0xd800, 0xfa2d, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xfb1d, + 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, + 0xfb44, 0xfb46, 0xfbb1, 0xfbd3, 0xfd3f, 0xfd50, 0xfd8f, 0xfd92, + 0xfdc7, 0xfdf0, 0xfdfb, 0xfe20, 0xfe23, 0xfe30, 0xfe44, 0xfe49, + 0xfe52, 0xfe54, 0xfe66, 0xfe68, 0xfe6b, 0xfe70, 0xfe72, 0xfe74, + 0xfe74, 0xfe76, 0xfefc, 0xfeff, 0xfeff, 0xff01, 0xff5e, 0xff61, + 0xffbe, 0xffc2, 0xffc7, 0xffca, 0xffcf, 0xffd2, 0xffd7, 0xffda, + 0xffdc, 0xffe0, 0xffe6, 0xffe8, 0xffee, 0xfff9, 0xffff, 0x1fffe, + 0x1ffff, 0x2fffe, 0x2ffff, 0x3fffe, 0x3ffff, 0x4fffe, 0x4ffff, 0x5fffe, + 0x5ffff, 0x6fffe, 0x6ffff, 0x7fffe, 0x7ffff, 0x8fffe, 0x8ffff, 0x9fffe, + 0x9ffff, 0xafffe, 0xaffff, 0xbfffe, 0xbffff, 0xcfffe, 0xcffff, 0xdfffe, + 0xdffff, 0xefffe, 0x10ffff, +}; /* CR_Age_3_0 */ + +/* 'Age_3_1': Derived Age 3.1 */ +static const OnigCodePoint CR_Age_3_1[] = { + 402, 0x0000, 0x021f, 0x0222, 0x0233, 0x0250, 0x02ad, 0x02b0, + 0x02ee, 0x0300, 0x034e, 0x0360, 0x0362, 0x0374, 0x0375, 0x037a, + 0x037a, 0x037e, 0x037e, 0x0384, 0x038a, 0x038c, 0x038c, 0x038e, + 0x03a1, 0x03a3, 0x03ce, 0x03d0, 0x03d7, 0x03da, 0x03f5, 0x0400, + 0x0486, 0x0488, 0x0489, 0x048c, 0x04c4, 0x04c7, 0x04c8, 0x04cb, + 0x04cc, 0x04d0, 0x04f5, 0x04f8, 0x04f9, 0x0531, 0x0556, 0x0559, + 0x055f, 0x0561, 0x0587, 0x0589, 0x058a, 0x0591, 0x05a1, 0x05a3, + 0x05b9, 0x05bb, 0x05c4, 0x05d0, 0x05ea, 0x05f0, 0x05f4, 0x060c, + 0x060c, 0x061b, 0x061b, 0x061f, 0x061f, 0x0621, 0x063a, 0x0640, + 0x0655, 0x0660, 0x066d, 0x0670, 0x06ed, 0x06f0, 0x06fe, 0x0700, + 0x070d, 0x070f, 0x072c, 0x0730, 0x074a, 0x0780, 0x07b0, 0x0901, + 0x0903, 0x0905, 0x0939, 0x093c, 0x094d, 0x0950, 0x0954, 0x0958, + 0x0970, 0x0981, 0x0983, 0x0985, 0x098c, 0x098f, 0x0990, 0x0993, + 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, 0x09b9, 0x09bc, + 0x09bc, 0x09be, 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09cd, 0x09d7, + 0x09d7, 0x09dc, 0x09dd, 0x09df, 0x09e3, 0x09e6, 0x09fa, 0x0a02, + 0x0a02, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, + 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3c, + 0x0a3c, 0x0a3e, 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4d, 0x0a59, + 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, 0x0a74, 0x0a81, 0x0a83, 0x0a85, + 0x0a8b, 0x0a8d, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, + 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, 0x0ac5, 0x0ac7, + 0x0ac9, 0x0acb, 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, 0x0ae0, 0x0ae6, + 0x0aef, 0x0b01, 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, + 0x0b28, 0x0b2a, 0x0b30, 0x0b32, 0x0b33, 0x0b36, 0x0b39, 0x0b3c, + 0x0b43, 0x0b47, 0x0b48, 0x0b4b, 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, + 0x0b5d, 0x0b5f, 0x0b61, 0x0b66, 0x0b70, 0x0b82, 0x0b83, 0x0b85, + 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, + 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, + 0x0bb5, 0x0bb7, 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, + 0x0bcd, 0x0bd7, 0x0bd7, 0x0be7, 0x0bf2, 0x0c01, 0x0c03, 0x0c05, + 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, 0x0c28, 0x0c2a, 0x0c33, 0x0c35, + 0x0c39, 0x0c3e, 0x0c44, 0x0c46, 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, + 0x0c56, 0x0c60, 0x0c61, 0x0c66, 0x0c6f, 0x0c82, 0x0c83, 0x0c85, + 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, + 0x0cb9, 0x0cbe, 0x0cc4, 0x0cc6, 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, + 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, 0x0ce1, 0x0ce6, 0x0cef, 0x0d02, + 0x0d03, 0x0d05, 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d28, 0x0d2a, + 0x0d39, 0x0d3e, 0x0d43, 0x0d46, 0x0d48, 0x0d4a, 0x0d4d, 0x0d57, + 0x0d57, 0x0d60, 0x0d61, 0x0d66, 0x0d6f, 0x0d82, 0x0d83, 0x0d85, + 0x0d96, 0x0d9a, 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, + 0x0dc6, 0x0dca, 0x0dca, 0x0dcf, 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, + 0x0ddf, 0x0df2, 0x0df4, 0x0e01, 0x0e3a, 0x0e3f, 0x0e5b, 0x0e81, + 0x0e82, 0x0e84, 0x0e84, 0x0e87, 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, + 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, + 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, + 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, + 0x0ed9, 0x0edc, 0x0edd, 0x0f00, 0x0f47, 0x0f49, 0x0f6a, 0x0f71, + 0x0f8b, 0x0f90, 0x0f97, 0x0f99, 0x0fbc, 0x0fbe, 0x0fcc, 0x0fcf, + 0x0fcf, 0x1000, 0x1021, 0x1023, 0x1027, 0x1029, 0x102a, 0x102c, + 0x1032, 0x1036, 0x1039, 0x1040, 0x1059, 0x10a0, 0x10c5, 0x10d0, + 0x10f6, 0x10fb, 0x10fb, 0x1100, 0x1159, 0x115f, 0x11a2, 0x11a8, + 0x11f9, 0x1200, 0x1206, 0x1208, 0x1246, 0x1248, 0x1248, 0x124a, + 0x124d, 0x1250, 0x1256, 0x1258, 0x1258, 0x125a, 0x125d, 0x1260, + 0x1286, 0x1288, 0x1288, 0x128a, 0x128d, 0x1290, 0x12ae, 0x12b0, + 0x12b0, 0x12b2, 0x12b5, 0x12b8, 0x12be, 0x12c0, 0x12c0, 0x12c2, + 0x12c5, 0x12c8, 0x12ce, 0x12d0, 0x12d6, 0x12d8, 0x12ee, 0x12f0, + 0x130e, 0x1310, 0x1310, 0x1312, 0x1315, 0x1318, 0x131e, 0x1320, + 0x1346, 0x1348, 0x135a, 0x1361, 0x137c, 0x13a0, 0x13f4, 0x1401, + 0x1676, 0x1680, 0x169c, 0x16a0, 0x16f0, 0x1780, 0x17dc, 0x17e0, + 0x17e9, 0x1800, 0x180e, 0x1810, 0x1819, 0x1820, 0x1877, 0x1880, + 0x18a9, 0x1e00, 0x1e9b, 0x1ea0, 0x1ef9, 0x1f00, 0x1f15, 0x1f18, + 0x1f1d, 0x1f20, 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, + 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, + 0x1fb4, 0x1fb6, 0x1fc4, 0x1fc6, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fdd, + 0x1fef, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ffe, 0x2000, 0x2046, 0x2048, + 0x204d, 0x206a, 0x2070, 0x2074, 0x208e, 0x20a0, 0x20af, 0x20d0, + 0x20e3, 0x2100, 0x213a, 0x2153, 0x2183, 0x2190, 0x21f3, 0x2200, + 0x22f1, 0x2300, 0x237b, 0x237d, 0x239a, 0x2400, 0x2426, 0x2440, + 0x244a, 0x2460, 0x24ea, 0x2500, 0x2595, 0x25a0, 0x25f7, 0x2600, + 0x2613, 0x2619, 0x2671, 0x2701, 0x2704, 0x2706, 0x2709, 0x270c, + 0x2727, 0x2729, 0x274b, 0x274d, 0x274d, 0x274f, 0x2752, 0x2756, + 0x2756, 0x2758, 0x275e, 0x2761, 0x2767, 0x2776, 0x2794, 0x2798, + 0x27af, 0x27b1, 0x27be, 0x2800, 0x28ff, 0x2e80, 0x2e99, 0x2e9b, + 0x2ef3, 0x2f00, 0x2fd5, 0x2ff0, 0x2ffb, 0x3000, 0x303a, 0x303e, + 0x303f, 0x3041, 0x3094, 0x3099, 0x309e, 0x30a1, 0x30fe, 0x3105, + 0x312c, 0x3131, 0x318e, 0x3190, 0x31b7, 0x3200, 0x321c, 0x3220, + 0x3243, 0x3260, 0x327b, 0x327f, 0x32b0, 0x32c0, 0x32cb, 0x32d0, + 0x32fe, 0x3300, 0x3376, 0x337b, 0x33dd, 0x33e0, 0x33fe, 0x3400, + 0x4db5, 0x4e00, 0x9fa5, 0xa000, 0xa48c, 0xa490, 0xa4a1, 0xa4a4, + 0xa4b3, 0xa4b5, 0xa4c0, 0xa4c2, 0xa4c4, 0xa4c6, 0xa4c6, 0xac00, + 0xd7a3, 0xd800, 0xfa2d, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xfb1d, + 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, + 0xfb44, 0xfb46, 0xfbb1, 0xfbd3, 0xfd3f, 0xfd50, 0xfd8f, 0xfd92, + 0xfdc7, 0xfdd0, 0xfdfb, 0xfe20, 0xfe23, 0xfe30, 0xfe44, 0xfe49, + 0xfe52, 0xfe54, 0xfe66, 0xfe68, 0xfe6b, 0xfe70, 0xfe72, 0xfe74, + 0xfe74, 0xfe76, 0xfefc, 0xfeff, 0xfeff, 0xff01, 0xff5e, 0xff61, + 0xffbe, 0xffc2, 0xffc7, 0xffca, 0xffcf, 0xffd2, 0xffd7, 0xffda, + 0xffdc, 0xffe0, 0xffe6, 0xffe8, 0xffee, 0xfff9, 0xffff, 0x10300, + 0x1031e, 0x10320, 0x10323, 0x10330, 0x1034a, 0x10400, 0x10425, 0x10428, + 0x1044d, 0x1d000, 0x1d0f5, 0x1d100, 0x1d126, 0x1d12a, 0x1d1dd, 0x1d400, + 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, + 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, + 0x1d4c0, 0x1d4c2, 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, + 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, + 0x1d544, 0x1d546, 0x1d546, 0x1d54a, 0x1d550, 0x1d552, 0x1d6a3, 0x1d6a8, + 0x1d7c9, 0x1d7ce, 0x1d7ff, 0x1fffe, 0x2a6d6, 0x2f800, 0x2fa1d, 0x2fffe, + 0x2ffff, 0x3fffe, 0x3ffff, 0x4fffe, 0x4ffff, 0x5fffe, 0x5ffff, 0x6fffe, + 0x6ffff, 0x7fffe, 0x7ffff, 0x8fffe, 0x8ffff, 0x9fffe, 0x9ffff, 0xafffe, + 0xaffff, 0xbfffe, 0xbffff, 0xcfffe, 0xcffff, 0xdfffe, 0xdffff, 0xe0001, + 0xe0001, 0xe0020, 0xe007f, 0xefffe, 0x10ffff, +}; /* CR_Age_3_1 */ + +/* 'Age_3_2': Derived Age 3.2 */ +static const OnigCodePoint CR_Age_3_2[] = { + 397, 0x0000, 0x0220, 0x0222, 0x0233, 0x0250, 0x02ad, 0x02b0, + 0x02ee, 0x0300, 0x034f, 0x0360, 0x036f, 0x0374, 0x0375, 0x037a, + 0x037a, 0x037e, 0x037e, 0x0384, 0x038a, 0x038c, 0x038c, 0x038e, + 0x03a1, 0x03a3, 0x03ce, 0x03d0, 0x03f6, 0x0400, 0x0486, 0x0488, + 0x04ce, 0x04d0, 0x04f5, 0x04f8, 0x04f9, 0x0500, 0x050f, 0x0531, + 0x0556, 0x0559, 0x055f, 0x0561, 0x0587, 0x0589, 0x058a, 0x0591, + 0x05a1, 0x05a3, 0x05b9, 0x05bb, 0x05c4, 0x05d0, 0x05ea, 0x05f0, + 0x05f4, 0x060c, 0x060c, 0x061b, 0x061b, 0x061f, 0x061f, 0x0621, + 0x063a, 0x0640, 0x0655, 0x0660, 0x06ed, 0x06f0, 0x06fe, 0x0700, + 0x070d, 0x070f, 0x072c, 0x0730, 0x074a, 0x0780, 0x07b1, 0x0901, + 0x0903, 0x0905, 0x0939, 0x093c, 0x094d, 0x0950, 0x0954, 0x0958, + 0x0970, 0x0981, 0x0983, 0x0985, 0x098c, 0x098f, 0x0990, 0x0993, + 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, 0x09b9, 0x09bc, + 0x09bc, 0x09be, 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09cd, 0x09d7, + 0x09d7, 0x09dc, 0x09dd, 0x09df, 0x09e3, 0x09e6, 0x09fa, 0x0a02, + 0x0a02, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, + 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3c, + 0x0a3c, 0x0a3e, 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4d, 0x0a59, + 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, 0x0a74, 0x0a81, 0x0a83, 0x0a85, + 0x0a8b, 0x0a8d, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, + 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, 0x0ac5, 0x0ac7, + 0x0ac9, 0x0acb, 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, 0x0ae0, 0x0ae6, + 0x0aef, 0x0b01, 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, + 0x0b28, 0x0b2a, 0x0b30, 0x0b32, 0x0b33, 0x0b36, 0x0b39, 0x0b3c, + 0x0b43, 0x0b47, 0x0b48, 0x0b4b, 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, + 0x0b5d, 0x0b5f, 0x0b61, 0x0b66, 0x0b70, 0x0b82, 0x0b83, 0x0b85, + 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, + 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, + 0x0bb5, 0x0bb7, 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, + 0x0bcd, 0x0bd7, 0x0bd7, 0x0be7, 0x0bf2, 0x0c01, 0x0c03, 0x0c05, + 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, 0x0c28, 0x0c2a, 0x0c33, 0x0c35, + 0x0c39, 0x0c3e, 0x0c44, 0x0c46, 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, + 0x0c56, 0x0c60, 0x0c61, 0x0c66, 0x0c6f, 0x0c82, 0x0c83, 0x0c85, + 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, + 0x0cb9, 0x0cbe, 0x0cc4, 0x0cc6, 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, + 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, 0x0ce1, 0x0ce6, 0x0cef, 0x0d02, + 0x0d03, 0x0d05, 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d28, 0x0d2a, + 0x0d39, 0x0d3e, 0x0d43, 0x0d46, 0x0d48, 0x0d4a, 0x0d4d, 0x0d57, + 0x0d57, 0x0d60, 0x0d61, 0x0d66, 0x0d6f, 0x0d82, 0x0d83, 0x0d85, + 0x0d96, 0x0d9a, 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, + 0x0dc6, 0x0dca, 0x0dca, 0x0dcf, 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, + 0x0ddf, 0x0df2, 0x0df4, 0x0e01, 0x0e3a, 0x0e3f, 0x0e5b, 0x0e81, + 0x0e82, 0x0e84, 0x0e84, 0x0e87, 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, + 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, + 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, + 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, + 0x0ed9, 0x0edc, 0x0edd, 0x0f00, 0x0f47, 0x0f49, 0x0f6a, 0x0f71, + 0x0f8b, 0x0f90, 0x0f97, 0x0f99, 0x0fbc, 0x0fbe, 0x0fcc, 0x0fcf, + 0x0fcf, 0x1000, 0x1021, 0x1023, 0x1027, 0x1029, 0x102a, 0x102c, + 0x1032, 0x1036, 0x1039, 0x1040, 0x1059, 0x10a0, 0x10c5, 0x10d0, + 0x10f8, 0x10fb, 0x10fb, 0x1100, 0x1159, 0x115f, 0x11a2, 0x11a8, + 0x11f9, 0x1200, 0x1206, 0x1208, 0x1246, 0x1248, 0x1248, 0x124a, + 0x124d, 0x1250, 0x1256, 0x1258, 0x1258, 0x125a, 0x125d, 0x1260, + 0x1286, 0x1288, 0x1288, 0x128a, 0x128d, 0x1290, 0x12ae, 0x12b0, + 0x12b0, 0x12b2, 0x12b5, 0x12b8, 0x12be, 0x12c0, 0x12c0, 0x12c2, + 0x12c5, 0x12c8, 0x12ce, 0x12d0, 0x12d6, 0x12d8, 0x12ee, 0x12f0, + 0x130e, 0x1310, 0x1310, 0x1312, 0x1315, 0x1318, 0x131e, 0x1320, + 0x1346, 0x1348, 0x135a, 0x1361, 0x137c, 0x13a0, 0x13f4, 0x1401, + 0x1676, 0x1680, 0x169c, 0x16a0, 0x16f0, 0x1700, 0x170c, 0x170e, + 0x1714, 0x1720, 0x1736, 0x1740, 0x1753, 0x1760, 0x176c, 0x176e, + 0x1770, 0x1772, 0x1773, 0x1780, 0x17dc, 0x17e0, 0x17e9, 0x1800, + 0x180e, 0x1810, 0x1819, 0x1820, 0x1877, 0x1880, 0x18a9, 0x1e00, + 0x1e9b, 0x1ea0, 0x1ef9, 0x1f00, 0x1f15, 0x1f18, 0x1f1d, 0x1f20, + 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, 0x1f59, 0x1f5b, + 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, + 0x1fc4, 0x1fc6, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fdd, 0x1fef, 0x1ff2, + 0x1ff4, 0x1ff6, 0x1ffe, 0x2000, 0x2052, 0x2057, 0x2057, 0x205f, + 0x2063, 0x206a, 0x2071, 0x2074, 0x208e, 0x20a0, 0x20b1, 0x20d0, + 0x20ea, 0x2100, 0x213a, 0x213d, 0x214b, 0x2153, 0x2183, 0x2190, + 0x23ce, 0x2400, 0x2426, 0x2440, 0x244a, 0x2460, 0x24fe, 0x2500, + 0x2613, 0x2616, 0x2617, 0x2619, 0x267d, 0x2680, 0x2689, 0x2701, + 0x2704, 0x2706, 0x2709, 0x270c, 0x2727, 0x2729, 0x274b, 0x274d, + 0x274d, 0x274f, 0x2752, 0x2756, 0x2756, 0x2758, 0x275e, 0x2761, + 0x2794, 0x2798, 0x27af, 0x27b1, 0x27be, 0x27d0, 0x27eb, 0x27f0, + 0x2aff, 0x2e80, 0x2e99, 0x2e9b, 0x2ef3, 0x2f00, 0x2fd5, 0x2ff0, + 0x2ffb, 0x3000, 0x303f, 0x3041, 0x3096, 0x3099, 0x30ff, 0x3105, + 0x312c, 0x3131, 0x318e, 0x3190, 0x31b7, 0x31f0, 0x321c, 0x3220, + 0x3243, 0x3251, 0x327b, 0x327f, 0x32cb, 0x32d0, 0x32fe, 0x3300, + 0x3376, 0x337b, 0x33dd, 0x33e0, 0x33fe, 0x3400, 0x4db5, 0x4e00, + 0x9fa5, 0xa000, 0xa48c, 0xa490, 0xa4c6, 0xac00, 0xd7a3, 0xd800, + 0xfa2d, 0xfa30, 0xfa6a, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xfb1d, + 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, + 0xfb44, 0xfb46, 0xfbb1, 0xfbd3, 0xfd3f, 0xfd50, 0xfd8f, 0xfd92, + 0xfdc7, 0xfdd0, 0xfdfc, 0xfe00, 0xfe0f, 0xfe20, 0xfe23, 0xfe30, + 0xfe46, 0xfe49, 0xfe52, 0xfe54, 0xfe66, 0xfe68, 0xfe6b, 0xfe70, + 0xfe74, 0xfe76, 0xfefc, 0xfeff, 0xfeff, 0xff01, 0xffbe, 0xffc2, + 0xffc7, 0xffca, 0xffcf, 0xffd2, 0xffd7, 0xffda, 0xffdc, 0xffe0, + 0xffe6, 0xffe8, 0xffee, 0xfff9, 0xffff, 0x10300, 0x1031e, 0x10320, + 0x10323, 0x10330, 0x1034a, 0x10400, 0x10425, 0x10428, 0x1044d, 0x1d000, + 0x1d0f5, 0x1d100, 0x1d126, 0x1d12a, 0x1d1dd, 0x1d400, 0x1d454, 0x1d456, + 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, + 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c0, 0x1d4c2, + 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, + 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, 0x1d544, 0x1d546, + 0x1d546, 0x1d54a, 0x1d550, 0x1d552, 0x1d6a3, 0x1d6a8, 0x1d7c9, 0x1d7ce, + 0x1d7ff, 0x1fffe, 0x2a6d6, 0x2f800, 0x2fa1d, 0x2fffe, 0x2ffff, 0x3fffe, + 0x3ffff, 0x4fffe, 0x4ffff, 0x5fffe, 0x5ffff, 0x6fffe, 0x6ffff, 0x7fffe, + 0x7ffff, 0x8fffe, 0x8ffff, 0x9fffe, 0x9ffff, 0xafffe, 0xaffff, 0xbfffe, + 0xbffff, 0xcfffe, 0xcffff, 0xdfffe, 0xdffff, 0xe0001, 0xe0001, 0xe0020, + 0xe007f, 0xefffe, 0x10ffff, +}; /* CR_Age_3_2 */ + +/* 'Age_4_0': Derived Age 4.0 */ +static const OnigCodePoint CR_Age_4_0[] = { + 412, 0x0000, 0x0236, 0x0250, 0x0357, 0x035d, 0x036f, 0x0374, + 0x0375, 0x037a, 0x037a, 0x037e, 0x037e, 0x0384, 0x038a, 0x038c, + 0x038c, 0x038e, 0x03a1, 0x03a3, 0x03ce, 0x03d0, 0x03fb, 0x0400, + 0x0486, 0x0488, 0x04ce, 0x04d0, 0x04f5, 0x04f8, 0x04f9, 0x0500, + 0x050f, 0x0531, 0x0556, 0x0559, 0x055f, 0x0561, 0x0587, 0x0589, + 0x058a, 0x0591, 0x05a1, 0x05a3, 0x05b9, 0x05bb, 0x05c4, 0x05d0, + 0x05ea, 0x05f0, 0x05f4, 0x0600, 0x0603, 0x060c, 0x0615, 0x061b, + 0x061b, 0x061f, 0x061f, 0x0621, 0x063a, 0x0640, 0x0658, 0x0660, + 0x070d, 0x070f, 0x074a, 0x074d, 0x074f, 0x0780, 0x07b1, 0x0901, + 0x0939, 0x093c, 0x094d, 0x0950, 0x0954, 0x0958, 0x0970, 0x0981, + 0x0983, 0x0985, 0x098c, 0x098f, 0x0990, 0x0993, 0x09a8, 0x09aa, + 0x09b0, 0x09b2, 0x09b2, 0x09b6, 0x09b9, 0x09bc, 0x09c4, 0x09c7, + 0x09c8, 0x09cb, 0x09cd, 0x09d7, 0x09d7, 0x09dc, 0x09dd, 0x09df, + 0x09e3, 0x09e6, 0x09fa, 0x0a01, 0x0a03, 0x0a05, 0x0a0a, 0x0a0f, + 0x0a10, 0x0a13, 0x0a28, 0x0a2a, 0x0a30, 0x0a32, 0x0a33, 0x0a35, + 0x0a36, 0x0a38, 0x0a39, 0x0a3c, 0x0a3c, 0x0a3e, 0x0a42, 0x0a47, + 0x0a48, 0x0a4b, 0x0a4d, 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, + 0x0a74, 0x0a81, 0x0a83, 0x0a85, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, + 0x0aa8, 0x0aaa, 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, + 0x0ac5, 0x0ac7, 0x0ac9, 0x0acb, 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, + 0x0ae3, 0x0ae6, 0x0aef, 0x0af1, 0x0af1, 0x0b01, 0x0b03, 0x0b05, + 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, 0x0b28, 0x0b2a, 0x0b30, 0x0b32, + 0x0b33, 0x0b35, 0x0b39, 0x0b3c, 0x0b43, 0x0b47, 0x0b48, 0x0b4b, + 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, 0x0b5d, 0x0b5f, 0x0b61, 0x0b66, + 0x0b71, 0x0b82, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, + 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, + 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, 0x0bb5, 0x0bb7, 0x0bb9, 0x0bbe, + 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, 0x0bcd, 0x0bd7, 0x0bd7, 0x0be7, + 0x0bfa, 0x0c01, 0x0c03, 0x0c05, 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, + 0x0c28, 0x0c2a, 0x0c33, 0x0c35, 0x0c39, 0x0c3e, 0x0c44, 0x0c46, + 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, 0x0c56, 0x0c60, 0x0c61, 0x0c66, + 0x0c6f, 0x0c82, 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, + 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbc, 0x0cc4, 0x0cc6, + 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, + 0x0ce1, 0x0ce6, 0x0cef, 0x0d02, 0x0d03, 0x0d05, 0x0d0c, 0x0d0e, + 0x0d10, 0x0d12, 0x0d28, 0x0d2a, 0x0d39, 0x0d3e, 0x0d43, 0x0d46, + 0x0d48, 0x0d4a, 0x0d4d, 0x0d57, 0x0d57, 0x0d60, 0x0d61, 0x0d66, + 0x0d6f, 0x0d82, 0x0d83, 0x0d85, 0x0d96, 0x0d9a, 0x0db1, 0x0db3, + 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, 0x0dc6, 0x0dca, 0x0dca, 0x0dcf, + 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, 0x0ddf, 0x0df2, 0x0df4, 0x0e01, + 0x0e3a, 0x0e3f, 0x0e5b, 0x0e81, 0x0e82, 0x0e84, 0x0e84, 0x0e87, + 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, 0x0e97, 0x0e99, + 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, + 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, + 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, 0x0ed9, 0x0edc, 0x0edd, 0x0f00, + 0x0f47, 0x0f49, 0x0f6a, 0x0f71, 0x0f8b, 0x0f90, 0x0f97, 0x0f99, + 0x0fbc, 0x0fbe, 0x0fcc, 0x0fcf, 0x0fcf, 0x1000, 0x1021, 0x1023, + 0x1027, 0x1029, 0x102a, 0x102c, 0x1032, 0x1036, 0x1039, 0x1040, + 0x1059, 0x10a0, 0x10c5, 0x10d0, 0x10f8, 0x10fb, 0x10fb, 0x1100, + 0x1159, 0x115f, 0x11a2, 0x11a8, 0x11f9, 0x1200, 0x1206, 0x1208, + 0x1246, 0x1248, 0x1248, 0x124a, 0x124d, 0x1250, 0x1256, 0x1258, + 0x1258, 0x125a, 0x125d, 0x1260, 0x1286, 0x1288, 0x1288, 0x128a, + 0x128d, 0x1290, 0x12ae, 0x12b0, 0x12b0, 0x12b2, 0x12b5, 0x12b8, + 0x12be, 0x12c0, 0x12c0, 0x12c2, 0x12c5, 0x12c8, 0x12ce, 0x12d0, + 0x12d6, 0x12d8, 0x12ee, 0x12f0, 0x130e, 0x1310, 0x1310, 0x1312, + 0x1315, 0x1318, 0x131e, 0x1320, 0x1346, 0x1348, 0x135a, 0x1361, + 0x137c, 0x13a0, 0x13f4, 0x1401, 0x1676, 0x1680, 0x169c, 0x16a0, + 0x16f0, 0x1700, 0x170c, 0x170e, 0x1714, 0x1720, 0x1736, 0x1740, + 0x1753, 0x1760, 0x176c, 0x176e, 0x1770, 0x1772, 0x1773, 0x1780, + 0x17dd, 0x17e0, 0x17e9, 0x17f0, 0x17f9, 0x1800, 0x180e, 0x1810, + 0x1819, 0x1820, 0x1877, 0x1880, 0x18a9, 0x1900, 0x191c, 0x1920, + 0x192b, 0x1930, 0x193b, 0x1940, 0x1940, 0x1944, 0x196d, 0x1970, + 0x1974, 0x19e0, 0x19ff, 0x1d00, 0x1d6b, 0x1e00, 0x1e9b, 0x1ea0, + 0x1ef9, 0x1f00, 0x1f15, 0x1f18, 0x1f1d, 0x1f20, 0x1f45, 0x1f48, + 0x1f4d, 0x1f50, 0x1f57, 0x1f59, 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, + 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, 0x1fc4, 0x1fc6, + 0x1fd3, 0x1fd6, 0x1fdb, 0x1fdd, 0x1fef, 0x1ff2, 0x1ff4, 0x1ff6, + 0x1ffe, 0x2000, 0x2054, 0x2057, 0x2057, 0x205f, 0x2063, 0x206a, + 0x2071, 0x2074, 0x208e, 0x20a0, 0x20b1, 0x20d0, 0x20ea, 0x2100, + 0x213b, 0x213d, 0x214b, 0x2153, 0x2183, 0x2190, 0x23d0, 0x2400, + 0x2426, 0x2440, 0x244a, 0x2460, 0x2617, 0x2619, 0x267d, 0x2680, + 0x2691, 0x26a0, 0x26a1, 0x2701, 0x2704, 0x2706, 0x2709, 0x270c, + 0x2727, 0x2729, 0x274b, 0x274d, 0x274d, 0x274f, 0x2752, 0x2756, + 0x2756, 0x2758, 0x275e, 0x2761, 0x2794, 0x2798, 0x27af, 0x27b1, + 0x27be, 0x27d0, 0x27eb, 0x27f0, 0x2b0d, 0x2e80, 0x2e99, 0x2e9b, + 0x2ef3, 0x2f00, 0x2fd5, 0x2ff0, 0x2ffb, 0x3000, 0x303f, 0x3041, + 0x3096, 0x3099, 0x30ff, 0x3105, 0x312c, 0x3131, 0x318e, 0x3190, + 0x31b7, 0x31f0, 0x321e, 0x3220, 0x3243, 0x3250, 0x327d, 0x327f, + 0x32fe, 0x3300, 0x4db5, 0x4dc0, 0x9fa5, 0xa000, 0xa48c, 0xa490, + 0xa4c6, 0xac00, 0xd7a3, 0xd800, 0xfa2d, 0xfa30, 0xfa6a, 0xfb00, + 0xfb06, 0xfb13, 0xfb17, 0xfb1d, 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, + 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, 0xfbb1, 0xfbd3, + 0xfd3f, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdd0, 0xfdfd, 0xfe00, + 0xfe0f, 0xfe20, 0xfe23, 0xfe30, 0xfe52, 0xfe54, 0xfe66, 0xfe68, + 0xfe6b, 0xfe70, 0xfe74, 0xfe76, 0xfefc, 0xfeff, 0xfeff, 0xff01, + 0xffbe, 0xffc2, 0xffc7, 0xffca, 0xffcf, 0xffd2, 0xffd7, 0xffda, + 0xffdc, 0xffe0, 0xffe6, 0xffe8, 0xffee, 0xfff9, 0x1000b, 0x1000d, + 0x10026, 0x10028, 0x1003a, 0x1003c, 0x1003d, 0x1003f, 0x1004d, 0x10050, + 0x1005d, 0x10080, 0x100fa, 0x10100, 0x10102, 0x10107, 0x10133, 0x10137, + 0x1013f, 0x10300, 0x1031e, 0x10320, 0x10323, 0x10330, 0x1034a, 0x10380, + 0x1039d, 0x1039f, 0x1039f, 0x10400, 0x1049d, 0x104a0, 0x104a9, 0x10800, + 0x10805, 0x10808, 0x10808, 0x1080a, 0x10835, 0x10837, 0x10838, 0x1083c, + 0x1083c, 0x1083f, 0x1083f, 0x1d000, 0x1d0f5, 0x1d100, 0x1d126, 0x1d12a, + 0x1d1dd, 0x1d300, 0x1d356, 0x1d400, 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, + 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, + 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, + 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, + 0x1d53e, 0x1d540, 0x1d544, 0x1d546, 0x1d546, 0x1d54a, 0x1d550, 0x1d552, + 0x1d6a3, 0x1d6a8, 0x1d7c9, 0x1d7ce, 0x1d7ff, 0x1fffe, 0x2a6d6, 0x2f800, + 0x2fa1d, 0x2fffe, 0x2ffff, 0x3fffe, 0x3ffff, 0x4fffe, 0x4ffff, 0x5fffe, + 0x5ffff, 0x6fffe, 0x6ffff, 0x7fffe, 0x7ffff, 0x8fffe, 0x8ffff, 0x9fffe, + 0x9ffff, 0xafffe, 0xaffff, 0xbfffe, 0xbffff, 0xcfffe, 0xcffff, 0xdfffe, + 0xdffff, 0xe0001, 0xe0001, 0xe0020, 0xe007f, 0xe0100, 0xe01ef, 0xefffe, + 0x10ffff, +}; /* CR_Age_4_0 */ + +/* 'Age_4_1': Derived Age 4.1 */ +static const OnigCodePoint CR_Age_4_1[] = { + 430, 0x0000, 0x0241, 0x0250, 0x036f, 0x0374, 0x0375, 0x037a, + 0x037a, 0x037e, 0x037e, 0x0384, 0x038a, 0x038c, 0x038c, 0x038e, + 0x03a1, 0x03a3, 0x03ce, 0x03d0, 0x0486, 0x0488, 0x04ce, 0x04d0, + 0x04f9, 0x0500, 0x050f, 0x0531, 0x0556, 0x0559, 0x055f, 0x0561, + 0x0587, 0x0589, 0x058a, 0x0591, 0x05b9, 0x05bb, 0x05c7, 0x05d0, + 0x05ea, 0x05f0, 0x05f4, 0x0600, 0x0603, 0x060b, 0x0615, 0x061b, + 0x061b, 0x061e, 0x061f, 0x0621, 0x063a, 0x0640, 0x065e, 0x0660, + 0x070d, 0x070f, 0x074a, 0x074d, 0x076d, 0x0780, 0x07b1, 0x0901, + 0x0939, 0x093c, 0x094d, 0x0950, 0x0954, 0x0958, 0x0970, 0x097d, + 0x097d, 0x0981, 0x0983, 0x0985, 0x098c, 0x098f, 0x0990, 0x0993, + 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, 0x09b9, 0x09bc, + 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09ce, 0x09d7, 0x09d7, 0x09dc, + 0x09dd, 0x09df, 0x09e3, 0x09e6, 0x09fa, 0x0a01, 0x0a03, 0x0a05, + 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, 0x0a30, 0x0a32, + 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3c, 0x0a3c, 0x0a3e, + 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4d, 0x0a59, 0x0a5c, 0x0a5e, + 0x0a5e, 0x0a66, 0x0a74, 0x0a81, 0x0a83, 0x0a85, 0x0a8d, 0x0a8f, + 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, + 0x0ab9, 0x0abc, 0x0ac5, 0x0ac7, 0x0ac9, 0x0acb, 0x0acd, 0x0ad0, + 0x0ad0, 0x0ae0, 0x0ae3, 0x0ae6, 0x0aef, 0x0af1, 0x0af1, 0x0b01, + 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, 0x0b28, 0x0b2a, + 0x0b30, 0x0b32, 0x0b33, 0x0b35, 0x0b39, 0x0b3c, 0x0b43, 0x0b47, + 0x0b48, 0x0b4b, 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, 0x0b5d, 0x0b5f, + 0x0b61, 0x0b66, 0x0b71, 0x0b82, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, + 0x0b90, 0x0b92, 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, + 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, 0x0bb9, 0x0bbe, + 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, 0x0bcd, 0x0bd7, 0x0bd7, 0x0be6, + 0x0bfa, 0x0c01, 0x0c03, 0x0c05, 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, + 0x0c28, 0x0c2a, 0x0c33, 0x0c35, 0x0c39, 0x0c3e, 0x0c44, 0x0c46, + 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, 0x0c56, 0x0c60, 0x0c61, 0x0c66, + 0x0c6f, 0x0c82, 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, + 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbc, 0x0cc4, 0x0cc6, + 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, + 0x0ce1, 0x0ce6, 0x0cef, 0x0d02, 0x0d03, 0x0d05, 0x0d0c, 0x0d0e, + 0x0d10, 0x0d12, 0x0d28, 0x0d2a, 0x0d39, 0x0d3e, 0x0d43, 0x0d46, + 0x0d48, 0x0d4a, 0x0d4d, 0x0d57, 0x0d57, 0x0d60, 0x0d61, 0x0d66, + 0x0d6f, 0x0d82, 0x0d83, 0x0d85, 0x0d96, 0x0d9a, 0x0db1, 0x0db3, + 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, 0x0dc6, 0x0dca, 0x0dca, 0x0dcf, + 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, 0x0ddf, 0x0df2, 0x0df4, 0x0e01, + 0x0e3a, 0x0e3f, 0x0e5b, 0x0e81, 0x0e82, 0x0e84, 0x0e84, 0x0e87, + 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, 0x0e97, 0x0e99, + 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, + 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, + 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, 0x0ed9, 0x0edc, 0x0edd, 0x0f00, + 0x0f47, 0x0f49, 0x0f6a, 0x0f71, 0x0f8b, 0x0f90, 0x0f97, 0x0f99, + 0x0fbc, 0x0fbe, 0x0fcc, 0x0fcf, 0x0fd1, 0x1000, 0x1021, 0x1023, + 0x1027, 0x1029, 0x102a, 0x102c, 0x1032, 0x1036, 0x1039, 0x1040, + 0x1059, 0x10a0, 0x10c5, 0x10d0, 0x10fc, 0x1100, 0x1159, 0x115f, + 0x11a2, 0x11a8, 0x11f9, 0x1200, 0x1248, 0x124a, 0x124d, 0x1250, + 0x1256, 0x1258, 0x1258, 0x125a, 0x125d, 0x1260, 0x1288, 0x128a, + 0x128d, 0x1290, 0x12b0, 0x12b2, 0x12b5, 0x12b8, 0x12be, 0x12c0, + 0x12c0, 0x12c2, 0x12c5, 0x12c8, 0x12d6, 0x12d8, 0x1310, 0x1312, + 0x1315, 0x1318, 0x135a, 0x135f, 0x137c, 0x1380, 0x1399, 0x13a0, + 0x13f4, 0x1401, 0x1676, 0x1680, 0x169c, 0x16a0, 0x16f0, 0x1700, + 0x170c, 0x170e, 0x1714, 0x1720, 0x1736, 0x1740, 0x1753, 0x1760, + 0x176c, 0x176e, 0x1770, 0x1772, 0x1773, 0x1780, 0x17dd, 0x17e0, + 0x17e9, 0x17f0, 0x17f9, 0x1800, 0x180e, 0x1810, 0x1819, 0x1820, + 0x1877, 0x1880, 0x18a9, 0x1900, 0x191c, 0x1920, 0x192b, 0x1930, + 0x193b, 0x1940, 0x1940, 0x1944, 0x196d, 0x1970, 0x1974, 0x1980, + 0x19a9, 0x19b0, 0x19c9, 0x19d0, 0x19d9, 0x19de, 0x1a1b, 0x1a1e, + 0x1a1f, 0x1d00, 0x1dc3, 0x1e00, 0x1e9b, 0x1ea0, 0x1ef9, 0x1f00, + 0x1f15, 0x1f18, 0x1f1d, 0x1f20, 0x1f45, 0x1f48, 0x1f4d, 0x1f50, + 0x1f57, 0x1f59, 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, + 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, 0x1fc4, 0x1fc6, 0x1fd3, 0x1fd6, + 0x1fdb, 0x1fdd, 0x1fef, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ffe, 0x2000, + 0x2063, 0x206a, 0x2071, 0x2074, 0x208e, 0x2090, 0x2094, 0x20a0, + 0x20b5, 0x20d0, 0x20eb, 0x2100, 0x214c, 0x2153, 0x2183, 0x2190, + 0x23db, 0x2400, 0x2426, 0x2440, 0x244a, 0x2460, 0x269c, 0x26a0, + 0x26b1, 0x2701, 0x2704, 0x2706, 0x2709, 0x270c, 0x2727, 0x2729, + 0x274b, 0x274d, 0x274d, 0x274f, 0x2752, 0x2756, 0x2756, 0x2758, + 0x275e, 0x2761, 0x2794, 0x2798, 0x27af, 0x27b1, 0x27be, 0x27c0, + 0x27c6, 0x27d0, 0x27eb, 0x27f0, 0x2b13, 0x2c00, 0x2c2e, 0x2c30, + 0x2c5e, 0x2c80, 0x2cea, 0x2cf9, 0x2d25, 0x2d30, 0x2d65, 0x2d6f, + 0x2d6f, 0x2d80, 0x2d96, 0x2da0, 0x2da6, 0x2da8, 0x2dae, 0x2db0, + 0x2db6, 0x2db8, 0x2dbe, 0x2dc0, 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, + 0x2dd6, 0x2dd8, 0x2dde, 0x2e00, 0x2e17, 0x2e1c, 0x2e1d, 0x2e80, + 0x2e99, 0x2e9b, 0x2ef3, 0x2f00, 0x2fd5, 0x2ff0, 0x2ffb, 0x3000, + 0x303f, 0x3041, 0x3096, 0x3099, 0x30ff, 0x3105, 0x312c, 0x3131, + 0x318e, 0x3190, 0x31b7, 0x31c0, 0x31cf, 0x31f0, 0x321e, 0x3220, + 0x3243, 0x3250, 0x32fe, 0x3300, 0x4db5, 0x4dc0, 0x9fbb, 0xa000, + 0xa48c, 0xa490, 0xa4c6, 0xa700, 0xa716, 0xa800, 0xa82b, 0xac00, + 0xd7a3, 0xd800, 0xfa2d, 0xfa30, 0xfa6a, 0xfa70, 0xfad9, 0xfb00, + 0xfb06, 0xfb13, 0xfb17, 0xfb1d, 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, + 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, 0xfbb1, 0xfbd3, + 0xfd3f, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdd0, 0xfdfd, 0xfe00, + 0xfe19, 0xfe20, 0xfe23, 0xfe30, 0xfe52, 0xfe54, 0xfe66, 0xfe68, + 0xfe6b, 0xfe70, 0xfe74, 0xfe76, 0xfefc, 0xfeff, 0xfeff, 0xff01, + 0xffbe, 0xffc2, 0xffc7, 0xffca, 0xffcf, 0xffd2, 0xffd7, 0xffda, + 0xffdc, 0xffe0, 0xffe6, 0xffe8, 0xffee, 0xfff9, 0x1000b, 0x1000d, + 0x10026, 0x10028, 0x1003a, 0x1003c, 0x1003d, 0x1003f, 0x1004d, 0x10050, + 0x1005d, 0x10080, 0x100fa, 0x10100, 0x10102, 0x10107, 0x10133, 0x10137, + 0x1018a, 0x10300, 0x1031e, 0x10320, 0x10323, 0x10330, 0x1034a, 0x10380, + 0x1039d, 0x1039f, 0x103c3, 0x103c8, 0x103d5, 0x10400, 0x1049d, 0x104a0, + 0x104a9, 0x10800, 0x10805, 0x10808, 0x10808, 0x1080a, 0x10835, 0x10837, + 0x10838, 0x1083c, 0x1083c, 0x1083f, 0x1083f, 0x10a00, 0x10a03, 0x10a05, + 0x10a06, 0x10a0c, 0x10a13, 0x10a15, 0x10a17, 0x10a19, 0x10a33, 0x10a38, + 0x10a3a, 0x10a3f, 0x10a47, 0x10a50, 0x10a58, 0x1d000, 0x1d0f5, 0x1d100, + 0x1d126, 0x1d12a, 0x1d1dd, 0x1d200, 0x1d245, 0x1d300, 0x1d356, 0x1d400, + 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, + 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, + 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, + 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, 0x1d544, 0x1d546, + 0x1d546, 0x1d54a, 0x1d550, 0x1d552, 0x1d6a5, 0x1d6a8, 0x1d7c9, 0x1d7ce, + 0x1d7ff, 0x1fffe, 0x2a6d6, 0x2f800, 0x2fa1d, 0x2fffe, 0x2ffff, 0x3fffe, + 0x3ffff, 0x4fffe, 0x4ffff, 0x5fffe, 0x5ffff, 0x6fffe, 0x6ffff, 0x7fffe, + 0x7ffff, 0x8fffe, 0x8ffff, 0x9fffe, 0x9ffff, 0xafffe, 0xaffff, 0xbfffe, + 0xbffff, 0xcfffe, 0xcffff, 0xdfffe, 0xdffff, 0xe0001, 0xe0001, 0xe0020, + 0xe007f, 0xe0100, 0xe01ef, 0xefffe, 0x10ffff, +}; /* CR_Age_4_1 */ + +/* 'Age_5_0': Derived Age 5.0 */ +static const OnigCodePoint CR_Age_5_0[] = { + 440, 0x0000, 0x036f, 0x0374, 0x0375, 0x037a, 0x037e, 0x0384, + 0x038a, 0x038c, 0x038c, 0x038e, 0x03a1, 0x03a3, 0x03ce, 0x03d0, + 0x0486, 0x0488, 0x0513, 0x0531, 0x0556, 0x0559, 0x055f, 0x0561, + 0x0587, 0x0589, 0x058a, 0x0591, 0x05c7, 0x05d0, 0x05ea, 0x05f0, + 0x05f4, 0x0600, 0x0603, 0x060b, 0x0615, 0x061b, 0x061b, 0x061e, + 0x061f, 0x0621, 0x063a, 0x0640, 0x065e, 0x0660, 0x070d, 0x070f, + 0x074a, 0x074d, 0x076d, 0x0780, 0x07b1, 0x07c0, 0x07fa, 0x0901, + 0x0939, 0x093c, 0x094d, 0x0950, 0x0954, 0x0958, 0x0970, 0x097b, + 0x097f, 0x0981, 0x0983, 0x0985, 0x098c, 0x098f, 0x0990, 0x0993, + 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, 0x09b9, 0x09bc, + 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09ce, 0x09d7, 0x09d7, 0x09dc, + 0x09dd, 0x09df, 0x09e3, 0x09e6, 0x09fa, 0x0a01, 0x0a03, 0x0a05, + 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, 0x0a30, 0x0a32, + 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3c, 0x0a3c, 0x0a3e, + 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4d, 0x0a59, 0x0a5c, 0x0a5e, + 0x0a5e, 0x0a66, 0x0a74, 0x0a81, 0x0a83, 0x0a85, 0x0a8d, 0x0a8f, + 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, + 0x0ab9, 0x0abc, 0x0ac5, 0x0ac7, 0x0ac9, 0x0acb, 0x0acd, 0x0ad0, + 0x0ad0, 0x0ae0, 0x0ae3, 0x0ae6, 0x0aef, 0x0af1, 0x0af1, 0x0b01, + 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, 0x0b28, 0x0b2a, + 0x0b30, 0x0b32, 0x0b33, 0x0b35, 0x0b39, 0x0b3c, 0x0b43, 0x0b47, + 0x0b48, 0x0b4b, 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, 0x0b5d, 0x0b5f, + 0x0b61, 0x0b66, 0x0b71, 0x0b82, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, + 0x0b90, 0x0b92, 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, + 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, 0x0bb9, 0x0bbe, + 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, 0x0bcd, 0x0bd7, 0x0bd7, 0x0be6, + 0x0bfa, 0x0c01, 0x0c03, 0x0c05, 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, + 0x0c28, 0x0c2a, 0x0c33, 0x0c35, 0x0c39, 0x0c3e, 0x0c44, 0x0c46, + 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, 0x0c56, 0x0c60, 0x0c61, 0x0c66, + 0x0c6f, 0x0c82, 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, + 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbc, 0x0cc4, 0x0cc6, + 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, + 0x0ce3, 0x0ce6, 0x0cef, 0x0cf1, 0x0cf2, 0x0d02, 0x0d03, 0x0d05, + 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d28, 0x0d2a, 0x0d39, 0x0d3e, + 0x0d43, 0x0d46, 0x0d48, 0x0d4a, 0x0d4d, 0x0d57, 0x0d57, 0x0d60, + 0x0d61, 0x0d66, 0x0d6f, 0x0d82, 0x0d83, 0x0d85, 0x0d96, 0x0d9a, + 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, 0x0dc6, 0x0dca, + 0x0dca, 0x0dcf, 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, 0x0ddf, 0x0df2, + 0x0df4, 0x0e01, 0x0e3a, 0x0e3f, 0x0e5b, 0x0e81, 0x0e82, 0x0e84, + 0x0e84, 0x0e87, 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, + 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, + 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, 0x0ebd, 0x0ec0, + 0x0ec4, 0x0ec6, 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, 0x0ed9, 0x0edc, + 0x0edd, 0x0f00, 0x0f47, 0x0f49, 0x0f6a, 0x0f71, 0x0f8b, 0x0f90, + 0x0f97, 0x0f99, 0x0fbc, 0x0fbe, 0x0fcc, 0x0fcf, 0x0fd1, 0x1000, + 0x1021, 0x1023, 0x1027, 0x1029, 0x102a, 0x102c, 0x1032, 0x1036, + 0x1039, 0x1040, 0x1059, 0x10a0, 0x10c5, 0x10d0, 0x10fc, 0x1100, + 0x1159, 0x115f, 0x11a2, 0x11a8, 0x11f9, 0x1200, 0x1248, 0x124a, + 0x124d, 0x1250, 0x1256, 0x1258, 0x1258, 0x125a, 0x125d, 0x1260, + 0x1288, 0x128a, 0x128d, 0x1290, 0x12b0, 0x12b2, 0x12b5, 0x12b8, + 0x12be, 0x12c0, 0x12c0, 0x12c2, 0x12c5, 0x12c8, 0x12d6, 0x12d8, + 0x1310, 0x1312, 0x1315, 0x1318, 0x135a, 0x135f, 0x137c, 0x1380, + 0x1399, 0x13a0, 0x13f4, 0x1401, 0x1676, 0x1680, 0x169c, 0x16a0, + 0x16f0, 0x1700, 0x170c, 0x170e, 0x1714, 0x1720, 0x1736, 0x1740, + 0x1753, 0x1760, 0x176c, 0x176e, 0x1770, 0x1772, 0x1773, 0x1780, + 0x17dd, 0x17e0, 0x17e9, 0x17f0, 0x17f9, 0x1800, 0x180e, 0x1810, + 0x1819, 0x1820, 0x1877, 0x1880, 0x18a9, 0x1900, 0x191c, 0x1920, + 0x192b, 0x1930, 0x193b, 0x1940, 0x1940, 0x1944, 0x196d, 0x1970, + 0x1974, 0x1980, 0x19a9, 0x19b0, 0x19c9, 0x19d0, 0x19d9, 0x19de, + 0x1a1b, 0x1a1e, 0x1a1f, 0x1b00, 0x1b4b, 0x1b50, 0x1b7c, 0x1d00, + 0x1dca, 0x1dfe, 0x1e9b, 0x1ea0, 0x1ef9, 0x1f00, 0x1f15, 0x1f18, + 0x1f1d, 0x1f20, 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, + 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, + 0x1fb4, 0x1fb6, 0x1fc4, 0x1fc6, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fdd, + 0x1fef, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ffe, 0x2000, 0x2063, 0x206a, + 0x2071, 0x2074, 0x208e, 0x2090, 0x2094, 0x20a0, 0x20b5, 0x20d0, + 0x20ef, 0x2100, 0x214e, 0x2153, 0x2184, 0x2190, 0x23e7, 0x2400, + 0x2426, 0x2440, 0x244a, 0x2460, 0x269c, 0x26a0, 0x26b2, 0x2701, + 0x2704, 0x2706, 0x2709, 0x270c, 0x2727, 0x2729, 0x274b, 0x274d, + 0x274d, 0x274f, 0x2752, 0x2756, 0x2756, 0x2758, 0x275e, 0x2761, + 0x2794, 0x2798, 0x27af, 0x27b1, 0x27be, 0x27c0, 0x27ca, 0x27d0, + 0x27eb, 0x27f0, 0x2b1a, 0x2b20, 0x2b23, 0x2c00, 0x2c2e, 0x2c30, + 0x2c5e, 0x2c60, 0x2c6c, 0x2c74, 0x2c77, 0x2c80, 0x2cea, 0x2cf9, + 0x2d25, 0x2d30, 0x2d65, 0x2d6f, 0x2d6f, 0x2d80, 0x2d96, 0x2da0, + 0x2da6, 0x2da8, 0x2dae, 0x2db0, 0x2db6, 0x2db8, 0x2dbe, 0x2dc0, + 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, 0x2dd6, 0x2dd8, 0x2dde, 0x2e00, + 0x2e17, 0x2e1c, 0x2e1d, 0x2e80, 0x2e99, 0x2e9b, 0x2ef3, 0x2f00, + 0x2fd5, 0x2ff0, 0x2ffb, 0x3000, 0x303f, 0x3041, 0x3096, 0x3099, + 0x30ff, 0x3105, 0x312c, 0x3131, 0x318e, 0x3190, 0x31b7, 0x31c0, + 0x31cf, 0x31f0, 0x321e, 0x3220, 0x3243, 0x3250, 0x32fe, 0x3300, + 0x4db5, 0x4dc0, 0x9fbb, 0xa000, 0xa48c, 0xa490, 0xa4c6, 0xa700, + 0xa71a, 0xa720, 0xa721, 0xa800, 0xa82b, 0xa840, 0xa877, 0xac00, + 0xd7a3, 0xd800, 0xfa2d, 0xfa30, 0xfa6a, 0xfa70, 0xfad9, 0xfb00, + 0xfb06, 0xfb13, 0xfb17, 0xfb1d, 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, + 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, 0xfbb1, 0xfbd3, + 0xfd3f, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdd0, 0xfdfd, 0xfe00, + 0xfe19, 0xfe20, 0xfe23, 0xfe30, 0xfe52, 0xfe54, 0xfe66, 0xfe68, + 0xfe6b, 0xfe70, 0xfe74, 0xfe76, 0xfefc, 0xfeff, 0xfeff, 0xff01, + 0xffbe, 0xffc2, 0xffc7, 0xffca, 0xffcf, 0xffd2, 0xffd7, 0xffda, + 0xffdc, 0xffe0, 0xffe6, 0xffe8, 0xffee, 0xfff9, 0x1000b, 0x1000d, + 0x10026, 0x10028, 0x1003a, 0x1003c, 0x1003d, 0x1003f, 0x1004d, 0x10050, + 0x1005d, 0x10080, 0x100fa, 0x10100, 0x10102, 0x10107, 0x10133, 0x10137, + 0x1018a, 0x10300, 0x1031e, 0x10320, 0x10323, 0x10330, 0x1034a, 0x10380, + 0x1039d, 0x1039f, 0x103c3, 0x103c8, 0x103d5, 0x10400, 0x1049d, 0x104a0, + 0x104a9, 0x10800, 0x10805, 0x10808, 0x10808, 0x1080a, 0x10835, 0x10837, + 0x10838, 0x1083c, 0x1083c, 0x1083f, 0x1083f, 0x10900, 0x10919, 0x1091f, + 0x1091f, 0x10a00, 0x10a03, 0x10a05, 0x10a06, 0x10a0c, 0x10a13, 0x10a15, + 0x10a17, 0x10a19, 0x10a33, 0x10a38, 0x10a3a, 0x10a3f, 0x10a47, 0x10a50, + 0x10a58, 0x12000, 0x1236e, 0x12400, 0x12462, 0x12470, 0x12473, 0x1d000, + 0x1d0f5, 0x1d100, 0x1d126, 0x1d12a, 0x1d1dd, 0x1d200, 0x1d245, 0x1d300, + 0x1d356, 0x1d360, 0x1d371, 0x1d400, 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, + 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, + 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, + 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, + 0x1d53e, 0x1d540, 0x1d544, 0x1d546, 0x1d546, 0x1d54a, 0x1d550, 0x1d552, + 0x1d6a5, 0x1d6a8, 0x1d7cb, 0x1d7ce, 0x1d7ff, 0x1fffe, 0x2a6d6, 0x2f800, + 0x2fa1d, 0x2fffe, 0x2ffff, 0x3fffe, 0x3ffff, 0x4fffe, 0x4ffff, 0x5fffe, + 0x5ffff, 0x6fffe, 0x6ffff, 0x7fffe, 0x7ffff, 0x8fffe, 0x8ffff, 0x9fffe, + 0x9ffff, 0xafffe, 0xaffff, 0xbfffe, 0xbffff, 0xcfffe, 0xcffff, 0xdfffe, + 0xdffff, 0xe0001, 0xe0001, 0xe0020, 0xe007f, 0xe0100, 0xe01ef, 0xefffe, + 0x10ffff, +}; /* CR_Age_5_0 */ + +/* 'Age_5_1': Derived Age 5.1 */ +static const OnigCodePoint CR_Age_5_1[] = { + 455, 0x0000, 0x0377, 0x037a, 0x037e, 0x0384, 0x038a, 0x038c, + 0x038c, 0x038e, 0x03a1, 0x03a3, 0x0523, 0x0531, 0x0556, 0x0559, + 0x055f, 0x0561, 0x0587, 0x0589, 0x058a, 0x0591, 0x05c7, 0x05d0, + 0x05ea, 0x05f0, 0x05f4, 0x0600, 0x0603, 0x0606, 0x061b, 0x061e, + 0x061f, 0x0621, 0x065e, 0x0660, 0x070d, 0x070f, 0x074a, 0x074d, + 0x07b1, 0x07c0, 0x07fa, 0x0901, 0x0939, 0x093c, 0x094d, 0x0950, + 0x0954, 0x0958, 0x0972, 0x097b, 0x097f, 0x0981, 0x0983, 0x0985, + 0x098c, 0x098f, 0x0990, 0x0993, 0x09a8, 0x09aa, 0x09b0, 0x09b2, + 0x09b2, 0x09b6, 0x09b9, 0x09bc, 0x09c4, 0x09c7, 0x09c8, 0x09cb, + 0x09ce, 0x09d7, 0x09d7, 0x09dc, 0x09dd, 0x09df, 0x09e3, 0x09e6, + 0x09fa, 0x0a01, 0x0a03, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, + 0x0a28, 0x0a2a, 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, + 0x0a39, 0x0a3c, 0x0a3c, 0x0a3e, 0x0a42, 0x0a47, 0x0a48, 0x0a4b, + 0x0a4d, 0x0a51, 0x0a51, 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, + 0x0a75, 0x0a81, 0x0a83, 0x0a85, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, + 0x0aa8, 0x0aaa, 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, + 0x0ac5, 0x0ac7, 0x0ac9, 0x0acb, 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, + 0x0ae3, 0x0ae6, 0x0aef, 0x0af1, 0x0af1, 0x0b01, 0x0b03, 0x0b05, + 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, 0x0b28, 0x0b2a, 0x0b30, 0x0b32, + 0x0b33, 0x0b35, 0x0b39, 0x0b3c, 0x0b44, 0x0b47, 0x0b48, 0x0b4b, + 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, 0x0b5d, 0x0b5f, 0x0b63, 0x0b66, + 0x0b71, 0x0b82, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, + 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, + 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, + 0x0bc8, 0x0bca, 0x0bcd, 0x0bd0, 0x0bd0, 0x0bd7, 0x0bd7, 0x0be6, + 0x0bfa, 0x0c01, 0x0c03, 0x0c05, 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, + 0x0c28, 0x0c2a, 0x0c33, 0x0c35, 0x0c39, 0x0c3d, 0x0c44, 0x0c46, + 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, 0x0c56, 0x0c58, 0x0c59, 0x0c60, + 0x0c63, 0x0c66, 0x0c6f, 0x0c78, 0x0c7f, 0x0c82, 0x0c83, 0x0c85, + 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, + 0x0cb9, 0x0cbc, 0x0cc4, 0x0cc6, 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, + 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, 0x0ce3, 0x0ce6, 0x0cef, 0x0cf1, + 0x0cf2, 0x0d02, 0x0d03, 0x0d05, 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, + 0x0d28, 0x0d2a, 0x0d39, 0x0d3d, 0x0d44, 0x0d46, 0x0d48, 0x0d4a, + 0x0d4d, 0x0d57, 0x0d57, 0x0d60, 0x0d63, 0x0d66, 0x0d75, 0x0d79, + 0x0d7f, 0x0d82, 0x0d83, 0x0d85, 0x0d96, 0x0d9a, 0x0db1, 0x0db3, + 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, 0x0dc6, 0x0dca, 0x0dca, 0x0dcf, + 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, 0x0ddf, 0x0df2, 0x0df4, 0x0e01, + 0x0e3a, 0x0e3f, 0x0e5b, 0x0e81, 0x0e82, 0x0e84, 0x0e84, 0x0e87, + 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, 0x0e97, 0x0e99, + 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, + 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, + 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, 0x0ed9, 0x0edc, 0x0edd, 0x0f00, + 0x0f47, 0x0f49, 0x0f6c, 0x0f71, 0x0f8b, 0x0f90, 0x0f97, 0x0f99, + 0x0fbc, 0x0fbe, 0x0fcc, 0x0fce, 0x0fd4, 0x1000, 0x1099, 0x109e, + 0x10c5, 0x10d0, 0x10fc, 0x1100, 0x1159, 0x115f, 0x11a2, 0x11a8, + 0x11f9, 0x1200, 0x1248, 0x124a, 0x124d, 0x1250, 0x1256, 0x1258, + 0x1258, 0x125a, 0x125d, 0x1260, 0x1288, 0x128a, 0x128d, 0x1290, + 0x12b0, 0x12b2, 0x12b5, 0x12b8, 0x12be, 0x12c0, 0x12c0, 0x12c2, + 0x12c5, 0x12c8, 0x12d6, 0x12d8, 0x1310, 0x1312, 0x1315, 0x1318, + 0x135a, 0x135f, 0x137c, 0x1380, 0x1399, 0x13a0, 0x13f4, 0x1401, + 0x1676, 0x1680, 0x169c, 0x16a0, 0x16f0, 0x1700, 0x170c, 0x170e, + 0x1714, 0x1720, 0x1736, 0x1740, 0x1753, 0x1760, 0x176c, 0x176e, + 0x1770, 0x1772, 0x1773, 0x1780, 0x17dd, 0x17e0, 0x17e9, 0x17f0, + 0x17f9, 0x1800, 0x180e, 0x1810, 0x1819, 0x1820, 0x1877, 0x1880, + 0x18aa, 0x1900, 0x191c, 0x1920, 0x192b, 0x1930, 0x193b, 0x1940, + 0x1940, 0x1944, 0x196d, 0x1970, 0x1974, 0x1980, 0x19a9, 0x19b0, + 0x19c9, 0x19d0, 0x19d9, 0x19de, 0x1a1b, 0x1a1e, 0x1a1f, 0x1b00, + 0x1b4b, 0x1b50, 0x1b7c, 0x1b80, 0x1baa, 0x1bae, 0x1bb9, 0x1c00, + 0x1c37, 0x1c3b, 0x1c49, 0x1c4d, 0x1c7f, 0x1d00, 0x1de6, 0x1dfe, + 0x1f15, 0x1f18, 0x1f1d, 0x1f20, 0x1f45, 0x1f48, 0x1f4d, 0x1f50, + 0x1f57, 0x1f59, 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, + 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, 0x1fc4, 0x1fc6, 0x1fd3, 0x1fd6, + 0x1fdb, 0x1fdd, 0x1fef, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ffe, 0x2000, + 0x2064, 0x206a, 0x2071, 0x2074, 0x208e, 0x2090, 0x2094, 0x20a0, + 0x20b5, 0x20d0, 0x20f0, 0x2100, 0x214f, 0x2153, 0x2188, 0x2190, + 0x23e7, 0x2400, 0x2426, 0x2440, 0x244a, 0x2460, 0x269d, 0x26a0, + 0x26bc, 0x26c0, 0x26c3, 0x2701, 0x2704, 0x2706, 0x2709, 0x270c, + 0x2727, 0x2729, 0x274b, 0x274d, 0x274d, 0x274f, 0x2752, 0x2756, + 0x2756, 0x2758, 0x275e, 0x2761, 0x2794, 0x2798, 0x27af, 0x27b1, + 0x27be, 0x27c0, 0x27ca, 0x27cc, 0x27cc, 0x27d0, 0x2b4c, 0x2b50, + 0x2b54, 0x2c00, 0x2c2e, 0x2c30, 0x2c5e, 0x2c60, 0x2c6f, 0x2c71, + 0x2c7d, 0x2c80, 0x2cea, 0x2cf9, 0x2d25, 0x2d30, 0x2d65, 0x2d6f, + 0x2d6f, 0x2d80, 0x2d96, 0x2da0, 0x2da6, 0x2da8, 0x2dae, 0x2db0, + 0x2db6, 0x2db8, 0x2dbe, 0x2dc0, 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, + 0x2dd6, 0x2dd8, 0x2dde, 0x2de0, 0x2e30, 0x2e80, 0x2e99, 0x2e9b, + 0x2ef3, 0x2f00, 0x2fd5, 0x2ff0, 0x2ffb, 0x3000, 0x303f, 0x3041, + 0x3096, 0x3099, 0x30ff, 0x3105, 0x312d, 0x3131, 0x318e, 0x3190, + 0x31b7, 0x31c0, 0x31e3, 0x31f0, 0x321e, 0x3220, 0x3243, 0x3250, + 0x32fe, 0x3300, 0x4db5, 0x4dc0, 0x9fc3, 0xa000, 0xa48c, 0xa490, + 0xa4c6, 0xa500, 0xa62b, 0xa640, 0xa65f, 0xa662, 0xa673, 0xa67c, + 0xa697, 0xa700, 0xa78c, 0xa7fb, 0xa82b, 0xa840, 0xa877, 0xa880, + 0xa8c4, 0xa8ce, 0xa8d9, 0xa900, 0xa953, 0xa95f, 0xa95f, 0xaa00, + 0xaa36, 0xaa40, 0xaa4d, 0xaa50, 0xaa59, 0xaa5c, 0xaa5f, 0xac00, + 0xd7a3, 0xd800, 0xfa2d, 0xfa30, 0xfa6a, 0xfa70, 0xfad9, 0xfb00, + 0xfb06, 0xfb13, 0xfb17, 0xfb1d, 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, + 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, 0xfbb1, 0xfbd3, + 0xfd3f, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdd0, 0xfdfd, 0xfe00, + 0xfe19, 0xfe20, 0xfe26, 0xfe30, 0xfe52, 0xfe54, 0xfe66, 0xfe68, + 0xfe6b, 0xfe70, 0xfe74, 0xfe76, 0xfefc, 0xfeff, 0xfeff, 0xff01, + 0xffbe, 0xffc2, 0xffc7, 0xffca, 0xffcf, 0xffd2, 0xffd7, 0xffda, + 0xffdc, 0xffe0, 0xffe6, 0xffe8, 0xffee, 0xfff9, 0x1000b, 0x1000d, + 0x10026, 0x10028, 0x1003a, 0x1003c, 0x1003d, 0x1003f, 0x1004d, 0x10050, + 0x1005d, 0x10080, 0x100fa, 0x10100, 0x10102, 0x10107, 0x10133, 0x10137, + 0x1018a, 0x10190, 0x1019b, 0x101d0, 0x101fd, 0x10280, 0x1029c, 0x102a0, + 0x102d0, 0x10300, 0x1031e, 0x10320, 0x10323, 0x10330, 0x1034a, 0x10380, + 0x1039d, 0x1039f, 0x103c3, 0x103c8, 0x103d5, 0x10400, 0x1049d, 0x104a0, + 0x104a9, 0x10800, 0x10805, 0x10808, 0x10808, 0x1080a, 0x10835, 0x10837, + 0x10838, 0x1083c, 0x1083c, 0x1083f, 0x1083f, 0x10900, 0x10919, 0x1091f, + 0x10939, 0x1093f, 0x1093f, 0x10a00, 0x10a03, 0x10a05, 0x10a06, 0x10a0c, + 0x10a13, 0x10a15, 0x10a17, 0x10a19, 0x10a33, 0x10a38, 0x10a3a, 0x10a3f, + 0x10a47, 0x10a50, 0x10a58, 0x12000, 0x1236e, 0x12400, 0x12462, 0x12470, + 0x12473, 0x1d000, 0x1d0f5, 0x1d100, 0x1d126, 0x1d129, 0x1d1dd, 0x1d200, + 0x1d245, 0x1d300, 0x1d356, 0x1d360, 0x1d371, 0x1d400, 0x1d454, 0x1d456, + 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, + 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, + 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, + 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, 0x1d544, 0x1d546, 0x1d546, 0x1d54a, + 0x1d550, 0x1d552, 0x1d6a5, 0x1d6a8, 0x1d7cb, 0x1d7ce, 0x1d7ff, 0x1f000, + 0x1f02b, 0x1f030, 0x1f093, 0x1fffe, 0x2a6d6, 0x2f800, 0x2fa1d, 0x2fffe, + 0x2ffff, 0x3fffe, 0x3ffff, 0x4fffe, 0x4ffff, 0x5fffe, 0x5ffff, 0x6fffe, + 0x6ffff, 0x7fffe, 0x7ffff, 0x8fffe, 0x8ffff, 0x9fffe, 0x9ffff, 0xafffe, + 0xaffff, 0xbfffe, 0xbffff, 0xcfffe, 0xcffff, 0xdfffe, 0xdffff, 0xe0001, + 0xe0001, 0xe0020, 0xe007f, 0xe0100, 0xe01ef, 0xefffe, 0x10ffff, +}; /* CR_Age_5_1 */ + +/* 'Age_5_2': Derived Age 5.2 */ +static const OnigCodePoint CR_Age_5_2[] = { + 495, 0x0000, 0x0377, 0x037a, 0x037e, 0x0384, 0x038a, 0x038c, + 0x038c, 0x038e, 0x03a1, 0x03a3, 0x0525, 0x0531, 0x0556, 0x0559, + 0x055f, 0x0561, 0x0587, 0x0589, 0x058a, 0x0591, 0x05c7, 0x05d0, + 0x05ea, 0x05f0, 0x05f4, 0x0600, 0x0603, 0x0606, 0x061b, 0x061e, + 0x061f, 0x0621, 0x065e, 0x0660, 0x070d, 0x070f, 0x074a, 0x074d, + 0x07b1, 0x07c0, 0x07fa, 0x0800, 0x082d, 0x0830, 0x083e, 0x0900, + 0x0939, 0x093c, 0x094e, 0x0950, 0x0955, 0x0958, 0x0972, 0x0979, + 0x097f, 0x0981, 0x0983, 0x0985, 0x098c, 0x098f, 0x0990, 0x0993, + 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, 0x09b9, 0x09bc, + 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09ce, 0x09d7, 0x09d7, 0x09dc, + 0x09dd, 0x09df, 0x09e3, 0x09e6, 0x09fb, 0x0a01, 0x0a03, 0x0a05, + 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, 0x0a30, 0x0a32, + 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3c, 0x0a3c, 0x0a3e, + 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4d, 0x0a51, 0x0a51, 0x0a59, + 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, 0x0a75, 0x0a81, 0x0a83, 0x0a85, + 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, 0x0ab0, 0x0ab2, + 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, 0x0ac5, 0x0ac7, 0x0ac9, 0x0acb, + 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, 0x0ae3, 0x0ae6, 0x0aef, 0x0af1, + 0x0af1, 0x0b01, 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, + 0x0b28, 0x0b2a, 0x0b30, 0x0b32, 0x0b33, 0x0b35, 0x0b39, 0x0b3c, + 0x0b44, 0x0b47, 0x0b48, 0x0b4b, 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, + 0x0b5d, 0x0b5f, 0x0b63, 0x0b66, 0x0b71, 0x0b82, 0x0b83, 0x0b85, + 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, + 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, + 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, 0x0bcd, 0x0bd0, + 0x0bd0, 0x0bd7, 0x0bd7, 0x0be6, 0x0bfa, 0x0c01, 0x0c03, 0x0c05, + 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, 0x0c28, 0x0c2a, 0x0c33, 0x0c35, + 0x0c39, 0x0c3d, 0x0c44, 0x0c46, 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, + 0x0c56, 0x0c58, 0x0c59, 0x0c60, 0x0c63, 0x0c66, 0x0c6f, 0x0c78, + 0x0c7f, 0x0c82, 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, + 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbc, 0x0cc4, 0x0cc6, + 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, + 0x0ce3, 0x0ce6, 0x0cef, 0x0cf1, 0x0cf2, 0x0d02, 0x0d03, 0x0d05, + 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d28, 0x0d2a, 0x0d39, 0x0d3d, + 0x0d44, 0x0d46, 0x0d48, 0x0d4a, 0x0d4d, 0x0d57, 0x0d57, 0x0d60, + 0x0d63, 0x0d66, 0x0d75, 0x0d79, 0x0d7f, 0x0d82, 0x0d83, 0x0d85, + 0x0d96, 0x0d9a, 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, + 0x0dc6, 0x0dca, 0x0dca, 0x0dcf, 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, + 0x0ddf, 0x0df2, 0x0df4, 0x0e01, 0x0e3a, 0x0e3f, 0x0e5b, 0x0e81, + 0x0e82, 0x0e84, 0x0e84, 0x0e87, 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, + 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, + 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, + 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, + 0x0ed9, 0x0edc, 0x0edd, 0x0f00, 0x0f47, 0x0f49, 0x0f6c, 0x0f71, + 0x0f8b, 0x0f90, 0x0f97, 0x0f99, 0x0fbc, 0x0fbe, 0x0fcc, 0x0fce, + 0x0fd8, 0x1000, 0x10c5, 0x10d0, 0x10fc, 0x1100, 0x1248, 0x124a, + 0x124d, 0x1250, 0x1256, 0x1258, 0x1258, 0x125a, 0x125d, 0x1260, + 0x1288, 0x128a, 0x128d, 0x1290, 0x12b0, 0x12b2, 0x12b5, 0x12b8, + 0x12be, 0x12c0, 0x12c0, 0x12c2, 0x12c5, 0x12c8, 0x12d6, 0x12d8, + 0x1310, 0x1312, 0x1315, 0x1318, 0x135a, 0x135f, 0x137c, 0x1380, + 0x1399, 0x13a0, 0x13f4, 0x1400, 0x169c, 0x16a0, 0x16f0, 0x1700, + 0x170c, 0x170e, 0x1714, 0x1720, 0x1736, 0x1740, 0x1753, 0x1760, + 0x176c, 0x176e, 0x1770, 0x1772, 0x1773, 0x1780, 0x17dd, 0x17e0, + 0x17e9, 0x17f0, 0x17f9, 0x1800, 0x180e, 0x1810, 0x1819, 0x1820, + 0x1877, 0x1880, 0x18aa, 0x18b0, 0x18f5, 0x1900, 0x191c, 0x1920, + 0x192b, 0x1930, 0x193b, 0x1940, 0x1940, 0x1944, 0x196d, 0x1970, + 0x1974, 0x1980, 0x19ab, 0x19b0, 0x19c9, 0x19d0, 0x19da, 0x19de, + 0x1a1b, 0x1a1e, 0x1a5e, 0x1a60, 0x1a7c, 0x1a7f, 0x1a89, 0x1a90, + 0x1a99, 0x1aa0, 0x1aad, 0x1b00, 0x1b4b, 0x1b50, 0x1b7c, 0x1b80, + 0x1baa, 0x1bae, 0x1bb9, 0x1c00, 0x1c37, 0x1c3b, 0x1c49, 0x1c4d, + 0x1c7f, 0x1cd0, 0x1cf2, 0x1d00, 0x1de6, 0x1dfd, 0x1f15, 0x1f18, + 0x1f1d, 0x1f20, 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, + 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, + 0x1fb4, 0x1fb6, 0x1fc4, 0x1fc6, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fdd, + 0x1fef, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ffe, 0x2000, 0x2064, 0x206a, + 0x2071, 0x2074, 0x208e, 0x2090, 0x2094, 0x20a0, 0x20b8, 0x20d0, + 0x20f0, 0x2100, 0x2189, 0x2190, 0x23e8, 0x2400, 0x2426, 0x2440, + 0x244a, 0x2460, 0x26cd, 0x26cf, 0x26e1, 0x26e3, 0x26e3, 0x26e8, + 0x26ff, 0x2701, 0x2704, 0x2706, 0x2709, 0x270c, 0x2727, 0x2729, + 0x274b, 0x274d, 0x274d, 0x274f, 0x2752, 0x2756, 0x275e, 0x2761, + 0x2794, 0x2798, 0x27af, 0x27b1, 0x27be, 0x27c0, 0x27ca, 0x27cc, + 0x27cc, 0x27d0, 0x2b4c, 0x2b50, 0x2b59, 0x2c00, 0x2c2e, 0x2c30, + 0x2c5e, 0x2c60, 0x2cf1, 0x2cf9, 0x2d25, 0x2d30, 0x2d65, 0x2d6f, + 0x2d6f, 0x2d80, 0x2d96, 0x2da0, 0x2da6, 0x2da8, 0x2dae, 0x2db0, + 0x2db6, 0x2db8, 0x2dbe, 0x2dc0, 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, + 0x2dd6, 0x2dd8, 0x2dde, 0x2de0, 0x2e31, 0x2e80, 0x2e99, 0x2e9b, + 0x2ef3, 0x2f00, 0x2fd5, 0x2ff0, 0x2ffb, 0x3000, 0x303f, 0x3041, + 0x3096, 0x3099, 0x30ff, 0x3105, 0x312d, 0x3131, 0x318e, 0x3190, + 0x31b7, 0x31c0, 0x31e3, 0x31f0, 0x321e, 0x3220, 0x32fe, 0x3300, + 0x4db5, 0x4dc0, 0x9fcb, 0xa000, 0xa48c, 0xa490, 0xa4c6, 0xa4d0, + 0xa62b, 0xa640, 0xa65f, 0xa662, 0xa673, 0xa67c, 0xa697, 0xa6a0, + 0xa6f7, 0xa700, 0xa78c, 0xa7fb, 0xa82b, 0xa830, 0xa839, 0xa840, + 0xa877, 0xa880, 0xa8c4, 0xa8ce, 0xa8d9, 0xa8e0, 0xa8fb, 0xa900, + 0xa953, 0xa95f, 0xa97c, 0xa980, 0xa9cd, 0xa9cf, 0xa9d9, 0xa9de, + 0xa9df, 0xaa00, 0xaa36, 0xaa40, 0xaa4d, 0xaa50, 0xaa59, 0xaa5c, + 0xaa7b, 0xaa80, 0xaac2, 0xaadb, 0xaadf, 0xabc0, 0xabed, 0xabf0, + 0xabf9, 0xac00, 0xd7a3, 0xd7b0, 0xd7c6, 0xd7cb, 0xd7fb, 0xd800, + 0xfa2d, 0xfa30, 0xfa6d, 0xfa70, 0xfad9, 0xfb00, 0xfb06, 0xfb13, + 0xfb17, 0xfb1d, 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, + 0xfb41, 0xfb43, 0xfb44, 0xfb46, 0xfbb1, 0xfbd3, 0xfd3f, 0xfd50, + 0xfd8f, 0xfd92, 0xfdc7, 0xfdd0, 0xfdfd, 0xfe00, 0xfe19, 0xfe20, + 0xfe26, 0xfe30, 0xfe52, 0xfe54, 0xfe66, 0xfe68, 0xfe6b, 0xfe70, + 0xfe74, 0xfe76, 0xfefc, 0xfeff, 0xfeff, 0xff01, 0xffbe, 0xffc2, + 0xffc7, 0xffca, 0xffcf, 0xffd2, 0xffd7, 0xffda, 0xffdc, 0xffe0, + 0xffe6, 0xffe8, 0xffee, 0xfff9, 0x1000b, 0x1000d, 0x10026, 0x10028, + 0x1003a, 0x1003c, 0x1003d, 0x1003f, 0x1004d, 0x10050, 0x1005d, 0x10080, + 0x100fa, 0x10100, 0x10102, 0x10107, 0x10133, 0x10137, 0x1018a, 0x10190, + 0x1019b, 0x101d0, 0x101fd, 0x10280, 0x1029c, 0x102a0, 0x102d0, 0x10300, + 0x1031e, 0x10320, 0x10323, 0x10330, 0x1034a, 0x10380, 0x1039d, 0x1039f, + 0x103c3, 0x103c8, 0x103d5, 0x10400, 0x1049d, 0x104a0, 0x104a9, 0x10800, + 0x10805, 0x10808, 0x10808, 0x1080a, 0x10835, 0x10837, 0x10838, 0x1083c, + 0x1083c, 0x1083f, 0x10855, 0x10857, 0x1085f, 0x10900, 0x1091b, 0x1091f, + 0x10939, 0x1093f, 0x1093f, 0x10a00, 0x10a03, 0x10a05, 0x10a06, 0x10a0c, + 0x10a13, 0x10a15, 0x10a17, 0x10a19, 0x10a33, 0x10a38, 0x10a3a, 0x10a3f, + 0x10a47, 0x10a50, 0x10a58, 0x10a60, 0x10a7f, 0x10b00, 0x10b35, 0x10b39, + 0x10b55, 0x10b58, 0x10b72, 0x10b78, 0x10b7f, 0x10c00, 0x10c48, 0x10e60, + 0x10e7e, 0x11080, 0x110c1, 0x12000, 0x1236e, 0x12400, 0x12462, 0x12470, + 0x12473, 0x13000, 0x1342e, 0x1d000, 0x1d0f5, 0x1d100, 0x1d126, 0x1d129, + 0x1d1dd, 0x1d200, 0x1d245, 0x1d300, 0x1d356, 0x1d360, 0x1d371, 0x1d400, + 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, + 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, + 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, + 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, 0x1d544, 0x1d546, + 0x1d546, 0x1d54a, 0x1d550, 0x1d552, 0x1d6a5, 0x1d6a8, 0x1d7cb, 0x1d7ce, + 0x1d7ff, 0x1f000, 0x1f02b, 0x1f030, 0x1f093, 0x1f100, 0x1f10a, 0x1f110, + 0x1f12e, 0x1f131, 0x1f131, 0x1f13d, 0x1f13d, 0x1f13f, 0x1f13f, 0x1f142, + 0x1f142, 0x1f146, 0x1f146, 0x1f14a, 0x1f14e, 0x1f157, 0x1f157, 0x1f15f, + 0x1f15f, 0x1f179, 0x1f179, 0x1f17b, 0x1f17c, 0x1f17f, 0x1f17f, 0x1f18a, + 0x1f18d, 0x1f190, 0x1f190, 0x1f200, 0x1f200, 0x1f210, 0x1f231, 0x1f240, + 0x1f248, 0x1fffe, 0x2a6d6, 0x2a700, 0x2b734, 0x2f800, 0x2fa1d, 0x2fffe, + 0x2ffff, 0x3fffe, 0x3ffff, 0x4fffe, 0x4ffff, 0x5fffe, 0x5ffff, 0x6fffe, + 0x6ffff, 0x7fffe, 0x7ffff, 0x8fffe, 0x8ffff, 0x9fffe, 0x9ffff, 0xafffe, + 0xaffff, 0xbfffe, 0xbffff, 0xcfffe, 0xcffff, 0xdfffe, 0xdffff, 0xe0001, + 0xe0001, 0xe0020, 0xe007f, 0xe0100, 0xe01ef, 0xefffe, 0x10ffff, +}; /* CR_Age_5_2 */ + +/* 'Age_6_0': Derived Age 6.0 */ +static const OnigCodePoint CR_Age_6_0[] = { + 511, 0x0000, 0x0377, 0x037a, 0x037e, 0x0384, 0x038a, 0x038c, + 0x038c, 0x038e, 0x03a1, 0x03a3, 0x0527, 0x0531, 0x0556, 0x0559, + 0x055f, 0x0561, 0x0587, 0x0589, 0x058a, 0x0591, 0x05c7, 0x05d0, + 0x05ea, 0x05f0, 0x05f4, 0x0600, 0x0603, 0x0606, 0x061b, 0x061e, + 0x070d, 0x070f, 0x074a, 0x074d, 0x07b1, 0x07c0, 0x07fa, 0x0800, + 0x082d, 0x0830, 0x083e, 0x0840, 0x085b, 0x085e, 0x085e, 0x0900, + 0x0977, 0x0979, 0x097f, 0x0981, 0x0983, 0x0985, 0x098c, 0x098f, + 0x0990, 0x0993, 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, + 0x09b9, 0x09bc, 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09ce, 0x09d7, + 0x09d7, 0x09dc, 0x09dd, 0x09df, 0x09e3, 0x09e6, 0x09fb, 0x0a01, + 0x0a03, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, + 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3c, + 0x0a3c, 0x0a3e, 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4d, 0x0a51, + 0x0a51, 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, 0x0a75, 0x0a81, + 0x0a83, 0x0a85, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, + 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, 0x0ac5, 0x0ac7, + 0x0ac9, 0x0acb, 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, 0x0ae3, 0x0ae6, + 0x0aef, 0x0af1, 0x0af1, 0x0b01, 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, + 0x0b10, 0x0b13, 0x0b28, 0x0b2a, 0x0b30, 0x0b32, 0x0b33, 0x0b35, + 0x0b39, 0x0b3c, 0x0b44, 0x0b47, 0x0b48, 0x0b4b, 0x0b4d, 0x0b56, + 0x0b57, 0x0b5c, 0x0b5d, 0x0b5f, 0x0b63, 0x0b66, 0x0b77, 0x0b82, + 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, 0x0b95, 0x0b99, + 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, + 0x0baa, 0x0bae, 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, + 0x0bcd, 0x0bd0, 0x0bd0, 0x0bd7, 0x0bd7, 0x0be6, 0x0bfa, 0x0c01, + 0x0c03, 0x0c05, 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, 0x0c28, 0x0c2a, + 0x0c33, 0x0c35, 0x0c39, 0x0c3d, 0x0c44, 0x0c46, 0x0c48, 0x0c4a, + 0x0c4d, 0x0c55, 0x0c56, 0x0c58, 0x0c59, 0x0c60, 0x0c63, 0x0c66, + 0x0c6f, 0x0c78, 0x0c7f, 0x0c82, 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, + 0x0c90, 0x0c92, 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbc, + 0x0cc4, 0x0cc6, 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, 0x0cd6, 0x0cde, + 0x0cde, 0x0ce0, 0x0ce3, 0x0ce6, 0x0cef, 0x0cf1, 0x0cf2, 0x0d02, + 0x0d03, 0x0d05, 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d3a, 0x0d3d, + 0x0d44, 0x0d46, 0x0d48, 0x0d4a, 0x0d4e, 0x0d57, 0x0d57, 0x0d60, + 0x0d63, 0x0d66, 0x0d75, 0x0d79, 0x0d7f, 0x0d82, 0x0d83, 0x0d85, + 0x0d96, 0x0d9a, 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, + 0x0dc6, 0x0dca, 0x0dca, 0x0dcf, 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, + 0x0ddf, 0x0df2, 0x0df4, 0x0e01, 0x0e3a, 0x0e3f, 0x0e5b, 0x0e81, + 0x0e82, 0x0e84, 0x0e84, 0x0e87, 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, + 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, + 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, + 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, + 0x0ed9, 0x0edc, 0x0edd, 0x0f00, 0x0f47, 0x0f49, 0x0f6c, 0x0f71, + 0x0f97, 0x0f99, 0x0fbc, 0x0fbe, 0x0fcc, 0x0fce, 0x0fda, 0x1000, + 0x10c5, 0x10d0, 0x10fc, 0x1100, 0x1248, 0x124a, 0x124d, 0x1250, + 0x1256, 0x1258, 0x1258, 0x125a, 0x125d, 0x1260, 0x1288, 0x128a, + 0x128d, 0x1290, 0x12b0, 0x12b2, 0x12b5, 0x12b8, 0x12be, 0x12c0, + 0x12c0, 0x12c2, 0x12c5, 0x12c8, 0x12d6, 0x12d8, 0x1310, 0x1312, + 0x1315, 0x1318, 0x135a, 0x135d, 0x137c, 0x1380, 0x1399, 0x13a0, + 0x13f4, 0x1400, 0x169c, 0x16a0, 0x16f0, 0x1700, 0x170c, 0x170e, + 0x1714, 0x1720, 0x1736, 0x1740, 0x1753, 0x1760, 0x176c, 0x176e, + 0x1770, 0x1772, 0x1773, 0x1780, 0x17dd, 0x17e0, 0x17e9, 0x17f0, + 0x17f9, 0x1800, 0x180e, 0x1810, 0x1819, 0x1820, 0x1877, 0x1880, + 0x18aa, 0x18b0, 0x18f5, 0x1900, 0x191c, 0x1920, 0x192b, 0x1930, + 0x193b, 0x1940, 0x1940, 0x1944, 0x196d, 0x1970, 0x1974, 0x1980, + 0x19ab, 0x19b0, 0x19c9, 0x19d0, 0x19da, 0x19de, 0x1a1b, 0x1a1e, + 0x1a5e, 0x1a60, 0x1a7c, 0x1a7f, 0x1a89, 0x1a90, 0x1a99, 0x1aa0, + 0x1aad, 0x1b00, 0x1b4b, 0x1b50, 0x1b7c, 0x1b80, 0x1baa, 0x1bae, + 0x1bb9, 0x1bc0, 0x1bf3, 0x1bfc, 0x1c37, 0x1c3b, 0x1c49, 0x1c4d, + 0x1c7f, 0x1cd0, 0x1cf2, 0x1d00, 0x1de6, 0x1dfc, 0x1f15, 0x1f18, + 0x1f1d, 0x1f20, 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, + 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, + 0x1fb4, 0x1fb6, 0x1fc4, 0x1fc6, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fdd, + 0x1fef, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ffe, 0x2000, 0x2064, 0x206a, + 0x2071, 0x2074, 0x208e, 0x2090, 0x209c, 0x20a0, 0x20b9, 0x20d0, + 0x20f0, 0x2100, 0x2189, 0x2190, 0x23f3, 0x2400, 0x2426, 0x2440, + 0x244a, 0x2460, 0x26ff, 0x2701, 0x27ca, 0x27cc, 0x27cc, 0x27ce, + 0x2b4c, 0x2b50, 0x2b59, 0x2c00, 0x2c2e, 0x2c30, 0x2c5e, 0x2c60, + 0x2cf1, 0x2cf9, 0x2d25, 0x2d30, 0x2d65, 0x2d6f, 0x2d70, 0x2d7f, + 0x2d96, 0x2da0, 0x2da6, 0x2da8, 0x2dae, 0x2db0, 0x2db6, 0x2db8, + 0x2dbe, 0x2dc0, 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, 0x2dd6, 0x2dd8, + 0x2dde, 0x2de0, 0x2e31, 0x2e80, 0x2e99, 0x2e9b, 0x2ef3, 0x2f00, + 0x2fd5, 0x2ff0, 0x2ffb, 0x3000, 0x303f, 0x3041, 0x3096, 0x3099, + 0x30ff, 0x3105, 0x312d, 0x3131, 0x318e, 0x3190, 0x31ba, 0x31c0, + 0x31e3, 0x31f0, 0x321e, 0x3220, 0x32fe, 0x3300, 0x4db5, 0x4dc0, + 0x9fcb, 0xa000, 0xa48c, 0xa490, 0xa4c6, 0xa4d0, 0xa62b, 0xa640, + 0xa673, 0xa67c, 0xa697, 0xa6a0, 0xa6f7, 0xa700, 0xa78e, 0xa790, + 0xa791, 0xa7a0, 0xa7a9, 0xa7fa, 0xa82b, 0xa830, 0xa839, 0xa840, + 0xa877, 0xa880, 0xa8c4, 0xa8ce, 0xa8d9, 0xa8e0, 0xa8fb, 0xa900, + 0xa953, 0xa95f, 0xa97c, 0xa980, 0xa9cd, 0xa9cf, 0xa9d9, 0xa9de, + 0xa9df, 0xaa00, 0xaa36, 0xaa40, 0xaa4d, 0xaa50, 0xaa59, 0xaa5c, + 0xaa7b, 0xaa80, 0xaac2, 0xaadb, 0xaadf, 0xab01, 0xab06, 0xab09, + 0xab0e, 0xab11, 0xab16, 0xab20, 0xab26, 0xab28, 0xab2e, 0xabc0, + 0xabed, 0xabf0, 0xabf9, 0xac00, 0xd7a3, 0xd7b0, 0xd7c6, 0xd7cb, + 0xd7fb, 0xd800, 0xfa2d, 0xfa30, 0xfa6d, 0xfa70, 0xfad9, 0xfb00, + 0xfb06, 0xfb13, 0xfb17, 0xfb1d, 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, + 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, 0xfbc1, 0xfbd3, + 0xfd3f, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdd0, 0xfdfd, 0xfe00, + 0xfe19, 0xfe20, 0xfe26, 0xfe30, 0xfe52, 0xfe54, 0xfe66, 0xfe68, + 0xfe6b, 0xfe70, 0xfe74, 0xfe76, 0xfefc, 0xfeff, 0xfeff, 0xff01, + 0xffbe, 0xffc2, 0xffc7, 0xffca, 0xffcf, 0xffd2, 0xffd7, 0xffda, + 0xffdc, 0xffe0, 0xffe6, 0xffe8, 0xffee, 0xfff9, 0x1000b, 0x1000d, + 0x10026, 0x10028, 0x1003a, 0x1003c, 0x1003d, 0x1003f, 0x1004d, 0x10050, + 0x1005d, 0x10080, 0x100fa, 0x10100, 0x10102, 0x10107, 0x10133, 0x10137, + 0x1018a, 0x10190, 0x1019b, 0x101d0, 0x101fd, 0x10280, 0x1029c, 0x102a0, + 0x102d0, 0x10300, 0x1031e, 0x10320, 0x10323, 0x10330, 0x1034a, 0x10380, + 0x1039d, 0x1039f, 0x103c3, 0x103c8, 0x103d5, 0x10400, 0x1049d, 0x104a0, + 0x104a9, 0x10800, 0x10805, 0x10808, 0x10808, 0x1080a, 0x10835, 0x10837, + 0x10838, 0x1083c, 0x1083c, 0x1083f, 0x10855, 0x10857, 0x1085f, 0x10900, + 0x1091b, 0x1091f, 0x10939, 0x1093f, 0x1093f, 0x10a00, 0x10a03, 0x10a05, + 0x10a06, 0x10a0c, 0x10a13, 0x10a15, 0x10a17, 0x10a19, 0x10a33, 0x10a38, + 0x10a3a, 0x10a3f, 0x10a47, 0x10a50, 0x10a58, 0x10a60, 0x10a7f, 0x10b00, + 0x10b35, 0x10b39, 0x10b55, 0x10b58, 0x10b72, 0x10b78, 0x10b7f, 0x10c00, + 0x10c48, 0x10e60, 0x10e7e, 0x11000, 0x1104d, 0x11052, 0x1106f, 0x11080, + 0x110c1, 0x12000, 0x1236e, 0x12400, 0x12462, 0x12470, 0x12473, 0x13000, + 0x1342e, 0x16800, 0x16a38, 0x1b000, 0x1b001, 0x1d000, 0x1d0f5, 0x1d100, + 0x1d126, 0x1d129, 0x1d1dd, 0x1d200, 0x1d245, 0x1d300, 0x1d356, 0x1d360, + 0x1d371, 0x1d400, 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, + 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, + 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, + 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, + 0x1d544, 0x1d546, 0x1d546, 0x1d54a, 0x1d550, 0x1d552, 0x1d6a5, 0x1d6a8, + 0x1d7cb, 0x1d7ce, 0x1d7ff, 0x1f000, 0x1f02b, 0x1f030, 0x1f093, 0x1f0a0, + 0x1f0ae, 0x1f0b1, 0x1f0be, 0x1f0c1, 0x1f0cf, 0x1f0d1, 0x1f0df, 0x1f100, + 0x1f10a, 0x1f110, 0x1f12e, 0x1f130, 0x1f169, 0x1f170, 0x1f19a, 0x1f1e6, + 0x1f202, 0x1f210, 0x1f23a, 0x1f240, 0x1f248, 0x1f250, 0x1f251, 0x1f300, + 0x1f320, 0x1f330, 0x1f335, 0x1f337, 0x1f37c, 0x1f380, 0x1f393, 0x1f3a0, + 0x1f3c4, 0x1f3c6, 0x1f3ca, 0x1f3e0, 0x1f3f0, 0x1f400, 0x1f43e, 0x1f440, + 0x1f440, 0x1f442, 0x1f4f7, 0x1f4f9, 0x1f4fc, 0x1f500, 0x1f53d, 0x1f550, + 0x1f567, 0x1f5fb, 0x1f5ff, 0x1f601, 0x1f610, 0x1f612, 0x1f614, 0x1f616, + 0x1f616, 0x1f618, 0x1f618, 0x1f61a, 0x1f61a, 0x1f61c, 0x1f61e, 0x1f620, + 0x1f625, 0x1f628, 0x1f62b, 0x1f62d, 0x1f62d, 0x1f630, 0x1f633, 0x1f635, + 0x1f640, 0x1f645, 0x1f64f, 0x1f680, 0x1f6c5, 0x1f700, 0x1f773, 0x1fffe, + 0x2a6d6, 0x2a700, 0x2b734, 0x2b740, 0x2b81d, 0x2f800, 0x2fa1d, 0x2fffe, + 0x2ffff, 0x3fffe, 0x3ffff, 0x4fffe, 0x4ffff, 0x5fffe, 0x5ffff, 0x6fffe, + 0x6ffff, 0x7fffe, 0x7ffff, 0x8fffe, 0x8ffff, 0x9fffe, 0x9ffff, 0xafffe, + 0xaffff, 0xbfffe, 0xbffff, 0xcfffe, 0xcffff, 0xdfffe, 0xdffff, 0xe0001, + 0xe0001, 0xe0020, 0xe007f, 0xe0100, 0xe01ef, 0xefffe, 0x10ffff, +}; /* CR_Age_6_0 */ + +/* 'Age_6_1': Derived Age 6.1 */ +static const OnigCodePoint CR_Age_6_1[] = { + 549, 0x0000, 0x0377, 0x037a, 0x037e, 0x0384, 0x038a, 0x038c, + 0x038c, 0x038e, 0x03a1, 0x03a3, 0x0527, 0x0531, 0x0556, 0x0559, + 0x055f, 0x0561, 0x0587, 0x0589, 0x058a, 0x058f, 0x058f, 0x0591, + 0x05c7, 0x05d0, 0x05ea, 0x05f0, 0x05f4, 0x0600, 0x0604, 0x0606, + 0x061b, 0x061e, 0x070d, 0x070f, 0x074a, 0x074d, 0x07b1, 0x07c0, + 0x07fa, 0x0800, 0x082d, 0x0830, 0x083e, 0x0840, 0x085b, 0x085e, + 0x085e, 0x08a0, 0x08a0, 0x08a2, 0x08ac, 0x08e4, 0x08fe, 0x0900, + 0x0977, 0x0979, 0x097f, 0x0981, 0x0983, 0x0985, 0x098c, 0x098f, + 0x0990, 0x0993, 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, + 0x09b9, 0x09bc, 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09ce, 0x09d7, + 0x09d7, 0x09dc, 0x09dd, 0x09df, 0x09e3, 0x09e6, 0x09fb, 0x0a01, + 0x0a03, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, + 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3c, + 0x0a3c, 0x0a3e, 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4d, 0x0a51, + 0x0a51, 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, 0x0a75, 0x0a81, + 0x0a83, 0x0a85, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, + 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, 0x0ac5, 0x0ac7, + 0x0ac9, 0x0acb, 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, 0x0ae3, 0x0ae6, + 0x0af1, 0x0b01, 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, + 0x0b28, 0x0b2a, 0x0b30, 0x0b32, 0x0b33, 0x0b35, 0x0b39, 0x0b3c, + 0x0b44, 0x0b47, 0x0b48, 0x0b4b, 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, + 0x0b5d, 0x0b5f, 0x0b63, 0x0b66, 0x0b77, 0x0b82, 0x0b83, 0x0b85, + 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, + 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, + 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, 0x0bcd, 0x0bd0, + 0x0bd0, 0x0bd7, 0x0bd7, 0x0be6, 0x0bfa, 0x0c01, 0x0c03, 0x0c05, + 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, 0x0c28, 0x0c2a, 0x0c33, 0x0c35, + 0x0c39, 0x0c3d, 0x0c44, 0x0c46, 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, + 0x0c56, 0x0c58, 0x0c59, 0x0c60, 0x0c63, 0x0c66, 0x0c6f, 0x0c78, + 0x0c7f, 0x0c82, 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, + 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbc, 0x0cc4, 0x0cc6, + 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, + 0x0ce3, 0x0ce6, 0x0cef, 0x0cf1, 0x0cf2, 0x0d02, 0x0d03, 0x0d05, + 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d3a, 0x0d3d, 0x0d44, 0x0d46, + 0x0d48, 0x0d4a, 0x0d4e, 0x0d57, 0x0d57, 0x0d60, 0x0d63, 0x0d66, + 0x0d75, 0x0d79, 0x0d7f, 0x0d82, 0x0d83, 0x0d85, 0x0d96, 0x0d9a, + 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, 0x0dc6, 0x0dca, + 0x0dca, 0x0dcf, 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, 0x0ddf, 0x0df2, + 0x0df4, 0x0e01, 0x0e3a, 0x0e3f, 0x0e5b, 0x0e81, 0x0e82, 0x0e84, + 0x0e84, 0x0e87, 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, + 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, + 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, 0x0ebd, 0x0ec0, + 0x0ec4, 0x0ec6, 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, 0x0ed9, 0x0edc, + 0x0edf, 0x0f00, 0x0f47, 0x0f49, 0x0f6c, 0x0f71, 0x0f97, 0x0f99, + 0x0fbc, 0x0fbe, 0x0fcc, 0x0fce, 0x0fda, 0x1000, 0x10c5, 0x10c7, + 0x10c7, 0x10cd, 0x10cd, 0x10d0, 0x1248, 0x124a, 0x124d, 0x1250, + 0x1256, 0x1258, 0x1258, 0x125a, 0x125d, 0x1260, 0x1288, 0x128a, + 0x128d, 0x1290, 0x12b0, 0x12b2, 0x12b5, 0x12b8, 0x12be, 0x12c0, + 0x12c0, 0x12c2, 0x12c5, 0x12c8, 0x12d6, 0x12d8, 0x1310, 0x1312, + 0x1315, 0x1318, 0x135a, 0x135d, 0x137c, 0x1380, 0x1399, 0x13a0, + 0x13f4, 0x1400, 0x169c, 0x16a0, 0x16f0, 0x1700, 0x170c, 0x170e, + 0x1714, 0x1720, 0x1736, 0x1740, 0x1753, 0x1760, 0x176c, 0x176e, + 0x1770, 0x1772, 0x1773, 0x1780, 0x17dd, 0x17e0, 0x17e9, 0x17f0, + 0x17f9, 0x1800, 0x180e, 0x1810, 0x1819, 0x1820, 0x1877, 0x1880, + 0x18aa, 0x18b0, 0x18f5, 0x1900, 0x191c, 0x1920, 0x192b, 0x1930, + 0x193b, 0x1940, 0x1940, 0x1944, 0x196d, 0x1970, 0x1974, 0x1980, + 0x19ab, 0x19b0, 0x19c9, 0x19d0, 0x19da, 0x19de, 0x1a1b, 0x1a1e, + 0x1a5e, 0x1a60, 0x1a7c, 0x1a7f, 0x1a89, 0x1a90, 0x1a99, 0x1aa0, + 0x1aad, 0x1b00, 0x1b4b, 0x1b50, 0x1b7c, 0x1b80, 0x1bf3, 0x1bfc, + 0x1c37, 0x1c3b, 0x1c49, 0x1c4d, 0x1c7f, 0x1cc0, 0x1cc7, 0x1cd0, + 0x1cf6, 0x1d00, 0x1de6, 0x1dfc, 0x1f15, 0x1f18, 0x1f1d, 0x1f20, + 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, 0x1f59, 0x1f5b, + 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, + 0x1fc4, 0x1fc6, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fdd, 0x1fef, 0x1ff2, + 0x1ff4, 0x1ff6, 0x1ffe, 0x2000, 0x2064, 0x206a, 0x2071, 0x2074, + 0x208e, 0x2090, 0x209c, 0x20a0, 0x20b9, 0x20d0, 0x20f0, 0x2100, + 0x2189, 0x2190, 0x23f3, 0x2400, 0x2426, 0x2440, 0x244a, 0x2460, + 0x26ff, 0x2701, 0x2b4c, 0x2b50, 0x2b59, 0x2c00, 0x2c2e, 0x2c30, + 0x2c5e, 0x2c60, 0x2cf3, 0x2cf9, 0x2d25, 0x2d27, 0x2d27, 0x2d2d, + 0x2d2d, 0x2d30, 0x2d67, 0x2d6f, 0x2d70, 0x2d7f, 0x2d96, 0x2da0, + 0x2da6, 0x2da8, 0x2dae, 0x2db0, 0x2db6, 0x2db8, 0x2dbe, 0x2dc0, + 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, 0x2dd6, 0x2dd8, 0x2dde, 0x2de0, + 0x2e3b, 0x2e80, 0x2e99, 0x2e9b, 0x2ef3, 0x2f00, 0x2fd5, 0x2ff0, + 0x2ffb, 0x3000, 0x303f, 0x3041, 0x3096, 0x3099, 0x30ff, 0x3105, + 0x312d, 0x3131, 0x318e, 0x3190, 0x31ba, 0x31c0, 0x31e3, 0x31f0, + 0x321e, 0x3220, 0x32fe, 0x3300, 0x4db5, 0x4dc0, 0x9fcc, 0xa000, + 0xa48c, 0xa490, 0xa4c6, 0xa4d0, 0xa62b, 0xa640, 0xa697, 0xa69f, + 0xa6f7, 0xa700, 0xa78e, 0xa790, 0xa793, 0xa7a0, 0xa7aa, 0xa7f8, + 0xa82b, 0xa830, 0xa839, 0xa840, 0xa877, 0xa880, 0xa8c4, 0xa8ce, + 0xa8d9, 0xa8e0, 0xa8fb, 0xa900, 0xa953, 0xa95f, 0xa97c, 0xa980, + 0xa9cd, 0xa9cf, 0xa9d9, 0xa9de, 0xa9df, 0xaa00, 0xaa36, 0xaa40, + 0xaa4d, 0xaa50, 0xaa59, 0xaa5c, 0xaa7b, 0xaa80, 0xaac2, 0xaadb, + 0xaaf6, 0xab01, 0xab06, 0xab09, 0xab0e, 0xab11, 0xab16, 0xab20, + 0xab26, 0xab28, 0xab2e, 0xabc0, 0xabed, 0xabf0, 0xabf9, 0xac00, + 0xd7a3, 0xd7b0, 0xd7c6, 0xd7cb, 0xd7fb, 0xd800, 0xfa6d, 0xfa70, + 0xfad9, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xfb1d, 0xfb36, 0xfb38, + 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, + 0xfbc1, 0xfbd3, 0xfd3f, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdd0, + 0xfdfd, 0xfe00, 0xfe19, 0xfe20, 0xfe26, 0xfe30, 0xfe52, 0xfe54, + 0xfe66, 0xfe68, 0xfe6b, 0xfe70, 0xfe74, 0xfe76, 0xfefc, 0xfeff, + 0xfeff, 0xff01, 0xffbe, 0xffc2, 0xffc7, 0xffca, 0xffcf, 0xffd2, + 0xffd7, 0xffda, 0xffdc, 0xffe0, 0xffe6, 0xffe8, 0xffee, 0xfff9, + 0x1000b, 0x1000d, 0x10026, 0x10028, 0x1003a, 0x1003c, 0x1003d, 0x1003f, + 0x1004d, 0x10050, 0x1005d, 0x10080, 0x100fa, 0x10100, 0x10102, 0x10107, + 0x10133, 0x10137, 0x1018a, 0x10190, 0x1019b, 0x101d0, 0x101fd, 0x10280, + 0x1029c, 0x102a0, 0x102d0, 0x10300, 0x1031e, 0x10320, 0x10323, 0x10330, + 0x1034a, 0x10380, 0x1039d, 0x1039f, 0x103c3, 0x103c8, 0x103d5, 0x10400, + 0x1049d, 0x104a0, 0x104a9, 0x10800, 0x10805, 0x10808, 0x10808, 0x1080a, + 0x10835, 0x10837, 0x10838, 0x1083c, 0x1083c, 0x1083f, 0x10855, 0x10857, + 0x1085f, 0x10900, 0x1091b, 0x1091f, 0x10939, 0x1093f, 0x1093f, 0x10980, + 0x109b7, 0x109be, 0x109bf, 0x10a00, 0x10a03, 0x10a05, 0x10a06, 0x10a0c, + 0x10a13, 0x10a15, 0x10a17, 0x10a19, 0x10a33, 0x10a38, 0x10a3a, 0x10a3f, + 0x10a47, 0x10a50, 0x10a58, 0x10a60, 0x10a7f, 0x10b00, 0x10b35, 0x10b39, + 0x10b55, 0x10b58, 0x10b72, 0x10b78, 0x10b7f, 0x10c00, 0x10c48, 0x10e60, + 0x10e7e, 0x11000, 0x1104d, 0x11052, 0x1106f, 0x11080, 0x110c1, 0x110d0, + 0x110e8, 0x110f0, 0x110f9, 0x11100, 0x11134, 0x11136, 0x11143, 0x11180, + 0x111c8, 0x111d0, 0x111d9, 0x11680, 0x116b7, 0x116c0, 0x116c9, 0x12000, + 0x1236e, 0x12400, 0x12462, 0x12470, 0x12473, 0x13000, 0x1342e, 0x16800, + 0x16a38, 0x16f00, 0x16f44, 0x16f50, 0x16f7e, 0x16f8f, 0x16f9f, 0x1b000, + 0x1b001, 0x1d000, 0x1d0f5, 0x1d100, 0x1d126, 0x1d129, 0x1d1dd, 0x1d200, + 0x1d245, 0x1d300, 0x1d356, 0x1d360, 0x1d371, 0x1d400, 0x1d454, 0x1d456, + 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, + 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, + 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, + 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, 0x1d544, 0x1d546, 0x1d546, 0x1d54a, + 0x1d550, 0x1d552, 0x1d6a5, 0x1d6a8, 0x1d7cb, 0x1d7ce, 0x1d7ff, 0x1ee00, + 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, 0x1ee22, 0x1ee24, 0x1ee24, 0x1ee27, + 0x1ee27, 0x1ee29, 0x1ee32, 0x1ee34, 0x1ee37, 0x1ee39, 0x1ee39, 0x1ee3b, + 0x1ee3b, 0x1ee42, 0x1ee42, 0x1ee47, 0x1ee47, 0x1ee49, 0x1ee49, 0x1ee4b, + 0x1ee4b, 0x1ee4d, 0x1ee4f, 0x1ee51, 0x1ee52, 0x1ee54, 0x1ee54, 0x1ee57, + 0x1ee57, 0x1ee59, 0x1ee59, 0x1ee5b, 0x1ee5b, 0x1ee5d, 0x1ee5d, 0x1ee5f, + 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, 0x1ee64, 0x1ee67, 0x1ee6a, 0x1ee6c, + 0x1ee72, 0x1ee74, 0x1ee77, 0x1ee79, 0x1ee7c, 0x1ee7e, 0x1ee7e, 0x1ee80, + 0x1ee89, 0x1ee8b, 0x1ee9b, 0x1eea1, 0x1eea3, 0x1eea5, 0x1eea9, 0x1eeab, + 0x1eebb, 0x1eef0, 0x1eef1, 0x1f000, 0x1f02b, 0x1f030, 0x1f093, 0x1f0a0, + 0x1f0ae, 0x1f0b1, 0x1f0be, 0x1f0c1, 0x1f0cf, 0x1f0d1, 0x1f0df, 0x1f100, + 0x1f10a, 0x1f110, 0x1f12e, 0x1f130, 0x1f16b, 0x1f170, 0x1f19a, 0x1f1e6, + 0x1f202, 0x1f210, 0x1f23a, 0x1f240, 0x1f248, 0x1f250, 0x1f251, 0x1f300, + 0x1f320, 0x1f330, 0x1f335, 0x1f337, 0x1f37c, 0x1f380, 0x1f393, 0x1f3a0, + 0x1f3c4, 0x1f3c6, 0x1f3ca, 0x1f3e0, 0x1f3f0, 0x1f400, 0x1f43e, 0x1f440, + 0x1f440, 0x1f442, 0x1f4f7, 0x1f4f9, 0x1f4fc, 0x1f500, 0x1f53d, 0x1f540, + 0x1f543, 0x1f550, 0x1f567, 0x1f5fb, 0x1f640, 0x1f645, 0x1f64f, 0x1f680, + 0x1f6c5, 0x1f700, 0x1f773, 0x1fffe, 0x2a6d6, 0x2a700, 0x2b734, 0x2b740, + 0x2b81d, 0x2f800, 0x2fa1d, 0x2fffe, 0x2ffff, 0x3fffe, 0x3ffff, 0x4fffe, + 0x4ffff, 0x5fffe, 0x5ffff, 0x6fffe, 0x6ffff, 0x7fffe, 0x7ffff, 0x8fffe, + 0x8ffff, 0x9fffe, 0x9ffff, 0xafffe, 0xaffff, 0xbfffe, 0xbffff, 0xcfffe, + 0xcffff, 0xdfffe, 0xdffff, 0xe0001, 0xe0001, 0xe0020, 0xe007f, 0xe0100, + 0xe01ef, 0xefffe, 0x10ffff, +}; /* CR_Age_6_1 */ + +/* 'Age_6_2': Derived Age 6.2 */ +static const OnigCodePoint CR_Age_6_2[] = { + 549, 0x0000, 0x0377, 0x037a, 0x037e, 0x0384, 0x038a, 0x038c, + 0x038c, 0x038e, 0x03a1, 0x03a3, 0x0527, 0x0531, 0x0556, 0x0559, + 0x055f, 0x0561, 0x0587, 0x0589, 0x058a, 0x058f, 0x058f, 0x0591, + 0x05c7, 0x05d0, 0x05ea, 0x05f0, 0x05f4, 0x0600, 0x0604, 0x0606, + 0x061b, 0x061e, 0x070d, 0x070f, 0x074a, 0x074d, 0x07b1, 0x07c0, + 0x07fa, 0x0800, 0x082d, 0x0830, 0x083e, 0x0840, 0x085b, 0x085e, + 0x085e, 0x08a0, 0x08a0, 0x08a2, 0x08ac, 0x08e4, 0x08fe, 0x0900, + 0x0977, 0x0979, 0x097f, 0x0981, 0x0983, 0x0985, 0x098c, 0x098f, + 0x0990, 0x0993, 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, + 0x09b9, 0x09bc, 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09ce, 0x09d7, + 0x09d7, 0x09dc, 0x09dd, 0x09df, 0x09e3, 0x09e6, 0x09fb, 0x0a01, + 0x0a03, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, + 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3c, + 0x0a3c, 0x0a3e, 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4d, 0x0a51, + 0x0a51, 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, 0x0a75, 0x0a81, + 0x0a83, 0x0a85, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, + 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, 0x0ac5, 0x0ac7, + 0x0ac9, 0x0acb, 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, 0x0ae3, 0x0ae6, + 0x0af1, 0x0b01, 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, + 0x0b28, 0x0b2a, 0x0b30, 0x0b32, 0x0b33, 0x0b35, 0x0b39, 0x0b3c, + 0x0b44, 0x0b47, 0x0b48, 0x0b4b, 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, + 0x0b5d, 0x0b5f, 0x0b63, 0x0b66, 0x0b77, 0x0b82, 0x0b83, 0x0b85, + 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, + 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, + 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, 0x0bcd, 0x0bd0, + 0x0bd0, 0x0bd7, 0x0bd7, 0x0be6, 0x0bfa, 0x0c01, 0x0c03, 0x0c05, + 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, 0x0c28, 0x0c2a, 0x0c33, 0x0c35, + 0x0c39, 0x0c3d, 0x0c44, 0x0c46, 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, + 0x0c56, 0x0c58, 0x0c59, 0x0c60, 0x0c63, 0x0c66, 0x0c6f, 0x0c78, + 0x0c7f, 0x0c82, 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, + 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbc, 0x0cc4, 0x0cc6, + 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, + 0x0ce3, 0x0ce6, 0x0cef, 0x0cf1, 0x0cf2, 0x0d02, 0x0d03, 0x0d05, + 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d3a, 0x0d3d, 0x0d44, 0x0d46, + 0x0d48, 0x0d4a, 0x0d4e, 0x0d57, 0x0d57, 0x0d60, 0x0d63, 0x0d66, + 0x0d75, 0x0d79, 0x0d7f, 0x0d82, 0x0d83, 0x0d85, 0x0d96, 0x0d9a, + 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, 0x0dc6, 0x0dca, + 0x0dca, 0x0dcf, 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, 0x0ddf, 0x0df2, + 0x0df4, 0x0e01, 0x0e3a, 0x0e3f, 0x0e5b, 0x0e81, 0x0e82, 0x0e84, + 0x0e84, 0x0e87, 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, + 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, + 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, 0x0ebd, 0x0ec0, + 0x0ec4, 0x0ec6, 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, 0x0ed9, 0x0edc, + 0x0edf, 0x0f00, 0x0f47, 0x0f49, 0x0f6c, 0x0f71, 0x0f97, 0x0f99, + 0x0fbc, 0x0fbe, 0x0fcc, 0x0fce, 0x0fda, 0x1000, 0x10c5, 0x10c7, + 0x10c7, 0x10cd, 0x10cd, 0x10d0, 0x1248, 0x124a, 0x124d, 0x1250, + 0x1256, 0x1258, 0x1258, 0x125a, 0x125d, 0x1260, 0x1288, 0x128a, + 0x128d, 0x1290, 0x12b0, 0x12b2, 0x12b5, 0x12b8, 0x12be, 0x12c0, + 0x12c0, 0x12c2, 0x12c5, 0x12c8, 0x12d6, 0x12d8, 0x1310, 0x1312, + 0x1315, 0x1318, 0x135a, 0x135d, 0x137c, 0x1380, 0x1399, 0x13a0, + 0x13f4, 0x1400, 0x169c, 0x16a0, 0x16f0, 0x1700, 0x170c, 0x170e, + 0x1714, 0x1720, 0x1736, 0x1740, 0x1753, 0x1760, 0x176c, 0x176e, + 0x1770, 0x1772, 0x1773, 0x1780, 0x17dd, 0x17e0, 0x17e9, 0x17f0, + 0x17f9, 0x1800, 0x180e, 0x1810, 0x1819, 0x1820, 0x1877, 0x1880, + 0x18aa, 0x18b0, 0x18f5, 0x1900, 0x191c, 0x1920, 0x192b, 0x1930, + 0x193b, 0x1940, 0x1940, 0x1944, 0x196d, 0x1970, 0x1974, 0x1980, + 0x19ab, 0x19b0, 0x19c9, 0x19d0, 0x19da, 0x19de, 0x1a1b, 0x1a1e, + 0x1a5e, 0x1a60, 0x1a7c, 0x1a7f, 0x1a89, 0x1a90, 0x1a99, 0x1aa0, + 0x1aad, 0x1b00, 0x1b4b, 0x1b50, 0x1b7c, 0x1b80, 0x1bf3, 0x1bfc, + 0x1c37, 0x1c3b, 0x1c49, 0x1c4d, 0x1c7f, 0x1cc0, 0x1cc7, 0x1cd0, + 0x1cf6, 0x1d00, 0x1de6, 0x1dfc, 0x1f15, 0x1f18, 0x1f1d, 0x1f20, + 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, 0x1f59, 0x1f5b, + 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, + 0x1fc4, 0x1fc6, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fdd, 0x1fef, 0x1ff2, + 0x1ff4, 0x1ff6, 0x1ffe, 0x2000, 0x2064, 0x206a, 0x2071, 0x2074, + 0x208e, 0x2090, 0x209c, 0x20a0, 0x20ba, 0x20d0, 0x20f0, 0x2100, + 0x2189, 0x2190, 0x23f3, 0x2400, 0x2426, 0x2440, 0x244a, 0x2460, + 0x26ff, 0x2701, 0x2b4c, 0x2b50, 0x2b59, 0x2c00, 0x2c2e, 0x2c30, + 0x2c5e, 0x2c60, 0x2cf3, 0x2cf9, 0x2d25, 0x2d27, 0x2d27, 0x2d2d, + 0x2d2d, 0x2d30, 0x2d67, 0x2d6f, 0x2d70, 0x2d7f, 0x2d96, 0x2da0, + 0x2da6, 0x2da8, 0x2dae, 0x2db0, 0x2db6, 0x2db8, 0x2dbe, 0x2dc0, + 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, 0x2dd6, 0x2dd8, 0x2dde, 0x2de0, + 0x2e3b, 0x2e80, 0x2e99, 0x2e9b, 0x2ef3, 0x2f00, 0x2fd5, 0x2ff0, + 0x2ffb, 0x3000, 0x303f, 0x3041, 0x3096, 0x3099, 0x30ff, 0x3105, + 0x312d, 0x3131, 0x318e, 0x3190, 0x31ba, 0x31c0, 0x31e3, 0x31f0, + 0x321e, 0x3220, 0x32fe, 0x3300, 0x4db5, 0x4dc0, 0x9fcc, 0xa000, + 0xa48c, 0xa490, 0xa4c6, 0xa4d0, 0xa62b, 0xa640, 0xa697, 0xa69f, + 0xa6f7, 0xa700, 0xa78e, 0xa790, 0xa793, 0xa7a0, 0xa7aa, 0xa7f8, + 0xa82b, 0xa830, 0xa839, 0xa840, 0xa877, 0xa880, 0xa8c4, 0xa8ce, + 0xa8d9, 0xa8e0, 0xa8fb, 0xa900, 0xa953, 0xa95f, 0xa97c, 0xa980, + 0xa9cd, 0xa9cf, 0xa9d9, 0xa9de, 0xa9df, 0xaa00, 0xaa36, 0xaa40, + 0xaa4d, 0xaa50, 0xaa59, 0xaa5c, 0xaa7b, 0xaa80, 0xaac2, 0xaadb, + 0xaaf6, 0xab01, 0xab06, 0xab09, 0xab0e, 0xab11, 0xab16, 0xab20, + 0xab26, 0xab28, 0xab2e, 0xabc0, 0xabed, 0xabf0, 0xabf9, 0xac00, + 0xd7a3, 0xd7b0, 0xd7c6, 0xd7cb, 0xd7fb, 0xd800, 0xfa6d, 0xfa70, + 0xfad9, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xfb1d, 0xfb36, 0xfb38, + 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, + 0xfbc1, 0xfbd3, 0xfd3f, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdd0, + 0xfdfd, 0xfe00, 0xfe19, 0xfe20, 0xfe26, 0xfe30, 0xfe52, 0xfe54, + 0xfe66, 0xfe68, 0xfe6b, 0xfe70, 0xfe74, 0xfe76, 0xfefc, 0xfeff, + 0xfeff, 0xff01, 0xffbe, 0xffc2, 0xffc7, 0xffca, 0xffcf, 0xffd2, + 0xffd7, 0xffda, 0xffdc, 0xffe0, 0xffe6, 0xffe8, 0xffee, 0xfff9, + 0x1000b, 0x1000d, 0x10026, 0x10028, 0x1003a, 0x1003c, 0x1003d, 0x1003f, + 0x1004d, 0x10050, 0x1005d, 0x10080, 0x100fa, 0x10100, 0x10102, 0x10107, + 0x10133, 0x10137, 0x1018a, 0x10190, 0x1019b, 0x101d0, 0x101fd, 0x10280, + 0x1029c, 0x102a0, 0x102d0, 0x10300, 0x1031e, 0x10320, 0x10323, 0x10330, + 0x1034a, 0x10380, 0x1039d, 0x1039f, 0x103c3, 0x103c8, 0x103d5, 0x10400, + 0x1049d, 0x104a0, 0x104a9, 0x10800, 0x10805, 0x10808, 0x10808, 0x1080a, + 0x10835, 0x10837, 0x10838, 0x1083c, 0x1083c, 0x1083f, 0x10855, 0x10857, + 0x1085f, 0x10900, 0x1091b, 0x1091f, 0x10939, 0x1093f, 0x1093f, 0x10980, + 0x109b7, 0x109be, 0x109bf, 0x10a00, 0x10a03, 0x10a05, 0x10a06, 0x10a0c, + 0x10a13, 0x10a15, 0x10a17, 0x10a19, 0x10a33, 0x10a38, 0x10a3a, 0x10a3f, + 0x10a47, 0x10a50, 0x10a58, 0x10a60, 0x10a7f, 0x10b00, 0x10b35, 0x10b39, + 0x10b55, 0x10b58, 0x10b72, 0x10b78, 0x10b7f, 0x10c00, 0x10c48, 0x10e60, + 0x10e7e, 0x11000, 0x1104d, 0x11052, 0x1106f, 0x11080, 0x110c1, 0x110d0, + 0x110e8, 0x110f0, 0x110f9, 0x11100, 0x11134, 0x11136, 0x11143, 0x11180, + 0x111c8, 0x111d0, 0x111d9, 0x11680, 0x116b7, 0x116c0, 0x116c9, 0x12000, + 0x1236e, 0x12400, 0x12462, 0x12470, 0x12473, 0x13000, 0x1342e, 0x16800, + 0x16a38, 0x16f00, 0x16f44, 0x16f50, 0x16f7e, 0x16f8f, 0x16f9f, 0x1b000, + 0x1b001, 0x1d000, 0x1d0f5, 0x1d100, 0x1d126, 0x1d129, 0x1d1dd, 0x1d200, + 0x1d245, 0x1d300, 0x1d356, 0x1d360, 0x1d371, 0x1d400, 0x1d454, 0x1d456, + 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, + 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, + 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, + 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, 0x1d544, 0x1d546, 0x1d546, 0x1d54a, + 0x1d550, 0x1d552, 0x1d6a5, 0x1d6a8, 0x1d7cb, 0x1d7ce, 0x1d7ff, 0x1ee00, + 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, 0x1ee22, 0x1ee24, 0x1ee24, 0x1ee27, + 0x1ee27, 0x1ee29, 0x1ee32, 0x1ee34, 0x1ee37, 0x1ee39, 0x1ee39, 0x1ee3b, + 0x1ee3b, 0x1ee42, 0x1ee42, 0x1ee47, 0x1ee47, 0x1ee49, 0x1ee49, 0x1ee4b, + 0x1ee4b, 0x1ee4d, 0x1ee4f, 0x1ee51, 0x1ee52, 0x1ee54, 0x1ee54, 0x1ee57, + 0x1ee57, 0x1ee59, 0x1ee59, 0x1ee5b, 0x1ee5b, 0x1ee5d, 0x1ee5d, 0x1ee5f, + 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, 0x1ee64, 0x1ee67, 0x1ee6a, 0x1ee6c, + 0x1ee72, 0x1ee74, 0x1ee77, 0x1ee79, 0x1ee7c, 0x1ee7e, 0x1ee7e, 0x1ee80, + 0x1ee89, 0x1ee8b, 0x1ee9b, 0x1eea1, 0x1eea3, 0x1eea5, 0x1eea9, 0x1eeab, + 0x1eebb, 0x1eef0, 0x1eef1, 0x1f000, 0x1f02b, 0x1f030, 0x1f093, 0x1f0a0, + 0x1f0ae, 0x1f0b1, 0x1f0be, 0x1f0c1, 0x1f0cf, 0x1f0d1, 0x1f0df, 0x1f100, + 0x1f10a, 0x1f110, 0x1f12e, 0x1f130, 0x1f16b, 0x1f170, 0x1f19a, 0x1f1e6, + 0x1f202, 0x1f210, 0x1f23a, 0x1f240, 0x1f248, 0x1f250, 0x1f251, 0x1f300, + 0x1f320, 0x1f330, 0x1f335, 0x1f337, 0x1f37c, 0x1f380, 0x1f393, 0x1f3a0, + 0x1f3c4, 0x1f3c6, 0x1f3ca, 0x1f3e0, 0x1f3f0, 0x1f400, 0x1f43e, 0x1f440, + 0x1f440, 0x1f442, 0x1f4f7, 0x1f4f9, 0x1f4fc, 0x1f500, 0x1f53d, 0x1f540, + 0x1f543, 0x1f550, 0x1f567, 0x1f5fb, 0x1f640, 0x1f645, 0x1f64f, 0x1f680, + 0x1f6c5, 0x1f700, 0x1f773, 0x1fffe, 0x2a6d6, 0x2a700, 0x2b734, 0x2b740, + 0x2b81d, 0x2f800, 0x2fa1d, 0x2fffe, 0x2ffff, 0x3fffe, 0x3ffff, 0x4fffe, + 0x4ffff, 0x5fffe, 0x5ffff, 0x6fffe, 0x6ffff, 0x7fffe, 0x7ffff, 0x8fffe, + 0x8ffff, 0x9fffe, 0x9ffff, 0xafffe, 0xaffff, 0xbfffe, 0xbffff, 0xcfffe, + 0xcffff, 0xdfffe, 0xdffff, 0xe0001, 0xe0001, 0xe0020, 0xe007f, 0xe0100, + 0xe01ef, 0xefffe, 0x10ffff, +}; /* CR_Age_6_2 */ + +/* 'Age_6_3': Derived Age 6.3 */ +static const OnigCodePoint CR_Age_6_3[] = { + 549, 0x0000, 0x0377, 0x037a, 0x037e, 0x0384, 0x038a, 0x038c, + 0x038c, 0x038e, 0x03a1, 0x03a3, 0x0527, 0x0531, 0x0556, 0x0559, + 0x055f, 0x0561, 0x0587, 0x0589, 0x058a, 0x058f, 0x058f, 0x0591, + 0x05c7, 0x05d0, 0x05ea, 0x05f0, 0x05f4, 0x0600, 0x0604, 0x0606, + 0x061c, 0x061e, 0x070d, 0x070f, 0x074a, 0x074d, 0x07b1, 0x07c0, + 0x07fa, 0x0800, 0x082d, 0x0830, 0x083e, 0x0840, 0x085b, 0x085e, + 0x085e, 0x08a0, 0x08a0, 0x08a2, 0x08ac, 0x08e4, 0x08fe, 0x0900, + 0x0977, 0x0979, 0x097f, 0x0981, 0x0983, 0x0985, 0x098c, 0x098f, + 0x0990, 0x0993, 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, + 0x09b9, 0x09bc, 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09ce, 0x09d7, + 0x09d7, 0x09dc, 0x09dd, 0x09df, 0x09e3, 0x09e6, 0x09fb, 0x0a01, + 0x0a03, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, + 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3c, + 0x0a3c, 0x0a3e, 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4d, 0x0a51, + 0x0a51, 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, 0x0a75, 0x0a81, + 0x0a83, 0x0a85, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, + 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, 0x0ac5, 0x0ac7, + 0x0ac9, 0x0acb, 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, 0x0ae3, 0x0ae6, + 0x0af1, 0x0b01, 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, + 0x0b28, 0x0b2a, 0x0b30, 0x0b32, 0x0b33, 0x0b35, 0x0b39, 0x0b3c, + 0x0b44, 0x0b47, 0x0b48, 0x0b4b, 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, + 0x0b5d, 0x0b5f, 0x0b63, 0x0b66, 0x0b77, 0x0b82, 0x0b83, 0x0b85, + 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, + 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, + 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, 0x0bcd, 0x0bd0, + 0x0bd0, 0x0bd7, 0x0bd7, 0x0be6, 0x0bfa, 0x0c01, 0x0c03, 0x0c05, + 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, 0x0c28, 0x0c2a, 0x0c33, 0x0c35, + 0x0c39, 0x0c3d, 0x0c44, 0x0c46, 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, + 0x0c56, 0x0c58, 0x0c59, 0x0c60, 0x0c63, 0x0c66, 0x0c6f, 0x0c78, + 0x0c7f, 0x0c82, 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, + 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbc, 0x0cc4, 0x0cc6, + 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, + 0x0ce3, 0x0ce6, 0x0cef, 0x0cf1, 0x0cf2, 0x0d02, 0x0d03, 0x0d05, + 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d3a, 0x0d3d, 0x0d44, 0x0d46, + 0x0d48, 0x0d4a, 0x0d4e, 0x0d57, 0x0d57, 0x0d60, 0x0d63, 0x0d66, + 0x0d75, 0x0d79, 0x0d7f, 0x0d82, 0x0d83, 0x0d85, 0x0d96, 0x0d9a, + 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, 0x0dc6, 0x0dca, + 0x0dca, 0x0dcf, 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, 0x0ddf, 0x0df2, + 0x0df4, 0x0e01, 0x0e3a, 0x0e3f, 0x0e5b, 0x0e81, 0x0e82, 0x0e84, + 0x0e84, 0x0e87, 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, + 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, + 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, 0x0ebd, 0x0ec0, + 0x0ec4, 0x0ec6, 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, 0x0ed9, 0x0edc, + 0x0edf, 0x0f00, 0x0f47, 0x0f49, 0x0f6c, 0x0f71, 0x0f97, 0x0f99, + 0x0fbc, 0x0fbe, 0x0fcc, 0x0fce, 0x0fda, 0x1000, 0x10c5, 0x10c7, + 0x10c7, 0x10cd, 0x10cd, 0x10d0, 0x1248, 0x124a, 0x124d, 0x1250, + 0x1256, 0x1258, 0x1258, 0x125a, 0x125d, 0x1260, 0x1288, 0x128a, + 0x128d, 0x1290, 0x12b0, 0x12b2, 0x12b5, 0x12b8, 0x12be, 0x12c0, + 0x12c0, 0x12c2, 0x12c5, 0x12c8, 0x12d6, 0x12d8, 0x1310, 0x1312, + 0x1315, 0x1318, 0x135a, 0x135d, 0x137c, 0x1380, 0x1399, 0x13a0, + 0x13f4, 0x1400, 0x169c, 0x16a0, 0x16f0, 0x1700, 0x170c, 0x170e, + 0x1714, 0x1720, 0x1736, 0x1740, 0x1753, 0x1760, 0x176c, 0x176e, + 0x1770, 0x1772, 0x1773, 0x1780, 0x17dd, 0x17e0, 0x17e9, 0x17f0, + 0x17f9, 0x1800, 0x180e, 0x1810, 0x1819, 0x1820, 0x1877, 0x1880, + 0x18aa, 0x18b0, 0x18f5, 0x1900, 0x191c, 0x1920, 0x192b, 0x1930, + 0x193b, 0x1940, 0x1940, 0x1944, 0x196d, 0x1970, 0x1974, 0x1980, + 0x19ab, 0x19b0, 0x19c9, 0x19d0, 0x19da, 0x19de, 0x1a1b, 0x1a1e, + 0x1a5e, 0x1a60, 0x1a7c, 0x1a7f, 0x1a89, 0x1a90, 0x1a99, 0x1aa0, + 0x1aad, 0x1b00, 0x1b4b, 0x1b50, 0x1b7c, 0x1b80, 0x1bf3, 0x1bfc, + 0x1c37, 0x1c3b, 0x1c49, 0x1c4d, 0x1c7f, 0x1cc0, 0x1cc7, 0x1cd0, + 0x1cf6, 0x1d00, 0x1de6, 0x1dfc, 0x1f15, 0x1f18, 0x1f1d, 0x1f20, + 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, 0x1f59, 0x1f5b, + 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, + 0x1fc4, 0x1fc6, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fdd, 0x1fef, 0x1ff2, + 0x1ff4, 0x1ff6, 0x1ffe, 0x2000, 0x2064, 0x2066, 0x2071, 0x2074, + 0x208e, 0x2090, 0x209c, 0x20a0, 0x20ba, 0x20d0, 0x20f0, 0x2100, + 0x2189, 0x2190, 0x23f3, 0x2400, 0x2426, 0x2440, 0x244a, 0x2460, + 0x26ff, 0x2701, 0x2b4c, 0x2b50, 0x2b59, 0x2c00, 0x2c2e, 0x2c30, + 0x2c5e, 0x2c60, 0x2cf3, 0x2cf9, 0x2d25, 0x2d27, 0x2d27, 0x2d2d, + 0x2d2d, 0x2d30, 0x2d67, 0x2d6f, 0x2d70, 0x2d7f, 0x2d96, 0x2da0, + 0x2da6, 0x2da8, 0x2dae, 0x2db0, 0x2db6, 0x2db8, 0x2dbe, 0x2dc0, + 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, 0x2dd6, 0x2dd8, 0x2dde, 0x2de0, + 0x2e3b, 0x2e80, 0x2e99, 0x2e9b, 0x2ef3, 0x2f00, 0x2fd5, 0x2ff0, + 0x2ffb, 0x3000, 0x303f, 0x3041, 0x3096, 0x3099, 0x30ff, 0x3105, + 0x312d, 0x3131, 0x318e, 0x3190, 0x31ba, 0x31c0, 0x31e3, 0x31f0, + 0x321e, 0x3220, 0x32fe, 0x3300, 0x4db5, 0x4dc0, 0x9fcc, 0xa000, + 0xa48c, 0xa490, 0xa4c6, 0xa4d0, 0xa62b, 0xa640, 0xa697, 0xa69f, + 0xa6f7, 0xa700, 0xa78e, 0xa790, 0xa793, 0xa7a0, 0xa7aa, 0xa7f8, + 0xa82b, 0xa830, 0xa839, 0xa840, 0xa877, 0xa880, 0xa8c4, 0xa8ce, + 0xa8d9, 0xa8e0, 0xa8fb, 0xa900, 0xa953, 0xa95f, 0xa97c, 0xa980, + 0xa9cd, 0xa9cf, 0xa9d9, 0xa9de, 0xa9df, 0xaa00, 0xaa36, 0xaa40, + 0xaa4d, 0xaa50, 0xaa59, 0xaa5c, 0xaa7b, 0xaa80, 0xaac2, 0xaadb, + 0xaaf6, 0xab01, 0xab06, 0xab09, 0xab0e, 0xab11, 0xab16, 0xab20, + 0xab26, 0xab28, 0xab2e, 0xabc0, 0xabed, 0xabf0, 0xabf9, 0xac00, + 0xd7a3, 0xd7b0, 0xd7c6, 0xd7cb, 0xd7fb, 0xd800, 0xfa6d, 0xfa70, + 0xfad9, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xfb1d, 0xfb36, 0xfb38, + 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, + 0xfbc1, 0xfbd3, 0xfd3f, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdd0, + 0xfdfd, 0xfe00, 0xfe19, 0xfe20, 0xfe26, 0xfe30, 0xfe52, 0xfe54, + 0xfe66, 0xfe68, 0xfe6b, 0xfe70, 0xfe74, 0xfe76, 0xfefc, 0xfeff, + 0xfeff, 0xff01, 0xffbe, 0xffc2, 0xffc7, 0xffca, 0xffcf, 0xffd2, + 0xffd7, 0xffda, 0xffdc, 0xffe0, 0xffe6, 0xffe8, 0xffee, 0xfff9, + 0x1000b, 0x1000d, 0x10026, 0x10028, 0x1003a, 0x1003c, 0x1003d, 0x1003f, + 0x1004d, 0x10050, 0x1005d, 0x10080, 0x100fa, 0x10100, 0x10102, 0x10107, + 0x10133, 0x10137, 0x1018a, 0x10190, 0x1019b, 0x101d0, 0x101fd, 0x10280, + 0x1029c, 0x102a0, 0x102d0, 0x10300, 0x1031e, 0x10320, 0x10323, 0x10330, + 0x1034a, 0x10380, 0x1039d, 0x1039f, 0x103c3, 0x103c8, 0x103d5, 0x10400, + 0x1049d, 0x104a0, 0x104a9, 0x10800, 0x10805, 0x10808, 0x10808, 0x1080a, + 0x10835, 0x10837, 0x10838, 0x1083c, 0x1083c, 0x1083f, 0x10855, 0x10857, + 0x1085f, 0x10900, 0x1091b, 0x1091f, 0x10939, 0x1093f, 0x1093f, 0x10980, + 0x109b7, 0x109be, 0x109bf, 0x10a00, 0x10a03, 0x10a05, 0x10a06, 0x10a0c, + 0x10a13, 0x10a15, 0x10a17, 0x10a19, 0x10a33, 0x10a38, 0x10a3a, 0x10a3f, + 0x10a47, 0x10a50, 0x10a58, 0x10a60, 0x10a7f, 0x10b00, 0x10b35, 0x10b39, + 0x10b55, 0x10b58, 0x10b72, 0x10b78, 0x10b7f, 0x10c00, 0x10c48, 0x10e60, + 0x10e7e, 0x11000, 0x1104d, 0x11052, 0x1106f, 0x11080, 0x110c1, 0x110d0, + 0x110e8, 0x110f0, 0x110f9, 0x11100, 0x11134, 0x11136, 0x11143, 0x11180, + 0x111c8, 0x111d0, 0x111d9, 0x11680, 0x116b7, 0x116c0, 0x116c9, 0x12000, + 0x1236e, 0x12400, 0x12462, 0x12470, 0x12473, 0x13000, 0x1342e, 0x16800, + 0x16a38, 0x16f00, 0x16f44, 0x16f50, 0x16f7e, 0x16f8f, 0x16f9f, 0x1b000, + 0x1b001, 0x1d000, 0x1d0f5, 0x1d100, 0x1d126, 0x1d129, 0x1d1dd, 0x1d200, + 0x1d245, 0x1d300, 0x1d356, 0x1d360, 0x1d371, 0x1d400, 0x1d454, 0x1d456, + 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, + 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, + 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, + 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, 0x1d544, 0x1d546, 0x1d546, 0x1d54a, + 0x1d550, 0x1d552, 0x1d6a5, 0x1d6a8, 0x1d7cb, 0x1d7ce, 0x1d7ff, 0x1ee00, + 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, 0x1ee22, 0x1ee24, 0x1ee24, 0x1ee27, + 0x1ee27, 0x1ee29, 0x1ee32, 0x1ee34, 0x1ee37, 0x1ee39, 0x1ee39, 0x1ee3b, + 0x1ee3b, 0x1ee42, 0x1ee42, 0x1ee47, 0x1ee47, 0x1ee49, 0x1ee49, 0x1ee4b, + 0x1ee4b, 0x1ee4d, 0x1ee4f, 0x1ee51, 0x1ee52, 0x1ee54, 0x1ee54, 0x1ee57, + 0x1ee57, 0x1ee59, 0x1ee59, 0x1ee5b, 0x1ee5b, 0x1ee5d, 0x1ee5d, 0x1ee5f, + 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, 0x1ee64, 0x1ee67, 0x1ee6a, 0x1ee6c, + 0x1ee72, 0x1ee74, 0x1ee77, 0x1ee79, 0x1ee7c, 0x1ee7e, 0x1ee7e, 0x1ee80, + 0x1ee89, 0x1ee8b, 0x1ee9b, 0x1eea1, 0x1eea3, 0x1eea5, 0x1eea9, 0x1eeab, + 0x1eebb, 0x1eef0, 0x1eef1, 0x1f000, 0x1f02b, 0x1f030, 0x1f093, 0x1f0a0, + 0x1f0ae, 0x1f0b1, 0x1f0be, 0x1f0c1, 0x1f0cf, 0x1f0d1, 0x1f0df, 0x1f100, + 0x1f10a, 0x1f110, 0x1f12e, 0x1f130, 0x1f16b, 0x1f170, 0x1f19a, 0x1f1e6, + 0x1f202, 0x1f210, 0x1f23a, 0x1f240, 0x1f248, 0x1f250, 0x1f251, 0x1f300, + 0x1f320, 0x1f330, 0x1f335, 0x1f337, 0x1f37c, 0x1f380, 0x1f393, 0x1f3a0, + 0x1f3c4, 0x1f3c6, 0x1f3ca, 0x1f3e0, 0x1f3f0, 0x1f400, 0x1f43e, 0x1f440, + 0x1f440, 0x1f442, 0x1f4f7, 0x1f4f9, 0x1f4fc, 0x1f500, 0x1f53d, 0x1f540, + 0x1f543, 0x1f550, 0x1f567, 0x1f5fb, 0x1f640, 0x1f645, 0x1f64f, 0x1f680, + 0x1f6c5, 0x1f700, 0x1f773, 0x1fffe, 0x2a6d6, 0x2a700, 0x2b734, 0x2b740, + 0x2b81d, 0x2f800, 0x2fa1d, 0x2fffe, 0x2ffff, 0x3fffe, 0x3ffff, 0x4fffe, + 0x4ffff, 0x5fffe, 0x5ffff, 0x6fffe, 0x6ffff, 0x7fffe, 0x7ffff, 0x8fffe, + 0x8ffff, 0x9fffe, 0x9ffff, 0xafffe, 0xaffff, 0xbfffe, 0xbffff, 0xcfffe, + 0xcffff, 0xdfffe, 0xdffff, 0xe0001, 0xe0001, 0xe0020, 0xe007f, 0xe0100, + 0xe01ef, 0xefffe, 0x10ffff, +}; /* CR_Age_6_3 */ + +/* 'Age_7_0': Derived Age 7.0 */ +static const OnigCodePoint CR_Age_7_0[] = { + 610, 0x0000, 0x0377, 0x037a, 0x037f, 0x0384, 0x038a, 0x038c, + 0x038c, 0x038e, 0x03a1, 0x03a3, 0x052f, 0x0531, 0x0556, 0x0559, + 0x055f, 0x0561, 0x0587, 0x0589, 0x058a, 0x058d, 0x058f, 0x0591, + 0x05c7, 0x05d0, 0x05ea, 0x05f0, 0x05f4, 0x0600, 0x061c, 0x061e, + 0x070d, 0x070f, 0x074a, 0x074d, 0x07b1, 0x07c0, 0x07fa, 0x0800, + 0x082d, 0x0830, 0x083e, 0x0840, 0x085b, 0x085e, 0x085e, 0x08a0, + 0x08b2, 0x08e4, 0x0983, 0x0985, 0x098c, 0x098f, 0x0990, 0x0993, + 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, 0x09b9, 0x09bc, + 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09ce, 0x09d7, 0x09d7, 0x09dc, + 0x09dd, 0x09df, 0x09e3, 0x09e6, 0x09fb, 0x0a01, 0x0a03, 0x0a05, + 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, 0x0a30, 0x0a32, + 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3c, 0x0a3c, 0x0a3e, + 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4d, 0x0a51, 0x0a51, 0x0a59, + 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, 0x0a75, 0x0a81, 0x0a83, 0x0a85, + 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, 0x0ab0, 0x0ab2, + 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, 0x0ac5, 0x0ac7, 0x0ac9, 0x0acb, + 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, 0x0ae3, 0x0ae6, 0x0af1, 0x0b01, + 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, 0x0b28, 0x0b2a, + 0x0b30, 0x0b32, 0x0b33, 0x0b35, 0x0b39, 0x0b3c, 0x0b44, 0x0b47, + 0x0b48, 0x0b4b, 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, 0x0b5d, 0x0b5f, + 0x0b63, 0x0b66, 0x0b77, 0x0b82, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, + 0x0b90, 0x0b92, 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, + 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, 0x0bb9, 0x0bbe, + 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, 0x0bcd, 0x0bd0, 0x0bd0, 0x0bd7, + 0x0bd7, 0x0be6, 0x0bfa, 0x0c00, 0x0c03, 0x0c05, 0x0c0c, 0x0c0e, + 0x0c10, 0x0c12, 0x0c28, 0x0c2a, 0x0c39, 0x0c3d, 0x0c44, 0x0c46, + 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, 0x0c56, 0x0c58, 0x0c59, 0x0c60, + 0x0c63, 0x0c66, 0x0c6f, 0x0c78, 0x0c7f, 0x0c81, 0x0c83, 0x0c85, + 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, + 0x0cb9, 0x0cbc, 0x0cc4, 0x0cc6, 0x0cc8, 0x0cca, 0x0ccd, 0x0cd5, + 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, 0x0ce3, 0x0ce6, 0x0cef, 0x0cf1, + 0x0cf2, 0x0d01, 0x0d03, 0x0d05, 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, + 0x0d3a, 0x0d3d, 0x0d44, 0x0d46, 0x0d48, 0x0d4a, 0x0d4e, 0x0d57, + 0x0d57, 0x0d60, 0x0d63, 0x0d66, 0x0d75, 0x0d79, 0x0d7f, 0x0d82, + 0x0d83, 0x0d85, 0x0d96, 0x0d9a, 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, + 0x0dbd, 0x0dc0, 0x0dc6, 0x0dca, 0x0dca, 0x0dcf, 0x0dd4, 0x0dd6, + 0x0dd6, 0x0dd8, 0x0ddf, 0x0de6, 0x0def, 0x0df2, 0x0df4, 0x0e01, + 0x0e3a, 0x0e3f, 0x0e5b, 0x0e81, 0x0e82, 0x0e84, 0x0e84, 0x0e87, + 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, 0x0e97, 0x0e99, + 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, + 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, + 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, 0x0ed9, 0x0edc, 0x0edf, 0x0f00, + 0x0f47, 0x0f49, 0x0f6c, 0x0f71, 0x0f97, 0x0f99, 0x0fbc, 0x0fbe, + 0x0fcc, 0x0fce, 0x0fda, 0x1000, 0x10c5, 0x10c7, 0x10c7, 0x10cd, + 0x10cd, 0x10d0, 0x1248, 0x124a, 0x124d, 0x1250, 0x1256, 0x1258, + 0x1258, 0x125a, 0x125d, 0x1260, 0x1288, 0x128a, 0x128d, 0x1290, + 0x12b0, 0x12b2, 0x12b5, 0x12b8, 0x12be, 0x12c0, 0x12c0, 0x12c2, + 0x12c5, 0x12c8, 0x12d6, 0x12d8, 0x1310, 0x1312, 0x1315, 0x1318, + 0x135a, 0x135d, 0x137c, 0x1380, 0x1399, 0x13a0, 0x13f4, 0x1400, + 0x169c, 0x16a0, 0x16f8, 0x1700, 0x170c, 0x170e, 0x1714, 0x1720, + 0x1736, 0x1740, 0x1753, 0x1760, 0x176c, 0x176e, 0x1770, 0x1772, + 0x1773, 0x1780, 0x17dd, 0x17e0, 0x17e9, 0x17f0, 0x17f9, 0x1800, + 0x180e, 0x1810, 0x1819, 0x1820, 0x1877, 0x1880, 0x18aa, 0x18b0, + 0x18f5, 0x1900, 0x191e, 0x1920, 0x192b, 0x1930, 0x193b, 0x1940, + 0x1940, 0x1944, 0x196d, 0x1970, 0x1974, 0x1980, 0x19ab, 0x19b0, + 0x19c9, 0x19d0, 0x19da, 0x19de, 0x1a1b, 0x1a1e, 0x1a5e, 0x1a60, + 0x1a7c, 0x1a7f, 0x1a89, 0x1a90, 0x1a99, 0x1aa0, 0x1aad, 0x1ab0, + 0x1abe, 0x1b00, 0x1b4b, 0x1b50, 0x1b7c, 0x1b80, 0x1bf3, 0x1bfc, + 0x1c37, 0x1c3b, 0x1c49, 0x1c4d, 0x1c7f, 0x1cc0, 0x1cc7, 0x1cd0, + 0x1cf6, 0x1cf8, 0x1cf9, 0x1d00, 0x1df5, 0x1dfc, 0x1f15, 0x1f18, + 0x1f1d, 0x1f20, 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, + 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, + 0x1fb4, 0x1fb6, 0x1fc4, 0x1fc6, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fdd, + 0x1fef, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ffe, 0x2000, 0x2064, 0x2066, + 0x2071, 0x2074, 0x208e, 0x2090, 0x209c, 0x20a0, 0x20bd, 0x20d0, + 0x20f0, 0x2100, 0x2189, 0x2190, 0x23fa, 0x2400, 0x2426, 0x2440, + 0x244a, 0x2460, 0x2b73, 0x2b76, 0x2b95, 0x2b98, 0x2bb9, 0x2bbd, + 0x2bc8, 0x2bca, 0x2bd1, 0x2c00, 0x2c2e, 0x2c30, 0x2c5e, 0x2c60, + 0x2cf3, 0x2cf9, 0x2d25, 0x2d27, 0x2d27, 0x2d2d, 0x2d2d, 0x2d30, + 0x2d67, 0x2d6f, 0x2d70, 0x2d7f, 0x2d96, 0x2da0, 0x2da6, 0x2da8, + 0x2dae, 0x2db0, 0x2db6, 0x2db8, 0x2dbe, 0x2dc0, 0x2dc6, 0x2dc8, + 0x2dce, 0x2dd0, 0x2dd6, 0x2dd8, 0x2dde, 0x2de0, 0x2e42, 0x2e80, + 0x2e99, 0x2e9b, 0x2ef3, 0x2f00, 0x2fd5, 0x2ff0, 0x2ffb, 0x3000, + 0x303f, 0x3041, 0x3096, 0x3099, 0x30ff, 0x3105, 0x312d, 0x3131, + 0x318e, 0x3190, 0x31ba, 0x31c0, 0x31e3, 0x31f0, 0x321e, 0x3220, + 0x32fe, 0x3300, 0x4db5, 0x4dc0, 0x9fcc, 0xa000, 0xa48c, 0xa490, + 0xa4c6, 0xa4d0, 0xa62b, 0xa640, 0xa69d, 0xa69f, 0xa6f7, 0xa700, + 0xa78e, 0xa790, 0xa7ad, 0xa7b0, 0xa7b1, 0xa7f7, 0xa82b, 0xa830, + 0xa839, 0xa840, 0xa877, 0xa880, 0xa8c4, 0xa8ce, 0xa8d9, 0xa8e0, + 0xa8fb, 0xa900, 0xa953, 0xa95f, 0xa97c, 0xa980, 0xa9cd, 0xa9cf, + 0xa9d9, 0xa9de, 0xa9fe, 0xaa00, 0xaa36, 0xaa40, 0xaa4d, 0xaa50, + 0xaa59, 0xaa5c, 0xaac2, 0xaadb, 0xaaf6, 0xab01, 0xab06, 0xab09, + 0xab0e, 0xab11, 0xab16, 0xab20, 0xab26, 0xab28, 0xab2e, 0xab30, + 0xab5f, 0xab64, 0xab65, 0xabc0, 0xabed, 0xabf0, 0xabf9, 0xac00, + 0xd7a3, 0xd7b0, 0xd7c6, 0xd7cb, 0xd7fb, 0xd800, 0xfa6d, 0xfa70, + 0xfad9, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xfb1d, 0xfb36, 0xfb38, + 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, + 0xfbc1, 0xfbd3, 0xfd3f, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdd0, + 0xfdfd, 0xfe00, 0xfe19, 0xfe20, 0xfe2d, 0xfe30, 0xfe52, 0xfe54, + 0xfe66, 0xfe68, 0xfe6b, 0xfe70, 0xfe74, 0xfe76, 0xfefc, 0xfeff, + 0xfeff, 0xff01, 0xffbe, 0xffc2, 0xffc7, 0xffca, 0xffcf, 0xffd2, + 0xffd7, 0xffda, 0xffdc, 0xffe0, 0xffe6, 0xffe8, 0xffee, 0xfff9, + 0x1000b, 0x1000d, 0x10026, 0x10028, 0x1003a, 0x1003c, 0x1003d, 0x1003f, + 0x1004d, 0x10050, 0x1005d, 0x10080, 0x100fa, 0x10100, 0x10102, 0x10107, + 0x10133, 0x10137, 0x1018c, 0x10190, 0x1019b, 0x101a0, 0x101a0, 0x101d0, + 0x101fd, 0x10280, 0x1029c, 0x102a0, 0x102d0, 0x102e0, 0x102fb, 0x10300, + 0x10323, 0x10330, 0x1034a, 0x10350, 0x1037a, 0x10380, 0x1039d, 0x1039f, + 0x103c3, 0x103c8, 0x103d5, 0x10400, 0x1049d, 0x104a0, 0x104a9, 0x10500, + 0x10527, 0x10530, 0x10563, 0x1056f, 0x1056f, 0x10600, 0x10736, 0x10740, + 0x10755, 0x10760, 0x10767, 0x10800, 0x10805, 0x10808, 0x10808, 0x1080a, + 0x10835, 0x10837, 0x10838, 0x1083c, 0x1083c, 0x1083f, 0x10855, 0x10857, + 0x1089e, 0x108a7, 0x108af, 0x10900, 0x1091b, 0x1091f, 0x10939, 0x1093f, + 0x1093f, 0x10980, 0x109b7, 0x109be, 0x109bf, 0x10a00, 0x10a03, 0x10a05, + 0x10a06, 0x10a0c, 0x10a13, 0x10a15, 0x10a17, 0x10a19, 0x10a33, 0x10a38, + 0x10a3a, 0x10a3f, 0x10a47, 0x10a50, 0x10a58, 0x10a60, 0x10a9f, 0x10ac0, + 0x10ae6, 0x10aeb, 0x10af6, 0x10b00, 0x10b35, 0x10b39, 0x10b55, 0x10b58, + 0x10b72, 0x10b78, 0x10b91, 0x10b99, 0x10b9c, 0x10ba9, 0x10baf, 0x10c00, + 0x10c48, 0x10e60, 0x10e7e, 0x11000, 0x1104d, 0x11052, 0x1106f, 0x1107f, + 0x110c1, 0x110d0, 0x110e8, 0x110f0, 0x110f9, 0x11100, 0x11134, 0x11136, + 0x11143, 0x11150, 0x11176, 0x11180, 0x111c8, 0x111cd, 0x111cd, 0x111d0, + 0x111da, 0x111e1, 0x111f4, 0x11200, 0x11211, 0x11213, 0x1123d, 0x112b0, + 0x112ea, 0x112f0, 0x112f9, 0x11301, 0x11303, 0x11305, 0x1130c, 0x1130f, + 0x11310, 0x11313, 0x11328, 0x1132a, 0x11330, 0x11332, 0x11333, 0x11335, + 0x11339, 0x1133c, 0x11344, 0x11347, 0x11348, 0x1134b, 0x1134d, 0x11357, + 0x11357, 0x1135d, 0x11363, 0x11366, 0x1136c, 0x11370, 0x11374, 0x11480, + 0x114c7, 0x114d0, 0x114d9, 0x11580, 0x115b5, 0x115b8, 0x115c9, 0x11600, + 0x11644, 0x11650, 0x11659, 0x11680, 0x116b7, 0x116c0, 0x116c9, 0x118a0, + 0x118f2, 0x118ff, 0x118ff, 0x11ac0, 0x11af8, 0x12000, 0x12398, 0x12400, + 0x1246e, 0x12470, 0x12474, 0x13000, 0x1342e, 0x16800, 0x16a38, 0x16a40, + 0x16a5e, 0x16a60, 0x16a69, 0x16a6e, 0x16a6f, 0x16ad0, 0x16aed, 0x16af0, + 0x16af5, 0x16b00, 0x16b45, 0x16b50, 0x16b59, 0x16b5b, 0x16b61, 0x16b63, + 0x16b77, 0x16b7d, 0x16b8f, 0x16f00, 0x16f44, 0x16f50, 0x16f7e, 0x16f8f, + 0x16f9f, 0x1b000, 0x1b001, 0x1bc00, 0x1bc6a, 0x1bc70, 0x1bc7c, 0x1bc80, + 0x1bc88, 0x1bc90, 0x1bc99, 0x1bc9c, 0x1bca3, 0x1d000, 0x1d0f5, 0x1d100, + 0x1d126, 0x1d129, 0x1d1dd, 0x1d200, 0x1d245, 0x1d300, 0x1d356, 0x1d360, + 0x1d371, 0x1d400, 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, + 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, + 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, + 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, + 0x1d544, 0x1d546, 0x1d546, 0x1d54a, 0x1d550, 0x1d552, 0x1d6a5, 0x1d6a8, + 0x1d7cb, 0x1d7ce, 0x1d7ff, 0x1e800, 0x1e8c4, 0x1e8c7, 0x1e8d6, 0x1ee00, + 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, 0x1ee22, 0x1ee24, 0x1ee24, 0x1ee27, + 0x1ee27, 0x1ee29, 0x1ee32, 0x1ee34, 0x1ee37, 0x1ee39, 0x1ee39, 0x1ee3b, + 0x1ee3b, 0x1ee42, 0x1ee42, 0x1ee47, 0x1ee47, 0x1ee49, 0x1ee49, 0x1ee4b, + 0x1ee4b, 0x1ee4d, 0x1ee4f, 0x1ee51, 0x1ee52, 0x1ee54, 0x1ee54, 0x1ee57, + 0x1ee57, 0x1ee59, 0x1ee59, 0x1ee5b, 0x1ee5b, 0x1ee5d, 0x1ee5d, 0x1ee5f, + 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, 0x1ee64, 0x1ee67, 0x1ee6a, 0x1ee6c, + 0x1ee72, 0x1ee74, 0x1ee77, 0x1ee79, 0x1ee7c, 0x1ee7e, 0x1ee7e, 0x1ee80, + 0x1ee89, 0x1ee8b, 0x1ee9b, 0x1eea1, 0x1eea3, 0x1eea5, 0x1eea9, 0x1eeab, + 0x1eebb, 0x1eef0, 0x1eef1, 0x1f000, 0x1f02b, 0x1f030, 0x1f093, 0x1f0a0, + 0x1f0ae, 0x1f0b1, 0x1f0bf, 0x1f0c1, 0x1f0cf, 0x1f0d1, 0x1f0f5, 0x1f100, + 0x1f10c, 0x1f110, 0x1f12e, 0x1f130, 0x1f16b, 0x1f170, 0x1f19a, 0x1f1e6, + 0x1f202, 0x1f210, 0x1f23a, 0x1f240, 0x1f248, 0x1f250, 0x1f251, 0x1f300, + 0x1f32c, 0x1f330, 0x1f37d, 0x1f380, 0x1f3ce, 0x1f3d4, 0x1f3f7, 0x1f400, + 0x1f4fe, 0x1f500, 0x1f54a, 0x1f550, 0x1f579, 0x1f57b, 0x1f5a3, 0x1f5a5, + 0x1f642, 0x1f645, 0x1f6cf, 0x1f6e0, 0x1f6ec, 0x1f6f0, 0x1f6f3, 0x1f700, + 0x1f773, 0x1f780, 0x1f7d4, 0x1f800, 0x1f80b, 0x1f810, 0x1f847, 0x1f850, + 0x1f859, 0x1f860, 0x1f887, 0x1f890, 0x1f8ad, 0x1fffe, 0x2a6d6, 0x2a700, + 0x2b734, 0x2b740, 0x2b81d, 0x2f800, 0x2fa1d, 0x2fffe, 0x2ffff, 0x3fffe, + 0x3ffff, 0x4fffe, 0x4ffff, 0x5fffe, 0x5ffff, 0x6fffe, 0x6ffff, 0x7fffe, + 0x7ffff, 0x8fffe, 0x8ffff, 0x9fffe, 0x9ffff, 0xafffe, 0xaffff, 0xbfffe, + 0xbffff, 0xcfffe, 0xcffff, 0xdfffe, 0xdffff, 0xe0001, 0xe0001, 0xe0020, + 0xe007f, 0xe0100, 0xe01ef, 0xefffe, 0x10ffff, +}; /* CR_Age_7_0 */ + +/* 'Age_8_0': Derived Age 8.0 */ +static const OnigCodePoint CR_Age_8_0[] = { + 623, 0x0000, 0x0377, 0x037a, 0x037f, 0x0384, 0x038a, 0x038c, + 0x038c, 0x038e, 0x03a1, 0x03a3, 0x052f, 0x0531, 0x0556, 0x0559, + 0x055f, 0x0561, 0x0587, 0x0589, 0x058a, 0x058d, 0x058f, 0x0591, + 0x05c7, 0x05d0, 0x05ea, 0x05f0, 0x05f4, 0x0600, 0x061c, 0x061e, + 0x070d, 0x070f, 0x074a, 0x074d, 0x07b1, 0x07c0, 0x07fa, 0x0800, + 0x082d, 0x0830, 0x083e, 0x0840, 0x085b, 0x085e, 0x085e, 0x08a0, + 0x08b4, 0x08e3, 0x0983, 0x0985, 0x098c, 0x098f, 0x0990, 0x0993, + 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, 0x09b9, 0x09bc, + 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09ce, 0x09d7, 0x09d7, 0x09dc, + 0x09dd, 0x09df, 0x09e3, 0x09e6, 0x09fb, 0x0a01, 0x0a03, 0x0a05, + 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, 0x0a30, 0x0a32, + 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3c, 0x0a3c, 0x0a3e, + 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4d, 0x0a51, 0x0a51, 0x0a59, + 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, 0x0a75, 0x0a81, 0x0a83, 0x0a85, + 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, 0x0ab0, 0x0ab2, + 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, 0x0ac5, 0x0ac7, 0x0ac9, 0x0acb, + 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, 0x0ae3, 0x0ae6, 0x0af1, 0x0af9, + 0x0af9, 0x0b01, 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, + 0x0b28, 0x0b2a, 0x0b30, 0x0b32, 0x0b33, 0x0b35, 0x0b39, 0x0b3c, + 0x0b44, 0x0b47, 0x0b48, 0x0b4b, 0x0b4d, 0x0b56, 0x0b57, 0x0b5c, + 0x0b5d, 0x0b5f, 0x0b63, 0x0b66, 0x0b77, 0x0b82, 0x0b83, 0x0b85, + 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, + 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, + 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, 0x0bcd, 0x0bd0, + 0x0bd0, 0x0bd7, 0x0bd7, 0x0be6, 0x0bfa, 0x0c00, 0x0c03, 0x0c05, + 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, 0x0c28, 0x0c2a, 0x0c39, 0x0c3d, + 0x0c44, 0x0c46, 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, 0x0c56, 0x0c58, + 0x0c5a, 0x0c60, 0x0c63, 0x0c66, 0x0c6f, 0x0c78, 0x0c7f, 0x0c81, + 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, 0x0ca8, 0x0caa, + 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbc, 0x0cc4, 0x0cc6, 0x0cc8, 0x0cca, + 0x0ccd, 0x0cd5, 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, 0x0ce3, 0x0ce6, + 0x0cef, 0x0cf1, 0x0cf2, 0x0d01, 0x0d03, 0x0d05, 0x0d0c, 0x0d0e, + 0x0d10, 0x0d12, 0x0d3a, 0x0d3d, 0x0d44, 0x0d46, 0x0d48, 0x0d4a, + 0x0d4e, 0x0d57, 0x0d57, 0x0d5f, 0x0d63, 0x0d66, 0x0d75, 0x0d79, + 0x0d7f, 0x0d82, 0x0d83, 0x0d85, 0x0d96, 0x0d9a, 0x0db1, 0x0db3, + 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, 0x0dc6, 0x0dca, 0x0dca, 0x0dcf, + 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, 0x0ddf, 0x0de6, 0x0def, 0x0df2, + 0x0df4, 0x0e01, 0x0e3a, 0x0e3f, 0x0e5b, 0x0e81, 0x0e82, 0x0e84, + 0x0e84, 0x0e87, 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, + 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, + 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, 0x0eb9, 0x0ebb, 0x0ebd, 0x0ec0, + 0x0ec4, 0x0ec6, 0x0ec6, 0x0ec8, 0x0ecd, 0x0ed0, 0x0ed9, 0x0edc, + 0x0edf, 0x0f00, 0x0f47, 0x0f49, 0x0f6c, 0x0f71, 0x0f97, 0x0f99, + 0x0fbc, 0x0fbe, 0x0fcc, 0x0fce, 0x0fda, 0x1000, 0x10c5, 0x10c7, + 0x10c7, 0x10cd, 0x10cd, 0x10d0, 0x1248, 0x124a, 0x124d, 0x1250, + 0x1256, 0x1258, 0x1258, 0x125a, 0x125d, 0x1260, 0x1288, 0x128a, + 0x128d, 0x1290, 0x12b0, 0x12b2, 0x12b5, 0x12b8, 0x12be, 0x12c0, + 0x12c0, 0x12c2, 0x12c5, 0x12c8, 0x12d6, 0x12d8, 0x1310, 0x1312, + 0x1315, 0x1318, 0x135a, 0x135d, 0x137c, 0x1380, 0x1399, 0x13a0, + 0x13f5, 0x13f8, 0x13fd, 0x1400, 0x169c, 0x16a0, 0x16f8, 0x1700, + 0x170c, 0x170e, 0x1714, 0x1720, 0x1736, 0x1740, 0x1753, 0x1760, + 0x176c, 0x176e, 0x1770, 0x1772, 0x1773, 0x1780, 0x17dd, 0x17e0, + 0x17e9, 0x17f0, 0x17f9, 0x1800, 0x180e, 0x1810, 0x1819, 0x1820, + 0x1877, 0x1880, 0x18aa, 0x18b0, 0x18f5, 0x1900, 0x191e, 0x1920, + 0x192b, 0x1930, 0x193b, 0x1940, 0x1940, 0x1944, 0x196d, 0x1970, + 0x1974, 0x1980, 0x19ab, 0x19b0, 0x19c9, 0x19d0, 0x19da, 0x19de, + 0x1a1b, 0x1a1e, 0x1a5e, 0x1a60, 0x1a7c, 0x1a7f, 0x1a89, 0x1a90, + 0x1a99, 0x1aa0, 0x1aad, 0x1ab0, 0x1abe, 0x1b00, 0x1b4b, 0x1b50, + 0x1b7c, 0x1b80, 0x1bf3, 0x1bfc, 0x1c37, 0x1c3b, 0x1c49, 0x1c4d, + 0x1c7f, 0x1cc0, 0x1cc7, 0x1cd0, 0x1cf6, 0x1cf8, 0x1cf9, 0x1d00, + 0x1df5, 0x1dfc, 0x1f15, 0x1f18, 0x1f1d, 0x1f20, 0x1f45, 0x1f48, + 0x1f4d, 0x1f50, 0x1f57, 0x1f59, 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, + 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, 0x1fc4, 0x1fc6, + 0x1fd3, 0x1fd6, 0x1fdb, 0x1fdd, 0x1fef, 0x1ff2, 0x1ff4, 0x1ff6, + 0x1ffe, 0x2000, 0x2064, 0x2066, 0x2071, 0x2074, 0x208e, 0x2090, + 0x209c, 0x20a0, 0x20be, 0x20d0, 0x20f0, 0x2100, 0x218b, 0x2190, + 0x23fa, 0x2400, 0x2426, 0x2440, 0x244a, 0x2460, 0x2b73, 0x2b76, + 0x2b95, 0x2b98, 0x2bb9, 0x2bbd, 0x2bc8, 0x2bca, 0x2bd1, 0x2bec, + 0x2bef, 0x2c00, 0x2c2e, 0x2c30, 0x2c5e, 0x2c60, 0x2cf3, 0x2cf9, + 0x2d25, 0x2d27, 0x2d27, 0x2d2d, 0x2d2d, 0x2d30, 0x2d67, 0x2d6f, + 0x2d70, 0x2d7f, 0x2d96, 0x2da0, 0x2da6, 0x2da8, 0x2dae, 0x2db0, + 0x2db6, 0x2db8, 0x2dbe, 0x2dc0, 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, + 0x2dd6, 0x2dd8, 0x2dde, 0x2de0, 0x2e42, 0x2e80, 0x2e99, 0x2e9b, + 0x2ef3, 0x2f00, 0x2fd5, 0x2ff0, 0x2ffb, 0x3000, 0x303f, 0x3041, + 0x3096, 0x3099, 0x30ff, 0x3105, 0x312d, 0x3131, 0x318e, 0x3190, + 0x31ba, 0x31c0, 0x31e3, 0x31f0, 0x321e, 0x3220, 0x32fe, 0x3300, + 0x4db5, 0x4dc0, 0x9fd5, 0xa000, 0xa48c, 0xa490, 0xa4c6, 0xa4d0, + 0xa62b, 0xa640, 0xa6f7, 0xa700, 0xa7ad, 0xa7b0, 0xa7b7, 0xa7f7, + 0xa82b, 0xa830, 0xa839, 0xa840, 0xa877, 0xa880, 0xa8c4, 0xa8ce, + 0xa8d9, 0xa8e0, 0xa8fd, 0xa900, 0xa953, 0xa95f, 0xa97c, 0xa980, + 0xa9cd, 0xa9cf, 0xa9d9, 0xa9de, 0xa9fe, 0xaa00, 0xaa36, 0xaa40, + 0xaa4d, 0xaa50, 0xaa59, 0xaa5c, 0xaac2, 0xaadb, 0xaaf6, 0xab01, + 0xab06, 0xab09, 0xab0e, 0xab11, 0xab16, 0xab20, 0xab26, 0xab28, + 0xab2e, 0xab30, 0xab65, 0xab70, 0xabed, 0xabf0, 0xabf9, 0xac00, + 0xd7a3, 0xd7b0, 0xd7c6, 0xd7cb, 0xd7fb, 0xd800, 0xfa6d, 0xfa70, + 0xfad9, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xfb1d, 0xfb36, 0xfb38, + 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, + 0xfbc1, 0xfbd3, 0xfd3f, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdd0, + 0xfdfd, 0xfe00, 0xfe19, 0xfe20, 0xfe52, 0xfe54, 0xfe66, 0xfe68, + 0xfe6b, 0xfe70, 0xfe74, 0xfe76, 0xfefc, 0xfeff, 0xfeff, 0xff01, + 0xffbe, 0xffc2, 0xffc7, 0xffca, 0xffcf, 0xffd2, 0xffd7, 0xffda, + 0xffdc, 0xffe0, 0xffe6, 0xffe8, 0xffee, 0xfff9, 0x1000b, 0x1000d, + 0x10026, 0x10028, 0x1003a, 0x1003c, 0x1003d, 0x1003f, 0x1004d, 0x10050, + 0x1005d, 0x10080, 0x100fa, 0x10100, 0x10102, 0x10107, 0x10133, 0x10137, + 0x1018c, 0x10190, 0x1019b, 0x101a0, 0x101a0, 0x101d0, 0x101fd, 0x10280, + 0x1029c, 0x102a0, 0x102d0, 0x102e0, 0x102fb, 0x10300, 0x10323, 0x10330, + 0x1034a, 0x10350, 0x1037a, 0x10380, 0x1039d, 0x1039f, 0x103c3, 0x103c8, + 0x103d5, 0x10400, 0x1049d, 0x104a0, 0x104a9, 0x10500, 0x10527, 0x10530, + 0x10563, 0x1056f, 0x1056f, 0x10600, 0x10736, 0x10740, 0x10755, 0x10760, + 0x10767, 0x10800, 0x10805, 0x10808, 0x10808, 0x1080a, 0x10835, 0x10837, + 0x10838, 0x1083c, 0x1083c, 0x1083f, 0x10855, 0x10857, 0x1089e, 0x108a7, + 0x108af, 0x108e0, 0x108f2, 0x108f4, 0x108f5, 0x108fb, 0x1091b, 0x1091f, + 0x10939, 0x1093f, 0x1093f, 0x10980, 0x109b7, 0x109bc, 0x109cf, 0x109d2, + 0x10a03, 0x10a05, 0x10a06, 0x10a0c, 0x10a13, 0x10a15, 0x10a17, 0x10a19, + 0x10a33, 0x10a38, 0x10a3a, 0x10a3f, 0x10a47, 0x10a50, 0x10a58, 0x10a60, + 0x10a9f, 0x10ac0, 0x10ae6, 0x10aeb, 0x10af6, 0x10b00, 0x10b35, 0x10b39, + 0x10b55, 0x10b58, 0x10b72, 0x10b78, 0x10b91, 0x10b99, 0x10b9c, 0x10ba9, + 0x10baf, 0x10c00, 0x10c48, 0x10c80, 0x10cb2, 0x10cc0, 0x10cf2, 0x10cfa, + 0x10cff, 0x10e60, 0x10e7e, 0x11000, 0x1104d, 0x11052, 0x1106f, 0x1107f, + 0x110c1, 0x110d0, 0x110e8, 0x110f0, 0x110f9, 0x11100, 0x11134, 0x11136, + 0x11143, 0x11150, 0x11176, 0x11180, 0x111cd, 0x111d0, 0x111df, 0x111e1, + 0x111f4, 0x11200, 0x11211, 0x11213, 0x1123d, 0x11280, 0x11286, 0x11288, + 0x11288, 0x1128a, 0x1128d, 0x1128f, 0x1129d, 0x1129f, 0x112a9, 0x112b0, + 0x112ea, 0x112f0, 0x112f9, 0x11300, 0x11303, 0x11305, 0x1130c, 0x1130f, + 0x11310, 0x11313, 0x11328, 0x1132a, 0x11330, 0x11332, 0x11333, 0x11335, + 0x11339, 0x1133c, 0x11344, 0x11347, 0x11348, 0x1134b, 0x1134d, 0x11350, + 0x11350, 0x11357, 0x11357, 0x1135d, 0x11363, 0x11366, 0x1136c, 0x11370, + 0x11374, 0x11480, 0x114c7, 0x114d0, 0x114d9, 0x11580, 0x115b5, 0x115b8, + 0x115dd, 0x11600, 0x11644, 0x11650, 0x11659, 0x11680, 0x116b7, 0x116c0, + 0x116c9, 0x11700, 0x11719, 0x1171d, 0x1172b, 0x11730, 0x1173f, 0x118a0, + 0x118f2, 0x118ff, 0x118ff, 0x11ac0, 0x11af8, 0x12000, 0x12399, 0x12400, + 0x1246e, 0x12470, 0x12474, 0x12480, 0x12543, 0x13000, 0x1342e, 0x14400, + 0x14646, 0x16800, 0x16a38, 0x16a40, 0x16a5e, 0x16a60, 0x16a69, 0x16a6e, + 0x16a6f, 0x16ad0, 0x16aed, 0x16af0, 0x16af5, 0x16b00, 0x16b45, 0x16b50, + 0x16b59, 0x16b5b, 0x16b61, 0x16b63, 0x16b77, 0x16b7d, 0x16b8f, 0x16f00, + 0x16f44, 0x16f50, 0x16f7e, 0x16f8f, 0x16f9f, 0x1b000, 0x1b001, 0x1bc00, + 0x1bc6a, 0x1bc70, 0x1bc7c, 0x1bc80, 0x1bc88, 0x1bc90, 0x1bc99, 0x1bc9c, + 0x1bca3, 0x1d000, 0x1d0f5, 0x1d100, 0x1d126, 0x1d129, 0x1d1e8, 0x1d200, + 0x1d245, 0x1d300, 0x1d356, 0x1d360, 0x1d371, 0x1d400, 0x1d454, 0x1d456, + 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, + 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, + 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, + 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, 0x1d544, 0x1d546, 0x1d546, 0x1d54a, + 0x1d550, 0x1d552, 0x1d6a5, 0x1d6a8, 0x1d7cb, 0x1d7ce, 0x1da8b, 0x1da9b, + 0x1da9f, 0x1daa1, 0x1daaf, 0x1e800, 0x1e8c4, 0x1e8c7, 0x1e8d6, 0x1ee00, + 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, 0x1ee22, 0x1ee24, 0x1ee24, 0x1ee27, + 0x1ee27, 0x1ee29, 0x1ee32, 0x1ee34, 0x1ee37, 0x1ee39, 0x1ee39, 0x1ee3b, + 0x1ee3b, 0x1ee42, 0x1ee42, 0x1ee47, 0x1ee47, 0x1ee49, 0x1ee49, 0x1ee4b, + 0x1ee4b, 0x1ee4d, 0x1ee4f, 0x1ee51, 0x1ee52, 0x1ee54, 0x1ee54, 0x1ee57, + 0x1ee57, 0x1ee59, 0x1ee59, 0x1ee5b, 0x1ee5b, 0x1ee5d, 0x1ee5d, 0x1ee5f, + 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, 0x1ee64, 0x1ee67, 0x1ee6a, 0x1ee6c, + 0x1ee72, 0x1ee74, 0x1ee77, 0x1ee79, 0x1ee7c, 0x1ee7e, 0x1ee7e, 0x1ee80, + 0x1ee89, 0x1ee8b, 0x1ee9b, 0x1eea1, 0x1eea3, 0x1eea5, 0x1eea9, 0x1eeab, + 0x1eebb, 0x1eef0, 0x1eef1, 0x1f000, 0x1f02b, 0x1f030, 0x1f093, 0x1f0a0, + 0x1f0ae, 0x1f0b1, 0x1f0bf, 0x1f0c1, 0x1f0cf, 0x1f0d1, 0x1f0f5, 0x1f100, + 0x1f10c, 0x1f110, 0x1f12e, 0x1f130, 0x1f16b, 0x1f170, 0x1f19a, 0x1f1e6, + 0x1f202, 0x1f210, 0x1f23a, 0x1f240, 0x1f248, 0x1f250, 0x1f251, 0x1f300, + 0x1f579, 0x1f57b, 0x1f5a3, 0x1f5a5, 0x1f6d0, 0x1f6e0, 0x1f6ec, 0x1f6f0, + 0x1f6f3, 0x1f700, 0x1f773, 0x1f780, 0x1f7d4, 0x1f800, 0x1f80b, 0x1f810, + 0x1f847, 0x1f850, 0x1f859, 0x1f860, 0x1f887, 0x1f890, 0x1f8ad, 0x1f910, + 0x1f918, 0x1f980, 0x1f984, 0x1f9c0, 0x1f9c0, 0x1fffe, 0x2a6d6, 0x2a700, + 0x2b734, 0x2b740, 0x2b81d, 0x2b820, 0x2cea1, 0x2f800, 0x2fa1d, 0x2fffe, + 0x2ffff, 0x3fffe, 0x3ffff, 0x4fffe, 0x4ffff, 0x5fffe, 0x5ffff, 0x6fffe, + 0x6ffff, 0x7fffe, 0x7ffff, 0x8fffe, 0x8ffff, 0x9fffe, 0x9ffff, 0xafffe, + 0xaffff, 0xbfffe, 0xbffff, 0xcfffe, 0xcffff, 0xdfffe, 0xdffff, 0xe0001, + 0xe0001, 0xe0020, 0xe007f, 0xe0100, 0xe01ef, 0xefffe, 0x10ffff, +}; /* CR_Age_8_0 */ + +/* 'Age_9_0': Derived Age 9.0 */ +static const OnigCodePoint CR_Age_9_0[] = { + 648, 0x0000, 0x0377, 0x037a, 0x037f, 0x0384, 0x038a, 0x038c, + 0x038c, 0x038e, 0x03a1, 0x03a3, 0x052f, 0x0531, 0x0556, 0x0559, + 0x055f, 0x0561, 0x0587, 0x0589, 0x058a, 0x058d, 0x058f, 0x0591, + 0x05c7, 0x05d0, 0x05ea, 0x05f0, 0x05f4, 0x0600, 0x061c, 0x061e, + 0x070d, 0x070f, 0x074a, 0x074d, 0x07b1, 0x07c0, 0x07fa, 0x0800, + 0x082d, 0x0830, 0x083e, 0x0840, 0x085b, 0x085e, 0x085e, 0x08a0, + 0x08b4, 0x08b6, 0x08bd, 0x08d4, 0x0983, 0x0985, 0x098c, 0x098f, + 0x0990, 0x0993, 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, + 0x09b9, 0x09bc, 0x09c4, 0x09c7, 0x09c8, 0x09cb, 0x09ce, 0x09d7, + 0x09d7, 0x09dc, 0x09dd, 0x09df, 0x09e3, 0x09e6, 0x09fb, 0x0a01, + 0x0a03, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, + 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3c, + 0x0a3c, 0x0a3e, 0x0a42, 0x0a47, 0x0a48, 0x0a4b, 0x0a4d, 0x0a51, + 0x0a51, 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, 0x0a75, 0x0a81, + 0x0a83, 0x0a85, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, + 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abc, 0x0ac5, 0x0ac7, + 0x0ac9, 0x0acb, 0x0acd, 0x0ad0, 0x0ad0, 0x0ae0, 0x0ae3, 0x0ae6, + 0x0af1, 0x0af9, 0x0af9, 0x0b01, 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, + 0x0b10, 0x0b13, 0x0b28, 0x0b2a, 0x0b30, 0x0b32, 0x0b33, 0x0b35, + 0x0b39, 0x0b3c, 0x0b44, 0x0b47, 0x0b48, 0x0b4b, 0x0b4d, 0x0b56, + 0x0b57, 0x0b5c, 0x0b5d, 0x0b5f, 0x0b63, 0x0b66, 0x0b77, 0x0b82, + 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, 0x0b95, 0x0b99, + 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, + 0x0baa, 0x0bae, 0x0bb9, 0x0bbe, 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, + 0x0bcd, 0x0bd0, 0x0bd0, 0x0bd7, 0x0bd7, 0x0be6, 0x0bfa, 0x0c00, + 0x0c03, 0x0c05, 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, 0x0c28, 0x0c2a, + 0x0c39, 0x0c3d, 0x0c44, 0x0c46, 0x0c48, 0x0c4a, 0x0c4d, 0x0c55, + 0x0c56, 0x0c58, 0x0c5a, 0x0c60, 0x0c63, 0x0c66, 0x0c6f, 0x0c78, + 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, 0x0ca8, 0x0caa, + 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbc, 0x0cc4, 0x0cc6, 0x0cc8, 0x0cca, + 0x0ccd, 0x0cd5, 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, 0x0ce3, 0x0ce6, + 0x0cef, 0x0cf1, 0x0cf2, 0x0d01, 0x0d03, 0x0d05, 0x0d0c, 0x0d0e, + 0x0d10, 0x0d12, 0x0d3a, 0x0d3d, 0x0d44, 0x0d46, 0x0d48, 0x0d4a, + 0x0d4f, 0x0d54, 0x0d63, 0x0d66, 0x0d7f, 0x0d82, 0x0d83, 0x0d85, + 0x0d96, 0x0d9a, 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, + 0x0dc6, 0x0dca, 0x0dca, 0x0dcf, 0x0dd4, 0x0dd6, 0x0dd6, 0x0dd8, + 0x0ddf, 0x0de6, 0x0def, 0x0df2, 0x0df4, 0x0e01, 0x0e3a, 0x0e3f, + 0x0e5b, 0x0e81, 0x0e82, 0x0e84, 0x0e84, 0x0e87, 0x0e88, 0x0e8a, + 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, + 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, + 0x0eb9, 0x0ebb, 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, 0x0ec6, 0x0ec8, + 0x0ecd, 0x0ed0, 0x0ed9, 0x0edc, 0x0edf, 0x0f00, 0x0f47, 0x0f49, + 0x0f6c, 0x0f71, 0x0f97, 0x0f99, 0x0fbc, 0x0fbe, 0x0fcc, 0x0fce, + 0x0fda, 0x1000, 0x10c5, 0x10c7, 0x10c7, 0x10cd, 0x10cd, 0x10d0, + 0x1248, 0x124a, 0x124d, 0x1250, 0x1256, 0x1258, 0x1258, 0x125a, + 0x125d, 0x1260, 0x1288, 0x128a, 0x128d, 0x1290, 0x12b0, 0x12b2, + 0x12b5, 0x12b8, 0x12be, 0x12c0, 0x12c0, 0x12c2, 0x12c5, 0x12c8, + 0x12d6, 0x12d8, 0x1310, 0x1312, 0x1315, 0x1318, 0x135a, 0x135d, + 0x137c, 0x1380, 0x1399, 0x13a0, 0x13f5, 0x13f8, 0x13fd, 0x1400, + 0x169c, 0x16a0, 0x16f8, 0x1700, 0x170c, 0x170e, 0x1714, 0x1720, + 0x1736, 0x1740, 0x1753, 0x1760, 0x176c, 0x176e, 0x1770, 0x1772, + 0x1773, 0x1780, 0x17dd, 0x17e0, 0x17e9, 0x17f0, 0x17f9, 0x1800, + 0x180e, 0x1810, 0x1819, 0x1820, 0x1877, 0x1880, 0x18aa, 0x18b0, + 0x18f5, 0x1900, 0x191e, 0x1920, 0x192b, 0x1930, 0x193b, 0x1940, + 0x1940, 0x1944, 0x196d, 0x1970, 0x1974, 0x1980, 0x19ab, 0x19b0, + 0x19c9, 0x19d0, 0x19da, 0x19de, 0x1a1b, 0x1a1e, 0x1a5e, 0x1a60, + 0x1a7c, 0x1a7f, 0x1a89, 0x1a90, 0x1a99, 0x1aa0, 0x1aad, 0x1ab0, + 0x1abe, 0x1b00, 0x1b4b, 0x1b50, 0x1b7c, 0x1b80, 0x1bf3, 0x1bfc, + 0x1c37, 0x1c3b, 0x1c49, 0x1c4d, 0x1c88, 0x1cc0, 0x1cc7, 0x1cd0, + 0x1cf6, 0x1cf8, 0x1cf9, 0x1d00, 0x1df5, 0x1dfb, 0x1f15, 0x1f18, + 0x1f1d, 0x1f20, 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, + 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, + 0x1fb4, 0x1fb6, 0x1fc4, 0x1fc6, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fdd, + 0x1fef, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ffe, 0x2000, 0x2064, 0x2066, + 0x2071, 0x2074, 0x208e, 0x2090, 0x209c, 0x20a0, 0x20be, 0x20d0, + 0x20f0, 0x2100, 0x218b, 0x2190, 0x23fe, 0x2400, 0x2426, 0x2440, + 0x244a, 0x2460, 0x2b73, 0x2b76, 0x2b95, 0x2b98, 0x2bb9, 0x2bbd, + 0x2bc8, 0x2bca, 0x2bd1, 0x2bec, 0x2bef, 0x2c00, 0x2c2e, 0x2c30, + 0x2c5e, 0x2c60, 0x2cf3, 0x2cf9, 0x2d25, 0x2d27, 0x2d27, 0x2d2d, + 0x2d2d, 0x2d30, 0x2d67, 0x2d6f, 0x2d70, 0x2d7f, 0x2d96, 0x2da0, + 0x2da6, 0x2da8, 0x2dae, 0x2db0, 0x2db6, 0x2db8, 0x2dbe, 0x2dc0, + 0x2dc6, 0x2dc8, 0x2dce, 0x2dd0, 0x2dd6, 0x2dd8, 0x2dde, 0x2de0, + 0x2e44, 0x2e80, 0x2e99, 0x2e9b, 0x2ef3, 0x2f00, 0x2fd5, 0x2ff0, + 0x2ffb, 0x3000, 0x303f, 0x3041, 0x3096, 0x3099, 0x30ff, 0x3105, + 0x312d, 0x3131, 0x318e, 0x3190, 0x31ba, 0x31c0, 0x31e3, 0x31f0, + 0x321e, 0x3220, 0x32fe, 0x3300, 0x4db5, 0x4dc0, 0x9fd5, 0xa000, + 0xa48c, 0xa490, 0xa4c6, 0xa4d0, 0xa62b, 0xa640, 0xa6f7, 0xa700, + 0xa7ae, 0xa7b0, 0xa7b7, 0xa7f7, 0xa82b, 0xa830, 0xa839, 0xa840, + 0xa877, 0xa880, 0xa8c5, 0xa8ce, 0xa8d9, 0xa8e0, 0xa8fd, 0xa900, + 0xa953, 0xa95f, 0xa97c, 0xa980, 0xa9cd, 0xa9cf, 0xa9d9, 0xa9de, + 0xa9fe, 0xaa00, 0xaa36, 0xaa40, 0xaa4d, 0xaa50, 0xaa59, 0xaa5c, + 0xaac2, 0xaadb, 0xaaf6, 0xab01, 0xab06, 0xab09, 0xab0e, 0xab11, + 0xab16, 0xab20, 0xab26, 0xab28, 0xab2e, 0xab30, 0xab65, 0xab70, + 0xabed, 0xabf0, 0xabf9, 0xac00, 0xd7a3, 0xd7b0, 0xd7c6, 0xd7cb, + 0xd7fb, 0xd800, 0xfa6d, 0xfa70, 0xfad9, 0xfb00, 0xfb06, 0xfb13, + 0xfb17, 0xfb1d, 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, + 0xfb41, 0xfb43, 0xfb44, 0xfb46, 0xfbc1, 0xfbd3, 0xfd3f, 0xfd50, + 0xfd8f, 0xfd92, 0xfdc7, 0xfdd0, 0xfdfd, 0xfe00, 0xfe19, 0xfe20, + 0xfe52, 0xfe54, 0xfe66, 0xfe68, 0xfe6b, 0xfe70, 0xfe74, 0xfe76, + 0xfefc, 0xfeff, 0xfeff, 0xff01, 0xffbe, 0xffc2, 0xffc7, 0xffca, + 0xffcf, 0xffd2, 0xffd7, 0xffda, 0xffdc, 0xffe0, 0xffe6, 0xffe8, + 0xffee, 0xfff9, 0x1000b, 0x1000d, 0x10026, 0x10028, 0x1003a, 0x1003c, + 0x1003d, 0x1003f, 0x1004d, 0x10050, 0x1005d, 0x10080, 0x100fa, 0x10100, + 0x10102, 0x10107, 0x10133, 0x10137, 0x1018e, 0x10190, 0x1019b, 0x101a0, + 0x101a0, 0x101d0, 0x101fd, 0x10280, 0x1029c, 0x102a0, 0x102d0, 0x102e0, + 0x102fb, 0x10300, 0x10323, 0x10330, 0x1034a, 0x10350, 0x1037a, 0x10380, + 0x1039d, 0x1039f, 0x103c3, 0x103c8, 0x103d5, 0x10400, 0x1049d, 0x104a0, + 0x104a9, 0x104b0, 0x104d3, 0x104d8, 0x104fb, 0x10500, 0x10527, 0x10530, + 0x10563, 0x1056f, 0x1056f, 0x10600, 0x10736, 0x10740, 0x10755, 0x10760, + 0x10767, 0x10800, 0x10805, 0x10808, 0x10808, 0x1080a, 0x10835, 0x10837, + 0x10838, 0x1083c, 0x1083c, 0x1083f, 0x10855, 0x10857, 0x1089e, 0x108a7, + 0x108af, 0x108e0, 0x108f2, 0x108f4, 0x108f5, 0x108fb, 0x1091b, 0x1091f, + 0x10939, 0x1093f, 0x1093f, 0x10980, 0x109b7, 0x109bc, 0x109cf, 0x109d2, + 0x10a03, 0x10a05, 0x10a06, 0x10a0c, 0x10a13, 0x10a15, 0x10a17, 0x10a19, + 0x10a33, 0x10a38, 0x10a3a, 0x10a3f, 0x10a47, 0x10a50, 0x10a58, 0x10a60, + 0x10a9f, 0x10ac0, 0x10ae6, 0x10aeb, 0x10af6, 0x10b00, 0x10b35, 0x10b39, + 0x10b55, 0x10b58, 0x10b72, 0x10b78, 0x10b91, 0x10b99, 0x10b9c, 0x10ba9, + 0x10baf, 0x10c00, 0x10c48, 0x10c80, 0x10cb2, 0x10cc0, 0x10cf2, 0x10cfa, + 0x10cff, 0x10e60, 0x10e7e, 0x11000, 0x1104d, 0x11052, 0x1106f, 0x1107f, + 0x110c1, 0x110d0, 0x110e8, 0x110f0, 0x110f9, 0x11100, 0x11134, 0x11136, + 0x11143, 0x11150, 0x11176, 0x11180, 0x111cd, 0x111d0, 0x111df, 0x111e1, + 0x111f4, 0x11200, 0x11211, 0x11213, 0x1123e, 0x11280, 0x11286, 0x11288, + 0x11288, 0x1128a, 0x1128d, 0x1128f, 0x1129d, 0x1129f, 0x112a9, 0x112b0, + 0x112ea, 0x112f0, 0x112f9, 0x11300, 0x11303, 0x11305, 0x1130c, 0x1130f, + 0x11310, 0x11313, 0x11328, 0x1132a, 0x11330, 0x11332, 0x11333, 0x11335, + 0x11339, 0x1133c, 0x11344, 0x11347, 0x11348, 0x1134b, 0x1134d, 0x11350, + 0x11350, 0x11357, 0x11357, 0x1135d, 0x11363, 0x11366, 0x1136c, 0x11370, + 0x11374, 0x11400, 0x11459, 0x1145b, 0x1145b, 0x1145d, 0x1145d, 0x11480, + 0x114c7, 0x114d0, 0x114d9, 0x11580, 0x115b5, 0x115b8, 0x115dd, 0x11600, + 0x11644, 0x11650, 0x11659, 0x11660, 0x1166c, 0x11680, 0x116b7, 0x116c0, + 0x116c9, 0x11700, 0x11719, 0x1171d, 0x1172b, 0x11730, 0x1173f, 0x118a0, + 0x118f2, 0x118ff, 0x118ff, 0x11ac0, 0x11af8, 0x11c00, 0x11c08, 0x11c0a, + 0x11c36, 0x11c38, 0x11c45, 0x11c50, 0x11c6c, 0x11c70, 0x11c8f, 0x11c92, + 0x11ca7, 0x11ca9, 0x11cb6, 0x12000, 0x12399, 0x12400, 0x1246e, 0x12470, + 0x12474, 0x12480, 0x12543, 0x13000, 0x1342e, 0x14400, 0x14646, 0x16800, + 0x16a38, 0x16a40, 0x16a5e, 0x16a60, 0x16a69, 0x16a6e, 0x16a6f, 0x16ad0, + 0x16aed, 0x16af0, 0x16af5, 0x16b00, 0x16b45, 0x16b50, 0x16b59, 0x16b5b, + 0x16b61, 0x16b63, 0x16b77, 0x16b7d, 0x16b8f, 0x16f00, 0x16f44, 0x16f50, + 0x16f7e, 0x16f8f, 0x16f9f, 0x16fe0, 0x16fe0, 0x17000, 0x187ec, 0x18800, + 0x18af2, 0x1b000, 0x1b001, 0x1bc00, 0x1bc6a, 0x1bc70, 0x1bc7c, 0x1bc80, + 0x1bc88, 0x1bc90, 0x1bc99, 0x1bc9c, 0x1bca3, 0x1d000, 0x1d0f5, 0x1d100, + 0x1d126, 0x1d129, 0x1d1e8, 0x1d200, 0x1d245, 0x1d300, 0x1d356, 0x1d360, + 0x1d371, 0x1d400, 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, + 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, + 0x1d4bb, 0x1d4bd, 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, + 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, + 0x1d544, 0x1d546, 0x1d546, 0x1d54a, 0x1d550, 0x1d552, 0x1d6a5, 0x1d6a8, + 0x1d7cb, 0x1d7ce, 0x1da8b, 0x1da9b, 0x1da9f, 0x1daa1, 0x1daaf, 0x1e000, + 0x1e006, 0x1e008, 0x1e018, 0x1e01b, 0x1e021, 0x1e023, 0x1e024, 0x1e026, + 0x1e02a, 0x1e800, 0x1e8c4, 0x1e8c7, 0x1e8d6, 0x1e900, 0x1e94a, 0x1e950, + 0x1e959, 0x1e95e, 0x1e95f, 0x1ee00, 0x1ee03, 0x1ee05, 0x1ee1f, 0x1ee21, + 0x1ee22, 0x1ee24, 0x1ee24, 0x1ee27, 0x1ee27, 0x1ee29, 0x1ee32, 0x1ee34, + 0x1ee37, 0x1ee39, 0x1ee39, 0x1ee3b, 0x1ee3b, 0x1ee42, 0x1ee42, 0x1ee47, + 0x1ee47, 0x1ee49, 0x1ee49, 0x1ee4b, 0x1ee4b, 0x1ee4d, 0x1ee4f, 0x1ee51, + 0x1ee52, 0x1ee54, 0x1ee54, 0x1ee57, 0x1ee57, 0x1ee59, 0x1ee59, 0x1ee5b, + 0x1ee5b, 0x1ee5d, 0x1ee5d, 0x1ee5f, 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, + 0x1ee64, 0x1ee67, 0x1ee6a, 0x1ee6c, 0x1ee72, 0x1ee74, 0x1ee77, 0x1ee79, + 0x1ee7c, 0x1ee7e, 0x1ee7e, 0x1ee80, 0x1ee89, 0x1ee8b, 0x1ee9b, 0x1eea1, + 0x1eea3, 0x1eea5, 0x1eea9, 0x1eeab, 0x1eebb, 0x1eef0, 0x1eef1, 0x1f000, + 0x1f02b, 0x1f030, 0x1f093, 0x1f0a0, 0x1f0ae, 0x1f0b1, 0x1f0bf, 0x1f0c1, + 0x1f0cf, 0x1f0d1, 0x1f0f5, 0x1f100, 0x1f10c, 0x1f110, 0x1f12e, 0x1f130, + 0x1f16b, 0x1f170, 0x1f1ac, 0x1f1e6, 0x1f202, 0x1f210, 0x1f23b, 0x1f240, + 0x1f248, 0x1f250, 0x1f251, 0x1f300, 0x1f6d2, 0x1f6e0, 0x1f6ec, 0x1f6f0, + 0x1f6f6, 0x1f700, 0x1f773, 0x1f780, 0x1f7d4, 0x1f800, 0x1f80b, 0x1f810, + 0x1f847, 0x1f850, 0x1f859, 0x1f860, 0x1f887, 0x1f890, 0x1f8ad, 0x1f910, + 0x1f91e, 0x1f920, 0x1f927, 0x1f930, 0x1f930, 0x1f933, 0x1f93e, 0x1f940, + 0x1f94b, 0x1f950, 0x1f95e, 0x1f980, 0x1f991, 0x1f9c0, 0x1f9c0, 0x1fffe, + 0x2a6d6, 0x2a700, 0x2b734, 0x2b740, 0x2b81d, 0x2b820, 0x2cea1, 0x2f800, + 0x2fa1d, 0x2fffe, 0x2ffff, 0x3fffe, 0x3ffff, 0x4fffe, 0x4ffff, 0x5fffe, + 0x5ffff, 0x6fffe, 0x6ffff, 0x7fffe, 0x7ffff, 0x8fffe, 0x8ffff, 0x9fffe, + 0x9ffff, 0xafffe, 0xaffff, 0xbfffe, 0xbffff, 0xcfffe, 0xcffff, 0xdfffe, + 0xdffff, 0xe0001, 0xe0001, 0xe0020, 0xe007f, 0xe0100, 0xe01ef, 0xefffe, + 0x10ffff, +}; /* CR_Age_9_0 */ + +# endif /* USE_UNICODE_AGE_PROPERTIES */ +/* 'Grapheme_Cluster_Break_Prepend': Grapheme_Cluster_Break=Prepend */ +static const OnigCodePoint CR_Grapheme_Cluster_Break_Prepend[] = { + 7, 0x0600, 0x0605, 0x06dd, 0x06dd, 0x070f, 0x070f, 0x08e2, + 0x08e2, 0x0d4e, 0x0d4e, 0x110bd, 0x110bd, 0x111c2, 0x111c3, +}; /* CR_Grapheme_Cluster_Break_Prepend */ + +/* 'Grapheme_Cluster_Break_CR': Grapheme_Cluster_Break=CR */ +static const OnigCodePoint CR_Grapheme_Cluster_Break_CR[] = { + 1, + 0x000d, + 0x000d, +}; /* CR_Grapheme_Cluster_Break_CR */ + +/* 'Grapheme_Cluster_Break_LF': Grapheme_Cluster_Break=LF */ +# define CR_Grapheme_Cluster_Break_LF CR_NEWLINE + +/* 'Grapheme_Cluster_Break_Control': Grapheme_Cluster_Break=Control */ +static const OnigCodePoint CR_Grapheme_Cluster_Break_Control[] = { + 19, 0x0000, 0x0009, 0x000b, 0x000c, 0x000e, 0x001f, 0x007f, + 0x009f, 0x00ad, 0x00ad, 0x061c, 0x061c, 0x180e, 0x180e, 0x200b, + 0x200b, 0x200e, 0x200f, 0x2028, 0x202e, 0x2060, 0x206f, 0xd800, + 0xdfff, 0xfeff, 0xfeff, 0xfff0, 0xfffb, 0x1bca0, 0x1bca3, 0x1d173, + 0x1d17a, 0xe0000, 0xe001f, 0xe0080, 0xe00ff, 0xe01f0, 0xe0fff, +}; /* CR_Grapheme_Cluster_Break_Control */ + +/* 'Grapheme_Cluster_Break_Extend': Grapheme_Cluster_Break=Extend */ +# define CR_Grapheme_Cluster_Break_Extend CR_Grapheme_Extend + +/* 'Grapheme_Cluster_Break_Regional_Indicator': + * Grapheme_Cluster_Break=Regional_Indicator */ +static const OnigCodePoint CR_Grapheme_Cluster_Break_Regional_Indicator[] = { + 1, + 0x1f1e6, + 0x1f1ff, +}; /* CR_Grapheme_Cluster_Break_Regional_Indicator */ + +/* 'Grapheme_Cluster_Break_SpacingMark': Grapheme_Cluster_Break=SpacingMark */ +static const OnigCodePoint CR_Grapheme_Cluster_Break_SpacingMark[] = { + 140, 0x0903, 0x0903, 0x093b, 0x093b, 0x093e, 0x0940, 0x0949, + 0x094c, 0x094e, 0x094f, 0x0982, 0x0983, 0x09bf, 0x09c0, 0x09c7, + 0x09c8, 0x09cb, 0x09cc, 0x0a03, 0x0a03, 0x0a3e, 0x0a40, 0x0a83, + 0x0a83, 0x0abe, 0x0ac0, 0x0ac9, 0x0ac9, 0x0acb, 0x0acc, 0x0b02, + 0x0b03, 0x0b40, 0x0b40, 0x0b47, 0x0b48, 0x0b4b, 0x0b4c, 0x0bbf, + 0x0bbf, 0x0bc1, 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, 0x0bcc, 0x0c01, + 0x0c03, 0x0c41, 0x0c44, 0x0c82, 0x0c83, 0x0cbe, 0x0cbe, 0x0cc0, + 0x0cc1, 0x0cc3, 0x0cc4, 0x0cc7, 0x0cc8, 0x0cca, 0x0ccb, 0x0d02, + 0x0d03, 0x0d3f, 0x0d40, 0x0d46, 0x0d48, 0x0d4a, 0x0d4c, 0x0d82, + 0x0d83, 0x0dd0, 0x0dd1, 0x0dd8, 0x0dde, 0x0df2, 0x0df3, 0x0e33, + 0x0e33, 0x0eb3, 0x0eb3, 0x0f3e, 0x0f3f, 0x0f7f, 0x0f7f, 0x1031, + 0x1031, 0x103b, 0x103c, 0x1056, 0x1057, 0x1084, 0x1084, 0x17b6, + 0x17b6, 0x17be, 0x17c5, 0x17c7, 0x17c8, 0x1923, 0x1926, 0x1929, + 0x192b, 0x1930, 0x1931, 0x1933, 0x1938, 0x1a19, 0x1a1a, 0x1a55, + 0x1a55, 0x1a57, 0x1a57, 0x1a6d, 0x1a72, 0x1b04, 0x1b04, 0x1b35, + 0x1b35, 0x1b3b, 0x1b3b, 0x1b3d, 0x1b41, 0x1b43, 0x1b44, 0x1b82, + 0x1b82, 0x1ba1, 0x1ba1, 0x1ba6, 0x1ba7, 0x1baa, 0x1baa, 0x1be7, + 0x1be7, 0x1bea, 0x1bec, 0x1bee, 0x1bee, 0x1bf2, 0x1bf3, 0x1c24, + 0x1c2b, 0x1c34, 0x1c35, 0x1ce1, 0x1ce1, 0x1cf2, 0x1cf3, 0xa823, + 0xa824, 0xa827, 0xa827, 0xa880, 0xa881, 0xa8b4, 0xa8c3, 0xa952, + 0xa953, 0xa983, 0xa983, 0xa9b4, 0xa9b5, 0xa9ba, 0xa9bb, 0xa9bd, + 0xa9c0, 0xaa2f, 0xaa30, 0xaa33, 0xaa34, 0xaa4d, 0xaa4d, 0xaaeb, + 0xaaeb, 0xaaee, 0xaaef, 0xaaf5, 0xaaf5, 0xabe3, 0xabe4, 0xabe6, + 0xabe7, 0xabe9, 0xabea, 0xabec, 0xabec, 0x11000, 0x11000, 0x11002, + 0x11002, 0x11082, 0x11082, 0x110b0, 0x110b2, 0x110b7, 0x110b8, 0x1112c, + 0x1112c, 0x11182, 0x11182, 0x111b3, 0x111b5, 0x111bf, 0x111c0, 0x1122c, + 0x1122e, 0x11232, 0x11233, 0x11235, 0x11235, 0x112e0, 0x112e2, 0x11302, + 0x11303, 0x1133f, 0x1133f, 0x11341, 0x11344, 0x11347, 0x11348, 0x1134b, + 0x1134d, 0x11362, 0x11363, 0x11435, 0x11437, 0x11440, 0x11441, 0x11445, + 0x11445, 0x114b1, 0x114b2, 0x114b9, 0x114b9, 0x114bb, 0x114bc, 0x114be, + 0x114be, 0x114c1, 0x114c1, 0x115b0, 0x115b1, 0x115b8, 0x115bb, 0x115be, + 0x115be, 0x11630, 0x11632, 0x1163b, 0x1163c, 0x1163e, 0x1163e, 0x116ac, + 0x116ac, 0x116ae, 0x116af, 0x116b6, 0x116b6, 0x11720, 0x11721, 0x11726, + 0x11726, 0x11c2f, 0x11c2f, 0x11c3e, 0x11c3e, 0x11ca9, 0x11ca9, 0x11cb1, + 0x11cb1, 0x11cb4, 0x11cb4, 0x16f51, 0x16f7e, 0x1d166, 0x1d166, 0x1d16d, + 0x1d16d, +}; /* CR_Grapheme_Cluster_Break_SpacingMark */ + +/* 'Grapheme_Cluster_Break_L': Grapheme_Cluster_Break=L */ +static const OnigCodePoint CR_Grapheme_Cluster_Break_L[] = { + 2, 0x1100, 0x115f, 0xa960, 0xa97c, +}; /* CR_Grapheme_Cluster_Break_L */ + +/* 'Grapheme_Cluster_Break_V': Grapheme_Cluster_Break=V */ +static const OnigCodePoint CR_Grapheme_Cluster_Break_V[] = { + 2, 0x1160, 0x11a7, 0xd7b0, 0xd7c6, +}; /* CR_Grapheme_Cluster_Break_V */ + +/* 'Grapheme_Cluster_Break_T': Grapheme_Cluster_Break=T */ +static const OnigCodePoint CR_Grapheme_Cluster_Break_T[] = { + 2, 0x11a8, 0x11ff, 0xd7cb, 0xd7fb, +}; /* CR_Grapheme_Cluster_Break_T */ + +/* 'Grapheme_Cluster_Break_LV': Grapheme_Cluster_Break=LV */ +static const OnigCodePoint CR_Grapheme_Cluster_Break_LV[] = { + 399, 0xac00, 0xac00, 0xac1c, 0xac1c, 0xac38, 0xac38, 0xac54, 0xac54, + 0xac70, 0xac70, 0xac8c, 0xac8c, 0xaca8, 0xaca8, 0xacc4, 0xacc4, 0xace0, + 0xace0, 0xacfc, 0xacfc, 0xad18, 0xad18, 0xad34, 0xad34, 0xad50, 0xad50, + 0xad6c, 0xad6c, 0xad88, 0xad88, 0xada4, 0xada4, 0xadc0, 0xadc0, 0xaddc, + 0xaddc, 0xadf8, 0xadf8, 0xae14, 0xae14, 0xae30, 0xae30, 0xae4c, 0xae4c, + 0xae68, 0xae68, 0xae84, 0xae84, 0xaea0, 0xaea0, 0xaebc, 0xaebc, 0xaed8, + 0xaed8, 0xaef4, 0xaef4, 0xaf10, 0xaf10, 0xaf2c, 0xaf2c, 0xaf48, 0xaf48, + 0xaf64, 0xaf64, 0xaf80, 0xaf80, 0xaf9c, 0xaf9c, 0xafb8, 0xafb8, 0xafd4, + 0xafd4, 0xaff0, 0xaff0, 0xb00c, 0xb00c, 0xb028, 0xb028, 0xb044, 0xb044, + 0xb060, 0xb060, 0xb07c, 0xb07c, 0xb098, 0xb098, 0xb0b4, 0xb0b4, 0xb0d0, + 0xb0d0, 0xb0ec, 0xb0ec, 0xb108, 0xb108, 0xb124, 0xb124, 0xb140, 0xb140, + 0xb15c, 0xb15c, 0xb178, 0xb178, 0xb194, 0xb194, 0xb1b0, 0xb1b0, 0xb1cc, + 0xb1cc, 0xb1e8, 0xb1e8, 0xb204, 0xb204, 0xb220, 0xb220, 0xb23c, 0xb23c, + 0xb258, 0xb258, 0xb274, 0xb274, 0xb290, 0xb290, 0xb2ac, 0xb2ac, 0xb2c8, + 0xb2c8, 0xb2e4, 0xb2e4, 0xb300, 0xb300, 0xb31c, 0xb31c, 0xb338, 0xb338, + 0xb354, 0xb354, 0xb370, 0xb370, 0xb38c, 0xb38c, 0xb3a8, 0xb3a8, 0xb3c4, + 0xb3c4, 0xb3e0, 0xb3e0, 0xb3fc, 0xb3fc, 0xb418, 0xb418, 0xb434, 0xb434, + 0xb450, 0xb450, 0xb46c, 0xb46c, 0xb488, 0xb488, 0xb4a4, 0xb4a4, 0xb4c0, + 0xb4c0, 0xb4dc, 0xb4dc, 0xb4f8, 0xb4f8, 0xb514, 0xb514, 0xb530, 0xb530, + 0xb54c, 0xb54c, 0xb568, 0xb568, 0xb584, 0xb584, 0xb5a0, 0xb5a0, 0xb5bc, + 0xb5bc, 0xb5d8, 0xb5d8, 0xb5f4, 0xb5f4, 0xb610, 0xb610, 0xb62c, 0xb62c, + 0xb648, 0xb648, 0xb664, 0xb664, 0xb680, 0xb680, 0xb69c, 0xb69c, 0xb6b8, + 0xb6b8, 0xb6d4, 0xb6d4, 0xb6f0, 0xb6f0, 0xb70c, 0xb70c, 0xb728, 0xb728, + 0xb744, 0xb744, 0xb760, 0xb760, 0xb77c, 0xb77c, 0xb798, 0xb798, 0xb7b4, + 0xb7b4, 0xb7d0, 0xb7d0, 0xb7ec, 0xb7ec, 0xb808, 0xb808, 0xb824, 0xb824, + 0xb840, 0xb840, 0xb85c, 0xb85c, 0xb878, 0xb878, 0xb894, 0xb894, 0xb8b0, + 0xb8b0, 0xb8cc, 0xb8cc, 0xb8e8, 0xb8e8, 0xb904, 0xb904, 0xb920, 0xb920, + 0xb93c, 0xb93c, 0xb958, 0xb958, 0xb974, 0xb974, 0xb990, 0xb990, 0xb9ac, + 0xb9ac, 0xb9c8, 0xb9c8, 0xb9e4, 0xb9e4, 0xba00, 0xba00, 0xba1c, 0xba1c, + 0xba38, 0xba38, 0xba54, 0xba54, 0xba70, 0xba70, 0xba8c, 0xba8c, 0xbaa8, + 0xbaa8, 0xbac4, 0xbac4, 0xbae0, 0xbae0, 0xbafc, 0xbafc, 0xbb18, 0xbb18, + 0xbb34, 0xbb34, 0xbb50, 0xbb50, 0xbb6c, 0xbb6c, 0xbb88, 0xbb88, 0xbba4, + 0xbba4, 0xbbc0, 0xbbc0, 0xbbdc, 0xbbdc, 0xbbf8, 0xbbf8, 0xbc14, 0xbc14, + 0xbc30, 0xbc30, 0xbc4c, 0xbc4c, 0xbc68, 0xbc68, 0xbc84, 0xbc84, 0xbca0, + 0xbca0, 0xbcbc, 0xbcbc, 0xbcd8, 0xbcd8, 0xbcf4, 0xbcf4, 0xbd10, 0xbd10, + 0xbd2c, 0xbd2c, 0xbd48, 0xbd48, 0xbd64, 0xbd64, 0xbd80, 0xbd80, 0xbd9c, + 0xbd9c, 0xbdb8, 0xbdb8, 0xbdd4, 0xbdd4, 0xbdf0, 0xbdf0, 0xbe0c, 0xbe0c, + 0xbe28, 0xbe28, 0xbe44, 0xbe44, 0xbe60, 0xbe60, 0xbe7c, 0xbe7c, 0xbe98, + 0xbe98, 0xbeb4, 0xbeb4, 0xbed0, 0xbed0, 0xbeec, 0xbeec, 0xbf08, 0xbf08, + 0xbf24, 0xbf24, 0xbf40, 0xbf40, 0xbf5c, 0xbf5c, 0xbf78, 0xbf78, 0xbf94, + 0xbf94, 0xbfb0, 0xbfb0, 0xbfcc, 0xbfcc, 0xbfe8, 0xbfe8, 0xc004, 0xc004, + 0xc020, 0xc020, 0xc03c, 0xc03c, 0xc058, 0xc058, 0xc074, 0xc074, 0xc090, + 0xc090, 0xc0ac, 0xc0ac, 0xc0c8, 0xc0c8, 0xc0e4, 0xc0e4, 0xc100, 0xc100, + 0xc11c, 0xc11c, 0xc138, 0xc138, 0xc154, 0xc154, 0xc170, 0xc170, 0xc18c, + 0xc18c, 0xc1a8, 0xc1a8, 0xc1c4, 0xc1c4, 0xc1e0, 0xc1e0, 0xc1fc, 0xc1fc, + 0xc218, 0xc218, 0xc234, 0xc234, 0xc250, 0xc250, 0xc26c, 0xc26c, 0xc288, + 0xc288, 0xc2a4, 0xc2a4, 0xc2c0, 0xc2c0, 0xc2dc, 0xc2dc, 0xc2f8, 0xc2f8, + 0xc314, 0xc314, 0xc330, 0xc330, 0xc34c, 0xc34c, 0xc368, 0xc368, 0xc384, + 0xc384, 0xc3a0, 0xc3a0, 0xc3bc, 0xc3bc, 0xc3d8, 0xc3d8, 0xc3f4, 0xc3f4, + 0xc410, 0xc410, 0xc42c, 0xc42c, 0xc448, 0xc448, 0xc464, 0xc464, 0xc480, + 0xc480, 0xc49c, 0xc49c, 0xc4b8, 0xc4b8, 0xc4d4, 0xc4d4, 0xc4f0, 0xc4f0, + 0xc50c, 0xc50c, 0xc528, 0xc528, 0xc544, 0xc544, 0xc560, 0xc560, 0xc57c, + 0xc57c, 0xc598, 0xc598, 0xc5b4, 0xc5b4, 0xc5d0, 0xc5d0, 0xc5ec, 0xc5ec, + 0xc608, 0xc608, 0xc624, 0xc624, 0xc640, 0xc640, 0xc65c, 0xc65c, 0xc678, + 0xc678, 0xc694, 0xc694, 0xc6b0, 0xc6b0, 0xc6cc, 0xc6cc, 0xc6e8, 0xc6e8, + 0xc704, 0xc704, 0xc720, 0xc720, 0xc73c, 0xc73c, 0xc758, 0xc758, 0xc774, + 0xc774, 0xc790, 0xc790, 0xc7ac, 0xc7ac, 0xc7c8, 0xc7c8, 0xc7e4, 0xc7e4, + 0xc800, 0xc800, 0xc81c, 0xc81c, 0xc838, 0xc838, 0xc854, 0xc854, 0xc870, + 0xc870, 0xc88c, 0xc88c, 0xc8a8, 0xc8a8, 0xc8c4, 0xc8c4, 0xc8e0, 0xc8e0, + 0xc8fc, 0xc8fc, 0xc918, 0xc918, 0xc934, 0xc934, 0xc950, 0xc950, 0xc96c, + 0xc96c, 0xc988, 0xc988, 0xc9a4, 0xc9a4, 0xc9c0, 0xc9c0, 0xc9dc, 0xc9dc, + 0xc9f8, 0xc9f8, 0xca14, 0xca14, 0xca30, 0xca30, 0xca4c, 0xca4c, 0xca68, + 0xca68, 0xca84, 0xca84, 0xcaa0, 0xcaa0, 0xcabc, 0xcabc, 0xcad8, 0xcad8, + 0xcaf4, 0xcaf4, 0xcb10, 0xcb10, 0xcb2c, 0xcb2c, 0xcb48, 0xcb48, 0xcb64, + 0xcb64, 0xcb80, 0xcb80, 0xcb9c, 0xcb9c, 0xcbb8, 0xcbb8, 0xcbd4, 0xcbd4, + 0xcbf0, 0xcbf0, 0xcc0c, 0xcc0c, 0xcc28, 0xcc28, 0xcc44, 0xcc44, 0xcc60, + 0xcc60, 0xcc7c, 0xcc7c, 0xcc98, 0xcc98, 0xccb4, 0xccb4, 0xccd0, 0xccd0, + 0xccec, 0xccec, 0xcd08, 0xcd08, 0xcd24, 0xcd24, 0xcd40, 0xcd40, 0xcd5c, + 0xcd5c, 0xcd78, 0xcd78, 0xcd94, 0xcd94, 0xcdb0, 0xcdb0, 0xcdcc, 0xcdcc, + 0xcde8, 0xcde8, 0xce04, 0xce04, 0xce20, 0xce20, 0xce3c, 0xce3c, 0xce58, + 0xce58, 0xce74, 0xce74, 0xce90, 0xce90, 0xceac, 0xceac, 0xcec8, 0xcec8, + 0xcee4, 0xcee4, 0xcf00, 0xcf00, 0xcf1c, 0xcf1c, 0xcf38, 0xcf38, 0xcf54, + 0xcf54, 0xcf70, 0xcf70, 0xcf8c, 0xcf8c, 0xcfa8, 0xcfa8, 0xcfc4, 0xcfc4, + 0xcfe0, 0xcfe0, 0xcffc, 0xcffc, 0xd018, 0xd018, 0xd034, 0xd034, 0xd050, + 0xd050, 0xd06c, 0xd06c, 0xd088, 0xd088, 0xd0a4, 0xd0a4, 0xd0c0, 0xd0c0, + 0xd0dc, 0xd0dc, 0xd0f8, 0xd0f8, 0xd114, 0xd114, 0xd130, 0xd130, 0xd14c, + 0xd14c, 0xd168, 0xd168, 0xd184, 0xd184, 0xd1a0, 0xd1a0, 0xd1bc, 0xd1bc, + 0xd1d8, 0xd1d8, 0xd1f4, 0xd1f4, 0xd210, 0xd210, 0xd22c, 0xd22c, 0xd248, + 0xd248, 0xd264, 0xd264, 0xd280, 0xd280, 0xd29c, 0xd29c, 0xd2b8, 0xd2b8, + 0xd2d4, 0xd2d4, 0xd2f0, 0xd2f0, 0xd30c, 0xd30c, 0xd328, 0xd328, 0xd344, + 0xd344, 0xd360, 0xd360, 0xd37c, 0xd37c, 0xd398, 0xd398, 0xd3b4, 0xd3b4, + 0xd3d0, 0xd3d0, 0xd3ec, 0xd3ec, 0xd408, 0xd408, 0xd424, 0xd424, 0xd440, + 0xd440, 0xd45c, 0xd45c, 0xd478, 0xd478, 0xd494, 0xd494, 0xd4b0, 0xd4b0, + 0xd4cc, 0xd4cc, 0xd4e8, 0xd4e8, 0xd504, 0xd504, 0xd520, 0xd520, 0xd53c, + 0xd53c, 0xd558, 0xd558, 0xd574, 0xd574, 0xd590, 0xd590, 0xd5ac, 0xd5ac, + 0xd5c8, 0xd5c8, 0xd5e4, 0xd5e4, 0xd600, 0xd600, 0xd61c, 0xd61c, 0xd638, + 0xd638, 0xd654, 0xd654, 0xd670, 0xd670, 0xd68c, 0xd68c, 0xd6a8, 0xd6a8, + 0xd6c4, 0xd6c4, 0xd6e0, 0xd6e0, 0xd6fc, 0xd6fc, 0xd718, 0xd718, 0xd734, + 0xd734, 0xd750, 0xd750, 0xd76c, 0xd76c, 0xd788, 0xd788, +}; /* CR_Grapheme_Cluster_Break_LV */ + +/* 'Grapheme_Cluster_Break_LVT': Grapheme_Cluster_Break=LVT */ +static const OnigCodePoint CR_Grapheme_Cluster_Break_LVT[] = { + 399, 0xac01, 0xac1b, 0xac1d, 0xac37, 0xac39, 0xac53, 0xac55, 0xac6f, + 0xac71, 0xac8b, 0xac8d, 0xaca7, 0xaca9, 0xacc3, 0xacc5, 0xacdf, 0xace1, + 0xacfb, 0xacfd, 0xad17, 0xad19, 0xad33, 0xad35, 0xad4f, 0xad51, 0xad6b, + 0xad6d, 0xad87, 0xad89, 0xada3, 0xada5, 0xadbf, 0xadc1, 0xaddb, 0xaddd, + 0xadf7, 0xadf9, 0xae13, 0xae15, 0xae2f, 0xae31, 0xae4b, 0xae4d, 0xae67, + 0xae69, 0xae83, 0xae85, 0xae9f, 0xaea1, 0xaebb, 0xaebd, 0xaed7, 0xaed9, + 0xaef3, 0xaef5, 0xaf0f, 0xaf11, 0xaf2b, 0xaf2d, 0xaf47, 0xaf49, 0xaf63, + 0xaf65, 0xaf7f, 0xaf81, 0xaf9b, 0xaf9d, 0xafb7, 0xafb9, 0xafd3, 0xafd5, + 0xafef, 0xaff1, 0xb00b, 0xb00d, 0xb027, 0xb029, 0xb043, 0xb045, 0xb05f, + 0xb061, 0xb07b, 0xb07d, 0xb097, 0xb099, 0xb0b3, 0xb0b5, 0xb0cf, 0xb0d1, + 0xb0eb, 0xb0ed, 0xb107, 0xb109, 0xb123, 0xb125, 0xb13f, 0xb141, 0xb15b, + 0xb15d, 0xb177, 0xb179, 0xb193, 0xb195, 0xb1af, 0xb1b1, 0xb1cb, 0xb1cd, + 0xb1e7, 0xb1e9, 0xb203, 0xb205, 0xb21f, 0xb221, 0xb23b, 0xb23d, 0xb257, + 0xb259, 0xb273, 0xb275, 0xb28f, 0xb291, 0xb2ab, 0xb2ad, 0xb2c7, 0xb2c9, + 0xb2e3, 0xb2e5, 0xb2ff, 0xb301, 0xb31b, 0xb31d, 0xb337, 0xb339, 0xb353, + 0xb355, 0xb36f, 0xb371, 0xb38b, 0xb38d, 0xb3a7, 0xb3a9, 0xb3c3, 0xb3c5, + 0xb3df, 0xb3e1, 0xb3fb, 0xb3fd, 0xb417, 0xb419, 0xb433, 0xb435, 0xb44f, + 0xb451, 0xb46b, 0xb46d, 0xb487, 0xb489, 0xb4a3, 0xb4a5, 0xb4bf, 0xb4c1, + 0xb4db, 0xb4dd, 0xb4f7, 0xb4f9, 0xb513, 0xb515, 0xb52f, 0xb531, 0xb54b, + 0xb54d, 0xb567, 0xb569, 0xb583, 0xb585, 0xb59f, 0xb5a1, 0xb5bb, 0xb5bd, + 0xb5d7, 0xb5d9, 0xb5f3, 0xb5f5, 0xb60f, 0xb611, 0xb62b, 0xb62d, 0xb647, + 0xb649, 0xb663, 0xb665, 0xb67f, 0xb681, 0xb69b, 0xb69d, 0xb6b7, 0xb6b9, + 0xb6d3, 0xb6d5, 0xb6ef, 0xb6f1, 0xb70b, 0xb70d, 0xb727, 0xb729, 0xb743, + 0xb745, 0xb75f, 0xb761, 0xb77b, 0xb77d, 0xb797, 0xb799, 0xb7b3, 0xb7b5, + 0xb7cf, 0xb7d1, 0xb7eb, 0xb7ed, 0xb807, 0xb809, 0xb823, 0xb825, 0xb83f, + 0xb841, 0xb85b, 0xb85d, 0xb877, 0xb879, 0xb893, 0xb895, 0xb8af, 0xb8b1, + 0xb8cb, 0xb8cd, 0xb8e7, 0xb8e9, 0xb903, 0xb905, 0xb91f, 0xb921, 0xb93b, + 0xb93d, 0xb957, 0xb959, 0xb973, 0xb975, 0xb98f, 0xb991, 0xb9ab, 0xb9ad, + 0xb9c7, 0xb9c9, 0xb9e3, 0xb9e5, 0xb9ff, 0xba01, 0xba1b, 0xba1d, 0xba37, + 0xba39, 0xba53, 0xba55, 0xba6f, 0xba71, 0xba8b, 0xba8d, 0xbaa7, 0xbaa9, + 0xbac3, 0xbac5, 0xbadf, 0xbae1, 0xbafb, 0xbafd, 0xbb17, 0xbb19, 0xbb33, + 0xbb35, 0xbb4f, 0xbb51, 0xbb6b, 0xbb6d, 0xbb87, 0xbb89, 0xbba3, 0xbba5, + 0xbbbf, 0xbbc1, 0xbbdb, 0xbbdd, 0xbbf7, 0xbbf9, 0xbc13, 0xbc15, 0xbc2f, + 0xbc31, 0xbc4b, 0xbc4d, 0xbc67, 0xbc69, 0xbc83, 0xbc85, 0xbc9f, 0xbca1, + 0xbcbb, 0xbcbd, 0xbcd7, 0xbcd9, 0xbcf3, 0xbcf5, 0xbd0f, 0xbd11, 0xbd2b, + 0xbd2d, 0xbd47, 0xbd49, 0xbd63, 0xbd65, 0xbd7f, 0xbd81, 0xbd9b, 0xbd9d, + 0xbdb7, 0xbdb9, 0xbdd3, 0xbdd5, 0xbdef, 0xbdf1, 0xbe0b, 0xbe0d, 0xbe27, + 0xbe29, 0xbe43, 0xbe45, 0xbe5f, 0xbe61, 0xbe7b, 0xbe7d, 0xbe97, 0xbe99, + 0xbeb3, 0xbeb5, 0xbecf, 0xbed1, 0xbeeb, 0xbeed, 0xbf07, 0xbf09, 0xbf23, + 0xbf25, 0xbf3f, 0xbf41, 0xbf5b, 0xbf5d, 0xbf77, 0xbf79, 0xbf93, 0xbf95, + 0xbfaf, 0xbfb1, 0xbfcb, 0xbfcd, 0xbfe7, 0xbfe9, 0xc003, 0xc005, 0xc01f, + 0xc021, 0xc03b, 0xc03d, 0xc057, 0xc059, 0xc073, 0xc075, 0xc08f, 0xc091, + 0xc0ab, 0xc0ad, 0xc0c7, 0xc0c9, 0xc0e3, 0xc0e5, 0xc0ff, 0xc101, 0xc11b, + 0xc11d, 0xc137, 0xc139, 0xc153, 0xc155, 0xc16f, 0xc171, 0xc18b, 0xc18d, + 0xc1a7, 0xc1a9, 0xc1c3, 0xc1c5, 0xc1df, 0xc1e1, 0xc1fb, 0xc1fd, 0xc217, + 0xc219, 0xc233, 0xc235, 0xc24f, 0xc251, 0xc26b, 0xc26d, 0xc287, 0xc289, + 0xc2a3, 0xc2a5, 0xc2bf, 0xc2c1, 0xc2db, 0xc2dd, 0xc2f7, 0xc2f9, 0xc313, + 0xc315, 0xc32f, 0xc331, 0xc34b, 0xc34d, 0xc367, 0xc369, 0xc383, 0xc385, + 0xc39f, 0xc3a1, 0xc3bb, 0xc3bd, 0xc3d7, 0xc3d9, 0xc3f3, 0xc3f5, 0xc40f, + 0xc411, 0xc42b, 0xc42d, 0xc447, 0xc449, 0xc463, 0xc465, 0xc47f, 0xc481, + 0xc49b, 0xc49d, 0xc4b7, 0xc4b9, 0xc4d3, 0xc4d5, 0xc4ef, 0xc4f1, 0xc50b, + 0xc50d, 0xc527, 0xc529, 0xc543, 0xc545, 0xc55f, 0xc561, 0xc57b, 0xc57d, + 0xc597, 0xc599, 0xc5b3, 0xc5b5, 0xc5cf, 0xc5d1, 0xc5eb, 0xc5ed, 0xc607, + 0xc609, 0xc623, 0xc625, 0xc63f, 0xc641, 0xc65b, 0xc65d, 0xc677, 0xc679, + 0xc693, 0xc695, 0xc6af, 0xc6b1, 0xc6cb, 0xc6cd, 0xc6e7, 0xc6e9, 0xc703, + 0xc705, 0xc71f, 0xc721, 0xc73b, 0xc73d, 0xc757, 0xc759, 0xc773, 0xc775, + 0xc78f, 0xc791, 0xc7ab, 0xc7ad, 0xc7c7, 0xc7c9, 0xc7e3, 0xc7e5, 0xc7ff, + 0xc801, 0xc81b, 0xc81d, 0xc837, 0xc839, 0xc853, 0xc855, 0xc86f, 0xc871, + 0xc88b, 0xc88d, 0xc8a7, 0xc8a9, 0xc8c3, 0xc8c5, 0xc8df, 0xc8e1, 0xc8fb, + 0xc8fd, 0xc917, 0xc919, 0xc933, 0xc935, 0xc94f, 0xc951, 0xc96b, 0xc96d, + 0xc987, 0xc989, 0xc9a3, 0xc9a5, 0xc9bf, 0xc9c1, 0xc9db, 0xc9dd, 0xc9f7, + 0xc9f9, 0xca13, 0xca15, 0xca2f, 0xca31, 0xca4b, 0xca4d, 0xca67, 0xca69, + 0xca83, 0xca85, 0xca9f, 0xcaa1, 0xcabb, 0xcabd, 0xcad7, 0xcad9, 0xcaf3, + 0xcaf5, 0xcb0f, 0xcb11, 0xcb2b, 0xcb2d, 0xcb47, 0xcb49, 0xcb63, 0xcb65, + 0xcb7f, 0xcb81, 0xcb9b, 0xcb9d, 0xcbb7, 0xcbb9, 0xcbd3, 0xcbd5, 0xcbef, + 0xcbf1, 0xcc0b, 0xcc0d, 0xcc27, 0xcc29, 0xcc43, 0xcc45, 0xcc5f, 0xcc61, + 0xcc7b, 0xcc7d, 0xcc97, 0xcc99, 0xccb3, 0xccb5, 0xcccf, 0xccd1, 0xcceb, + 0xcced, 0xcd07, 0xcd09, 0xcd23, 0xcd25, 0xcd3f, 0xcd41, 0xcd5b, 0xcd5d, + 0xcd77, 0xcd79, 0xcd93, 0xcd95, 0xcdaf, 0xcdb1, 0xcdcb, 0xcdcd, 0xcde7, + 0xcde9, 0xce03, 0xce05, 0xce1f, 0xce21, 0xce3b, 0xce3d, 0xce57, 0xce59, + 0xce73, 0xce75, 0xce8f, 0xce91, 0xceab, 0xcead, 0xcec7, 0xcec9, 0xcee3, + 0xcee5, 0xceff, 0xcf01, 0xcf1b, 0xcf1d, 0xcf37, 0xcf39, 0xcf53, 0xcf55, + 0xcf6f, 0xcf71, 0xcf8b, 0xcf8d, 0xcfa7, 0xcfa9, 0xcfc3, 0xcfc5, 0xcfdf, + 0xcfe1, 0xcffb, 0xcffd, 0xd017, 0xd019, 0xd033, 0xd035, 0xd04f, 0xd051, + 0xd06b, 0xd06d, 0xd087, 0xd089, 0xd0a3, 0xd0a5, 0xd0bf, 0xd0c1, 0xd0db, + 0xd0dd, 0xd0f7, 0xd0f9, 0xd113, 0xd115, 0xd12f, 0xd131, 0xd14b, 0xd14d, + 0xd167, 0xd169, 0xd183, 0xd185, 0xd19f, 0xd1a1, 0xd1bb, 0xd1bd, 0xd1d7, + 0xd1d9, 0xd1f3, 0xd1f5, 0xd20f, 0xd211, 0xd22b, 0xd22d, 0xd247, 0xd249, + 0xd263, 0xd265, 0xd27f, 0xd281, 0xd29b, 0xd29d, 0xd2b7, 0xd2b9, 0xd2d3, + 0xd2d5, 0xd2ef, 0xd2f1, 0xd30b, 0xd30d, 0xd327, 0xd329, 0xd343, 0xd345, + 0xd35f, 0xd361, 0xd37b, 0xd37d, 0xd397, 0xd399, 0xd3b3, 0xd3b5, 0xd3cf, + 0xd3d1, 0xd3eb, 0xd3ed, 0xd407, 0xd409, 0xd423, 0xd425, 0xd43f, 0xd441, + 0xd45b, 0xd45d, 0xd477, 0xd479, 0xd493, 0xd495, 0xd4af, 0xd4b1, 0xd4cb, + 0xd4cd, 0xd4e7, 0xd4e9, 0xd503, 0xd505, 0xd51f, 0xd521, 0xd53b, 0xd53d, + 0xd557, 0xd559, 0xd573, 0xd575, 0xd58f, 0xd591, 0xd5ab, 0xd5ad, 0xd5c7, + 0xd5c9, 0xd5e3, 0xd5e5, 0xd5ff, 0xd601, 0xd61b, 0xd61d, 0xd637, 0xd639, + 0xd653, 0xd655, 0xd66f, 0xd671, 0xd68b, 0xd68d, 0xd6a7, 0xd6a9, 0xd6c3, + 0xd6c5, 0xd6df, 0xd6e1, 0xd6fb, 0xd6fd, 0xd717, 0xd719, 0xd733, 0xd735, + 0xd74f, 0xd751, 0xd76b, 0xd76d, 0xd787, 0xd789, 0xd7a3, +}; /* CR_Grapheme_Cluster_Break_LVT */ + +/* 'Grapheme_Cluster_Break_E_Base': Grapheme_Cluster_Break=E_Base */ +static const OnigCodePoint CR_Grapheme_Cluster_Break_E_Base[] = { + 28, 0x261d, 0x261d, 0x26f9, 0x26f9, 0x270a, 0x270d, 0x1f385, + 0x1f385, 0x1f3c3, 0x1f3c4, 0x1f3ca, 0x1f3cb, 0x1f442, 0x1f443, 0x1f446, + 0x1f450, 0x1f46e, 0x1f46e, 0x1f470, 0x1f478, 0x1f47c, 0x1f47c, 0x1f481, + 0x1f483, 0x1f485, 0x1f487, 0x1f4aa, 0x1f4aa, 0x1f575, 0x1f575, 0x1f57a, + 0x1f57a, 0x1f590, 0x1f590, 0x1f595, 0x1f596, 0x1f645, 0x1f647, 0x1f64b, + 0x1f64f, 0x1f6a3, 0x1f6a3, 0x1f6b4, 0x1f6b6, 0x1f6c0, 0x1f6c0, 0x1f918, + 0x1f91e, 0x1f926, 0x1f926, 0x1f930, 0x1f930, 0x1f933, 0x1f939, 0x1f93c, + 0x1f93e, +}; /* CR_Grapheme_Cluster_Break_E_Base */ + +/* 'Grapheme_Cluster_Break_E_Modifier': Grapheme_Cluster_Break=E_Modifier */ +static const OnigCodePoint CR_Grapheme_Cluster_Break_E_Modifier[] = { + 1, + 0x1f3fb, + 0x1f3ff, +}; /* CR_Grapheme_Cluster_Break_E_Modifier */ + +/* 'Grapheme_Cluster_Break_ZWJ': Grapheme_Cluster_Break=ZWJ */ +static const OnigCodePoint CR_Grapheme_Cluster_Break_ZWJ[] = { + 1, + 0x200d, + 0x200d, +}; /* CR_Grapheme_Cluster_Break_ZWJ */ + +/* 'Grapheme_Cluster_Break_Glue_After_Zwj': + * Grapheme_Cluster_Break=Glue_After_Zwj */ +static const OnigCodePoint CR_Grapheme_Cluster_Break_Glue_After_Zwj[] = { + 3, 0x2764, 0x2764, 0x1f48b, 0x1f48b, 0x1f5e8, 0x1f5e8, +}; /* CR_Grapheme_Cluster_Break_Glue_After_Zwj */ + +/* 'Grapheme_Cluster_Break_E_Base_GAZ': Grapheme_Cluster_Break=E_Base_GAZ */ +static const OnigCodePoint CR_Grapheme_Cluster_Break_E_Base_GAZ[] = { + 1, + 0x1f466, + 0x1f469, +}; /* CR_Grapheme_Cluster_Break_E_Base_GAZ */ + +/* 'In_Basic_Latin': Block */ +# define CR_In_Basic_Latin CR_ASCII + +/* 'In_Latin_1_Supplement': Block */ +static const OnigCodePoint CR_In_Latin_1_Supplement[] = { + 1, + 0x0080, + 0x00ff, +}; /* CR_In_Latin_1_Supplement */ + +/* 'In_Latin_Extended_A': Block */ +static const OnigCodePoint CR_In_Latin_Extended_A[] = { + 1, + 0x0100, + 0x017f, +}; /* CR_In_Latin_Extended_A */ + +/* 'In_Latin_Extended_B': Block */ +static const OnigCodePoint CR_In_Latin_Extended_B[] = { + 1, + 0x0180, + 0x024f, +}; /* CR_In_Latin_Extended_B */ + +/* 'In_IPA_Extensions': Block */ +static const OnigCodePoint CR_In_IPA_Extensions[] = { + 1, + 0x0250, + 0x02af, +}; /* CR_In_IPA_Extensions */ + +/* 'In_Spacing_Modifier_Letters': Block */ +static const OnigCodePoint CR_In_Spacing_Modifier_Letters[] = { + 1, + 0x02b0, + 0x02ff, +}; /* CR_In_Spacing_Modifier_Letters */ + +/* 'In_Combining_Diacritical_Marks': Block */ +static const OnigCodePoint CR_In_Combining_Diacritical_Marks[] = { + 1, + 0x0300, + 0x036f, +}; /* CR_In_Combining_Diacritical_Marks */ + +/* 'In_Greek_and_Coptic': Block */ +static const OnigCodePoint CR_In_Greek_and_Coptic[] = { + 1, + 0x0370, + 0x03ff, +}; /* CR_In_Greek_and_Coptic */ + +/* 'In_Cyrillic': Block */ +static const OnigCodePoint CR_In_Cyrillic[] = { + 1, + 0x0400, + 0x04ff, +}; /* CR_In_Cyrillic */ + +/* 'In_Cyrillic_Supplement': Block */ +static const OnigCodePoint CR_In_Cyrillic_Supplement[] = { + 1, + 0x0500, + 0x052f, +}; /* CR_In_Cyrillic_Supplement */ + +/* 'In_Armenian': Block */ +static const OnigCodePoint CR_In_Armenian[] = { + 1, + 0x0530, + 0x058f, +}; /* CR_In_Armenian */ + +/* 'In_Hebrew': Block */ +static const OnigCodePoint CR_In_Hebrew[] = { + 1, + 0x0590, + 0x05ff, +}; /* CR_In_Hebrew */ + +/* 'In_Arabic': Block */ +static const OnigCodePoint CR_In_Arabic[] = { + 1, + 0x0600, + 0x06ff, +}; /* CR_In_Arabic */ + +/* 'In_Syriac': Block */ +static const OnigCodePoint CR_In_Syriac[] = { + 1, + 0x0700, + 0x074f, +}; /* CR_In_Syriac */ + +/* 'In_Arabic_Supplement': Block */ +static const OnigCodePoint CR_In_Arabic_Supplement[] = { + 1, + 0x0750, + 0x077f, +}; /* CR_In_Arabic_Supplement */ + +/* 'In_Thaana': Block */ +static const OnigCodePoint CR_In_Thaana[] = { + 1, + 0x0780, + 0x07bf, +}; /* CR_In_Thaana */ + +/* 'In_NKo': Block */ +static const OnigCodePoint CR_In_NKo[] = { + 1, + 0x07c0, + 0x07ff, +}; /* CR_In_NKo */ + +/* 'In_Samaritan': Block */ +static const OnigCodePoint CR_In_Samaritan[] = { + 1, + 0x0800, + 0x083f, +}; /* CR_In_Samaritan */ + +/* 'In_Mandaic': Block */ +static const OnigCodePoint CR_In_Mandaic[] = { + 1, + 0x0840, + 0x085f, +}; /* CR_In_Mandaic */ + +/* 'In_Arabic_Extended_A': Block */ +static const OnigCodePoint CR_In_Arabic_Extended_A[] = { + 1, + 0x08a0, + 0x08ff, +}; /* CR_In_Arabic_Extended_A */ + +/* 'In_Devanagari': Block */ +static const OnigCodePoint CR_In_Devanagari[] = { + 1, + 0x0900, + 0x097f, +}; /* CR_In_Devanagari */ + +/* 'In_Bengali': Block */ +static const OnigCodePoint CR_In_Bengali[] = { + 1, + 0x0980, + 0x09ff, +}; /* CR_In_Bengali */ + +/* 'In_Gurmukhi': Block */ +static const OnigCodePoint CR_In_Gurmukhi[] = { + 1, + 0x0a00, + 0x0a7f, +}; /* CR_In_Gurmukhi */ + +/* 'In_Gujarati': Block */ +static const OnigCodePoint CR_In_Gujarati[] = { + 1, + 0x0a80, + 0x0aff, +}; /* CR_In_Gujarati */ + +/* 'In_Oriya': Block */ +static const OnigCodePoint CR_In_Oriya[] = { + 1, + 0x0b00, + 0x0b7f, +}; /* CR_In_Oriya */ + +/* 'In_Tamil': Block */ +static const OnigCodePoint CR_In_Tamil[] = { + 1, + 0x0b80, + 0x0bff, +}; /* CR_In_Tamil */ + +/* 'In_Telugu': Block */ +static const OnigCodePoint CR_In_Telugu[] = { + 1, + 0x0c00, + 0x0c7f, +}; /* CR_In_Telugu */ + +/* 'In_Kannada': Block */ +static const OnigCodePoint CR_In_Kannada[] = { + 1, + 0x0c80, + 0x0cff, +}; /* CR_In_Kannada */ + +/* 'In_Malayalam': Block */ +static const OnigCodePoint CR_In_Malayalam[] = { + 1, + 0x0d00, + 0x0d7f, +}; /* CR_In_Malayalam */ + +/* 'In_Sinhala': Block */ +static const OnigCodePoint CR_In_Sinhala[] = { + 1, + 0x0d80, + 0x0dff, +}; /* CR_In_Sinhala */ + +/* 'In_Thai': Block */ +static const OnigCodePoint CR_In_Thai[] = { + 1, + 0x0e00, + 0x0e7f, +}; /* CR_In_Thai */ + +/* 'In_Lao': Block */ +static const OnigCodePoint CR_In_Lao[] = { + 1, + 0x0e80, + 0x0eff, +}; /* CR_In_Lao */ + +/* 'In_Tibetan': Block */ +static const OnigCodePoint CR_In_Tibetan[] = { + 1, + 0x0f00, + 0x0fff, +}; /* CR_In_Tibetan */ + +/* 'In_Myanmar': Block */ +static const OnigCodePoint CR_In_Myanmar[] = { + 1, + 0x1000, + 0x109f, +}; /* CR_In_Myanmar */ + +/* 'In_Georgian': Block */ +static const OnigCodePoint CR_In_Georgian[] = { + 1, + 0x10a0, + 0x10ff, +}; /* CR_In_Georgian */ + +/* 'In_Hangul_Jamo': Block */ +static const OnigCodePoint CR_In_Hangul_Jamo[] = { + 1, + 0x1100, + 0x11ff, +}; /* CR_In_Hangul_Jamo */ + +/* 'In_Ethiopic': Block */ +static const OnigCodePoint CR_In_Ethiopic[] = { + 1, + 0x1200, + 0x137f, +}; /* CR_In_Ethiopic */ + +/* 'In_Ethiopic_Supplement': Block */ +static const OnigCodePoint CR_In_Ethiopic_Supplement[] = { + 1, + 0x1380, + 0x139f, +}; /* CR_In_Ethiopic_Supplement */ + +/* 'In_Cherokee': Block */ +static const OnigCodePoint CR_In_Cherokee[] = { + 1, + 0x13a0, + 0x13ff, +}; /* CR_In_Cherokee */ + +/* 'In_Unified_Canadian_Aboriginal_Syllabics': Block */ +static const OnigCodePoint CR_In_Unified_Canadian_Aboriginal_Syllabics[] = { + 1, + 0x1400, + 0x167f, +}; /* CR_In_Unified_Canadian_Aboriginal_Syllabics */ + +/* 'In_Ogham': Block */ +static const OnigCodePoint CR_In_Ogham[] = { + 1, + 0x1680, + 0x169f, +}; /* CR_In_Ogham */ + +/* 'In_Runic': Block */ +static const OnigCodePoint CR_In_Runic[] = { + 1, + 0x16a0, + 0x16ff, +}; /* CR_In_Runic */ + +/* 'In_Tagalog': Block */ +static const OnigCodePoint CR_In_Tagalog[] = { + 1, + 0x1700, + 0x171f, +}; /* CR_In_Tagalog */ + +/* 'In_Hanunoo': Block */ +static const OnigCodePoint CR_In_Hanunoo[] = { + 1, + 0x1720, + 0x173f, +}; /* CR_In_Hanunoo */ + +/* 'In_Buhid': Block */ +static const OnigCodePoint CR_In_Buhid[] = { + 1, + 0x1740, + 0x175f, +}; /* CR_In_Buhid */ + +/* 'In_Tagbanwa': Block */ +static const OnigCodePoint CR_In_Tagbanwa[] = { + 1, + 0x1760, + 0x177f, +}; /* CR_In_Tagbanwa */ + +/* 'In_Khmer': Block */ +static const OnigCodePoint CR_In_Khmer[] = { + 1, + 0x1780, + 0x17ff, +}; /* CR_In_Khmer */ + +/* 'In_Mongolian': Block */ +static const OnigCodePoint CR_In_Mongolian[] = { + 1, + 0x1800, + 0x18af, +}; /* CR_In_Mongolian */ + +/* 'In_Unified_Canadian_Aboriginal_Syllabics_Extended': Block */ +static const OnigCodePoint + CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended[] + = { + 1, + 0x18b0, + 0x18ff, +}; /* CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended */ + +/* 'In_Limbu': Block */ +static const OnigCodePoint CR_In_Limbu[] = { + 1, + 0x1900, + 0x194f, +}; /* CR_In_Limbu */ + +/* 'In_Tai_Le': Block */ +static const OnigCodePoint CR_In_Tai_Le[] = { + 1, + 0x1950, + 0x197f, +}; /* CR_In_Tai_Le */ + +/* 'In_New_Tai_Lue': Block */ +static const OnigCodePoint CR_In_New_Tai_Lue[] = { + 1, + 0x1980, + 0x19df, +}; /* CR_In_New_Tai_Lue */ + +/* 'In_Khmer_Symbols': Block */ +static const OnigCodePoint CR_In_Khmer_Symbols[] = { + 1, + 0x19e0, + 0x19ff, +}; /* CR_In_Khmer_Symbols */ + +/* 'In_Buginese': Block */ +static const OnigCodePoint CR_In_Buginese[] = { + 1, + 0x1a00, + 0x1a1f, +}; /* CR_In_Buginese */ + +/* 'In_Tai_Tham': Block */ +static const OnigCodePoint CR_In_Tai_Tham[] = { + 1, + 0x1a20, + 0x1aaf, +}; /* CR_In_Tai_Tham */ + +/* 'In_Combining_Diacritical_Marks_Extended': Block */ +static const OnigCodePoint CR_In_Combining_Diacritical_Marks_Extended[] = { + 1, + 0x1ab0, + 0x1aff, +}; /* CR_In_Combining_Diacritical_Marks_Extended */ + +/* 'In_Balinese': Block */ +static const OnigCodePoint CR_In_Balinese[] = { + 1, + 0x1b00, + 0x1b7f, +}; /* CR_In_Balinese */ + +/* 'In_Sundanese': Block */ +static const OnigCodePoint CR_In_Sundanese[] = { + 1, + 0x1b80, + 0x1bbf, +}; /* CR_In_Sundanese */ + +/* 'In_Batak': Block */ +static const OnigCodePoint CR_In_Batak[] = { + 1, + 0x1bc0, + 0x1bff, +}; /* CR_In_Batak */ + +/* 'In_Lepcha': Block */ +static const OnigCodePoint CR_In_Lepcha[] = { + 1, + 0x1c00, + 0x1c4f, +}; /* CR_In_Lepcha */ + +/* 'In_Ol_Chiki': Block */ +# define CR_In_Ol_Chiki CR_Ol_Chiki + +/* 'In_Cyrillic_Extended_C': Block */ +static const OnigCodePoint CR_In_Cyrillic_Extended_C[] = { + 1, + 0x1c80, + 0x1c8f, +}; /* CR_In_Cyrillic_Extended_C */ + +/* 'In_Sundanese_Supplement': Block */ +static const OnigCodePoint CR_In_Sundanese_Supplement[] = { + 1, + 0x1cc0, + 0x1ccf, +}; /* CR_In_Sundanese_Supplement */ + +/* 'In_Vedic_Extensions': Block */ +static const OnigCodePoint CR_In_Vedic_Extensions[] = { + 1, + 0x1cd0, + 0x1cff, +}; /* CR_In_Vedic_Extensions */ + +/* 'In_Phonetic_Extensions': Block */ +static const OnigCodePoint CR_In_Phonetic_Extensions[] = { + 1, + 0x1d00, + 0x1d7f, +}; /* CR_In_Phonetic_Extensions */ + +/* 'In_Phonetic_Extensions_Supplement': Block */ +static const OnigCodePoint CR_In_Phonetic_Extensions_Supplement[] = { + 1, + 0x1d80, + 0x1dbf, +}; /* CR_In_Phonetic_Extensions_Supplement */ + +/* 'In_Combining_Diacritical_Marks_Supplement': Block */ +static const OnigCodePoint CR_In_Combining_Diacritical_Marks_Supplement[] = { + 1, + 0x1dc0, + 0x1dff, +}; /* CR_In_Combining_Diacritical_Marks_Supplement */ + +/* 'In_Latin_Extended_Additional': Block */ +static const OnigCodePoint CR_In_Latin_Extended_Additional[] = { + 1, + 0x1e00, + 0x1eff, +}; /* CR_In_Latin_Extended_Additional */ + +/* 'In_Greek_Extended': Block */ +static const OnigCodePoint CR_In_Greek_Extended[] = { + 1, + 0x1f00, + 0x1fff, +}; /* CR_In_Greek_Extended */ + +/* 'In_General_Punctuation': Block */ +static const OnigCodePoint CR_In_General_Punctuation[] = { + 1, + 0x2000, + 0x206f, +}; /* CR_In_General_Punctuation */ + +/* 'In_Superscripts_and_Subscripts': Block */ +static const OnigCodePoint CR_In_Superscripts_and_Subscripts[] = { + 1, + 0x2070, + 0x209f, +}; /* CR_In_Superscripts_and_Subscripts */ + +/* 'In_Currency_Symbols': Block */ +static const OnigCodePoint CR_In_Currency_Symbols[] = { + 1, + 0x20a0, + 0x20cf, +}; /* CR_In_Currency_Symbols */ + +/* 'In_Combining_Diacritical_Marks_for_Symbols': Block */ +static const OnigCodePoint CR_In_Combining_Diacritical_Marks_for_Symbols[] = { + 1, + 0x20d0, + 0x20ff, +}; /* CR_In_Combining_Diacritical_Marks_for_Symbols */ + +/* 'In_Letterlike_Symbols': Block */ +static const OnigCodePoint CR_In_Letterlike_Symbols[] = { + 1, + 0x2100, + 0x214f, +}; /* CR_In_Letterlike_Symbols */ + +/* 'In_Number_Forms': Block */ +static const OnigCodePoint CR_In_Number_Forms[] = { + 1, + 0x2150, + 0x218f, +}; /* CR_In_Number_Forms */ + +/* 'In_Arrows': Block */ +static const OnigCodePoint CR_In_Arrows[] = { + 1, + 0x2190, + 0x21ff, +}; /* CR_In_Arrows */ + +/* 'In_Mathematical_Operators': Block */ +static const OnigCodePoint CR_In_Mathematical_Operators[] = { + 1, + 0x2200, + 0x22ff, +}; /* CR_In_Mathematical_Operators */ + +/* 'In_Miscellaneous_Technical': Block */ +static const OnigCodePoint CR_In_Miscellaneous_Technical[] = { + 1, + 0x2300, + 0x23ff, +}; /* CR_In_Miscellaneous_Technical */ + +/* 'In_Control_Pictures': Block */ +static const OnigCodePoint CR_In_Control_Pictures[] = { + 1, + 0x2400, + 0x243f, +}; /* CR_In_Control_Pictures */ + +/* 'In_Optical_Character_Recognition': Block */ +static const OnigCodePoint CR_In_Optical_Character_Recognition[] = { + 1, + 0x2440, + 0x245f, +}; /* CR_In_Optical_Character_Recognition */ + +/* 'In_Enclosed_Alphanumerics': Block */ +static const OnigCodePoint CR_In_Enclosed_Alphanumerics[] = { + 1, + 0x2460, + 0x24ff, +}; /* CR_In_Enclosed_Alphanumerics */ + +/* 'In_Box_Drawing': Block */ +static const OnigCodePoint CR_In_Box_Drawing[] = { + 1, + 0x2500, + 0x257f, +}; /* CR_In_Box_Drawing */ + +/* 'In_Block_Elements': Block */ +static const OnigCodePoint CR_In_Block_Elements[] = { + 1, + 0x2580, + 0x259f, +}; /* CR_In_Block_Elements */ + +/* 'In_Geometric_Shapes': Block */ +static const OnigCodePoint CR_In_Geometric_Shapes[] = { + 1, + 0x25a0, + 0x25ff, +}; /* CR_In_Geometric_Shapes */ + +/* 'In_Miscellaneous_Symbols': Block */ +static const OnigCodePoint CR_In_Miscellaneous_Symbols[] = { + 1, + 0x2600, + 0x26ff, +}; /* CR_In_Miscellaneous_Symbols */ + +/* 'In_Dingbats': Block */ +static const OnigCodePoint CR_In_Dingbats[] = { + 1, + 0x2700, + 0x27bf, +}; /* CR_In_Dingbats */ + +/* 'In_Miscellaneous_Mathematical_Symbols_A': Block */ +static const OnigCodePoint CR_In_Miscellaneous_Mathematical_Symbols_A[] = { + 1, + 0x27c0, + 0x27ef, +}; /* CR_In_Miscellaneous_Mathematical_Symbols_A */ + +/* 'In_Supplemental_Arrows_A': Block */ +static const OnigCodePoint CR_In_Supplemental_Arrows_A[] = { + 1, + 0x27f0, + 0x27ff, +}; /* CR_In_Supplemental_Arrows_A */ + +/* 'In_Braille_Patterns': Block */ +# define CR_In_Braille_Patterns CR_Braille + +/* 'In_Supplemental_Arrows_B': Block */ +static const OnigCodePoint CR_In_Supplemental_Arrows_B[] = { + 1, + 0x2900, + 0x297f, +}; /* CR_In_Supplemental_Arrows_B */ + +/* 'In_Miscellaneous_Mathematical_Symbols_B': Block */ +static const OnigCodePoint CR_In_Miscellaneous_Mathematical_Symbols_B[] = { + 1, + 0x2980, + 0x29ff, +}; /* CR_In_Miscellaneous_Mathematical_Symbols_B */ + +/* 'In_Supplemental_Mathematical_Operators': Block */ +static const OnigCodePoint CR_In_Supplemental_Mathematical_Operators[] = { + 1, + 0x2a00, + 0x2aff, +}; /* CR_In_Supplemental_Mathematical_Operators */ + +/* 'In_Miscellaneous_Symbols_and_Arrows': Block */ +static const OnigCodePoint CR_In_Miscellaneous_Symbols_and_Arrows[] = { + 1, + 0x2b00, + 0x2bff, +}; /* CR_In_Miscellaneous_Symbols_and_Arrows */ + +/* 'In_Glagolitic': Block */ +static const OnigCodePoint CR_In_Glagolitic[] = { + 1, + 0x2c00, + 0x2c5f, +}; /* CR_In_Glagolitic */ + +/* 'In_Latin_Extended_C': Block */ +static const OnigCodePoint CR_In_Latin_Extended_C[] = { + 1, + 0x2c60, + 0x2c7f, +}; /* CR_In_Latin_Extended_C */ + +/* 'In_Coptic': Block */ +static const OnigCodePoint CR_In_Coptic[] = { + 1, + 0x2c80, + 0x2cff, +}; /* CR_In_Coptic */ + +/* 'In_Georgian_Supplement': Block */ +static const OnigCodePoint CR_In_Georgian_Supplement[] = { + 1, + 0x2d00, + 0x2d2f, +}; /* CR_In_Georgian_Supplement */ + +/* 'In_Tifinagh': Block */ +static const OnigCodePoint CR_In_Tifinagh[] = { + 1, + 0x2d30, + 0x2d7f, +}; /* CR_In_Tifinagh */ + +/* 'In_Ethiopic_Extended': Block */ +static const OnigCodePoint CR_In_Ethiopic_Extended[] = { + 1, + 0x2d80, + 0x2ddf, +}; /* CR_In_Ethiopic_Extended */ + +/* 'In_Cyrillic_Extended_A': Block */ +static const OnigCodePoint CR_In_Cyrillic_Extended_A[] = { + 1, + 0x2de0, + 0x2dff, +}; /* CR_In_Cyrillic_Extended_A */ + +/* 'In_Supplemental_Punctuation': Block */ +static const OnigCodePoint CR_In_Supplemental_Punctuation[] = { + 1, + 0x2e00, + 0x2e7f, +}; /* CR_In_Supplemental_Punctuation */ + +/* 'In_CJK_Radicals_Supplement': Block */ +static const OnigCodePoint CR_In_CJK_Radicals_Supplement[] = { + 1, + 0x2e80, + 0x2eff, +}; /* CR_In_CJK_Radicals_Supplement */ + +/* 'In_Kangxi_Radicals': Block */ +static const OnigCodePoint CR_In_Kangxi_Radicals[] = { + 1, + 0x2f00, + 0x2fdf, +}; /* CR_In_Kangxi_Radicals */ + +/* 'In_Ideographic_Description_Characters': Block */ +static const OnigCodePoint CR_In_Ideographic_Description_Characters[] = { + 1, + 0x2ff0, + 0x2fff, +}; /* CR_In_Ideographic_Description_Characters */ + +/* 'In_CJK_Symbols_and_Punctuation': Block */ +static const OnigCodePoint CR_In_CJK_Symbols_and_Punctuation[] = { + 1, + 0x3000, + 0x303f, +}; /* CR_In_CJK_Symbols_and_Punctuation */ + +/* 'In_Hiragana': Block */ +static const OnigCodePoint CR_In_Hiragana[] = { + 1, + 0x3040, + 0x309f, +}; /* CR_In_Hiragana */ + +/* 'In_Katakana': Block */ +static const OnigCodePoint CR_In_Katakana[] = { + 1, + 0x30a0, + 0x30ff, +}; /* CR_In_Katakana */ + +/* 'In_Bopomofo': Block */ +static const OnigCodePoint CR_In_Bopomofo[] = { + 1, + 0x3100, + 0x312f, +}; /* CR_In_Bopomofo */ + +/* 'In_Hangul_Compatibility_Jamo': Block */ +static const OnigCodePoint CR_In_Hangul_Compatibility_Jamo[] = { + 1, + 0x3130, + 0x318f, +}; /* CR_In_Hangul_Compatibility_Jamo */ + +/* 'In_Kanbun': Block */ +static const OnigCodePoint CR_In_Kanbun[] = { + 1, + 0x3190, + 0x319f, +}; /* CR_In_Kanbun */ + +/* 'In_Bopomofo_Extended': Block */ +static const OnigCodePoint CR_In_Bopomofo_Extended[] = { + 1, + 0x31a0, + 0x31bf, +}; /* CR_In_Bopomofo_Extended */ + +/* 'In_CJK_Strokes': Block */ +static const OnigCodePoint CR_In_CJK_Strokes[] = { + 1, + 0x31c0, + 0x31ef, +}; /* CR_In_CJK_Strokes */ + +/* 'In_Katakana_Phonetic_Extensions': Block */ +static const OnigCodePoint CR_In_Katakana_Phonetic_Extensions[] = { + 1, + 0x31f0, + 0x31ff, +}; /* CR_In_Katakana_Phonetic_Extensions */ + +/* 'In_Enclosed_CJK_Letters_and_Months': Block */ +static const OnigCodePoint CR_In_Enclosed_CJK_Letters_and_Months[] = { + 1, + 0x3200, + 0x32ff, +}; /* CR_In_Enclosed_CJK_Letters_and_Months */ + +/* 'In_CJK_Compatibility': Block */ +static const OnigCodePoint CR_In_CJK_Compatibility[] = { + 1, + 0x3300, + 0x33ff, +}; /* CR_In_CJK_Compatibility */ + +/* 'In_CJK_Unified_Ideographs_Extension_A': Block */ +static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_A[] = { + 1, + 0x3400, + 0x4dbf, +}; /* CR_In_CJK_Unified_Ideographs_Extension_A */ + +/* 'In_Yijing_Hexagram_Symbols': Block */ +static const OnigCodePoint CR_In_Yijing_Hexagram_Symbols[] = { + 1, + 0x4dc0, + 0x4dff, +}; /* CR_In_Yijing_Hexagram_Symbols */ + +/* 'In_CJK_Unified_Ideographs': Block */ +static const OnigCodePoint CR_In_CJK_Unified_Ideographs[] = { + 1, + 0x4e00, + 0x9fff, +}; /* CR_In_CJK_Unified_Ideographs */ + +/* 'In_Yi_Syllables': Block */ +static const OnigCodePoint CR_In_Yi_Syllables[] = { + 1, + 0xa000, + 0xa48f, +}; /* CR_In_Yi_Syllables */ + +/* 'In_Yi_Radicals': Block */ +static const OnigCodePoint CR_In_Yi_Radicals[] = { + 1, + 0xa490, + 0xa4cf, +}; /* CR_In_Yi_Radicals */ + +/* 'In_Lisu': Block */ +# define CR_In_Lisu CR_Lisu + +/* 'In_Vai': Block */ +static const OnigCodePoint CR_In_Vai[] = { + 1, + 0xa500, + 0xa63f, +}; /* CR_In_Vai */ + +/* 'In_Cyrillic_Extended_B': Block */ +static const OnigCodePoint CR_In_Cyrillic_Extended_B[] = { + 1, + 0xa640, + 0xa69f, +}; /* CR_In_Cyrillic_Extended_B */ + +/* 'In_Bamum': Block */ +static const OnigCodePoint CR_In_Bamum[] = { + 1, + 0xa6a0, + 0xa6ff, +}; /* CR_In_Bamum */ + +/* 'In_Modifier_Tone_Letters': Block */ +static const OnigCodePoint CR_In_Modifier_Tone_Letters[] = { + 1, + 0xa700, + 0xa71f, +}; /* CR_In_Modifier_Tone_Letters */ + +/* 'In_Latin_Extended_D': Block */ +static const OnigCodePoint CR_In_Latin_Extended_D[] = { + 1, + 0xa720, + 0xa7ff, +}; /* CR_In_Latin_Extended_D */ + +/* 'In_Syloti_Nagri': Block */ +static const OnigCodePoint CR_In_Syloti_Nagri[] = { + 1, + 0xa800, + 0xa82f, +}; /* CR_In_Syloti_Nagri */ + +/* 'In_Common_Indic_Number_Forms': Block */ +static const OnigCodePoint CR_In_Common_Indic_Number_Forms[] = { + 1, + 0xa830, + 0xa83f, +}; /* CR_In_Common_Indic_Number_Forms */ + +/* 'In_Phags_pa': Block */ +static const OnigCodePoint CR_In_Phags_pa[] = { + 1, + 0xa840, + 0xa87f, +}; /* CR_In_Phags_pa */ + +/* 'In_Saurashtra': Block */ +static const OnigCodePoint CR_In_Saurashtra[] = { + 1, + 0xa880, + 0xa8df, +}; /* CR_In_Saurashtra */ + +/* 'In_Devanagari_Extended': Block */ +static const OnigCodePoint CR_In_Devanagari_Extended[] = { + 1, + 0xa8e0, + 0xa8ff, +}; /* CR_In_Devanagari_Extended */ + +/* 'In_Kayah_Li': Block */ +static const OnigCodePoint CR_In_Kayah_Li[] = { + 1, + 0xa900, + 0xa92f, +}; /* CR_In_Kayah_Li */ + +/* 'In_Rejang': Block */ +static const OnigCodePoint CR_In_Rejang[] = { + 1, + 0xa930, + 0xa95f, +}; /* CR_In_Rejang */ + +/* 'In_Hangul_Jamo_Extended_A': Block */ +static const OnigCodePoint CR_In_Hangul_Jamo_Extended_A[] = { + 1, + 0xa960, + 0xa97f, +}; /* CR_In_Hangul_Jamo_Extended_A */ + +/* 'In_Javanese': Block */ +static const OnigCodePoint CR_In_Javanese[] = { + 1, + 0xa980, + 0xa9df, +}; /* CR_In_Javanese */ + +/* 'In_Myanmar_Extended_B': Block */ +static const OnigCodePoint CR_In_Myanmar_Extended_B[] = { + 1, + 0xa9e0, + 0xa9ff, +}; /* CR_In_Myanmar_Extended_B */ + +/* 'In_Cham': Block */ +static const OnigCodePoint CR_In_Cham[] = { + 1, + 0xaa00, + 0xaa5f, +}; /* CR_In_Cham */ + +/* 'In_Myanmar_Extended_A': Block */ +static const OnigCodePoint CR_In_Myanmar_Extended_A[] = { + 1, + 0xaa60, + 0xaa7f, +}; /* CR_In_Myanmar_Extended_A */ + +/* 'In_Tai_Viet': Block */ +static const OnigCodePoint CR_In_Tai_Viet[] = { + 1, + 0xaa80, + 0xaadf, +}; /* CR_In_Tai_Viet */ + +/* 'In_Meetei_Mayek_Extensions': Block */ +static const OnigCodePoint CR_In_Meetei_Mayek_Extensions[] = { + 1, + 0xaae0, + 0xaaff, +}; /* CR_In_Meetei_Mayek_Extensions */ + +/* 'In_Ethiopic_Extended_A': Block */ +static const OnigCodePoint CR_In_Ethiopic_Extended_A[] = { + 1, + 0xab00, + 0xab2f, +}; /* CR_In_Ethiopic_Extended_A */ + +/* 'In_Latin_Extended_E': Block */ +static const OnigCodePoint CR_In_Latin_Extended_E[] = { + 1, + 0xab30, + 0xab6f, +}; /* CR_In_Latin_Extended_E */ + +/* 'In_Cherokee_Supplement': Block */ +static const OnigCodePoint CR_In_Cherokee_Supplement[] = { + 1, + 0xab70, + 0xabbf, +}; /* CR_In_Cherokee_Supplement */ + +/* 'In_Meetei_Mayek': Block */ +static const OnigCodePoint CR_In_Meetei_Mayek[] = { + 1, + 0xabc0, + 0xabff, +}; /* CR_In_Meetei_Mayek */ + +/* 'In_Hangul_Syllables': Block */ +static const OnigCodePoint CR_In_Hangul_Syllables[] = { + 1, + 0xac00, + 0xd7af, +}; /* CR_In_Hangul_Syllables */ + +/* 'In_Hangul_Jamo_Extended_B': Block */ +static const OnigCodePoint CR_In_Hangul_Jamo_Extended_B[] = { + 1, + 0xd7b0, + 0xd7ff, +}; /* CR_In_Hangul_Jamo_Extended_B */ + +/* 'In_High_Surrogates': Block */ +static const OnigCodePoint CR_In_High_Surrogates[] = { + 1, + 0xd800, + 0xdb7f, +}; /* CR_In_High_Surrogates */ + +/* 'In_High_Private_Use_Surrogates': Block */ +static const OnigCodePoint CR_In_High_Private_Use_Surrogates[] = { + 1, + 0xdb80, + 0xdbff, +}; /* CR_In_High_Private_Use_Surrogates */ + +/* 'In_Low_Surrogates': Block */ +static const OnigCodePoint CR_In_Low_Surrogates[] = { + 1, + 0xdc00, + 0xdfff, +}; /* CR_In_Low_Surrogates */ + +/* 'In_Private_Use_Area': Block */ +static const OnigCodePoint CR_In_Private_Use_Area[] = { + 1, + 0xe000, + 0xf8ff, +}; /* CR_In_Private_Use_Area */ + +/* 'In_CJK_Compatibility_Ideographs': Block */ +static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs[] = { + 1, + 0xf900, + 0xfaff, +}; /* CR_In_CJK_Compatibility_Ideographs */ + +/* 'In_Alphabetic_Presentation_Forms': Block */ +static const OnigCodePoint CR_In_Alphabetic_Presentation_Forms[] = { + 1, + 0xfb00, + 0xfb4f, +}; /* CR_In_Alphabetic_Presentation_Forms */ + +/* 'In_Arabic_Presentation_Forms_A': Block */ +static const OnigCodePoint CR_In_Arabic_Presentation_Forms_A[] = { + 1, + 0xfb50, + 0xfdff, +}; /* CR_In_Arabic_Presentation_Forms_A */ + +/* 'In_Variation_Selectors': Block */ +static const OnigCodePoint CR_In_Variation_Selectors[] = { + 1, + 0xfe00, + 0xfe0f, +}; /* CR_In_Variation_Selectors */ + +/* 'In_Vertical_Forms': Block */ +static const OnigCodePoint CR_In_Vertical_Forms[] = { + 1, + 0xfe10, + 0xfe1f, +}; /* CR_In_Vertical_Forms */ + +/* 'In_Combining_Half_Marks': Block */ +static const OnigCodePoint CR_In_Combining_Half_Marks[] = { + 1, + 0xfe20, + 0xfe2f, +}; /* CR_In_Combining_Half_Marks */ + +/* 'In_CJK_Compatibility_Forms': Block */ +static const OnigCodePoint CR_In_CJK_Compatibility_Forms[] = { + 1, + 0xfe30, + 0xfe4f, +}; /* CR_In_CJK_Compatibility_Forms */ + +/* 'In_Small_Form_Variants': Block */ +static const OnigCodePoint CR_In_Small_Form_Variants[] = { + 1, + 0xfe50, + 0xfe6f, +}; /* CR_In_Small_Form_Variants */ + +/* 'In_Arabic_Presentation_Forms_B': Block */ +static const OnigCodePoint CR_In_Arabic_Presentation_Forms_B[] = { + 1, + 0xfe70, + 0xfeff, +}; /* CR_In_Arabic_Presentation_Forms_B */ + +/* 'In_Halfwidth_and_Fullwidth_Forms': Block */ +static const OnigCodePoint CR_In_Halfwidth_and_Fullwidth_Forms[] = { + 1, + 0xff00, + 0xffef, +}; /* CR_In_Halfwidth_and_Fullwidth_Forms */ + +/* 'In_Specials': Block */ +static const OnigCodePoint CR_In_Specials[] = { + 1, + 0xfff0, + 0xffff, +}; /* CR_In_Specials */ + +/* 'In_Linear_B_Syllabary': Block */ +static const OnigCodePoint CR_In_Linear_B_Syllabary[] = { + 1, + 0x10000, + 0x1007f, +}; /* CR_In_Linear_B_Syllabary */ + +/* 'In_Linear_B_Ideograms': Block */ +static const OnigCodePoint CR_In_Linear_B_Ideograms[] = { + 1, + 0x10080, + 0x100ff, +}; /* CR_In_Linear_B_Ideograms */ + +/* 'In_Aegean_Numbers': Block */ +static const OnigCodePoint CR_In_Aegean_Numbers[] = { + 1, + 0x10100, + 0x1013f, +}; /* CR_In_Aegean_Numbers */ + +/* 'In_Ancient_Greek_Numbers': Block */ +static const OnigCodePoint CR_In_Ancient_Greek_Numbers[] = { + 1, + 0x10140, + 0x1018f, +}; /* CR_In_Ancient_Greek_Numbers */ + +/* 'In_Ancient_Symbols': Block */ +static const OnigCodePoint CR_In_Ancient_Symbols[] = { + 1, + 0x10190, + 0x101cf, +}; /* CR_In_Ancient_Symbols */ + +/* 'In_Phaistos_Disc': Block */ +static const OnigCodePoint CR_In_Phaistos_Disc[] = { + 1, + 0x101d0, + 0x101ff, +}; /* CR_In_Phaistos_Disc */ + +/* 'In_Lycian': Block */ +static const OnigCodePoint CR_In_Lycian[] = { + 1, + 0x10280, + 0x1029f, +}; /* CR_In_Lycian */ + +/* 'In_Carian': Block */ +static const OnigCodePoint CR_In_Carian[] = { + 1, + 0x102a0, + 0x102df, +}; /* CR_In_Carian */ + +/* 'In_Coptic_Epact_Numbers': Block */ +static const OnigCodePoint CR_In_Coptic_Epact_Numbers[] = { + 1, + 0x102e0, + 0x102ff, +}; /* CR_In_Coptic_Epact_Numbers */ + +/* 'In_Old_Italic': Block */ +static const OnigCodePoint CR_In_Old_Italic[] = { + 1, + 0x10300, + 0x1032f, +}; /* CR_In_Old_Italic */ + +/* 'In_Gothic': Block */ +static const OnigCodePoint CR_In_Gothic[] = { + 1, + 0x10330, + 0x1034f, +}; /* CR_In_Gothic */ + +/* 'In_Old_Permic': Block */ +static const OnigCodePoint CR_In_Old_Permic[] = { + 1, + 0x10350, + 0x1037f, +}; /* CR_In_Old_Permic */ + +/* 'In_Ugaritic': Block */ +static const OnigCodePoint CR_In_Ugaritic[] = { + 1, + 0x10380, + 0x1039f, +}; /* CR_In_Ugaritic */ + +/* 'In_Old_Persian': Block */ +static const OnigCodePoint CR_In_Old_Persian[] = { + 1, + 0x103a0, + 0x103df, +}; /* CR_In_Old_Persian */ + +/* 'In_Deseret': Block */ +# define CR_In_Deseret CR_Deseret + +/* 'In_Shavian': Block */ +# define CR_In_Shavian CR_Shavian + +/* 'In_Osmanya': Block */ +static const OnigCodePoint CR_In_Osmanya[] = { + 1, + 0x10480, + 0x104af, +}; /* CR_In_Osmanya */ + +/* 'In_Osage': Block */ +static const OnigCodePoint CR_In_Osage[] = { + 1, + 0x104b0, + 0x104ff, +}; /* CR_In_Osage */ + +/* 'In_Elbasan': Block */ +static const OnigCodePoint CR_In_Elbasan[] = { + 1, + 0x10500, + 0x1052f, +}; /* CR_In_Elbasan */ + +/* 'In_Caucasian_Albanian': Block */ +static const OnigCodePoint CR_In_Caucasian_Albanian[] = { + 1, + 0x10530, + 0x1056f, +}; /* CR_In_Caucasian_Albanian */ + +/* 'In_Linear_A': Block */ +static const OnigCodePoint CR_In_Linear_A[] = { + 1, + 0x10600, + 0x1077f, +}; /* CR_In_Linear_A */ + +/* 'In_Cypriot_Syllabary': Block */ +static const OnigCodePoint CR_In_Cypriot_Syllabary[] = { + 1, + 0x10800, + 0x1083f, +}; /* CR_In_Cypriot_Syllabary */ + +/* 'In_Imperial_Aramaic': Block */ +static const OnigCodePoint CR_In_Imperial_Aramaic[] = { + 1, + 0x10840, + 0x1085f, +}; /* CR_In_Imperial_Aramaic */ + +/* 'In_Palmyrene': Block */ +# define CR_In_Palmyrene CR_Palmyrene + +/* 'In_Nabataean': Block */ +static const OnigCodePoint CR_In_Nabataean[] = { + 1, + 0x10880, + 0x108af, +}; /* CR_In_Nabataean */ + +/* 'In_Hatran': Block */ +static const OnigCodePoint CR_In_Hatran[] = { + 1, + 0x108e0, + 0x108ff, +}; /* CR_In_Hatran */ + +/* 'In_Phoenician': Block */ +static const OnigCodePoint CR_In_Phoenician[] = { + 1, + 0x10900, + 0x1091f, +}; /* CR_In_Phoenician */ + +/* 'In_Lydian': Block */ +static const OnigCodePoint CR_In_Lydian[] = { + 1, + 0x10920, + 0x1093f, +}; /* CR_In_Lydian */ + +/* 'In_Meroitic_Hieroglyphs': Block */ +# define CR_In_Meroitic_Hieroglyphs CR_Meroitic_Hieroglyphs + +/* 'In_Meroitic_Cursive': Block */ +static const OnigCodePoint CR_In_Meroitic_Cursive[] = { + 1, + 0x109a0, + 0x109ff, +}; /* CR_In_Meroitic_Cursive */ + +/* 'In_Kharoshthi': Block */ +static const OnigCodePoint CR_In_Kharoshthi[] = { + 1, + 0x10a00, + 0x10a5f, +}; /* CR_In_Kharoshthi */ + +/* 'In_Old_South_Arabian': Block */ +# define CR_In_Old_South_Arabian CR_Old_South_Arabian + +/* 'In_Old_North_Arabian': Block */ +# define CR_In_Old_North_Arabian CR_Old_North_Arabian + +/* 'In_Manichaean': Block */ +static const OnigCodePoint CR_In_Manichaean[] = { + 1, + 0x10ac0, + 0x10aff, +}; /* CR_In_Manichaean */ + +/* 'In_Avestan': Block */ +static const OnigCodePoint CR_In_Avestan[] = { + 1, + 0x10b00, + 0x10b3f, +}; /* CR_In_Avestan */ + +/* 'In_Inscriptional_Parthian': Block */ +static const OnigCodePoint CR_In_Inscriptional_Parthian[] = { + 1, + 0x10b40, + 0x10b5f, +}; /* CR_In_Inscriptional_Parthian */ + +/* 'In_Inscriptional_Pahlavi': Block */ +static const OnigCodePoint CR_In_Inscriptional_Pahlavi[] = { + 1, + 0x10b60, + 0x10b7f, +}; /* CR_In_Inscriptional_Pahlavi */ + +/* 'In_Psalter_Pahlavi': Block */ +static const OnigCodePoint CR_In_Psalter_Pahlavi[] = { + 1, + 0x10b80, + 0x10baf, +}; /* CR_In_Psalter_Pahlavi */ + +/* 'In_Old_Turkic': Block */ +static const OnigCodePoint CR_In_Old_Turkic[] = { + 1, + 0x10c00, + 0x10c4f, +}; /* CR_In_Old_Turkic */ + +/* 'In_Old_Hungarian': Block */ +static const OnigCodePoint CR_In_Old_Hungarian[] = { + 1, + 0x10c80, + 0x10cff, +}; /* CR_In_Old_Hungarian */ + +/* 'In_Rumi_Numeral_Symbols': Block */ +static const OnigCodePoint CR_In_Rumi_Numeral_Symbols[] = { + 1, + 0x10e60, + 0x10e7f, +}; /* CR_In_Rumi_Numeral_Symbols */ + +/* 'In_Brahmi': Block */ +static const OnigCodePoint CR_In_Brahmi[] = { + 1, + 0x11000, + 0x1107f, +}; /* CR_In_Brahmi */ + +/* 'In_Kaithi': Block */ +static const OnigCodePoint CR_In_Kaithi[] = { + 1, + 0x11080, + 0x110cf, +}; /* CR_In_Kaithi */ + +/* 'In_Sora_Sompeng': Block */ +static const OnigCodePoint CR_In_Sora_Sompeng[] = { + 1, + 0x110d0, + 0x110ff, +}; /* CR_In_Sora_Sompeng */ + +/* 'In_Chakma': Block */ +static const OnigCodePoint CR_In_Chakma[] = { + 1, + 0x11100, + 0x1114f, +}; /* CR_In_Chakma */ + +/* 'In_Mahajani': Block */ +static const OnigCodePoint CR_In_Mahajani[] = { + 1, + 0x11150, + 0x1117f, +}; /* CR_In_Mahajani */ + +/* 'In_Sharada': Block */ +static const OnigCodePoint CR_In_Sharada[] = { + 1, + 0x11180, + 0x111df, +}; /* CR_In_Sharada */ + +/* 'In_Sinhala_Archaic_Numbers': Block */ +static const OnigCodePoint CR_In_Sinhala_Archaic_Numbers[] = { + 1, + 0x111e0, + 0x111ff, +}; /* CR_In_Sinhala_Archaic_Numbers */ + +/* 'In_Khojki': Block */ +static const OnigCodePoint CR_In_Khojki[] = { + 1, + 0x11200, + 0x1124f, +}; /* CR_In_Khojki */ + +/* 'In_Multani': Block */ +static const OnigCodePoint CR_In_Multani[] = { + 1, + 0x11280, + 0x112af, +}; /* CR_In_Multani */ + +/* 'In_Khudawadi': Block */ +static const OnigCodePoint CR_In_Khudawadi[] = { + 1, + 0x112b0, + 0x112ff, +}; /* CR_In_Khudawadi */ + +/* 'In_Grantha': Block */ +static const OnigCodePoint CR_In_Grantha[] = { + 1, + 0x11300, + 0x1137f, +}; /* CR_In_Grantha */ + +/* 'In_Newa': Block */ +static const OnigCodePoint CR_In_Newa[] = { + 1, + 0x11400, + 0x1147f, +}; /* CR_In_Newa */ + +/* 'In_Tirhuta': Block */ +static const OnigCodePoint CR_In_Tirhuta[] = { + 1, + 0x11480, + 0x114df, +}; /* CR_In_Tirhuta */ + +/* 'In_Siddham': Block */ +static const OnigCodePoint CR_In_Siddham[] = { + 1, + 0x11580, + 0x115ff, +}; /* CR_In_Siddham */ + +/* 'In_Modi': Block */ +static const OnigCodePoint CR_In_Modi[] = { + 1, + 0x11600, + 0x1165f, +}; /* CR_In_Modi */ + +/* 'In_Mongolian_Supplement': Block */ +static const OnigCodePoint CR_In_Mongolian_Supplement[] = { + 1, + 0x11660, + 0x1167f, +}; /* CR_In_Mongolian_Supplement */ + +/* 'In_Takri': Block */ +static const OnigCodePoint CR_In_Takri[] = { + 1, + 0x11680, + 0x116cf, +}; /* CR_In_Takri */ + +/* 'In_Ahom': Block */ +static const OnigCodePoint CR_In_Ahom[] = { + 1, + 0x11700, + 0x1173f, +}; /* CR_In_Ahom */ + +/* 'In_Warang_Citi': Block */ +static const OnigCodePoint CR_In_Warang_Citi[] = { + 1, + 0x118a0, + 0x118ff, +}; /* CR_In_Warang_Citi */ + +/* 'In_Pau_Cin_Hau': Block */ +static const OnigCodePoint CR_In_Pau_Cin_Hau[] = { + 1, + 0x11ac0, + 0x11aff, +}; /* CR_In_Pau_Cin_Hau */ + +/* 'In_Bhaiksuki': Block */ +static const OnigCodePoint CR_In_Bhaiksuki[] = { + 1, + 0x11c00, + 0x11c6f, +}; /* CR_In_Bhaiksuki */ + +/* 'In_Marchen': Block */ +static const OnigCodePoint CR_In_Marchen[] = { + 1, + 0x11c70, + 0x11cbf, +}; /* CR_In_Marchen */ + +/* 'In_Cuneiform': Block */ +static const OnigCodePoint CR_In_Cuneiform[] = { + 1, + 0x12000, + 0x123ff, +}; /* CR_In_Cuneiform */ + +/* 'In_Cuneiform_Numbers_and_Punctuation': Block */ +static const OnigCodePoint CR_In_Cuneiform_Numbers_and_Punctuation[] = { + 1, + 0x12400, + 0x1247f, +}; /* CR_In_Cuneiform_Numbers_and_Punctuation */ + +/* 'In_Early_Dynastic_Cuneiform': Block */ +static const OnigCodePoint CR_In_Early_Dynastic_Cuneiform[] = { + 1, + 0x12480, + 0x1254f, +}; /* CR_In_Early_Dynastic_Cuneiform */ + +/* 'In_Egyptian_Hieroglyphs': Block */ +static const OnigCodePoint CR_In_Egyptian_Hieroglyphs[] = { + 1, + 0x13000, + 0x1342f, +}; /* CR_In_Egyptian_Hieroglyphs */ + +/* 'In_Anatolian_Hieroglyphs': Block */ +static const OnigCodePoint CR_In_Anatolian_Hieroglyphs[] = { + 1, + 0x14400, + 0x1467f, +}; /* CR_In_Anatolian_Hieroglyphs */ + +/* 'In_Bamum_Supplement': Block */ +static const OnigCodePoint CR_In_Bamum_Supplement[] = { + 1, + 0x16800, + 0x16a3f, +}; /* CR_In_Bamum_Supplement */ + +/* 'In_Mro': Block */ +static const OnigCodePoint CR_In_Mro[] = { + 1, + 0x16a40, + 0x16a6f, +}; /* CR_In_Mro */ + +/* 'In_Bassa_Vah': Block */ +static const OnigCodePoint CR_In_Bassa_Vah[] = { + 1, + 0x16ad0, + 0x16aff, +}; /* CR_In_Bassa_Vah */ + +/* 'In_Pahawh_Hmong': Block */ +static const OnigCodePoint CR_In_Pahawh_Hmong[] = { + 1, + 0x16b00, + 0x16b8f, +}; /* CR_In_Pahawh_Hmong */ + +/* 'In_Miao': Block */ +static const OnigCodePoint CR_In_Miao[] = { + 1, + 0x16f00, + 0x16f9f, +}; /* CR_In_Miao */ + +/* 'In_Ideographic_Symbols_and_Punctuation': Block */ +static const OnigCodePoint CR_In_Ideographic_Symbols_and_Punctuation[] = { + 1, + 0x16fe0, + 0x16fff, +}; /* CR_In_Ideographic_Symbols_and_Punctuation */ + +/* 'In_Tangut': Block */ +static const OnigCodePoint CR_In_Tangut[] = { + 1, + 0x17000, + 0x187ff, +}; /* CR_In_Tangut */ + +/* 'In_Tangut_Components': Block */ +static const OnigCodePoint CR_In_Tangut_Components[] = { + 1, + 0x18800, + 0x18aff, +}; /* CR_In_Tangut_Components */ + +/* 'In_Kana_Supplement': Block */ +static const OnigCodePoint CR_In_Kana_Supplement[] = { + 1, + 0x1b000, + 0x1b0ff, +}; /* CR_In_Kana_Supplement */ + +/* 'In_Duployan': Block */ +static const OnigCodePoint CR_In_Duployan[] = { + 1, + 0x1bc00, + 0x1bc9f, +}; /* CR_In_Duployan */ + +/* 'In_Shorthand_Format_Controls': Block */ +static const OnigCodePoint CR_In_Shorthand_Format_Controls[] = { + 1, + 0x1bca0, + 0x1bcaf, +}; /* CR_In_Shorthand_Format_Controls */ + +/* 'In_Byzantine_Musical_Symbols': Block */ +static const OnigCodePoint CR_In_Byzantine_Musical_Symbols[] = { + 1, + 0x1d000, + 0x1d0ff, +}; /* CR_In_Byzantine_Musical_Symbols */ + +/* 'In_Musical_Symbols': Block */ +static const OnigCodePoint CR_In_Musical_Symbols[] = { + 1, + 0x1d100, + 0x1d1ff, +}; /* CR_In_Musical_Symbols */ + +/* 'In_Ancient_Greek_Musical_Notation': Block */ +static const OnigCodePoint CR_In_Ancient_Greek_Musical_Notation[] = { + 1, + 0x1d200, + 0x1d24f, +}; /* CR_In_Ancient_Greek_Musical_Notation */ + +/* 'In_Tai_Xuan_Jing_Symbols': Block */ +static const OnigCodePoint CR_In_Tai_Xuan_Jing_Symbols[] = { + 1, + 0x1d300, + 0x1d35f, +}; /* CR_In_Tai_Xuan_Jing_Symbols */ + +/* 'In_Counting_Rod_Numerals': Block */ +static const OnigCodePoint CR_In_Counting_Rod_Numerals[] = { + 1, + 0x1d360, + 0x1d37f, +}; /* CR_In_Counting_Rod_Numerals */ + +/* 'In_Mathematical_Alphanumeric_Symbols': Block */ +static const OnigCodePoint CR_In_Mathematical_Alphanumeric_Symbols[] = { + 1, + 0x1d400, + 0x1d7ff, +}; /* CR_In_Mathematical_Alphanumeric_Symbols */ + +/* 'In_Sutton_SignWriting': Block */ +static const OnigCodePoint CR_In_Sutton_SignWriting[] = { + 1, + 0x1d800, + 0x1daaf, +}; /* CR_In_Sutton_SignWriting */ + +/* 'In_Glagolitic_Supplement': Block */ +static const OnigCodePoint CR_In_Glagolitic_Supplement[] = { + 1, + 0x1e000, + 0x1e02f, +}; /* CR_In_Glagolitic_Supplement */ + +/* 'In_Mende_Kikakui': Block */ +static const OnigCodePoint CR_In_Mende_Kikakui[] = { + 1, + 0x1e800, + 0x1e8df, +}; /* CR_In_Mende_Kikakui */ + +/* 'In_Adlam': Block */ +static const OnigCodePoint CR_In_Adlam[] = { + 1, + 0x1e900, + 0x1e95f, +}; /* CR_In_Adlam */ + +/* 'In_Arabic_Mathematical_Alphabetic_Symbols': Block */ +static const OnigCodePoint CR_In_Arabic_Mathematical_Alphabetic_Symbols[] = { + 1, + 0x1ee00, + 0x1eeff, +}; /* CR_In_Arabic_Mathematical_Alphabetic_Symbols */ + +/* 'In_Mahjong_Tiles': Block */ +static const OnigCodePoint CR_In_Mahjong_Tiles[] = { + 1, + 0x1f000, + 0x1f02f, +}; /* CR_In_Mahjong_Tiles */ + +/* 'In_Domino_Tiles': Block */ +static const OnigCodePoint CR_In_Domino_Tiles[] = { + 1, + 0x1f030, + 0x1f09f, +}; /* CR_In_Domino_Tiles */ + +/* 'In_Playing_Cards': Block */ +static const OnigCodePoint CR_In_Playing_Cards[] = { + 1, + 0x1f0a0, + 0x1f0ff, +}; /* CR_In_Playing_Cards */ + +/* 'In_Enclosed_Alphanumeric_Supplement': Block */ +static const OnigCodePoint CR_In_Enclosed_Alphanumeric_Supplement[] = { + 1, + 0x1f100, + 0x1f1ff, +}; /* CR_In_Enclosed_Alphanumeric_Supplement */ + +/* 'In_Enclosed_Ideographic_Supplement': Block */ +static const OnigCodePoint CR_In_Enclosed_Ideographic_Supplement[] = { + 1, + 0x1f200, + 0x1f2ff, +}; /* CR_In_Enclosed_Ideographic_Supplement */ + +/* 'In_Miscellaneous_Symbols_and_Pictographs': Block */ +static const OnigCodePoint CR_In_Miscellaneous_Symbols_and_Pictographs[] = { + 1, + 0x1f300, + 0x1f5ff, +}; /* CR_In_Miscellaneous_Symbols_and_Pictographs */ + +/* 'In_Emoticons': Block */ +static const OnigCodePoint CR_In_Emoticons[] = { + 1, + 0x1f600, + 0x1f64f, +}; /* CR_In_Emoticons */ + +/* 'In_Ornamental_Dingbats': Block */ +static const OnigCodePoint CR_In_Ornamental_Dingbats[] = { + 1, + 0x1f650, + 0x1f67f, +}; /* CR_In_Ornamental_Dingbats */ + +/* 'In_Transport_and_Map_Symbols': Block */ +static const OnigCodePoint CR_In_Transport_and_Map_Symbols[] = { + 1, + 0x1f680, + 0x1f6ff, +}; /* CR_In_Transport_and_Map_Symbols */ + +/* 'In_Alchemical_Symbols': Block */ +static const OnigCodePoint CR_In_Alchemical_Symbols[] = { + 1, + 0x1f700, + 0x1f77f, +}; /* CR_In_Alchemical_Symbols */ + +/* 'In_Geometric_Shapes_Extended': Block */ +static const OnigCodePoint CR_In_Geometric_Shapes_Extended[] = { + 1, + 0x1f780, + 0x1f7ff, +}; /* CR_In_Geometric_Shapes_Extended */ + +/* 'In_Supplemental_Arrows_C': Block */ +static const OnigCodePoint CR_In_Supplemental_Arrows_C[] = { + 1, + 0x1f800, + 0x1f8ff, +}; /* CR_In_Supplemental_Arrows_C */ + +/* 'In_Supplemental_Symbols_and_Pictographs': Block */ +static const OnigCodePoint CR_In_Supplemental_Symbols_and_Pictographs[] = { + 1, + 0x1f900, + 0x1f9ff, +}; /* CR_In_Supplemental_Symbols_and_Pictographs */ + +/* 'In_CJK_Unified_Ideographs_Extension_B': Block */ +static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_B[] = { + 1, + 0x20000, + 0x2a6df, +}; /* CR_In_CJK_Unified_Ideographs_Extension_B */ + +/* 'In_CJK_Unified_Ideographs_Extension_C': Block */ +static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_C[] = { + 1, + 0x2a700, + 0x2b73f, +}; /* CR_In_CJK_Unified_Ideographs_Extension_C */ + +/* 'In_CJK_Unified_Ideographs_Extension_D': Block */ +static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_D[] = { + 1, + 0x2b740, + 0x2b81f, +}; /* CR_In_CJK_Unified_Ideographs_Extension_D */ + +/* 'In_CJK_Unified_Ideographs_Extension_E': Block */ +static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_E[] = { + 1, + 0x2b820, + 0x2ceaf, +}; /* CR_In_CJK_Unified_Ideographs_Extension_E */ + +/* 'In_CJK_Compatibility_Ideographs_Supplement': Block */ +static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs_Supplement[] = { + 1, + 0x2f800, + 0x2fa1f, +}; /* CR_In_CJK_Compatibility_Ideographs_Supplement */ + +/* 'In_Tags': Block */ +static const OnigCodePoint CR_In_Tags[] = { + 1, + 0xe0000, + 0xe007f, +}; /* CR_In_Tags */ + +/* 'In_Variation_Selectors_Supplement': Block */ +static const OnigCodePoint CR_In_Variation_Selectors_Supplement[] = { + 1, + 0xe0100, + 0xe01ef, +}; /* CR_In_Variation_Selectors_Supplement */ + +/* 'In_Supplementary_Private_Use_Area_A': Block */ +static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_A[] = { + 1, + 0xf0000, + 0xfffff, +}; /* CR_In_Supplementary_Private_Use_Area_A */ + +/* 'In_Supplementary_Private_Use_Area_B': Block */ +static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_B[] = { + 1, + 0x100000, + 0x10ffff, +}; /* CR_In_Supplementary_Private_Use_Area_B */ + +/* 'In_No_Block': Block */ +static const OnigCodePoint CR_In_No_Block[] = { + 44, 0x0860, 0x089f, 0x1c90, 0x1cbf, 0x2fe0, 0x2fef, 0x10200, + 0x1027f, 0x103e0, 0x103ff, 0x10570, 0x105ff, 0x10780, 0x107ff, 0x108b0, + 0x108df, 0x10940, 0x1097f, 0x10aa0, 0x10abf, 0x10bb0, 0x10bff, 0x10c50, + 0x10c7f, 0x10d00, 0x10e5f, 0x10e80, 0x10fff, 0x11250, 0x1127f, 0x11380, + 0x113ff, 0x114e0, 0x1157f, 0x116d0, 0x116ff, 0x11740, 0x1189f, 0x11900, + 0x11abf, 0x11b00, 0x11bff, 0x11cc0, 0x11fff, 0x12550, 0x12fff, 0x13430, + 0x143ff, 0x14680, 0x167ff, 0x16a70, 0x16acf, 0x16b90, 0x16eff, 0x16fa0, + 0x16fdf, 0x18b00, 0x1afff, 0x1b100, 0x1bbff, 0x1bcb0, 0x1cfff, 0x1d250, + 0x1d2ff, 0x1d380, 0x1d3ff, 0x1dab0, 0x1dfff, 0x1e030, 0x1e7ff, 0x1e8e0, + 0x1e8ff, 0x1e960, 0x1edff, 0x1ef00, 0x1efff, 0x1fa00, 0x1ffff, 0x2a6e0, + 0x2a6ff, 0x2ceb0, 0x2f7ff, 0x2fa20, 0xdffff, 0xe0080, 0xe00ff, 0xe01f0, + 0xeffff, +}; /* CR_In_No_Block */ + +#endif /* USE_UNICODE_PROPERTIES */ +static const OnigCodePoint *const CodeRanges[] = { + CR_NEWLINE, + CR_Alpha, + CR_Blank, + CR_Cntrl, + CR_Digit, + CR_Graph, + CR_Lower, + CR_Print, + CR_XPosixPunct, + CR_Space, + CR_Upper, + CR_XDigit, + CR_Word, + CR_Alnum, + CR_ASCII, + CR_Punct, +#ifdef USE_UNICODE_PROPERTIES + CR_Any, + CR_Assigned, + CR_C, + CR_Cc, + CR_Cf, + CR_Cn, + CR_Co, + CR_Cs, + CR_L, + CR_LC, + CR_Ll, + CR_Lm, + CR_Lo, + CR_Lt, + CR_Lu, + CR_M, + CR_Mc, + CR_Me, + CR_Mn, + CR_N, + CR_Nd, + CR_Nl, + CR_No, + CR_P, + CR_Pc, + CR_Pd, + CR_Pe, + CR_Pf, + CR_Pi, + CR_Po, + CR_Ps, + CR_S, + CR_Sc, + CR_Sk, + CR_Sm, + CR_So, + CR_Z, + CR_Zl, + CR_Zp, + CR_Zs, + CR_Math, + CR_Alphabetic, + CR_Lowercase, + CR_Uppercase, + CR_Cased, + CR_Case_Ignorable, + CR_Changes_When_Lowercased, + CR_Changes_When_Uppercased, + CR_Changes_When_Titlecased, + CR_Changes_When_Casefolded, + CR_Changes_When_Casemapped, + CR_ID_Start, + CR_ID_Continue, + CR_XID_Start, + CR_XID_Continue, + CR_Default_Ignorable_Code_Point, + CR_Grapheme_Extend, + CR_Grapheme_Base, + CR_Grapheme_Link, + CR_Common, + CR_Latin, + CR_Greek, + CR_Cyrillic, + CR_Armenian, + CR_Hebrew, + CR_Arabic, + CR_Syriac, + CR_Thaana, + CR_Devanagari, + CR_Bengali, + CR_Gurmukhi, + CR_Gujarati, + CR_Oriya, + CR_Tamil, + CR_Telugu, + CR_Kannada, + CR_Malayalam, + CR_Sinhala, + CR_Thai, + CR_Lao, + CR_Tibetan, + CR_Myanmar, + CR_Georgian, + CR_Hangul, + CR_Ethiopic, + CR_Cherokee, + CR_Canadian_Aboriginal, + CR_Ogham, + CR_Runic, + CR_Khmer, + CR_Mongolian, + CR_Hiragana, + CR_Katakana, + CR_Bopomofo, + CR_Han, + CR_Yi, + CR_Old_Italic, + CR_Gothic, + CR_Deseret, + CR_Inherited, + CR_Tagalog, + CR_Hanunoo, + CR_Buhid, + CR_Tagbanwa, + CR_Limbu, + CR_Tai_Le, + CR_Linear_B, + CR_Ugaritic, + CR_Shavian, + CR_Osmanya, + CR_Cypriot, + CR_Braille, + CR_Buginese, + CR_Coptic, + CR_New_Tai_Lue, + CR_Glagolitic, + CR_Tifinagh, + CR_Syloti_Nagri, + CR_Old_Persian, + CR_Kharoshthi, + CR_Balinese, + CR_Cuneiform, + CR_Phoenician, + CR_Phags_Pa, + CR_Nko, + CR_Sundanese, + CR_Lepcha, + CR_Ol_Chiki, + CR_Vai, + CR_Saurashtra, + CR_Kayah_Li, + CR_Rejang, + CR_Lycian, + CR_Carian, + CR_Lydian, + CR_Cham, + CR_Tai_Tham, + CR_Tai_Viet, + CR_Avestan, + CR_Egyptian_Hieroglyphs, + CR_Samaritan, + CR_Lisu, + CR_Bamum, + CR_Javanese, + CR_Meetei_Mayek, + CR_Imperial_Aramaic, + CR_Old_South_Arabian, + CR_Inscriptional_Parthian, + CR_Inscriptional_Pahlavi, + CR_Old_Turkic, + CR_Kaithi, + CR_Batak, + CR_Brahmi, + CR_Mandaic, + CR_Chakma, + CR_Meroitic_Cursive, + CR_Meroitic_Hieroglyphs, + CR_Miao, + CR_Sharada, + CR_Sora_Sompeng, + CR_Takri, + CR_Caucasian_Albanian, + CR_Bassa_Vah, + CR_Duployan, + CR_Elbasan, + CR_Grantha, + CR_Pahawh_Hmong, + CR_Khojki, + CR_Linear_A, + CR_Mahajani, + CR_Manichaean, + CR_Mende_Kikakui, + CR_Modi, + CR_Mro, + CR_Old_North_Arabian, + CR_Nabataean, + CR_Palmyrene, + CR_Pau_Cin_Hau, + CR_Old_Permic, + CR_Psalter_Pahlavi, + CR_Siddham, + CR_Khudawadi, + CR_Tirhuta, + CR_Warang_Citi, + CR_Ahom, + CR_Anatolian_Hieroglyphs, + CR_Hatran, + CR_Multani, + CR_Old_Hungarian, + CR_SignWriting, + CR_Adlam, + CR_Bhaiksuki, + CR_Marchen, + CR_Newa, + CR_Osage, + CR_Tangut, + CR_White_Space, + CR_Bidi_Control, + CR_Join_Control, + CR_Dash, + CR_Hyphen, + CR_Quotation_Mark, + CR_Terminal_Punctuation, + CR_Other_Math, + CR_Hex_Digit, + CR_ASCII_Hex_Digit, + CR_Other_Alphabetic, + CR_Ideographic, + CR_Diacritic, + CR_Extender, + CR_Other_Lowercase, + CR_Other_Uppercase, + CR_Noncharacter_Code_Point, + CR_Other_Grapheme_Extend, + CR_IDS_Binary_Operator, + CR_IDS_Trinary_Operator, + CR_Radical, + CR_Unified_Ideograph, + CR_Other_Default_Ignorable_Code_Point, + CR_Deprecated, + CR_Soft_Dotted, + CR_Logical_Order_Exception, + CR_Other_ID_Start, + CR_Other_ID_Continue, + CR_Sentence_Terminal, + CR_Variation_Selector, + CR_Pattern_White_Space, + CR_Pattern_Syntax, + CR_Prepended_Concatenation_Mark, + CR_Unknown, +# ifdef USE_UNICODE_AGE_PROPERTIES + CR_Age_1_1, + CR_Age_2_0, + CR_Age_2_1, + CR_Age_3_0, + CR_Age_3_1, + CR_Age_3_2, + CR_Age_4_0, + CR_Age_4_1, + CR_Age_5_0, + CR_Age_5_1, + CR_Age_5_2, + CR_Age_6_0, + CR_Age_6_1, + CR_Age_6_2, + CR_Age_6_3, + CR_Age_7_0, + CR_Age_8_0, + CR_Age_9_0, +# endif /* USE_UNICODE_AGE_PROPERTIES */ + CR_Grapheme_Cluster_Break_Prepend, + CR_Grapheme_Cluster_Break_CR, + CR_Grapheme_Cluster_Break_LF, + CR_Grapheme_Cluster_Break_Control, + CR_Grapheme_Cluster_Break_Extend, + CR_Grapheme_Cluster_Break_Regional_Indicator, + CR_Grapheme_Cluster_Break_SpacingMark, + CR_Grapheme_Cluster_Break_L, + CR_Grapheme_Cluster_Break_V, + CR_Grapheme_Cluster_Break_T, + CR_Grapheme_Cluster_Break_LV, + CR_Grapheme_Cluster_Break_LVT, + CR_Grapheme_Cluster_Break_E_Base, + CR_Grapheme_Cluster_Break_E_Modifier, + CR_Grapheme_Cluster_Break_ZWJ, + CR_Grapheme_Cluster_Break_Glue_After_Zwj, + CR_Grapheme_Cluster_Break_E_Base_GAZ, + CR_In_Basic_Latin, + CR_In_Latin_1_Supplement, + CR_In_Latin_Extended_A, + CR_In_Latin_Extended_B, + CR_In_IPA_Extensions, + CR_In_Spacing_Modifier_Letters, + CR_In_Combining_Diacritical_Marks, + CR_In_Greek_and_Coptic, + CR_In_Cyrillic, + CR_In_Cyrillic_Supplement, + CR_In_Armenian, + CR_In_Hebrew, + CR_In_Arabic, + CR_In_Syriac, + CR_In_Arabic_Supplement, + CR_In_Thaana, + CR_In_NKo, + CR_In_Samaritan, + CR_In_Mandaic, + CR_In_Arabic_Extended_A, + CR_In_Devanagari, + CR_In_Bengali, + CR_In_Gurmukhi, + CR_In_Gujarati, + CR_In_Oriya, + CR_In_Tamil, + CR_In_Telugu, + CR_In_Kannada, + CR_In_Malayalam, + CR_In_Sinhala, + CR_In_Thai, + CR_In_Lao, + CR_In_Tibetan, + CR_In_Myanmar, + CR_In_Georgian, + CR_In_Hangul_Jamo, + CR_In_Ethiopic, + CR_In_Ethiopic_Supplement, + CR_In_Cherokee, + CR_In_Unified_Canadian_Aboriginal_Syllabics, + CR_In_Ogham, + CR_In_Runic, + CR_In_Tagalog, + CR_In_Hanunoo, + CR_In_Buhid, + CR_In_Tagbanwa, + CR_In_Khmer, + CR_In_Mongolian, + CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended, + CR_In_Limbu, + CR_In_Tai_Le, + CR_In_New_Tai_Lue, + CR_In_Khmer_Symbols, + CR_In_Buginese, + CR_In_Tai_Tham, + CR_In_Combining_Diacritical_Marks_Extended, + CR_In_Balinese, + CR_In_Sundanese, + CR_In_Batak, + CR_In_Lepcha, + CR_In_Ol_Chiki, + CR_In_Cyrillic_Extended_C, + CR_In_Sundanese_Supplement, + CR_In_Vedic_Extensions, + CR_In_Phonetic_Extensions, + CR_In_Phonetic_Extensions_Supplement, + CR_In_Combining_Diacritical_Marks_Supplement, + CR_In_Latin_Extended_Additional, + CR_In_Greek_Extended, + CR_In_General_Punctuation, + CR_In_Superscripts_and_Subscripts, + CR_In_Currency_Symbols, + CR_In_Combining_Diacritical_Marks_for_Symbols, + CR_In_Letterlike_Symbols, + CR_In_Number_Forms, + CR_In_Arrows, + CR_In_Mathematical_Operators, + CR_In_Miscellaneous_Technical, + CR_In_Control_Pictures, + CR_In_Optical_Character_Recognition, + CR_In_Enclosed_Alphanumerics, + CR_In_Box_Drawing, + CR_In_Block_Elements, + CR_In_Geometric_Shapes, + CR_In_Miscellaneous_Symbols, + CR_In_Dingbats, + CR_In_Miscellaneous_Mathematical_Symbols_A, + CR_In_Supplemental_Arrows_A, + CR_In_Braille_Patterns, + CR_In_Supplemental_Arrows_B, + CR_In_Miscellaneous_Mathematical_Symbols_B, + CR_In_Supplemental_Mathematical_Operators, + CR_In_Miscellaneous_Symbols_and_Arrows, + CR_In_Glagolitic, + CR_In_Latin_Extended_C, + CR_In_Coptic, + CR_In_Georgian_Supplement, + CR_In_Tifinagh, + CR_In_Ethiopic_Extended, + CR_In_Cyrillic_Extended_A, + CR_In_Supplemental_Punctuation, + CR_In_CJK_Radicals_Supplement, + CR_In_Kangxi_Radicals, + CR_In_Ideographic_Description_Characters, + CR_In_CJK_Symbols_and_Punctuation, + CR_In_Hiragana, + CR_In_Katakana, + CR_In_Bopomofo, + CR_In_Hangul_Compatibility_Jamo, + CR_In_Kanbun, + CR_In_Bopomofo_Extended, + CR_In_CJK_Strokes, + CR_In_Katakana_Phonetic_Extensions, + CR_In_Enclosed_CJK_Letters_and_Months, + CR_In_CJK_Compatibility, + CR_In_CJK_Unified_Ideographs_Extension_A, + CR_In_Yijing_Hexagram_Symbols, + CR_In_CJK_Unified_Ideographs, + CR_In_Yi_Syllables, + CR_In_Yi_Radicals, + CR_In_Lisu, + CR_In_Vai, + CR_In_Cyrillic_Extended_B, + CR_In_Bamum, + CR_In_Modifier_Tone_Letters, + CR_In_Latin_Extended_D, + CR_In_Syloti_Nagri, + CR_In_Common_Indic_Number_Forms, + CR_In_Phags_pa, + CR_In_Saurashtra, + CR_In_Devanagari_Extended, + CR_In_Kayah_Li, + CR_In_Rejang, + CR_In_Hangul_Jamo_Extended_A, + CR_In_Javanese, + CR_In_Myanmar_Extended_B, + CR_In_Cham, + CR_In_Myanmar_Extended_A, + CR_In_Tai_Viet, + CR_In_Meetei_Mayek_Extensions, + CR_In_Ethiopic_Extended_A, + CR_In_Latin_Extended_E, + CR_In_Cherokee_Supplement, + CR_In_Meetei_Mayek, + CR_In_Hangul_Syllables, + CR_In_Hangul_Jamo_Extended_B, + CR_In_High_Surrogates, + CR_In_High_Private_Use_Surrogates, + CR_In_Low_Surrogates, + CR_In_Private_Use_Area, + CR_In_CJK_Compatibility_Ideographs, + CR_In_Alphabetic_Presentation_Forms, + CR_In_Arabic_Presentation_Forms_A, + CR_In_Variation_Selectors, + CR_In_Vertical_Forms, + CR_In_Combining_Half_Marks, + CR_In_CJK_Compatibility_Forms, + CR_In_Small_Form_Variants, + CR_In_Arabic_Presentation_Forms_B, + CR_In_Halfwidth_and_Fullwidth_Forms, + CR_In_Specials, + CR_In_Linear_B_Syllabary, + CR_In_Linear_B_Ideograms, + CR_In_Aegean_Numbers, + CR_In_Ancient_Greek_Numbers, + CR_In_Ancient_Symbols, + CR_In_Phaistos_Disc, + CR_In_Lycian, + CR_In_Carian, + CR_In_Coptic_Epact_Numbers, + CR_In_Old_Italic, + CR_In_Gothic, + CR_In_Old_Permic, + CR_In_Ugaritic, + CR_In_Old_Persian, + CR_In_Deseret, + CR_In_Shavian, + CR_In_Osmanya, + CR_In_Osage, + CR_In_Elbasan, + CR_In_Caucasian_Albanian, + CR_In_Linear_A, + CR_In_Cypriot_Syllabary, + CR_In_Imperial_Aramaic, + CR_In_Palmyrene, + CR_In_Nabataean, + CR_In_Hatran, + CR_In_Phoenician, + CR_In_Lydian, + CR_In_Meroitic_Hieroglyphs, + CR_In_Meroitic_Cursive, + CR_In_Kharoshthi, + CR_In_Old_South_Arabian, + CR_In_Old_North_Arabian, + CR_In_Manichaean, + CR_In_Avestan, + CR_In_Inscriptional_Parthian, + CR_In_Inscriptional_Pahlavi, + CR_In_Psalter_Pahlavi, + CR_In_Old_Turkic, + CR_In_Old_Hungarian, + CR_In_Rumi_Numeral_Symbols, + CR_In_Brahmi, + CR_In_Kaithi, + CR_In_Sora_Sompeng, + CR_In_Chakma, + CR_In_Mahajani, + CR_In_Sharada, + CR_In_Sinhala_Archaic_Numbers, + CR_In_Khojki, + CR_In_Multani, + CR_In_Khudawadi, + CR_In_Grantha, + CR_In_Newa, + CR_In_Tirhuta, + CR_In_Siddham, + CR_In_Modi, + CR_In_Mongolian_Supplement, + CR_In_Takri, + CR_In_Ahom, + CR_In_Warang_Citi, + CR_In_Pau_Cin_Hau, + CR_In_Bhaiksuki, + CR_In_Marchen, + CR_In_Cuneiform, + CR_In_Cuneiform_Numbers_and_Punctuation, + CR_In_Early_Dynastic_Cuneiform, + CR_In_Egyptian_Hieroglyphs, + CR_In_Anatolian_Hieroglyphs, + CR_In_Bamum_Supplement, + CR_In_Mro, + CR_In_Bassa_Vah, + CR_In_Pahawh_Hmong, + CR_In_Miao, + CR_In_Ideographic_Symbols_and_Punctuation, + CR_In_Tangut, + CR_In_Tangut_Components, + CR_In_Kana_Supplement, + CR_In_Duployan, + CR_In_Shorthand_Format_Controls, + CR_In_Byzantine_Musical_Symbols, + CR_In_Musical_Symbols, + CR_In_Ancient_Greek_Musical_Notation, + CR_In_Tai_Xuan_Jing_Symbols, + CR_In_Counting_Rod_Numerals, + CR_In_Mathematical_Alphanumeric_Symbols, + CR_In_Sutton_SignWriting, + CR_In_Glagolitic_Supplement, + CR_In_Mende_Kikakui, + CR_In_Adlam, + CR_In_Arabic_Mathematical_Alphabetic_Symbols, + CR_In_Mahjong_Tiles, + CR_In_Domino_Tiles, + CR_In_Playing_Cards, + CR_In_Enclosed_Alphanumeric_Supplement, + CR_In_Enclosed_Ideographic_Supplement, + CR_In_Miscellaneous_Symbols_and_Pictographs, + CR_In_Emoticons, + CR_In_Ornamental_Dingbats, + CR_In_Transport_and_Map_Symbols, + CR_In_Alchemical_Symbols, + CR_In_Geometric_Shapes_Extended, + CR_In_Supplemental_Arrows_C, + CR_In_Supplemental_Symbols_and_Pictographs, + CR_In_CJK_Unified_Ideographs_Extension_B, + CR_In_CJK_Unified_Ideographs_Extension_C, + CR_In_CJK_Unified_Ideographs_Extension_D, + CR_In_CJK_Unified_Ideographs_Extension_E, + CR_In_CJK_Compatibility_Ideographs_Supplement, + CR_In_Tags, + CR_In_Variation_Selectors_Supplement, + CR_In_Supplementary_Private_Use_Area_A, + CR_In_Supplementary_Private_Use_Area_B, + CR_In_No_Block, +#endif /* USE_UNICODE_PROPERTIES */ +}; +struct uniname2ctype_struct +{ + short name; + unsigned short ctype; +}; +#define uniname2ctype_offset(str) \ + offsetof(struct uniname2ctype_pool_t, uniname2ctype_pool_##str) + +static const struct uniname2ctype_struct *uniname2ctype_p(const char *, + unsigned int); + +#ifndef USE_UNICODE_PROPERTIES +# define TOTAL_KEYWORDS 15 +# define MIN_WORD_LENGTH 4 +# define MAX_WORD_LENGTH 11 +# define MIN_HASH_VALUE 6 +# define MAX_HASH_VALUE 20 +/* maximum key range = 15, duplicates = 0 */ +#else /* USE_UNICODE_PROPERTIES */ +# ifndef USE_UNICODE_AGE_PROPERTIES +# define TOTAL_KEYWORDS 753 +# else /* USE_UNICODE_AGE_PROPERTIES */ +# define TOTAL_KEYWORDS 771 +# endif /* USE_UNICODE_AGE_PROPERTIES */ +# define MIN_WORD_LENGTH 1 +# define MAX_WORD_LENGTH 44 +# define MIN_HASH_VALUE 3 +# define MAX_HASH_VALUE 5275 +/* maximum key range = 5273, duplicates = 0 */ +#endif /* USE_UNICODE_PROPERTIES */ + +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ + || defined(__cplusplus) || defined(__GNUC_STDC_INLINE__) +inline +#elif defined(__GNUC__) +__inline +#endif + static unsigned int + uniname2ctype_hash(str, len) +register const char *str; +register unsigned int len; +{ +#ifndef USE_UNICODE_PROPERTIES + static const unsigned char asso_values[] = +#else /* USE_UNICODE_PROPERTIES */ + static const unsigned short asso_values[] = +#endif /* USE_UNICODE_PROPERTIES */ + { +#ifndef USE_UNICODE_PROPERTIES + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 3, 12, 5, 4, 21, + 21, 10, 21, 1, 21, 21, 11, 21, 2, 1, 1, 21, 1, 7, 4, 6, 21, + 1, 4, 21, 21, 21, 21, 21, 21, 21 +#else /* USE_UNICODE_PROPERTIES */ + 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, + 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, + 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, + 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, +# ifndef USE_UNICODE_AGE_PROPERTIES + 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, + 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, +# else /* USE_UNICODE_AGE_PROPERTIES */ + 5276, 5276, 5276, 5276, 5276, 5276, 1, 5276, 8, 1, + 2, 11, 25, 22, 7, 19, 14, 13, 5276, 5276, +# endif /* USE_UNICODE_AGE_PROPERTIES */ + 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, + 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, + 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, 5276, + 5276, 5276, 5276, 5276, 5276, 5276, 5276, 13, 1100, 20, + 497, 25, 315, 494, 322, 4, 279, 1693, 169, 7, + 1, 267, 1336, 2, 214, 40, 92, 1301, 615, 434, + 494, 1306, 17, 5276, 5276, 5276, 5276, 5276 +#endif /* USE_UNICODE_PROPERTIES */ + }; +#ifndef USE_UNICODE_PROPERTIES + return len + asso_values[(unsigned char)str[2]] + + asso_values[(unsigned char)str[0]]; +#else /* USE_UNICODE_PROPERTIES */ + register int hval = len; + + switch (hval) + { + default: + hval += asso_values[(unsigned char)str[15]]; + /*FALLTHROUGH*/ + case 15: + case 14: + case 13: + case 12: + hval += asso_values[(unsigned char)str[11]]; + /*FALLTHROUGH*/ + case 11: + case 10: + case 9: + case 8: + case 7: + case 6: + hval += asso_values[(unsigned char)str[5]]; + /*FALLTHROUGH*/ + case 5: + hval += asso_values[(unsigned char)str[4]]; + /*FALLTHROUGH*/ + case 4: + case 3: + hval += asso_values[(unsigned char)str[2]]; + /*FALLTHROUGH*/ + case 2: + hval += asso_values[(unsigned char)str[1]]; + /*FALLTHROUGH*/ + case 1: + hval += asso_values[(unsigned char)str[0]]; + break; + } + return hval + asso_values[(unsigned char)str[len - 1]]; +#endif /* USE_UNICODE_PROPERTIES */ +} + +struct uniname2ctype_pool_t +{ +#ifndef USE_UNICODE_PROPERTIES + char uniname2ctype_pool_str6[sizeof("word")]; + char uniname2ctype_pool_str7[sizeof("print")]; + char uniname2ctype_pool_str8[sizeof("punct")]; + char uniname2ctype_pool_str9[sizeof("alpha")]; + char uniname2ctype_pool_str10[sizeof("alnum")]; + char uniname2ctype_pool_str11[sizeof("xdigit")]; + char uniname2ctype_pool_str12[sizeof("upper")]; + char uniname2ctype_pool_str13[sizeof("ascii")]; + char uniname2ctype_pool_str14[sizeof("cntrl")]; + char uniname2ctype_pool_str15[sizeof("space")]; + char uniname2ctype_pool_str16[sizeof("xposixpunct")]; + char uniname2ctype_pool_str17[sizeof("lower")]; + char uniname2ctype_pool_str18[sizeof("graph")]; + char uniname2ctype_pool_str19[sizeof("digit")]; + char uniname2ctype_pool_str20[sizeof("blank")]; +#else /* USE_UNICODE_PROPERTIES */ + char uniname2ctype_pool_str3[sizeof("n")]; + char uniname2ctype_pool_str11[sizeof("mn")]; + char uniname2ctype_pool_str15[sizeof("m")]; + char uniname2ctype_pool_str24[sizeof("cn")]; + char uniname2ctype_pool_str29[sizeof("mani")]; + char uniname2ctype_pool_str30[sizeof("ci")]; + char uniname2ctype_pool_str31[sizeof("inmanichaean")]; + char uniname2ctype_pool_str35[sizeof("z")]; + char uniname2ctype_pool_str36[sizeof("qaai")]; + char uniname2ctype_pool_str41[sizeof("c")]; + char uniname2ctype_pool_str49[sizeof("mc")]; + char uniname2ctype_pool_str52[sizeof("qaac")]; + char uniname2ctype_pool_str56[sizeof("sm")]; + char uniname2ctype_pool_str58[sizeof("incham")]; + char uniname2ctype_pool_str59[sizeof("me")]; + char uniname2ctype_pool_str61[sizeof("inarmenian")]; + char uniname2ctype_pool_str62[sizeof("cc")]; + char uniname2ctype_pool_str65[sizeof("mandaic")]; + char uniname2ctype_pool_str69[sizeof("incuneiform")]; + char uniname2ctype_pool_str72[sizeof("zzzz")]; + char uniname2ctype_pool_str77[sizeof("insamaritan")]; + char uniname2ctype_pool_str78[sizeof("cans")]; + char uniname2ctype_pool_str81[sizeof("s")]; + char uniname2ctype_pool_str82[sizeof("sc")]; + char uniname2ctype_pool_str86[sizeof("ascii")]; + char uniname2ctype_pool_str93[sizeof("inavestan")]; + char uniname2ctype_pool_str99[sizeof("zs")]; + char uniname2ctype_pool_str102[sizeof("cs")]; + char uniname2ctype_pool_str106[sizeof("inipaextensions")]; + char uniname2ctype_pool_str110[sizeof("incuneiformnumbersandpunctuation")]; + char uniname2ctype_pool_str114[sizeof("incommonindicnumberforms")]; + char uniname2ctype_pool_str124[sizeof("inthai")]; + char uniname2ctype_pool_str132[sizeof("mtei")]; + char uniname2ctype_pool_str140[sizeof("inspecials")]; + char uniname2ctype_pool_str141[sizeof("initialpunctuation")]; + char uniname2ctype_pool_str144[sizeof("inthaana")]; + char uniname2ctype_pool_str145[sizeof("inancientsymbols")]; + char uniname2ctype_pool_str152[sizeof("inmiscellaneousmathematicalsymbolsa")]; + char uniname2ctype_pool_str159[sizeof("inmusicalsymbols")]; + char uniname2ctype_pool_str164[sizeof("taile")]; + char uniname2ctype_pool_str174[sizeof("inmyanmarextendeda")]; + char uniname2ctype_pool_str176[sizeof("sterm")]; + char uniname2ctype_pool_str185[sizeof("lm")]; + char uniname2ctype_pool_str191[sizeof("lina")]; + char uniname2ctype_pool_str199[sizeof("inmiscellaneoussymbols")]; + char uniname2ctype_pool_str200[sizeof("lana")]; + char uniname2ctype_pool_str201[sizeof("intransportandmapsymbols")]; + char uniname2ctype_pool_str202[sizeof("alnum")]; + char uniname2ctype_pool_str207[sizeof("inlycian")]; + char uniname2ctype_pool_str208[sizeof("inmiscellaneoussymbolsandarrows")]; + char uniname2ctype_pool_str209[sizeof("intaitham")]; + char uniname2ctype_pool_str211[sizeof("lc")]; + char uniname2ctype_pool_str212[sizeof("inmalayalam")]; + char + uniname2ctype_pool_str213[sizeof("inmiscellaneoussymbolsandpictographs")]; + char uniname2ctype_pool_str214[sizeof("inadlam")]; + char uniname2ctype_pool_str220[sizeof("incontrolpictures")]; + char uniname2ctype_pool_str222[sizeof("inlineara")]; + char uniname2ctype_pool_str237[sizeof("taiviet")]; + char uniname2ctype_pool_str239[sizeof("armn")]; + char uniname2ctype_pool_str242[sizeof("armi")]; + char uniname2ctype_pool_str247[sizeof("sinhala")]; + char uniname2ctype_pool_str248[sizeof("armenian")]; + char uniname2ctype_pool_str249[sizeof("inmyanmar")]; + char uniname2ctype_pool_str251[sizeof("inrunic")]; + char uniname2ctype_pool_str252[sizeof("incarian")]; + char uniname2ctype_pool_str255[sizeof("cari")]; + char uniname2ctype_pool_str256[sizeof("inmarchen")]; + char uniname2ctype_pool_str258[sizeof("marc")]; + char uniname2ctype_pool_str268[sizeof("carian")]; + char uniname2ctype_pool_str270[sizeof("merc")]; + char uniname2ctype_pool_str273[sizeof("incyrillic")]; + char uniname2ctype_pool_str278[sizeof("samr")]; + char uniname2ctype_pool_str279[sizeof("latn")]; + char uniname2ctype_pool_str281[sizeof("latin")]; + char uniname2ctype_pool_str282[sizeof("ital")]; + char uniname2ctype_pool_str284[sizeof("intamil")]; + char uniname2ctype_pool_str285[sizeof("taml")]; + char uniname2ctype_pool_str286[sizeof("inmultani")]; + char uniname2ctype_pool_str288[sizeof("samaritan")]; + char uniname2ctype_pool_str290[sizeof("arabic")]; + char uniname2ctype_pool_str291[sizeof("insyriac")]; + char uniname2ctype_pool_str294[sizeof("insharada")]; + char uniname2ctype_pool_str295[sizeof("miao")]; + char uniname2ctype_pool_str296[sizeof("inlinearbideograms")]; + char uniname2ctype_pool_str299[sizeof("incherokee")]; + char uniname2ctype_pool_str302[sizeof("intaile")]; + char uniname2ctype_pool_str303[sizeof("tale")]; + char uniname2ctype_pool_str305[sizeof("inahom")]; + char uniname2ctype_pool_str309[sizeof("inmeeteimayekextensions")]; + char uniname2ctype_pool_str310[sizeof("inruminumeralsymbols")]; + char uniname2ctype_pool_str313[sizeof("inlatinextendeda")]; + char uniname2ctype_pool_str314[sizeof("inosmanya")]; + char uniname2ctype_pool_str327[sizeof("inlatinextendedc")]; + char uniname2ctype_pool_str331[sizeof("osma")]; + char uniname2ctype_pool_str337[sizeof("inlatinextendede")]; + char uniname2ctype_pool_str339[sizeof("l")]; + char uniname2ctype_pool_str340[sizeof("han")]; + char uniname2ctype_pool_str341[sizeof("nl")]; + char uniname2ctype_pool_str342[sizeof("term")]; + char uniname2ctype_pool_str344[sizeof("hani")]; + char uniname2ctype_pool_str347[sizeof("inideographicsymbolsandpunctuation")]; + char uniname2ctype_pool_str348[sizeof("zinh")]; + char uniname2ctype_pool_str355[sizeof("lt")]; + char uniname2ctype_pool_str357[sizeof("zl")]; + char uniname2ctype_pool_str361[sizeof("inmahajani")]; + char uniname2ctype_pool_str366[sizeof("cham")]; + char uniname2ctype_pool_str368[sizeof("connectorpunctuation")]; + char uniname2ctype_pool_str371[sizeof("sinh")]; + char uniname2ctype_pool_str374[sizeof("manichaean")]; + char uniname2ctype_pool_str375[sizeof("osage")]; + char uniname2ctype_pool_str382[sizeof("inmiscellaneoustechnical")]; + char uniname2ctype_pool_str386[sizeof("inethiopic")]; + char uniname2ctype_pool_str390[sizeof("insinhala")]; + char uniname2ctype_pool_str394[sizeof("chakma")]; + char uniname2ctype_pool_str400[sizeof("shavian")]; + char uniname2ctype_pool_str419[sizeof("inideographicdescriptioncharacters")]; + char uniname2ctype_pool_str421[sizeof("lineara")]; + char uniname2ctype_pool_str422[sizeof("meroiticcursive")]; + char uniname2ctype_pool_str435[sizeof("thai")]; + char uniname2ctype_pool_str438[sizeof("math")]; + char uniname2ctype_pool_str440[sizeof("inemoticons")]; + char uniname2ctype_pool_str444[sizeof("thaa")]; + char uniname2ctype_pool_str447[sizeof("ethi")]; + char uniname2ctype_pool_str448[sizeof("hatran")]; + char uniname2ctype_pool_str452[sizeof("inenclosedalphanumerics")]; + char uniname2ctype_pool_str453[sizeof("sentenceterminal")]; + char uniname2ctype_pool_str455[sizeof("tamil")]; + char uniname2ctype_pool_str456[sizeof("cntrl")]; + char uniname2ctype_pool_str458[sizeof("taitham")]; + char uniname2ctype_pool_str460[sizeof("thaana")]; + char uniname2ctype_pool_str468[sizeof("terminalpunctuation")]; + char uniname2ctype_pool_str471[sizeof("insinhalaarchaicnumbers")]; + char uniname2ctype_pool_str472[sizeof("innewa")]; + char uniname2ctype_pool_str477[sizeof("newa")]; + char uniname2ctype_pool_str478[sizeof("inlatinextendedadditional")]; + char uniname2ctype_pool_str485[sizeof("cwcm")]; + char uniname2ctype_pool_str489[sizeof("loe")]; + char uniname2ctype_pool_str503[sizeof("inopticalcharacterrecognition")]; + char uniname2ctype_pool_str504[sizeof("inearlydynasticcuneiform")]; + char uniname2ctype_pool_str507[sizeof("di")]; + char uniname2ctype_pool_str508[sizeof("asciihexdigit")]; + char uniname2ctype_pool_str509[sizeof("ll")]; + char uniname2ctype_pool_str511[sizeof("newtailue")]; + char uniname2ctype_pool_str512[sizeof("inscriptionalparthian")]; + char uniname2ctype_pool_str513[sizeof("inenclosedalphanumericsupplement")]; + char uniname2ctype_pool_str516[sizeof("oriya")]; + char uniname2ctype_pool_str517[sizeof("mero")]; + char uniname2ctype_pool_str519[sizeof("inmongolian")]; + char uniname2ctype_pool_str522[sizeof("mand")]; + char uniname2ctype_pool_str523[sizeof("inmodi")]; + char uniname2ctype_pool_str530[sizeof("dia")]; + char uniname2ctype_pool_str534[sizeof("mend")]; + char uniname2ctype_pool_str535[sizeof("ingrantha")]; + char uniname2ctype_pool_str537[sizeof("no")]; + char uniname2ctype_pool_str538[sizeof("sora")]; + char uniname2ctype_pool_str539[sizeof("inmandaic")]; +# ifdef USE_UNICODE_AGE_PROPERTIES + char uniname2ctype_pool_str542[sizeof("age=1.1")]; + char uniname2ctype_pool_str543[sizeof("age=2.1")]; +# endif /* USE_UNICODE_AGE_PROPERTIES */ + char uniname2ctype_pool_str544[sizeof("idc")]; + char uniname2ctype_pool_str545[sizeof("innko")]; + char uniname2ctype_pool_str546[sizeof("sind")]; + char uniname2ctype_pool_str547[sizeof("inarrows")]; +# ifdef USE_UNICODE_AGE_PROPERTIES + char uniname2ctype_pool_str548[sizeof("age=6.1")]; + char uniname2ctype_pool_str549[sizeof("age=6.2")]; + char uniname2ctype_pool_str550[sizeof("age=2.0")]; +# endif /* USE_UNICODE_AGE_PROPERTIES */ + char uniname2ctype_pool_str551[sizeof("inmro")]; +# ifdef USE_UNICODE_AGE_PROPERTIES + char uniname2ctype_pool_str552[sizeof("age=3.1")]; + char uniname2ctype_pool_str553[sizeof("age=3.2")]; +# endif /* USE_UNICODE_AGE_PROPERTIES */ + char uniname2ctype_pool_str554[sizeof("titlecaseletter")]; +# ifdef USE_UNICODE_AGE_PROPERTIES + char uniname2ctype_pool_str555[sizeof("age=6.0")]; +# endif /* USE_UNICODE_AGE_PROPERTIES */ + char uniname2ctype_pool_str556[sizeof("co")]; + char uniname2ctype_pool_str557[sizeof("hira")]; +# ifdef USE_UNICODE_AGE_PROPERTIES + char uniname2ctype_pool_str558[sizeof("age=6.3")]; + char uniname2ctype_pool_str559[sizeof("age=3.0")]; +# endif /* USE_UNICODE_AGE_PROPERTIES */ + char uniname2ctype_pool_str560[sizeof("ingeneralpunctuation")]; +# ifdef USE_UNICODE_AGE_PROPERTIES + char uniname2ctype_pool_str561[sizeof("age=9.0")]; + char uniname2ctype_pool_str562[sizeof("age=8.0")]; + char uniname2ctype_pool_str563[sizeof("age=5.1")]; + char uniname2ctype_pool_str564[sizeof("age=5.2")]; +# endif /* USE_UNICODE_AGE_PROPERTIES */ + char uniname2ctype_pool_str565[sizeof("inmiao")]; +# ifdef USE_UNICODE_AGE_PROPERTIES + char uniname2ctype_pool_str566[sizeof("age=4.1")]; + char uniname2ctype_pool_str567[sizeof("age=7.0")]; +# endif /* USE_UNICODE_AGE_PROPERTIES */ + char uniname2ctype_pool_str568[sizeof("innewtailue")]; + char uniname2ctype_pool_str569[sizeof("common")]; +# ifdef USE_UNICODE_AGE_PROPERTIES + char uniname2ctype_pool_str570[sizeof("age=5.0")]; + char uniname2ctype_pool_str573[sizeof("age=4.0")]; +# endif /* USE_UNICODE_AGE_PROPERTIES */ + char uniname2ctype_pool_str576[sizeof("so")]; + char uniname2ctype_pool_str577[sizeof("inhiragana")]; + char uniname2ctype_pool_str579[sizeof("insundanese")]; + char uniname2ctype_pool_str584[sizeof("ids")]; + char uniname2ctype_pool_str585[sizeof("cher")]; + char uniname2ctype_pool_str589[sizeof("marchen")]; + char uniname2ctype_pool_str591[sizeof("indominotiles")]; + char uniname2ctype_pool_str595[sizeof("joinc")]; + char uniname2ctype_pool_str604[sizeof("tang")]; + char uniname2ctype_pool_str607[sizeof("hano")]; + char uniname2ctype_pool_str613[sizeof("ahom")]; + char uniname2ctype_pool_str621[sizeof("inogham")]; + char uniname2ctype_pool_str622[sizeof("inscriptionalpahlavi")]; + char uniname2ctype_pool_str625[sizeof("mahj")]; + char uniname2ctype_pool_str627[sizeof("inolchiki")]; + char uniname2ctype_pool_str633[sizeof("invai")]; + char uniname2ctype_pool_str634[sizeof("tagbanwa")]; + char uniname2ctype_pool_str636[sizeof("tirh")]; + char uniname2ctype_pool_str637[sizeof("idst")]; + char uniname2ctype_pool_str639[sizeof("vai")]; + char uniname2ctype_pool_str640[sizeof("vaii")]; + char uniname2ctype_pool_str641[sizeof("cwt")]; + char uniname2ctype_pool_str642[sizeof("inhatran")]; + char uniname2ctype_pool_str645[sizeof("hatr")]; + char uniname2ctype_pool_str646[sizeof("mahajani")]; + char uniname2ctype_pool_str649[sizeof("idcontinue")]; + char uniname2ctype_pool_str652[sizeof("cf")]; + char uniname2ctype_pool_str655[sizeof("intirhuta")]; + char uniname2ctype_pool_str659[sizeof("inenclosedcjklettersandmonths")]; + char uniname2ctype_pool_str663[sizeof("intaixuanjingsymbols")]; + char uniname2ctype_pool_str664[sizeof("inspacingmodifierletters")]; + char uniname2ctype_pool_str668[sizeof("indeseret")]; + char uniname2ctype_pool_str677[sizeof("intags")]; + char uniname2ctype_pool_str678[sizeof("wara")]; + char uniname2ctype_pool_str683[sizeof("inshavian")]; + char uniname2ctype_pool_str684[sizeof("inlydian")]; + char uniname2ctype_pool_str686[sizeof("inwarangciti")]; + char uniname2ctype_pool_str688[sizeof("inmathematicalalphanumericsymbols")]; + char uniname2ctype_pool_str690[sizeof("adlm")]; + char uniname2ctype_pool_str692[sizeof("intangut")]; + char uniname2ctype_pool_str697[sizeof("vs")]; + char uniname2ctype_pool_str698[sizeof("adlam")]; + char uniname2ctype_pool_str705[sizeof("lo")]; + char uniname2ctype_pool_str706[sizeof("ext")]; + char uniname2ctype_pool_str712[sizeof("insylotinagri")]; + char uniname2ctype_pool_str713[sizeof("inlao")]; + char uniname2ctype_pool_str716[sizeof("inlowsurrogates")]; + char uniname2ctype_pool_str717[sizeof("anatolianhieroglyphs")]; + char uniname2ctype_pool_str719[sizeof("lao")]; + char uniname2ctype_pool_str720[sizeof("laoo")]; + char uniname2ctype_pool_str721[sizeof("mongolian")]; + char uniname2ctype_pool_str726[sizeof("gran")]; + char uniname2ctype_pool_str733[sizeof("lineseparator")]; + char uniname2ctype_pool_str734[sizeof("ingurmukhi")]; + char uniname2ctype_pool_str745[sizeof("letter")]; + char uniname2ctype_pool_str748[sizeof("intifinagh")]; + char uniname2ctype_pool_str755[sizeof("tifinagh")]; + char uniname2ctype_pool_str758[sizeof("mro")]; + char uniname2ctype_pool_str759[sizeof("mroo")]; + char uniname2ctype_pool_str761[sizeof("diacritic")]; + char uniname2ctype_pool_str764[sizeof("avst")]; + char uniname2ctype_pool_str766[sizeof("avestan")]; + char uniname2ctype_pool_str773[sizeof("mong")]; + char uniname2ctype_pool_str774[sizeof("inanatolianhieroglyphs")]; + char uniname2ctype_pool_str775[sizeof("odi")]; + char uniname2ctype_pool_str776[sizeof("nchar")]; + char uniname2ctype_pool_str778[sizeof("caseignorable")]; + char uniname2ctype_pool_str779[sizeof("modi")]; + char uniname2ctype_pool_str780[sizeof("insorasompeng")]; + char uniname2ctype_pool_str785[sizeof("ogam")]; + char uniname2ctype_pool_str792[sizeof("oidc")]; + char uniname2ctype_pool_str793[sizeof("cwcf")]; + char uniname2ctype_pool_str795[sizeof("cwl")]; + char uniname2ctype_pool_str797[sizeof("ideo")]; + char uniname2ctype_pool_str803[sizeof("oalpha")]; + char uniname2ctype_pool_str804[sizeof("inolditalic")]; + char uniname2ctype_pool_str805[sizeof("ingujarati")]; + char uniname2ctype_pool_str811[sizeof("inosage")]; + char uniname2ctype_pool_str812[sizeof("oids")]; + char uniname2ctype_pool_str813[sizeof("shaw")]; + char uniname2ctype_pool_str814[sizeof("decimalnumber")]; + char uniname2ctype_pool_str816[sizeof("tavt")]; + char uniname2ctype_pool_str817[sizeof("intaiviet")]; + char uniname2ctype_pool_str828[sizeof("hmng")]; + char uniname2ctype_pool_str829[sizeof("inmongoliansupplement")]; + char uniname2ctype_pool_str830[sizeof("osge")]; + char uniname2ctype_pool_str834[sizeof("hang")]; + char uniname2ctype_pool_str835[sizeof("insuttonsignwriting")]; + char uniname2ctype_pool_str836[sizeof("inmahjongtiles")]; + char uniname2ctype_pool_str847[sizeof("dsrt")]; + char uniname2ctype_pool_str858[sizeof("ahex")]; + char uniname2ctype_pool_str860[sizeof("whitespace")]; + char uniname2ctype_pool_str865[sizeof("insundanesesupplement")]; + char uniname2ctype_pool_str866[sizeof("inmodifiertoneletters")]; + char uniname2ctype_pool_str867[sizeof("idstart")]; + char uniname2ctype_pool_str872[sizeof("ingreekandcoptic")]; + char uniname2ctype_pool_str876[sizeof("dash")]; + char uniname2ctype_pool_str878[sizeof("hanunoo")]; + char uniname2ctype_pool_str890[sizeof("siddham")]; + char uniname2ctype_pool_str892[sizeof("inoldturkic")]; + char uniname2ctype_pool_str895[sizeof("ingeometricshapes")]; + char uniname2ctype_pool_str900[sizeof("deseret")]; + char uniname2ctype_pool_str903[sizeof("gothic")]; + char uniname2ctype_pool_str905[sizeof("sharada")]; + char uniname2ctype_pool_str906[sizeof("tfng")]; + char uniname2ctype_pool_str914[sizeof("insmallformvariants")]; + char uniname2ctype_pool_str919[sizeof("inshorthandformatcontrols")]; + char uniname2ctype_pool_str922[sizeof("grext")]; + char uniname2ctype_pool_str924[sizeof("java")]; + char uniname2ctype_pool_str933[sizeof("radical")]; + char uniname2ctype_pool_str936[sizeof("omath")]; + char uniname2ctype_pool_str937[sizeof("canadianaboriginal")]; + char uniname2ctype_pool_str941[sizeof("ingothic")]; + char uniname2ctype_pool_str943[sizeof("otheridcontinue")]; + char uniname2ctype_pool_str945[sizeof("control")]; + char uniname2ctype_pool_str947[sizeof("injavanese")]; + char uniname2ctype_pool_str956[sizeof("noncharactercodepoint")]; + char uniname2ctype_pool_str958[sizeof("invariationselectors")]; + char uniname2ctype_pool_str964[sizeof("casedletter")]; + char uniname2ctype_pool_str965[sizeof("letternumber")]; + char uniname2ctype_pool_str966[sizeof("javanese")]; + char uniname2ctype_pool_str968[sizeof("otheralphabetic")]; + char uniname2ctype_pool_str973[sizeof("sgnw")]; + char uniname2ctype_pool_str991[sizeof("ingeorgian")]; + char uniname2ctype_pool_str992[sizeof("rjng")]; + char uniname2ctype_pool_str997[sizeof("nd")]; + char uniname2ctype_pool_str999[sizeof("format")]; + char uniname2ctype_pool_str1004[sizeof("geor")]; + char uniname2ctype_pool_str1009[sizeof("inornamentaldingbats")]; + char uniname2ctype_pool_str1013[sizeof("inrejang")]; + char uniname2ctype_pool_str1015[sizeof("inoldnortharabian")]; + char uniname2ctype_pool_str1017[sizeof("joincontrol")]; + char uniname2ctype_pool_str1019[sizeof("xidc")]; + char uniname2ctype_pool_str1020[sizeof("invariationselectorssupplement")]; + char uniname2ctype_pool_str1036[sizeof("sd")]; + char uniname2ctype_pool_str1039[sizeof("xids")]; + char uniname2ctype_pool_str1042[sizeof("sidd")]; + char uniname2ctype_pool_str1047[sizeof("indingbats")]; + char uniname2ctype_pool_str1051[sizeof("inherited")]; + char uniname2ctype_pool_str1052[sizeof("inmeroitichieroglyphs")]; + char uniname2ctype_pool_str1053[sizeof("inenclosedideographicsupplement")]; + char uniname2ctype_pool_str1054[sizeof("inoldsoutharabian")]; + char uniname2ctype_pool_str1055[sizeof("insiddham")]; + char uniname2ctype_pool_str1058[sizeof("inglagolitic")]; + char uniname2ctype_pool_str1062[sizeof("ingreekextended")]; + char uniname2ctype_pool_str1067[sizeof("olditalic")]; + char uniname2ctype_pool_str1068[sizeof("hiragana")]; + char uniname2ctype_pool_str1069[sizeof("idsbinaryoperator")]; + char uniname2ctype_pool_str1072[sizeof("cased")]; + char uniname2ctype_pool_str1073[sizeof("inhangulsyllables")]; + char uniname2ctype_pool_str1077[sizeof("shrd")]; + char uniname2ctype_pool_str1093[sizeof("assigned")]; + char uniname2ctype_pool_str1095[sizeof("otheridstart")]; + char uniname2ctype_pool_str1102[sizeof("ogham")]; + char uniname2ctype_pool_str1107[sizeof("intagalog")]; + char uniname2ctype_pool_str1110[sizeof("inoldhungarian")]; + char uniname2ctype_pool_str1114[sizeof("other")]; + char uniname2ctype_pool_str1115[sizeof("othersymbol")]; + char uniname2ctype_pool_str1116[sizeof("otherlowercase")]; + char uniname2ctype_pool_str1121[sizeof("othernumber")]; + char uniname2ctype_pool_str1130[sizeof("graphemebase")]; + char uniname2ctype_pool_str1131[sizeof("innabataean")]; + char uniname2ctype_pool_str1137[sizeof("inbhaiksuki")]; + char uniname2ctype_pool_str1138[sizeof("lowercase")]; + char uniname2ctype_pool_str1139[sizeof("bamum")]; + char uniname2ctype_pool_str1142[sizeof("glagolitic")]; + char uniname2ctype_pool_str1148[sizeof("inhanguljamoextendeda")]; + char uniname2ctype_pool_str1150[sizeof("indevanagari")]; + char uniname2ctype_pool_str1153[sizeof("inelbasan")]; + char uniname2ctype_pool_str1154[sizeof("deva")]; + char uniname2ctype_pool_str1155[sizeof("grantha")]; + char uniname2ctype_pool_str1159[sizeof("inarabic")]; + char uniname2ctype_pool_str1162[sizeof("olower")]; + char uniname2ctype_pool_str1163[sizeof("inbasiclatin")]; + char uniname2ctype_pool_str1165[sizeof("devanagari")]; + char uniname2ctype_pool_str1170[sizeof("warangciti")]; + char uniname2ctype_pool_str1173[sizeof("innumberforms")]; + char uniname2ctype_pool_str1174[sizeof("glag")]; + char uniname2ctype_pool_str1179[sizeof("goth")]; + char uniname2ctype_pool_str1180[sizeof("invedicextensions")]; + char uniname2ctype_pool_str1183[sizeof("oldpersian")]; + char uniname2ctype_pool_str1184[sizeof("digit")]; + char uniname2ctype_pool_str1189[sizeof("xdigit")]; + char uniname2ctype_pool_str1197[sizeof("bass")]; + char uniname2ctype_pool_str1200[sizeof("xidstart")]; + char uniname2ctype_pool_str1201[sizeof("oldpermic")]; + char uniname2ctype_pool_str1210[sizeof("nbat")]; + char uniname2ctype_pool_str1223[sizeof("inarabicpresentationformsa")]; + char uniname2ctype_pool_str1224[sizeof("logicalorderexception")]; + char uniname2ctype_pool_str1227[sizeof("inbyzantinemusicalsymbols")]; + char uniname2ctype_pool_str1229[sizeof("nabataean")]; + char uniname2ctype_pool_str1232[sizeof("intibetan")]; + char uniname2ctype_pool_str1233[sizeof("othermath")]; + char + uniname2ctype_pool_str1239[sizeof("inmiscellaneousmathematicalsymbolsb")]; + char uniname2ctype_pool_str1248[sizeof("inverticalforms")]; + char uniname2ctype_pool_str1253[sizeof("tglg")]; + char uniname2ctype_pool_str1261[sizeof("inmyanmarextendedb")]; + char uniname2ctype_pool_str1265[sizeof("ideographic")]; + char uniname2ctype_pool_str1266[sizeof("incyrillicextendeda")]; + char uniname2ctype_pool_str1272[sizeof("inbraillepatterns")]; + char uniname2ctype_pool_str1273[sizeof("incyrillicextendedc")]; + char uniname2ctype_pool_str1278[sizeof("linb")]; + char uniname2ctype_pool_str1281[sizeof("inlatinextendedd")]; + char uniname2ctype_pool_str1284[sizeof("limb")]; + char uniname2ctype_pool_str1289[sizeof("otherletter")]; + char uniname2ctype_pool_str1290[sizeof("bali")]; + char uniname2ctype_pool_str1292[sizeof("tibt")]; + char uniname2ctype_pool_str1293[sizeof("georgian")]; + char uniname2ctype_pool_str1299[sizeof("xidcontinue")]; + char uniname2ctype_pool_str1303[sizeof("lower")]; + char uniname2ctype_pool_str1309[sizeof("tibetan")]; + char uniname2ctype_pool_str1311[sizeof("elba")]; + char uniname2ctype_pool_str1313[sizeof("inbalinese")]; + char uniname2ctype_pool_str1316[sizeof("yi")]; + char uniname2ctype_pool_str1319[sizeof("bengali")]; + char uniname2ctype_pool_str1322[sizeof("yiii")]; + char uniname2ctype_pool_str1326[sizeof("inhighprivateusesurrogates")]; + char uniname2ctype_pool_str1331[sizeof("extender")]; + char uniname2ctype_pool_str1332[sizeof("narb")]; + char uniname2ctype_pool_str1333[sizeof("sorasompeng")]; + char uniname2ctype_pool_str1335[sizeof("brai")]; + char uniname2ctype_pool_str1338[sizeof("hex")]; + char uniname2ctype_pool_str1341[sizeof("balinese")]; + char uniname2ctype_pool_str1344[sizeof("arab")]; + char uniname2ctype_pool_str1346[sizeof("pi")]; + char uniname2ctype_pool_str1348[sizeof("brahmi")]; + char uniname2ctype_pool_str1355[sizeof("elbasan")]; + char uniname2ctype_pool_str1360[sizeof("ingeometricshapesextended")]; + char uniname2ctype_pool_str1368[sizeof("inhanguljamo")]; + char uniname2ctype_pool_str1370[sizeof("graph")]; + char uniname2ctype_pool_str1371[sizeof("sarb")]; + char uniname2ctype_pool_str1373[sizeof("pcm")]; + char uniname2ctype_pool_str1378[sizeof("pc")]; + char uniname2ctype_pool_str1379[sizeof("inethiopicextendeda")]; + char uniname2ctype_pool_str1380[sizeof("incaucasianalbanian")]; + char uniname2ctype_pool_str1388[sizeof("pe")]; + char uniname2ctype_pool_str1390[sizeof("sundanese")]; + char uniname2ctype_pool_str1396[sizeof("inphaistosdisc")]; + char uniname2ctype_pool_str1398[sizeof("inancientgreekmusicalnotation")]; + char uniname2ctype_pool_str1410[sizeof("modifierletter")]; + char uniname2ctype_pool_str1416[sizeof("word")]; + char uniname2ctype_pool_str1418[sizeof("ps")]; + char uniname2ctype_pool_str1419[sizeof("changeswhencasemapped")]; + char uniname2ctype_pool_str1425[sizeof("lowercaseletter")]; + char uniname2ctype_pool_str1429[sizeof("inancientgreeknumbers")]; + char uniname2ctype_pool_str1430[sizeof("saurashtra")]; + char uniname2ctype_pool_str1439[sizeof("hexdigit")]; + char uniname2ctype_pool_str1444[sizeof("space")]; + char uniname2ctype_pool_str1452[sizeof("inbrahmi")]; + char uniname2ctype_pool_str1472[sizeof("inblockelements")]; + char uniname2ctype_pool_str1481[sizeof("incoptic")]; + char uniname2ctype_pool_str1493[sizeof("mlym")]; + char uniname2ctype_pool_str1502[sizeof("multani")]; + char uniname2ctype_pool_str1503[sizeof("lyci")]; + char uniname2ctype_pool_str1508[sizeof("linearb")]; + char uniname2ctype_pool_str1509[sizeof("changeswhentitlecased")]; + char uniname2ctype_pool_str1513[sizeof("rejang")]; + char uniname2ctype_pool_str1516[sizeof("lycian")]; + char uniname2ctype_pool_str1517[sizeof("inbassavah")]; + char uniname2ctype_pool_str1518[sizeof("lisu")]; + char uniname2ctype_pool_str1521[sizeof("incombininghalfmarks")]; + char uniname2ctype_pool_str1524[sizeof("malayalam")]; + char uniname2ctype_pool_str1526[sizeof("patws")]; + char uniname2ctype_pool_str1529[sizeof("palm")]; + char uniname2ctype_pool_str1536[sizeof("tagalog")]; + char uniname2ctype_pool_str1537[sizeof("psalterpahlavi")]; + char uniname2ctype_pool_str1538[sizeof("mymr")]; + char uniname2ctype_pool_str1540[sizeof("incopticepactnumbers")]; + char uniname2ctype_pool_str1542[sizeof("inletterlikesymbols")]; + char uniname2ctype_pool_str1549[sizeof("alpha")]; + char uniname2ctype_pool_str1551[sizeof("inlepcha")]; + char uniname2ctype_pool_str1553[sizeof("inpalmyrene")]; + char uniname2ctype_pool_str1554[sizeof("lepc")]; + char uniname2ctype_pool_str1561[sizeof("runic")]; + char uniname2ctype_pool_str1563[sizeof("inugaritic")]; + char uniname2ctype_pool_str1567[sizeof("myanmar")]; + char uniname2ctype_pool_str1572[sizeof("saur")]; + char uniname2ctype_pool_str1573[sizeof("mult")]; + char uniname2ctype_pool_str1579[sizeof("talu")]; + char uniname2ctype_pool_str1584[sizeof("syrc")]; + char uniname2ctype_pool_str1586[sizeof("perm")]; + char uniname2ctype_pool_str1591[sizeof("telu")]; + char uniname2ctype_pool_str1597[sizeof("tangut")]; + char uniname2ctype_pool_str1598[sizeof("insaurashtra")]; + char uniname2ctype_pool_str1602[sizeof("inoriya")]; + char uniname2ctype_pool_str1604[sizeof("graphemeextend")]; + char uniname2ctype_pool_str1607[sizeof("imperialaramaic")]; + char uniname2ctype_pool_str1613[sizeof("inbengali")]; + char uniname2ctype_pool_str1614[sizeof("variationselector")]; + char uniname2ctype_pool_str1619[sizeof("syriac")]; + char uniname2ctype_pool_str1622[sizeof( + "inarabicmathematicalalphabeticsymbols")]; + char uniname2ctype_pool_str1624[sizeof("beng")]; + char uniname2ctype_pool_str1625[sizeof("inimperialaramaic")]; + char uniname2ctype_pool_str1626[sizeof("sylotinagri")]; + char uniname2ctype_pool_str1630[sizeof("inyiradicals")]; + char uniname2ctype_pool_str1637[sizeof("mathsymbol")]; + char uniname2ctype_pool_str1638[sizeof("inbuginese")]; + char uniname2ctype_pool_str1641[sizeof("osmanya")]; + char uniname2ctype_pool_str1645[sizeof("idsb")]; + char uniname2ctype_pool_str1646[sizeof("bidic")]; + char uniname2ctype_pool_str1647[sizeof("inphoenician")]; + char uniname2ctype_pool_str1650[sizeof("prti")]; + char uniname2ctype_pool_str1653[sizeof("brah")]; + char uniname2ctype_pool_str1657[sizeof("cuneiform")]; + char uniname2ctype_pool_str1659[sizeof("ogrext")]; + char uniname2ctype_pool_str1662[sizeof("incountingrodnumerals")]; + char uniname2ctype_pool_str1665[sizeof("hebr")]; + char uniname2ctype_pool_str1666[sizeof("cprt")]; + char uniname2ctype_pool_str1673[sizeof("coptic")]; + char uniname2ctype_pool_str1676[sizeof("indevanagariextended")]; + char uniname2ctype_pool_str1677[sizeof("inyijinghexagramsymbols")]; + char uniname2ctype_pool_str1681[sizeof("incyrillicsupplement")]; + char uniname2ctype_pool_str1683[sizeof("inarabicextendeda")]; + char uniname2ctype_pool_str1688[sizeof("inalchemicalsymbols")]; + char uniname2ctype_pool_str1691[sizeof("signwriting")]; + char uniname2ctype_pool_str1692[sizeof("inaegeannumbers")]; + char uniname2ctype_pool_str1694[sizeof("privateuse")]; + char uniname2ctype_pool_str1696[sizeof("ininscriptionalparthian")]; + char uniname2ctype_pool_str1697[sizeof("braille")]; + char uniname2ctype_pool_str1698[sizeof("ininscriptionalpahlavi")]; + char uniname2ctype_pool_str1702[sizeof("incherokeesupplement")]; + char uniname2ctype_pool_str1703[sizeof("tagb")]; + char uniname2ctype_pool_str1706[sizeof("inlinearbsyllabary")]; + char uniname2ctype_pool_str1713[sizeof("cyrl")]; + char uniname2ctype_pool_str1714[sizeof("intagbanwa")]; + char uniname2ctype_pool_str1715[sizeof( + "inunifiedcanadianaboriginalsyllabics")]; + char uniname2ctype_pool_str1719[sizeof("copt")]; + char uniname2ctype_pool_str1722[sizeof("inkannada")]; + char uniname2ctype_pool_str1723[sizeof("tirhuta")]; + char uniname2ctype_pool_str1724[sizeof("kana")]; + char uniname2ctype_pool_str1727[sizeof("changeswhencasefolded")]; + char uniname2ctype_pool_str1733[sizeof("inhighsurrogates")]; + char uniname2ctype_pool_str1734[sizeof("runr")]; + char uniname2ctype_pool_str1737[sizeof("cakm")]; + char uniname2ctype_pool_str1741[sizeof("inlatin1supplement")]; + char uniname2ctype_pool_str1743[sizeof("print")]; + char uniname2ctype_pool_str1752[sizeof("inchakma")]; + char uniname2ctype_pool_str1767[sizeof("patternwhitespace")]; + char uniname2ctype_pool_str1768[sizeof("number")]; + char uniname2ctype_pool_str1771[sizeof("mendekikakui")]; + char uniname2ctype_pool_str1774[sizeof("spaceseparator")]; + char uniname2ctype_pool_str1775[sizeof("changeswhenlowercased")]; + char uniname2ctype_pool_str1786[sizeof("sylo")]; + char uniname2ctype_pool_str1790[sizeof("meeteimayek")]; + char uniname2ctype_pool_str1794[sizeof("inethiopicsupplement")]; + char uniname2ctype_pool_str1804[sizeof("orya")]; + char uniname2ctype_pool_str1805[sizeof("inalphabeticpresentationforms")]; + char uniname2ctype_pool_str1806[sizeof("inkaithi")]; + char uniname2ctype_pool_str1809[sizeof("incjkcompatibilityforms")]; + char uniname2ctype_pool_str1811[sizeof("takri")]; + char uniname2ctype_pool_str1814[sizeof("incjkcompatibilityideographs")]; + char uniname2ctype_pool_str1826[sizeof("inkatakana")]; + char uniname2ctype_pool_str1835[sizeof("phli")]; + char uniname2ctype_pool_str1843[sizeof("sund")]; + char uniname2ctype_pool_str1845[sizeof("inmathematicaloperators")]; + char uniname2ctype_pool_str1848[sizeof("closepunctuation")]; + char uniname2ctype_pool_str1850[sizeof("incjkstrokes")]; + char uniname2ctype_pool_str1851[sizeof("separator")]; + char uniname2ctype_pool_str1856[sizeof("finalpunctuation")]; + char uniname2ctype_pool_str1860[sizeof("inmeeteimayek")]; + char uniname2ctype_pool_str1862[sizeof("inethiopicextended")]; + char uniname2ctype_pool_str1866[sizeof("unassigned")]; + char uniname2ctype_pool_str1869[sizeof("inpsalterpahlavi")]; + char uniname2ctype_pool_str1870[sizeof("inphagspa")]; + char uniname2ctype_pool_str1872[sizeof("po")]; + char uniname2ctype_pool_str1873[sizeof("otherdefaultignorablecodepoint")]; + char uniname2ctype_pool_str1876[sizeof( + "incjkcompatibilityideographssupplement")]; + char uniname2ctype_pool_str1883[sizeof("kali")]; + char uniname2ctype_pool_str1884[sizeof("lepcha")]; + char uniname2ctype_pool_str1886[sizeof("wspace")]; + char uniname2ctype_pool_str1893[sizeof("softdotted")]; + char uniname2ctype_pool_str1904[sizeof("grbase")]; + char uniname2ctype_pool_str1905[sizeof("inhanunoo")]; + char uniname2ctype_pool_str1906[sizeof("cyrillic")]; + char uniname2ctype_pool_str1910[sizeof("incombiningdiacriticalmarks")]; + char uniname2ctype_pool_str1920[sizeof( + "incombiningdiacriticalmarksforsymbols")]; + char uniname2ctype_pool_str1921[sizeof("meroitichieroglyphs")]; + char uniname2ctype_pool_str1931[sizeof("mark")]; + char uniname2ctype_pool_str1932[sizeof("ugaritic")]; + char uniname2ctype_pool_str1933[sizeof("aghb")]; + char uniname2ctype_pool_str1935[sizeof("inbuhid")]; + char uniname2ctype_pool_str1937[sizeof("inkanasupplement")]; + char uniname2ctype_pool_str1941[sizeof("phoenician")]; + char uniname2ctype_pool_str1945[sizeof("inkharoshthi")]; + char uniname2ctype_pool_str1951[sizeof("inkhmer")]; + char uniname2ctype_pool_str1964[sizeof("symbol")]; + char uniname2ctype_pool_str1968[sizeof("pf")]; + char uniname2ctype_pool_str1972[sizeof( + "incombiningdiacriticalmarkssupplement")]; + char uniname2ctype_pool_str1980[sizeof("lydi")]; + char uniname2ctype_pool_str1981[sizeof("hangul")]; + char uniname2ctype_pool_str1985[sizeof("incurrencysymbols")]; + char uniname2ctype_pool_str1987[sizeof("intangutcomponents")]; + char uniname2ctype_pool_str1993[sizeof("lydian")]; + char uniname2ctype_pool_str2004[sizeof("othergraphemeextend")]; + char uniname2ctype_pool_str2015[sizeof("intakri")]; + char uniname2ctype_pool_str2016[sizeof("takr")]; + char uniname2ctype_pool_str2018[sizeof("induployan")]; + char uniname2ctype_pool_str2026[sizeof("ugar")]; + char uniname2ctype_pool_str2027[sizeof("inprivateusearea")]; + char uniname2ctype_pool_str2046[sizeof("kaithi")]; + char uniname2ctype_pool_str2051[sizeof("inkhmersymbols")]; + char uniname2ctype_pool_str2068[sizeof("bidicontrol")]; + char uniname2ctype_pool_str2070[sizeof("ethiopic")]; + char uniname2ctype_pool_str2083[sizeof("inhebrew")]; + char uniname2ctype_pool_str2111[sizeof("bassavah")]; + char uniname2ctype_pool_str2115[sizeof("kthi")]; + char uniname2ctype_pool_str2119[sizeof("inoldpersian")]; + char uniname2ctype_pool_str2122[sizeof("hung")]; + char uniname2ctype_pool_str2126[sizeof("xpeo")]; + char uniname2ctype_pool_str2136[sizeof("inoldpermic")]; + char uniname2ctype_pool_str2153[sizeof("olck")]; + char uniname2ctype_pool_str2157[sizeof("phnx")]; + char uniname2ctype_pool_str2164[sizeof("olchiki")]; + char uniname2ctype_pool_str2169[sizeof("phag")]; + char uniname2ctype_pool_str2180[sizeof( + "inunifiedcanadianaboriginalsyllabicsextended")]; + char uniname2ctype_pool_str2184[sizeof("inpahawhhmong")]; + char uniname2ctype_pool_str2193[sizeof("inhalfwidthandfullwidthforms")]; + char uniname2ctype_pool_str2200[sizeof("patternsyntax")]; + char uniname2ctype_pool_str2203[sizeof("inphoneticextensions")]; + char uniname2ctype_pool_str2208[sizeof("knda")]; + char uniname2ctype_pool_str2219[sizeof("combiningmark")]; + char uniname2ctype_pool_str2220[sizeof("plrd")]; + char uniname2ctype_pool_str2221[sizeof("inmendekikakui")]; + char uniname2ctype_pool_str2230[sizeof("hluw")]; + char uniname2ctype_pool_str2231[sizeof("nko")]; + char uniname2ctype_pool_str2232[sizeof("nkoo")]; + char uniname2ctype_pool_str2235[sizeof("inhanguljamoextendedb")]; + char uniname2ctype_pool_str2237[sizeof("kannada")]; + char uniname2ctype_pool_str2240[sizeof("khmr")]; + char uniname2ctype_pool_str2246[sizeof("khar")]; + char uniname2ctype_pool_str2248[sizeof("otheruppercase")]; + char uniname2ctype_pool_str2249[sizeof("oldhungarian")]; + char uniname2ctype_pool_str2254[sizeof("graphemeclusterbreak=ebasegaz")]; + char uniname2ctype_pool_str2256[sizeof("inkhojki")]; + char uniname2ctype_pool_str2259[sizeof("graphemeclusterbreak=ebase")]; + char uniname2ctype_pool_str2262[sizeof("otherpunctuation")]; + char uniname2ctype_pool_str2265[sizeof("inphoneticextensionssupplement")]; + char uniname2ctype_pool_str2273[sizeof("enclosingmark")]; + char uniname2ctype_pool_str2285[sizeof("inkatakanaphoneticextensions")]; + char uniname2ctype_pool_str2292[sizeof("gujr")]; + char uniname2ctype_pool_str2293[sizeof("inkangxiradicals")]; + char uniname2ctype_pool_str2310[sizeof("inarabicpresentationformsb")]; + char uniname2ctype_pool_str2313[sizeof("gujarati")]; + char uniname2ctype_pool_str2322[sizeof("graphemeclusterbreak=t")]; + char uniname2ctype_pool_str2324[sizeof("graphemeclusterbreak=lvt")]; + char uniname2ctype_pool_str2332[sizeof("pd")]; + char uniname2ctype_pool_str2333[sizeof("xsux")]; + char uniname2ctype_pool_str2341[sizeof("uideo")]; + char uniname2ctype_pool_str2346[sizeof("hebrew")]; + char uniname2ctype_pool_str2349[sizeof("kharoshthi")]; + char uniname2ctype_pool_str2350[sizeof("surrogate")]; + char uniname2ctype_pool_str2353[sizeof("incyrillicextendedb")]; + char uniname2ctype_pool_str2360[sizeof("cherokee")]; + char uniname2ctype_pool_str2373[sizeof("modifiersymbol")]; + char + uniname2ctype_pool_str2375[sizeof("incombiningdiacriticalmarksextended")]; + char uniname2ctype_pool_str2399[sizeof("graphemeclusterbreak=l")]; + char uniname2ctype_pool_str2405[sizeof("graphemeclusterbreak=control")]; + char uniname2ctype_pool_str2410[sizeof("deprecated")]; + char uniname2ctype_pool_str2418[sizeof("ingeorgiansupplement")]; + char uniname2ctype_pool_str2419[sizeof("idstrinaryoperator")]; + char uniname2ctype_pool_str2425[sizeof("bamu")]; + char uniname2ctype_pool_str2427[sizeof("inbamum")]; + char uniname2ctype_pool_str2430[sizeof("grek")]; + char uniname2ctype_pool_str2445[sizeof("graphemeclusterbreak=cr")]; + char uniname2ctype_pool_str2451[sizeof("inmeroiticcursive")]; + char uniname2ctype_pool_str2452[sizeof("graphemeclusterbreak=emodifier")]; + char uniname2ctype_pool_str2455[sizeof("khmer")]; + char uniname2ctype_pool_str2460[sizeof( + "graphemeclusterbreak=regionalindicator")]; + char uniname2ctype_pool_str2476[sizeof("inglagoliticsupplement")]; + char uniname2ctype_pool_str2477[sizeof("oldturkic")]; + char uniname2ctype_pool_str2487[sizeof("inlatinextendedb")]; + char uniname2ctype_pool_str2489[sizeof("unifiedideograph")]; + char uniname2ctype_pool_str2500[sizeof("orkh")]; + char uniname2ctype_pool_str2511[sizeof("graphemeclusterbreak=zwj")]; + char uniname2ctype_pool_str2518[sizeof("caucasianalbanian")]; + char uniname2ctype_pool_str2520[sizeof("graphemeclusterbreak=glueafterzwj")]; + char uniname2ctype_pool_str2530[sizeof("oldnortharabian")]; + char uniname2ctype_pool_str2546[sizeof("graphemeclusterbreak=lf")]; + char uniname2ctype_pool_str2565[sizeof("khoj")]; + char uniname2ctype_pool_str2589[sizeof("inlimbu")]; + char uniname2ctype_pool_str2602[sizeof("inarabicsupplement")]; + char uniname2ctype_pool_str2629[sizeof("any")]; + char uniname2ctype_pool_str2661[sizeof("alphabetic")]; + char uniname2ctype_pool_str2663[sizeof("defaultignorablecodepoint")]; + char uniname2ctype_pool_str2673[sizeof("p")]; + char uniname2ctype_pool_str2674[sizeof("pauc")]; + char uniname2ctype_pool_str2691[sizeof("zp")]; + char uniname2ctype_pool_str2692[sizeof("inbamumsupplement")]; + char uniname2ctype_pool_str2698[sizeof("xposixpunct")]; + char uniname2ctype_pool_str2732[sizeof("graphemeclusterbreak=extend")]; + char uniname2ctype_pool_str2733[sizeof("graphemeclusterbreak=prepend")]; + char uniname2ctype_pool_str2735[sizeof("inyisyllables")]; + char uniname2ctype_pool_str2755[sizeof("patsyn")]; + char uniname2ctype_pool_str2773[sizeof("lu")]; + char uniname2ctype_pool_str2787[sizeof("limbu")]; + char uniname2ctype_pool_str2808[sizeof("inkanbun")]; + char uniname2ctype_pool_str2810[sizeof("insuperscriptsandsubscripts")]; + char uniname2ctype_pool_str2822[sizeof("inlisu")]; + char uniname2ctype_pool_str2827[sizeof("punct")]; + char uniname2ctype_pool_str2844[sizeof("currencysymbol")]; + char uniname2ctype_pool_str2845[sizeof("graphemeclusterbreak=v")]; + char uniname2ctype_pool_str2846[sizeof("graphemeclusterbreak=lv")]; + char uniname2ctype_pool_str2876[sizeof("intelugu")]; + char + uniname2ctype_pool_str2897[sizeof("insupplementalmathematicaloperators")]; + char uniname2ctype_pool_str2902[sizeof("batk")]; + char uniname2ctype_pool_str2903[sizeof("bugi")]; + char uniname2ctype_pool_str2907[sizeof("changeswhenuppercased")]; + char uniname2ctype_pool_str2910[sizeof("inbatak")]; + char uniname2ctype_pool_str2928[sizeof("inplayingcards")]; + char uniname2ctype_pool_str2932[sizeof("pahawhhmong")]; + char uniname2ctype_pool_str2954[sizeof("buginese")]; + char uniname2ctype_pool_str2974[sizeof("bopo")]; + char uniname2ctype_pool_str2977[sizeof("innoblock")]; + char uniname2ctype_pool_str2985[sizeof("inbopomofo")]; + char uniname2ctype_pool_str2997[sizeof("hyphen")]; + char uniname2ctype_pool_str3030[sizeof("inkayahli")]; + char uniname2ctype_pool_str3032[sizeof("cypriot")]; + char uniname2ctype_pool_str3057[sizeof("insupplementalarrowsa")]; + char uniname2ctype_pool_str3059[sizeof("cwu")]; + char uniname2ctype_pool_str3064[sizeof("insupplementalarrowsc")]; + char uniname2ctype_pool_str3067[sizeof("phagspa")]; + char uniname2ctype_pool_str3070[sizeof("incjkcompatibility")]; + char uniname2ctype_pool_str3072[sizeof("palmyrene")]; + char uniname2ctype_pool_str3081[sizeof("incypriotsyllabary")]; + char uniname2ctype_pool_str3096[sizeof("inboxdrawing")]; + char uniname2ctype_pool_str3098[sizeof("spacingmark")]; + char uniname2ctype_pool_str3159[sizeof("bhks")]; + char uniname2ctype_pool_str3161[sizeof("incjksymbolsandpunctuation")]; + char uniname2ctype_pool_str3165[sizeof("egyp")]; + char uniname2ctype_pool_str3167[sizeof("phlp")]; + char uniname2ctype_pool_str3181[sizeof("bhaiksuki")]; + char uniname2ctype_pool_str3197[sizeof("dep")]; + char uniname2ctype_pool_str3224[sizeof("buhd")]; + char uniname2ctype_pool_str3231[sizeof("inegyptianhieroglyphs")]; + char uniname2ctype_pool_str3252[sizeof("bopomofo")]; + char uniname2ctype_pool_str3295[sizeof("dashpunctuation")]; + char uniname2ctype_pool_str3307[sizeof("dupl")]; + char uniname2ctype_pool_str3314[sizeof("guru")]; + char uniname2ctype_pool_str3338[sizeof("nonspacingmark")]; + char uniname2ctype_pool_str3346[sizeof("prependedconcatenationmark")]; + char uniname2ctype_pool_str3363[sizeof("oupper")]; + char uniname2ctype_pool_str3388[sizeof("telugu")]; + char uniname2ctype_pool_str3413[sizeof("qmark")]; + char uniname2ctype_pool_str3428[sizeof("sk")]; + char uniname2ctype_pool_str3500[sizeof("egyptianhieroglyphs")]; + char uniname2ctype_pool_str3511[sizeof("inkhudawadi")]; + char uniname2ctype_pool_str3514[sizeof("kayahli")]; + char uniname2ctype_pool_str3525[sizeof("katakana")]; + char uniname2ctype_pool_str3550[sizeof("inhangulcompatibilityjamo")]; + char uniname2ctype_pool_str3552[sizeof("incjkradicalssupplement")]; + char uniname2ctype_pool_str3595[sizeof("quotationmark")]; + char uniname2ctype_pool_str3617[sizeof("oldsoutharabian")]; + char uniname2ctype_pool_str3704[sizeof("unknown")]; + char uniname2ctype_pool_str3722[sizeof("buhid")]; + char uniname2ctype_pool_str3776[sizeof("khudawadi")]; + char uniname2ctype_pool_str3828[sizeof("incjkunifiedideographsextensiona")]; + char uniname2ctype_pool_str3835[sizeof("incjkunifiedideographsextensionc")]; + char uniname2ctype_pool_str3840[sizeof("incjkunifiedideographsextensione")]; + char uniname2ctype_pool_str3845[sizeof("incjkunifiedideographs")]; + char uniname2ctype_pool_str3931[sizeof("paragraphseparator")]; + char uniname2ctype_pool_str3933[sizeof("graphemeclusterbreak=spacingmark")]; + char uniname2ctype_pool_str3939[sizeof("zyyy")]; + char uniname2ctype_pool_str3965[sizeof("paucinhau")]; + char uniname2ctype_pool_str3974[sizeof("inpaucinhau")]; + char uniname2ctype_pool_str3989[sizeof("khojki")]; + char uniname2ctype_pool_str4043[sizeof("punctuation")]; + char uniname2ctype_pool_str4124[sizeof("greek")]; + char uniname2ctype_pool_str4136[sizeof("insupplementalpunctuation")]; + char uniname2ctype_pool_str4144[sizeof("insupplementalarrowsb")]; + char uniname2ctype_pool_str4188[sizeof("insupplementaryprivateuseareaa")]; + char + uniname2ctype_pool_str4190[sizeof("insupplementalsymbolsandpictographs")]; + char uniname2ctype_pool_str4214[sizeof("inbopomofoextended")]; + char uniname2ctype_pool_str4241[sizeof("uppercase")]; + char uniname2ctype_pool_str4270[sizeof("grlink")]; + char uniname2ctype_pool_str4312[sizeof("incjkunifiedideographsextensiond")]; + char uniname2ctype_pool_str4373[sizeof("openpunctuation")]; + char uniname2ctype_pool_str4406[sizeof("upper")]; + char uniname2ctype_pool_str4466[sizeof("graphemelink")]; + char uniname2ctype_pool_str4528[sizeof("uppercaseletter")]; + char uniname2ctype_pool_str4596[sizeof("batak")]; + char uniname2ctype_pool_str4673[sizeof("blank")]; + char uniname2ctype_pool_str4716[sizeof("duployan")]; + char uniname2ctype_pool_str4915[sizeof("incjkunifiedideographsextensionb")]; + char uniname2ctype_pool_str5015[sizeof("gurmukhi")]; + char uniname2ctype_pool_str5275[sizeof("insupplementaryprivateuseareab")]; +#endif /* USE_UNICODE_PROPERTIES */ +}; +static const struct uniname2ctype_pool_t uniname2ctype_pool_contents = { +#ifndef USE_UNICODE_PROPERTIES + "word", + "print", + "punct", + "alpha", + "alnum", + "xdigit", + "upper", +#else /* USE_UNICODE_PROPERTIES */ + "n", + "mn", + "m", + "cn", + "mani", + "ci", + "inmanichaean", + "z", + "qaai", + "c", + "mc", + "qaac", + "sm", + "incham", + "me", + "inarmenian", + "cc", + "mandaic", + "incuneiform", + "zzzz", + "insamaritan", + "cans", + "s", + "sc", +#endif /* USE_UNICODE_PROPERTIES */ + "ascii", +#ifdef USE_UNICODE_PROPERTIES + "inavestan", + "zs", + "cs", + "inipaextensions", + "incuneiformnumbersandpunctuation", + "incommonindicnumberforms", + "inthai", + "mtei", + "inspecials", + "initialpunctuation", + "inthaana", + "inancientsymbols", + "inmiscellaneousmathematicalsymbolsa", + "inmusicalsymbols", + "taile", + "inmyanmarextendeda", + "sterm", + "lm", + "lina", + "inmiscellaneoussymbols", + "lana", + "intransportandmapsymbols", + "alnum", + "inlycian", + "inmiscellaneoussymbolsandarrows", + "intaitham", + "lc", + "inmalayalam", + "inmiscellaneoussymbolsandpictographs", + "inadlam", + "incontrolpictures", + "inlineara", + "taiviet", + "armn", + "armi", + "sinhala", + "armenian", + "inmyanmar", + "inrunic", + "incarian", + "cari", + "inmarchen", + "marc", + "carian", + "merc", + "incyrillic", + "samr", + "latn", + "latin", + "ital", + "intamil", + "taml", + "inmultani", + "samaritan", + "arabic", + "insyriac", + "insharada", + "miao", + "inlinearbideograms", + "incherokee", + "intaile", + "tale", + "inahom", + "inmeeteimayekextensions", + "inruminumeralsymbols", + "inlatinextendeda", + "inosmanya", + "inlatinextendedc", + "osma", + "inlatinextendede", + "l", + "han", + "nl", + "term", + "hani", + "inideographicsymbolsandpunctuation", + "zinh", + "lt", + "zl", + "inmahajani", + "cham", + "connectorpunctuation", + "sinh", + "manichaean", + "osage", + "inmiscellaneoustechnical", + "inethiopic", + "insinhala", + "chakma", + "shavian", + "inideographicdescriptioncharacters", + "lineara", + "meroiticcursive", + "thai", + "math", + "inemoticons", + "thaa", + "ethi", + "hatran", + "inenclosedalphanumerics", + "sentenceterminal", + "tamil", +#endif /* USE_UNICODE_PROPERTIES */ + "cntrl", +#ifndef USE_UNICODE_PROPERTIES + "space", + "xposixpunct", +#else /* USE_UNICODE_PROPERTIES */ + "taitham", + "thaana", + "terminalpunctuation", + "insinhalaarchaicnumbers", + "innewa", + "newa", + "inlatinextendedadditional", + "cwcm", + "loe", + "inopticalcharacterrecognition", + "inearlydynasticcuneiform", + "di", + "asciihexdigit", + "ll", + "newtailue", + "inscriptionalparthian", + "inenclosedalphanumericsupplement", + "oriya", + "mero", + "inmongolian", + "mand", + "inmodi", + "dia", + "mend", + "ingrantha", + "no", + "sora", + "inmandaic", +# ifdef USE_UNICODE_AGE_PROPERTIES + "age=1.1", + "age=2.1", +# endif /* USE_UNICODE_AGE_PROPERTIES */ + "idc", + "innko", + "sind", + "inarrows", +# ifdef USE_UNICODE_AGE_PROPERTIES + "age=6.1", + "age=6.2", + "age=2.0", +# endif /* USE_UNICODE_AGE_PROPERTIES */ + "inmro", +# ifdef USE_UNICODE_AGE_PROPERTIES + "age=3.1", + "age=3.2", +# endif /* USE_UNICODE_AGE_PROPERTIES */ + "titlecaseletter", +# ifdef USE_UNICODE_AGE_PROPERTIES + "age=6.0", +# endif /* USE_UNICODE_AGE_PROPERTIES */ + "co", + "hira", +# ifdef USE_UNICODE_AGE_PROPERTIES + "age=6.3", + "age=3.0", +# endif /* USE_UNICODE_AGE_PROPERTIES */ + "ingeneralpunctuation", +# ifdef USE_UNICODE_AGE_PROPERTIES + "age=9.0", + "age=8.0", + "age=5.1", + "age=5.2", +# endif /* USE_UNICODE_AGE_PROPERTIES */ + "inmiao", +# ifdef USE_UNICODE_AGE_PROPERTIES + "age=4.1", + "age=7.0", +# endif /* USE_UNICODE_AGE_PROPERTIES */ + "innewtailue", + "common", +# ifdef USE_UNICODE_AGE_PROPERTIES + "age=5.0", + "age=4.0", +# endif /* USE_UNICODE_AGE_PROPERTIES */ + "so", + "inhiragana", + "insundanese", + "ids", + "cher", + "marchen", + "indominotiles", + "joinc", + "tang", + "hano", + "ahom", + "inogham", + "inscriptionalpahlavi", + "mahj", + "inolchiki", + "invai", + "tagbanwa", + "tirh", + "idst", + "vai", + "vaii", + "cwt", + "inhatran", + "hatr", + "mahajani", + "idcontinue", + "cf", + "intirhuta", + "inenclosedcjklettersandmonths", + "intaixuanjingsymbols", + "inspacingmodifierletters", + "indeseret", + "intags", + "wara", + "inshavian", + "inlydian", + "inwarangciti", + "inmathematicalalphanumericsymbols", + "adlm", + "intangut", + "vs", + "adlam", + "lo", + "ext", + "insylotinagri", + "inlao", + "inlowsurrogates", + "anatolianhieroglyphs", + "lao", + "laoo", + "mongolian", + "gran", + "lineseparator", + "ingurmukhi", + "letter", + "intifinagh", + "tifinagh", + "mro", + "mroo", + "diacritic", + "avst", + "avestan", + "mong", + "inanatolianhieroglyphs", + "odi", + "nchar", + "caseignorable", + "modi", + "insorasompeng", + "ogam", + "oidc", + "cwcf", + "cwl", + "ideo", + "oalpha", + "inolditalic", + "ingujarati", + "inosage", + "oids", + "shaw", + "decimalnumber", + "tavt", + "intaiviet", + "hmng", + "inmongoliansupplement", + "osge", + "hang", + "insuttonsignwriting", + "inmahjongtiles", + "dsrt", + "ahex", + "whitespace", + "insundanesesupplement", + "inmodifiertoneletters", + "idstart", + "ingreekandcoptic", + "dash", + "hanunoo", + "siddham", + "inoldturkic", + "ingeometricshapes", + "deseret", + "gothic", + "sharada", + "tfng", + "insmallformvariants", + "inshorthandformatcontrols", + "grext", + "java", + "radical", + "omath", + "canadianaboriginal", + "ingothic", + "otheridcontinue", + "control", + "injavanese", + "noncharactercodepoint", + "invariationselectors", + "casedletter", + "letternumber", + "javanese", + "otheralphabetic", + "sgnw", + "ingeorgian", + "rjng", + "nd", + "format", + "geor", + "inornamentaldingbats", + "inrejang", + "inoldnortharabian", + "joincontrol", + "xidc", + "invariationselectorssupplement", + "sd", + "xids", + "sidd", + "indingbats", + "inherited", + "inmeroitichieroglyphs", + "inenclosedideographicsupplement", + "inoldsoutharabian", + "insiddham", + "inglagolitic", + "ingreekextended", + "olditalic", + "hiragana", + "idsbinaryoperator", + "cased", + "inhangulsyllables", + "shrd", + "assigned", + "otheridstart", + "ogham", + "intagalog", + "inoldhungarian", + "other", + "othersymbol", + "otherlowercase", + "othernumber", + "graphemebase", + "innabataean", + "inbhaiksuki", + "lowercase", + "bamum", + "glagolitic", + "inhanguljamoextendeda", + "indevanagari", + "inelbasan", + "deva", + "grantha", + "inarabic", + "olower", + "inbasiclatin", + "devanagari", + "warangciti", + "innumberforms", + "glag", + "goth", + "invedicextensions", + "oldpersian", + "digit", + "xdigit", + "bass", + "xidstart", + "oldpermic", + "nbat", + "inarabicpresentationformsa", + "logicalorderexception", + "inbyzantinemusicalsymbols", + "nabataean", + "intibetan", + "othermath", + "inmiscellaneousmathematicalsymbolsb", + "inverticalforms", + "tglg", + "inmyanmarextendedb", + "ideographic", + "incyrillicextendeda", + "inbraillepatterns", + "incyrillicextendedc", + "linb", + "inlatinextendedd", + "limb", + "otherletter", + "bali", + "tibt", + "georgian", + "xidcontinue", +#endif /* USE_UNICODE_PROPERTIES */ + "lower", +#ifdef USE_UNICODE_PROPERTIES + "tibetan", + "elba", + "inbalinese", + "yi", + "bengali", + "yiii", + "inhighprivateusesurrogates", + "extender", + "narb", + "sorasompeng", + "brai", + "hex", + "balinese", + "arab", + "pi", + "brahmi", + "elbasan", + "ingeometricshapesextended", + "inhanguljamo", +#endif /* USE_UNICODE_PROPERTIES */ + "graph", +#ifndef USE_UNICODE_PROPERTIES + "digit", + "blank" +#else /* USE_UNICODE_PROPERTIES */ + "sarb", + "pcm", + "pc", + "inethiopicextendeda", + "incaucasianalbanian", + "pe", + "sundanese", + "inphaistosdisc", + "inancientgreekmusicalnotation", + "modifierletter", + "word", + "ps", + "changeswhencasemapped", + "lowercaseletter", + "inancientgreeknumbers", + "saurashtra", + "hexdigit", + "space", + "inbrahmi", + "inblockelements", + "incoptic", + "mlym", + "multani", + "lyci", + "linearb", + "changeswhentitlecased", + "rejang", + "lycian", + "inbassavah", + "lisu", + "incombininghalfmarks", + "malayalam", + "patws", + "palm", + "tagalog", + "psalterpahlavi", + "mymr", + "incopticepactnumbers", + "inletterlikesymbols", + "alpha", + "inlepcha", + "inpalmyrene", + "lepc", + "runic", + "inugaritic", + "myanmar", + "saur", + "mult", + "talu", + "syrc", + "perm", + "telu", + "tangut", + "insaurashtra", + "inoriya", + "graphemeextend", + "imperialaramaic", + "inbengali", + "variationselector", + "syriac", + "inarabicmathematicalalphabeticsymbols", + "beng", + "inimperialaramaic", + "sylotinagri", + "inyiradicals", + "mathsymbol", + "inbuginese", + "osmanya", + "idsb", + "bidic", + "inphoenician", + "prti", + "brah", + "cuneiform", + "ogrext", + "incountingrodnumerals", + "hebr", + "cprt", + "coptic", + "indevanagariextended", + "inyijinghexagramsymbols", + "incyrillicsupplement", + "inarabicextendeda", + "inalchemicalsymbols", + "signwriting", + "inaegeannumbers", + "privateuse", + "ininscriptionalparthian", + "braille", + "ininscriptionalpahlavi", + "incherokeesupplement", + "tagb", + "inlinearbsyllabary", + "cyrl", + "intagbanwa", + "inunifiedcanadianaboriginalsyllabics", + "copt", + "inkannada", + "tirhuta", + "kana", + "changeswhencasefolded", + "inhighsurrogates", + "runr", + "cakm", + "inlatin1supplement", + "print", + "inchakma", + "patternwhitespace", + "number", + "mendekikakui", + "spaceseparator", + "changeswhenlowercased", + "sylo", + "meeteimayek", + "inethiopicsupplement", + "orya", + "inalphabeticpresentationforms", + "inkaithi", + "incjkcompatibilityforms", + "takri", + "incjkcompatibilityideographs", + "inkatakana", + "phli", + "sund", + "inmathematicaloperators", + "closepunctuation", + "incjkstrokes", + "separator", + "finalpunctuation", + "inmeeteimayek", + "inethiopicextended", + "unassigned", + "inpsalterpahlavi", + "inphagspa", + "po", + "otherdefaultignorablecodepoint", + "incjkcompatibilityideographssupplement", + "kali", + "lepcha", + "wspace", + "softdotted", + "grbase", + "inhanunoo", + "cyrillic", + "incombiningdiacriticalmarks", + "incombiningdiacriticalmarksforsymbols", + "meroitichieroglyphs", + "mark", + "ugaritic", + "aghb", + "inbuhid", + "inkanasupplement", + "phoenician", + "inkharoshthi", + "inkhmer", + "symbol", + "pf", + "incombiningdiacriticalmarkssupplement", + "lydi", + "hangul", + "incurrencysymbols", + "intangutcomponents", + "lydian", + "othergraphemeextend", + "intakri", + "takr", + "induployan", + "ugar", + "inprivateusearea", + "kaithi", + "inkhmersymbols", + "bidicontrol", + "ethiopic", + "inhebrew", + "bassavah", + "kthi", + "inoldpersian", + "hung", + "xpeo", + "inoldpermic", + "olck", + "phnx", + "olchiki", + "phag", + "inunifiedcanadianaboriginalsyllabicsextended", + "inpahawhhmong", + "inhalfwidthandfullwidthforms", + "patternsyntax", + "inphoneticextensions", + "knda", + "combiningmark", + "plrd", + "inmendekikakui", + "hluw", + "nko", + "nkoo", + "inhanguljamoextendedb", + "kannada", + "khmr", + "khar", + "otheruppercase", + "oldhungarian", + "graphemeclusterbreak=ebasegaz", + "inkhojki", + "graphemeclusterbreak=ebase", + "otherpunctuation", + "inphoneticextensionssupplement", + "enclosingmark", + "inkatakanaphoneticextensions", + "gujr", + "inkangxiradicals", + "inarabicpresentationformsb", + "gujarati", + "graphemeclusterbreak=t", + "graphemeclusterbreak=lvt", + "pd", + "xsux", + "uideo", + "hebrew", + "kharoshthi", + "surrogate", + "incyrillicextendedb", + "cherokee", + "modifiersymbol", + "incombiningdiacriticalmarksextended", + "graphemeclusterbreak=l", + "graphemeclusterbreak=control", + "deprecated", + "ingeorgiansupplement", + "idstrinaryoperator", + "bamu", + "inbamum", + "grek", + "graphemeclusterbreak=cr", + "inmeroiticcursive", + "graphemeclusterbreak=emodifier", + "khmer", + "graphemeclusterbreak=regionalindicator", + "inglagoliticsupplement", + "oldturkic", + "inlatinextendedb", + "unifiedideograph", + "orkh", + "graphemeclusterbreak=zwj", + "caucasianalbanian", + "graphemeclusterbreak=glueafterzwj", + "oldnortharabian", + "graphemeclusterbreak=lf", + "khoj", + "inlimbu", + "inarabicsupplement", + "any", + "alphabetic", + "defaultignorablecodepoint", + "p", + "pauc", + "zp", + "inbamumsupplement", + "xposixpunct", + "graphemeclusterbreak=extend", + "graphemeclusterbreak=prepend", + "inyisyllables", + "patsyn", + "lu", + "limbu", + "inkanbun", + "insuperscriptsandsubscripts", + "inlisu", + "punct", + "currencysymbol", + "graphemeclusterbreak=v", + "graphemeclusterbreak=lv", + "intelugu", + "insupplementalmathematicaloperators", + "batk", + "bugi", + "changeswhenuppercased", + "inbatak", + "inplayingcards", + "pahawhhmong", + "buginese", + "bopo", + "innoblock", + "inbopomofo", + "hyphen", + "inkayahli", + "cypriot", + "insupplementalarrowsa", + "cwu", + "insupplementalarrowsc", + "phagspa", + "incjkcompatibility", + "palmyrene", + "incypriotsyllabary", + "inboxdrawing", + "spacingmark", + "bhks", + "incjksymbolsandpunctuation", + "egyp", + "phlp", + "bhaiksuki", + "dep", + "buhd", + "inegyptianhieroglyphs", + "bopomofo", + "dashpunctuation", + "dupl", + "guru", + "nonspacingmark", + "prependedconcatenationmark", + "oupper", + "telugu", + "qmark", + "sk", + "egyptianhieroglyphs", + "inkhudawadi", + "kayahli", + "katakana", + "inhangulcompatibilityjamo", + "incjkradicalssupplement", + "quotationmark", + "oldsoutharabian", + "unknown", + "buhid", + "khudawadi", + "incjkunifiedideographsextensiona", + "incjkunifiedideographsextensionc", + "incjkunifiedideographsextensione", + "incjkunifiedideographs", + "paragraphseparator", + "graphemeclusterbreak=spacingmark", + "zyyy", + "paucinhau", + "inpaucinhau", + "khojki", + "punctuation", + "greek", + "insupplementalpunctuation", + "insupplementalarrowsb", + "insupplementaryprivateuseareaa", + "insupplementalsymbolsandpictographs", + "inbopomofoextended", + "uppercase", + "grlink", + "incjkunifiedideographsextensiond", + "openpunctuation", + "upper", + "graphemelink", + "uppercaseletter", + "batak", + "blank", + "duployan", + "incjkunifiedideographsextensionb", + "gurmukhi", + "insupplementaryprivateuseareab" +#endif /* USE_UNICODE_PROPERTIES */ +}; +#define uniname2ctype_pool ((const char *)&uniname2ctype_pool_contents) +#ifdef __GNUC__ +__inline +# if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ + __attribute__((__gnu_inline__)) +# endif +#endif + const struct uniname2ctype_struct * + uniname2ctype_p(str, len) +register const char *str; +register unsigned int len; +{ + static const struct uniname2ctype_struct wordlist[] = { +#ifdef USE_UNICODE_PROPERTIES + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3), 35}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str11), 34}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str15), 31}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str24), 21}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str29), 186}, + {uniname2ctype_offset(str30), 61}, + {uniname2ctype_offset(str31), 475}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str35), 52}, + {uniname2ctype_offset(str36), 115}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str41), 18}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str49), 32}, + {-1}, + {-1}, + {uniname2ctype_offset(str52), 129}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str56), 50}, + {-1}, + {uniname2ctype_offset(str58), 417}, + {uniname2ctype_offset(str59), 33}, + {-1}, + {uniname2ctype_offset(str61), 291}, + {uniname2ctype_offset(str62), 19}, + {-1}, + {-1}, + {uniname2ctype_offset(str65), 169}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str69), 505}, + {-1}, + {-1}, + {uniname2ctype_offset(str72), 245}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str77), 298}, + {uniname2ctype_offset(str78), 102}, + {-1}, + {-1}, + {uniname2ctype_offset(str81), 47}, + {uniname2ctype_offset(str82), 48}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str86), 14}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str93), 476}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str99), 55}, + {-1}, + {-1}, + {uniname2ctype_offset(str102), 23}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str106), 285}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str110), 506}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str114), 408}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str124), 311}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str132), 160}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str140), 441}, + {uniname2ctype_offset(str141), 44}, + {-1}, + {-1}, + {uniname2ctype_offset(str144), 296}, + {uniname2ctype_offset(str145), 446}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str152), 367}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str159), 522}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str164), 121}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str174), 418}, + {-1}, + {uniname2ctype_offset(str176), 240}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str185), 27}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str191), 184}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str199), 365}, + {uniname2ctype_offset(str200), 152}, + {uniname2ctype_offset(str201), 540}, + {uniname2ctype_offset(str202), 13}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str207), 448}, + {uniname2ctype_offset(str208), 373}, + {uniname2ctype_offset(str209), 335}, + {-1}, + {uniname2ctype_offset(str211), 25}, + {uniname2ctype_offset(str212), 309}, + {uniname2ctype_offset(str213), 537}, + {uniname2ctype_offset(str214), 530}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str220), 359}, + {-1}, + {uniname2ctype_offset(str222), 462}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str237), 153}, + {-1}, + {uniname2ctype_offset(str239), 79}, + {-1}, + {-1}, + {uniname2ctype_offset(str242), 161}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str247), 93}, + {uniname2ctype_offset(str248), 79}, + {uniname2ctype_offset(str249), 314}, + {-1}, + {uniname2ctype_offset(str251), 322}, + {uniname2ctype_offset(str252), 449}, + {-1}, + {-1}, + {uniname2ctype_offset(str255), 149}, + {uniname2ctype_offset(str256), 504}, + {-1}, + {uniname2ctype_offset(str258), 208}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str268), 149}, + {-1}, + {uniname2ctype_offset(str270), 171}, + {-1}, + {-1}, + {uniname2ctype_offset(str273), 289}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str278), 156}, + {uniname2ctype_offset(str279), 76}, + {-1}, + {uniname2ctype_offset(str281), 76}, + {uniname2ctype_offset(str282), 112}, + {-1}, + {uniname2ctype_offset(str284), 306}, + {uniname2ctype_offset(str285), 89}, + {uniname2ctype_offset(str286), 491}, + {-1}, + {uniname2ctype_offset(str288), 156}, + {-1}, + {uniname2ctype_offset(str290), 81}, + {uniname2ctype_offset(str291), 294}, + {-1}, + {-1}, + {uniname2ctype_offset(str294), 488}, + {uniname2ctype_offset(str295), 173}, + {uniname2ctype_offset(str296), 443}, + {-1}, + {-1}, + {uniname2ctype_offset(str299), 319}, + {-1}, + {-1}, + {uniname2ctype_offset(str302), 331}, + {uniname2ctype_offset(str303), 121}, + {-1}, + {uniname2ctype_offset(str305), 500}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str309), 420}, + {uniname2ctype_offset(str310), 482}, + {-1}, + {-1}, + {uniname2ctype_offset(str313), 283}, + {uniname2ctype_offset(str314), 458}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str327), 375}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str331), 125}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str337), 422}, + {-1}, + {uniname2ctype_offset(str339), 24}, + {uniname2ctype_offset(str340), 110}, + {uniname2ctype_offset(str341), 37}, + {uniname2ctype_offset(str342), 218}, + {-1}, + {uniname2ctype_offset(str344), 110}, + {-1}, + {-1}, + {uniname2ctype_offset(str347), 515}, + {uniname2ctype_offset(str348), 115}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str355), 29}, + {-1}, + {uniname2ctype_offset(str357), 53}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str361), 487}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str366), 151}, + {-1}, + {uniname2ctype_offset(str368), 40}, + {-1}, + {-1}, + {uniname2ctype_offset(str371), 93}, + {-1}, + {-1}, + {uniname2ctype_offset(str374), 186}, + {uniname2ctype_offset(str375), 210}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str382), 358}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str386), 317}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str390), 310}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str394), 170}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str400), 124}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str419), 384}, + {-1}, + {uniname2ctype_offset(str421), 184}, + {uniname2ctype_offset(str422), 171}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str435), 94}, + {-1}, + {-1}, + {uniname2ctype_offset(str438), 56}, + {-1}, + {uniname2ctype_offset(str440), 538}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str444), 83}, + {-1}, + {-1}, + {uniname2ctype_offset(str447), 100}, + {uniname2ctype_offset(str448), 202}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str452), 361}, + {uniname2ctype_offset(str453), 240}, + {-1}, + {uniname2ctype_offset(str455), 89}, + {uniname2ctype_offset(str456), 3}, + {-1}, + {uniname2ctype_offset(str458), 152}, + {-1}, + {uniname2ctype_offset(str460), 83}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str468), 218}, + {-1}, + {-1}, + {uniname2ctype_offset(str471), 489}, + {uniname2ctype_offset(str472), 494}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str477), 209}, + {uniname2ctype_offset(str478), 348}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str485), 66}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str489), 237}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str503), 360}, + {uniname2ctype_offset(str504), 507}, + {-1}, + {-1}, + {uniname2ctype_offset(str507), 71}, + {uniname2ctype_offset(str508), 221}, + {uniname2ctype_offset(str509), 26}, + {-1}, + {uniname2ctype_offset(str511), 130}, + {uniname2ctype_offset(str512), 163}, + {uniname2ctype_offset(str513), 535}, + {-1}, + {-1}, + {uniname2ctype_offset(str516), 88}, + {uniname2ctype_offset(str517), 172}, + {-1}, + {uniname2ctype_offset(str519), 328}, + {-1}, + {-1}, + {uniname2ctype_offset(str522), 169}, + {uniname2ctype_offset(str523), 497}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str530), 224}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str534), 187}, + {uniname2ctype_offset(str535), 493}, + {-1}, + {uniname2ctype_offset(str537), 38}, + {uniname2ctype_offset(str538), 175}, + {uniname2ctype_offset(str539), 299}, +# ifndef USE_UNICODE_AGE_PROPERTIES + {-1}, + {-1}, + {-1}, + {-1}, +# else /* USE_UNICODE_AGE_PROPERTIES */ + {-1}, + {-1}, + {uniname2ctype_offset(str542), 246}, + {uniname2ctype_offset(str543), 248}, +# endif /* USE_UNICODE_AGE_PROPERTIES */ + {uniname2ctype_offset(str544), 68}, + {uniname2ctype_offset(str545), 297}, + {uniname2ctype_offset(str546), 197}, + {uniname2ctype_offset(str547), 356}, +# ifndef USE_UNICODE_AGE_PROPERTIES + {-1}, + {-1}, + {-1}, +# else /* USE_UNICODE_AGE_PROPERTIES */ + {uniname2ctype_offset(str548), 258}, + {uniname2ctype_offset(str549), 259}, + {uniname2ctype_offset(str550), 247}, +# endif /* USE_UNICODE_AGE_PROPERTIES */ + {uniname2ctype_offset(str551), 511}, +# ifndef USE_UNICODE_AGE_PROPERTIES + {-1}, + {-1}, +# else /* USE_UNICODE_AGE_PROPERTIES */ + {uniname2ctype_offset(str552), 250}, + {uniname2ctype_offset(str553), 251}, +# endif /* USE_UNICODE_AGE_PROPERTIES */ + {uniname2ctype_offset(str554), 29}, +# ifndef USE_UNICODE_AGE_PROPERTIES + {-1}, +# else /* USE_UNICODE_AGE_PROPERTIES */ + {uniname2ctype_offset(str555), 257}, +# endif /* USE_UNICODE_AGE_PROPERTIES */ + {uniname2ctype_offset(str556), 22}, + {uniname2ctype_offset(str557), 107}, +# ifndef USE_UNICODE_AGE_PROPERTIES + {-1}, + {-1}, +# else /* USE_UNICODE_AGE_PROPERTIES */ + {uniname2ctype_offset(str558), 260}, + {uniname2ctype_offset(str559), 249}, +# endif /* USE_UNICODE_AGE_PROPERTIES */ + {uniname2ctype_offset(str560), 350}, +# ifndef USE_UNICODE_AGE_PROPERTIES + {-1}, + {-1}, + {-1}, + {-1}, +# else /* USE_UNICODE_AGE_PROPERTIES */ + {uniname2ctype_offset(str561), 263}, + {uniname2ctype_offset(str562), 262}, + {uniname2ctype_offset(str563), 255}, + {uniname2ctype_offset(str564), 256}, +# endif /* USE_UNICODE_AGE_PROPERTIES */ + {uniname2ctype_offset(str565), 514}, +# ifndef USE_UNICODE_AGE_PROPERTIES + {-1}, + {-1}, +# else /* USE_UNICODE_AGE_PROPERTIES */ + {uniname2ctype_offset(str566), 253}, + {uniname2ctype_offset(str567), 261}, +# endif /* USE_UNICODE_AGE_PROPERTIES */ + {uniname2ctype_offset(str568), 332}, + {uniname2ctype_offset(str569), 75}, +# ifndef USE_UNICODE_AGE_PROPERTIES + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, +# else /* USE_UNICODE_AGE_PROPERTIES */ + {uniname2ctype_offset(str570), 254}, + {-1}, + {-1}, + {uniname2ctype_offset(str573), 252}, + {-1}, + {-1}, +# endif /* USE_UNICODE_AGE_PROPERTIES */ + {uniname2ctype_offset(str576), 51}, + {uniname2ctype_offset(str577), 386}, + {-1}, + {uniname2ctype_offset(str579), 338}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str584), 67}, + {uniname2ctype_offset(str585), 101}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str589), 208}, + {-1}, + {uniname2ctype_offset(str591), 533}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str595), 214}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str604), 211}, + {-1}, + {-1}, + {uniname2ctype_offset(str607), 117}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str613), 200}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str621), 321}, + {uniname2ctype_offset(str622), 164}, + {-1}, + {-1}, + {uniname2ctype_offset(str625), 185}, + {-1}, + {uniname2ctype_offset(str627), 341}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str633), 402}, + {uniname2ctype_offset(str634), 119}, + {-1}, + {uniname2ctype_offset(str636), 198}, + {uniname2ctype_offset(str637), 231}, + {-1}, + {uniname2ctype_offset(str639), 144}, + {uniname2ctype_offset(str640), 144}, + {uniname2ctype_offset(str641), 64}, + {uniname2ctype_offset(str642), 467}, + {-1}, + {-1}, + {uniname2ctype_offset(str645), 202}, + {uniname2ctype_offset(str646), 185}, + {-1}, + {-1}, + {uniname2ctype_offset(str649), 68}, + {-1}, + {-1}, + {uniname2ctype_offset(str652), 20}, + {-1}, + {-1}, + {uniname2ctype_offset(str655), 495}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str659), 394}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str663), 524}, + {uniname2ctype_offset(str664), 286}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str668), 456}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str677), 550}, + {uniname2ctype_offset(str678), 199}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str683), 457}, + {uniname2ctype_offset(str684), 469}, + {-1}, + {uniname2ctype_offset(str686), 501}, + {-1}, + {uniname2ctype_offset(str688), 526}, + {-1}, + {uniname2ctype_offset(str690), 206}, + {-1}, + {uniname2ctype_offset(str692), 516}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str697), 241}, + {uniname2ctype_offset(str698), 206}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str705), 28}, + {uniname2ctype_offset(str706), 225}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str712), 407}, + {uniname2ctype_offset(str713), 312}, + {-1}, + {-1}, + {uniname2ctype_offset(str716), 429}, + {uniname2ctype_offset(str717), 201}, + {-1}, + {uniname2ctype_offset(str719), 95}, + {uniname2ctype_offset(str720), 95}, + {uniname2ctype_offset(str721), 106}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str726), 181}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str733), 53}, + {uniname2ctype_offset(str734), 303}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str745), 24}, + {-1}, + {-1}, + {uniname2ctype_offset(str748), 378}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str755), 132}, + {-1}, + {-1}, + {uniname2ctype_offset(str758), 189}, + {uniname2ctype_offset(str759), 189}, + {-1}, + {uniname2ctype_offset(str761), 224}, + {-1}, + {-1}, + {uniname2ctype_offset(str764), 154}, + {-1}, + {uniname2ctype_offset(str766), 154}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str773), 106}, + {uniname2ctype_offset(str774), 509}, + {uniname2ctype_offset(str775), 234}, + {uniname2ctype_offset(str776), 228}, + {-1}, + {uniname2ctype_offset(str778), 61}, + {uniname2ctype_offset(str779), 188}, + {uniname2ctype_offset(str780), 485}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str785), 103}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str792), 239}, + {uniname2ctype_offset(str793), 65}, + {-1}, + {uniname2ctype_offset(str795), 62}, + {-1}, + {uniname2ctype_offset(str797), 223}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str803), 222}, + {uniname2ctype_offset(str804), 451}, + {uniname2ctype_offset(str805), 304}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str811), 459}, + {uniname2ctype_offset(str812), 238}, + {uniname2ctype_offset(str813), 124}, + {uniname2ctype_offset(str814), 36}, + {-1}, + {uniname2ctype_offset(str816), 153}, + {uniname2ctype_offset(str817), 419}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str828), 182}, + {uniname2ctype_offset(str829), 498}, + {uniname2ctype_offset(str830), 210}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str834), 99}, + {uniname2ctype_offset(str835), 527}, + {uniname2ctype_offset(str836), 532}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str847), 114}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str858), 221}, + {-1}, + {uniname2ctype_offset(str860), 212}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str865), 343}, + {uniname2ctype_offset(str866), 405}, + {uniname2ctype_offset(str867), 67}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str872), 288}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str876), 215}, + {-1}, + {uniname2ctype_offset(str878), 117}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str890), 196}, + {-1}, + {uniname2ctype_offset(str892), 480}, + {-1}, + {-1}, + {uniname2ctype_offset(str895), 364}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str900), 114}, + {-1}, + {-1}, + {uniname2ctype_offset(str903), 113}, + {-1}, + {uniname2ctype_offset(str905), 174}, + {uniname2ctype_offset(str906), 132}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str914), 438}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str919), 520}, + {-1}, + {-1}, + {uniname2ctype_offset(str922), 72}, + {-1}, + {uniname2ctype_offset(str924), 159}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str933), 232}, + {-1}, + {-1}, + {uniname2ctype_offset(str936), 219}, + {uniname2ctype_offset(str937), 102}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str941), 452}, + {-1}, + {uniname2ctype_offset(str943), 239}, + {-1}, + {uniname2ctype_offset(str945), 19}, + {-1}, + {uniname2ctype_offset(str947), 415}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str956), 228}, + {-1}, + {uniname2ctype_offset(str958), 434}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str964), 25}, + {uniname2ctype_offset(str965), 37}, + {uniname2ctype_offset(str966), 159}, + {-1}, + {uniname2ctype_offset(str968), 222}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str973), 205}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str991), 315}, + {uniname2ctype_offset(str992), 147}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str997), 36}, + {-1}, + {uniname2ctype_offset(str999), 20}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1004), 98}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1009), 539}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1013), 413}, + {-1}, + {uniname2ctype_offset(str1015), 474}, + {-1}, + {uniname2ctype_offset(str1017), 214}, + {-1}, + {uniname2ctype_offset(str1019), 70}, + {uniname2ctype_offset(str1020), 551}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1036), 236}, + {-1}, + {-1}, + {uniname2ctype_offset(str1039), 69}, + {-1}, + {-1}, + {uniname2ctype_offset(str1042), 196}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1047), 366}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1051), 115}, + {uniname2ctype_offset(str1052), 470}, + {uniname2ctype_offset(str1053), 536}, + {uniname2ctype_offset(str1054), 473}, + {uniname2ctype_offset(str1055), 496}, + {-1}, + {-1}, + {uniname2ctype_offset(str1058), 374}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1062), 349}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1067), 112}, + {uniname2ctype_offset(str1068), 107}, + {uniname2ctype_offset(str1069), 230}, + {-1}, + {-1}, + {uniname2ctype_offset(str1072), 60}, + {uniname2ctype_offset(str1073), 425}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1077), 174}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1093), 17}, + {-1}, + {uniname2ctype_offset(str1095), 238}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1102), 103}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1107), 323}, + {-1}, + {-1}, + {uniname2ctype_offset(str1110), 481}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1114), 18}, + {uniname2ctype_offset(str1115), 51}, + {uniname2ctype_offset(str1116), 226}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1121), 38}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1130), 73}, + {uniname2ctype_offset(str1131), 466}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1137), 503}, + {uniname2ctype_offset(str1138), 58}, + {uniname2ctype_offset(str1139), 158}, + {-1}, + {-1}, + {uniname2ctype_offset(str1142), 131}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1148), 414}, + {-1}, + {uniname2ctype_offset(str1150), 301}, + {-1}, + {-1}, + {uniname2ctype_offset(str1153), 460}, + {uniname2ctype_offset(str1154), 84}, + {uniname2ctype_offset(str1155), 181}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1159), 293}, + {-1}, + {-1}, + {uniname2ctype_offset(str1162), 226}, + {uniname2ctype_offset(str1163), 281}, + {-1}, + {uniname2ctype_offset(str1165), 84}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1170), 199}, + {-1}, + {-1}, + {uniname2ctype_offset(str1173), 355}, + {uniname2ctype_offset(str1174), 131}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1179), 113}, + {uniname2ctype_offset(str1180), 344}, + {-1}, + {-1}, + {uniname2ctype_offset(str1183), 134}, + {uniname2ctype_offset(str1184), 4}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1189), 11}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1197), 178}, + {-1}, + {-1}, + {uniname2ctype_offset(str1200), 69}, + {uniname2ctype_offset(str1201), 194}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1210), 191}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1223), 433}, + {uniname2ctype_offset(str1224), 237}, + {-1}, + {-1}, + {uniname2ctype_offset(str1227), 521}, + {-1}, + {uniname2ctype_offset(str1229), 191}, + {-1}, + {-1}, + {uniname2ctype_offset(str1232), 313}, + {uniname2ctype_offset(str1233), 219}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1239), 371}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1248), 435}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1253), 116}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1261), 416}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1265), 223}, + {uniname2ctype_offset(str1266), 380}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1272), 369}, + {uniname2ctype_offset(str1273), 342}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1278), 122}, + {-1}, + {-1}, + {uniname2ctype_offset(str1281), 406}, + {-1}, + {-1}, + {uniname2ctype_offset(str1284), 120}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1289), 28}, + {uniname2ctype_offset(str1290), 136}, + {-1}, + {uniname2ctype_offset(str1292), 96}, + {uniname2ctype_offset(str1293), 98}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1299), 70}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1303), 6}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1309), 96}, + {-1}, + {uniname2ctype_offset(str1311), 180}, + {-1}, + {uniname2ctype_offset(str1313), 337}, + {-1}, + {-1}, + {uniname2ctype_offset(str1316), 111}, + {-1}, + {-1}, + {uniname2ctype_offset(str1319), 85}, + {-1}, + {-1}, + {uniname2ctype_offset(str1322), 111}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1326), 428}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1331), 225}, + {uniname2ctype_offset(str1332), 190}, + {uniname2ctype_offset(str1333), 175}, + {-1}, + {uniname2ctype_offset(str1335), 127}, + {-1}, + {-1}, + {uniname2ctype_offset(str1338), 220}, + {-1}, + {-1}, + {uniname2ctype_offset(str1341), 136}, + {-1}, + {-1}, + {uniname2ctype_offset(str1344), 81}, + {-1}, + {uniname2ctype_offset(str1346), 44}, + {-1}, + {uniname2ctype_offset(str1348), 168}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1355), 180}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1360), 542}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1368), 316}, + {-1}, + {uniname2ctype_offset(str1370), 5}, + {uniname2ctype_offset(str1371), 162}, + {-1}, + {uniname2ctype_offset(str1373), 244}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1378), 40}, + {uniname2ctype_offset(str1379), 421}, + {uniname2ctype_offset(str1380), 461}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1388), 42}, + {-1}, + {uniname2ctype_offset(str1390), 141}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1396), 447}, + {-1}, + {uniname2ctype_offset(str1398), 523}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1410), 27}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1416), 12}, + {-1}, + {uniname2ctype_offset(str1418), 46}, + {uniname2ctype_offset(str1419), 66}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1425), 26}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1429), 445}, + {uniname2ctype_offset(str1430), 145}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1439), 220}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1444), 9}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1452), 483}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1472), 363}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1481), 376}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1493), 92}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1502), 203}, + {uniname2ctype_offset(str1503), 148}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1508), 122}, + {uniname2ctype_offset(str1509), 64}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1513), 147}, + {-1}, + {-1}, + {uniname2ctype_offset(str1516), 148}, + {uniname2ctype_offset(str1517), 512}, + {uniname2ctype_offset(str1518), 157}, + {-1}, + {-1}, + {uniname2ctype_offset(str1521), 436}, + {-1}, + {-1}, + {uniname2ctype_offset(str1524), 92}, + {-1}, + {uniname2ctype_offset(str1526), 242}, + {-1}, + {-1}, + {uniname2ctype_offset(str1529), 192}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1536), 116}, + {uniname2ctype_offset(str1537), 195}, + {uniname2ctype_offset(str1538), 97}, + {-1}, + {uniname2ctype_offset(str1540), 450}, + {-1}, + {uniname2ctype_offset(str1542), 354}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1549), 1}, + {-1}, + {uniname2ctype_offset(str1551), 340}, + {-1}, + {uniname2ctype_offset(str1553), 465}, + {uniname2ctype_offset(str1554), 142}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1561), 104}, + {-1}, + {uniname2ctype_offset(str1563), 454}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1567), 97}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1572), 145}, + {uniname2ctype_offset(str1573), 203}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1579), 130}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1584), 82}, + {-1}, + {uniname2ctype_offset(str1586), 194}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1591), 90}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1597), 211}, + {uniname2ctype_offset(str1598), 410}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1602), 305}, + {-1}, + {uniname2ctype_offset(str1604), 72}, + {-1}, + {-1}, + {uniname2ctype_offset(str1607), 161}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1613), 302}, + {uniname2ctype_offset(str1614), 241}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1619), 82}, + {-1}, + {-1}, + {uniname2ctype_offset(str1622), 531}, + {-1}, + {uniname2ctype_offset(str1624), 85}, + {uniname2ctype_offset(str1625), 464}, + {uniname2ctype_offset(str1626), 133}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1630), 400}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1637), 50}, + {uniname2ctype_offset(str1638), 334}, + {-1}, + {-1}, + {uniname2ctype_offset(str1641), 125}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1645), 230}, + {uniname2ctype_offset(str1646), 213}, + {uniname2ctype_offset(str1647), 468}, + {-1}, + {-1}, + {uniname2ctype_offset(str1650), 163}, + {-1}, + {-1}, + {uniname2ctype_offset(str1653), 168}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1657), 137}, + {-1}, + {uniname2ctype_offset(str1659), 229}, + {-1}, + {-1}, + {uniname2ctype_offset(str1662), 525}, + {-1}, + {-1}, + {uniname2ctype_offset(str1665), 80}, + {uniname2ctype_offset(str1666), 126}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1673), 129}, + {-1}, + {-1}, + {uniname2ctype_offset(str1676), 411}, + {uniname2ctype_offset(str1677), 397}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1681), 290}, + {-1}, + {uniname2ctype_offset(str1683), 300}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1688), 541}, + {-1}, + {-1}, + {uniname2ctype_offset(str1691), 205}, + {uniname2ctype_offset(str1692), 444}, + {-1}, + {uniname2ctype_offset(str1694), 22}, + {-1}, + {uniname2ctype_offset(str1696), 477}, + {uniname2ctype_offset(str1697), 127}, + {uniname2ctype_offset(str1698), 478}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1702), 423}, + {uniname2ctype_offset(str1703), 119}, + {-1}, + {-1}, + {uniname2ctype_offset(str1706), 442}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1713), 78}, + {uniname2ctype_offset(str1714), 326}, + {uniname2ctype_offset(str1715), 320}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1719), 129}, + {-1}, + {-1}, + {uniname2ctype_offset(str1722), 308}, + {uniname2ctype_offset(str1723), 198}, + {uniname2ctype_offset(str1724), 108}, + {-1}, + {-1}, + {uniname2ctype_offset(str1727), 65}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1733), 427}, + {uniname2ctype_offset(str1734), 104}, + {-1}, + {-1}, + {uniname2ctype_offset(str1737), 170}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1741), 282}, + {-1}, + {uniname2ctype_offset(str1743), 7}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1752), 486}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1767), 242}, + {uniname2ctype_offset(str1768), 35}, + {-1}, + {-1}, + {uniname2ctype_offset(str1771), 187}, + {-1}, + {-1}, + {uniname2ctype_offset(str1774), 55}, + {uniname2ctype_offset(str1775), 62}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1786), 133}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1790), 160}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1794), 318}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1804), 88}, + {uniname2ctype_offset(str1805), 432}, + {uniname2ctype_offset(str1806), 484}, + {-1}, + {-1}, + {uniname2ctype_offset(str1809), 437}, + {-1}, + {uniname2ctype_offset(str1811), 176}, + {-1}, + {-1}, + {uniname2ctype_offset(str1814), 431}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1826), 387}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1835), 164}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1843), 141}, + {-1}, + {uniname2ctype_offset(str1845), 357}, + {-1}, + {-1}, + {uniname2ctype_offset(str1848), 42}, + {-1}, + {uniname2ctype_offset(str1850), 392}, + {uniname2ctype_offset(str1851), 52}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1856), 43}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1860), 424}, + {-1}, + {uniname2ctype_offset(str1862), 379}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1866), 21}, + {-1}, + {-1}, + {uniname2ctype_offset(str1869), 479}, + {uniname2ctype_offset(str1870), 409}, + {-1}, + {uniname2ctype_offset(str1872), 45}, + {uniname2ctype_offset(str1873), 234}, + {-1}, + {-1}, + {uniname2ctype_offset(str1876), 549}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1883), 146}, + {uniname2ctype_offset(str1884), 142}, + {-1}, + {uniname2ctype_offset(str1886), 212}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1893), 236}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1904), 73}, + {uniname2ctype_offset(str1905), 324}, + {uniname2ctype_offset(str1906), 78}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1910), 287}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1920), 353}, + {uniname2ctype_offset(str1921), 172}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1931), 31}, + {uniname2ctype_offset(str1932), 123}, + {uniname2ctype_offset(str1933), 177}, + {-1}, + {uniname2ctype_offset(str1935), 325}, + {-1}, + {uniname2ctype_offset(str1937), 518}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1941), 138}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1945), 472}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1951), 327}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1964), 47}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1968), 43}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1972), 347}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1980), 150}, + {uniname2ctype_offset(str1981), 99}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1985), 352}, + {-1}, + {uniname2ctype_offset(str1987), 517}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str1993), 150}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2004), 229}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2015), 499}, + {uniname2ctype_offset(str2016), 176}, + {-1}, + {uniname2ctype_offset(str2018), 519}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2026), 123}, + {uniname2ctype_offset(str2027), 430}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2046), 166}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2051), 333}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2068), 213}, + {-1}, + {uniname2ctype_offset(str2070), 100}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2083), 292}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2111), 178}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2115), 166}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2119), 455}, + {-1}, + {-1}, + {uniname2ctype_offset(str2122), 204}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2126), 134}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2136), 453}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2153), 143}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2157), 138}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2164), 143}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2169), 139}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2180), 329}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2184), 513}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2193), 440}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2200), 243}, + {-1}, + {-1}, + {uniname2ctype_offset(str2203), 345}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2208), 91}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2219), 31}, + {uniname2ctype_offset(str2220), 173}, + {uniname2ctype_offset(str2221), 529}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2230), 201}, + {uniname2ctype_offset(str2231), 140}, + {uniname2ctype_offset(str2232), 140}, + {-1}, + {-1}, + {uniname2ctype_offset(str2235), 426}, + {-1}, + {uniname2ctype_offset(str2237), 91}, + {-1}, + {-1}, + {uniname2ctype_offset(str2240), 105}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2246), 135}, + {-1}, + {uniname2ctype_offset(str2248), 227}, + {uniname2ctype_offset(str2249), 204}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2254), 280}, + {-1}, + {uniname2ctype_offset(str2256), 490}, + {-1}, + {-1}, + {uniname2ctype_offset(str2259), 276}, + {-1}, + {-1}, + {uniname2ctype_offset(str2262), 45}, + {-1}, + {-1}, + {uniname2ctype_offset(str2265), 346}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2273), 33}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2285), 393}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2292), 87}, + {uniname2ctype_offset(str2293), 383}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2310), 439}, + {-1}, + {-1}, + {uniname2ctype_offset(str2313), 87}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2322), 273}, + {-1}, + {uniname2ctype_offset(str2324), 275}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2332), 41}, + {uniname2ctype_offset(str2333), 137}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2341), 233}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2346), 80}, + {-1}, + {-1}, + {uniname2ctype_offset(str2349), 135}, + {uniname2ctype_offset(str2350), 23}, + {-1}, + {-1}, + {uniname2ctype_offset(str2353), 403}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2360), 101}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2373), 49}, + {-1}, + {uniname2ctype_offset(str2375), 336}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2399), 271}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2405), 267}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2410), 235}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2418), 377}, + {uniname2ctype_offset(str2419), 231}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2425), 158}, + {-1}, + {uniname2ctype_offset(str2427), 404}, + {-1}, + {-1}, + {uniname2ctype_offset(str2430), 77}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2445), 265}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2451), 471}, + {uniname2ctype_offset(str2452), 277}, + {-1}, + {-1}, + {uniname2ctype_offset(str2455), 105}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2460), 269}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2476), 528}, + {uniname2ctype_offset(str2477), 165}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2487), 284}, + {-1}, + {uniname2ctype_offset(str2489), 233}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2500), 165}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2511), 278}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2518), 177}, + {-1}, + {uniname2ctype_offset(str2520), 279}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2530), 190}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2546), 266}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2565), 183}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2589), 330}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2602), 295}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2629), 16}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2661), 57}, + {-1}, + {uniname2ctype_offset(str2663), 71}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2673), 39}, + {uniname2ctype_offset(str2674), 193}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2691), 54}, + {uniname2ctype_offset(str2692), 510}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2698), 8}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2732), 268}, + {uniname2ctype_offset(str2733), 264}, + {-1}, + {uniname2ctype_offset(str2735), 399}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2755), 243}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2773), 30}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2787), 120}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2808), 390}, + {-1}, + {uniname2ctype_offset(str2810), 351}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2822), 401}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2827), 15}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2844), 48}, + {uniname2ctype_offset(str2845), 272}, + {uniname2ctype_offset(str2846), 274}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2876), 307}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2897), 372}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2902), 167}, + {uniname2ctype_offset(str2903), 128}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2907), 63}, + {-1}, + {-1}, + {uniname2ctype_offset(str2910), 339}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2928), 534}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2932), 182}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2954), 128}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2974), 109}, + {-1}, + {-1}, + {uniname2ctype_offset(str2977), 554}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2985), 388}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str2997), 216}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3030), 412}, + {-1}, + {uniname2ctype_offset(str3032), 126}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3057), 368}, + {-1}, + {uniname2ctype_offset(str3059), 63}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3064), 543}, + {-1}, + {-1}, + {uniname2ctype_offset(str3067), 139}, + {-1}, + {-1}, + {uniname2ctype_offset(str3070), 395}, + {-1}, + {uniname2ctype_offset(str3072), 192}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3081), 463}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3096), 362}, + {-1}, + {uniname2ctype_offset(str3098), 32}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3159), 207}, + {-1}, + {uniname2ctype_offset(str3161), 385}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3165), 155}, + {-1}, + {uniname2ctype_offset(str3167), 195}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3181), 207}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3197), 235}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3224), 118}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3231), 508}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3252), 109}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3295), 41}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3307), 179}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3314), 86}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3338), 34}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3346), 244}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3363), 227}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3388), 90}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3413), 217}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3428), 49}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3500), 155}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3511), 492}, + {-1}, + {-1}, + {uniname2ctype_offset(str3514), 146}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3525), 108}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3550), 389}, + {-1}, + {uniname2ctype_offset(str3552), 382}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3595), 217}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3617), 162}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3704), 245}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3722), 118}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3776), 197}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3828), 396}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3835), 546}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3840), 548}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3845), 398}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3931), 54}, + {-1}, + {uniname2ctype_offset(str3933), 270}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3939), 75}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3965), 193}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3974), 502}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str3989), 183}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str4043), 39}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str4124), 77}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str4136), 381}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str4144), 370}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str4188), 552}, + {-1}, + {uniname2ctype_offset(str4190), 544}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str4214), 391}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str4241), 59}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str4270), 74}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str4312), 547}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str4373), 46}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str4406), 10}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str4466), 74}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str4528), 30}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str4596), 167}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str4673), 2}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, +#endif /* USE_UNICODE_PROPERTIES */ + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, +#ifndef USE_UNICODE_PROPERTIES + {uniname2ctype_offset(str6), 12}, + {uniname2ctype_offset(str7), 7}, + {uniname2ctype_offset(str8), 15}, + {uniname2ctype_offset(str9), 1}, + {uniname2ctype_offset(str10), 13}, + {uniname2ctype_offset(str11), 11}, + {uniname2ctype_offset(str12), 10}, + {uniname2ctype_offset(str13), 14}, + {uniname2ctype_offset(str14), 3}, + {uniname2ctype_offset(str15), 9}, + {uniname2ctype_offset(str16), 8}, + {uniname2ctype_offset(str17), 6}, + {uniname2ctype_offset(str18), 5}, + {uniname2ctype_offset(str19), 4}, + {uniname2ctype_offset(str20), 2} +#else /* USE_UNICODE_PROPERTIES */ + {uniname2ctype_offset(str4716), 179}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str4915), 545}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str5015), 86}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {-1}, + {uniname2ctype_offset(str5275), 553} +#endif /* USE_UNICODE_PROPERTIES */ + }; + + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = uniname2ctype_hash(str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register int o = wordlist[key].name; + if (o >= 0) + { + register const char *s = o + uniname2ctype_pool; + + if (*str == *s && !strncmp(str + 1, s + 1, len - 1) && s[len] == '\0') + return &wordlist[key]; + } + } + } + return 0; +} + +static int uniname2ctype(const UChar *name, unsigned int len) +{ + const struct uniname2ctype_struct *p + = uniname2ctype_p((const char *)name, len); + if (p) + return p->ctype; + return -1; +} +#if defined ONIG_UNICODE_VERSION_STRING \ + && !(ONIG_UNICODE_VERSION_MAJOR == 9 && ONIG_UNICODE_VERSION_MINOR == 0 \ + && ONIG_UNICODE_VERSION_TEENY == 0 && 1) +# error ONIG_UNICODE_VERSION_STRING mismatch +#endif +#define ONIG_UNICODE_VERSION_STRING "9.0.0" +#define ONIG_UNICODE_VERSION_MAJOR 9 +#define ONIG_UNICODE_VERSION_MINOR 0 +#define ONIG_UNICODE_VERSION_TEENY 0 diff --git a/lib/edbee-lib/vendor/onig/enc/us_ascii.c b/lib/edbee-lib/vendor/onig/enc/us_ascii.c new file mode 100644 index 00000000..7c1d84ea --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/us_ascii.c @@ -0,0 +1,41 @@ +#include "regenc.h" +#ifdef RUBY +# include "encindex.h" +#endif + +#ifndef ENCINDEX_US_ASCII +# define ENCINDEX_US_ASCII 0 +#endif + +static int us_ascii_mbc_enc_len(const UChar *p, const UChar *e, + OnigEncoding enc) +{ + if (*p & 0x80) + return ONIGENC_CONSTRUCT_MBCLEN_INVALID(); + return ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(1); +} + +OnigEncodingDefine(us_ascii, US_ASCII) = { + us_ascii_mbc_enc_len, + "US-ASCII", /* name */ + 1, /* max byte length */ + 1, /* min byte length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + onigenc_ascii_mbc_case_fold, + onigenc_ascii_apply_all_case_fold, + onigenc_ascii_get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + onigenc_ascii_is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + onigenc_single_byte_ascii_only_case_map, + ENCINDEX_US_ASCII, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("ASCII", "US-ASCII") +ENC_ALIAS("ANSI_X3.4-1968", "US-ASCII") +ENC_ALIAS("646", "US-ASCII") diff --git a/lib/edbee-lib/vendor/onig/enc/utf_16be.c b/lib/edbee-lib/vendor/onig/enc/utf_16be.c new file mode 100644 index 00000000..4eb1f9dc --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/utf_16be.c @@ -0,0 +1,263 @@ +/********************************************************************** + utf_16be.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" +#include "iso_8859.h" + +#if 0 +static const int EncLen_UTF16[] = { + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 +}; +#endif + +static int utf16be_mbc_enc_len(const UChar *p, const OnigUChar *e ARG_UNUSED, + OnigEncoding enc ARG_UNUSED) +{ + int byte = p[0]; + if (!UTF16_IS_SURROGATE(byte)) + { + if (2 <= e - p) + return ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(2); + else + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(1); + } + if (UTF16_IS_SURROGATE_FIRST(byte)) + { + switch (e - p) + { + case 1: + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(3); + case 2: + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(2); + case 3: + if (UTF16_IS_SURROGATE_SECOND(p[2])) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(1); + break; + default: + if (UTF16_IS_SURROGATE_SECOND(p[2])) + return ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(4); + break; + } + } + return ONIGENC_CONSTRUCT_MBCLEN_INVALID(); +} + +static int utf16be_is_mbc_newline(const UChar *p, const UChar *end, + OnigEncoding enc) +{ + if (p + 1 < end) + { + if (*(p + 1) == 0x0a && *p == 0x00) + return 1; +#ifdef USE_UNICODE_ALL_LINE_TERMINATORS + if ((*(p + 1) == 0x0b || *(p + 1) == 0x0c || *(p + 1) == 0x0d + || *(p + 1) == 0x85) + && *p == 0x00) + return 1; + if (*p == 0x20 && (*(p + 1) == 0x29 || *(p + 1) == 0x28)) + return 1; +#endif + } + return 0; +} + +static OnigCodePoint utf16be_mbc_to_code(const UChar *p, + const UChar *end ARG_UNUSED, + OnigEncoding enc) +{ + OnigCodePoint code; + + if (UTF16_IS_SURROGATE_FIRST(*p)) + { + code = ((((p[0] << 8) + p[1]) & 0x03ff) << 10) + + (((p[2] << 8) + p[3]) & 0x03ff) + 0x10000; + } + else + { + code = p[0] * 256 + p[1]; + } + return code; +} + +static int utf16be_code_to_mbclen(OnigCodePoint code, OnigEncoding enc) +{ + return (code > 0xffff ? 4 : 2); +} + +static int utf16be_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc) +{ + UChar *p = buf; + + if (code > 0xffff) + { + unsigned int high = (code >> 10) + 0xD7C0; + unsigned int low = (code & 0x3FF) + 0xDC00; + *p++ = (high >> 8) & 0xFF; + *p++ = high & 0xFF; + *p++ = (low >> 8) & 0xFF; + *p++ = low & 0xFF; + return 4; + } + else + { + *p++ = (UChar)((code & 0xff00) >> 8); + *p++ = (UChar)(code & 0xff); + return 2; + } +} + +static int utf16be_mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end, UChar *fold, + OnigEncoding enc) +{ + const UChar *p = *pp; + + if (ONIGENC_IS_ASCII_CODE(*(p + 1)) && *p == 0) + { + p++; +#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI + if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) + { + if (*p == 0x49) + { + *fold++ = 0x01; + *fold = 0x31; + (*pp) += 2; + return 2; + } + } +#endif + + *fold++ = 0; + *fold = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p); + *pp += 2; + return 2; + } + else + return onigenc_unicode_mbc_case_fold(enc, flag, pp, end, fold); +} + +#if 0 +static int +utf16be_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end) +{ + const UChar* p = *pp; + + (*pp) += EncLen_UTF16[*p]; + + if (*p == 0) { + int c, v; + + p++; + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) { + return TRUE; + } + + c = *p; + v = ONIGENC_IS_UNICODE_ISO_8859_1_BIT_CTYPE(c, + (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + + if ((v | BIT_CTYPE_LOWER) != 0) { + /* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */ + if (c >= 0xaa && c <= 0xba) + return FALSE; + else + return TRUE; + } + return (v != 0 ? TRUE : FALSE); + } + + return FALSE; +} +#endif + +static UChar *utf16be_left_adjust_char_head(const UChar *start, const UChar *s, + const UChar *end, + OnigEncoding enc ARG_UNUSED) +{ + if (s <= start) + return (UChar *)s; + + if ((s - start) % 2 == 1) + { + s--; + } + + if (UTF16_IS_SURROGATE_SECOND(*s) && s > start + 1) + s -= 2; + + return (UChar *)s; +} + +static int utf16be_get_case_fold_codes_by_str(OnigCaseFoldType flag, + const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc) +{ + return onigenc_unicode_get_case_fold_codes_by_str(enc, flag, p, end, items); +} + +OnigEncodingDefine(utf_16be, UTF_16BE) = { + utf16be_mbc_enc_len, + "UTF-16BE", /* name */ + 4, /* max byte length */ + 2, /* min byte length */ + utf16be_is_mbc_newline, + utf16be_mbc_to_code, + utf16be_code_to_mbclen, + utf16be_code_to_mbc, + utf16be_mbc_case_fold, + onigenc_unicode_apply_all_case_fold, + utf16be_get_case_fold_codes_by_str, + onigenc_unicode_property_name_to_ctype, + onigenc_unicode_is_code_ctype, + onigenc_utf16_32_get_ctype_code_range, + utf16be_left_adjust_char_head, + onigenc_always_false_is_allowed_reverse_match, + onigenc_unicode_case_map, + 0, + ONIGENC_FLAG_UNICODE, +}; +ENC_ALIAS("UCS-2BE", "UTF-16BE") diff --git a/lib/edbee-lib/vendor/onig/enc/utf_16le.c b/lib/edbee-lib/vendor/onig/enc/utf_16le.c new file mode 100644 index 00000000..c595e47f --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/utf_16le.c @@ -0,0 +1,253 @@ +/********************************************************************** + utf_16le.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" +#include "iso_8859.h" + +#if 0 +static const int EncLen_UTF16[] = { + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 +}; +#endif + +static int utf16le_mbc_enc_len(const UChar *p, const OnigUChar *e, + OnigEncoding enc ARG_UNUSED) +{ + int len = (int)(e - p); + UChar byte; + if (len < 2) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(1); + byte = p[1]; + if (!UTF16_IS_SURROGATE(byte)) + { + return ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(2); + } + if (UTF16_IS_SURROGATE_FIRST(byte)) + { + if (len < 4) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(4 - len); + if (UTF16_IS_SURROGATE_SECOND(p[3])) + return ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(4); + } + return ONIGENC_CONSTRUCT_MBCLEN_INVALID(); +} + +static int utf16le_is_mbc_newline(const UChar *p, const UChar *end, + OnigEncoding enc ARG_UNUSED) +{ + if (p + 1 < end) + { + if (*p == 0x0a && *(p + 1) == 0x00) + return 1; +#ifdef USE_UNICODE_ALL_LINE_TERMINATORS + if ((*p == 0x0b || *p == 0x0c || *p == 0x0d || *p == 0x85) + && *(p + 1) == 0x00) + return 1; + if (*(p + 1) == 0x20 && (*p == 0x29 || *p == 0x28)) + return 1; +#endif + } + return 0; +} + +static OnigCodePoint utf16le_mbc_to_code(const UChar *p, + const UChar *end ARG_UNUSED, + OnigEncoding enc ARG_UNUSED) +{ + OnigCodePoint code; + UChar c0 = *p; + UChar c1 = *(p + 1); + + if (UTF16_IS_SURROGATE_FIRST(c1)) + { + code = ((((c1 << 8) + c0) & 0x03ff) << 10) + (((p[3] << 8) + p[2]) & 0x03ff) + + 0x10000; + } + else + { + code = c1 * 256 + p[0]; + } + return code; +} + +static int utf16le_code_to_mbclen(OnigCodePoint code, + OnigEncoding enc ARG_UNUSED) +{ + return (code > 0xffff ? 4 : 2); +} + +static int utf16le_code_to_mbc(OnigCodePoint code, UChar *buf, + OnigEncoding enc ARG_UNUSED) +{ + UChar *p = buf; + + if (code > 0xffff) + { + unsigned int high = (code >> 10) + 0xD7C0; + unsigned int low = (code & 0x3FF) + 0xDC00; + *p++ = high & 0xFF; + *p++ = (high >> 8) & 0xFF; + *p++ = low & 0xFF; + *p++ = (low >> 8) & 0xFF; + return 4; + } + else + { + *p++ = (UChar)(code & 0xff); + *p++ = (UChar)((code & 0xff00) >> 8); + return 2; + } +} + +static int utf16le_mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end, UChar *fold, + OnigEncoding enc) +{ + const UChar *p = *pp; + + if (ONIGENC_IS_ASCII_CODE(*p) && *(p + 1) == 0) + { +#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI + if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) + { + if (*p == 0x49) + { + *fold++ = 0x31; + *fold = 0x01; + (*pp) += 2; + return 2; + } + } +#endif + + *fold++ = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p); + *fold = 0; + *pp += 2; + return 2; + } + else + return onigenc_unicode_mbc_case_fold(enc, flag, pp, end, fold); +} + +#if 0 +static int +utf16le_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, + const UChar* end) +{ + const UChar* p = *pp; + + (*pp) += EncLen_UTF16[*(p+1)]; + + if (*(p+1) == 0) { + int c, v; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) { + return TRUE; + } + + c = *p; + v = ONIGENC_IS_UNICODE_ISO_8859_1_BIT_CTYPE(c, + (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + if ((v | BIT_CTYPE_LOWER) != 0) { + /* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */ + if (c >= 0xaa && c <= 0xba) + return FALSE; + else + return TRUE; + } + return (v != 0 ? TRUE : FALSE); + } + + return FALSE; +} +#endif + +static UChar *utf16le_left_adjust_char_head(const UChar *start, const UChar *s, + const UChar *end, + OnigEncoding enc ARG_UNUSED) +{ + if (s <= start) + return (UChar *)s; + + if ((s - start) % 2 == 1) + { + s--; + } + + if (UTF16_IS_SURROGATE_SECOND(*(s + 1)) && s > start + 1) + s -= 2; + + return (UChar *)s; +} + +static int utf16le_get_case_fold_codes_by_str(OnigCaseFoldType flag, + const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc) +{ + return onigenc_unicode_get_case_fold_codes_by_str(enc, flag, p, end, items); +} + +OnigEncodingDefine(utf_16le, UTF_16LE) = { + utf16le_mbc_enc_len, + "UTF-16LE", /* name */ + 4, /* max byte length */ + 2, /* min byte length */ + utf16le_is_mbc_newline, + utf16le_mbc_to_code, + utf16le_code_to_mbclen, + utf16le_code_to_mbc, + utf16le_mbc_case_fold, + onigenc_unicode_apply_all_case_fold, + utf16le_get_case_fold_codes_by_str, + onigenc_unicode_property_name_to_ctype, + onigenc_unicode_is_code_ctype, + onigenc_utf16_32_get_ctype_code_range, + utf16le_left_adjust_char_head, + onigenc_always_false_is_allowed_reverse_match, + onigenc_unicode_case_map, + 0, + ONIGENC_FLAG_UNICODE, +}; diff --git a/lib/edbee-lib/vendor/onig/enc/utf_32be.c b/lib/edbee-lib/vendor/onig/enc/utf_32be.c new file mode 100644 index 00000000..742a9967 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/utf_32be.c @@ -0,0 +1,210 @@ +/********************************************************************** + utf_32be.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" +#include "iso_8859.h" + +static OnigCodePoint utf32be_mbc_to_code(const UChar *p, const UChar *end, + OnigEncoding enc); +static int utf32be_mbc_enc_len(const UChar *p ARG_UNUSED, const OnigUChar *e, + OnigEncoding enc) +{ + if (e < p) + { + return ONIGENC_CONSTRUCT_MBCLEN_INVALID(); + } + else if (e - p < 4) + { + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(4 - (int)(e - p)); + } + else + { + OnigCodePoint c = utf32be_mbc_to_code(p, e, enc); + if (!UNICODE_VALID_CODEPOINT_P(c)) + return ONIGENC_CONSTRUCT_MBCLEN_INVALID(); + return ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(4); + } +} + +static int utf32be_is_mbc_newline(const UChar *p, const UChar *end, + OnigEncoding enc ARG_UNUSED) +{ + if (p + 3 < end) + { + if (*(p + 3) == 0x0a && *(p + 2) == 0 && *(p + 1) == 0 && *p == 0) + return 1; +#ifdef USE_UNICODE_ALL_LINE_TERMINATORS + if ((*(p + 3) == 0x0b || *(p + 3) == 0x0c || *(p + 3) == 0x0d + || *(p + 3) == 0x85) + && *(p + 2) == 0 && *(p + 1) == 0 && *p == 0x00) + return 1; + if (*(p + 2) == 0x20 && (*(p + 3) == 0x29 || *(p + 3) == 0x28) + && *(p + 1) == 0 && *p == 0) + return 1; +#endif + } + return 0; +} + +static OnigCodePoint utf32be_mbc_to_code(const UChar *p, + const UChar *end ARG_UNUSED, + OnigEncoding enc ARG_UNUSED) +{ + return (OnigCodePoint)(((p[0] * 256 + p[1]) * 256 + p[2]) * 256 + p[3]); +} + +static int utf32be_code_to_mbclen(OnigCodePoint code ARG_UNUSED, + OnigEncoding enc ARG_UNUSED) +{ + return 4; +} + +static int utf32be_code_to_mbc(OnigCodePoint code, UChar *buf, + OnigEncoding enc ARG_UNUSED) +{ + UChar *p = buf; + + *p++ = (UChar)((code & 0xff000000) >> 24); + *p++ = (UChar)((code & 0xff0000) >> 16); + *p++ = (UChar)((code & 0xff00) >> 8); + *p++ = (UChar)(code & 0xff); + return 4; +} + +static int utf32be_mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end, UChar *fold, + OnigEncoding enc) +{ + const UChar *p = *pp; + + if (ONIGENC_IS_ASCII_CODE(*(p + 3)) && *(p + 2) == 0 && *(p + 1) == 0 + && *p == 0) + { + *fold++ = 0; + *fold++ = 0; + +#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI + if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) + { + if (*(p + 3) == 0x49) + { + *fold++ = 0x01; + *fold = 0x31; + (*pp) += 4; + return 4; + } + } +#endif + + *fold++ = 0; + *fold = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*(p + 3)); + *pp += 4; + return 4; + } + else + return onigenc_unicode_mbc_case_fold(enc, flag, pp, end, fold); +} + +#if 0 +static int +utf32be_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end) +{ + const UChar* p = *pp; + + (*pp) += 4; + + if (*(p+2) == 0 && *(p+1) == 0 && *p == 0) { + int c, v; + + p += 3; + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) { + return TRUE; + } + + c = *p; + v = ONIGENC_IS_UNICODE_ISO_8859_1_BIT_CTYPE(c, + (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + if ((v | BIT_CTYPE_LOWER) != 0) { + /* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */ + if (c >= 0xaa && c <= 0xba) + return FALSE; + else + return TRUE; + } + return (v != 0 ? TRUE : FALSE); + } + + return FALSE; +} +#endif + +static UChar *utf32be_left_adjust_char_head(const UChar *start, const UChar *s, + const UChar *end, + OnigEncoding enc ARG_UNUSED) +{ + ptrdiff_t rem; + + if (s <= start) + return (UChar *)s; + + rem = (int)((s - start) % 4); + return (UChar *)(s - rem); +} + +static int utf32be_get_case_fold_codes_by_str(OnigCaseFoldType flag, + const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc) +{ + return onigenc_unicode_get_case_fold_codes_by_str(enc, flag, p, end, items); +} + +OnigEncodingDefine(utf_32be, UTF_32BE) = { + utf32be_mbc_enc_len, + "UTF-32BE", /* name */ + 4, /* max byte length */ + 4, /* min byte length */ + utf32be_is_mbc_newline, + utf32be_mbc_to_code, + utf32be_code_to_mbclen, + utf32be_code_to_mbc, + utf32be_mbc_case_fold, + onigenc_unicode_apply_all_case_fold, + utf32be_get_case_fold_codes_by_str, + onigenc_unicode_property_name_to_ctype, + onigenc_unicode_is_code_ctype, + onigenc_utf16_32_get_ctype_code_range, + utf32be_left_adjust_char_head, + onigenc_always_false_is_allowed_reverse_match, + onigenc_unicode_case_map, + 0, + ONIGENC_FLAG_UNICODE, +}; +ENC_ALIAS("UCS-4BE", "UTF-32BE") diff --git a/lib/edbee-lib/vendor/onig/enc/utf_32le.c b/lib/edbee-lib/vendor/onig/enc/utf_32le.c new file mode 100644 index 00000000..20e3023e --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/utf_32le.c @@ -0,0 +1,210 @@ +/********************************************************************** + utf_32le.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" +#include "iso_8859.h" + +static OnigCodePoint utf32le_mbc_to_code(const UChar *p, const UChar *end, + OnigEncoding enc); +static int utf32le_mbc_enc_len(const UChar *p ARG_UNUSED, const OnigUChar *e, + OnigEncoding enc) +{ + if (e < p) + { + return ONIGENC_CONSTRUCT_MBCLEN_INVALID(); + } + else if (e - p < 4) + { + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(4 - (int)(e - p)); + } + else + { + OnigCodePoint c = utf32le_mbc_to_code(p, e, enc); + if (!UNICODE_VALID_CODEPOINT_P(c)) + return ONIGENC_CONSTRUCT_MBCLEN_INVALID(); + return ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(4); + } +} + +static int utf32le_is_mbc_newline(const UChar *p, const UChar *end, + OnigEncoding enc ARG_UNUSED) +{ + if (p + 3 < end) + { + if (*p == 0x0a && *(p + 1) == 0 && *(p + 2) == 0 && *(p + 3) == 0) + return 1; +#ifdef USE_UNICODE_ALL_LINE_TERMINATORS + if ((*p == 0x0b || *p == 0x0c || *p == 0x0d || *p == 0x85) + && *(p + 1) == 0x00 && (p + 2) == 0x00 && *(p + 3) == 0x00) + return 1; + if (*(p + 1) == 0x20 && (*p == 0x29 || *p == 0x28) && *(p + 2) == 0x00 + && *(p + 3) == 0x00) + return 1; +#endif + } + return 0; +} + +static OnigCodePoint utf32le_mbc_to_code(const UChar *p, + const UChar *end ARG_UNUSED, + OnigEncoding enc ARG_UNUSED) +{ + return (OnigCodePoint)(((p[3] * 256 + p[2]) * 256 + p[1]) * 256 + p[0]); +} + +static int utf32le_code_to_mbclen(OnigCodePoint code ARG_UNUSED, + OnigEncoding enc ARG_UNUSED) +{ + return 4; +} + +static int utf32le_code_to_mbc(OnigCodePoint code, UChar *buf, + OnigEncoding enc ARG_UNUSED) +{ + UChar *p = buf; + + *p++ = (UChar)(code & 0xff); + *p++ = (UChar)((code & 0xff00) >> 8); + *p++ = (UChar)((code & 0xff0000) >> 16); + *p++ = (UChar)((code & 0xff000000) >> 24); + return 4; +} + +static int utf32le_mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end, UChar *fold, + OnigEncoding enc) +{ + const UChar *p = *pp; + + if (ONIGENC_IS_ASCII_CODE(*p) && *(p + 1) == 0 && *(p + 2) == 0 + && *(p + 3) == 0) + { +#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI + if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) + { + if (*p == 0x49) + { + *fold++ = 0x31; + *fold++ = 0x01; + } + } + else + { +#endif + *fold++ = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p); + *fold++ = 0; +#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI + } +#endif + + *fold++ = 0; + *fold = 0; + *pp += 4; + return 4; + } + else + return onigenc_unicode_mbc_case_fold(enc, flag, pp, end, fold); +} + +#if 0 +static int +utf32le_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end) +{ + const UChar* p = *pp; + + (*pp) += 4; + + if (*(p+1) == 0 && *(p+2) == 0 && *(p+3) == 0) { + int c, v; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) { + return TRUE; + } + + c = *p; + v = ONIGENC_IS_UNICODE_ISO_8859_1_BIT_CTYPE(c, + (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + if ((v | BIT_CTYPE_LOWER) != 0) { + /* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */ + if (c >= 0xaa && c <= 0xba) + return FALSE; + else + return TRUE; + } + return (v != 0 ? TRUE : FALSE); + } + + return FALSE; +} +#endif + +static UChar *utf32le_left_adjust_char_head(const UChar *start, const UChar *s, + const UChar *end, + OnigEncoding enc ARG_UNUSED) +{ + ptrdiff_t rem; + + if (s <= start) + return (UChar *)s; + + rem = (int)((s - start) % 4); + return (UChar *)(s - rem); +} + +static int utf32le_get_case_fold_codes_by_str(OnigCaseFoldType flag, + const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc) +{ + return onigenc_unicode_get_case_fold_codes_by_str(enc, flag, p, end, items); +} + +OnigEncodingDefine(utf_32le, UTF_32LE) = { + utf32le_mbc_enc_len, + "UTF-32LE", /* name */ + 4, /* max byte length */ + 4, /* min byte length */ + utf32le_is_mbc_newline, + utf32le_mbc_to_code, + utf32le_code_to_mbclen, + utf32le_code_to_mbc, + utf32le_mbc_case_fold, + onigenc_unicode_apply_all_case_fold, + utf32le_get_case_fold_codes_by_str, + onigenc_unicode_property_name_to_ctype, + onigenc_unicode_is_code_ctype, + onigenc_utf16_32_get_ctype_code_range, + utf32le_left_adjust_char_head, + onigenc_always_false_is_allowed_reverse_match, + onigenc_unicode_case_map, + 0, + ONIGENC_FLAG_UNICODE, +}; +ENC_ALIAS("UCS-4LE", "UTF-32LE") diff --git a/lib/edbee-lib/vendor/onig/enc/utf_8.c b/lib/edbee-lib/vendor/onig/enc/utf_8.c new file mode 100644 index 00000000..4d5a8d9c --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/utf_8.c @@ -0,0 +1,474 @@ +/********************************************************************** + utf_8.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" +#ifdef RUBY +# include "encindex.h" +#endif + +#ifndef ENCINDEX_UTF_8 +# define ENCINDEX_UTF_8 0 +#endif + +#define USE_INVALID_CODE_SCHEME + +#ifdef USE_INVALID_CODE_SCHEME +/* virtual codepoint values for invalid encoding byte 0xfe and 0xff */ +# define INVALID_CODE_FE 0xfffffffe +# define INVALID_CODE_FF 0xffffffff +#endif +#define VALID_CODE_LIMIT 0x0010ffff + +#define utf8_islead(c) ((UChar)((c) & 0xc0) != 0x80) + +static const int EncLen_UTF8[] + = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; + +typedef enum +{ + FAILURE = -2, + ACCEPT, + S0, + S1, + S2, + S3, + S4, + S5, + S6, + S7 +} state_t; +#define A ACCEPT +#define F FAILURE +static const signed char trans[][0x100] = { + {/* S0 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 1 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 2 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 3 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* b */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* c */ F, F, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* e */ 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, + /* f */ 5, 6, 6, 6, 7, F, F, F, F, F, F, F, F, F, F, F}, + {/* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* 9 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* a */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* b */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, + /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F}, + {/* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F}, + {/* S3 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 9 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* a */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F}, + {/* S4 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* 9 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + /* a */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* b */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F}, + {/* S5 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 9 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* a */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* b */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F}, + {/* S6 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* 9 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* a */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* b */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F}, + {/* S7 0 1 2 3 4 5 6 7 8 9 a b c d e f */ + /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* 8 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* a */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* b */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, + /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F}, +}; +#undef A +#undef F + +static int mbc_enc_len(const UChar *p, const UChar *e, + OnigEncoding enc ARG_UNUSED) +{ + int firstbyte = *p++; + state_t s; + s = trans[0][firstbyte]; + if (s < 0) + return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(1) + : ONIGENC_CONSTRUCT_MBCLEN_INVALID(); + + if (p == e) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_UTF8[firstbyte] - 1); + s = trans[s][*p++]; + if (s < 0) + return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(2) + : ONIGENC_CONSTRUCT_MBCLEN_INVALID(); + + if (p == e) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_UTF8[firstbyte] - 2); + s = trans[s][*p++]; + if (s < 0) + return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(3) + : ONIGENC_CONSTRUCT_MBCLEN_INVALID(); + + if (p == e) + return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_UTF8[firstbyte] - 3); + s = trans[s][*p++]; + return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(4) + : ONIGENC_CONSTRUCT_MBCLEN_INVALID(); +} + +static int is_mbc_newline(const UChar *p, const UChar *end, OnigEncoding enc) +{ + if (p < end) + { + if (*p == 0x0a) + return 1; + +#ifdef USE_UNICODE_ALL_LINE_TERMINATORS + if (*p == 0x0b || *p == 0x0c || *p == 0x0d) + return 1; + if (p + 1 < end) + { + if (*(p + 1) == 0x85 && *p == 0xc2) /* U+0085 */ + return 1; + if (p + 2 < end) + { + if ((*(p + 2) == 0xa8 || *(p + 2) == 0xa9) && *(p + 1) == 0x80 + && *p == 0xe2) /* U+2028, U+2029 */ + return 1; + } + } +#endif + } + + return 0; +} + +static OnigCodePoint mbc_to_code(const UChar *p, const UChar *end, + OnigEncoding enc) +{ + int c, len; + OnigCodePoint n; + + len = mbc_enc_len(p, end, enc); + c = *p++; + if (len > 1) + { + len--; + n = c & ((1 << (6 - len)) - 1); + while (len--) + { + c = *p++; + n = (n << 6) | (c & ((1 << 6) - 1)); + } + return n; + } + else + { +#ifdef USE_INVALID_CODE_SCHEME + if (c > 0xfd) + { + return ((c == 0xfe) ? INVALID_CODE_FE : INVALID_CODE_FF); + } +#endif + return (OnigCodePoint)c; + } +} + +static int code_to_mbclen(OnigCodePoint code, OnigEncoding enc ARG_UNUSED) +{ + if ((code & 0xffffff80) == 0) + return 1; + else if ((code & 0xfffff800) == 0) + return 2; + else if ((code & 0xffff0000) == 0) + return 3; + else if (code <= VALID_CODE_LIMIT) + return 4; +#ifdef USE_INVALID_CODE_SCHEME + else if (code == INVALID_CODE_FE) + return 1; + else if (code == INVALID_CODE_FF) + return 1; +#endif + else + return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE; +} + +static int code_to_mbc(OnigCodePoint code, UChar *buf, + OnigEncoding enc ARG_UNUSED) +{ +#define UTF8_TRAILS(code, shift) (UChar)((((code) >> (shift)) & 0x3f) | 0x80) +#define UTF8_TRAIL0(code) (UChar)(((code) & 0x3f) | 0x80) + + if ((code & 0xffffff80) == 0) + { + *buf = (UChar)code; + return 1; + } + else + { + UChar *p = buf; + + if ((code & 0xfffff800) == 0) + { + *p++ = (UChar)(((code >> 6) & 0x1f) | 0xc0); + } + else if ((code & 0xffff0000) == 0) + { + *p++ = (UChar)(((code >> 12) & 0x0f) | 0xe0); + *p++ = UTF8_TRAILS(code, 6); + } + else if (code <= VALID_CODE_LIMIT) + { + *p++ = (UChar)(((code >> 18) & 0x07) | 0xf0); + *p++ = UTF8_TRAILS(code, 12); + *p++ = UTF8_TRAILS(code, 6); + } +#ifdef USE_INVALID_CODE_SCHEME + else if (code == INVALID_CODE_FE) + { + *p = 0xfe; + return 1; + } + else if (code == INVALID_CODE_FF) + { + *p = 0xff; + return 1; + } +#endif + else + { + return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE; + } + + *p++ = UTF8_TRAIL0(code); + return (int)(p - buf); + } +} + +static int mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end, UChar *fold, OnigEncoding enc) +{ + const UChar *p = *pp; + + if (ONIGENC_IS_MBC_ASCII(p)) + { +#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI + if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) + { + if (*p == 0x49) + { + *fold++ = 0xc4; + *fold = 0xb1; + (*pp)++; + return 2; + } + } +#endif + + *fold = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p); + (*pp)++; + return 1; /* return byte length of converted char to lower */ + } + else + { + return onigenc_unicode_mbc_case_fold(enc, flag, pp, end, fold); + } +} + +static int get_ctype_code_range(OnigCtype ctype, OnigCodePoint *sb_out, + const OnigCodePoint *ranges[], + OnigEncoding enc ARG_UNUSED) +{ + *sb_out = 0x80; + return onigenc_unicode_ctype_code_range(ctype, ranges); +} + +static UChar *left_adjust_char_head(const UChar *start, const UChar *s, + const UChar *end, + OnigEncoding enc ARG_UNUSED) +{ + const UChar *p; + + if (s <= start) + return (UChar *)s; + p = s; + + while (!utf8_islead(*p) && p > start) + p--; + return (UChar *)p; +} + +static int get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc) +{ + return onigenc_unicode_get_case_fold_codes_by_str(enc, flag, p, end, items); +} + +OnigEncodingDefine(utf_8, UTF_8) = { + mbc_enc_len, + "UTF-8", /* name */ + 6, /* max byte length */ + 1, /* min byte length */ + is_mbc_newline, + mbc_to_code, + code_to_mbclen, + code_to_mbc, + mbc_case_fold, + onigenc_unicode_apply_all_case_fold, + get_case_fold_codes_by_str, + onigenc_unicode_property_name_to_ctype, + onigenc_unicode_is_code_ctype, + get_ctype_code_range, + left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + onigenc_unicode_case_map, + ENCINDEX_UTF_8, + ONIGENC_FLAG_UNICODE, +}; +ENC_ALIAS("CP65001", "UTF-8") + +/* + * Name: UTF8-MAC + * Link: + * http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/BPFileSystem.html + * Link: http://developer.apple.com/qa/qa2001/qa1235.html + * Link: http://developer.apple.com/jp/qa/qa2001/qa1235.html + * Link: http://www.gnu.org/software/emacs/NEWS.23.2 + */ +ENC_REPLICATE("UTF8-MAC", "UTF-8") +ENC_ALIAS("UTF-8-MAC", "UTF8-MAC") +ENC_ALIAS("UTF-8-HFS", "UTF8-MAC") /* Emacs 23.2 */ diff --git a/lib/edbee-lib/vendor/onig/enc/windows_1250.c b/lib/edbee-lib/vendor/onig/enc/windows_1250.c new file mode 100644 index 00000000..b6fd8060 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/windows_1250.c @@ -0,0 +1,246 @@ +/********************************************************************** + windows_1250.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2006-2007 Byte <byte AT mail DOT kna DOT ru> + * K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" +#include "iso_8859.h" + +#define ENC_CP1250_TO_LOWER_CASE(c) EncCP1250_ToLowerCaseTable[c] +#define ENC_IS_CP1250_CTYPE(code, ctype) \ + ((EncCP1250_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const UChar EncCP1250_ToLowerCaseTable[256] = { + '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\232', '\213', '\234', '\235', '\236', '\237', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\241', + '\242', '\263', '\244', '\271', '\246', '\247', '\250', '\251', '\272', + '\253', '\254', '\255', '\256', '\277', '\260', '\261', '\262', '\263', + '\264', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\276', + '\275', '\276', '\277', '\340', '\341', '\342', '\343', '\344', '\345', + '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', + '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', + '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', '\340', + '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', + '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', + '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', + '\374', '\375', '\376', '\377', +}; + +static const unsigned short EncCP1250_CtypeTable[256] = { + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x00a0, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, /* 8 */ + 0x0008, 0x0008, 0x34a2, 0x0008, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x0000, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, /* 9 */ + 0x0008, 0x0008, 0x30e2, 0x0008, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x0284, + 0x01a0, 0x00a0, 0x34a2, 0x00a0, 0x34a2, 0x00a0, 0x00a0, /* A */ + 0x00a0, 0x00a0, 0x34a2, 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x34a2, 0x00a0, + 0x00a0, 0x10a0, 0x30e2, 0x00a0, 0x30e2, 0x00a0, 0x01a0, /* B */ + 0x00a0, 0x30e2, 0x30e2, 0x01a0, 0x34a2, 0x10a0, 0x30e2, 0x30e2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, /* C */ + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0, /* D */ + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, /* E */ + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0, /* F */ + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0, +}; + +static int cp1250_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED, + const UChar **pp, const UChar *end ARG_UNUSED, + UChar *lower, OnigEncoding enc ARG_UNUSED) +{ + const UChar *p = *pp; + + *lower = ENC_CP1250_TO_LOWER_CASE(*p); + (*pp)++; + return 1; +} + +static int cp1250_is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_CP1250_CTYPE(code, ctype); + else + return FALSE; +} + +static const OnigPairCaseFoldCodes CaseFoldMap[] = { + {0x8a, 0x9a}, {0x8c, 0x9c}, {0x8d, 0x9d}, {0x8e, 0x9e}, {0x8f, 0x9f}, + + {0xa3, 0xb3}, {0xa5, 0xb9}, {0xaa, 0xba}, {0xaf, 0xbf}, + + {0xbc, 0xbe}, + + {0xc0, 0xe0}, {0xc1, 0xe1}, {0xc2, 0xe2}, {0xc3, 0xe3}, {0xc4, 0xe4}, + {0xc5, 0xe5}, {0xc6, 0xe6}, {0xc7, 0xe7}, {0xc8, 0xe8}, {0xc9, 0xe9}, + {0xca, 0xea}, {0xcb, 0xeb}, {0xcc, 0xec}, {0xcd, 0xed}, {0xce, 0xee}, + {0xcf, 0xef}, + + {0xd0, 0xf0}, {0xd1, 0xf1}, {0xd2, 0xf2}, {0xd3, 0xf3}, {0xd4, 0xf4}, + {0xd5, 0xf5}, {0xd6, 0xf6}, {0xd8, 0xf8}, {0xd9, 0xf9}, {0xda, 0xfa}, + {0xdb, 0xfb}, {0xdc, 0xfc}, {0xdd, 0xfd}, {0xde, 0xfe}, +}; + +static int cp1250_apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_apply_all_case_fold_with_map( + sizeof(CaseFoldMap) / sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1, flag, + f, arg); +} + +static int cp1250_get_case_fold_codes_by_str(OnigCaseFoldType flag, + const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_get_case_fold_codes_by_str_with_map( + sizeof(CaseFoldMap) / sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1, flag, + p, end, items); +} + +static int case_map(OnigCaseFoldType *flagP, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, OnigUChar *to_end, + const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp < end && to < to_end) + { + code = *(*pp)++; + if (code == SHARP_s) + { + if (flags & ONIGENC_CASE_UPCASE) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 'S'; + code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S'; + } + else if (flags & ONIGENC_CASE_FOLD) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 's'; + code = 's'; + } + } + else if ((EncCP1250_CtypeTable[code] & BIT_CTYPE_UPPER) + && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) + { + flags |= ONIGENC_CASE_MODIFIED; + code = ENC_CP1250_TO_LOWER_CASE(code); + } + else if (code == 0xB5) + ; + else if ((EncCP1250_CtypeTable[code] & BIT_CTYPE_LOWER) + && (flags & ONIGENC_CASE_UPCASE)) + { + flags |= ONIGENC_CASE_MODIFIED; + if (code == 0xB9) + code = 0xA5; + else if (code == 0xBE) + code = 0xBC; + else if (code >= 0x8A && code <= 0xBF && code != 0xB9) + code -= 0x10; + else + code -= 0x20; + } + *to++ = code; + if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase + for capitalize */ + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE); + } + *flagP = flags; + return (int)(to - to_start); +} + +OnigEncodingDefine(windows_1250, Windows_1250) = { + onigenc_single_byte_mbc_enc_len, + "Windows-1250", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + cp1250_mbc_case_fold, + cp1250_apply_all_case_fold, + cp1250_get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + cp1250_is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + case_map, + 0, + ONIGENC_FLAG_NONE, +}; +/* + * Name: windows-1250 + * MIBenum: 2251 + * Link: http://www.iana.org/assignments/character-sets + * Link: http://www.microsoft.com/globaldev/reference/sbcs/1250.mspx + * Link: http://en.wikipedia.org/wiki/Windows-1250 + */ +ENC_ALIAS("CP1250", "Windows-1250") diff --git a/lib/edbee-lib/vendor/onig/enc/windows_1251.c b/lib/edbee-lib/vendor/onig/enc/windows_1251.c new file mode 100644 index 00000000..51c4b77d --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/windows_1251.c @@ -0,0 +1,224 @@ +/********************************************************************** + windows_1251.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2006-2007 Byte <byte AT mail DOT kna DOT ru> + * K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" + +#define ENC_CP1251_TO_LOWER_CASE(c) EncCP1251_ToLowerCaseTable[c] +#define ENC_IS_CP1251_CTYPE(code, ctype) \ + ((EncCP1251_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const UChar EncCP1251_ToLowerCaseTable[256] + = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\220', '\203', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\232', '\213', '\234', '\235', '\236', '\237', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\242', + '\242', '\274', '\244', '\264', '\246', '\247', '\270', '\251', '\272', + '\253', '\254', '\255', '\256', '\277', '\260', '\261', '\263', '\263', + '\264', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\274', + '\276', '\276', '\277', '\340', '\341', '\342', '\343', '\344', '\345', + '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', + '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', + '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377', '\340', + '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', + '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', + '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', + '\374', '\375', '\376', '\377'}; + +static const unsigned short EncCP1251_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x428c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x34a2, 0x34a2, 0x01a0, 0x30e2, 0x01a0, 0x01a0, 0x01a0, + 0x01a0, 0x0000, 0x01a0, 0x34a2, 0x01a0, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x30e2, 0x01a0, 0x01a0, 0x01a0, 0x01a0, 0x01a0, 0x01a0, 0x01a0, 0x0008, + 0x0000, 0x30e2, 0x01a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x0280, 0x34a2, + 0x30e2, 0x34a2, 0x01a0, 0x34a2, 0x01a0, 0x01a0, 0x34a2, 0x01a0, 0x34a2, + 0x01a0, 0x01a0, 0x01a0, 0x01a0, 0x34a2, 0x01a0, 0x01a0, 0x34a2, 0x30e2, + 0x30e2, 0x31e2, 0x01a0, 0x01a0, 0x30e2, 0x0000, 0x30e2, 0x01a0, 0x30e2, + 0x34a2, 0x30e2, 0x30e2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2}; + +static int cp1251_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED, + const UChar **pp, const UChar *end ARG_UNUSED, + UChar *lower, OnigEncoding enc ARG_UNUSED) +{ + const UChar *p = *pp; + + *lower = ENC_CP1251_TO_LOWER_CASE(*p); + (*pp)++; + return 1; +} + +static int cp1251_is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_CP1251_CTYPE(code, ctype); + else + return FALSE; +} + +static const OnigPairCaseFoldCodes CaseFoldMap[] + = {{0xb8, 0xa8}, + + {0xe0, 0xc0}, {0xe1, 0xc1}, {0xe2, 0xc2}, {0xe3, 0xc3}, + {0xe4, 0xc4}, {0xe5, 0xc5}, {0xe6, 0xc6}, {0xe7, 0xc7}, + {0xe8, 0xc8}, {0xe9, 0xc9}, {0xea, 0xca}, {0xeb, 0xcb}, + {0xec, 0xcc}, {0xed, 0xcd}, {0xee, 0xce}, {0xef, 0xcf}, + + {0xf0, 0xd0}, {0xf1, 0xd1}, {0xf2, 0xd2}, {0xf3, 0xd3}, + {0xf4, 0xd4}, {0xf5, 0xd5}, {0xf6, 0xd6}, {0xf7, 0xd7}, + {0xf8, 0xd8}, {0xf9, 0xd9}, {0xfa, 0xda}, {0xfb, 0xdb}, + {0xfc, 0xdc}, {0xfd, 0xdd}, {0xfe, 0xde}, {0xff, 0xdf}}; + +static int cp1251_apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_apply_all_case_fold_with_map(numberof(CaseFoldMap), + CaseFoldMap, 0, flag, f, arg); +} + +static int cp1251_get_case_fold_codes_by_str(OnigCaseFoldType flag, + const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_get_case_fold_codes_by_str_with_map( + numberof(CaseFoldMap), CaseFoldMap, 0, flag, p, end, items); +} + +static int case_map(OnigCaseFoldType *flagP, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, OnigUChar *to_end, + const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp < end && to < to_end) + { + code = *(*pp)++; + if ((EncCP1251_CtypeTable[code] & BIT_CTYPE_UPPER) + && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) + { + flags |= ONIGENC_CASE_MODIFIED; + code = ENC_CP1251_TO_LOWER_CASE(code); + } + else if (code == 0xB5) + ; + else if ((EncCP1251_CtypeTable[code] & BIT_CTYPE_LOWER) + && (flags & ONIGENC_CASE_UPCASE)) + { + flags |= ONIGENC_CASE_MODIFIED; + if ((0x61 <= code && code <= 0x7A) || (0xE0 <= code && code <= 0xFF)) + code -= 0x20; + else if (code == 0xA2 || code == 0xB3 || code == 0xBE) + code -= 0x01; + else if (code == 0x83) + code = 0x81; + else if (code == 0xBC) + code = 0xA3; + else if (code == 0xB4) + code = 0xA5; + else + code -= 0x10; + } + *to++ = code; + if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase + for capitalize */ + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE); + } + *flagP = flags; + return (int)(to - to_start); +} + +OnigEncodingDefine(windows_1251, Windows_1251) = { + onigenc_single_byte_mbc_enc_len, + "Windows-1251", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + cp1251_mbc_case_fold, + cp1251_apply_all_case_fold, + cp1251_get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + cp1251_is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + case_map, + 0, + ONIGENC_FLAG_NONE, +}; +/* + * Name: windows-1251 + * MIBenum: 2251 + * Link: http://www.iana.org/assignments/character-sets + * Link: http://www.microsoft.com/globaldev/reference/sbcs/1251.mspx + * Link: http://en.wikipedia.org/wiki/Windows-1251 + */ +ENC_ALIAS("CP1251", "Windows-1251") diff --git a/lib/edbee-lib/vendor/onig/enc/windows_1252.c b/lib/edbee-lib/vendor/onig/enc/windows_1252.c new file mode 100644 index 00000000..f2e8d90b --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/windows_1252.c @@ -0,0 +1,237 @@ +/********************************************************************** + windows_1252.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2006-2007 Byte <byte AT mail DOT kna DOT ru> + * K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" +#include "iso_8859.h" + +#define ENC_CP1252_TO_LOWER_CASE(c) EncCP1252_ToLowerCaseTable[c] +#define ENC_IS_CP1252_CTYPE(code, ctype) \ + ((EncCP1252_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const UChar EncCP1252_ToLowerCaseTable[256] = { + '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\232', '\213', '\234', '\215', '\236', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\377', '\240', '\241', + '\242', '\243', '\244', '\245', '\246', '\247', '\250', '\251', '\252', + '\253', '\254', '\255', '\256', '\277', '\260', '\261', '\262', '\263', + '\264', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\274', + '\275', '\276', '\277', '\340', '\341', '\342', '\343', '\344', '\345', + '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', + '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', + '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', '\340', + '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', + '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', + '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', + '\374', '\375', '\376', '\377', +}; + +static const unsigned short EncCP1252_CtypeTable[256] = { + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x00a0, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x34a2, 0x0008, 0x34a2, 0x0000, 0x34a2, 0x0000, + 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x30e2, 0x0008, 0x30e2, 0x0000, 0x30e2, 0x34a2, 0x0284, 0x01a0, + 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x30e2, + 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x10a0, 0x10a0, + 0x00a0, 0x30e2, 0x00a0, 0x01a0, 0x00a0, 0x10a0, 0x30e2, 0x01a0, 0x10a0, + 0x10a0, 0x10a0, 0x01a0, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, +}; + +static int cp1252_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED, + const UChar **pp, const UChar *end ARG_UNUSED, + UChar *lower, OnigEncoding enc ARG_UNUSED) +{ + const UChar *p = *pp; + + *lower = ENC_CP1252_TO_LOWER_CASE(*p); + (*pp)++; + return 1; +} +static int cp1252_is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_CP1252_CTYPE(code, ctype); + else + return FALSE; +} + +static const OnigPairCaseFoldCodes CaseFoldMap[] = { + {0x8a, 0x9a}, {0x8c, 0x9c}, {0x8e, 0x9e}, {0x9f, 0xff}, + + {0xc0, 0xe0}, {0xc1, 0xe1}, {0xc2, 0xe2}, {0xc3, 0xe3}, {0xc4, 0xe4}, + {0xc5, 0xe5}, {0xc6, 0xe6}, {0xc7, 0xe7}, {0xc8, 0xe8}, {0xc9, 0xe9}, + {0xca, 0xea}, {0xcb, 0xeb}, {0xcc, 0xec}, {0xcd, 0xed}, {0xce, 0xee}, + {0xcf, 0xef}, + + {0xd0, 0xf0}, {0xd1, 0xf1}, {0xd2, 0xf2}, {0xd3, 0xf3}, {0xd4, 0xf4}, + {0xd5, 0xf5}, {0xd6, 0xf6}, {0xd8, 0xf8}, {0xd9, 0xf9}, {0xda, 0xfa}, + {0xdb, 0xfb}, {0xdc, 0xfc}, {0xdd, 0xfd}, {0xde, 0xfe}, +}; + +static int cp1252_apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_apply_all_case_fold_with_map( + sizeof(CaseFoldMap) / sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1, flag, + f, arg); +} + +static int cp1252_get_case_fold_codes_by_str(OnigCaseFoldType flag, + const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_get_case_fold_codes_by_str_with_map( + sizeof(CaseFoldMap) / sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1, flag, + p, end, items); +} + +static int case_map(OnigCaseFoldType *flagP, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, OnigUChar *to_end, + const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp < end && to < to_end) + { + code = *(*pp)++; + if (code == SHARP_s) + { + if (flags & ONIGENC_CASE_UPCASE) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 'S'; + code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S'; + } + else if (flags & ONIGENC_CASE_FOLD) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 's'; + code = 's'; + } + } + else if ((EncCP1252_CtypeTable[code] & BIT_CTYPE_UPPER) + && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) + { + flags |= ONIGENC_CASE_MODIFIED; + code = ENC_CP1252_TO_LOWER_CASE(code); + } + else if (code == 0x83 || code == 0xAA || code == 0xBA || code == 0xB5) + ; + else if ((EncCP1252_CtypeTable[code] & BIT_CTYPE_LOWER) + && (flags & ONIGENC_CASE_UPCASE)) + { + flags |= ONIGENC_CASE_MODIFIED; + if (code == 0x9A || code == 0x9C || code == 0x9E) + code -= 0x10; + else if (code == 0xFF) + code -= 0x60; + else + code -= 0x20; + } + *to++ = code; + if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase + for capitalize */ + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE); + } + *flagP = flags; + return (int)(to - to_start); +} + +OnigEncodingDefine(windows_1252, Windows_1252) = { + onigenc_single_byte_mbc_enc_len, + "Windows-1252", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + cp1252_mbc_case_fold, + cp1252_apply_all_case_fold, + cp1252_get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + cp1252_is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + case_map, + 0, + ONIGENC_FLAG_NONE, +}; +/* + * Name: windows-1252 + * MIBenum: 2251 + * Link: http://www.iana.org/assignments/character-sets + * Link: http://www.microsoft.com/globaldev/reference/sbcs/1252.mspx + * Link: http://en.wikipedia.org/wiki/Windows-1252 + */ +ENC_ALIAS("CP1252", "Windows-1252") diff --git a/lib/edbee-lib/vendor/onig/enc/windows_1253.c b/lib/edbee-lib/vendor/onig/enc/windows_1253.c new file mode 100644 index 00000000..4b8ff30a --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/windows_1253.c @@ -0,0 +1,267 @@ +/********************************************************************** + windows_1253.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Name: windows-1253 + * MIBenum: 2253 + * Link: http://www.iana.org/assignments/character-sets + * Link: http://www.microsoft.com/globaldev/reference/sbcs/1253.mspx + * Link: http://en.wikipedia.org/wiki/Windows-1253 + */ + +#include "regenc.h" + +#define ENC_CP1253_TO_LOWER_CASE(c) EncCP1253_ToLowerCaseTable[c] +#define ENC_IS_CP1253_CTYPE(code, ctype) \ + ((EncCP1253_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const UChar EncCP1253_ToLowerCaseTable[256] + = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\241', + '\334', '\243', '\244', '\245', '\246', '\247', '\250', '\251', '\252', + '\253', '\254', '\255', '\256', '\257', '\260', '\261', '\262', '\263', + '\264', '\354', '\334', '\267', '\335', '\336', '\337', '\273', '\374', + '\275', '\375', '\376', '\300', '\341', '\342', '\343', '\344', '\345', + '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', + '\357', '\360', '\361', '\322', '\363', '\364', '\365', '\366', '\367', + '\370', '\371', '\372', '\373', '\334', '\335', '\336', '\337', '\340', + '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', + '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', + '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', + '\374', '\375', '\376', '\377'}; + +static const unsigned short EncCP1253_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0284, 0x01a0, + 0x34a2, 0x00a0, 0x0000, 0x0000, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x0000, + 0x01a0, 0x00a0, 0x01a0, 0x0000, 0x01a0, 0x00a0, 0x00a0, 0x10a0, 0x10a0, + 0x00a0, 0x30e2, 0x34a2, 0x01a0, 0x34a2, 0x34a2, 0x34a2, 0x01a0, 0x34a2, + 0x10a0, 0x34a2, 0x34a2, 0x30e2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x0000, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x0000}; + +static int mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end ARG_UNUSED, UChar *lower, + OnigEncoding enc ARG_UNUSED) +{ + const UChar *p = *pp; + + *lower = ENC_CP1253_TO_LOWER_CASE(*p); + (*pp)++; + return 1; +} + +#if 0 +static int +is_mbc_ambiguous(OnigCaseFoldType flag, + const UChar** pp, const UChar* end) +{ + int v; + const UChar* p = *pp; + + (*pp)++; + v = (EncCP1253_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + if ((v | BIT_CTYPE_LOWER) != 0) { + if (*p == 0xc0 || *p == 0xe0) + return FALSE; + else + return TRUE; + } + + return (v != 0 ? TRUE : FALSE); +} +#endif + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_CP1253_CTYPE(code, ctype); + else + return FALSE; +} + +static const OnigPairCaseFoldCodes CaseFoldMap[] + = {{0xb6, 0xdc}, {0xb8, 0xdd}, {0xb9, 0xde}, {0xba, 0xdf}, {0xbc, 0xfc}, + {0xbe, 0xfd}, {0xbf, 0xfe}, + + {0xc1, 0xe1}, {0xc2, 0xe2}, {0xc3, 0xe3}, {0xc4, 0xe4}, {0xc5, 0xe5}, + {0xc6, 0xe6}, {0xc7, 0xe7}, {0xc8, 0xe8}, {0xc9, 0xe9}, {0xca, 0xea}, + {0xcb, 0xeb}, {0xcc, 0xec}, {0xcd, 0xed}, {0xce, 0xee}, {0xcf, 0xef}, + + {0xd0, 0xf0}, {0xd1, 0xf1}, {0xd2, 0xf2}, {0xd3, 0xf3}, {0xd4, 0xf4}, + {0xd5, 0xf5}, {0xd6, 0xf6}, {0xd7, 0xf7}, {0xd8, 0xf8}, {0xd9, 0xf9}, + {0xda, 0xfa}, {0xdb, 0xfb}}; + +static int apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_apply_all_case_fold_with_map(numberof(CaseFoldMap), + CaseFoldMap, 0, flag, f, arg); +} + +static int get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_get_case_fold_codes_by_str_with_map( + numberof(CaseFoldMap), CaseFoldMap, 0, flag, p, end, items); +} + +static int case_map(OnigCaseFoldType *flagP, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, OnigUChar *to_end, + const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp < end && to < to_end) + { + code = *(*pp)++; + if (code == 0xF2) + { + if (flags & ONIGENC_CASE_UPCASE) + { + flags |= ONIGENC_CASE_MODIFIED; + code = 0xD3; + } + else if (flags & ONIGENC_CASE_FOLD) + { + flags |= ONIGENC_CASE_MODIFIED; + code = 0xF3; + } + } + else if (code == 0xB5) + { + if (flags & ONIGENC_CASE_UPCASE) + { + flags |= ONIGENC_CASE_MODIFIED; + code = 0xCC; + } + else if (flags & ONIGENC_CASE_FOLD) + { + flags |= ONIGENC_CASE_MODIFIED; + code = 0xEC; + } + } + else if (code == 0xC0 || code == 0xE0 || code == 0xB6) + ; + else if ((EncCP1253_CtypeTable[code] & BIT_CTYPE_UPPER) + && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) + { + flags |= ONIGENC_CASE_MODIFIED; + code = ENC_CP1253_TO_LOWER_CASE(code); + } + else if ((EncCP1253_CtypeTable[code] & BIT_CTYPE_LOWER) + && (flags & ONIGENC_CASE_UPCASE)) + { + flags |= ONIGENC_CASE_MODIFIED; + if (code == 0xDC) + code = 0xA2; + else if (code >= 0xDD && code <= 0xDF) + code -= 0x25; + else if (code == 0xFC) + code = 0xBC; + else if (code == 0xFD || code == 0xFE) + code -= 0x3F; + else + code -= 0x20; + } + *to++ = code; + if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase + for capitalize */ + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE); + } + *flagP = flags; + return (int)(to - to_start); +} + +OnigEncodingDefine(windows_1253, Windows_1253) = { + onigenc_single_byte_mbc_enc_len, + "Windows-1253", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + mbc_case_fold, + apply_all_case_fold, + get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("CP1253", "Windows-1253") diff --git a/lib/edbee-lib/vendor/onig/enc/windows_1254.c b/lib/edbee-lib/vendor/onig/enc/windows_1254.c new file mode 100644 index 00000000..82c77984 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/windows_1254.c @@ -0,0 +1,273 @@ +/********************************************************************** + windows_1254.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Name: windows-1254 + * MIBenum: 2254 + * Link: http://www.iana.org/assignments/character-sets + * Link: http://www.microsoft.com/globaldev/reference/sbcs/1254.mspx + * Link: http://en.wikipedia.org/wiki/Windows-1254 + */ + +#include "regenc.h" +#include "iso_8859.h" + +#define ENC_CP1254_TO_LOWER_CASE(c) EncCP1254_ToLowerCaseTable[c] +#define ENC_IS_CP1254_CTYPE(code, ctype) \ + ((EncCP1254_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const UChar EncCP1254_ToLowerCaseTable[256] + = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\232', '\213', '\234', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\377', '\240', '\241', + '\242', '\243', '\244', '\245', '\246', '\247', '\250', '\251', '\252', + '\253', '\254', '\255', '\256', '\257', '\260', '\261', '\262', '\263', + '\264', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\274', + '\275', '\276', '\277', '\340', '\341', '\342', '\343', '\344', '\345', + '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', + '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327', + '\370', '\371', '\372', '\373', '\374', '\151', '\376', '\337', '\340', + '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', + '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', + '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', + '\374', '\375', '\376', '\377'}; + +static const unsigned short EncCP1254_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x34a2, 0x0008, 0x34a2, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x30e2, 0x0008, 0x30e2, 0x0008, 0x0008, 0x34a2, 0x0284, 0x01a0, + 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x30e2, + 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x10a0, 0x10a0, + 0x00a0, 0x30e2, 0x00a0, 0x01a0, 0x00a0, 0x10a0, 0x30e2, 0x01a0, 0x10a0, + 0x10a0, 0x10a0, 0x01a0, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2}; + +static int mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end ARG_UNUSED, UChar *lower, + OnigEncoding enc ARG_UNUSED) +{ + const UChar *p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) + { + *lower++ = 's'; + *lower = 's'; + (*pp)++; + return 2; + } + + *lower = ENC_CP1254_TO_LOWER_CASE(*p); + (*pp)++; + return 1; +} + +#if 0 +static int +is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end) +{ + int v; + const UChar* p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) { + (*pp)++; + return TRUE; + } + + (*pp)++; + v = (EncCP1254_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + if ((v | BIT_CTYPE_LOWER) != 0) { + /* 0xdf etc.. are lower case letter, but can't convert. */ + if (*p >= 0xaa && *p <= 0xba) + return FALSE; + else + return TRUE; + } + + return (v != 0 ? TRUE : FALSE); +} +#endif + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_CP1254_CTYPE(code, ctype); + else + return FALSE; +} + +static const OnigPairCaseFoldCodes CaseFoldMap[] + = {{0xc0, 0xe0}, {0xc1, 0xe1}, {0xc2, 0xe2}, {0xc3, 0xe3}, {0xc4, 0xe4}, + {0xc5, 0xe5}, {0xc6, 0xe6}, {0xc7, 0xe7}, {0xc8, 0xe8}, {0xc9, 0xe9}, + {0xca, 0xea}, {0xcb, 0xeb}, {0xcc, 0xec}, {0xcd, 0xed}, {0xce, 0xee}, + {0xcf, 0xef}, + + {0xd0, 0xf0}, {0xd1, 0xf1}, {0xd2, 0xf2}, {0xd3, 0xf3}, {0xd4, 0xf4}, + {0xd5, 0xf5}, {0xd6, 0xf6}, {0xd8, 0xf8}, {0xd9, 0xf9}, {0xda, 0xfa}, + {0xdb, 0xfb}, {0xdc, 0xfc}, {0xdd, 0xfd}, {0xde, 0xfe}}; + +static int apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_apply_all_case_fold_with_map(numberof(CaseFoldMap), + CaseFoldMap, 1, flag, f, arg); +} + +static int get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_get_case_fold_codes_by_str_with_map( + numberof(CaseFoldMap), CaseFoldMap, 1, flag, p, end, items); +} + +#define DOTLESS_i (0xFD) +#define I_WITH_DOT_ABOVE (0xDD) +static int case_map(OnigCaseFoldType *flagP, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, OnigUChar *to_end, + const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp < end && to < to_end) + { + code = *(*pp)++; + if (code == SHARP_s) + { + if (flags & ONIGENC_CASE_UPCASE) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 'S'; + code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S'; + } + else if (flags & ONIGENC_CASE_FOLD) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 's'; + code = 's'; + } + } + else if ((EncCP1254_CtypeTable[code] & BIT_CTYPE_UPPER) + && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) + { + flags |= ONIGENC_CASE_MODIFIED; + if (code == 'I') + code = flags & ONIGENC_CASE_FOLD_TURKISH_AZERI ? DOTLESS_i : 'i'; + else + code = ENC_CP1254_TO_LOWER_CASE(code); + } + else if (code == 0x83 || code == 0xAA || code == 0xBA || code == 0xB5) + ; + else if ((EncCP1254_CtypeTable[code] & BIT_CTYPE_LOWER) + && (flags & ONIGENC_CASE_UPCASE)) + { + flags |= ONIGENC_CASE_MODIFIED; + if (code == 'i') + code = flags & ONIGENC_CASE_FOLD_TURKISH_AZERI ? I_WITH_DOT_ABOVE : 'I'; + else if (code == DOTLESS_i) + code = 'I'; + else if (code == 0x9A || code == 0x9C || code == 0x9E) + code -= 0x10; + else if (code == 0xFF) + code -= 0x60; + else + code -= 0x20; + } + *to++ = code; + if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase + for capitalize */ + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE); + } + *flagP = flags; + return (int)(to - to_start); +} + +OnigEncodingDefine(windows_1254, Windows_1254) = { + onigenc_single_byte_mbc_enc_len, + "Windows-1254", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + mbc_case_fold, + apply_all_case_fold, + get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("CP1254", "Windows-1254") diff --git a/lib/edbee-lib/vendor/onig/enc/windows_1257.c b/lib/edbee-lib/vendor/onig/enc/windows_1257.c new file mode 100644 index 00000000..8a2b13b6 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/windows_1257.c @@ -0,0 +1,273 @@ +/********************************************************************** + windows_1257.c - Oniguruma (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regenc.h" +#include "iso_8859.h" + +/* + * Name: windows-1257 + * MIBenum: 2257 + * Link: http://www.iana.org/assignments/character-sets + * Link: http://www.microsoft.com/globaldev/reference/sbcs/1257.mspx + * Link: http://en.wikipedia.org/wiki/Windows-1257 + */ + +#define ENC_CP1252_TO_LOWER_CASE(c) EncCP1252_ToLowerCaseTable[c] +#define ENC_IS_CP1252_CTYPE(code, ctype) \ + ((EncCP1252_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) + +static const UChar EncCP1252_ToLowerCaseTable[256] + = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\241', + '\242', '\243', '\244', '\245', '\246', '\247', '\270', '\251', '\272', + '\253', '\254', '\255', '\256', '\277', '\260', '\261', '\262', '\263', + '\264', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\274', + '\275', '\276', '\277', '\340', '\341', '\342', '\343', '\344', '\345', + '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', + '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327', + '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', '\340', + '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', + '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', + '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', + '\374', '\375', '\376', '\377'}; + +static const unsigned short EncCP1252_CtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0284, 0x01a0, + 0x00a0, 0x00a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0, 0x34a2, 0x00a0, 0x34a2, + 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x34a2, 0x00a0, 0x00a0, 0x10a0, 0x10a0, + 0x01a0, 0x30e2, 0x00a0, 0x01a0, 0x30e2, 0x10a0, 0x30e2, 0x01a0, 0x10a0, + 0x10a0, 0x10a0, 0x30e2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0, + 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, + 0x30e2, 0x30e2, 0x30e2, 0x01a0}; + +static int mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, + const UChar *end ARG_UNUSED, UChar *lower, + OnigEncoding enc ARG_UNUSED) +{ + const UChar *p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) + { + *lower++ = 's'; + *lower = 's'; + (*pp)++; + return 2; + } + + *lower = ENC_CP1252_TO_LOWER_CASE(*p); + (*pp)++; + return 1; +} + +#if 0 +static int +is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end) +{ + int v; + const UChar* p = *pp; + + if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) { + (*pp)++; + return TRUE; + } + + (*pp)++; + v = (EncCP1252_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + if ((v | BIT_CTYPE_LOWER) != 0) { + /* 0xdf, 0xb5 are lower case letter, but can't convert. */ + if (*p == 0xb5) + return FALSE; + else + return TRUE; + } + + return (v != 0 ? TRUE : FALSE); +} +#endif + +static int is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 256) + return ENC_IS_CP1252_CTYPE(code, ctype); + else + return FALSE; +} + +static const OnigPairCaseFoldCodes CaseFoldMap[] + = {{0xa8, 0xb8}, {0xaa, 0xba}, {0xaf, 0xbf}, + + {0xc0, 0xe0}, {0xc1, 0xe1}, {0xc2, 0xe2}, {0xc3, 0xe3}, {0xc4, 0xe4}, + {0xc5, 0xe5}, {0xc6, 0xe6}, {0xc7, 0xe7}, {0xc8, 0xe8}, {0xc9, 0xe9}, + {0xca, 0xea}, {0xcb, 0xeb}, {0xcc, 0xec}, {0xcd, 0xed}, {0xce, 0xee}, + {0xcf, 0xef}, + + {0xd0, 0xf0}, {0xd1, 0xf1}, {0xd2, 0xf2}, {0xd3, 0xf3}, {0xd4, 0xf4}, + {0xd5, 0xf5}, {0xd6, 0xf6}, {0xd8, 0xf8}, {0xd9, 0xf9}, {0xda, 0xfa}, + {0xdb, 0xfb}, {0xdc, 0xfc}, {0xdd, 0xfd}, {0xde, 0xfe}}; + +static int apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, void *arg, + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_apply_all_case_fold_with_map(numberof(CaseFoldMap), + CaseFoldMap, 1, flag, f, arg); +} + +static int get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + return onigenc_get_case_fold_codes_by_str_with_map( + numberof(CaseFoldMap), CaseFoldMap, 1, flag, p, end, items); +} + +#define DOTLESS_i (0xB9) +#define I_WITH_DOT_ABOVE (0xA9) +static int case_map(OnigCaseFoldType *flagP, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, OnigUChar *to_end, + const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp < end && to < to_end) + { + code = *(*pp)++; + if (code == SHARP_s) + { + if (flags & ONIGENC_CASE_UPCASE) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 'S'; + code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S'; + } + else if (flags & ONIGENC_CASE_FOLD) + { + flags |= ONIGENC_CASE_MODIFIED; + *to++ = 's'; + code = 's'; + } + } + else if (code == 0xB5) + ; + else if ((EncCP1252_CtypeTable[code] & BIT_CTYPE_UPPER) + && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) + { + flags |= ONIGENC_CASE_MODIFIED; + if (code == 'I') + code = flags & ONIGENC_CASE_FOLD_TURKISH_AZERI ? DOTLESS_i : 'i'; + else + code = ENC_CP1252_TO_LOWER_CASE(code); + } + else if ((EncCP1252_CtypeTable[code] & BIT_CTYPE_LOWER) + && (flags & ONIGENC_CASE_UPCASE)) + { + flags |= ONIGENC_CASE_MODIFIED; + if (code == 'i') + code = flags & ONIGENC_CASE_FOLD_TURKISH_AZERI ? I_WITH_DOT_ABOVE : 'I'; + else if (code == DOTLESS_i) + code = 'I'; + else if (code >= 0xB0 && code <= 0xBF) + code -= 0x10; + else + code -= 0x20; + } + *to++ = code; + if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase + for capitalize */ + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE); + } + *flagP = flags; + return (int)(to - to_start); +} + +OnigEncodingDefine(windows_1257, Windows_1257) = { + onigenc_single_byte_mbc_enc_len, + "Windows-1257", /* name */ + 1, /* max enc length */ + 1, /* min enc length */ + onigenc_is_mbc_newline_0x0a, + onigenc_single_byte_mbc_to_code, + onigenc_single_byte_code_to_mbclen, + onigenc_single_byte_code_to_mbc, + mbc_case_fold, + apply_all_case_fold, + get_case_fold_codes_by_str, + onigenc_minimum_property_name_to_ctype, + is_code_ctype, + onigenc_not_support_get_ctype_code_range, + onigenc_single_byte_left_adjust_char_head, + onigenc_always_true_is_allowed_reverse_match, + case_map, + 0, + ONIGENC_FLAG_NONE, +}; +ENC_ALIAS("CP1257", "Windows-1257") diff --git a/lib/edbee-lib/vendor/onig/enc/windows_31j.c b/lib/edbee-lib/vendor/onig/enc/windows_31j.c new file mode 100644 index 00000000..3fd5cceb --- /dev/null +++ b/lib/edbee-lib/vendor/onig/enc/windows_31j.c @@ -0,0 +1,86 @@ +/********************************************************************** + windows_31j.c - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#define ENC_CP932 +#include "shift_jis.h" + +OnigEncodingDefine(windows_31j, Windows_31J) = { + mbc_enc_len, + "Windows-31J", /* name */ + 2, /* max byte length */ + 1, /* min byte length */ + onigenc_is_mbc_newline_0x0a, + mbc_to_code, + code_to_mbclen, + code_to_mbc, + mbc_case_fold, + apply_all_case_fold, + get_case_fold_codes_by_str, + property_name_to_ctype, + is_code_ctype, + get_ctype_code_range, + left_adjust_char_head, + is_allowed_reverse_match, + onigenc_ascii_only_case_map, + 0, + ONIGENC_FLAG_NONE, +}; +/* + * Name: Windows-31J + * MIBenum: 2024 + * Link: http://www.iana.org/assignments/character-sets + * Link: http://www.microsoft.com/globaldev/reference/dbcs/932.mspx + * Link: http://ja.wikipedia.org/wiki/Windows-31J + * Link: + * http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/windows-932-2000.ucm + * + * Windows Standard Character Set and its mapping to Unicode by Microsoft. + * Since 1.9.3, SJIS is the alias of Windows-31J because its character + * set is usually this one even if its mapping may differ. + */ +ENC_ALIAS("CP932", "Windows-31J") +ENC_ALIAS( + "csWindows31J", + "Windows-31J") /* IANA. IE6 don't accept Windows-31J but csWindows31J. */ +ENC_ALIAS("SJIS", "Windows-31J") + +/* + * Name: PCK + * Link: + * http://download.oracle.com/docs/cd/E19253-01/819-0606/x-2chn0/index.html + * Link: + * http://download.oracle.com/docs/cd/E19253-01/819-0606/appb-pckwarn-1/index.html + * + * Solaris's SJIS variant. Its set is Windows Standard Character Set; it + * consists JIS X 0201 Latin (US-ASCII), JIS X 0201 Katakana, JIS X 0208, NEC + * special characters, NEC-selected IBM extended characters, and IBM extended + * characters. Solaris's iconv seems to use SJIS-open. + */ +ENC_ALIAS("PCK", "Windows-31J") diff --git a/lib/edbee-lib/vendor/onig/install-sh b/lib/edbee-lib/vendor/onig/install-sh new file mode 100755 index 00000000..a9244eb0 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/install-sh @@ -0,0 +1,527 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2011-01-19.21; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for `test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/lib/edbee-lib/vendor/onig/ltmain.sh b/lib/edbee-lib/vendor/onig/ltmain.sh new file mode 100644 index 00000000..8a65ad3c --- /dev/null +++ b/lib/edbee-lib/vendor/onig/ltmain.sh @@ -0,0 +1,11150 @@ +#! /bin/sh +## DO NOT EDIT - This file generated from /usr/src/ports/libtool/libtool-2.4.6-4.x86_64/src/libtool-2.4.6/build-aux/ltmain.in +## by inline-source v2014-01-03.01 + +# libtool (GNU libtool) 2.4.6 +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 + +# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +PROGRAM=libtool +PACKAGE=libtool +VERSION=2.4.6 +package_revision=2.4.6 + + +## ------ ## +## Usage. ## +## ------ ## + +# Run './libtool --help' for help with using this script from the +# command line. + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# After configure completes, it has a better idea of some of the +# shell tools we need than the defaults used by the functions shared +# with bootstrap, so set those here where they can still be over- +# ridden by the user, but otherwise take precedence. + +: ${AUTOCONF="autoconf"} +: ${AUTOMAKE="automake"} + + +## -------------------------- ## +## Source external libraries. ## +## -------------------------- ## + +# Much of our low-level functionality needs to be sourced from external +# libraries, which are installed to $pkgauxdir. + +# Set a version string for this script. +scriptversion=2015-01-20.17; # UTC + +# General shell script boiler plate, and helper functions. +# Written by Gary V. Vaughan, 2004 + +# Copyright (C) 2004-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# As a special exception to the GNU General Public License, if you distribute +# this file as part of a program or library that is built using GNU Libtool, +# you may include this file under the same distribution terms that you use +# for the rest of that program. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# Evaluate this file near the top of your script to gain access to +# the functions and variables defined here: +# +# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh +# +# If you need to override any of the default environment variable +# settings, do that before evaluating this file. + + +## -------------------- ## +## Shell normalisation. ## +## -------------------- ## + +# Some shells need a little help to be as Bourne compatible as possible. +# Before doing anything else, make sure all that help has been provided! + +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac +fi + +# NLS nuisances: We save the old values in case they are required later. +_G_user_locale= +_G_safe_locale= +for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test set = \"\${$_G_var+set}\"; then + save_$_G_var=\$$_G_var + $_G_var=C + export $_G_var + _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" + _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" + fi" +done + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Make sure IFS has a sensible default +sp=' ' +nl=' +' +IFS="$sp $nl" + +# There are apparently some retarded systems that use ';' as a PATH separator! +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + + +## ------------------------- ## +## Locate command utilities. ## +## ------------------------- ## + + +# func_executable_p FILE +# ---------------------- +# Check that FILE is an executable regular file. +func_executable_p () +{ + test -f "$1" && test -x "$1" +} + + +# func_path_progs PROGS_LIST CHECK_FUNC [PATH] +# -------------------------------------------- +# Search for either a program that responds to --version with output +# containing "GNU", or else returned by CHECK_FUNC otherwise, by +# trying all the directories in PATH with each of the elements of +# PROGS_LIST. +# +# CHECK_FUNC should accept the path to a candidate program, and +# set $func_check_prog_result if it truncates its output less than +# $_G_path_prog_max characters. +func_path_progs () +{ + _G_progs_list=$1 + _G_check_func=$2 + _G_PATH=${3-"$PATH"} + + _G_path_prog_max=0 + _G_path_prog_found=false + _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} + for _G_dir in $_G_PATH; do + IFS=$_G_save_IFS + test -z "$_G_dir" && _G_dir=. + for _G_prog_name in $_G_progs_list; do + for _exeext in '' .EXE; do + _G_path_prog=$_G_dir/$_G_prog_name$_exeext + func_executable_p "$_G_path_prog" || continue + case `"$_G_path_prog" --version 2>&1` in + *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; + *) $_G_check_func $_G_path_prog + func_path_progs_result=$func_check_prog_result + ;; + esac + $_G_path_prog_found && break 3 + done + done + done + IFS=$_G_save_IFS + test -z "$func_path_progs_result" && { + echo "no acceptable sed could be found in \$PATH" >&2 + exit 1 + } +} + + +# We want to be able to use the functions in this file before configure +# has figured out where the best binaries are kept, which means we have +# to search for them ourselves - except when the results are already set +# where we skip the searches. + +# Unless the user overrides by setting SED, search the path for either GNU +# sed, or the sed that truncates its output the least. +test -z "$SED" && { + _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for _G_i in 1 2 3 4 5 6 7; do + _G_sed_script=$_G_sed_script$nl$_G_sed_script + done + echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed + _G_sed_script= + + func_check_prog_sed () + { + _G_path_prog=$1 + + _G_count=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo '' >> conftest.nl + "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + rm -f conftest.sed + SED=$func_path_progs_result +} + + +# Unless the user overrides by setting GREP, search the path for either GNU +# grep, or the grep that truncates its output the least. +test -z "$GREP" && { + func_check_prog_grep () + { + _G_path_prog=$1 + + _G_count=0 + _G_path_prog_max=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo 'GREP' >> conftest.nl + "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + GREP=$func_path_progs_result +} + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# All uppercase variable names are used for environment variables. These +# variables can be overridden by the user before calling a script that +# uses them if a suitable command of that name is not already available +# in the command search PATH. + +: ${CP="cp -f"} +: ${ECHO="printf %s\n"} +: ${EGREP="$GREP -E"} +: ${FGREP="$GREP -F"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} + + +## -------------------- ## +## Useful sed snippets. ## +## -------------------- ## + +sed_dirname='s|/[^/]*$||' +sed_basename='s|^.*/||' + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s|\([`"$\\]\)|\\\1|g' + +# Same as above, but do not quote variable references. +sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' + +# Sed substitution that converts a w32 file name or path +# that contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-'\' parameter expansions in output of sed_double_quote_subst that +# were '\'-ed in input to the same. If an odd number of '\' preceded a +# '$' in input to sed_double_quote_subst, that '$' was protected from +# expansion. Since each input '\' is now two '\'s, look for any number +# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. +_G_bs='\\' +_G_bs2='\\\\' +_G_bs4='\\\\\\\\' +_G_dollar='\$' +sed_double_backslash="\ + s/$_G_bs4/&\\ +/g + s/^$_G_bs2$_G_dollar/$_G_bs&/ + s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g + s/\n//g" + + +## ----------------- ## +## Global variables. ## +## ----------------- ## + +# Except for the global variables explicitly listed below, the following +# functions in the '^func_' namespace, and the '^require_' namespace +# variables initialised in the 'Resource management' section, sourcing +# this file will not pollute your global namespace with anything +# else. There's no portable way to scope variables in Bourne shell +# though, so actually running these functions will sometimes place +# results into a variable named after the function, and often use +# temporary variables in the '^_G_' namespace. If you are careful to +# avoid using those namespaces casually in your sourcing script, things +# should continue to work as you expect. And, of course, you can freely +# overwrite any of the functions or variables defined here before +# calling anything to customize them. + +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +# Allow overriding, eg assuming that you follow the convention of +# putting '$debug_cmd' at the start of all your functions, you can get +# bash to show function call trace with: +# +# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name +debug_cmd=${debug_cmd-":"} +exit_cmd=: + +# By convention, finish your script with: +# +# exit $exit_status +# +# so that you can set exit_status to non-zero if you want to indicate +# something went wrong during execution without actually bailing out at +# the point of failure. +exit_status=$EXIT_SUCCESS + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath=$0 + +# The name of this program. +progname=`$ECHO "$progpath" |$SED "$sed_basename"` + +# Make sure we have an absolute progpath for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` + progdir=`cd "$progdir" && pwd` + progpath=$progdir/$progname + ;; + *) + _G_IFS=$IFS + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS=$_G_IFS + test -x "$progdir/$progname" && break + done + IFS=$_G_IFS + test -n "$progdir" || progdir=`pwd` + progpath=$progdir/$progname + ;; +esac + + +## ----------------- ## +## Standard options. ## +## ----------------- ## + +# The following options affect the operation of the functions defined +# below, and should be set appropriately depending on run-time para- +# meters passed on the command line. + +opt_dry_run=false +opt_quiet=false +opt_verbose=false + +# Categories 'all' and 'none' are always available. Append any others +# you will pass as the first argument to func_warning from your own +# code. +warning_categories= + +# By default, display warnings according to 'opt_warning_types'. Set +# 'warning_func' to ':' to elide all warnings, or func_fatal_error to +# treat the next displayed warning as a fatal error. +warning_func=func_warn_and_continue + +# Set to 'all' to display all warnings, 'none' to suppress all +# warnings, or a space delimited list of some subset of +# 'warning_categories' to display only the listed warnings. +opt_warning_types=all + + +## -------------------- ## +## Resource management. ## +## -------------------- ## + +# This section contains definitions for functions that each ensure a +# particular resource (a file, or a non-empty configuration variable for +# example) is available, and if appropriate to extract default values +# from pertinent package files. Call them using their associated +# 'require_*' variable to ensure that they are executed, at most, once. +# +# It's entirely deliberate that calling these functions can set +# variables that don't obey the namespace limitations obeyed by the rest +# of this file, in order that that they be as useful as possible to +# callers. + + +# require_term_colors +# ------------------- +# Allow display of bold text on terminals that support it. +require_term_colors=func_require_term_colors +func_require_term_colors () +{ + $debug_cmd + + test -t 1 && { + # COLORTERM and USE_ANSI_COLORS environment variables take + # precedence, because most terminfo databases neglect to describe + # whether color sequences are supported. + test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} + + if test 1 = "$USE_ANSI_COLORS"; then + # Standard ANSI escape sequences + tc_reset='' + tc_bold=''; tc_standout='' + tc_red=''; tc_green='' + tc_blue=''; tc_cyan='' + else + # Otherwise trust the terminfo database after all. + test -n "`tput sgr0 2>/dev/null`" && { + tc_reset=`tput sgr0` + test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` + tc_standout=$tc_bold + test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` + test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` + test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` + test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` + test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` + } + fi + } + + require_term_colors=: +} + + +## ----------------- ## +## Function library. ## +## ----------------- ## + +# This section contains a variety of useful functions to call in your +# scripts. Take note of the portable wrappers for features provided by +# some modern shells, which will fall back to slower equivalents on +# less featureful shells. + + +# func_append VAR VALUE +# --------------------- +# Append VALUE onto the existing contents of VAR. + + # We should try to minimise forks, especially on Windows where they are + # unreasonably slow, so skip the feature probes when bash or zsh are + # being used: + if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then + : ${_G_HAVE_ARITH_OP="yes"} + : ${_G_HAVE_XSI_OPS="yes"} + # The += operator was introduced in bash 3.1 + case $BASH_VERSION in + [12].* | 3.0 | 3.0*) ;; + *) + : ${_G_HAVE_PLUSEQ_OP="yes"} + ;; + esac + fi + + # _G_HAVE_PLUSEQ_OP + # Can be empty, in which case the shell is probed, "yes" if += is + # useable or anything else if it does not work. + test -z "$_G_HAVE_PLUSEQ_OP" \ + && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ + && _G_HAVE_PLUSEQ_OP=yes + +if test yes = "$_G_HAVE_PLUSEQ_OP" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_append () + { + $debug_cmd + + eval "$1+=\$2" + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_append () + { + $debug_cmd + + eval "$1=\$$1\$2" + } +fi + + +# func_append_quoted VAR VALUE +# ---------------------------- +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +if test yes = "$_G_HAVE_PLUSEQ_OP"; then + eval 'func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1+=\\ \$func_quote_for_eval_result" + }' +else + func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1=\$$1\\ \$func_quote_for_eval_result" + } +fi + + +# func_append_uniq VAR VALUE +# -------------------------- +# Append unique VALUE onto the existing contents of VAR, assuming +# entries are delimited by the first character of VALUE. For example: +# +# func_append_uniq options " --another-option option-argument" +# +# will only append to $options if " --another-option option-argument " +# is not already present somewhere in $options already (note spaces at +# each end implied by leading space in second argument). +func_append_uniq () +{ + $debug_cmd + + eval _G_current_value='`$ECHO $'$1'`' + _G_delim=`expr "$2" : '\(.\)'` + + case $_G_delim$_G_current_value$_G_delim in + *"$2$_G_delim"*) ;; + *) func_append "$@" ;; + esac +} + + +# func_arith TERM... +# ------------------ +# Set func_arith_result to the result of evaluating TERMs. + test -z "$_G_HAVE_ARITH_OP" \ + && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ + && _G_HAVE_ARITH_OP=yes + +if test yes = "$_G_HAVE_ARITH_OP"; then + eval 'func_arith () + { + $debug_cmd + + func_arith_result=$(( $* )) + }' +else + func_arith () + { + $debug_cmd + + func_arith_result=`expr "$@"` + } +fi + + +# func_basename FILE +# ------------------ +# Set func_basename_result to FILE with everything up to and including +# the last / stripped. +if test yes = "$_G_HAVE_XSI_OPS"; then + # If this shell supports suffix pattern removal, then use it to avoid + # forking. Hide the definitions single quotes in case the shell chokes + # on unsupported syntax... + _b='func_basename_result=${1##*/}' + _d='case $1 in + */*) func_dirname_result=${1%/*}$2 ;; + * ) func_dirname_result=$3 ;; + esac' + +else + # ...otherwise fall back to using sed. + _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' + _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` + if test "X$func_dirname_result" = "X$1"; then + func_dirname_result=$3 + else + func_append func_dirname_result "$2" + fi' +fi + +eval 'func_basename () +{ + $debug_cmd + + '"$_b"' +}' + + +# func_dirname FILE APPEND NONDIR_REPLACEMENT +# ------------------------------------------- +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +eval 'func_dirname () +{ + $debug_cmd + + '"$_d"' +}' + + +# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT +# -------------------------------------------------------- +# Perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# For efficiency, we do not delegate to the functions above but instead +# duplicate the functionality here. +eval 'func_dirname_and_basename () +{ + $debug_cmd + + '"$_b"' + '"$_d"' +}' + + +# func_echo ARG... +# ---------------- +# Echo program name prefixed message. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_echo_all ARG... +# -------------------- +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + + +# func_echo_infix_1 INFIX ARG... +# ------------------------------ +# Echo program name, followed by INFIX on the first line, with any +# additional lines not showing INFIX. +func_echo_infix_1 () +{ + $debug_cmd + + $require_term_colors + + _G_infix=$1; shift + _G_indent=$_G_infix + _G_prefix="$progname: $_G_infix: " + _G_message=$* + + # Strip color escape sequences before counting printable length + for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" + do + test -n "$_G_tc" && { + _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` + _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` + } + done + _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes + + func_echo_infix_1_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_infix_1_IFS + $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 + _G_prefix=$_G_indent + done + IFS=$func_echo_infix_1_IFS +} + + +# func_error ARG... +# ----------------- +# Echo program name prefixed message to standard error. +func_error () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 +} + + +# func_fatal_error ARG... +# ----------------------- +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + $debug_cmd + + func_error "$*" + exit $EXIT_FAILURE +} + + +# func_grep EXPRESSION FILENAME +# ----------------------------- +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $debug_cmd + + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_len STRING +# --------------- +# Set func_len_result to the length of STRING. STRING may not +# start with a hyphen. + test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_len () + { + $debug_cmd + + func_len_result=${#1} + }' +else + func_len () + { + $debug_cmd + + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` + } +fi + + +# func_mkdir_p DIRECTORY-PATH +# --------------------------- +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + $debug_cmd + + _G_directory_path=$1 + _G_dir_list= + + if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then + + # Protect directory names starting with '-' + case $_G_directory_path in + -*) _G_directory_path=./$_G_directory_path ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$_G_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + _G_dir_list=$_G_directory_path:$_G_dir_list + + # If the last portion added has no slash in it, the list is done + case $_G_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` + done + _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` + + func_mkdir_p_IFS=$IFS; IFS=: + for _G_dir in $_G_dir_list; do + IFS=$func_mkdir_p_IFS + # mkdir can fail with a 'File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$_G_dir" 2>/dev/null || : + done + IFS=$func_mkdir_p_IFS + + # Bail out if we (or some other process) failed to create a directory. + test -d "$_G_directory_path" || \ + func_fatal_error "Failed to create '$1'" + fi +} + + +# func_mktempdir [BASENAME] +# ------------------------- +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, BASENAME is the basename for that directory. +func_mktempdir () +{ + $debug_cmd + + _G_template=${TMPDIR-/tmp}/${1-$progname} + + if test : = "$opt_dry_run"; then + # Return a directory name, but don't create it in dry-run mode + _G_tmpdir=$_G_template-$$ + else + + # If mktemp works, use that first and foremost + _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` + + if test ! -d "$_G_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + _G_tmpdir=$_G_template-${RANDOM-0}$$ + + func_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$_G_tmpdir" + umask $func_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$_G_tmpdir" || \ + func_fatal_error "cannot create temporary directory '$_G_tmpdir'" + fi + + $ECHO "$_G_tmpdir" +} + + +# func_normal_abspath PATH +# ------------------------ +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +func_normal_abspath () +{ + $debug_cmd + + # These SED scripts presuppose an absolute path with a trailing slash. + _G_pathcar='s|^/\([^/]*\).*$|\1|' + _G_pathcdr='s|^/[^/]*||' + _G_removedotparts=':dotsl + s|/\./|/|g + t dotsl + s|/\.$|/|' + _G_collapseslashes='s|/\{1,\}|/|g' + _G_finalslash='s|/*$|/|' + + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` + while :; do + # Processed it all yet? + if test / = "$func_normal_abspath_tpath"; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result"; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + + +# func_notquiet ARG... +# -------------------- +# Echo program name prefixed message only when not in quiet mode. +func_notquiet () +{ + $debug_cmd + + $opt_quiet || func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + + +# func_relative_path SRCDIR DSTDIR +# -------------------------------- +# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. +func_relative_path () +{ + $debug_cmd + + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=$func_dirname_result + if test -z "$func_relative_path_tlibdir"; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test -n "$func_stripname_result"; then + func_append func_relative_path_result "/$func_stripname_result" + fi + + # Normalisation. If bindir is libdir, return '.' else relative path. + if test -n "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + fi + + test -n "$func_relative_path_result" || func_relative_path_result=. + + : +} + + +# func_quote_for_eval ARG... +# -------------------------- +# Aesthetically quote ARGs to be evaled later. +# This function returns two values: +# i) func_quote_for_eval_result +# double-quoted, suitable for a subsequent eval +# ii) func_quote_for_eval_unquoted_result +# has all characters that are still active within double +# quotes backslashified. +func_quote_for_eval () +{ + $debug_cmd + + func_quote_for_eval_unquoted_result= + func_quote_for_eval_result= + while test 0 -lt $#; do + case $1 in + *[\\\`\"\$]*) + _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; + *) + _G_unquoted_arg=$1 ;; + esac + if test -n "$func_quote_for_eval_unquoted_result"; then + func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" + else + func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + fi + + case $_G_unquoted_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + _G_quoted_arg=\"$_G_unquoted_arg\" + ;; + *) + _G_quoted_arg=$_G_unquoted_arg + ;; + esac + + if test -n "$func_quote_for_eval_result"; then + func_append func_quote_for_eval_result " $_G_quoted_arg" + else + func_append func_quote_for_eval_result "$_G_quoted_arg" + fi + shift + done +} + + +# func_quote_for_expand ARG +# ------------------------- +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + $debug_cmd + + case $1 in + *[\\\`\"]*) + _G_arg=`$ECHO "$1" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; + *) + _G_arg=$1 ;; + esac + + case $_G_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + _G_arg=\"$_G_arg\" + ;; + esac + + func_quote_for_expand_result=$_G_arg +} + + +# func_stripname PREFIX SUFFIX NAME +# --------------------------------- +# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_stripname () + { + $debug_cmd + + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary variable first. + func_stripname_result=$3 + func_stripname_result=${func_stripname_result#"$1"} + func_stripname_result=${func_stripname_result%"$2"} + }' +else + func_stripname () + { + $debug_cmd + + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; + esac + } +fi + + +# func_show_eval CMD [FAIL_EXP] +# ----------------------------- +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + func_quote_for_expand "$_G_cmd" + eval "func_notquiet $func_quote_for_expand_result" + + $opt_dry_run || { + eval "$_G_cmd" + _G_status=$? + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_show_eval_locale CMD [FAIL_EXP] +# ------------------------------------ +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + $opt_quiet || { + func_quote_for_expand "$_G_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + $opt_dry_run || { + eval "$_G_user_locale + $_G_cmd" + _G_status=$? + eval "$_G_safe_locale" + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_tr_sh +# ---------- +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + $debug_cmd + + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_verbose ARG... +# ------------------- +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $debug_cmd + + $opt_verbose && func_echo "$*" + + : +} + + +# func_warn_and_continue ARG... +# ----------------------------- +# Echo program name prefixed warning message to standard error. +func_warn_and_continue () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 +} + + +# func_warning CATEGORY ARG... +# ---------------------------- +# Echo program name prefixed warning message to standard error. Warning +# messages can be filtered according to CATEGORY, where this function +# elides messages where CATEGORY is not listed in the global variable +# 'opt_warning_types'. +func_warning () +{ + $debug_cmd + + # CATEGORY must be in the warning_categories list! + case " $warning_categories " in + *" $1 "*) ;; + *) func_internal_error "invalid warning category '$1'" ;; + esac + + _G_category=$1 + shift + + case " $opt_warning_types " in + *" $_G_category "*) $warning_func ${1+"$@"} ;; + esac +} + + +# func_sort_ver VER1 VER2 +# ----------------------- +# 'sort -V' is not generally available. +# Note this deviates from the version comparison in automake +# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a +# but this should suffice as we won't be specifying old +# version formats or redundant trailing .0 in bootstrap.conf. +# If we did want full compatibility then we should probably +# use m4_version_compare from autoconf. +func_sort_ver () +{ + $debug_cmd + + printf '%s\n%s\n' "$1" "$2" \ + | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n +} + +# func_lt_ver PREV CURR +# --------------------- +# Return true if PREV and CURR are in the correct order according to +# func_sort_ver, otherwise false. Use it like this: +# +# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." +func_lt_ver () +{ + $debug_cmd + + test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: +#! /bin/sh + +# Set a version string for this script. +scriptversion=2014-01-07.03; # UTC + +# A portable, pluggable option parser for Bourne shell. +# Written by Gary V. Vaughan, 2010 + +# Copyright (C) 2010-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# This file is a library for parsing options in your shell scripts along +# with assorted other useful supporting features that you can make use +# of too. +# +# For the simplest scripts you might need only: +# +# #!/bin/sh +# . relative/path/to/funclib.sh +# . relative/path/to/options-parser +# scriptversion=1.0 +# func_options ${1+"$@"} +# eval set dummy "$func_options_result"; shift +# ...rest of your script... +# +# In order for the '--version' option to work, you will need to have a +# suitably formatted comment like the one at the top of this file +# starting with '# Written by ' and ending with '# warranty; '. +# +# For '-h' and '--help' to work, you will also need a one line +# description of your script's purpose in a comment directly above the +# '# Written by ' line, like the one at the top of this file. +# +# The default options also support '--debug', which will turn on shell +# execution tracing (see the comment above debug_cmd below for another +# use), and '--verbose' and the func_verbose function to allow your script +# to display verbose messages only when your user has specified +# '--verbose'. +# +# After sourcing this file, you can plug processing for additional +# options by amending the variables from the 'Configuration' section +# below, and following the instructions in the 'Option parsing' +# section further down. + +## -------------- ## +## Configuration. ## +## -------------- ## + +# You should override these variables in your script after sourcing this +# file so that they reflect the customisations you have added to the +# option parser. + +# The usage line for option parsing errors and the start of '-h' and +# '--help' output messages. You can embed shell variables for delayed +# expansion at the time the message is displayed, but you will need to +# quote other shell meta-characters carefully to prevent them being +# expanded when the contents are evaled. +usage='$progpath [OPTION]...' + +# Short help message in response to '-h' and '--help'. Add to this or +# override it after sourcing this library to reflect the full set of +# options your script accepts. +usage_message="\ + --debug enable verbose shell tracing + -W, --warnings=CATEGORY + report the warnings falling in CATEGORY [all] + -v, --verbose verbosely report processing + --version print version information and exit + -h, --help print short or long help message and exit +" + +# Additional text appended to 'usage_message' in response to '--help'. +long_help_message=" +Warning categories include: + 'all' show all warnings + 'none' turn off all the warnings + 'error' warnings are treated as fatal errors" + +# Help message printed before fatal option parsing errors. +fatal_help="Try '\$progname --help' for more information." + + + +## ------------------------- ## +## Hook function management. ## +## ------------------------- ## + +# This section contains functions for adding, removing, and running hooks +# to the main code. A hook is just a named list of of function, that can +# be run in order later on. + +# func_hookable FUNC_NAME +# ----------------------- +# Declare that FUNC_NAME will run hooks added with +# 'func_add_hook FUNC_NAME ...'. +func_hookable () +{ + $debug_cmd + + func_append hookable_fns " $1" +} + + +# func_add_hook FUNC_NAME HOOK_FUNC +# --------------------------------- +# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must +# first have been declared "hookable" by a call to 'func_hookable'. +func_add_hook () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not accept hook functions." ;; + esac + + eval func_append ${1}_hooks '" $2"' +} + + +# func_remove_hook FUNC_NAME HOOK_FUNC +# ------------------------------------ +# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +func_remove_hook () +{ + $debug_cmd + + eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' +} + + +# func_run_hooks FUNC_NAME [ARG]... +# --------------------------------- +# Run all hook functions registered to FUNC_NAME. +# It is assumed that the list of hook functions contains nothing more +# than a whitespace-delimited list of legal shell function names, and +# no effort is wasted trying to catch shell meta-characters or preserve +# whitespace. +func_run_hooks () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not support hook funcions.n" ;; + esac + + eval _G_hook_fns=\$$1_hooks; shift + + for _G_hook in $_G_hook_fns; do + eval $_G_hook '"$@"' + + # store returned options list back into positional + # parameters for next 'cmd' execution. + eval _G_hook_result=\$${_G_hook}_result + eval set dummy "$_G_hook_result"; shift + done + + func_quote_for_eval ${1+"$@"} + func_run_hooks_result=$func_quote_for_eval_result +} + + + +## --------------- ## +## Option parsing. ## +## --------------- ## + +# In order to add your own option parsing hooks, you must accept the +# full positional parameter list in your hook function, remove any +# options that you action, and then pass back the remaining unprocessed +# options in '<hooked_function_name>_result', escaped suitably for +# 'eval'. Like this: +# +# my_options_prep () +# { +# $debug_cmd +# +# # Extend the existing usage message. +# usage_message=$usage_message' +# -s, --silent don'\''t print informational messages +# ' +# +# func_quote_for_eval ${1+"$@"} +# my_options_prep_result=$func_quote_for_eval_result +# } +# func_add_hook func_options_prep my_options_prep +# +# +# my_silent_option () +# { +# $debug_cmd +# +# # Note that for efficiency, we parse as many options as we can +# # recognise in a loop before passing the remainder back to the +# # caller on the first unrecognised argument we encounter. +# while test $# -gt 0; do +# opt=$1; shift +# case $opt in +# --silent|-s) opt_silent=: ;; +# # Separate non-argument short options: +# -s*) func_split_short_opt "$_G_opt" +# set dummy "$func_split_short_opt_name" \ +# "-$func_split_short_opt_arg" ${1+"$@"} +# shift +# ;; +# *) set dummy "$_G_opt" "$*"; shift; break ;; +# esac +# done +# +# func_quote_for_eval ${1+"$@"} +# my_silent_option_result=$func_quote_for_eval_result +# } +# func_add_hook func_parse_options my_silent_option +# +# +# my_option_validation () +# { +# $debug_cmd +# +# $opt_silent && $opt_verbose && func_fatal_help "\ +# '--silent' and '--verbose' options are mutually exclusive." +# +# func_quote_for_eval ${1+"$@"} +# my_option_validation_result=$func_quote_for_eval_result +# } +# func_add_hook func_validate_options my_option_validation +# +# You'll alse need to manually amend $usage_message to reflect the extra +# options you parse. It's preferable to append if you can, so that +# multiple option parsing hooks can be added safely. + + +# func_options [ARG]... +# --------------------- +# All the functions called inside func_options are hookable. See the +# individual implementations for details. +func_hookable func_options +func_options () +{ + $debug_cmd + + func_options_prep ${1+"$@"} + eval func_parse_options \ + ${func_options_prep_result+"$func_options_prep_result"} + eval func_validate_options \ + ${func_parse_options_result+"$func_parse_options_result"} + + eval func_run_hooks func_options \ + ${func_validate_options_result+"$func_validate_options_result"} + + # save modified positional parameters for caller + func_options_result=$func_run_hooks_result +} + + +# func_options_prep [ARG]... +# -------------------------- +# All initialisations required before starting the option parse loop. +# Note that when calling hook functions, we pass through the list of +# positional parameters. If a hook function modifies that list, and +# needs to propogate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before +# returning. +func_hookable func_options_prep +func_options_prep () +{ + $debug_cmd + + # Option defaults: + opt_verbose=false + opt_warning_types= + + func_run_hooks func_options_prep ${1+"$@"} + + # save modified positional parameters for caller + func_options_prep_result=$func_run_hooks_result +} + + +# func_parse_options [ARG]... +# --------------------------- +# The main option parsing loop. +func_hookable func_parse_options +func_parse_options () +{ + $debug_cmd + + func_parse_options_result= + + # this just eases exit handling + while test $# -gt 0; do + # Defer to hook functions for initial option parsing, so they + # get priority in the event of reusing an option name. + func_run_hooks func_parse_options ${1+"$@"} + + # Adjust func_parse_options positional parameters to match + eval set dummy "$func_run_hooks_result"; shift + + # Break out of the loop if we already parsed every option. + test $# -gt 0 || break + + _G_opt=$1 + shift + case $_G_opt in + --debug|-x) debug_cmd='set -x' + func_echo "enabling shell trace mode" + $debug_cmd + ;; + + --no-warnings|--no-warning|--no-warn) + set dummy --warnings none ${1+"$@"} + shift + ;; + + --warnings|--warning|-W) + test $# = 0 && func_missing_arg $_G_opt && break + case " $warning_categories $1" in + *" $1 "*) + # trailing space prevents matching last $1 above + func_append_uniq opt_warning_types " $1" + ;; + *all) + opt_warning_types=$warning_categories + ;; + *none) + opt_warning_types=none + warning_func=: + ;; + *error) + opt_warning_types=$warning_categories + warning_func=func_fatal_error + ;; + *) + func_fatal_error \ + "unsupported warning category: '$1'" + ;; + esac + shift + ;; + + --verbose|-v) opt_verbose=: ;; + --version) func_version ;; + -\?|-h) func_usage ;; + --help) func_help ;; + + # Separate optargs to long options (plugins may need this): + --*=*) func_split_equals "$_G_opt" + set dummy "$func_split_equals_lhs" \ + "$func_split_equals_rhs" ${1+"$@"} + shift + ;; + + # Separate optargs to short options: + -W*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-v*|-x*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + esac + done + + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + func_parse_options_result=$func_quote_for_eval_result +} + + +# func_validate_options [ARG]... +# ------------------------------ +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +func_hookable func_validate_options +func_validate_options () +{ + $debug_cmd + + # Display all warnings if -W was not given. + test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" + + func_run_hooks func_validate_options ${1+"$@"} + + # Bail if the options were screwed! + $exit_cmd $EXIT_FAILURE + + # save modified positional parameters for caller + func_validate_options_result=$func_run_hooks_result +} + + + +## ----------------- ## +## Helper functions. ## +## ----------------- ## + +# This section contains the helper functions used by the rest of the +# hookable option parser framework in ascii-betical order. + + +# func_fatal_help ARG... +# ---------------------- +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + eval \$ECHO \""$fatal_help"\" + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + + +# func_help +# --------- +# Echo long help message to standard output and exit. +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message" + exit 0 +} + + +# func_missing_arg ARGNAME +# ------------------------ +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $debug_cmd + + func_error "Missing argument for '$1'." + exit_cmd=exit +} + + +# func_split_equals STRING +# ------------------------ +# Set func_split_equals_lhs and func_split_equals_rhs shell variables after +# splitting STRING at the '=' sign. +test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=${1%%=*} + func_split_equals_rhs=${1#*=} + test "x$func_split_equals_lhs" = "x$1" \ + && func_split_equals_rhs= + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` + func_split_equals_rhs= + test "x$func_split_equals_lhs" = "x$1" \ + || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` + } +fi #func_split_equals + + +# func_split_short_opt SHORTOPT +# ----------------------------- +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"} + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` + } +fi #func_split_short_opt + + +# func_usage +# ---------- +# Echo short help message to standard output and exit. +func_usage () +{ + $debug_cmd + + func_usage_message + $ECHO "Run '$progname --help |${PAGER-more}' for full usage" + exit 0 +} + + +# func_usage_message +# ------------------ +# Echo short help message to standard output. +func_usage_message () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + echo + $SED -n 's|^# || + /^Written by/{ + x;p;x + } + h + /^Written by/q' < "$progpath" + echo + eval \$ECHO \""$usage_message"\" +} + + +# func_version +# ------------ +# Echo version message to standard output and exit. +func_version () +{ + $debug_cmd + + printf '%s\n' "$progname $scriptversion" + $SED -n ' + /(C)/!b go + :more + /\./!{ + N + s|\n# | | + b more + } + :go + /^# Written by /,/# warranty; / { + s|^# || + s|^# *$|| + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + p + } + /^# Written by / { + s|^# || + p + } + /^warranty; /q' < "$progpath" + + exit $? +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: + +# Set a version string. +scriptversion='(GNU libtool) 2.4.6' + + +# func_echo ARG... +# ---------------- +# Libtool also displays the current mode in messages, so override +# funclib.sh func_echo with this custom definition. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_warning ARG... +# ------------------- +# Libtool warnings are not categorized, so override funclib.sh +# func_warning with this simpler definition. +func_warning () +{ + $debug_cmd + + $warning_func ${1+"$@"} +} + + +## ---------------- ## +## Options parsing. ## +## ---------------- ## + +# Hook in the functions to make sure our own options are parsed during +# the option parsing loop. + +usage='$progpath [OPTION]... [MODE-ARG]...' + +# Short help message in response to '-h'. +usage_message="Options: + --config show all configuration variables + --debug enable verbose shell tracing + -n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --mode=MODE use operation mode MODE + --no-warnings equivalent to '-Wnone' + --preserve-dup-deps don't remove duplicate dependency libraries + --quiet, --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + -v, --verbose print more informational messages than default + --version print version information + -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] + -h, --help, --help-all print short, long, or detailed help message +" + +# Additional text appended to 'usage_message' in response to '--help'. +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. When passed as first option, +'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. +Try '$progname --help --mode=MODE' for a more detailed description of MODE. + +When reporting a bug, please describe a test case to reproduce it and +include the following information: + + host-triplet: $host + shell: $SHELL + compiler: $LTCC + compiler flags: $LTCFLAGS + linker: $LD (gnu? $with_gnu_ld) + version: $progname (GNU libtool) 2.4.6 + automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` + autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` + +Report bugs to <bug-libtool@gnu.org>. +GNU libtool home page: <http://www.gnu.org/software/libtool/>. +General help using GNU software: <http://www.gnu.org/gethelp/>." + exit 0 +} + + +# func_lo2o OBJECT-NAME +# --------------------- +# Transform OBJECT-NAME from a '.lo' suffix to the platform specific +# object suffix. + +lo2o=s/\\.lo\$/.$objext/ +o2lo=s/\\.$objext\$/.lo/ + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_lo2o () + { + case $1 in + *.lo) func_lo2o_result=${1%.lo}.$objext ;; + * ) func_lo2o_result=$1 ;; + esac + }' + + # func_xform LIBOBJ-OR-SOURCE + # --------------------------- + # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) + # suffix to a '.lo' libtool-object suffix. + eval 'func_xform () + { + func_xform_result=${1%.*}.lo + }' +else + # ...otherwise fall back to using sed. + func_lo2o () + { + func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` + } + + func_xform () + { + func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` + } +fi + + +# func_fatal_configuration ARG... +# ------------------------------- +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func__fatal_error ${1+"$@"} \ + "See the $PACKAGE documentation for more information." \ + "Fatal configuration error." +} + + +# func_config +# ----------- +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + + +# func_features +# ------------- +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test yes = "$build_libtool_libs"; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test yes = "$build_old_libs"; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + + +# func_enable_tag TAGNAME +# ----------------------- +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname=$1 + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf=/$re_begincf/,/$re_endcf/p + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + + +# func_check_version_match +# ------------------------ +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# libtool_options_prep [ARG]... +# ----------------------------- +# Preparation for options parsed by libtool. +libtool_options_prep () +{ + $debug_mode + + # Option defaults: + opt_config=false + opt_dlopen= + opt_dry_run=false + opt_help=false + opt_mode= + opt_preserve_dup_deps=false + opt_quiet=false + + nonopt= + preserve_args= + + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; + esac + + # Pass back the list of options. + func_quote_for_eval ${1+"$@"} + libtool_options_prep_result=$func_quote_for_eval_result +} +func_add_hook func_options_prep libtool_options_prep + + +# libtool_parse_options [ARG]... +# --------------------------------- +# Provide handling for libtool specific options. +libtool_parse_options () +{ + $debug_cmd + + # Perform our own loop to consume as many options as possible in + # each iteration. + while test $# -gt 0; do + _G_opt=$1 + shift + case $_G_opt in + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + + --config) func_config ;; + + --dlopen|-dlopen) + opt_dlopen="${opt_dlopen+$opt_dlopen +}$1" + shift + ;; + + --preserve-dup-deps) + opt_preserve_dup_deps=: ;; + + --features) func_features ;; + + --finish) set dummy --mode finish ${1+"$@"}; shift ;; + + --help) opt_help=: ;; + + --help-all) opt_help=': help-all' ;; + + --mode) test $# = 0 && func_missing_arg $_G_opt && break + opt_mode=$1 + case $1 in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $_G_opt" + exit_cmd=exit + break + ;; + esac + shift + ;; + + --no-silent|--no-quiet) + opt_quiet=false + func_append preserve_args " $_G_opt" + ;; + + --no-warnings|--no-warning|--no-warn) + opt_warning=false + func_append preserve_args " $_G_opt" + ;; + + --no-verbose) + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --silent|--quiet) + opt_quiet=: + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --tag) test $# = 0 && func_missing_arg $_G_opt && break + opt_tag=$1 + func_append preserve_args " $_G_opt $1" + func_enable_tag "$1" + shift + ;; + + --verbose|-v) opt_quiet=false + opt_verbose=: + func_append preserve_args " $_G_opt" + ;; + + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + esac + done + + + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + libtool_parse_options_result=$func_quote_for_eval_result +} +func_add_hook func_parse_options libtool_parse_options + + + +# libtool_validate_options [ARG]... +# --------------------------------- +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +libtool_validate_options () +{ + # save first non-option argument + if test 0 -lt $#; then + nonopt=$1 + shift + fi + + # preserve --debug + test : = "$debug_cmd" || func_append preserve_args " --debug" + + case $host in + # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 + # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + test yes != "$build_libtool_libs" \ + && test yes != "$build_old_libs" \ + && func_fatal_configuration "not configured to build any kind of library" + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test execute != "$opt_mode"; then + func_error "unrecognized option '-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help=$help + help="Try '$progname --help --mode=$opt_mode' for more information." + } + + # Pass back the unparsed argument list + func_quote_for_eval ${1+"$@"} + libtool_validate_options_result=$func_quote_for_eval_result +} +func_add_hook func_validate_options libtool_validate_options + + +# Process options as early as possible so that --help and --version +# can return quickly. +func_options ${1+"$@"} +eval set dummy "$func_options_result"; shift + + + +## ----------- ## +## Main. ## +## ----------- ## + +magic='%%%MAGIC variable%%%' +magic_exe='%%%MAGIC EXE variable%%%' + +# Global variables. +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# func_generated_by_libtool +# True iff stdin has been generated by Libtool. This function is only +# a basic sanity check; it will hardly flush out determined imposters. +func_generated_by_libtool_p () +{ + $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_p file +# True iff FILE is a libtool '.la' library or '.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool '.la' library or '.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if 'file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case $lalib_p_line in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test yes = "$lalib_p" +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + test -f "$1" && + $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $debug_cmd + + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$sp$nl + eval cmd=\"$cmd\" + IFS=$save_ifs + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# 'FILE.' does not work on cygwin managed mounts. +func_source () +{ + $debug_cmd + + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case $lt_sysroot:$1 in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result='='$func_stripname_result + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $debug_cmd + + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with '--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=$1 + if test yes = "$build_libtool_libs"; then + write_lobj=\'$2\' + else + write_lobj=none + fi + + if test yes = "$build_old_libs"; then + write_oldobj=\'$3\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T <<EOF +# $write_libobj - a libtool object file +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# Name of the PIC object. +pic_object=$write_lobj + +# Name of the non-PIC object +non_pic_object=$write_oldobj + +EOF + $MV "${write_libobj}T" "$write_libobj" + } +} + + +################################################## +# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS # +################################################## + +# func_convert_core_file_wine_to_w32 ARG +# Helper function used by file name conversion functions when $build is *nix, +# and $host is mingw, cygwin, or some other w32 environment. Relies on a +# correctly configured wine environment available, with the winepath program +# in $build's $PATH. +# +# ARG is the $build file name to be converted to w32 format. +# Result is available in $func_convert_core_file_wine_to_w32_result, and will +# be empty on error (or when ARG is empty) +func_convert_core_file_wine_to_w32 () +{ + $debug_cmd + + func_convert_core_file_wine_to_w32_result=$1 + if test -n "$1"; then + # Unfortunately, winepath does not exit with a non-zero error code, so we + # are forced to check the contents of stdout. On the other hand, if the + # command is not found, the shell will set an exit code of 127 and print + # *an error message* to stdout. So we must check for both error code of + # zero AND non-empty stdout, which explains the odd construction: + func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null` + if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $debug_cmd + + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result= + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result"; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $debug_cmd + + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $debug_cmd + + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $debug_cmd + + if test -z "$2" && test -n "$1"; then + func_error "Could not determine host file name corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result=$1 + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $debug_cmd + + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " '$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result=$3 + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $debug_cmd + + case $4 in + $1 ) func_to_host_path_result=$3$func_to_host_path_result + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via '$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $debug_cmd + + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $debug_cmd + + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result=$1 +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result=$func_convert_core_msys_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result=$func_convert_core_file_wine_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via '$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $debug_cmd + + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd=func_convert_path_$func_stripname_result + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $debug_cmd + + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result=$1 +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=$func_convert_core_msys_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=$func_convert_core_path_wine_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_dll_def_p FILE +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with _LT_DLL_DEF_P in libtool.m4 +func_dll_def_p () +{ + $debug_cmd + + func_dll_def_p_tmp=`$SED -n \ + -e 's/^[ ]*//' \ + -e '/^\(;.*\)*$/d' \ + -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ + -e q \ + "$1"` + test DEF = "$func_dll_def_p_tmp" +} + + +# func_mode_compile arg... +func_mode_compile () +{ + $debug_cmd + + # Get the compilation command and the source file. + base_compile= + srcfile=$nonopt # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + pie_flag= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg=$arg + arg_mode=normal + ;; + + target ) + libobj=$arg + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + test -n "$libobj" && \ + func_fatal_error "you cannot specify '-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append later " $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs=$IFS; IFS=, + for arg in $args; do + IFS=$save_ifs + func_append_quoted lastarg "$arg" + done + IFS=$save_ifs + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append base_compile " $lastarg" + continue + ;; + + *) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg=$srcfile + srcfile=$arg + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with '-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj=$func_basename_result + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from '$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test yes = "$build_libtool_libs" \ + || func_fatal_configuration "cannot build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name '$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname=$func_basename_result + xdir=$func_dirname_result + lobj=$xdir$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test yes = "$build_old_libs"; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test no = "$compiler_c_o"; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext + lockfile=$output_obj.lock + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test yes = "$need_locks"; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test warn = "$need_locks"; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test yes = "$build_libtool_libs"; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test no != "$pic_mode"; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test warn = "$need_locks" && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test yes = "$suppress_opt"; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test yes = "$build_old_libs"; then + if test yes != "$pic_mode"; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test yes = "$compiler_c_o"; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test warn = "$need_locks" && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test no != "$need_locks"; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test compile = "$opt_mode" && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a '.o' file suitable for static linking + -static only build a '.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a 'standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix '.c' with the +library object suffix, '.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to '-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the '--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the 'install' or 'cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE use a list of object files found in FILE to specify objects + -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with '-') are ignored. + +Every other argument is treated as a filename. Files ending in '.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in '.la', then a libtool library is created, +only library objects ('.lo' files) may be specified, and '-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created +using 'ar' and 'ranlib', or on Windows using 'lib'. + +If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode '$opt_mode'" + ;; + esac + + echo + $ECHO "Try '$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test : = "$opt_help"; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | $SED -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + $SED '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $debug_cmd + + # The first argument is the command name. + cmd=$nonopt + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "'$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "'$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "'$file' was not linked with '-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir=$func_dirname_result + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir=$func_dirname_result + ;; + + *) + func_warning "'-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir=$absdir + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic=$magic + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file=$progdir/$program + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file=$progdir/$program + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if $opt_dry_run; then + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + else + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd=\$cmd$args + fi +} + +test execute = "$opt_mode" && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $debug_cmd + + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "'$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument '$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and '=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_quiet && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the '-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the '$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the '$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the '$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test finish = "$opt_mode" && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $debug_cmd + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac + then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=false + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=: ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test X-m = "X$prev" && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the '$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=: + if $isdir; then + destdir=$dest + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir=$func_dirname_result + destname=$func_basename_result + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "'$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "'$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic=$magic + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "'$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir=$func_dirname_result + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking '$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname=$1 + shift + + srcname=$realname + test -n "$relink_command" && srcname=${realname}T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme=$stripme + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme= + ;; + esac + ;; + os2*) + case $realname in + *_dll.a) + tstripme= + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try 'ln -sf' first, because the 'ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib=$destdir/$realname + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name=$func_basename_result + instname=$dir/${name}i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile=$destdir/$destname + else + func_basename "$file" + destfile=$func_basename_result + destfile=$destdir/$destfile + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest=$destfile + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to '$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test yes = "$build_old_libs"; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile=$destdir/$destname + else + func_basename "$file" + destfile=$func_basename_result + destfile=$destdir/$destfile + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext= + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=.exe + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script '$wrapper'" + + finalize=: + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "'$lib' has not been installed in '$libdir'" + finalize=false + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test no = "$fast_install" && test -n "$relink_command"; then + $opt_dry_run || { + if $finalize; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file=$func_basename_result + outputname=$tmpdir/$file + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_quiet || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink '$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file=$outputname + else + func_warning "cannot relink '$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name=$func_basename_result + + # Set up the ranlib parameters. + oldlib=$destdir/$name + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run '$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test install = "$opt_mode" && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $debug_cmd + + my_outputname=$1 + my_originator=$2 + my_pic_p=${3-false} + my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms=${my_outputname}S.c + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist=$output_objdir/$my_outputname.nm + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + +/* External symbol declarations for the compiler. */\ +" + + if test yes = "$dlself"; then + func_verbose "generating symbol list for '$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from '$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols=$output_objdir/$outputname.exp + $opt_dry_run || { + $RM $export_symbols + eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from '$dlprefile'" + func_basename "$dlprefile" + name=$func_basename_result + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename= + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname"; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename=$func_basename_result + else + # no lafile. user explicitly requested -dlpreopen <import library>. + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename"; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 </dev/null >/dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + func_show_eval '$RM "${nlist}I"' + if test -n "$global_symbol_to_import"; then + eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[];\ +" + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ +static void lt_syminit(void) +{ + LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; + for (; symbol->name; ++symbol) + {" + $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" + echo >> "$output_objdir/$my_dlsyms" "\ + } +}" + fi + echo >> "$output_objdir/$my_dlsyms" "\ +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{ {\"$my_originator\", (void *) 0}," + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ + {\"@INIT@\", (void *) <_syminit}," + fi + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + $my_pic_p && pic_flag_for_symtable=" $pic_flag" + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' + + # Transform the symbol file into the correct name. + symfileobj=$output_objdir/${my_outputname}S.$objext + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for '$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $debug_cmd + + win32_libid_type=unknown + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + case $nm_interface in + "MS dumpbin") + if func_cygming_ms_implib_p "$1" || + func_cygming_gnu_implib_p "$1" + then + win32_nmres=import + else + win32_nmres= + fi + ;; + *) + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s|.*|import| + p + q + } + }'` + ;; + esac + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $debug_cmd + + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $debug_cmd + + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive that possess that section. Heuristic: eliminate + # all those that have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $debug_cmd + + if func_cygming_gnu_implib_p "$1"; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1"; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result= + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $debug_cmd + + f_ex_an_ar_dir=$1; shift + f_ex_an_ar_oldlib=$1 + if test yes = "$lock_old_archive_extraction"; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test yes = "$lock_old_archive_extraction"; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $debug_cmd + + my_gentop=$1; shift + my_oldlibs=${1+"$@"} + my_oldobjs= + my_xlib= + my_xabs= + my_xdir= + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib=$func_basename_result + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir=$my_gentop/$my_xlib_u + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + func_basename "$darwin_archive" + darwin_base_archive=$func_basename_result + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches; do + func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" + $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" + cd "unfat-$$/$darwin_base_archive-$darwin_arch" + func_extract_an_archive "`pwd`" "$darwin_base_archive" + cd "$darwin_curdir" + $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result=$my_oldobjs +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory where it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ that is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options that match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test yes = "$fast_install"; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + \$ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat <<EOF + +/* $cwrappersource - temporary wrapper executable for $objdir/$outputname + Generated by $PROGRAM (GNU $PACKAGE) $VERSION + + The $output program cannot be directly executed until all the libtool + libraries that it depends on are installed. + + This wrapper executable should never be moved out of the build directory. + If it is, it will not operate correctly. +*/ +EOF + cat <<"EOF" +#ifdef _MSC_VER +# define _CRT_SECURE_NO_DEPRECATE 1 +#endif +#include <stdio.h> +#include <stdlib.h> +#ifdef _MSC_VER +# include <direct.h> +# include <process.h> +# include <io.h> +#else +# include <unistd.h> +# include <stdint.h> +# ifdef __CYGWIN__ +# include <io.h> +# endif +#endif +#include <malloc.h> +#include <stdarg.h> +#include <assert.h> +#include <string.h> +#include <ctype.h> +#include <errno.h> +#include <fcntl.h> +#include <sys/stat.h> + +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + +/* declarations of non-ANSI functions */ +#if defined __MINGW32__ +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined __CYGWIN__ +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined other_platform || defined ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined _MSC_VER +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +#elif defined __MINGW32__ +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined __CYGWIN__ +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined other platforms ... */ +#endif + +#if defined PATH_MAX +# define LT_PATHMAX PATH_MAX +#elif defined MAXPATHLEN +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ + defined __OS2__ +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free (stale); stale = 0; } \ +} while (0) + +#if defined LT_DEBUGWRAPPER +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <<EOF +#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) +# define externally_visible volatile +#else +# define externally_visible __attribute__((externally_visible)) volatile +#endif +externally_visible const char * MAGIC_EXE = "$magic_exe"; +const char * LIB_PATH_VARNAME = "$shlibpath_var"; +EOF + + if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + func_to_host_path "$temp_rpath" + cat <<EOF +const char * LIB_PATH_VALUE = "$func_to_host_path_result"; +EOF + else + cat <<"EOF" +const char * LIB_PATH_VALUE = ""; +EOF + fi + + if test -n "$dllsearchpath"; then + func_to_host_path "$dllsearchpath:" + cat <<EOF +const char * EXE_PATH_VARNAME = "PATH"; +const char * EXE_PATH_VALUE = "$func_to_host_path_result"; +EOF + else + cat <<"EOF" +const char * EXE_PATH_VARNAME = ""; +const char * EXE_PATH_VALUE = ""; +EOF + fi + + if test yes = "$fast_install"; then + cat <<EOF +const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */ +EOF + else + cat <<EOF +const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */ +EOF + fi + + + cat <<"EOF" + +#define LTWRAPPER_OPTION_PREFIX "--lt-" + +static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX; +static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script"; +static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug"; + +int +main (int argc, char *argv[]) +{ + char **newargz; + int newargc; + char *tmp_pathspec; + char *actual_cwrapper_path; + char *actual_cwrapper_name; + char *target_name; + char *lt_argv_zero; + int rval = 127; + + int i; + + program_name = (char *) xstrdup (base_name (argv[0])); + newargz = XMALLOC (char *, (size_t) argc + 1); + + /* very simple arg parsing; don't want to rely on getopt + * also, copy all non cwrapper options to newargz, except + * argz[0], which is handled differently + */ + newargc=0; + for (i = 1; i < argc; i++) + { + if (STREQ (argv[i], dumpscript_opt)) + { +EOF + case $host in + *mingw* | *cygwin* ) + # make stdout use "unix" line endings + echo " setmode(1,_O_BINARY);" + ;; + esac + + cat <<"EOF" + lt_dump_script (stdout); + return 0; + } + if (STREQ (argv[i], debug_opt)) + { + lt_debug = 1; + continue; + } + if (STREQ (argv[i], ltwrapper_option_prefix)) + { + /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX + namespace, but it is not one of the ones we know about and + have already dealt with, above (inluding dump-script), then + report an error. Otherwise, targets might begin to believe + they are allowed to use options in the LTWRAPPER_OPTION_PREFIX + namespace. The first time any user complains about this, we'll + need to make LTWRAPPER_OPTION_PREFIX a configure-time option + or a configure.ac-settable value. + */ + lt_fatal (__FILE__, __LINE__, + "unrecognized %s option: '%s'", + ltwrapper_option_prefix, argv[i]); + } + /* otherwise ... */ + newargz[++newargc] = xstrdup (argv[i]); + } + newargz[++newargc] = NULL; + +EOF + cat <<EOF + /* The GNU banner must be the first non-error debug message */ + lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n"); +EOF + cat <<"EOF" + lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]); + lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name); + + tmp_pathspec = find_executable (argv[0]); + if (tmp_pathspec == NULL) + lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]); + lt_debugprintf (__FILE__, __LINE__, + "(main) found exe (before symlink chase) at: %s\n", + tmp_pathspec); + + actual_cwrapper_path = chase_symlinks (tmp_pathspec); + lt_debugprintf (__FILE__, __LINE__, + "(main) found exe (after symlink chase) at: %s\n", + actual_cwrapper_path); + XFREE (tmp_pathspec); + + actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path)); + strendzap (actual_cwrapper_path, actual_cwrapper_name); + + /* wrapper name transforms */ + strendzap (actual_cwrapper_name, ".exe"); + tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1); + XFREE (actual_cwrapper_name); + actual_cwrapper_name = tmp_pathspec; + tmp_pathspec = 0; + + /* target_name transforms -- use actual target program name; might have lt- prefix */ + target_name = xstrdup (base_name (TARGET_PROGRAM_NAME)); + strendzap (target_name, ".exe"); + tmp_pathspec = lt_extend_str (target_name, ".exe", 1); + XFREE (target_name); + target_name = tmp_pathspec; + tmp_pathspec = 0; + + lt_debugprintf (__FILE__, __LINE__, + "(main) libtool target name: %s\n", + target_name); +EOF + + cat <<EOF + newargz[0] = + XMALLOC (char, (strlen (actual_cwrapper_path) + + strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1)); + strcpy (newargz[0], actual_cwrapper_path); + strcat (newargz[0], "$objdir"); + strcat (newargz[0], "/"); +EOF + + cat <<"EOF" + /* stop here, and copy so we don't have to do this twice */ + tmp_pathspec = xstrdup (newargz[0]); + + /* do NOT want the lt- prefix here, so use actual_cwrapper_name */ + strcat (newargz[0], actual_cwrapper_name); + + /* DO want the lt- prefix here if it exists, so use target_name */ + lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1); + XFREE (tmp_pathspec); + tmp_pathspec = NULL; +EOF + + case $host_os in + mingw*) + cat <<"EOF" + { + char* p; + while ((p = strchr (newargz[0], '\\')) != NULL) + { + *p = '/'; + } + while ((p = strchr (lt_argv_zero, '\\')) != NULL) + { + *p = '/'; + } + } +EOF + ;; + esac + + cat <<"EOF" + XFREE (target_name); + XFREE (actual_cwrapper_path); + XFREE (actual_cwrapper_name); + + lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */ + lt_setenv ("DUALCASE", "1"); /* for MSK sh */ + /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must + be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath) + because on Windows, both *_VARNAMEs are PATH but uninstalled + libraries must come first. */ + lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE); + lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE); + + lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n", + nonnull (lt_argv_zero)); + for (i = 0; i < newargc; i++) + { + lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n", + i, nonnull (newargz[i])); + } + +EOF + + case $host_os in + mingw*) + cat <<"EOF" + /* execv doesn't actually work on mingw as expected on unix */ + newargz = prepare_spawn (newargz); + rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); + if (rval == -1) + { + /* failed to start process */ + lt_debugprintf (__FILE__, __LINE__, + "(main) failed to launch target \"%s\": %s\n", + lt_argv_zero, nonnull (strerror (errno))); + return 127; + } + return rval; +EOF + ;; + *) + cat <<"EOF" + execv (lt_argv_zero, newargz); + return rval; /* =127, but avoids unused variable warning */ +EOF + ;; + esac + + cat <<"EOF" +} + +void * +xmalloc (size_t num) +{ + void *p = (void *) malloc (num); + if (!p) + lt_fatal (__FILE__, __LINE__, "memory exhausted"); + + return p; +} + +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), + string) : NULL; +} + +const char * +base_name (const char *name) +{ + const char *base; + +#if defined HAVE_DOS_BASED_FILE_SYSTEM + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha ((unsigned char) name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return base; +} + +int +check_executable (const char *path) +{ + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + size_t tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined HAVE_DOS_BASED_FILE_SYSTEM + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined HAVE_DOS_BASED_FILE_SYSTEM + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = (size_t) (q - p); + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (STREQ (str, pat)) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + size_t len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + size_t orig_value_len = strlen (orig_value); + size_t add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + size_t len = strlen (new_value); + while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[--len] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $debug_cmd + + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_suncc_cstd_abi +# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! +# Several compiler flags select an ABI that is incompatible with the +# Cstd library. Avoid specifying it if any are in CXXFLAGS. +func_suncc_cstd_abi () +{ + $debug_cmd + + case " $compile_command " in + *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) + suncc_use_cstd_abi=no + ;; + *) + suncc_use_cstd_abi=yes + ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $debug_cmd + + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # what system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll that has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + os2dllname= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=false + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module=$wl-single_module + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test yes != "$build_libtool_libs" \ + && func_fatal_configuration "cannot build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg=$1 + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir=$arg + prev= + continue + ;; + dlfiles|dlprefiles) + $preload || { + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=: + } + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test no = "$dlself"; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test dlprefiles = "$prev"; then + dlself=yes + elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test dlfiles = "$prev"; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols=$arg + test -f "$arg" \ + || func_fatal_error "symbol file '$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex=$arg + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir=$arg + prev= + continue + ;; + mllvm) + # Clang does not use LLVM to link, so we can simply discard any + # '-mllvm $arg' options when doing the link step. + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + if test none != "$pic_object"; then + # Prepend the subdirectory the object is found in. + pic_object=$xdir$pic_object + + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=$pic_object + fi + + # Non-PIC object. + if test none != "$non_pic_object"; then + # Prepend the subdirectory the object is found in. + non_pic_object=$xdir$non_pic_object + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object=$pic_object + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "'$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file '$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + os2dllname) + os2dllname=$arg + prev= + continue + ;; + precious_regex) + precious_files_regex=$arg + prev= + continue + ;; + release) + release=-$arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test rpath = "$prev"; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds=$arg + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg=$arg + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "'-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test X-export-symbols = "X$arg"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between '-L' and '$1'" + else + func_fatal_error "need path for '-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of '$dir'" + dir=$absdir + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test X-lc = "X$arg" || test X-lm = "X$arg"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test X-lc = "X$arg" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + # Do not include libc due to us having libc/libc_r. + test X-lc = "X$arg" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test X-lc = "X$arg" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test X-lc = "X$arg" && continue + ;; + esac + elif test X-lc_r = "X$arg"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -mllvm) + prev=mllvm + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module=$wl-multi_module + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "'-no-install' is ignored for $host" + func_warning "assuming '-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -os2dllname) + prev=os2dllname + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs=$IFS; IFS=, + for flag in $args; do + IFS=$save_ifs + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done + IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs=$IFS; IFS=, + for flag in $args; do + IFS=$save_ifs + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done + IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # -fstack-protector* stack protector flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -stdlib=* select c++ std lib with clang + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ + -fopenacc|-fopenmp|-ftree-parallelize-loops=*|-fcilkplus|-fgnu-tm| \ + -ffast-math|-funsafe-math-optimizations|-fvtable-verify*| \ + -shared-libgcc|-static-libgcc|-static-libgfortran|-static-libstdc++) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + -Z*) + if test os2 = "`expr $host : '.*\(os2\)'`"; then + # OS/2 uses -Zxxx to specify OS/2-specific options + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case $arg in + -Zlinker | -Zstack) + prev=xcompiler + ;; + esac + continue + else + # Otherwise treat like 'Some other compiler flag' below + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + fi + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + test none = "$pic_object" || { + # Prepend the subdirectory the object is found in. + pic_object=$xdir$pic_object + + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=$pic_object + } + + # Non-PIC object. + if test none != "$non_pic_object"; then + # Prepend the subdirectory the object is found in. + non_pic_object=$xdir$non_pic_object + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object=$pic_object + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "'$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test dlfiles = "$prev"; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test dlprefiles = "$prev"; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the '$prevarg' option requires an argument" + + if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname=$func_basename_result + libobjs_save=$libobjs + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + # Definition is injected by LT_CONFIG during libtool generation. + func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" + + func_dirname "$output" "/" "" + output_objdir=$func_dirname_result$objdir + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_preserve_dup_deps; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append libs " $deplib" + done + + if test lib = "$linkmode"; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append pre_post_deps " $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=false + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test lib,link = "$linkmode,$pass"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs=$tmp_deplibs + fi + + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass"; then + libs=$deplibs + deplibs= + fi + if test prog = "$linkmode"; then + case $pass in + dlopen) libs=$dlfiles ;; + dlpreopen) libs=$dlprefiles ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test lib,dlpreopen = "$linkmode,$pass"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs=$dlprefiles + fi + if test dlopen = "$pass"; then + # Collect dlpreopened libraries + save_deplibs=$deplibs + deplibs= + fi + + for deplib in $libs; do + lib= + found=false + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test lib = "$linkmode"; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test lib != "$linkmode" && test prog != "$linkmode"; then + func_warning "'-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test lib = "$linkmode"; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib=$searchdir/lib$name$search_ext + if test -f "$lib"; then + if test .la = "$search_ext"; then + found=: + else + found=false + fi + break 2 + fi + done + done + if $found; then + # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll=$l + done + if test "X$ll" = "X$old_library"; then # only static version available + found=false + func_dirname "$lib" "" "." + ladir=$func_dirname_result + lib=$ladir/$old_library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + else + # deplib doesn't seem to be a libtool library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + ;; # -l + *.ltframework) + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test lib = "$linkmode"; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test conv = "$pass" && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + continue + fi + if test scan = "$pass"; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "'-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test link = "$pass"; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=false + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=: + fi + ;; + pass_all) + valid_a_lib=: + ;; + esac + if $valid_a_lib; then + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + else + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + fi + ;; + esac + continue + ;; + prog) + if test link != "$pass"; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + elif test prog = "$linkmode"; then + if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=: + continue + ;; + esac # case $deplib + + $found || test -f "$lib" \ + || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "'$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir=$func_dirname_result + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass" || + { test prog != "$linkmode" && test lib != "$linkmode"; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test conv = "$pass"; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for '$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + elif test prog != "$linkmode" && test lib != "$linkmode"; then + func_fatal_error "'$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test yes = "$prefer_static_libs" || + test built,no = "$prefer_static_libs,$installed"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib=$l + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for '$lib'" + fi + + # This library was specified with -dlopen. + if test dlopen = "$pass"; then + test -z "$libdir" \ + && func_fatal_error "cannot -dlopen a convenience library: '$lib'" + if test -z "$dlname" || + test yes != "$dlopen_support" || + test no = "$build_libtool_libs" + then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + func_append dlprefiles " $lib $dependency_libs" + else + func_append newdlfiles " $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of '$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir=$ladir + fi + ;; + esac + func_basename "$lib" + laname=$func_basename_result + + # Find the relevant object directory and library name. + if test yes = "$installed"; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library '$lib' was moved." + dir=$ladir + absdir=$abs_ladir + libdir=$abs_ladir + else + dir=$lt_sysroot$libdir + absdir=$lt_sysroot$libdir + fi + test yes = "$hardcode_automatic" && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir=$ladir + absdir=$abs_ladir + # Remove this search path later + func_append notinst_path " $abs_ladir" + else + dir=$ladir/$objdir + absdir=$abs_ladir/$objdir + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test dlpreopen = "$pass"; then + if test -z "$libdir" && test prog = "$linkmode"; then + func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" + fi + case $host in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test lib = "$linkmode"; then + deplibs="$dir/$old_library $deplibs" + elif test prog,link = "$linkmode,$pass"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test prog = "$linkmode" && test link != "$pass"; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=false + if test no != "$link_all_deplibs" || test -z "$library_names" || + test no = "$build_libtool_libs"; then + linkalldeplibs=: + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? + if $linkalldeplibs; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test prog,link = "$linkmode,$pass"; then + if test -n "$library_names" && + { { test no = "$prefer_static_libs" || + test built,yes = "$prefer_static_libs,$installed"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then + # Make sure the rpath contains only unique directories. + case $temp_rpath: in + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if $alldeplibs && + { test pass_all = "$deplibs_check_method" || + { test yes = "$build_libtool_libs" && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test built = "$use_static_libs" && test yes = "$installed"; then + use_static_libs=no + fi + if test -n "$library_names" && + { test no = "$use_static_libs" || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc* | *os2*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test no = "$installed"; then + func_append notinst_deplibs " $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule= + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule=$dlpremoduletest + break + fi + done + if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then + echo + if test prog = "$linkmode"; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test lib = "$linkmode" && + test yes = "$hardcode_into_libs"; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname=$1 + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname=$dlname + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc* | *os2*) + func_arith $current - $age + major=$func_arith_result + versuffix=-$major + ;; + esac + eval soname=\"$soname_spec\" + else + soname=$realname + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot=$soname + func_basename "$soroot" + soname=$func_basename_result + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from '$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for '$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test prog = "$linkmode" || test relink != "$opt_mode"; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test no = "$hardcode_direct"; then + add=$dir/$linklib + case $host in + *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; + *-*-sysv4*uw2*) add_dir=-L$dir ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir=-L$dir ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we cannot + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library"; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add=$dir/$old_library + fi + elif test -n "$old_library"; then + add=$dir/$old_library + fi + fi + esac + elif test no = "$hardcode_minus_L"; then + case $host in + *-*-sunos*) add_shlibpath=$dir ;; + esac + add_dir=-L$dir + add=-l$name + elif test no = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name + else + lib_linked=no + fi + ;; + relink) + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$dir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$absdir + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test yes != "$lib_linked"; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test prog = "$linkmode"; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test yes != "$hardcode_direct" && + test yes != "$hardcode_minus_L" && + test yes = "$hardcode_shlibpath_var"; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test prog = "$linkmode" || test relink = "$opt_mode"; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$libdir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$libdir + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add=-l$name + elif test yes = "$hardcode_automatic"; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib"; then + add=$inst_prefix_dir$libdir/$linklib + else + add=$libdir/$linklib + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir=-L$libdir + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add=-l$name + fi + + if test prog = "$linkmode"; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test prog = "$linkmode"; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test unsupported != "$hardcode_direct"; then + test -n "$old_library" && linklib=$old_library + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test yes = "$build_libtool_libs"; then + # Not a shared library + if test pass_all != "$deplibs_check_method"; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system cannot link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test yes = "$module"; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** 'nm' from GNU binutils and a full rebuild may help." + fi + if test no = "$build_old_libs"; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test lib = "$linkmode"; then + if test -n "$dependency_libs" && + { test yes != "$hardcode_into_libs" || + test yes = "$build_old_libs" || + test yes = "$link_static"; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs=$temp_deplibs + fi + + func_append newlib_search_path " $absdir" + # Link against this library + test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test no != "$link_all_deplibs"; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path=$deplib ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of '$dir'" + absdir=$dir + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names"; then + for tmp in $deplibrary_names; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl"; then + depdepl=$absdir/$objdir/$depdepl + darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" + func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" + path= + fi + fi + ;; + *) + path=-L$absdir/$objdir + ;; + esac + else + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "'$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "'$deplib' seems to be moved" + + path=-L$absdir + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test link = "$pass"; then + if test prog = "$linkmode"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs=$newdependency_libs + if test dlpreopen = "$pass"; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test dlopen != "$pass"; then + test conv = "$pass" || { + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path= + } + + if test prog,link = "$linkmode,$pass"; then + vars="compile_deplibs finalize_deplibs" + else + vars=deplibs + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append tmp_libs " $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + + # Add Sun CC postdeps if required: + test CXX = "$tagname" && { + case $host_os in + linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C++ 5.9 + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + + solaris*) + func_cc_basename "$CC" + case $func_cc_basename_result in + CC* | sunCC*) + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + esac + } + + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i= + ;; + esac + if test -n "$i"; then + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test prog = "$linkmode"; then + dlfiles=$newdlfiles + fi + if test prog = "$linkmode" || test lib = "$linkmode"; then + dlprefiles=$newdlprefiles + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "'-l' and '-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "'-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "'-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "'-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "'-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "'-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs=$output + func_append objs "$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form 'libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test no = "$module" \ + && func_fatal_help "libtool library '$output' must begin with 'lib'" + + if test no != "$need_lib_prefix"; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test pass_all != "$deplibs_check_method"; then + func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + func_append libobjs " $objs" + fi + fi + + test no = "$dlself" \ + || func_warning "'-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test 1 -lt "$#" \ + && func_warning "ignoring multiple '-rpath's for a libtool library" + + install_libdir=$1 + + oldlibs= + if test -z "$rpath"; then + if test yes = "$build_libtool_libs"; then + # Building a libtool convenience library. + # Some compilers have problems with a '.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "'-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "'-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs=$IFS; IFS=: + set dummy $vinfo 0 0 0 + shift + IFS=$save_ifs + + test -n "$7" && \ + func_fatal_help "too many parameters to '-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major=$1 + number_minor=$2 + number_revision=$3 + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # that has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|freebsd-elf|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age=$number_minor + revision=$number_revision + ;; + freebsd-aout|qnx|sunos) + current=$number_major + revision=$number_minor + age=0 + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age=$number_minor + revision=$number_minor + lt_irix_increment=no + ;; + esac + ;; + no) + current=$1 + revision=$2 + age=$3 + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT '$current' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION '$revision' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE '$age' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE '$age' is greater than the current interface number '$current'" + func_fatal_error "'$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + # On Darwin other compilers + case $CC in + nagfor*) + verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + ;; + *) + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + esac + ;; + + freebsd-aout) + major=.$current + versuffix=.$current.$revision + ;; + + freebsd-elf) + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + ;; + + irix | nonstopux) + if test no = "$lt_irix_increment"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring=$verstring_prefix$major.$revision + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test 0 -ne "$loop"; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring=$verstring_prefix$major.$iface:$verstring + done + + # Before this point, $major must not contain '.'. + major=.$major + versuffix=$major.$revision + ;; + + linux) # correct to gnu/linux during the next big refactor + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=.$current.$age.$revision + verstring=$current.$age.$revision + + # Add in all the interfaces that we are compatible with. + loop=$age + while test 0 -ne "$loop"; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring=$verstring:$iface.0 + done + + # Make executables depend on our current version. + func_append verstring ":$current.0" + ;; + + qnx) + major=.$current + versuffix=.$current + ;; + + sco) + major=.$current + versuffix=.$current + ;; + + sunos) + major=.$current + versuffix=.$current.$revision + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 file systems. + func_arith $current - $age + major=$func_arith_result + versuffix=-$major + ;; + + *) + func_fatal_configuration "unknown library version type '$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring=0.0 + ;; + esac + if test no = "$need_version"; then + versuffix= + else + versuffix=.0.0 + fi + fi + + # Remove version info from name if versioning should be avoided + if test yes,no = "$avoid_version,$need_version"; then + major= + versuffix= + verstring= + fi + + # Check to see if the archive will have undefined symbols. + if test yes = "$allow_undefined"; then + if test unsupported = "$allow_undefined_flag"; then + if test yes = "$build_old_libs"; then + func_warning "undefined symbols not allowed in $host shared libraries; building static only" + build_libtool_libs=no + else + func_fatal_error "can't build $host shared library unless -no-undefined is specified" + fi + fi + else + # Don't allow undefined symbols. + allow_undefined_flag=$no_undefined_flag + fi + + fi + + func_generate_dlsyms "$libname" "$libname" : + func_append libobjs " $symfileobj" + test " " = "$libobjs" && libobjs= + + if test relink != "$opt_mode"; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) + if test -n "$precious_files_regex"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles=$dlfiles + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) func_append dlfiles " $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles=$dlprefiles + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test yes = "$build_libtool_libs"; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test yes = "$build_libtool_need_lc"; then + func_append deplibs " -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release= + versuffix= + major= + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c <<EOF + int main() { return 0; } +EOF + $opt_dry_run || $RM conftest + if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then + ldd_output=`ldd conftest` + for i in $deplibs; do + case $i in + -l*) + func_stripname -l '' "$i" + name=$func_stripname_result + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $i "*) + func_append newdeplibs " $i" + i= + ;; + esac + fi + if test -n "$i"; then + libname=`eval "\\$ECHO \"$libname_spec\""` + deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` + set dummy $deplib_matches; shift + deplib_match=$1 + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then + func_append newdeplibs " $i" + else + droppeddeps=yes + echo + $ECHO "*** Warning: dynamic linker does not accept needed library $i." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which I believe you do not have" + echo "*** because a test_compile did reveal that the linker did not use it for" + echo "*** its dynamic dependency list that programs get resolved with at runtime." + fi + fi + ;; + *) + func_append newdeplibs " $i" + ;; + esac + done + else + # Error occurred in the first compile. Let's try to salvage + # the situation: Compile a separate program for each library. + for i in $deplibs; do + case $i in + -l*) + func_stripname -l '' "$i" + name=$func_stripname_result + $opt_dry_run || $RM conftest + if $LTCC $LTCFLAGS -o conftest conftest.c $i; then + ldd_output=`ldd conftest` + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $i "*) + func_append newdeplibs " $i" + i= + ;; + esac + fi + if test -n "$i"; then + libname=`eval "\\$ECHO \"$libname_spec\""` + deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` + set dummy $deplib_matches; shift + deplib_match=$1 + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then + func_append newdeplibs " $i" + else + droppeddeps=yes + echo + $ECHO "*** Warning: dynamic linker does not accept needed library $i." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because a test_compile did reveal that the linker did not use this one" + echo "*** as a dynamic dependency that programs can get resolved with at runtime." + fi + fi + else + droppeddeps=yes + echo + $ECHO "*** Warning! Library $i is needed by this library but I was not able to" + echo "*** make it link in! You will probably need to install it or some" + echo "*** library that it depends on before this library will be fully" + echo "*** functional. Installing it before continuing would be even better." + fi + ;; + *) + func_append newdeplibs " $i" + ;; + esac + done + fi + ;; + file_magic*) + set dummy $deplibs_check_method; shift + file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib= + ;; + esac + fi + if test -n "$a_deplib"; then + libname=`eval "\\$ECHO \"$libname_spec\""` + if test -n "$file_magic_glob"; then + libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` + else + libnameglob=$libname + fi + test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + if test yes = "$want_nocaseglob"; then + shopt -s nocaseglob + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib=$potent_lib + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | $SED 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; + *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib= + break 2 + fi + done + done + fi + if test -n "$a_deplib"; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib"; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib= + ;; + esac + fi + if test -n "$a_deplib"; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib=$potent_lib # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib= + break 2 + fi + done + done + fi + if test -n "$a_deplib"; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib"; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs= + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + for i in $predeps $postdeps; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test none = "$deplibs_check_method"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test yes = "$droppeddeps"; then + if test yes = "$module"; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** 'nm' from GNU binutils and a full rebuild may help." + fi + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test no = "$allow_undefined"; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + deplibs=$new_libs + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test yes = "$build_libtool_libs"; then + # Remove $wl instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac + if test yes = "$hardcode_into_libs"; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath=$finalize_rpath + test relink = "$opt_mode" || rpath=$compile_rpath$rpath + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath=$finalize_shlibpath + test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname=$1 + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname=$realname + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib=$output_objdir/$realname + linknames= + for link + do + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols=$output_objdir/$libname.uexp + func_append delfiles " $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + func_dll_def_p "$export_symbols" || { + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols=$export_symbols + export_symbols= + always_export_symbols=yes + } + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs=$IFS; IFS='~' + for cmd1 in $cmds; do + IFS=$save_ifs + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test yes = "$try_normal_branch" \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=$output_objdir/$output_la.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS=$save_ifs + if test -n "$export_symbols_regex" && test : != "$skipped_export"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test : != "$skipped_export" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands, which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs=$tmp_deplibs + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test yes = "$compiler_needs_object" && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test relink = "$opt_mode"; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test yes = "$module" && test -n "$module_cmds"; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test : != "$skipped_export" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then + output=$output_objdir/$output_la.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then + output=$output_objdir/$output_la.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test yes = "$compiler_needs_object"; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-$k.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test -z "$objlist" || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test 1 -eq "$k"; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-$k.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-$k.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output= + fi + + ${skipped_export-false} && { + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + } + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs=$IFS; IFS='~' + for cmd in $concat_cmds; do + IFS=$save_ifs + $opt_quiet || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS=$save_ifs + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + ${skipped_export-false} && { + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands, which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + } + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test yes = "$module" && test -n "$module_cmds"; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs=$IFS; IFS='~' + for cmd in $cmds; do + IFS=$sp$nl + eval cmd=\"$cmd\" + IFS=$save_ifs + $opt_quiet || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS=$save_ifs + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test yes = "$module" || test yes = "$export_dynamic"; then + # On all known operating systems, these are identical. + dlname=$soname + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "'-l' and '-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "'-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "'-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "'-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "'-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object '$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj=$output + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # if reload_cmds runs $LD directly, get rid of -Wl from + # whole_archive_flag_spec and hope we can get by with turning comma + # into space. + case $reload_cmds in + *\$LD[\ \$]*) wl= ;; + esac + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags + else + gentop=$output_objdir/${obj}x + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test yes = "$build_libtool_libs" || libobjs=$non_pic_objects + + # Create the old-style object. + reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs + + output=$obj + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + test yes = "$build_libtool_libs" || { + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + } + + if test -n "$pic_flag" || test default != "$pic_mode"; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output=$libobj + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "'-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "'-release' is ignored for programs" + + $preload \ + && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ + && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test CXX = "$tagname"; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " $wl-bind_at_load" + func_append finalize_command " $wl-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs=$new_libs + + + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath=$rpath + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append finalize_perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath=$rpath + + if test -n "$libobjs" && test yes = "$build_old_libs"; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" false + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=: + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=false + ;; + *cygwin* | *mingw* ) + test yes = "$build_libtool_libs" || wrappers_required=false + ;; + *) + if test no = "$need_relink" || test yes != "$build_libtool_libs"; then + wrappers_required=false + fi + ;; + esac + $wrappers_required || { + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command=$compile_command$compile_rpath + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.$objext"; then + func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' + fi + + exit $exit_status + } + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + func_append rpath "$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test yes = "$no_install"; then + # We don't need to create a wrapper script. + link_command=$compile_var$compile_command$compile_rpath + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + exit $EXIT_SUCCESS + fi + + case $hardcode_action,$fast_install in + relink,*) + # Fast installation is not supported + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "'$output' will be relinked during installation" + ;; + *,yes) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + ;; + *,no) + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + ;; + *,needless) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command= + ;; + esac + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource=$output_path/$objdir/lt-$output_name.c + cwrapper=$output_path/$output_name.exe + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host"; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + case $build_libtool_libs in + convenience) + oldobjs="$libobjs_save $symfileobj" + addlibs=$convenience + build_libtool_libs=no + ;; + module) + oldobjs=$libobjs_save + addlibs=$old_convenience + build_libtool_libs=no + ;; + *) + oldobjs="$old_deplibs $non_pic_objects" + $preload && test -f "$symfileobj" \ + && func_append oldobjs " $symfileobj" + addlibs=$old_convenience + ;; + esac + + if test -n "$addlibs"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append oldobjs " $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase=$func_basename_result + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj"; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test -z "$oldobjs"; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test yes = "$build_old_libs" && old_library=$libname.$libext + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test yes = "$hardcode_automatic"; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test yes = "$installed"; then + if test -z "$install_libdir"; then + break + fi + output=$output_objdir/${outputname}i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name=$func_basename_result + func_resolve_sysroot "$deplib" + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "'$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs=$newdependency_libs + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "'$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles=$newdlfiles + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "'$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done + dlprefiles=$newdlprefiles + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done + dlfiles=$newdlfiles + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles=$newdlprefiles + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test -n "$bindir"; then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result/$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that cannot go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test no,yes = "$installed,$need_relink"; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +if test link = "$opt_mode" || test relink = "$opt_mode"; then + func_mode_link ${1+"$@"} +fi + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $debug_cmd + + RM=$nonopt + files= + rmforce=false + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic=$magic + + for arg + do + case $arg in + -f) func_append RM " $arg"; rmforce=: ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir=$func_dirname_result + if test . = "$dir"; then + odir=$objdir + else + odir=$dir/$objdir + fi + func_basename "$file" + name=$func_basename_result + test uninstall = "$opt_mode" && odir=$dir + + # Remember odir for removal later, being careful to avoid duplicates + if test clean = "$opt_mode"; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif $rmforce; then + continue + fi + + rmfiles=$file + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case $opt_mode in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && test none != "$pic_object"; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && test none != "$non_pic_object"; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test clean = "$opt_mode"; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + func_append rmfiles " $odir/$name $odir/${name}S.$objext" + if test yes = "$fast_install" && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" != "X$name"; then + func_append rmfiles " $odir/lt-$noexename.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # Try to remove the $objdir's in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then + func_mode_uninstall ${1+"$@"} +fi + +test -z "$opt_mode" && { + help=$generic_help + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode '$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# where we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/lib/edbee-lib/vendor/onig/m4/libtool.m4 b/lib/edbee-lib/vendor/onig/m4/libtool.m4 new file mode 100644 index 00000000..a3bc337b --- /dev/null +++ b/lib/edbee-lib/vendor/onig/m4/libtool.m4 @@ -0,0 +1,8369 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +]) + +# serial 58 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS=$ltmain + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_PREPARE_CC_BASENAME +# ----------------------- +m4_defun([_LT_PREPARE_CC_BASENAME], [ +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in @S|@*""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} +])# _LT_PREPARE_CC_BASENAME + + +# _LT_CC_BASENAME(CC) +# ------------------- +# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, +# but that macro is also expanded into generated libtool script, which +# arranges for $SED and $ECHO to be set by different means. +m4_defun([_LT_CC_BASENAME], +[m4_require([_LT_PREPARE_CC_BASENAME])dnl +AC_REQUIRE([_LT_DECL_SED])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +func_cc_basename $1 +cc_basename=$func_cc_basename_result +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl +m4_require([_LT_CMD_TRUNCATE])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options that allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld=$lt_cv_prog_gnu_ld + +old_CC=$CC +old_CFLAGS=$CFLAGS + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from 'configure', and 'config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# 'config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain=$ac_aux_dir/ltmain.sh +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the 'libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to 'config.status' so that its +# declaration there will have the same value as in 'configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags='_LT_TAGS'dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into 'config.status', and then the shell code to quote escape them in +# for loops in 'config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# '#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test 0 = "$lt_write_fail" && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +'$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to <bug-libtool@gnu.org>." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test 0 != $[#] +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try '$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try '$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test yes = "$silent" && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + + cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL +# Generated automatically by $as_me ($PACKAGE) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +_LT_COPYING +_LT_LIBTOOL_TAGS + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +_LT_PREPARE_MUNGE_PATH_LIST +_LT_PREPARE_CC_BASENAME + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "$LT_MULTI_MODULE"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS=$save_LDFLAGS + ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[[012]][[,.]]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + fi + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test yes = "$lt_cv_ld_force_load"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + m4_if([$1], [CXX], +[ if test yes != "$lt_cv_apple_cc_single_mod"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script that will find a shell with a builtin +# printf (that we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case $ECHO in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], + [Search for dependent libraries within DIR (or the compiler's sysroot + if not specified).])], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case $with_sysroot in #( + yes) + if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([$with_sysroot]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and where our libraries should be installed.])]) + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test no = "$enable_libtool_lock" || enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE=32 + ;; + *ELF-64*) + HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test yes = "$lt_cv_prog_gnu_ld"; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS=$SAVE_CFLAGS + fi + ;; +*-*solaris*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD=${LD-ld}_sol2 + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks=$enable_libtool_lock +])# _LT_ENABLE_LOCK + + +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[_LT_PROG_AR + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + bitrig* | openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test yes = "[$]$2"; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS +]) + +if test yes = "[$]$2"; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring=ABCD + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test 17 != "$i" # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n "$lt_cv_sys_max_cmd_len"; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test yes = "$cross_compiling"; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen=LoadLibrary + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ + lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen=shl_load], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen=dlopen], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test no = "$lt_cv_dlopen"; then + enable_dlopen=no + else + enable_dlopen=yes + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links=nottested +if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test no = "$hard_links"; then + AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", + [Define to the sub-directory where libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then + + # We can hardcode non-existent directories. + if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && + test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || + test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP"; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_PREPARE_MUNGE_PATH_LIST +# --------------------------- +# Make sure func_munge_path_list() is defined correctly. +m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], +[[# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x@S|@2 in + x) + ;; + *:) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" + ;; + x:*) + eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" + ;; + *) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + esac +} +]])# _LT_PREPARE_PATH_LIST + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test yes = "$GCC"; then + case $host_os in + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary... + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo = "/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +AC_ARG_VAR([LT_SYS_LIBRARY_PATH], +[User-defined run-time library search path.]) + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[[4-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib<name>.so + # instead of lib<name>.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a[(]lib.so.V[)]' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[23]].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], + [Detected run-time system search path for libraries]) +_LT_DECL([], [configure_time_lt_sys_library_path], [2], + [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program that can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$1"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac]) +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program that can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test no = "$withval" || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in + *GNU* | *'with BFD'*) + test no != "$with_gnu_ld" && break + ;; + *) + test yes != "$with_gnu_ld" && break + ;; + esac + fi + done + IFS=$lt_save_ifs +else + lt_cv_path_LD=$LD # Let the user override the test with a path. +fi]) +LD=$lt_cv_path_LD +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +_LT_PATH_LD_GNU +AC_SUBST([LD]) + +_LT_TAGDECL([], [LD], [1], [The linker used to build libraries]) +])# LT_PATH_LD + +# Old names: +AU_ALIAS([AM_PROG_LD], [LT_PATH_LD]) +AU_ALIAS([AC_PROG_LD], [LT_PATH_LD]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_LD], []) +dnl AC_DEFUN([AC_PROG_LD], []) + + +# _LT_PATH_LD_GNU +#- -------------- +m4_defun([_LT_PATH_LD_GNU], +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 </dev/null` in +*GNU* | *'with BFD'*) + lt_cv_prog_gnu_ld=yes + ;; +*) + lt_cv_prog_gnu_ld=no + ;; +esac]) +with_gnu_ld=$lt_cv_prog_gnu_ld +])# _LT_PATH_LD_GNU + + +# _LT_CMD_RELOAD +# -------------- +# find reload flag for linker +# -- PORTME Some linkers may need a different reload flag. +m4_defun([_LT_CMD_RELOAD], +[AC_CACHE_CHECK([for $LD option to reload object files], + lt_cv_ld_reload_flag, + [lt_cv_ld_reload_flag='-r']) +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test yes != "$GCC"; then + reload_cmds=false + fi + ;; + darwin*) + if test yes = "$GCC"; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac +_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl +_LT_TAGDECL([], [reload_cmds], [2])dnl +])# _LT_CMD_RELOAD + + +# _LT_PATH_DD +# ----------- +# find a working dd +m4_defun([_LT_PATH_DD], +[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD], +[printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], +[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi]) +rm -f conftest.i conftest2.i conftest.out]) +])# _LT_PATH_DD + + +# _LT_CMD_TRUNCATE +# ---------------- +# find command to truncate a binary pipe +m4_defun([_LT_CMD_TRUNCATE], +[m4_require([_LT_PATH_DD]) +AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], +[printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) +_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], + [Command to truncate a binary pipe]) +])# _LT_CMD_TRUNCATE + + +# _LT_CHECK_MAGIC_METHOD +# ---------------------- +# how to check for library dependencies +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_MAGIC_METHOD], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +AC_CACHE_CHECK([how to recognize dependent libraries], +lt_cv_deplibs_check_method, +[lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# 'unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[[4-9]]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[[45]]*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM=$NM +else + lt_nm_to_check=${ac_tool_prefix}nm + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break 2 + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS=$lt_save_ifs + done + : ${lt_cv_path_NM=no} +fi]) +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test : != "$DUMPBIN"; then + NM=$DUMPBIN + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test yes != "$lt_cv_path_mainfest_tool"; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# _LT_DLL_DEF_P([FILE]) +# --------------------- +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with func_dll_def_p in the libtool script +AC_DEFUN([_LT_DLL_DEF_P], +[dnl + test DEF = "`$SED -n dnl + -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace + -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments + -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl + -e q dnl Only consider the first "real" line + $1`" dnl +])# _LT_DLL_DEF_P + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM=-lm) + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test ia64 = "$host_cpu"; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], + [Transform the output of nm into a list of symbols to manually relocate]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([nm_interface], [lt_cv_nm_interface], [1], + [The name lister interface]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test yes = "$GXX"; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64, which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test yes = "$GCC"; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64, which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd* | bitrig*) + with_gnu_ld=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test yes = "$lt_use_gnu_ld_interface"; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='$wl' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test ia64 != "$host_cpu"; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach <jrb3@best.com> says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test linux-dietlibc = "$host_os"; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + tcc*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' + ;; + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac + + if test yes = "$GCC"; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + ;; + + hpux10*) + if test yes,no = "$GCC,$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS=$save_LDFLAGS]) + if test yes = "$lt_cv_irix_exported_symbol"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(ld_shlibs, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + osf3*) + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test yes = "$GCC"; then + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. GCC discards it without '$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test yes = "$GCC"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting $shlibpath_var if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC=$CC +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report what library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC=$lt_save_CC +])# _LT_LANG_C_CONFIG + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_caught_CXX_error"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test yes = "$GXX"; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test yes = "$GXX"; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test yes = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='$wl' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac + + if test yes = "$GXX"; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + # The "-G" linker flag allows undefined symbols. + _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach <jrb3@best.com> says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require '-G' NOT '-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no + + _LT_TAGVAR(GCC, $1)=$GXX + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test yes != "$_lt_caught_CXX_error" + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case @S|@2 in + .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; + *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF +]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $prev$p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test x-L = "$p" || + test x-R = "$p"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test no = "$pre_test_object_deps_done"; then + case $prev in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)=$prev$p + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test no = "$pre_test_object_deps_done"; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)=$p + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)=$p + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test no = "$F77"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_disable_F77"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} + CFLAGS=$FFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)=$G77 + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test yes != "$_lt_disable_F77" + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test no = "$FC"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_disable_FC"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} + CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test yes != "$_lt_disable_FC" + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)=$LD +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)=$LD +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code=$lt_simple_compile_test_code + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f "$lt_ac_sed" && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test 10 -lt "$lt_ac_count" && break + lt_ac_count=`expr $lt_ac_count + 1` + if test "$lt_ac_count" -gt "$lt_ac_max"; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine what file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS diff --git a/lib/edbee-lib/vendor/onig/m4/ltoptions.m4 b/lib/edbee-lib/vendor/onig/m4/ltoptions.m4 new file mode 100644 index 00000000..94b08297 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/m4/ltoptions.m4 @@ -0,0 +1,437 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software +# Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 8 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option '$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl 'shared' nor 'disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], + [_LT_WITH_AIX_SONAME([aix])]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the 'shared' and +# 'disable-shared' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the 'static' and +# 'disable-static' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the 'fast-install' +# and 'disable-fast-install' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the 'fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the 'disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_AIX_SONAME([DEFAULT]) +# ---------------------------------- +# implement the --with-aix-soname flag, and support the `aix-soname=aix' +# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT +# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. +m4_define([_LT_WITH_AIX_SONAME], +[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl +shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[[5-9]]*,yes) + AC_MSG_CHECKING([which variant of shared library versioning to provide]) + AC_ARG_WITH([aix-soname], + [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], + [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], + [case $withval in + aix|svr4|both) + ;; + *) + AC_MSG_ERROR([Unknown argument to --with-aix-soname]) + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname], + [AC_CACHE_VAL([lt_cv_with_aix_soname], + [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) + with_aix_soname=$lt_cv_with_aix_soname]) + AC_MSG_RESULT([$with_aix_soname]) + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + +_LT_DECL([], [shared_archive_member_spec], [0], + [Shared archive member basename, for filename based shared library versioning on AIX])dnl +])# _LT_WITH_AIX_SONAME + +LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the 'pic-only' and 'no-pic' +# LT_INIT options. +# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [pic_mode=m4_default([$1], [default])]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) diff --git a/lib/edbee-lib/vendor/onig/m4/ltsugar.m4 b/lib/edbee-lib/vendor/onig/m4/ltsugar.m4 new file mode 100644 index 00000000..48bc9344 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/m4/ltsugar.m4 @@ -0,0 +1,124 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59, which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) diff --git a/lib/edbee-lib/vendor/onig/m4/ltversion.m4 b/lib/edbee-lib/vendor/onig/m4/ltversion.m4 new file mode 100644 index 00000000..fa04b52a --- /dev/null +++ b/lib/edbee-lib/vendor/onig/m4/ltversion.m4 @@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# @configure_input@ + +# serial 4179 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.6]) +m4_define([LT_PACKAGE_REVISION], [2.4.6]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.6' +macro_revision='2.4.6' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff --git a/lib/edbee-lib/vendor/onig/m4/lt~obsolete.m4 b/lib/edbee-lib/vendor/onig/m4/lt~obsolete.m4 new file mode 100644 index 00000000..c6b26f88 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/m4/lt~obsolete.m4 @@ -0,0 +1,99 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software +# Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff --git a/lib/edbee-lib/vendor/onig/missing b/lib/edbee-lib/vendor/onig/missing new file mode 100755 index 00000000..86a8fc31 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/missing @@ -0,0 +1,331 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2012-01-06.13; # UTC + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +\`g' are ignored when checking the name. + +Send bug reports to <bug-automake@gnu.org>." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# normalize program name to check for. +program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). This is about non-GNU programs, so use $1 not +# $program. +case $1 in + lex*|yacc*) + # Not GNU programs, they don't have --version. + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $program in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te*) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison*|yacc*) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG=\${$#} + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex*|flex*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG=\${$#} + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit $? + fi + ;; + + makeinfo*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/lib/edbee-lib/vendor/onig/onig.pri b/lib/edbee-lib/vendor/onig/onig.pri new file mode 100644 index 00000000..134e72b9 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/onig.pri @@ -0,0 +1,90 @@ +!win32:system($$PWD/configure) +INCLUDEPATH += $$PWD +INCLUDEPATH += $$PWD/enc/unicode + +SOURCES += $$PWD/regcomp.c \ + $$PWD/regenc.c \ + $$PWD/regerror.c \ + $$PWD/regexec.c \ + $$PWD/regext.c \ + $$PWD/reggnu.c \ + $$PWD/regparse.c \ + $$PWD/regposerr.c \ + $$PWD/regposix.c \ + $$PWD/regsyntax.c \ + $$PWD/regtrav.c \ + $$PWD/regversion.c \ + $$PWD/st.c \ + $$PWD/enc/ascii.c \ + $$PWD/enc/big5.c \ + $$PWD/enc/cp949.c \ + $$PWD/enc/emacs_mule.c \ + $$PWD/enc/euc_jp.c \ + $$PWD/enc/euc_kr.c \ + $$PWD/enc/euc_tw.c \ + $$PWD/enc/gb18030.c \ + $$PWD/enc/gbk.c \ + $$PWD/enc/iso_8859.h \ + $$PWD/enc/iso_8859_1.c \ + $$PWD/enc/iso_8859_10.c \ + $$PWD/enc/iso_8859_11.c \ + $$PWD/enc/iso_8859_13.c \ + $$PWD/enc/iso_8859_14.c \ + $$PWD/enc/iso_8859_15.c \ + $$PWD/enc/iso_8859_16.c \ + $$PWD/enc/iso_8859_2.c \ + $$PWD/enc/iso_8859_3.c \ + $$PWD/enc/iso_8859_4.c \ + $$PWD/enc/iso_8859_5.c \ + $$PWD/enc/iso_8859_6.c \ + $$PWD/enc/iso_8859_7.c \ + $$PWD/enc/iso_8859_8.c \ + $$PWD/enc/iso_8859_9.c \ + $$PWD/enc/koi8_r.c \ + $$PWD/enc/koi8_u.c \ + $$PWD/enc/shift_jis.c \ + $$PWD/enc/unicode.c \ + $$PWD/enc/us_ascii.c \ + $$PWD/enc/utf_16be.c \ + $$PWD/enc/utf_16le.c \ + $$PWD/enc/utf_32be.c \ + $$PWD/enc/utf_32le.c \ + $$PWD/enc/utf_8.c \ + $$PWD/enc/windows_1250.c \ + $$PWD/enc/windows_1251.c \ + $$PWD/enc/windows_1252.c \ + $$PWD/enc/windows_1253.c \ + $$PWD/enc/windows_1254.c \ + $$PWD/enc/windows_1257.c \ + $$PWD/enc/windows_31j.c + + +## Temporary diabled windows_31j encoding (see: https://github.com/edbee/edbee-lib/issues/9) + + +# $$PWD/testc.c \ +# $$PWD/testu.c \ +# $$PWD/win32/testc.c +# $$PWD/enc/gb2312.c \ +# $$PWD/enc/mktable.c \ + + +HEADERS += $$PWD/config.h \ + $$PWD/enc/unicode/casefold.h \ + $$PWD/onigmo.h \ + $$PWD/onigmognu.h \ + $$PWD/onigmoposix.h \ + $$PWD/regenc.h \ + $$PWD/regint.h \ + $$PWD/regparse.h \ + $$PWD/st.h \ + $$PWD/win32/config.h \ + $$PWD/config-onig-edbee.h + + + +###################################################################### +# Automatically generated by qmake (2.01a) Wed Jan 23 20:33:59 2013 +###################################################################### + +# Input diff --git a/lib/edbee-lib/vendor/onig/onig.pro b/lib/edbee-lib/vendor/onig/onig.pro new file mode 100644 index 00000000..0257498d --- /dev/null +++ b/lib/edbee-lib/vendor/onig/onig.pro @@ -0,0 +1,67 @@ +###################################################################### +# Automatically generated by qmake (2.01a) Wed Jan 23 20:33:59 2013 +###################################################################### + +TEMPLATE = app +TARGET = +DEPENDPATH += . enc win32 +INCLUDEPATH += . + +# Input +HEADERS += config.h \ + oniggnu.h \ + onigposix.h \ + oniguruma.h \ + regenc.h \ + regint.h \ + regparse.h \ + st.h \ + win32/config.h +SOURCES += regcomp.c \ + regenc.c \ + regerror.c \ + regexec.c \ + regext.c \ + reggnu.c \ + regparse.c \ + regposerr.c \ + regposix.c \ + regsyntax.c \ + regtrav.c \ + regversion.c \ + st.c \ + testc.c \ + testu.c \ + enc/ascii.c \ + enc/big5.c \ + enc/cp1251.c \ + enc/euc_jp.c \ + enc/euc_kr.c \ + enc/euc_tw.c \ + enc/gb18030.c \ + enc/iso8859_1.c \ + enc/iso8859_10.c \ + enc/iso8859_11.c \ + enc/iso8859_13.c \ + enc/iso8859_14.c \ + enc/iso8859_15.c \ + enc/iso8859_16.c \ + enc/iso8859_2.c \ + enc/iso8859_3.c \ + enc/iso8859_4.c \ + enc/iso8859_5.c \ + enc/iso8859_6.c \ + enc/iso8859_7.c \ + enc/iso8859_8.c \ + enc/iso8859_9.c \ + enc/koi8.c \ + enc/koi8_r.c \ + enc/mktable.c \ + enc/sjis.c \ + enc/unicode.c \ + enc/utf16_be.c \ + enc/utf16_le.c \ + enc/utf32_be.c \ + enc/utf32_le.c \ + enc/utf8.c \ + win32/testc.c diff --git a/lib/edbee-lib/vendor/onig/onig.xcodeproj/project.pbxproj b/lib/edbee-lib/vendor/onig/onig.xcodeproj/project.pbxproj new file mode 100644 index 00000000..1ead3e87 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/onig.xcodeproj/project.pbxproj @@ -0,0 +1,1384 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + D7BA7D76DAB5DD13389D6332 = { + buildActionMask = 2147483647; + files = ( + ); + generatedFileNames = ( + ); + isa = PBXShellScriptBuildPhase; + name = "Qt Qmake"; + neededFileNames = ( + ); + shellPath = "/bin/sh"; + shellScript = "make\ -C\ /Users/rick/bit/prj/compare/src/vendor/onig\ -f\ \'onig.xcodeproj/qt_makeqmake.mak\'"; + }; + 45A3B531E1A3DD993ADD3125 = { + isa = PBXFileReference; + name = "regcomp.c"; + path = "regcomp.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + A14CD0C98448AA103A28B989 = { + fileRef = "45A3B531E1A3DD993ADD3125"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 0125A2B1F80C4E0DCB8AE0FF = { + isa = PBXFileReference; + name = "regenc.c"; + path = "regenc.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + AD8875711B94E66D3436369E = { + fileRef = "0125A2B1F80C4E0DCB8AE0FF"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 6FE48441EC9A3AA9DAAD6586 = { + isa = PBXFileReference; + name = "regerror.c"; + path = "regerror.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + C4D8A8F084600EE43E260635 = { + fileRef = "6FE48441EC9A3AA9DAAD6586"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + EADAB6E9EA2E2F1D404DF17D = { + isa = PBXFileReference; + name = "regexec.c"; + path = "regexec.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 10D5FEE3F1464F0A19D30B72 = { + fileRef = "EADAB6E9EA2E2F1D404DF17D"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 2AE87BE2DAE39B1811496335 = { + isa = PBXFileReference; + name = "regext.c"; + path = "regext.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 2DAA8557ABEC39A18D55AD64 = { + fileRef = "2AE87BE2DAE39B1811496335"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + EFC47CEEAB84064E42E0A366 = { + isa = PBXFileReference; + name = "reggnu.c"; + path = "reggnu.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 3DF8206800884E30C6CFBA38 = { + fileRef = "EFC47CEEAB84064E42E0A366"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + A05CBE34D16476E409CA74C5 = { + isa = PBXFileReference; + name = "regparse.c"; + path = "regparse.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 5A0B6E73244B9151669A353D = { + fileRef = "A05CBE34D16476E409CA74C5"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 4A7B253CD25D7611D02A69E2 = { + isa = PBXFileReference; + name = "regposerr.c"; + path = "regposerr.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 809BE57B3EDD72B3508441E9 = { + fileRef = "4A7B253CD25D7611D02A69E2"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + B363F2540CFB9049FDD64DF9 = { + isa = PBXFileReference; + name = "regposix.c"; + path = "regposix.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 9C8B131FA4EBB715E63E24AE = { + fileRef = "B363F2540CFB9049FDD64DF9"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + F1F8BA8FD83099467398EE71 = { + isa = PBXFileReference; + name = "regsyntax.c"; + path = "regsyntax.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + FA55922880E907B2E241436D = { + fileRef = "F1F8BA8FD83099467398EE71"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 52D0CCBECBF2BD50F580181D = { + isa = PBXFileReference; + name = "regtrav.c"; + path = "regtrav.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + BBAF4062F90DB909220E6864 = { + fileRef = "52D0CCBECBF2BD50F580181D"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 4AC74F5A71FF4FF04D64B027 = { + isa = PBXFileReference; + name = "regversion.c"; + path = "regversion.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 2ED7809978D2C58080C00BF7 = { + fileRef = "4AC74F5A71FF4FF04D64B027"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 7875E170ADA1A2B62A8C8798 = { + isa = PBXFileReference; + name = "st.c"; + path = "st.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 867C776EB81CD557E7FDE8EA = { + fileRef = "7875E170ADA1A2B62A8C8798"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + D0D31F40E09615ABA8EA0EEE = { + isa = PBXFileReference; + name = "testc.c"; + path = "testc.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 1DA4FBD0A7EA06786F484181 = { + fileRef = "D0D31F40E09615ABA8EA0EEE"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 6EFF105266156A788611A107 = { + isa = PBXFileReference; + name = "testu.c"; + path = "testu.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 92312AC9E4C7EE90584EF9B3 = { + fileRef = "6EFF105266156A788611A107"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 01D1D4737A1609807EEC6323 = { + isa = PBXFileReference; + name = "ascii.c"; + path = "enc/ascii.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + AD99EFB77D80649A7AD07414 = { + fileRef = "01D1D4737A1609807EEC6323"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 8A5CE5A2F0109864325EE936 = { + isa = PBXFileReference; + name = "big5.c"; + path = "enc/big5.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + C1E6E097D79769394623CDA2 = { + fileRef = "8A5CE5A2F0109864325EE936"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 237988C4CFAA8A390CE6CD09 = { + isa = PBXFileReference; + name = "cp1251.c"; + path = "enc/cp1251.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + DB3D0B300CA0968E876B661A = { + fileRef = "237988C4CFAA8A390CE6CD09"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 6D584F6591197182AB045974 = { + isa = PBXFileReference; + name = "euc_jp.c"; + path = "enc/euc_jp.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + D104CC2E2D1F8E607A424717 = { + fileRef = "6D584F6591197182AB045974"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 3634380D2562B6D376460530 = { + isa = PBXFileReference; + name = "euc_kr.c"; + path = "enc/euc_kr.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + F0C93E60E271D771ACC59DD4 = { + fileRef = "3634380D2562B6D376460530"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + C2F874DB54D5DAE2510463F8 = { + isa = PBXFileReference; + name = "euc_tw.c"; + path = "enc/euc_tw.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 201AEDEB948305AAADB1CD74 = { + fileRef = "C2F874DB54D5DAE2510463F8"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 6E8C0DA9E7161926BCED070D = { + isa = PBXFileReference; + name = "gb18030.c"; + path = "enc/gb18030.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + DDA182C9017D8C9E833E8F30 = { + fileRef = "6E8C0DA9E7161926BCED070D"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + CF26CC5676C5C376F3C07F76 = { + isa = PBXFileReference; + name = "iso8859_1.c"; + path = "enc/iso8859_1.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + AAF062E6A672D3B82B8B6B9F = { + fileRef = "CF26CC5676C5C376F3C07F76"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + E85DDEF2771671A8E6853D7D = { + isa = PBXFileReference; + name = "iso8859_10.c"; + path = "enc/iso8859_10.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 4828C0848688847E75C667BF = { + fileRef = "E85DDEF2771671A8E6853D7D"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + F3407363A9E293F0F54769F5 = { + isa = PBXFileReference; + name = "iso8859_11.c"; + path = "enc/iso8859_11.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 54464B92F6CA479657E3A4B0 = { + fileRef = "F3407363A9E293F0F54769F5"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 3A9FCA92A8A69DB5B4B34F8C = { + isa = PBXFileReference; + name = "iso8859_13.c"; + path = "enc/iso8859_13.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 2EC2F2218022BA4E175FD18D = { + fileRef = "3A9FCA92A8A69DB5B4B34F8C"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + C1C56D9576862FAD78C5D192 = { + isa = PBXFileReference; + name = "iso8859_14.c"; + path = "enc/iso8859_14.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 8975DDF36B2D4673C3917F65 = { + fileRef = "C1C56D9576862FAD78C5D192"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + CF57BC380E358CFC0011750B = { + isa = PBXFileReference; + name = "iso8859_15.c"; + path = "enc/iso8859_15.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 720DB52247832495CE52686E = { + fileRef = "CF57BC380E358CFC0011750B"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + CB1A8356DD6D92978A131F65 = { + isa = PBXFileReference; + name = "iso8859_16.c"; + path = "enc/iso8859_16.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 673F365E152F029005883820 = { + fileRef = "CB1A8356DD6D92978A131F65"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + AC8996CB4AA7ED741BA2B653 = { + isa = PBXFileReference; + name = "iso8859_2.c"; + path = "enc/iso8859_2.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 5003134D918C64258ECF669F = { + fileRef = "AC8996CB4AA7ED741BA2B653"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + F9C940DAC156872F63AA7041 = { + isa = PBXFileReference; + name = "iso8859_3.c"; + path = "enc/iso8859_3.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 61D8B44D5669A898245EC094 = { + fileRef = "F9C940DAC156872F63AA7041"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 0AB9A6BF72A34F015452AB0C = { + isa = PBXFileReference; + name = "iso8859_4.c"; + path = "enc/iso8859_4.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 735CDD263CEA47F27D7DCD16 = { + fileRef = "0AB9A6BF72A34F015452AB0C"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 17EECA3A78C84BD7DEFF2959 = { + isa = PBXFileReference; + name = "iso8859_5.c"; + path = "enc/iso8859_5.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 257978C3248C04762ED04B7C = { + fileRef = "17EECA3A78C84BD7DEFF2959"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 6CBD23D222678945E76FF01B = { + isa = PBXFileReference; + name = "iso8859_6.c"; + path = "enc/iso8859_6.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 912DBEC0790272635D97D41D = { + fileRef = "6CBD23D222678945E76FF01B"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 5A39D0158A73207018EE9B7C = { + isa = PBXFileReference; + name = "iso8859_7.c"; + path = "enc/iso8859_7.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 9850C2D8798C8B3CBCCADBAB = { + fileRef = "5A39D0158A73207018EE9B7C"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + F3B8B01B3CCEB76C9FCC3B0B = { + isa = PBXFileReference; + name = "iso8859_8.c"; + path = "enc/iso8859_8.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 219260A83700502EE0CAAA4C = { + fileRef = "F3B8B01B3CCEB76C9FCC3B0B"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 76D203D70E7F39CBCE6EE0E7 = { + isa = PBXFileReference; + name = "iso8859_9.c"; + path = "enc/iso8859_9.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 6A7309E55B65AFD0CD7DC0F5 = { + fileRef = "76D203D70E7F39CBCE6EE0E7"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + DF6584F6CF2273808EC5E49E = { + isa = PBXFileReference; + name = "koi8.c"; + path = "enc/koi8.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 5EB6E6DA07EB534BEB2D9504 = { + fileRef = "DF6584F6CF2273808EC5E49E"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + F7FAE504DF29FBF0CA5B6521 = { + isa = PBXFileReference; + name = "koi8_r.c"; + path = "enc/koi8_r.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 7CD61C95360AC027FDD53741 = { + fileRef = "F7FAE504DF29FBF0CA5B6521"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 243D71CCC4582184046AE82C = { + isa = PBXFileReference; + name = "mktable.c"; + path = "enc/mktable.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + A61637435AD8545BA3070D50 = { + fileRef = "243D71CCC4582184046AE82C"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 6E648DE7F70123147B40AEE2 = { + isa = PBXFileReference; + name = "sjis.c"; + path = "enc/sjis.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 3DD2BB989AD6F95E08842C77 = { + fileRef = "6E648DE7F70123147B40AEE2"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 3D9C222367DA37768FF1B7F0 = { + isa = PBXFileReference; + name = "unicode.c"; + path = "enc/unicode.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 0B84F102C5C551AE10631B3F = { + fileRef = "3D9C222367DA37768FF1B7F0"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 85AF7D48F51C3AF95449EA56 = { + isa = PBXFileReference; + name = "utf16_be.c"; + path = "enc/utf16_be.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 6002E9EE91B7CD53D7F6C1D9 = { + fileRef = "85AF7D48F51C3AF95449EA56"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + A22E8CB605AA62E4B18A79DC = { + isa = PBXFileReference; + name = "utf16_le.c"; + path = "enc/utf16_le.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + EF423018A81BFDA3184E3AB4 = { + fileRef = "A22E8CB605AA62E4B18A79DC"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + E8C480A8383B4DD3B2869498 = { + isa = PBXFileReference; + name = "utf32_be.c"; + path = "enc/utf32_be.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 4318E871A6CC21C2E4313050 = { + fileRef = "E8C480A8383B4DD3B2869498"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 808D2B53FCCE3316AA4360DB = { + isa = PBXFileReference; + name = "utf32_le.c"; + path = "enc/utf32_le.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + AEC876C331C7E3034F2FA9E1 = { + fileRef = "808D2B53FCCE3316AA4360DB"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 3D0809782296D6CDCF6889DD = { + isa = PBXFileReference; + name = "utf8.c"; + path = "enc/utf8.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 29EB19309BCEBA1C34787309 = { + fileRef = "3D0809782296D6CDCF6889DD"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 5B10297D6DF772D0F1087188 = { + isa = PBXFileReference; + name = "testc.c"; + path = "win32/testc.c"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 606EE73ADEB7964B2CE2111A = { + fileRef = "5B10297D6DF772D0F1087188"; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 98BA56D25D28991FE5FB1F3F = { + isa = PBXFileReference; + name = "config.h"; + path = "config.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 8C82976484E62ED4E39611B7 = { + isa = PBXFileReference; + name = "oniggnu.h"; + path = "oniggnu.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 3B5FF5276711BA050B53A038 = { + isa = PBXFileReference; + name = "onigposix.h"; + path = "onigposix.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 07A74D6291F537EAE0A14967 = { + isa = PBXFileReference; + name = "oniguruma.h"; + path = "oniguruma.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 79115FC57CC527574480E346 = { + isa = PBXFileReference; + name = "regenc.h"; + path = "regenc.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 77D09AB910B276FAEF72857C = { + isa = PBXFileReference; + name = "regint.h"; + path = "regint.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + E42DEAB312FEC56B23213E59 = { + isa = PBXFileReference; + name = "regparse.h"; + path = "regparse.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + BE3127FCBB3EABE77C363A99 = { + isa = PBXFileReference; + name = "st.h"; + path = "st.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 77A474F3ED00EC7D4B3A59E1 = { + isa = PBXFileReference; + name = "config.h"; + path = "win32/config.h"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 522C3E5E36A9ACE7FAA73B6A = { + isa = PBXFileReference; + name = "onig.pro"; + path = "onig.pro"; + refType = 4; + sourceTree = "SOURCE_ROOT"; + }; + 883D7615C4D2DE3FA1218F12 = { + isa = PBXGroup; + children = ( + "98BA56D25D28991FE5FB1F3F", + "8C82976484E62ED4E39611B7", + "3B5FF5276711BA050B53A038", + "07A74D6291F537EAE0A14967", + "79115FC57CC527574480E346", + "77D09AB910B276FAEF72857C", + "E42DEAB312FEC56B23213E59", + "BE3127FCBB3EABE77C363A99", + "8C91CE79D88D1019A4127FDB"); + name = "Headers"; + refType = 4; + sourceTree = "<Group>"; + }; + 8C91CE79D88D1019A4127FDB = { + isa = PBXGroup; + children = ( + "77A474F3ED00EC7D4B3A59E1"); + name = "win32"; + refType = 4; + sourceTree = "<Group>"; + }; + 217CE2FA1DE975F3FA453FAE = { + isa = PBXGroup; + children = ( + "01D1D4737A1609807EEC6323", + "8A5CE5A2F0109864325EE936", + "237988C4CFAA8A390CE6CD09", + "6D584F6591197182AB045974", + "3634380D2562B6D376460530", + "C2F874DB54D5DAE2510463F8", + "6E8C0DA9E7161926BCED070D", + "CF26CC5676C5C376F3C07F76", + "E85DDEF2771671A8E6853D7D", + "F3407363A9E293F0F54769F5", + "3A9FCA92A8A69DB5B4B34F8C", + "C1C56D9576862FAD78C5D192", + "CF57BC380E358CFC0011750B", + "CB1A8356DD6D92978A131F65", + "AC8996CB4AA7ED741BA2B653", + "F9C940DAC156872F63AA7041", + "0AB9A6BF72A34F015452AB0C", + "17EECA3A78C84BD7DEFF2959", + "6CBD23D222678945E76FF01B", + "5A39D0158A73207018EE9B7C", + "F3B8B01B3CCEB76C9FCC3B0B", + "76D203D70E7F39CBCE6EE0E7", + "DF6584F6CF2273808EC5E49E", + "F7FAE504DF29FBF0CA5B6521", + "243D71CCC4582184046AE82C", + "6E648DE7F70123147B40AEE2", + "3D9C222367DA37768FF1B7F0", + "85AF7D48F51C3AF95449EA56", + "A22E8CB605AA62E4B18A79DC", + "E8C480A8383B4DD3B2869498", + "808D2B53FCCE3316AA4360DB", + "3D0809782296D6CDCF6889DD"); + name = "enc"; + refType = 4; + sourceTree = "<Group>"; + }; + 8CC886E18A608BFA3302186C = { + isa = PBXGroup; + children = ( + "5B10297D6DF772D0F1087188"); + name = "win32"; + refType = 4; + sourceTree = "<Group>"; + }; + FB61758D0F0FDA4BA867C3D5 = { + isa = PBXGroup; + children = ( + "45A3B531E1A3DD993ADD3125", + "0125A2B1F80C4E0DCB8AE0FF", + "6FE48441EC9A3AA9DAAD6586", + "EADAB6E9EA2E2F1D404DF17D", + "2AE87BE2DAE39B1811496335", + "EFC47CEEAB84064E42E0A366", + "A05CBE34D16476E409CA74C5", + "4A7B253CD25D7611D02A69E2", + "B363F2540CFB9049FDD64DF9", + "F1F8BA8FD83099467398EE71", + "52D0CCBECBF2BD50F580181D", + "4AC74F5A71FF4FF04D64B027", + "7875E170ADA1A2B62A8C8798", + "D0D31F40E09615ABA8EA0EEE", + "6EFF105266156A788611A107", + "217CE2FA1DE975F3FA453FAE", + "8CC886E18A608BFA3302186C"); + name = "Sources"; + refType = 4; + sourceTree = "<Group>"; + }; + 7CABE3C80E79AD2B307756D2 = { + isa = PBXGroup; + children = ( + "522C3E5E36A9ACE7FAA73B6A"); + name = "Sources [qmake]"; + refType = 4; + sourceTree = "<Group>"; + }; + A0A52A2ADF7A1E2A99738674 = { + buildActionMask = 2147483647; + files = ( + ); + generatedFileNames = ( + "A14CD0C98448AA103A28B989", + "AD8875711B94E66D3436369E", + "C4D8A8F084600EE43E260635", + "10D5FEE3F1464F0A19D30B72", + "2DAA8557ABEC39A18D55AD64", + "3DF8206800884E30C6CFBA38", + "5A0B6E73244B9151669A353D", + "809BE57B3EDD72B3508441E9", + "9C8B131FA4EBB715E63E24AE", + "FA55922880E907B2E241436D", + "BBAF4062F90DB909220E6864", + "2ED7809978D2C58080C00BF7", + "867C776EB81CD557E7FDE8EA", + "1DA4FBD0A7EA06786F484181", + "92312AC9E4C7EE90584EF9B3", + "AD99EFB77D80649A7AD07414", + "C1E6E097D79769394623CDA2", + "DB3D0B300CA0968E876B661A", + "D104CC2E2D1F8E607A424717", + "F0C93E60E271D771ACC59DD4", + "201AEDEB948305AAADB1CD74", + "DDA182C9017D8C9E833E8F30", + "AAF062E6A672D3B82B8B6B9F", + "4828C0848688847E75C667BF", + "54464B92F6CA479657E3A4B0", + "2EC2F2218022BA4E175FD18D", + "8975DDF36B2D4673C3917F65", + "720DB52247832495CE52686E", + "673F365E152F029005883820", + "5003134D918C64258ECF669F", + "61D8B44D5669A898245EC094", + "735CDD263CEA47F27D7DCD16", + "257978C3248C04762ED04B7C", + "912DBEC0790272635D97D41D", + "9850C2D8798C8B3CBCCADBAB", + "219260A83700502EE0CAAA4C", + "6A7309E55B65AFD0CD7DC0F5", + "5EB6E6DA07EB534BEB2D9504", + "7CD61C95360AC027FDD53741", + "A61637435AD8545BA3070D50", + "3DD2BB989AD6F95E08842C77", + "0B84F102C5C551AE10631B3F", + "6002E9EE91B7CD53D7F6C1D9", + "EF423018A81BFDA3184E3AB4", + "4318E871A6CC21C2E4313050", + "AEC876C331C7E3034F2FA9E1", + "29EB19309BCEBA1C34787309", + "606EE73ADEB7964B2CE2111A"); + isa = PBXShellScriptBuildPhase; + name = "Qt Preprocessors"; + neededFileNames = ( + "A14CD0C98448AA103A28B989", + "AD8875711B94E66D3436369E", + "C4D8A8F084600EE43E260635", + "10D5FEE3F1464F0A19D30B72", + "2DAA8557ABEC39A18D55AD64", + "3DF8206800884E30C6CFBA38", + "5A0B6E73244B9151669A353D", + "809BE57B3EDD72B3508441E9", + "9C8B131FA4EBB715E63E24AE", + "FA55922880E907B2E241436D", + "BBAF4062F90DB909220E6864", + "2ED7809978D2C58080C00BF7", + "867C776EB81CD557E7FDE8EA", + "1DA4FBD0A7EA06786F484181", + "92312AC9E4C7EE90584EF9B3", + "AD99EFB77D80649A7AD07414", + "C1E6E097D79769394623CDA2", + "DB3D0B300CA0968E876B661A", + "D104CC2E2D1F8E607A424717", + "F0C93E60E271D771ACC59DD4", + "201AEDEB948305AAADB1CD74", + "DDA182C9017D8C9E833E8F30", + "AAF062E6A672D3B82B8B6B9F", + "4828C0848688847E75C667BF", + "54464B92F6CA479657E3A4B0", + "2EC2F2218022BA4E175FD18D", + "8975DDF36B2D4673C3917F65", + "720DB52247832495CE52686E", + "673F365E152F029005883820", + "5003134D918C64258ECF669F", + "61D8B44D5669A898245EC094", + "735CDD263CEA47F27D7DCD16", + "257978C3248C04762ED04B7C", + "912DBEC0790272635D97D41D", + "9850C2D8798C8B3CBCCADBAB", + "219260A83700502EE0CAAA4C", + "6A7309E55B65AFD0CD7DC0F5", + "5EB6E6DA07EB534BEB2D9504", + "7CD61C95360AC027FDD53741", + "A61637435AD8545BA3070D50", + "3DD2BB989AD6F95E08842C77", + "0B84F102C5C551AE10631B3F", + "6002E9EE91B7CD53D7F6C1D9", + "EF423018A81BFDA3184E3AB4", + "4318E871A6CC21C2E4313050", + "AEC876C331C7E3034F2FA9E1", + "29EB19309BCEBA1C34787309", + "606EE73ADEB7964B2CE2111A"); + shellPath = "/bin/sh"; + shellScript = "make\ -C\ /Users/rick/bit/prj/compare/src/vendor/onig\ -f\ \'onig.xcodeproj/qt_preprocess.mak\'"; + }; + C29B8785722055ED95EF7B57 = { + buildActionMask = 2147483647; + files = ( + "A14CD0C98448AA103A28B989", + "AD8875711B94E66D3436369E", + "C4D8A8F084600EE43E260635", + "10D5FEE3F1464F0A19D30B72", + "2DAA8557ABEC39A18D55AD64", + "3DF8206800884E30C6CFBA38", + "5A0B6E73244B9151669A353D", + "809BE57B3EDD72B3508441E9", + "9C8B131FA4EBB715E63E24AE", + "FA55922880E907B2E241436D", + "BBAF4062F90DB909220E6864", + "2ED7809978D2C58080C00BF7", + "867C776EB81CD557E7FDE8EA", + "1DA4FBD0A7EA06786F484181", + "92312AC9E4C7EE90584EF9B3", + "AD99EFB77D80649A7AD07414", + "C1E6E097D79769394623CDA2", + "DB3D0B300CA0968E876B661A", + "D104CC2E2D1F8E607A424717", + "F0C93E60E271D771ACC59DD4", + "201AEDEB948305AAADB1CD74", + "DDA182C9017D8C9E833E8F30", + "AAF062E6A672D3B82B8B6B9F", + "4828C0848688847E75C667BF", + "54464B92F6CA479657E3A4B0", + "2EC2F2218022BA4E175FD18D", + "8975DDF36B2D4673C3917F65", + "720DB52247832495CE52686E", + "673F365E152F029005883820", + "5003134D918C64258ECF669F", + "61D8B44D5669A898245EC094", + "735CDD263CEA47F27D7DCD16", + "257978C3248C04762ED04B7C", + "912DBEC0790272635D97D41D", + "9850C2D8798C8B3CBCCADBAB", + "219260A83700502EE0CAAA4C", + "6A7309E55B65AFD0CD7DC0F5", + "5EB6E6DA07EB534BEB2D9504", + "7CD61C95360AC027FDD53741", + "A61637435AD8545BA3070D50", + "3DD2BB989AD6F95E08842C77", + "0B84F102C5C551AE10631B3F", + "6002E9EE91B7CD53D7F6C1D9", + "EF423018A81BFDA3184E3AB4", + "4318E871A6CC21C2E4313050", + "AEC876C331C7E3034F2FA9E1", + "29EB19309BCEBA1C34787309", + "606EE73ADEB7964B2CE2111A"); + isa = PBXSourcesBuildPhase; + name = "Build Sources"; + }; + 9B36DA7E32F0304E780E7972 = { + isa = PBXFrameworkReference; + name = "QtGui.framework"; + path = "/Library/Frameworks/QtGui.framework"; + refType = 0; + sourceTree = "<absolute>"; + }; + 501667F26B3C1FF6767A7C12 = { + fileRef = "9B36DA7E32F0304E780E7972"; + isa = PBXBuildFile; + settings = { + }; + }; + 7BC2E65A5E699A5E5D834CA2 = { + isa = PBXFrameworkReference; + name = "QtCore.framework"; + path = "/Library/Frameworks/QtCore.framework"; + refType = 0; + sourceTree = "<absolute>"; + }; + 069D05B0128AE5DC7EE31738 = { + fileRef = "7BC2E65A5E699A5E5D834CA2"; + isa = PBXBuildFile; + settings = { + }; + }; + ED1E82605DD74B483AF3C982 = { + children = ( + "9B36DA7E32F0304E780E7972", + "7BC2E65A5E699A5E5D834CA2"); + isa = PBXGroup; + name = "External Frameworks and Libraries"; + path = ""; + refType = 4; + sourceTree = "<Group>"; + }; + 2A1043669E6E5A7426EA502A = { + buildActionMask = 2147483647; + files = ( + "501667F26B3C1FF6767A7C12", + "069D05B0128AE5DC7EE31738"); + isa = PBXFrameworksBuildPhase; + name = "Frameworks & Libraries"; + }; + 3787F99312C85FF0073FD7BA = { + buildActionMask = 2147483647; + files = ( + ); + isa = PBXResourcesBuildPhase; + name = "Bundle Resources"; + }; + 05596AB53D8D521C69802C27 = { + children = ( + "FB61758D0F0FDA4BA867C3D5", + "883D7615C4D2DE3FA1218F12", + "7CABE3C80E79AD2B307756D2", + "ED1E82605DD74B483AF3C982"); + isa = PBXGroup; + name = "onig"; + path = ""; + refType = 4; + sourceTree = "<Group>"; + }; + D76F688573FD7E50230F12FB = { + isa = PBXFileReference; + explicitFileType = "wrapper.application"; + path = "onig.app"; + refType = 3; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 068F80C7519D0528FB08E821 = { + children = ( + "D76F688573FD7E50230F12FB"); + isa = PBXGroup; + name = "Products"; + refType = 4; + }; + FFA26564C089E4FFFD2340B2 = { + buildPhases = ( + "D7BA7D76DAB5DD13389D6332", + "A0A52A2ADF7A1E2A99738674", + "C29B8785722055ED95EF7B57", + "2A1043669E6E5A7426EA502A", + "3787F99312C85FF0073FD7BA"); + buildSettings = { + CC = "/usr/bin/gcc"; + CPLUSPLUS = "/usr/bin/g++"; + LEXFLAGS = ""; + YACCFLAGS = "-d"; + OTHER_REZFLAGS = ""; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ""; + PREBINDING = NO; + INFOPLIST_FILE = "Info.plist"; + BUILD_ROOT = "/Users/rick/bit/prj/compare/src/vendor/onig"; + OTHER_LDFLAGS = ( + "-headerpad_max_install_names", + "-L/Library/Frameworks", + "-F/Library/Frameworks"); + DYLIB_CURRENT_VERSION = "1.0.0"; + DYLIB_COMPATIBILITY_VERSION = "1.0"; + MACOSX_DEPLOYMENT_TARGET = "10.4"; + PRODUCT_NAME = "onig"; + }; + conditionalBuildSettings = { + }; + dependencies = ( + ); + productReference = "D76F688573FD7E50230F12FB"; + shouldUseHeadermap = 1; + buildConfigurationList = 17B3380A4D6A7D415E7F2E1E; + isa = PBXNativeTarget; + productType = "com.apple.product-type.application"; + productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> +<!DOCTYPE plist SYSTEM \"file://localhost/System/Library/DTDs/PropertyList.dtd\"> +<plist version=\"0.9\"> +<dict> + <key>NSPrincipalClass</key> + <string>NSApplication</string> + <key>CFBundleIconFile</key> + <string></string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleGetInfoString</key> + <string>Created by Qt/QMake</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleExecutable</key> + <string>onig</string> + <key>CFBundleIdentifier</key> + <string>com.yourcompany.onig</string> + <key>NOTE</key> + <string>This file was generated by Qt/QMake.</string> +</dict> +</plist> +"; + name = "onig"; + productName = "onig"; + startupPath = "<<ProjectDirectory>>"; + }; + 4B72B24813252891014BCF61 = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = "NO"; + GCC_GENERATE_DEBUGGING_SYMBOLS = "YES"; + GCC_OPTIMIZATION_LEVEL = "0"; + PRODUCT_NAME = "onig"; + HEADER_SEARCH_PATHS = ( + "/Library/Frameworks/QtCore.framework/Versions/4/Headers", + "/usr/include/QtCore", + "/Library/Frameworks/QtGui.framework/Versions/4/Headers", + "/usr/include/QtGui", + "/usr/include", + ".", + ".", + "/usr/local/include", + "/System/Library/Frameworks/CarbonCore.framework/Headers", + "/usr/local/Qt4.8/mkspecs/macx-xcode"); + LIBRARY_SEARCH_PATHS = ( + "/Library/Frameworks"); + FRAMEWORK_SEARCH_PATHS = ( + "/Library/Frameworks", + "/Library/Frameworks"); + INFOPLIST_FILE = "Info.plist"; + OTHER_CFLAGS = ( + "-pipe", + "-g", + "-Wall", + "-W", + "-DQT_GUI_LIB", + "-DQT_CORE_LIB", + "-DQT_SHARED"); + OTHER_CPLUSPLUSFLAGS = ( + "-pipe", + "-g", + "-Wall", + "-W", + "-DQT_GUI_LIB", + "-DQT_CORE_LIB", + "-DQT_SHARED"); + OTHER_LDFLAGS = ( + "-headerpad_max_install_names", + "-L/Library/Frameworks", + "-F/Library/Frameworks"); + ARCHS = "x86_64"; + }; + name = "Debug"; + }; + BEC09A62E69C3553534FF35E = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = "NO"; + GCC_GENERATE_DEBUGGING_SYMBOLS = "YES"; + GCC_OPTIMIZATION_LEVEL = "0"; + PRODUCT_NAME = "onig"; + PRODUCT_NAME = "onig"; + }; + name = "Debug"; + }; + 2C641C3335766025DD51B7BD = { + buildRules = ( + ); + buildSettings = { + COPY_PHASE_STRIP = "NO"; + GCC_GENERATE_DEBUGGING_SYMBOLS = "YES"; + GCC_OPTIMIZATION_LEVEL = "0"; + PRODUCT_NAME = "onig"; + }; + isa = "PBXBuildStyle"; + name = "Debug"; + }; + D70590BEB531B51029F711BB = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = "YES"; + GCC_GENERATE_DEBUGGING_SYMBOLS = "NO"; + PRODUCT_NAME = "onig"; + HEADER_SEARCH_PATHS = ( + "/Library/Frameworks/QtCore.framework/Versions/4/Headers", + "/usr/include/QtCore", + "/Library/Frameworks/QtGui.framework/Versions/4/Headers", + "/usr/include/QtGui", + "/usr/include", + ".", + ".", + "/usr/local/include", + "/System/Library/Frameworks/CarbonCore.framework/Headers", + "/usr/local/Qt4.8/mkspecs/macx-xcode"); + LIBRARY_SEARCH_PATHS = ( + "/Library/Frameworks"); + FRAMEWORK_SEARCH_PATHS = ( + "/Library/Frameworks", + "/Library/Frameworks"); + INFOPLIST_FILE = "Info.plist"; + OTHER_CFLAGS = ( + "-pipe", + "-g", + "-Wall", + "-W", + "-DQT_GUI_LIB", + "-DQT_CORE_LIB", + "-DQT_SHARED"); + OTHER_CPLUSPLUSFLAGS = ( + "-pipe", + "-g", + "-Wall", + "-W", + "-DQT_GUI_LIB", + "-DQT_CORE_LIB", + "-DQT_SHARED"); + OTHER_LDFLAGS = ( + "-headerpad_max_install_names", + "-L/Library/Frameworks", + "-F/Library/Frameworks"); + ARCHS = "x86_64"; + }; + name = "Release"; + }; + 8C7174830A1E4DCBA0332EC1 = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = "YES"; + GCC_GENERATE_DEBUGGING_SYMBOLS = "NO"; + PRODUCT_NAME = "onig"; + PRODUCT_NAME = "onig"; + }; + name = "Release"; + }; + 26DE8D2AEA4B3714B41E931F = { + buildRules = ( + ); + buildSettings = { + COPY_PHASE_STRIP = "YES"; + GCC_GENERATE_DEBUGGING_SYMBOLS = "NO"; + PRODUCT_NAME = "onig"; + }; + isa = "PBXBuildStyle"; + name = "Release"; + }; + CC82A9286117DFED018F418F = { + isa = XCConfigurationList; + buildConfigurations = ( + "4B72B24813252891014BCF61", + "D70590BEB531B51029F711BB"); + defaultConfigurationIsVisible = 0; + defaultConfigurationIsName = "Debug"; + }; + 17B3380A4D6A7D415E7F2E1E = { + isa = XCConfigurationList; + buildConfigurations = ( + "BEC09A62E69C3553534FF35E", + "8C7174830A1E4DCBA0332EC1"); + defaultConfigurationIsVisible = 0; + defaultConfigurationIsName = "Debug"; + }; + 91B15E841AA80083484172DE = { + buildStyles = ( + "2C641C3335766025DD51B7BD", + "26DE8D2AEA4B3714B41E931F"); + hasScannedForEncodings = 1; + isa = PBXProject; + mainGroup = "05596AB53D8D521C69802C27"; + buildConfigurationList = "CC82A9286117DFED018F418F"; + projectDirPath = ""; + targets = ( + "FFA26564C089E4FFFD2340B2"); + }; + }; + rootObject = "91B15E841AA80083484172DE"; +} diff --git a/lib/edbee-lib/vendor/onig/onig.xcodeproj/qt_makeqmake.mak b/lib/edbee-lib/vendor/onig/onig.xcodeproj/qt_makeqmake.mak new file mode 100644 index 00000000..309d5bb0 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/onig.xcodeproj/qt_makeqmake.mak @@ -0,0 +1,77 @@ +############################################################################# +# Makefile for building: onig.app/Contents/MacOS/onig +# Generated by qmake (2.01a) (Qt 4.8.4) on: Wed Jan 23 20:34:27 2013 +# Project: onig.pro +# Template: app +# Command: /usr/bin/qmake -o onig.xcodeproj/project.pbxproj onig.pro +############################################################################# + +QMAKE = /usr/bin/qmake +onig.xcodeproj/project.pbxproj: onig.pro /usr/local/Qt4.8/mkspecs/macx-xcode/qmake.conf /usr/local/Qt4.8/mkspecs/common/unix.conf \ + /usr/local/Qt4.8/mkspecs/common/mac.conf \ + /usr/local/Qt4.8/mkspecs/common/gcc-base.conf \ + /usr/local/Qt4.8/mkspecs/common/gcc-base-macx.conf \ + /usr/local/Qt4.8/mkspecs/common/g++-base.conf \ + /usr/local/Qt4.8/mkspecs/common/g++-macx.conf \ + /usr/local/Qt4.8/mkspecs/qconfig.pri \ + /usr/local/Qt4.8/mkspecs/modules/qt_webkit_version.pri \ + /usr/local/Qt4.8/mkspecs/features/qt_functions.prf \ + /usr/local/Qt4.8/mkspecs/features/qt_config.prf \ + /usr/local/Qt4.8/mkspecs/features/exclusive_builds.prf \ + /usr/local/Qt4.8/mkspecs/features/default_pre.prf \ + /usr/local/Qt4.8/mkspecs/features/mac/default_pre.prf \ + /usr/local/Qt4.8/mkspecs/features/mac/dwarf2.prf \ + /usr/local/Qt4.8/mkspecs/features/debug.prf \ + /usr/local/Qt4.8/mkspecs/features/default_post.prf \ + /usr/local/Qt4.8/mkspecs/features/mac/default_post.prf \ + /usr/local/Qt4.8/mkspecs/features/mac/x86_64.prf \ + /usr/local/Qt4.8/mkspecs/features/mac/objective_c.prf \ + /usr/local/Qt4.8/mkspecs/features/warn_on.prf \ + /usr/local/Qt4.8/mkspecs/features/qt.prf \ + /usr/local/Qt4.8/mkspecs/features/unix/thread.prf \ + /usr/local/Qt4.8/mkspecs/features/moc.prf \ + /usr/local/Qt4.8/mkspecs/features/mac/rez.prf \ + /usr/local/Qt4.8/mkspecs/features/mac/sdk.prf \ + /usr/local/Qt4.8/mkspecs/features/resources.prf \ + /usr/local/Qt4.8/mkspecs/features/uic.prf \ + /usr/local/Qt4.8/mkspecs/features/yacc.prf \ + /usr/local/Qt4.8/mkspecs/features/lex.prf \ + /usr/local/Qt4.8/mkspecs/features/include_source_dir.prf \ + /Library/Frameworks/QtGui.framework/QtGui.prl \ + /Library/Frameworks/QtCore.framework/QtCore.prl + $(QMAKE) -o onig.xcodeproj/project.pbxproj onig.pro +/usr/local/Qt4.8/mkspecs/common/unix.conf: +/usr/local/Qt4.8/mkspecs/common/mac.conf: +/usr/local/Qt4.8/mkspecs/common/gcc-base.conf: +/usr/local/Qt4.8/mkspecs/common/gcc-base-macx.conf: +/usr/local/Qt4.8/mkspecs/common/g++-base.conf: +/usr/local/Qt4.8/mkspecs/common/g++-macx.conf: +/usr/local/Qt4.8/mkspecs/qconfig.pri: +/usr/local/Qt4.8/mkspecs/modules/qt_webkit_version.pri: +/usr/local/Qt4.8/mkspecs/features/qt_functions.prf: +/usr/local/Qt4.8/mkspecs/features/qt_config.prf: +/usr/local/Qt4.8/mkspecs/features/exclusive_builds.prf: +/usr/local/Qt4.8/mkspecs/features/default_pre.prf: +/usr/local/Qt4.8/mkspecs/features/mac/default_pre.prf: +/usr/local/Qt4.8/mkspecs/features/mac/dwarf2.prf: +/usr/local/Qt4.8/mkspecs/features/debug.prf: +/usr/local/Qt4.8/mkspecs/features/default_post.prf: +/usr/local/Qt4.8/mkspecs/features/mac/default_post.prf: +/usr/local/Qt4.8/mkspecs/features/mac/x86_64.prf: +/usr/local/Qt4.8/mkspecs/features/mac/objective_c.prf: +/usr/local/Qt4.8/mkspecs/features/warn_on.prf: +/usr/local/Qt4.8/mkspecs/features/qt.prf: +/usr/local/Qt4.8/mkspecs/features/unix/thread.prf: +/usr/local/Qt4.8/mkspecs/features/moc.prf: +/usr/local/Qt4.8/mkspecs/features/mac/rez.prf: +/usr/local/Qt4.8/mkspecs/features/mac/sdk.prf: +/usr/local/Qt4.8/mkspecs/features/resources.prf: +/usr/local/Qt4.8/mkspecs/features/uic.prf: +/usr/local/Qt4.8/mkspecs/features/yacc.prf: +/usr/local/Qt4.8/mkspecs/features/lex.prf: +/usr/local/Qt4.8/mkspecs/features/include_source_dir.prf: +/Library/Frameworks/QtGui.framework/QtGui.prl: +/Library/Frameworks/QtCore.framework/QtCore.prl: +qmake: FORCE + @$(QMAKE) -o onig.xcodeproj/project.pbxproj onig.pro + diff --git a/lib/edbee-lib/vendor/onig/onig.xcodeproj/qt_preprocess.mak b/lib/edbee-lib/vendor/onig/onig.xcodeproj/qt_preprocess.mak new file mode 100644 index 00000000..6995af63 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/onig.xcodeproj/qt_preprocess.mak @@ -0,0 +1,55 @@ +############################################################################# +# Makefile for building: onig.app/Contents/MacOS/onig +# Generated by qmake (2.01a) (Qt 4.8.4) on: Wed Jan 23 20:34:27 2013 +# Project: onig.pro +# Template: app +# Command: /usr/bin/qmake -o onig.xcodeproj/project.pbxproj onig.pro +############################################################################# + +MOC = /Developer/Tools/Qt/moc +UIC = /Developer/Tools/Qt/uic +LEX = flex +LEXFLAGS = +YACC = yacc +YACCFLAGS = -d +DEFINES = -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED +INCPATH = -I/usr/local/Qt4.8/mkspecs/macx-xcode -I. -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/usr/include/QtGui -I/usr/include -I. -I. -I/usr/local/include -I/System/Library/Frameworks/CarbonCore.framework/Headers -F/Library/Frameworks +DEL_FILE = rm -f +MOVE = mv -f + +IMAGES = +PARSERS = +preprocess: $(PARSERS) compilers +clean preprocess_clean: parser_clean compiler_clean + +parser_clean: +check: first + +mocclean: compiler_moc_header_clean compiler_moc_source_clean + +mocables: compiler_moc_header_make_all compiler_moc_source_make_all + +compilers: +compiler_objective_c_make_all: +compiler_objective_c_clean: +compiler_moc_header_make_all: +compiler_moc_header_clean: +compiler_rcc_make_all: +compiler_rcc_clean: +compiler_image_collection_make_all: qmake_image_collection.cpp +compiler_image_collection_clean: + -$(DEL_FILE) qmake_image_collection.cpp +compiler_moc_source_make_all: +compiler_moc_source_clean: +compiler_rez_source_make_all: +compiler_rez_source_clean: +compiler_uic_make_all: +compiler_uic_clean: +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: + diff --git a/lib/edbee-lib/vendor/onig/onigmo-config.in b/lib/edbee-lib/vendor/onig/onigmo-config.in new file mode 100644 index 00000000..ab408b51 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/onigmo-config.in @@ -0,0 +1,78 @@ +#!/bin/sh +# Copyright (C) 2006 K.Kosako (sndgk393 AT ybb DOT ne DOT jp) + +ONIGMO_VERSION=@PACKAGE_VERSION@ + +show_usage() +{ + cat <<EOF +Usage: onigmo-config [OPTION] + + Values for OPTION are: + --prefix[=DIR] change prefix to DIR + --prefix print prefix + --exec-prefix[=DIR] change exec_prefix to DIR + --exec-prefix print exec_prefix + --cflags print C compiler flags + --libs print library information + --version print onigmo version + --help print this help + +EOF + + exit 1 +} + +if test $# -eq 0; then + show_usage +fi + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +is_set_exec_prefix=no + +while test $# -gt 0; do + case "$1" in + -*=*) val=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` + ;; + *) val= + ;; + esac + + case $1 in + --prefix=*) + prefix=$val + if test $is_set_exec_prefix = no ; then + exec_prefix=$val + fi + ;; + --prefix) + echo $prefix + ;; + --exec-prefix=*) + exec_prefix=$val + is_set_exec_prefix=yes + ;; + --exec-prefix) + echo $exec_prefix + ;; + --cflags) + if test @includedir@ != /usr/include ; then + show_includedir=-I@includedir@ + fi + echo $show_includedir + ;; + --libs) + echo -L@libdir@ -lonigmo + ;; + --version) + echo $ONIGMO_VERSION + ;; + *) + show_usage + ;; + esac + shift +done + +# END diff --git a/lib/edbee-lib/vendor/onig/onigmo.h b/lib/edbee-lib/vendor/onig/onigmo.h new file mode 100644 index 00000000..13a6562f --- /dev/null +++ b/lib/edbee-lib/vendor/onig/onigmo.h @@ -0,0 +1,1035 @@ +#ifndef ONIGMO_H +#define ONIGMO_H +/********************************************************************** + onigmo.h - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011-2017 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifdef __cplusplus +extern "C" { +# if 0 +} /* satisfy cc-mode */ +# endif +#endif + +#define ONIGMO_VERSION_MAJOR 6 +#define ONIGMO_VERSION_MINOR 1 +#define ONIGMO_VERSION_TEENY 2 + +#ifndef ONIG_EXTERN +# ifdef RUBY_EXTERN +# define ONIG_EXTERN RUBY_EXTERN +# else +# if defined(_WIN32) && !defined(__GNUC__) +# if defined(EXPORT) || defined(RUBY_EXPORT) +# define ONIG_EXTERN extern __declspec(dllexport) +# else +# define ONIG_EXTERN extern __declspec(dllimport) +# endif +# endif +# endif +#endif + +#ifndef ONIG_EXTERN +# define ONIG_EXTERN extern +#endif + +#ifndef RUBY +# ifndef RUBY_SYMBOL_EXPORT_BEGIN +# define RUBY_SYMBOL_EXPORT_BEGIN +# define RUBY_SYMBOL_EXPORT_END +# endif +#endif + +RUBY_SYMBOL_EXPORT_BEGIN + +#include <stddef.h> /* for size_t */ + +/* PART: character encoding */ + +#ifndef ONIG_ESCAPE_UCHAR_COLLISION +# define UChar OnigUChar +#endif + +typedef unsigned char OnigUChar; +typedef unsigned int OnigCodePoint; +typedef unsigned int OnigCtype; +typedef size_t OnigDistance; +typedef ptrdiff_t OnigPosition; + +#define ONIG_INFINITE_DISTANCE ~((OnigDistance)0) + +/* + * Onig casefold/case mapping flags and related definitions + * + * Subfields (starting with 0 at LSB): + * 0-2: Code point count in casefold.h + * 3-12: Index into SpecialCaseMapping array in casefold.h + * 13-22: Case folding/mapping flags + */ +typedef unsigned int OnigCaseFoldType; /* case fold flag */ + +ONIG_EXTERN OnigCaseFoldType OnigDefaultCaseFoldFlag; + +/* bits for actual code point count; 3 bits is more than enough, currently only + * 2 used */ +#define OnigCodePointMaskWidth 3 +#define OnigCodePointMask ((1 << OnigCodePointMaskWidth) - 1) +#define OnigCodePointCount(n) ((n) & OnigCodePointMask) +#define OnigCaseFoldFlags(n) ((n) & ~OnigCodePointMask) + +/* #define ONIGENC_CASE_FOLD_HIRAGANA_KATAKANA (1<<1) */ /* no longer usable + with these values! + */ +/* #define ONIGENC_CASE_FOLD_KATAKANA_WIDTH (1<<2) */ /* no longer usable + with these values! + */ + +/* bits for index into table with separate titlecase mappings */ +/* 10 bits provide 1024 values */ +#define OnigSpecialIndexShift 3 +#define OnigSpecialIndexWidth 10 + +#define ONIGENC_CASE_UPCASE (1 << 13) /* has/needs uppercase mapping */ +#define ONIGENC_CASE_DOWNCASE (1 << 14) /* has/needs lowercase mapping */ +#define ONIGENC_CASE_TITLECASE \ + (1 << 15) /* has/needs (special) titlecase mapping */ +#define ONIGENC_CASE_SPECIAL_OFFSET \ + 3 /* offset in bits from ONIGENC_CASE to ONIGENC_CASE_SPECIAL */ +#define ONIGENC_CASE_UP_SPECIAL (1 << 16) /* has special upcase mapping */ +#define ONIGENC_CASE_DOWN_SPECIAL (1 << 17) /* has special downcase mapping */ +#define ONIGENC_CASE_MODIFIED (1 << 18) /* data has been modified */ +#define ONIGENC_CASE_FOLD (1 << 19) /* has/needs case folding */ + +#define ONIGENC_CASE_FOLD_TURKISH_AZERI \ + (1 << 20) /* needs mapping specific to Turkic languages; better not change \ + original value! */ + +#define ONIGENC_CASE_FOLD_LITHUANIAN \ + (1 << 21) /* needs Lithuanian-specific mapping */ +#define ONIGENC_CASE_ASCII_ONLY (1 << 22) /* only modify ASCII range */ +#define ONIGENC_CASE_IS_TITLECASE \ + (1 << 23) /* character itself is already titlecase */ + +#define INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR \ + (1 << 30) /* better not change original value! */ + +#define ONIGENC_CASE_FOLD_MIN INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR +#define ONIGENC_CASE_FOLD_DEFAULT OnigDefaultCaseFoldFlag + +#define ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN 3 +#define ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM 13 +/* 13 => Unicode:0x1ffc */ + +/* code range */ +#define ONIGENC_CODE_RANGE_NUM(range) ((int)range[0]) +#define ONIGENC_CODE_RANGE_FROM(range, i) range[((i) * 2) + 1] +#define ONIGENC_CODE_RANGE_TO(range, i) range[((i) * 2) + 2] + +typedef struct +{ + int byte_len; /* argument(original) character(s) byte length */ + int code_len; /* number of code */ + OnigCodePoint code[ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN]; +} OnigCaseFoldCodeItem; + +typedef struct +{ + OnigCodePoint esc; + OnigCodePoint anychar; + OnigCodePoint anytime; + OnigCodePoint zero_or_one_time; + OnigCodePoint one_or_more_time; + OnigCodePoint anychar_anytime; +} OnigMetaCharTableType; + +typedef int (*OnigApplyAllCaseFoldFunc)(OnigCodePoint from, OnigCodePoint *to, + int to_len, void *arg); + +typedef struct OnigEncodingTypeST +{ + int (*precise_mbc_enc_len)(const OnigUChar *p, const OnigUChar *e, + const struct OnigEncodingTypeST *enc); + const char *name; + int max_enc_len; + int min_enc_len; + int (*is_mbc_newline)(const OnigUChar *p, const OnigUChar *end, + const struct OnigEncodingTypeST *enc); + OnigCodePoint (*mbc_to_code)(const OnigUChar *p, const OnigUChar *end, + const struct OnigEncodingTypeST *enc); + int (*code_to_mbclen)(OnigCodePoint code, + const struct OnigEncodingTypeST *enc); + int (*code_to_mbc)(OnigCodePoint code, OnigUChar *buf, + const struct OnigEncodingTypeST *enc); + int (*mbc_case_fold)(OnigCaseFoldType flag, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, + const struct OnigEncodingTypeST *enc); + int (*apply_all_case_fold)(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, + void *arg, const struct OnigEncodingTypeST *enc); + int (*get_case_fold_codes_by_str)(OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, + OnigCaseFoldCodeItem acs[], + const struct OnigEncodingTypeST *enc); + int (*property_name_to_ctype)(const struct OnigEncodingTypeST *enc, + const OnigUChar *p, const OnigUChar *end); + int (*is_code_ctype)(OnigCodePoint code, OnigCtype ctype, + const struct OnigEncodingTypeST *enc); + int (*get_ctype_code_range)(OnigCtype ctype, OnigCodePoint *sb_out, + const OnigCodePoint *ranges[], + const struct OnigEncodingTypeST *enc); + OnigUChar *(*left_adjust_char_head)(const OnigUChar *start, + const OnigUChar *p, const OnigUChar *end, + const struct OnigEncodingTypeST *enc); + int (*is_allowed_reverse_match)(const OnigUChar *p, const OnigUChar *end, + const struct OnigEncodingTypeST *enc); + int (*case_map)(OnigCaseFoldType *flagP, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, OnigUChar *to_end, + const struct OnigEncodingTypeST *enc); + int ruby_encoding_index; + unsigned int flags; +} OnigEncodingType; + +typedef const OnigEncodingType *OnigEncoding; + +ONIG_EXTERN const OnigEncodingType OnigEncodingASCII; +#ifndef RUBY +ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_1; +ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_2; +ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_3; +ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_4; +ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_5; +ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_6; +ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_7; +ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_8; +ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_9; +ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_10; +ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_11; +ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_13; +ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_14; +ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_15; +ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_16; +ONIG_EXTERN const OnigEncodingType OnigEncodingUTF_8; +ONIG_EXTERN const OnigEncodingType OnigEncodingUTF_16BE; +ONIG_EXTERN const OnigEncodingType OnigEncodingUTF_16LE; +ONIG_EXTERN const OnigEncodingType OnigEncodingUTF_32BE; +ONIG_EXTERN const OnigEncodingType OnigEncodingUTF_32LE; +ONIG_EXTERN const OnigEncodingType OnigEncodingEUC_JP; +ONIG_EXTERN const OnigEncodingType OnigEncodingEUC_TW; +ONIG_EXTERN const OnigEncodingType OnigEncodingEUC_KR; +ONIG_EXTERN const OnigEncodingType OnigEncodingEUC_CN; +ONIG_EXTERN const OnigEncodingType OnigEncodingShift_JIS; +ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_31J; +/* ONIG_EXTERN const OnigEncodingType OnigEncodingKOI8; */ +ONIG_EXTERN const OnigEncodingType OnigEncodingKOI8_R; +ONIG_EXTERN const OnigEncodingType OnigEncodingKOI8_U; +ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_1250; +ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_1251; +ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_1252; +ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_1253; +ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_1254; +ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_1257; +ONIG_EXTERN const OnigEncodingType OnigEncodingBIG5; +ONIG_EXTERN const OnigEncodingType OnigEncodingGB18030; +#endif /* RUBY */ + +#define ONIG_ENCODING_ASCII (&OnigEncodingASCII) +#ifndef RUBY +# define ONIG_ENCODING_ISO_8859_1 (&OnigEncodingISO_8859_1) +# define ONIG_ENCODING_ISO_8859_2 (&OnigEncodingISO_8859_2) +# define ONIG_ENCODING_ISO_8859_3 (&OnigEncodingISO_8859_3) +# define ONIG_ENCODING_ISO_8859_4 (&OnigEncodingISO_8859_4) +# define ONIG_ENCODING_ISO_8859_5 (&OnigEncodingISO_8859_5) +# define ONIG_ENCODING_ISO_8859_6 (&OnigEncodingISO_8859_6) +# define ONIG_ENCODING_ISO_8859_7 (&OnigEncodingISO_8859_7) +# define ONIG_ENCODING_ISO_8859_8 (&OnigEncodingISO_8859_8) +# define ONIG_ENCODING_ISO_8859_9 (&OnigEncodingISO_8859_9) +# define ONIG_ENCODING_ISO_8859_10 (&OnigEncodingISO_8859_10) +# define ONIG_ENCODING_ISO_8859_11 (&OnigEncodingISO_8859_11) +# define ONIG_ENCODING_ISO_8859_13 (&OnigEncodingISO_8859_13) +# define ONIG_ENCODING_ISO_8859_14 (&OnigEncodingISO_8859_14) +# define ONIG_ENCODING_ISO_8859_15 (&OnigEncodingISO_8859_15) +# define ONIG_ENCODING_ISO_8859_16 (&OnigEncodingISO_8859_16) +# define ONIG_ENCODING_UTF_8 (&OnigEncodingUTF_8) +# define ONIG_ENCODING_UTF_16BE (&OnigEncodingUTF_16BE) +# define ONIG_ENCODING_UTF_16LE (&OnigEncodingUTF_16LE) +# define ONIG_ENCODING_UTF_32BE (&OnigEncodingUTF_32BE) +# define ONIG_ENCODING_UTF_32LE (&OnigEncodingUTF_32LE) +# define ONIG_ENCODING_EUC_JP (&OnigEncodingEUC_JP) +# define ONIG_ENCODING_EUC_TW (&OnigEncodingEUC_TW) +# define ONIG_ENCODING_EUC_KR (&OnigEncodingEUC_KR) +# define ONIG_ENCODING_EUC_CN (&OnigEncodingEUC_CN) +# define ONIG_ENCODING_SHIFT_JIS (&OnigEncodingShift_JIS) +# define ONIG_ENCODING_WINDOWS_31J (&OnigEncodingWindows_31J) +/* # define ONIG_ENCODING_KOI8 (&OnigEncodingKOI8) */ +# define ONIG_ENCODING_KOI8_R (&OnigEncodingKOI8_R) +# define ONIG_ENCODING_KOI8_U (&OnigEncodingKOI8_U) +# define ONIG_ENCODING_WINDOWS_1250 (&OnigEncodingWindows_1250) +# define ONIG_ENCODING_WINDOWS_1251 (&OnigEncodingWindows_1251) +# define ONIG_ENCODING_WINDOWS_1252 (&OnigEncodingWindows_1252) +# define ONIG_ENCODING_WINDOWS_1253 (&OnigEncodingWindows_1253) +# define ONIG_ENCODING_WINDOWS_1254 (&OnigEncodingWindows_1254) +# define ONIG_ENCODING_WINDOWS_1257 (&OnigEncodingWindows_1257) +# define ONIG_ENCODING_BIG5 (&OnigEncodingBIG5) +# define ONIG_ENCODING_GB18030 (&OnigEncodingGB18030) + +/* old names */ +# define ONIG_ENCODING_SJIS ONIG_ENCODING_SHIFT_JIS +# define ONIG_ENCODING_CP932 ONIG_ENCODING_WINDOWS_31J +# define ONIG_ENCODING_CP1250 ONIG_ENCODING_WINDOWS_1250 +# define ONIG_ENCODING_CP1251 ONIG_ENCODING_WINDOWS_1251 +# define ONIG_ENCODING_CP1252 ONIG_ENCODING_WINDOWS_1252 +# define ONIG_ENCODING_CP1253 ONIG_ENCODING_WINDOWS_1253 +# define ONIG_ENCODING_CP1254 ONIG_ENCODING_WINDOWS_1254 +# define ONIG_ENCODING_CP1257 ONIG_ENCODING_WINDOWS_1257 +# define ONIG_ENCODING_UTF8 ONIG_ENCODING_UTF_8 +# define ONIG_ENCODING_UTF16_BE ONIG_ENCODING_UTF_16BE +# define ONIG_ENCODING_UTF16_LE ONIG_ENCODING_UTF_16LE +# define ONIG_ENCODING_UTF32_BE ONIG_ENCODING_UTF_32BE +# define ONIG_ENCODING_UTF32_LE ONIG_ENCODING_UTF_32LE +#endif /* RUBY */ + +#define ONIG_ENCODING_UNDEF ((OnigEncoding)0) + +/* this declaration needs to be here because it is used in string.c in Ruby */ +ONIG_EXTERN +int onigenc_ascii_only_case_map(OnigCaseFoldType *flagP, const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, + OnigUChar *to_end, + const struct OnigEncodingTypeST *enc); + +/* work size */ +#define ONIGENC_CODE_TO_MBC_MAXLEN 7 +#define ONIGENC_MBC_CASE_FOLD_MAXLEN 18 +/* 18: 6(max-byte) * 3(case-fold chars) */ + +/* character types */ +#define ONIGENC_CTYPE_NEWLINE 0 +#define ONIGENC_CTYPE_ALPHA 1 +#define ONIGENC_CTYPE_BLANK 2 +#define ONIGENC_CTYPE_CNTRL 3 +#define ONIGENC_CTYPE_DIGIT 4 +#define ONIGENC_CTYPE_GRAPH 5 +#define ONIGENC_CTYPE_LOWER 6 +#define ONIGENC_CTYPE_PRINT 7 +#define ONIGENC_CTYPE_PUNCT 8 +#define ONIGENC_CTYPE_SPACE 9 +#define ONIGENC_CTYPE_UPPER 10 +#define ONIGENC_CTYPE_XDIGIT 11 +#define ONIGENC_CTYPE_WORD 12 +#define ONIGENC_CTYPE_ALNUM 13 /* alpha || digit */ +#define ONIGENC_CTYPE_ASCII 14 +#define ONIGENC_MAX_STD_CTYPE ONIGENC_CTYPE_ASCII + +/* flags */ +#define ONIGENC_FLAG_NONE 0U +#define ONIGENC_FLAG_UNICODE 1U + +#define onig_enc_len(enc, p, e) ONIGENC_MBC_ENC_LEN(enc, p, e) + +#define ONIGENC_IS_UNDEF(enc) ((enc) == ONIG_ENCODING_UNDEF) +#define ONIGENC_IS_SINGLEBYTE(enc) (ONIGENC_MBC_MAXLEN(enc) == 1) +#define ONIGENC_IS_MBC_HEAD(enc, p, e) (ONIGENC_MBC_ENC_LEN(enc, p, e) != 1) +#define ONIGENC_IS_MBC_ASCII(p) (*(p) < 128) +#define ONIGENC_IS_CODE_ASCII(code) ((code) < 128) +#define ONIGENC_IS_MBC_WORD(enc, s, end) \ + ONIGENC_IS_CODE_WORD(enc, ONIGENC_MBC_TO_CODE(enc, s, end)) +#define ONIGENC_IS_MBC_ASCII_WORD(enc, s, end) \ + onigenc_ascii_is_code_ctype(ONIGENC_MBC_TO_CODE(enc, s, end), \ + ONIGENC_CTYPE_WORD, enc) +#define ONIGENC_IS_UNICODE(enc) ((enc)->flags & ONIGENC_FLAG_UNICODE) + +#define ONIGENC_NAME(enc) ((enc)->name) + +#define ONIGENC_MBC_CASE_FOLD(enc, flag, pp, end, buf) \ + (enc)->mbc_case_fold(flag, (const OnigUChar **)pp, end, buf, enc) +#define ONIGENC_IS_ALLOWED_REVERSE_MATCH(enc, s, end) \ + (enc)->is_allowed_reverse_match(s, end, enc) +#define ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s, end) \ + (enc)->left_adjust_char_head(start, s, end, enc) +#define ONIGENC_APPLY_ALL_CASE_FOLD(enc, case_fold_flag, f, arg) \ + (enc)->apply_all_case_fold(case_fold_flag, f, arg, enc) +#define ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc, case_fold_flag, p, end, acs) \ + (enc)->get_case_fold_codes_by_str(case_fold_flag, p, end, acs, enc) +#define ONIGENC_STEP_BACK(enc, start, s, end, n) \ + onigenc_step_back((enc), (start), (s), (end), (n)) + +#define ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(n) (n) +#define ONIGENC_MBCLEN_CHARFOUND_P(r) (0 < (r)) +#define ONIGENC_MBCLEN_CHARFOUND_LEN(r) (r) + +#define ONIGENC_CONSTRUCT_MBCLEN_INVALID() (-1) +#define ONIGENC_MBCLEN_INVALID_P(r) ((r) == -1) + +#define ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(n) (-1 - (n)) +#define ONIGENC_MBCLEN_NEEDMORE_P(r) ((r) < -1) +#define ONIGENC_MBCLEN_NEEDMORE_LEN(r) (-1 - (r)) + +#define ONIGENC_PRECISE_MBC_ENC_LEN(enc, p, e) \ + (enc)->precise_mbc_enc_len(p, e, enc) + +ONIG_EXTERN +int onigenc_mbclen_approximate(const OnigUChar *p, const OnigUChar *e, + const struct OnigEncodingTypeST *enc); + +#define ONIGENC_MBC_ENC_LEN(enc, p, e) onigenc_mbclen_approximate(p, e, enc) +#define ONIGENC_MBC_MAXLEN(enc) ((enc)->max_enc_len) +#define ONIGENC_MBC_MAXLEN_DIST(enc) ONIGENC_MBC_MAXLEN(enc) +#define ONIGENC_MBC_MINLEN(enc) ((enc)->min_enc_len) +#define ONIGENC_IS_MBC_NEWLINE(enc, p, end) \ + (enc)->is_mbc_newline((p), (end), enc) +#define ONIGENC_MBC_TO_CODE(enc, p, end) (enc)->mbc_to_code((p), (end), enc) +#define ONIGENC_CODE_TO_MBCLEN(enc, code) (enc)->code_to_mbclen(code, enc) +#define ONIGENC_CODE_TO_MBC(enc, code, buf) (enc)->code_to_mbc(code, buf, enc) +#define ONIGENC_PROPERTY_NAME_TO_CTYPE(enc, p, end) \ + (enc)->property_name_to_ctype(enc, p, end) + +#define ONIGENC_IS_CODE_CTYPE(enc, code, ctype) \ + (enc)->is_code_ctype(code, ctype, enc) + +#define ONIGENC_IS_CODE_NEWLINE(enc, code) \ + ONIGENC_IS_CODE_CTYPE(enc, code, ONIGENC_CTYPE_NEWLINE) +#define ONIGENC_IS_CODE_GRAPH(enc, code) \ + ONIGENC_IS_CODE_CTYPE(enc, code, ONIGENC_CTYPE_GRAPH) +#define ONIGENC_IS_CODE_PRINT(enc, code) \ + ONIGENC_IS_CODE_CTYPE(enc, code, ONIGENC_CTYPE_PRINT) +#define ONIGENC_IS_CODE_ALNUM(enc, code) \ + ONIGENC_IS_CODE_CTYPE(enc, code, ONIGENC_CTYPE_ALNUM) +#define ONIGENC_IS_CODE_ALPHA(enc, code) \ + ONIGENC_IS_CODE_CTYPE(enc, code, ONIGENC_CTYPE_ALPHA) +#define ONIGENC_IS_CODE_LOWER(enc, code) \ + ONIGENC_IS_CODE_CTYPE(enc, code, ONIGENC_CTYPE_LOWER) +#define ONIGENC_IS_CODE_UPPER(enc, code) \ + ONIGENC_IS_CODE_CTYPE(enc, code, ONIGENC_CTYPE_UPPER) +#define ONIGENC_IS_CODE_CNTRL(enc, code) \ + ONIGENC_IS_CODE_CTYPE(enc, code, ONIGENC_CTYPE_CNTRL) +#define ONIGENC_IS_CODE_PUNCT(enc, code) \ + ONIGENC_IS_CODE_CTYPE(enc, code, ONIGENC_CTYPE_PUNCT) +#define ONIGENC_IS_CODE_SPACE(enc, code) \ + ONIGENC_IS_CODE_CTYPE(enc, code, ONIGENC_CTYPE_SPACE) +#define ONIGENC_IS_CODE_BLANK(enc, code) \ + ONIGENC_IS_CODE_CTYPE(enc, code, ONIGENC_CTYPE_BLANK) +#define ONIGENC_IS_CODE_DIGIT(enc, code) \ + ONIGENC_IS_CODE_CTYPE(enc, code, ONIGENC_CTYPE_DIGIT) +#define ONIGENC_IS_CODE_XDIGIT(enc, code) \ + ONIGENC_IS_CODE_CTYPE(enc, code, ONIGENC_CTYPE_XDIGIT) +#define ONIGENC_IS_CODE_WORD(enc, code) \ + ONIGENC_IS_CODE_CTYPE(enc, code, ONIGENC_CTYPE_WORD) + +#define ONIGENC_GET_CTYPE_CODE_RANGE(enc, ctype, sbout, ranges) \ + (enc)->get_ctype_code_range(ctype, sbout, ranges, enc) + +ONIG_EXTERN +OnigUChar *onigenc_step_back(OnigEncoding enc, const OnigUChar *start, + const OnigUChar *s, const OnigUChar *end, int n); + +/* encoding API */ +ONIG_EXTERN +int onigenc_init(void); +ONIG_EXTERN +int onigenc_set_default_encoding(OnigEncoding enc); +ONIG_EXTERN +OnigEncoding onigenc_get_default_encoding(void); +ONIG_EXTERN +OnigUChar *onigenc_get_right_adjust_char_head_with_prev(OnigEncoding enc, + const OnigUChar *start, + const OnigUChar *s, + const OnigUChar *end, + const OnigUChar **prev); +ONIG_EXTERN +OnigUChar *onigenc_get_prev_char_head(OnigEncoding enc, const OnigUChar *start, + const OnigUChar *s, const OnigUChar *end); +ONIG_EXTERN +OnigUChar *onigenc_get_left_adjust_char_head(OnigEncoding enc, + const OnigUChar *start, + const OnigUChar *s, + const OnigUChar *end); +ONIG_EXTERN +OnigUChar *onigenc_get_right_adjust_char_head(OnigEncoding enc, + const OnigUChar *start, + const OnigUChar *s, + const OnigUChar *end); +ONIG_EXTERN +int onigenc_strlen(OnigEncoding enc, const OnigUChar *p, const OnigUChar *end); +ONIG_EXTERN +int onigenc_strlen_null(OnigEncoding enc, const OnigUChar *p); +ONIG_EXTERN +int onigenc_str_bytelen_null(OnigEncoding enc, const OnigUChar *p); + +/* PART: regular expression */ + +/* config parameters */ +#define ONIG_NREGION 10 +#define ONIG_MAX_CAPTURE_GROUP_NUM 32767 +#define ONIG_MAX_BACKREF_NUM 1000 +#define ONIG_MAX_REPEAT_NUM 100000 +#define ONIG_MAX_MULTI_BYTE_RANGES_NUM 10000 +/* constants */ +#define ONIG_MAX_ERROR_MESSAGE_LEN 90 + +typedef unsigned int OnigOptionType; + +#define ONIG_OPTION_DEFAULT ONIG_OPTION_NONE + +/* options */ +#define ONIG_OPTION_NONE 0U +#define ONIG_OPTION_IGNORECASE 1U +#define ONIG_OPTION_EXTEND (ONIG_OPTION_IGNORECASE << 1) +#define ONIG_OPTION_MULTILINE (ONIG_OPTION_EXTEND << 1) +#define ONIG_OPTION_DOTALL ONIG_OPTION_MULTILINE +#define ONIG_OPTION_SINGLELINE (ONIG_OPTION_MULTILINE << 1) +#define ONIG_OPTION_FIND_LONGEST (ONIG_OPTION_SINGLELINE << 1) +#define ONIG_OPTION_FIND_NOT_EMPTY (ONIG_OPTION_FIND_LONGEST << 1) +#define ONIG_OPTION_NEGATE_SINGLELINE (ONIG_OPTION_FIND_NOT_EMPTY << 1) +#define ONIG_OPTION_DONT_CAPTURE_GROUP (ONIG_OPTION_NEGATE_SINGLELINE << 1) +#define ONIG_OPTION_CAPTURE_GROUP (ONIG_OPTION_DONT_CAPTURE_GROUP << 1) +/* options (search time) */ +#define ONIG_OPTION_NOTBOL (ONIG_OPTION_CAPTURE_GROUP << 1) +#define ONIG_OPTION_NOTEOL (ONIG_OPTION_NOTBOL << 1) +#define ONIG_OPTION_NOTBOS (ONIG_OPTION_NOTEOL << 1) +#define ONIG_OPTION_NOTEOS (ONIG_OPTION_NOTBOS << 1) +/* options (ctype range) */ +#define ONIG_OPTION_ASCII_RANGE (ONIG_OPTION_NOTEOS << 1) +#define ONIG_OPTION_POSIX_BRACKET_ALL_RANGE (ONIG_OPTION_ASCII_RANGE << 1) +#define ONIG_OPTION_WORD_BOUND_ALL_RANGE \ + (ONIG_OPTION_POSIX_BRACKET_ALL_RANGE << 1) +/* options (newline) */ +#define ONIG_OPTION_NEWLINE_CRLF (ONIG_OPTION_WORD_BOUND_ALL_RANGE << 1) +#define ONIG_OPTION_MAXBIT ONIG_OPTION_NEWLINE_CRLF /* limit */ + +#define ONIG_OPTION_ON(options, regopt) ((options) |= (regopt)) +#define ONIG_OPTION_OFF(options, regopt) ((options) &= ~(regopt)) +#define ONIG_IS_OPTION_ON(options, option) ((options) & (option)) + +/* syntax */ +typedef struct +{ + unsigned int op; + unsigned int op2; + unsigned int behavior; + OnigOptionType options; /* default option */ + OnigMetaCharTableType meta_char_table; +} OnigSyntaxType; + +ONIG_EXTERN const OnigSyntaxType OnigSyntaxASIS; +ONIG_EXTERN const OnigSyntaxType OnigSyntaxPosixBasic; +ONIG_EXTERN const OnigSyntaxType OnigSyntaxPosixExtended; +ONIG_EXTERN const OnigSyntaxType OnigSyntaxEmacs; +ONIG_EXTERN const OnigSyntaxType OnigSyntaxGrep; +ONIG_EXTERN const OnigSyntaxType OnigSyntaxGnuRegex; +ONIG_EXTERN const OnigSyntaxType OnigSyntaxJava; +ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl58; +ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl58_NG; +ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl; +ONIG_EXTERN const OnigSyntaxType OnigSyntaxRuby; +ONIG_EXTERN const OnigSyntaxType OnigSyntaxPython; + +/* predefined syntaxes (see regsyntax.c) */ +#define ONIG_SYNTAX_ASIS (&OnigSyntaxASIS) +#define ONIG_SYNTAX_POSIX_BASIC (&OnigSyntaxPosixBasic) +#define ONIG_SYNTAX_POSIX_EXTENDED (&OnigSyntaxPosixExtended) +#define ONIG_SYNTAX_EMACS (&OnigSyntaxEmacs) +#define ONIG_SYNTAX_GREP (&OnigSyntaxGrep) +#define ONIG_SYNTAX_GNU_REGEX (&OnigSyntaxGnuRegex) +#define ONIG_SYNTAX_JAVA (&OnigSyntaxJava) +#define ONIG_SYNTAX_PERL58 (&OnigSyntaxPerl58) +#define ONIG_SYNTAX_PERL58_NG (&OnigSyntaxPerl58_NG) +#define ONIG_SYNTAX_PERL (&OnigSyntaxPerl) +#define ONIG_SYNTAX_RUBY (&OnigSyntaxRuby) +#define ONIG_SYNTAX_PYTHON (&OnigSyntaxPython) + +/* default syntax */ +ONIG_EXTERN const OnigSyntaxType *OnigDefaultSyntax; +#define ONIG_SYNTAX_DEFAULT OnigDefaultSyntax + +/* syntax (operators) */ +#define ONIG_SYN_OP_VARIABLE_META_CHARACTERS (1U << 0) +#define ONIG_SYN_OP_DOT_ANYCHAR (1U << 1) /* . */ +#define ONIG_SYN_OP_ASTERISK_ZERO_INF (1U << 2) /* * */ +#define ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF (1U << 3) +#define ONIG_SYN_OP_PLUS_ONE_INF (1U << 4) /* + */ +#define ONIG_SYN_OP_ESC_PLUS_ONE_INF (1U << 5) +#define ONIG_SYN_OP_QMARK_ZERO_ONE (1U << 6) /* ? */ +#define ONIG_SYN_OP_ESC_QMARK_ZERO_ONE (1U << 7) +#define ONIG_SYN_OP_BRACE_INTERVAL (1U << 8) /* {lower,upper} */ +#define ONIG_SYN_OP_ESC_BRACE_INTERVAL (1U << 9) /* \{lower,upper\} */ +#define ONIG_SYN_OP_VBAR_ALT (1U << 10) /* | */ +#define ONIG_SYN_OP_ESC_VBAR_ALT (1U << 11) /* \| */ +#define ONIG_SYN_OP_LPAREN_SUBEXP (1U << 12) /* (...) */ +#define ONIG_SYN_OP_ESC_LPAREN_SUBEXP (1U << 13) /* \(...\) */ +#define ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR (1U << 14) /* \A, \Z, \z */ +#define ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR (1U << 15) /* \G */ +#define ONIG_SYN_OP_DECIMAL_BACKREF (1U << 16) /* \num */ +#define ONIG_SYN_OP_BRACKET_CC (1U << 17) /* [...] */ +#define ONIG_SYN_OP_ESC_W_WORD (1U << 18) /* \w, \W */ +#define ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END (1U << 19) /* \<. \> */ +#define ONIG_SYN_OP_ESC_B_WORD_BOUND (1U << 20) /* \b, \B */ +#define ONIG_SYN_OP_ESC_S_WHITE_SPACE (1U << 21) /* \s, \S */ +#define ONIG_SYN_OP_ESC_D_DIGIT (1U << 22) /* \d, \D */ +#define ONIG_SYN_OP_LINE_ANCHOR (1U << 23) /* ^, $ */ +#define ONIG_SYN_OP_POSIX_BRACKET (1U << 24) /* [:xxxx:] */ +#define ONIG_SYN_OP_QMARK_NON_GREEDY (1U << 25) /* ??,*?,+?,{n,m}? */ +#define ONIG_SYN_OP_ESC_CONTROL_CHARS (1U << 26) /* \n,\r,\t,\a ... */ +#define ONIG_SYN_OP_ESC_C_CONTROL (1U << 27) /* \cx */ +#define ONIG_SYN_OP_ESC_OCTAL3 (1U << 28) /* \OOO */ +#define ONIG_SYN_OP_ESC_X_HEX2 (1U << 29) /* \xHH */ +#define ONIG_SYN_OP_ESC_X_BRACE_HEX8 (1U << 30) /* \x{7HHHHHHH} */ +#define ONIG_SYN_OP_ESC_O_BRACE_OCTAL (1U << 31) /* \o{OOO} */ + +#define ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE (1U << 0) /* \Q...\E */ +#define ONIG_SYN_OP2_QMARK_GROUP_EFFECT (1U << 1) /* (?...) */ +#define ONIG_SYN_OP2_OPTION_PERL \ + (1U << 2) /* (?imsxadlu), (?-imsx), (?^imsxalu) */ +#define ONIG_SYN_OP2_OPTION_RUBY (1U << 3) /* (?imxadu), (?-imx) */ +#define ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT (1U << 4) /* ?+,*+,++ */ +#define ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL (1U << 5) /* {n,m}+ */ +#define ONIG_SYN_OP2_CCLASS_SET_OP (1U << 6) /* [...&&..[..]..] */ +#define ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP (1U << 7) /* (?<name>...) */ +#define ONIG_SYN_OP2_ESC_K_NAMED_BACKREF (1U << 8) /* \k<name> */ +#define ONIG_SYN_OP2_ESC_G_SUBEXP_CALL (1U << 9) /* \g<name>, \g<n> */ +#define ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY (1U << 10) /* (?@..),(?@<x>..) */ +#define ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL (1U << 11) /* \C-x */ +#define ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META (1U << 12) /* \M-x */ +#define ONIG_SYN_OP2_ESC_V_VTAB (1U << 13) /* \v as VTAB */ +#define ONIG_SYN_OP2_ESC_U_HEX4 (1U << 14) /* \uHHHH */ +#define ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR (1U << 15) /* \`, \' */ +#define ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY (1U << 16) /* \p{...}, \P{...} \ + */ +#define ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT \ + (1U << 17) /* \p{^..}, \P{^..} */ +/* #define ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS (1U<<18) */ +#define ONIG_SYN_OP2_ESC_H_XDIGIT (1U << 19) /* \h, \H */ +#define ONIG_SYN_OP2_INEFFECTIVE_ESCAPE (1U << 20) /* \ */ +#define ONIG_SYN_OP2_ESC_CAPITAL_R_LINEBREAK \ + (1U << 21) /* \R as (?>\x0D\x0A|[\x0A-\x0D\x{85}\x{2028}\x{2029}]) */ +#define ONIG_SYN_OP2_ESC_CAPITAL_X_EXTENDED_GRAPHEME_CLUSTER (1U << 22) /* \X \ + */ +#define ONIG_SYN_OP2_ESC_V_VERTICAL_WHITESPACE \ + (1U << 23) /* \v, \V -- Perl */ /* NOTIMPL */ +#define ONIG_SYN_OP2_ESC_H_HORIZONTAL_WHITESPACE \ + (1U << 24) /* \h, \H -- Perl */ /* NOTIMPL */ +#define ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP (1U << 25) /* \K */ +#define ONIG_SYN_OP2_ESC_G_BRACE_BACKREF (1U << 26) /* \g{name}, \g{n} */ +#define ONIG_SYN_OP2_QMARK_SUBEXP_CALL \ + (1U << 27) /* (?&name), (?n), (?R), (?0) */ +#define ONIG_SYN_OP2_QMARK_VBAR_BRANCH_RESET \ + (1U << 28) /* (?|...) */ /* NOTIMPL */ +#define ONIG_SYN_OP2_QMARK_LPAREN_CONDITION \ + (1U << 29) /* (?(cond)yes...|no...) */ +#define ONIG_SYN_OP2_QMARK_CAPITAL_P_NAMED_GROUP \ + (1U << 30) /* (?P<name>...), (?P=name), (?P>name) -- Python/PCRE */ +#define ONIG_SYN_OP2_QMARK_TILDE_ABSENT (1U << 31) /* (?~...) */ +/* #define ONIG_SYN_OP2_OPTION_JAVA (1U<<xx) */ +/* (?idmsux), (?-idmsux) */ /* NOTIMPL */ + +/* syntax (behavior) */ +#define ONIG_SYN_CONTEXT_INDEP_ANCHORS (1U << 31) /* not implemented */ +#define ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS (1U << 0) /* ?, *, +, {n,m} */ +#define ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS (1U << 1) /* error or ignore */ +#define ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP (1U << 2) /* ...)... */ +#define ONIG_SYN_ALLOW_INVALID_INTERVAL (1U << 3) /* {??? */ +#define ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV (1U << 4) /* {,n} => {0,n} */ +#define ONIG_SYN_STRICT_CHECK_BACKREF (1U << 5) /* /(\1)/,/\1()/ ..*/ +#define ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND (1U << 6) /* (?<=a|bc) */ +#define ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP (1U << 7) /* see doc/RE */ +#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME (1U << 8) /* (?<x>)(?<x>) */ +#define ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY (1U << 9) /* a{n}?=(?:a{n})? */ +#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME_CALL \ + (1U << 10) /* (?<x>)(?<x>)(?&x) */ +#define ONIG_SYN_USE_LEFT_MOST_NAMED_GROUP (1U << 11) /* (?<x>)(?<x>)\k<x> */ + +/* syntax (behavior) in char class [...] */ +#define ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC (1U << 20) /* [^...] */ +#define ONIG_SYN_BACKSLASH_ESCAPE_IN_CC (1U << 21) /* [..\w..] etc.. */ +#define ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC (1U << 22) +#define ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC (1U << 23) /* [0-9-a]=[0-9\-a] */ +/* syntax (behavior) warning */ +#define ONIG_SYN_WARN_CC_OP_NOT_ESCAPED (1U << 24) /* [,-,] */ +#define ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT (1U << 25) /* (?:a*)+ */ +#define ONIG_SYN_WARN_CC_DUP (1U << 26) /* [aa] */ + +/* meta character specifiers (onig_set_meta_char()) */ +#define ONIG_META_CHAR_ESCAPE 0 +#define ONIG_META_CHAR_ANYCHAR 1 +#define ONIG_META_CHAR_ANYTIME 2 +#define ONIG_META_CHAR_ZERO_OR_ONE_TIME 3 +#define ONIG_META_CHAR_ONE_OR_MORE_TIME 4 +#define ONIG_META_CHAR_ANYCHAR_ANYTIME 5 + +#define ONIG_INEFFECTIVE_META_CHAR 0 + +/* error codes */ +#define ONIG_IS_PATTERN_ERROR(ecode) ((ecode) <= -100 && (ecode) > -1000) +/* normal return */ +#define ONIG_NORMAL 0 +#define ONIG_MISMATCH -1 +#define ONIG_NO_SUPPORT_CONFIG -2 + +/* internal error */ +#define ONIGERR_MEMORY -5 +#define ONIGERR_TYPE_BUG -6 +#define ONIGERR_PARSER_BUG -11 +#define ONIGERR_STACK_BUG -12 +#define ONIGERR_UNDEFINED_BYTECODE -13 +#define ONIGERR_UNEXPECTED_BYTECODE -14 +#define ONIGERR_MATCH_STACK_LIMIT_OVER -15 +#define ONIGERR_PARSE_DEPTH_LIMIT_OVER -16 +#define ONIGERR_DEFAULT_ENCODING_IS_NOT_SET -21 +#define ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR -22 +/* general error */ +#define ONIGERR_INVALID_ARGUMENT -30 +/* syntax error */ +#define ONIGERR_END_PATTERN_AT_LEFT_BRACE -100 +#define ONIGERR_END_PATTERN_AT_LEFT_BRACKET -101 +#define ONIGERR_EMPTY_CHAR_CLASS -102 +#define ONIGERR_PREMATURE_END_OF_CHAR_CLASS -103 +#define ONIGERR_END_PATTERN_AT_ESCAPE -104 +#define ONIGERR_END_PATTERN_AT_META -105 +#define ONIGERR_END_PATTERN_AT_CONTROL -106 +#define ONIGERR_META_CODE_SYNTAX -108 +#define ONIGERR_CONTROL_CODE_SYNTAX -109 +#define ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE -110 +#define ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE -111 +#define ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS -112 +#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED -113 +#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID -114 +#define ONIGERR_NESTED_REPEAT_OPERATOR -115 +#define ONIGERR_UNMATCHED_CLOSE_PARENTHESIS -116 +#define ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS -117 +#define ONIGERR_END_PATTERN_IN_GROUP -118 +#define ONIGERR_UNDEFINED_GROUP_OPTION -119 +#define ONIGERR_INVALID_POSIX_BRACKET_TYPE -121 +#define ONIGERR_INVALID_LOOK_BEHIND_PATTERN -122 +#define ONIGERR_INVALID_REPEAT_RANGE_PATTERN -123 +#define ONIGERR_INVALID_CONDITION_PATTERN -124 +/* values error (syntax error) */ +#define ONIGERR_TOO_BIG_NUMBER -200 +#define ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE -201 +#define ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE -202 +#define ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS -203 +#define ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE -204 +#define ONIGERR_TOO_MANY_MULTI_BYTE_RANGES -205 +#define ONIGERR_TOO_SHORT_MULTI_BYTE_STRING -206 +#define ONIGERR_TOO_BIG_BACKREF_NUMBER -207 +#define ONIGERR_INVALID_BACKREF -208 +#define ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED -209 +#define ONIGERR_TOO_MANY_CAPTURE_GROUPS -210 +#define ONIGERR_TOO_SHORT_DIGITS -211 +#define ONIGERR_TOO_LONG_WIDE_CHAR_VALUE -212 +#define ONIGERR_EMPTY_GROUP_NAME -214 +#define ONIGERR_INVALID_GROUP_NAME -215 +#define ONIGERR_INVALID_CHAR_IN_GROUP_NAME -216 +#define ONIGERR_UNDEFINED_NAME_REFERENCE -217 +#define ONIGERR_UNDEFINED_GROUP_REFERENCE -218 +#define ONIGERR_MULTIPLEX_DEFINED_NAME -219 +#define ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL -220 +#define ONIGERR_NEVER_ENDING_RECURSION -221 +#define ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY -222 +#define ONIGERR_INVALID_CHAR_PROPERTY_NAME -223 +#define ONIGERR_INVALID_CODE_POINT_VALUE -400 +#define ONIGERR_INVALID_WIDE_CHAR_VALUE -400 +#define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE -401 +#define ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION -402 +#define ONIGERR_INVALID_COMBINATION_OF_OPTIONS -403 + +/* errors related to thread */ +/* #define ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT -1001 */ + +/* must be smaller than BIT_STATUS_BITS_NUM (unsigned int * 8) */ +#define ONIG_MAX_CAPTURE_HISTORY_GROUP 31 +#define ONIG_IS_CAPTURE_HISTORY_GROUP(r, i) \ + ((i) <= ONIG_MAX_CAPTURE_HISTORY_GROUP && (r)->list && (r)->list[i]) + +typedef struct OnigCaptureTreeNodeStruct +{ + int group; /* group number */ + OnigPosition beg; + OnigPosition end; + int allocated; + int num_childs; + struct OnigCaptureTreeNodeStruct **childs; +} OnigCaptureTreeNode; + +/* match result region type */ +struct re_registers +{ + int allocated; + int num_regs; + OnigPosition *beg; + OnigPosition *end; + /* extended */ + OnigCaptureTreeNode *history_root; /* capture history tree root */ +}; + +/* capture tree traverse */ +#define ONIG_TRAVERSE_CALLBACK_AT_FIRST 1 +#define ONIG_TRAVERSE_CALLBACK_AT_LAST 2 +#define ONIG_TRAVERSE_CALLBACK_AT_BOTH \ + (ONIG_TRAVERSE_CALLBACK_AT_FIRST | ONIG_TRAVERSE_CALLBACK_AT_LAST) + +#define ONIG_REGION_NOTPOS -1 + +typedef struct re_registers OnigRegion; + +typedef struct +{ + OnigEncoding enc; + OnigUChar *par; + OnigUChar *par_end; +} OnigErrorInfo; + +typedef struct +{ + int lower; + int upper; +} OnigRepeatRange; + +typedef void (*OnigWarnFunc)(const char *s); +extern void onig_null_warn(const char *s); +#define ONIG_NULL_WARN onig_null_warn + +#define ONIG_CHAR_TABLE_SIZE 256 + +typedef struct re_pattern_buffer +{ + /* common members of BBuf(bytes-buffer) */ + unsigned char *p; /* compiled pattern */ + unsigned int used; /* used space for p */ + unsigned int alloc; /* allocated space for p */ + + int num_mem; /* used memory(...) num counted from 1 */ + int num_repeat; /* OP_REPEAT/OP_REPEAT_NG id-counter */ + int num_null_check; /* OP_NULL_CHECK_START/END id counter */ + int num_comb_exp_check; /* combination explosion check */ + int num_call; /* number of subexp call */ + unsigned int capture_history; /* (?@...) flag (1-31) */ + unsigned int bt_mem_start; /* need backtrack flag */ + unsigned int bt_mem_end; /* need backtrack flag */ + int stack_pop_level; + int repeat_range_alloc; + + OnigOptionType options; + + OnigRepeatRange *repeat_range; + + OnigEncoding enc; + const OnigSyntaxType *syntax; + void *name_table; + OnigCaseFoldType case_fold_flag; + + /* optimization info (string search, char-map and anchors) */ + int optimize; /* optimize flag */ + int threshold_len; /* search str-length for apply optimize */ + int anchor; /* BEGIN_BUF, BEGIN_POS, (SEMI_)END_BUF */ + OnigDistance anchor_dmin; /* (SEMI_)END_BUF anchor distance */ + OnigDistance anchor_dmax; /* (SEMI_)END_BUF anchor distance */ + int sub_anchor; /* start-anchor for exact or map */ + unsigned char *exact; + unsigned char *exact_end; + unsigned char map[ONIG_CHAR_TABLE_SIZE]; /* used as BM skip or char-map */ + int *int_map; /* BM skip for exact_len > 255 */ + int *int_map_backward; /* BM skip for backward search */ + OnigDistance dmin; /* min-distance of exact or map */ + OnigDistance dmax; /* max-distance of exact or map */ + + /* regex_t link chain */ + struct re_pattern_buffer *chain; /* escape compile-conflict */ +} OnigRegexType; + +typedef OnigRegexType *OnigRegex; + +#ifndef ONIG_ESCAPE_REGEX_T_COLLISION +typedef OnigRegexType regex_t; +#endif + +typedef struct +{ + int num_of_elements; + OnigEncoding pattern_enc; + OnigEncoding target_enc; + const OnigSyntaxType *syntax; + OnigOptionType option; + OnigCaseFoldType case_fold_flag; +} OnigCompileInfo; + +/* Oniguruma Native API */ +ONIG_EXTERN +int onig_initialize(OnigEncoding encodings[], int n); +ONIG_EXTERN +int onig_init(void); +ONIG_EXTERN +int onig_error_code_to_str(OnigUChar *s, OnigPosition err_code, ...); +ONIG_EXTERN +void onig_set_warn_func(OnigWarnFunc f); +ONIG_EXTERN +void onig_set_verb_warn_func(OnigWarnFunc f); +ONIG_EXTERN +int onig_new(OnigRegex *, const OnigUChar *pattern, + const OnigUChar *pattern_end, OnigOptionType option, + OnigEncoding enc, const OnigSyntaxType *syntax, + OnigErrorInfo *einfo); +ONIG_EXTERN +int onig_reg_init(OnigRegex reg, OnigOptionType option, + OnigCaseFoldType case_fold_flag, OnigEncoding enc, + const OnigSyntaxType *syntax); +ONIG_EXTERN +int onig_new_without_alloc(OnigRegex, const OnigUChar *pattern, + const OnigUChar *pattern_end, OnigOptionType option, + OnigEncoding enc, const OnigSyntaxType *syntax, + OnigErrorInfo *einfo); +ONIG_EXTERN +int onig_new_deluxe(OnigRegex *reg, const OnigUChar *pattern, + const OnigUChar *pattern_end, OnigCompileInfo *ci, + OnigErrorInfo *einfo); +ONIG_EXTERN +void onig_free(OnigRegex); +ONIG_EXTERN +void onig_free_body(OnigRegex); +ONIG_EXTERN +OnigPosition onig_scan(OnigRegex reg, const OnigUChar *str, + const OnigUChar *end, OnigRegion *region, + OnigOptionType option, + int (*scan_callback)(OnigPosition, OnigPosition, + OnigRegion *, void *), + void *callback_arg); +ONIG_EXTERN +OnigPosition onig_search(OnigRegex, const OnigUChar *str, const OnigUChar *end, + const OnigUChar *start, const OnigUChar *range, + OnigRegion *region, OnigOptionType option); +ONIG_EXTERN +OnigPosition onig_search_gpos(OnigRegex, const OnigUChar *str, + const OnigUChar *end, const OnigUChar *global_pos, + const OnigUChar *start, const OnigUChar *range, + OnigRegion *region, OnigOptionType option); +ONIG_EXTERN +OnigPosition onig_match(OnigRegex, const OnigUChar *str, const OnigUChar *end, + const OnigUChar *at, OnigRegion *region, + OnigOptionType option); +ONIG_EXTERN +OnigRegion *onig_region_new(void); +ONIG_EXTERN +void onig_region_init(OnigRegion *region); +ONIG_EXTERN +void onig_region_free(OnigRegion *region, int free_self); +ONIG_EXTERN +void onig_region_copy(OnigRegion *to, const OnigRegion *from); +ONIG_EXTERN +void onig_region_clear(OnigRegion *region); +ONIG_EXTERN +int onig_region_resize(OnigRegion *region, int n); +ONIG_EXTERN +int onig_region_set(OnigRegion *region, int at, int beg, int end); +ONIG_EXTERN +int onig_name_to_group_numbers(OnigRegex reg, const OnigUChar *name, + const OnigUChar *name_end, int **nums); +ONIG_EXTERN +int onig_name_to_backref_number(OnigRegex reg, const OnigUChar *name, + const OnigUChar *name_end, + const OnigRegion *region); +ONIG_EXTERN +int onig_foreach_name(OnigRegex reg, + int (*func)(const OnigUChar *, const OnigUChar *, int, + int *, OnigRegex, void *), + void *arg); +ONIG_EXTERN +int onig_number_of_names(const OnigRegexType *reg); +ONIG_EXTERN +int onig_number_of_captures(const OnigRegexType *reg); +ONIG_EXTERN +int onig_number_of_capture_histories(const OnigRegexType *reg); +ONIG_EXTERN +OnigCaptureTreeNode *onig_get_capture_tree(OnigRegion *region); +ONIG_EXTERN +int onig_capture_tree_traverse(OnigRegion *region, int at, + int (*callback_func)(int, OnigPosition, + OnigPosition, int, int, + void *), + void *arg); +ONIG_EXTERN +int onig_noname_group_capture_is_active(const OnigRegexType *reg); +ONIG_EXTERN +OnigEncoding onig_get_encoding(const OnigRegexType *reg); +ONIG_EXTERN +OnigOptionType onig_get_options(const OnigRegexType *reg); +ONIG_EXTERN +OnigCaseFoldType onig_get_case_fold_flag(const OnigRegexType *reg); +ONIG_EXTERN +const OnigSyntaxType *onig_get_syntax(const OnigRegexType *reg); +ONIG_EXTERN +int onig_set_default_syntax(const OnigSyntaxType *syntax); +ONIG_EXTERN +void onig_copy_syntax(OnigSyntaxType *to, const OnigSyntaxType *from); +ONIG_EXTERN +unsigned int onig_get_syntax_op(const OnigSyntaxType *syntax); +ONIG_EXTERN +unsigned int onig_get_syntax_op2(const OnigSyntaxType *syntax); +ONIG_EXTERN +unsigned int onig_get_syntax_behavior(const OnigSyntaxType *syntax); +ONIG_EXTERN +OnigOptionType onig_get_syntax_options(const OnigSyntaxType *syntax); +ONIG_EXTERN +void onig_set_syntax_op(OnigSyntaxType *syntax, unsigned int op); +ONIG_EXTERN +void onig_set_syntax_op2(OnigSyntaxType *syntax, unsigned int op2); +ONIG_EXTERN +void onig_set_syntax_behavior(OnigSyntaxType *syntax, unsigned int behavior); +ONIG_EXTERN +void onig_set_syntax_options(OnigSyntaxType *syntax, OnigOptionType options); +ONIG_EXTERN +int onig_set_meta_char(OnigSyntaxType *syntax, unsigned int what, + OnigCodePoint code); +ONIG_EXTERN +void onig_copy_encoding(OnigEncodingType *to, OnigEncoding from); +ONIG_EXTERN +OnigCaseFoldType onig_get_default_case_fold_flag(void); +ONIG_EXTERN +int onig_set_default_case_fold_flag(OnigCaseFoldType case_fold_flag); +ONIG_EXTERN +unsigned int onig_get_match_stack_limit_size(void); +ONIG_EXTERN +int onig_set_match_stack_limit_size(unsigned int size); +ONIG_EXTERN +unsigned int onig_get_parse_depth_limit(void); +ONIG_EXTERN +int onig_set_parse_depth_limit(unsigned int depth); +ONIG_EXTERN +int onig_end(void); +ONIG_EXTERN +const char *onig_version(void); +ONIG_EXTERN +const char *onig_copyright(void); + +RUBY_SYMBOL_EXPORT_END + +#ifdef __cplusplus +# if 0 +{ /* satisfy cc-mode */ +# endif +} +#endif + +#endif /* ONIGMO_H */ diff --git a/lib/edbee-lib/vendor/onig/onigmo.pc.in b/lib/edbee-lib/vendor/onig/onigmo.pc.in new file mode 100644 index 00000000..40c5f845 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/onigmo.pc.in @@ -0,0 +1,14 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ +datarootdir=@datarootdir@ +datadir=@datadir@ + +Name: onigmo +Description: Regular expression library +Version: @PACKAGE_VERSION@ +Requires: +Libs: -L${libdir} -lonigmo +Cflags: -I${includedir} + diff --git a/lib/edbee-lib/vendor/onig/onigmo.py b/lib/edbee-lib/vendor/onig/onigmo.py new file mode 100644 index 00000000..79439b25 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/onigmo.py @@ -0,0 +1,627 @@ +# -*- coding: utf-8 -*- + +"""Using Onigmo (Oniguruma-mod) regular expression library. + +This is a low level wrapper for Onigmo regular expression DLL/shared object. +(This module does not support static link library.) +This provides almost same API as the original C API, so the API is not +object oriented. + +Onigmo DLL (onigmo.dll, libonigmo.so, etc.) must be placed in the +default search path. The default search path depends on the system. +""" + +import ctypes +import os +import sys + +#__all__ = ["onig_new", "onig_free", +# "onig_search", "onig_match", +# "onig_region_new", "onig_region_free", +# "onig_version", "onig_copyright"] + +# +# Onigmo API version +# (Must be synchronized with LTVERSION in configure.ac.) +# +_onig_api_version = 6 + +# +# Type Definitions +# + +OnigCodePoint = ctypes.c_uint + +class OnigRegexType(ctypes.Structure): + _fields_ = [ + ] +regex_t = OnigRegexType +OnigRegex = ctypes.POINTER(OnigRegexType) + +try: + # Python 2.7 + _c_ssize_t = ctypes.c_ssize_t +except AttributeError: + # Python 2.6 + if ctypes.sizeof(ctypes.c_int) == ctypes.sizeof(ctypes.c_void_p): + _c_ssize_t = ctypes.c_int + elif ctypes.sizeof(ctypes.c_long) == ctypes.sizeof(ctypes.c_void_p): + _c_ssize_t = ctypes.c_long + elif ctypes.sizeof(ctypes.c_longlong) == ctypes.sizeof(ctypes.c_void_p): + _c_ssize_t = ctypes.c_longlong + +class OnigRegion(ctypes.Structure): + _fields_ = [ + ("allocated", ctypes.c_int), + ("num_regs", ctypes.c_int), + ("beg", ctypes.POINTER(_c_ssize_t)), + ("end", ctypes.POINTER(_c_ssize_t)), + ("history_root",ctypes.c_void_p), + ] +re_registers = OnigRegion + +OnigOptionType = ctypes.c_int + +class OnigEncodingType(ctypes.Structure): + _fields_ = [ + ("mbc_enc_len", ctypes.c_void_p), + ("name", ctypes.c_char_p), + ("max_enc_len", ctypes.c_int), + ("min_enc_len", ctypes.c_int), + ("is_mbc_newline", ctypes.c_void_p), + ("mbc_to_code", ctypes.c_void_p), + ("code_to_mbclen", ctypes.c_void_p), + ("code_to_mbc", ctypes.c_void_p), + ("mbc_case_fold", ctypes.c_void_p), + ("apply_all_case_fold", ctypes.c_void_p), + ("get_case_fold_codes_by_str", ctypes.c_void_p), + ("property_name_to_ctype", ctypes.c_void_p), + ("is_code_ctype", ctypes.c_void_p), + ("get_ctype_code_range", ctypes.c_void_p), + ("left_adjust_char_head", ctypes.c_void_p), + ("is_allowed_reverse_match",ctypes.c_void_p), + ("case_map", ctypes.c_void_p), + ("ruby_encoding_index", ctypes.c_int), + ("flags", ctypes.c_int), + ] +OnigEncoding = ctypes.POINTER(OnigEncodingType) + +class OnigMetaCharTableType(ctypes.Structure): + _fields_ = [ + ("esc", OnigCodePoint), + ("anychar", OnigCodePoint), + ("anytime", OnigCodePoint), + ("zero_or_one_time",OnigCodePoint), + ("one_or_one_time", OnigCodePoint), + ("anychar_anytime", OnigCodePoint), + ] + +class OnigSyntaxType(ctypes.Structure): + _fields_ = [ + ("op", ctypes.c_uint), + ("op2", ctypes.c_uint), + ("behavior", ctypes.c_uint), + ("options", OnigOptionType), + ("meta_char_table", OnigMetaCharTableType), + ] + +class OnigErrorInfo(ctypes.Structure): + _fields_ = [ + ("enc", OnigEncoding), + ("par", ctypes.c_char_p), + ("par_end", ctypes.c_char_p), + ] + + +# load the DLL or the shared library + +if os.name in ("nt", "ce"): + # Win32 + _libname = "onigmo.dll" + try: + libonig = ctypes.cdll.LoadLibrary(_libname) + except OSError: + # Sometimes MinGW version has a prefix "lib". + _libname = "libonigmo.dll" + try: + libonig = ctypes.cdll.LoadLibrary(_libname) + except OSError: + # Sometimes MinGW version has the API version. + _libname = "libonigmo-%d.dll" % _onig_api_version + libonig = ctypes.cdll.LoadLibrary(_libname) +elif sys.platform == "cygwin": + # Cygwin + _libname = "cygonigmo-%d.dll" % _onig_api_version + libonig = ctypes.cdll.LoadLibrary(_libname) +elif sys.platform == "msys": + # MSYS/MSYS2 + _libname = "msys-onigmo-%d.dll" % _onig_api_version + libonig = ctypes.cdll.LoadLibrary(_libname) +elif sys.platform == "darwin": + # Mac + _libname = "libonigmo.dylib" + libonig = ctypes.cdll.LoadLibrary(_libname) +else: + # Unix + _libname = "libonigmo.so" + libonig = ctypes.cdll.LoadLibrary(_libname) + +# +# Encodings +# +def _load_encoding(enc): + return ctypes.pointer(OnigEncodingType.in_dll(libonig, enc)) + +ONIG_ENCODING_ASCII = _load_encoding("OnigEncodingASCII") +ONIG_ENCODING_ISO_8859_1 = _load_encoding("OnigEncodingISO_8859_1") +ONIG_ENCODING_ISO_8859_2 = _load_encoding("OnigEncodingISO_8859_2") +ONIG_ENCODING_ISO_8859_3 = _load_encoding("OnigEncodingISO_8859_3") +ONIG_ENCODING_ISO_8859_4 = _load_encoding("OnigEncodingISO_8859_4") +ONIG_ENCODING_ISO_8859_5 = _load_encoding("OnigEncodingISO_8859_5") +ONIG_ENCODING_ISO_8859_6 = _load_encoding("OnigEncodingISO_8859_6") +ONIG_ENCODING_ISO_8859_7 = _load_encoding("OnigEncodingISO_8859_7") +ONIG_ENCODING_ISO_8859_8 = _load_encoding("OnigEncodingISO_8859_8") +ONIG_ENCODING_ISO_8859_9 = _load_encoding("OnigEncodingISO_8859_9") +ONIG_ENCODING_ISO_8859_10 = _load_encoding("OnigEncodingISO_8859_10") +ONIG_ENCODING_ISO_8859_11 = _load_encoding("OnigEncodingISO_8859_11") +ONIG_ENCODING_ISO_8859_13 = _load_encoding("OnigEncodingISO_8859_13") +ONIG_ENCODING_ISO_8859_14 = _load_encoding("OnigEncodingISO_8859_14") +ONIG_ENCODING_ISO_8859_15 = _load_encoding("OnigEncodingISO_8859_15") +ONIG_ENCODING_ISO_8859_16 = _load_encoding("OnigEncodingISO_8859_16") +ONIG_ENCODING_UTF_8 = _load_encoding("OnigEncodingUTF_8") +ONIG_ENCODING_UTF_16LE = _load_encoding("OnigEncodingUTF_16LE") +ONIG_ENCODING_UTF_16BE = _load_encoding("OnigEncodingUTF_16BE") +ONIG_ENCODING_UTF_32LE = _load_encoding("OnigEncodingUTF_32LE") +ONIG_ENCODING_UTF_32BE = _load_encoding("OnigEncodingUTF_32BE") +ONIG_ENCODING_UTF8 = ONIG_ENCODING_UTF_8 +ONIG_ENCODING_UTF16_LE = ONIG_ENCODING_UTF_16LE +ONIG_ENCODING_UTF16_BE = ONIG_ENCODING_UTF_16BE +ONIG_ENCODING_UTF32_LE = ONIG_ENCODING_UTF_32LE +ONIG_ENCODING_UTF32_BE = ONIG_ENCODING_UTF_32BE +ONIG_ENCODING_EUC_JP = _load_encoding("OnigEncodingEUC_JP") +ONIG_ENCODING_EUC_TW = _load_encoding("OnigEncodingEUC_TW") +ONIG_ENCODING_EUC_KR = _load_encoding("OnigEncodingEUC_KR") +ONIG_ENCODING_EUC_CN = _load_encoding("OnigEncodingEUC_CN") +ONIG_ENCODING_SHIFT_JIS = _load_encoding("OnigEncodingShift_JIS") +ONIG_ENCODING_WINDOWS_31J = _load_encoding("OnigEncodingWindows_31J") +ONIG_ENCODING_SJIS = ONIG_ENCODING_SHIFT_JIS +ONIG_ENCODING_CP932 = ONIG_ENCODING_WINDOWS_31J +#ONIG_ENCODING_KOI8 = _load_encoding("OnigEncodingKOI8") +ONIG_ENCODING_KOI8_R = _load_encoding("OnigEncodingKOI8_R") +ONIG_ENCODING_KOI8_U = _load_encoding("OnigEncodingKOI8_U") +ONIG_ENCODING_WINDOWS_1250 = _load_encoding("OnigEncodingWindows_1250") +ONIG_ENCODING_WINDOWS_1251 = _load_encoding("OnigEncodingWindows_1251") +ONIG_ENCODING_WINDOWS_1252 = _load_encoding("OnigEncodingWindows_1252") +ONIG_ENCODING_WINDOWS_1253 = _load_encoding("OnigEncodingWindows_1253") +ONIG_ENCODING_WINDOWS_1254 = _load_encoding("OnigEncodingWindows_1254") +ONIG_ENCODING_WINDOWS_1257 = _load_encoding("OnigEncodingWindows_1257") +ONIG_ENCODING_CP1250 = ONIG_ENCODING_WINDOWS_1250 +ONIG_ENCODING_CP1251 = ONIG_ENCODING_WINDOWS_1251 +ONIG_ENCODING_CP1252 = ONIG_ENCODING_WINDOWS_1252 +ONIG_ENCODING_CP1253 = ONIG_ENCODING_WINDOWS_1253 +ONIG_ENCODING_CP1254 = ONIG_ENCODING_WINDOWS_1254 +ONIG_ENCODING_CP1257 = ONIG_ENCODING_WINDOWS_1257 +ONIG_ENCODING_BIG5 = _load_encoding("OnigEncodingBIG5") +ONIG_ENCODING_GB18030 = _load_encoding("OnigEncodingGB18030") + +#ONIG_ENCODING_UNDEF = None + + +# +# Syntaxes +# +def _load_syntax(syn): + return ctypes.pointer(OnigSyntaxType.in_dll(libonig, syn)) + +ONIG_SYNTAX_ASIS = _load_syntax("OnigSyntaxASIS") +ONIG_SYNTAX_POSIX_BASIC = _load_syntax("OnigSyntaxPosixBasic") +ONIG_SYNTAX_POSIX_EXTENDED = _load_syntax("OnigSyntaxPosixExtended") +ONIG_SYNTAX_EMACS = _load_syntax("OnigSyntaxEmacs") +ONIG_SYNTAX_GREP = _load_syntax("OnigSyntaxGrep") +ONIG_SYNTAX_GNU_REGEX = _load_syntax("OnigSyntaxGnuRegex") +ONIG_SYNTAX_JAVA = _load_syntax("OnigSyntaxJava") +ONIG_SYNTAX_PERL = _load_syntax("OnigSyntaxPerl") +ONIG_SYNTAX_PERL58 = _load_syntax("OnigSyntaxPerl58") +ONIG_SYNTAX_PERL58_NG = _load_syntax("OnigSyntaxPerl58_NG") +ONIG_SYNTAX_RUBY = _load_syntax("OnigSyntaxRuby") +ONIG_SYNTAX_PYTHON = _load_syntax("OnigSyntaxPython") + +ONIG_SYNTAX_DEFAULT = ctypes.POINTER(OnigSyntaxType).in_dll( + libonig, "OnigDefaultSyntax") + + +# +# Constants +# + +ONIG_MAX_ERROR_MESSAGE_LEN = 90 + +# options +ONIG_OPTION_NONE = 0 +ONIG_OPTION_IGNORECASE = 1 +ONIG_OPTION_EXTEND = (ONIG_OPTION_IGNORECASE << 1) +ONIG_OPTION_MULTILINE = (ONIG_OPTION_EXTEND << 1) +ONIG_OPTION_DOTALL = ONIG_OPTION_MULTILINE +ONIG_OPTION_SINGLELINE = (ONIG_OPTION_MULTILINE << 1) +ONIG_OPTION_FIND_LONGEST = (ONIG_OPTION_SINGLELINE << 1) +ONIG_OPTION_FIND_NOT_EMPTY = (ONIG_OPTION_FIND_LONGEST << 1) +ONIG_OPTION_NEGATE_SINGLELINE = (ONIG_OPTION_FIND_NOT_EMPTY << 1) +ONIG_OPTION_DONT_CAPTURE_GROUP = (ONIG_OPTION_NEGATE_SINGLELINE << 1) +ONIG_OPTION_CAPTURE_GROUP = (ONIG_OPTION_DONT_CAPTURE_GROUP << 1) +# options (search time) +ONIG_OPTION_NOTBOL = (ONIG_OPTION_CAPTURE_GROUP << 1) +ONIG_OPTION_NOTEOL = (ONIG_OPTION_NOTBOL << 1) +ONIG_OPTION_NOTBOS = (ONIG_OPTION_NOTEOL << 1) +ONIG_OPTION_NOTEOS = (ONIG_OPTION_NOTBOS << 1) +# options (ctype range) +ONIG_OPTION_ASCII_RANGE = (ONIG_OPTION_NOTEOS << 1) +ONIG_OPTION_POSIX_BRACKET_ALL_RANGE = (ONIG_OPTION_ASCII_RANGE << 1) +ONIG_OPTION_WORD_BOUND_ALL_RANGE = (ONIG_OPTION_POSIX_BRACKET_ALL_RANGE << 1) +# options (newline) +ONIG_OPTION_NEWLINE_CRLF = (ONIG_OPTION_WORD_BOUND_ALL_RANGE << 1) + +ONIG_OPTION_DEFAULT = ONIG_OPTION_NONE + + +# syntax (operators) +ONIG_SYN_OP_VARIABLE_META_CHARACTERS = (1<<0) +ONIG_SYN_OP_DOT_ANYCHAR = (1<<1) +ONIG_SYN_OP_ASTERISK_ZERO_INF = (1<<2) +ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF = (1<<3) +ONIG_SYN_OP_PLUS_ONE_INF = (1<<4) +ONIG_SYN_OP_ESC_PLUS_ONE_INF = (1<<5) +ONIG_SYN_OP_QMARK_ZERO_ONE = (1<<6) +ONIG_SYN_OP_ESC_QMARK_ZERO_ONE = (1<<7) +ONIG_SYN_OP_BRACE_INTERVAL = (1<<8) +ONIG_SYN_OP_ESC_BRACE_INTERVAL = (1<<9) +ONIG_SYN_OP_VBAR_ALT = (1<<10) +ONIG_SYN_OP_ESC_VBAR_ALT = (1<<11) +ONIG_SYN_OP_LPAREN_SUBEXP = (1<<12) +ONIG_SYN_OP_ESC_LPAREN_SUBEXP = (1<<13) +ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR = (1<<14) +ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR = (1<<15) +ONIG_SYN_OP_DECIMAL_BACKREF = (1<<16) +ONIG_SYN_OP_BRACKET_CC = (1<<17) +ONIG_SYN_OP_ESC_W_WORD = (1<<18) +ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END = (1<<19) +ONIG_SYN_OP_ESC_B_WORD_BOUND = (1<<20) +ONIG_SYN_OP_ESC_S_WHITE_SPACE = (1<<21) +ONIG_SYN_OP_ESC_D_DIGIT = (1<<22) +ONIG_SYN_OP_LINE_ANCHOR = (1<<23) +ONIG_SYN_OP_POSIX_BRACKET = (1<<24) +ONIG_SYN_OP_QMARK_NON_GREEDY = (1<<25) +ONIG_SYN_OP_ESC_CONTROL_CHARS = (1<<26) +ONIG_SYN_OP_ESC_C_CONTROL = (1<<27) +ONIG_SYN_OP_ESC_OCTAL3 = (1<<28) +ONIG_SYN_OP_ESC_X_HEX2 = (1<<29) +ONIG_SYN_OP_ESC_X_BRACE_HEX8 = (1<<30) +ONIG_SYN_OP_ESC_O_BRACE_OCTAL = (1<<31) + +ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE = (1<<0) +ONIG_SYN_OP2_QMARK_GROUP_EFFECT = (1<<1) +ONIG_SYN_OP2_OPTION_PERL = (1<<2) +ONIG_SYN_OP2_OPTION_RUBY = (1<<3) +ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT = (1<<4) +ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL = (1<<5) +ONIG_SYN_OP2_CCLASS_SET_OP = (1<<6) +ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP = (1<<7) +ONIG_SYN_OP2_ESC_K_NAMED_BACKREF = (1<<8) +ONIG_SYN_OP2_ESC_G_SUBEXP_CALL = (1<<9) +ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY = (1<<10) +ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL = (1<<11) +ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META = (1<<12) +ONIG_SYN_OP2_ESC_V_VTAB = (1<<13) +ONIG_SYN_OP2_ESC_U_HEX4 = (1<<14) +ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR = (1<<15) +ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY = (1<<16) +ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT = (1<<17) +#ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS = (1<<18) +ONIG_SYN_OP2_ESC_H_XDIGIT = (1<<19) +ONIG_SYN_OP2_INEFFECTIVE_ESCAPE = (1<<20) +ONIG_SYN_OP2_ESC_CAPITAL_R_LINEBREAK = (1<<21) +ONIG_SYN_OP2_ESC_CAPITAL_X_EXTENDED_GRAPHEME_CLUSTER = (1<<22) +ONIG_SYN_OP2_ESC_V_VERTICAL_WHITESPACE = (1<<23) +ONIG_SYN_OP2_ESC_H_HORIZONTAL_WHITESPACE = (1<<24) +ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP = (1<<25) +ONIG_SYN_OP2_ESC_G_BRACE_BACKREF = (1<<26) +ONIG_SYN_OP2_QMARK_SUBEXP_CALL = (1<<27) +ONIG_SYN_OP2_QMARK_VBAR_BRANCH_RESET = (1<<28) +ONIG_SYN_OP2_QMARK_LPAREN_CONDITION = (1<<29) +ONIG_SYN_OP2_QMARK_CAPITAL_P_NAMED_GROUP = (1<<30) +ONIG_SYN_OP2_OPTION_JAVA = (1<<31) + +# syntax (behavior) +ONIG_SYN_CONTEXT_INDEP_ANCHORS = (1<<31) +ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS = (1<<0) +ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS = (1<<1) +ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP = (1<<2) +ONIG_SYN_ALLOW_INVALID_INTERVAL = (1<<3) +ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV = (1<<4) +ONIG_SYN_STRICT_CHECK_BACKREF = (1<<5) +ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND = (1<<6) +ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP = (1<<7) +ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME = (1<<8) +ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY = (1<<9) +ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME_CALL = (1<<10) +ONIG_SYN_USE_LEFT_MOST_NAMED_GROUP = (1<<11) + +# (behavior) in char class [...] +ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC = (1<<20) +ONIG_SYN_BACKSLASH_ESCAPE_IN_CC = (1<<21) +ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC = (1<<22) +ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC = (1<<23) +# syntax (behavior) warning +ONIG_SYN_WARN_CC_OP_NOT_ESCAPED = (1<<24) +ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT = (1<<25) +ONIG_SYN_WARN_CC_DUP = (1<<26) + +# meta character specifiers (onig_set_meta_char()) +ONIG_META_CHAR_ESCAPE = 0 +ONIG_META_CHAR_ANYCHAR = 1 +ONIG_META_CHAR_ANYTIME = 2 +ONIG_META_CHAR_ZERO_OR_ONE_TIME = 3 +ONIG_META_CHAR_ONE_OR_MORE_TIME = 4 +ONIG_META_CHAR_ANYCHAR_ANYTIME = 5 + +ONIG_INEFFECTIVE_META_CHAR = 0 + + +# error codes +def ONIG_IS_PATTERN_ERROR(ecode): + return ((ecode) <= -100 and (ecode) > -1000) +# normal return +ONIG_NORMAL = 0 +ONIG_MISMATCH = -1 +ONIG_NO_SUPPORT_CONFIG = -2 +# internal error +ONIGERR_MEMORY = -5 +ONIGERR_TYPE_BUG = -6 +ONIGERR_PARSER_BUG = -11 +ONIGERR_STACK_BUG = -12 +ONIGERR_UNDEFINED_BYTECODE = -13 +ONIGERR_UNEXPECTED_BYTECODE = -14 +ONIGERR_MATCH_STACK_LIMIT_OVER = -15 +ONIGERR_PARSE_DEPTH_LIMIT_OVER = -16 +ONIGERR_DEFAULT_ENCODING_IS_NOT_SET = -21 +ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR = -22 +# general error +ONIGERR_INVALID_ARGUMENT = -30 +# syntax error +ONIGERR_END_PATTERN_AT_LEFT_BRACE = -100 +ONIGERR_END_PATTERN_AT_LEFT_BRACKET = -101 +ONIGERR_EMPTY_CHAR_CLASS = -102 +ONIGERR_PREMATURE_END_OF_CHAR_CLASS = -103 +ONIGERR_END_PATTERN_AT_ESCAPE = -104 +ONIGERR_END_PATTERN_AT_META = -105 +ONIGERR_END_PATTERN_AT_CONTROL = -106 +ONIGERR_META_CODE_SYNTAX = -108 +ONIGERR_CONTROL_CODE_SYNTAX = -109 +ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE = -110 +ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE = -111 +ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS = -112 +ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED = -113 +ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID = -114 +ONIGERR_NESTED_REPEAT_OPERATOR = -115 +ONIGERR_UNMATCHED_CLOSE_PARENTHESIS = -116 +ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS = -117 +ONIGERR_END_PATTERN_IN_GROUP = -118 +ONIGERR_UNDEFINED_GROUP_OPTION = -119 +ONIGERR_INVALID_POSIX_BRACKET_TYPE = -121 +ONIGERR_INVALID_LOOK_BEHIND_PATTERN = -122 +ONIGERR_INVALID_REPEAT_RANGE_PATTERN = -123 +ONIGERR_INVALID_CONDITION_PATTERN = -124 +# values error (syntax error) +ONIGERR_TOO_BIG_NUMBER = -200 +ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE = -201 +ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE = -202 +ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS = -203 +ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE = -204 +ONIGERR_TOO_MANY_MULTI_BYTE_RANGES = -205 +ONIGERR_TOO_SHORT_MULTI_BYTE_STRING = -206 +ONIGERR_TOO_BIG_BACKREF_NUMBER = -207 +ONIGERR_INVALID_BACKREF = -208 +ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED = -209 +ONIGERR_TOO_MANY_CAPTURE_GROUPS = -210 +ONIGERR_TOO_SHORT_DIGITS = -211 +ONIGERR_TOO_LONG_WIDE_CHAR_VALUE = -212 +ONIGERR_EMPTY_GROUP_NAME = -214 +ONIGERR_INVALID_GROUP_NAME = -215 +ONIGERR_INVALID_CHAR_IN_GROUP_NAME = -216 +ONIGERR_UNDEFINED_NAME_REFERENCE = -217 +ONIGERR_UNDEFINED_GROUP_REFERENCE = -218 +ONIGERR_MULTIPLEX_DEFINED_NAME = -219 +ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL = -220 +ONIGERR_NEVER_ENDING_RECURSION = -221 +ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY = -222 +ONIGERR_INVALID_CHAR_PROPERTY_NAME = -223 +ONIGERR_INVALID_CODE_POINT_VALUE = -400 +ONIGERR_INVALID_WIDE_CHAR_VALUE = -400 +ONIGERR_TOO_BIG_WIDE_CHAR_VALUE = -401 +ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION = -402 +ONIGERR_INVALID_COMBINATION_OF_OPTIONS = -403 + +# errors related to thread +#ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT = -1001 + + +OnigWarnFunc = ctypes.CFUNCTYPE(None, ctypes.c_char_p) + +# +# Onigmo APIs +# + +# onig_init +onig_init = libonig.onig_init + +# onig_error_code_to_str +libonig.onig_error_code_to_str.argtypes = [ctypes.c_char_p, _c_ssize_t, + ctypes.POINTER(OnigErrorInfo)] +def onig_error_code_to_str(err_buf, err_code, err_info=None): + return libonig.onig_error_code_to_str(err_buf, err_code, err_info) + +# onig_set_warn_func +libonig.onig_set_warn_func.argtypes = [OnigWarnFunc] +onig_set_warn_func = libonig.onig_set_warn_func + +# onig_set_verb_warn_func +libonig.onig_set_verb_warn_func.argtypes = [OnigWarnFunc] +onig_set_verb_warn_func = libonig.onig_set_verb_warn_func + +# onig_new +libonig.onig_new.argtypes = [ctypes.POINTER(OnigRegex), + ctypes.c_void_p, ctypes.c_void_p, + OnigOptionType, OnigEncoding, ctypes.POINTER(OnigSyntaxType), + ctypes.POINTER(OnigErrorInfo)] +onig_new = libonig.onig_new + +# onig_reg_init +# onig_new_without_alloc +# onig_new_deluxe + +# onig_free +libonig.onig_free.argtypes = [OnigRegex] +onig_free = libonig.onig_free + +# onig_free_body + +# onig_search +libonig.onig_search.argtypes = [OnigRegex, + ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, + ctypes.POINTER(OnigRegion), OnigOptionType] +libonig.onig_search.restype = _c_ssize_t +onig_search = libonig.onig_search + +# onig_search_gpos +libonig.onig_search_gpos.argtypes = [OnigRegex, + ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, + ctypes.c_void_p, + ctypes.POINTER(OnigRegion), OnigOptionType] +libonig.onig_search_gpos.restype = _c_ssize_t +onig_search_gpos = libonig.onig_search_gpos + +# onig_match +libonig.onig_match.argtypes = [OnigRegex, + ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, + ctypes.POINTER(OnigRegion), OnigOptionType] +libonig.onig_match.restype = _c_ssize_t +onig_match = libonig.onig_match + +# onig_region_new +libonig.onig_region_new.argtypes = [] +libonig.onig_region_new.restype = ctypes.POINTER(OnigRegion) +onig_region_new = libonig.onig_region_new + +# onig_region_init + +# onig_region_free +libonig.onig_region_free.argtypes = [ctypes.POINTER(OnigRegion), ctypes.c_int] +onig_region_free = libonig.onig_region_free + +# onig_region_copy +# onig_region_clear +# onig_region_resize +# onig_region_set +# onig_name_to_group_numbers +# onig_name_to_backref_number +# onig_foreach_name +# onig_number_of_names +# onig_number_of_captures +# onig_number_of_capture_histories +# onig_get_capture_tree +# onig_capture_tree_traverse +# onig_noname_group_capture_is_active +# onig_get_encoding +# onig_get_options +# onig_get_case_fold_flag +# onig_get_syntax + +# onig_set_default_syntax +libonig.onig_set_default_syntax.argtypes = [ctypes.POINTER(OnigSyntaxType)] +libonig.onig_set_default_syntax.restype = ctypes.c_int +onig_set_default_syntax = libonig.onig_set_default_syntax + +# onig_copy_syntax +libonig.onig_copy_syntax.argtypes = [ctypes.POINTER(OnigSyntaxType), + ctypes.POINTER(OnigSyntaxType)] +onig_copy_syntax = libonig.onig_copy_syntax + +# onig_get_syntax_op +libonig.onig_get_syntax_op.argtypes = [ctypes.POINTER(OnigSyntaxType)] +libonig.onig_get_syntax_op.restype = ctypes.c_int +onig_get_syntax_op = libonig.onig_get_syntax_op + +# onig_get_syntax_op2 +libonig.onig_get_syntax_op2.argtypes = [ctypes.POINTER(OnigSyntaxType)] +libonig.onig_get_syntax_op2.restype = ctypes.c_int +onig_get_syntax_op2 = libonig.onig_get_syntax_op2 + +# onig_get_syntax_behavior +libonig.onig_get_syntax_behavior.argtypes = [ctypes.POINTER(OnigSyntaxType)] +libonig.onig_get_syntax_behavior.restype = ctypes.c_int +onig_get_syntax_behavior = libonig.onig_get_syntax_behavior + +# onig_get_syntax_options +libonig.onig_get_syntax_options.argtypes = [ctypes.POINTER(OnigSyntaxType)] +libonig.onig_get_syntax_options.restype = ctypes.c_int +onig_get_syntax_options = libonig.onig_get_syntax_options + +# onig_set_syntax_op +libonig.onig_set_syntax_op.argtypes = [ctypes.POINTER(OnigSyntaxType), + ctypes.c_int] +onig_set_syntax_op = libonig.onig_set_syntax_op + +# onig_set_syntax_op2 +libonig.onig_set_syntax_op2.argtypes = [ctypes.POINTER(OnigSyntaxType), + ctypes.c_int] +onig_set_syntax_op2 = libonig.onig_set_syntax_op2 + +# onig_set_syntax_behavior +libonig.onig_set_syntax_behavior.argtypes = [ctypes.POINTER(OnigSyntaxType), + ctypes.c_int] +onig_set_syntax_behavior = libonig.onig_set_syntax_behavior + +# onig_set_syntax_options +libonig.onig_set_syntax_options.argtypes = [ctypes.POINTER(OnigSyntaxType), + ctypes.c_int] +onig_set_syntax_options = libonig.onig_set_syntax_options + +# onig_set_meta_char +# onig_copy_encoding +# onig_get_default_case_fold_flag +# onig_set_default_case_fold_flag + +# onig_get_match_stack_limit_size +libonig.onig_get_match_stack_limit_size.argtypes = [] +libonig.onig_get_match_stack_limit_size.restype = ctypes.c_int +onig_get_match_stack_limit_size = libonig.onig_get_match_stack_limit_size + +# onig_set_match_stack_limit_size +libonig.onig_set_match_stack_limit_size.argtypes = [ctypes.c_int] +libonig.onig_set_match_stack_limit_size.restype = ctypes.c_int +onig_set_match_stack_limit_size = libonig.onig_set_match_stack_limit_size + +# onig_get_parse_depth_limit +libonig.onig_get_parse_depth_limit.argtypes = [] +libonig.onig_get_parse_depth_limit.restype = ctypes.c_int +onig_get_parse_depth_limit = libonig.onig_get_parse_depth_limit + +# onig_set_parse_depth_limit +libonig.onig_set_parse_depth_limit.argtypes = [ctypes.c_int] +libonig.onig_set_parse_depth_limit.restype = ctypes.c_int +onig_set_parse_depth_limit = libonig.onig_set_parse_depth_limit + +# onig_end +libonig.onig_end.argtypes = [] +onig_end = libonig.onig_end + +# onig_version +libonig.onig_version.argtypes = [] +libonig.onig_version.restype = ctypes.c_char_p +def onig_version(): + return libonig.onig_version().decode() + +# onig_copyright +libonig.onig_copyright.argtypes = [] +libonig.onig_copyright.restype = ctypes.c_char_p +def onig_copyright(): + return libonig.onig_copyright().decode() diff --git a/lib/edbee-lib/vendor/onig/onigmognu.h b/lib/edbee-lib/vendor/onig/onigmognu.h new file mode 100644 index 00000000..64efd8a8 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/onigmognu.h @@ -0,0 +1,89 @@ +#ifndef ONIGMOGNU_H +#define ONIGMOGNU_H +/********************************************************************** + onigmognu.h - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "onigmo.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define RE_MBCTYPE_ASCII 0 +#define RE_MBCTYPE_EUC 1 +#define RE_MBCTYPE_SJIS 2 +#define RE_MBCTYPE_UTF8 3 + +/* GNU regex options */ +#ifndef RE_NREGS +# define RE_NREGS ONIG_NREGION +#endif + +#define RE_OPTION_IGNORECASE ONIG_OPTION_IGNORECASE +#define RE_OPTION_EXTENDED ONIG_OPTION_EXTEND +#define RE_OPTION_MULTILINE ONIG_OPTION_MULTILINE +#define RE_OPTION_SINGLELINE ONIG_OPTION_SINGLELINE +#define RE_OPTION_LONGEST ONIG_OPTION_FIND_LONGEST +#define RE_OPTION_POSIXLINE (RE_OPTION_MULTILINE | RE_OPTION_SINGLELINE) +#define RE_OPTION_FIND_NOT_EMPTY ONIG_OPTION_FIND_NOT_EMPTY +#define RE_OPTION_NEGATE_SINGLELINE ONIG_OPTION_NEGATE_SINGLELINE +#define RE_OPTION_DONT_CAPTURE_GROUP ONIG_OPTION_DONT_CAPTURE_GROUP +#define RE_OPTION_CAPTURE_GROUP ONIG_OPTION_CAPTURE_GROUP + +ONIG_EXTERN +void re_mbcinit(int); +ONIG_EXTERN +int re_compile_pattern(const char *, int, struct re_pattern_buffer *, + char *err_buf); +ONIG_EXTERN +int re_recompile_pattern(const char *, int, struct re_pattern_buffer *, + char *err_buf); +ONIG_EXTERN +void re_free_pattern(struct re_pattern_buffer *); +ONIG_EXTERN +int re_adjust_startpos(struct re_pattern_buffer *, const char *, int, int, int); +ONIG_EXTERN +int re_search(struct re_pattern_buffer *, const char *, int, int, int, + struct re_registers *); +ONIG_EXTERN +int re_match(struct re_pattern_buffer *, const char *, int, int, + struct re_registers *); +ONIG_EXTERN +void re_set_casetable(const char *); +ONIG_EXTERN +void re_free_registers(struct re_registers *); +ONIG_EXTERN +int re_alloc_pattern(struct re_pattern_buffer **); /* added */ + +#ifdef __cplusplus +} +#endif + +#endif /* ONIGMOGNU_H */ diff --git a/lib/edbee-lib/vendor/onig/onigmoposix.h b/lib/edbee-lib/vendor/onig/onigmoposix.h new file mode 100644 index 00000000..fa448411 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/onigmoposix.h @@ -0,0 +1,172 @@ +#ifndef ONIGMOPOSIX_H +#define ONIGMOPOSIX_H +/********************************************************************** + onigmoposix.h - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include <stdlib.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* options */ +#define REG_ICASE (1 << 0) +#define REG_NEWLINE (1 << 1) +#define REG_NOTBOL (1 << 2) +#define REG_NOTEOL (1 << 3) +#define REG_EXTENDED (1 << 4) /* if not set, Basic Onigular Expression */ +#define REG_NOSUB (1 << 5) + +/* POSIX error codes */ +#define REG_NOMATCH 1 +#define REG_BADPAT 2 +#define REG_ECOLLATE 3 +#define REG_ECTYPE 4 +#define REG_EESCAPE 5 +#define REG_ESUBREG 6 +#define REG_EBRACK 7 +#define REG_EPAREN 8 +#define REG_EBRACE 9 +#define REG_BADBR 10 +#define REG_ERANGE 11 +#define REG_ESPACE 12 +#define REG_BADRPT 13 + +/* extended error codes */ +#define REG_EONIG_INTERNAL 14 +#define REG_EONIG_BADWC 15 +#define REG_EONIG_BADARG 16 +/* #define REG_EONIG_THREAD 17 */ + +/* character encodings (for reg_set_encoding()) */ +#define REG_POSIX_ENCODING_ASCII 0 +#define REG_POSIX_ENCODING_EUC_JP 1 +#define REG_POSIX_ENCODING_SJIS 2 +#define REG_POSIX_ENCODING_UTF8 3 +#define REG_POSIX_ENCODING_UTF16_BE 4 +#define REG_POSIX_ENCODING_UTF16_LE 5 + +typedef int regoff_t; + +typedef struct +{ + regoff_t rm_so; + regoff_t rm_eo; +} regmatch_t; + +/* POSIX regex_t */ +typedef struct +{ + void *onig; /* Oniguruma regex_t* */ + size_t re_nsub; + int comp_options; +} regex_t; + +#ifndef ONIG_EXTERN +# if defined(_WIN32) && !defined(__GNUC__) +# if defined(EXPORT) +# define ONIG_EXTERN extern __declspec(dllexport) +# else +# define ONIG_EXTERN extern __declspec(dllimport) +# endif +# endif +#endif + +#ifndef ONIG_EXTERN +# define ONIG_EXTERN extern +#endif + +#ifndef ONIGMO_H +typedef unsigned int OnigOptionType; + +/* syntax */ +typedef struct +{ + unsigned int op; + unsigned int op2; + unsigned int behavior; + OnigOptionType options; /* default option */ +} OnigSyntaxType; + +ONIG_EXTERN const OnigSyntaxType OnigSyntaxPosixBasic; +ONIG_EXTERN const OnigSyntaxType OnigSyntaxPosixExtended; +ONIG_EXTERN const OnigSyntaxType OnigSyntaxEmacs; +ONIG_EXTERN const OnigSyntaxType OnigSyntaxGrep; +ONIG_EXTERN const OnigSyntaxType OnigSyntaxGnuRegex; +ONIG_EXTERN const OnigSyntaxType OnigSyntaxJava; +ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl; +ONIG_EXTERN const OnigSyntaxType OnigSyntaxRuby; + +/* predefined syntaxes (see regsyntax.c) */ +# define ONIG_SYNTAX_POSIX_BASIC (&OnigSyntaxPosixBasic) +# define ONIG_SYNTAX_POSIX_EXTENDED (&OnigSyntaxPosixExtended) +# define ONIG_SYNTAX_EMACS (&OnigSyntaxEmacs) +# define ONIG_SYNTAX_GREP (&OnigSyntaxGrep) +# define ONIG_SYNTAX_GNU_REGEX (&OnigSyntaxGnuRegex) +# define ONIG_SYNTAX_JAVA (&OnigSyntaxJava) +# define ONIG_SYNTAX_PERL (&OnigSyntaxPerl) +# define ONIG_SYNTAX_RUBY (&OnigSyntaxRuby) +/* default syntax */ +# define ONIG_SYNTAX_DEFAULT OnigDefaultSyntax + +ONIG_EXTERN const OnigSyntaxType *OnigDefaultSyntax; + +ONIG_EXTERN int onig_set_default_syntax(const OnigSyntaxType *syntax); +ONIG_EXTERN void onig_copy_syntax(OnigSyntaxType *to, + const OnigSyntaxType *from); +ONIG_EXTERN const char *onig_version(void); +ONIG_EXTERN const char *onig_copyright(void); + +#endif /* ONIGMO_H */ + +ONIG_EXTERN int regcomp(regex_t *reg, const char *pat, int options); +ONIG_EXTERN int regexec(regex_t *reg, const char *str, size_t nmatch, + regmatch_t *matches, int options); +ONIG_EXTERN void regfree(regex_t *reg); +ONIG_EXTERN size_t regerror(int code, const regex_t *reg, char *buf, + size_t size); + +/* extended API */ +ONIG_EXTERN void reg_set_encoding(int enc); +ONIG_EXTERN int reg_name_to_group_numbers(regex_t *reg, + const unsigned char *name, + const unsigned char *name_end, + int **nums); +ONIG_EXTERN int reg_foreach_name(regex_t *reg, + int (*func)(const unsigned char *, + const unsigned char *, int, int *, + regex_t *, void *), + void *arg); +ONIG_EXTERN int reg_number_of_names(regex_t *reg); + +#ifdef __cplusplus +} +#endif + +#endif /* ONIGMOPOSIX_H */ diff --git a/lib/edbee-lib/vendor/onig/regcomp.c b/lib/edbee-lib/vendor/onig/regcomp.c new file mode 100644 index 00000000..86ed3125 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/regcomp.c @@ -0,0 +1,7497 @@ +/********************************************************************** + regcomp.c - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2013 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regparse.h" + +OnigCaseFoldType OnigDefaultCaseFoldFlag = ONIGENC_CASE_FOLD_MIN; + +extern OnigCaseFoldType onig_get_default_case_fold_flag(void) +{ + return OnigDefaultCaseFoldFlag; +} + +extern int onig_set_default_case_fold_flag(OnigCaseFoldType case_fold_flag) +{ + OnigDefaultCaseFoldFlag = case_fold_flag; + return 0; +} + +#ifndef PLATFORM_UNALIGNED_WORD_ACCESS +static unsigned char PadBuf[WORD_ALIGNMENT_SIZE]; +#endif + +#if 0 +static UChar* +str_dup(UChar* s, UChar* end) +{ + ptrdiff_t len = end - s; + + if (len > 0) { + UChar* r = (UChar* )xmalloc(len + 1); + CHECK_NULL_RETURN(r); + xmemcpy(r, s, len); + r[len] = (UChar )0; + return r; + } + else return NULL; +} +#endif + +static void swap_node(Node *a, Node *b) +{ + Node c; + c = *a; + *a = *b; + *b = c; + + if (NTYPE(a) == NT_STR) + { + StrNode *sn = NSTR(a); + if (sn->capa == 0) + { + size_t len = sn->end - sn->s; + sn->s = sn->buf; + sn->end = sn->s + len; + } + } + + if (NTYPE(b) == NT_STR) + { + StrNode *sn = NSTR(b); + if (sn->capa == 0) + { + size_t len = sn->end - sn->s; + sn->s = sn->buf; + sn->end = sn->s + len; + } + } +} + +static OnigDistance distance_add(OnigDistance d1, OnigDistance d2) +{ + if (d1 == ONIG_INFINITE_DISTANCE || d2 == ONIG_INFINITE_DISTANCE) + return ONIG_INFINITE_DISTANCE; + else + { + if (d1 <= ONIG_INFINITE_DISTANCE - d2) + return d1 + d2; + else + return ONIG_INFINITE_DISTANCE; + } +} + +static OnigDistance distance_multiply(OnigDistance d, int m) +{ + if (m == 0) + return 0; + + if (d < ONIG_INFINITE_DISTANCE / m) + return d * m; + else + return ONIG_INFINITE_DISTANCE; +} + +static int bitset_is_empty(BitSetRef bs) +{ + int i; + for (i = 0; i < BITSET_SIZE; i++) + { + if (bs[i] != 0) + return 0; + } + return 1; +} + +#ifdef ONIG_DEBUG +static int bitset_on_num(BitSetRef bs) +{ + int i, n; + + n = 0; + for (i = 0; i < SINGLE_BYTE_SIZE; i++) + { + if (BITSET_AT(bs, i)) + n++; + } + return n; +} +#endif + +extern int onig_bbuf_init(BBuf *buf, OnigDistance size) +{ + if (size <= 0) + { + size = 0; + buf->p = NULL; + } + else + { + buf->p = (UChar *)xmalloc(size); + if (IS_NULL(buf->p)) + return (ONIGERR_MEMORY); + } + + buf->alloc = (unsigned int)size; + buf->used = 0; + return 0; +} + +#ifdef USE_SUBEXP_CALL + +static int unset_addr_list_init(UnsetAddrList *uslist, int size) +{ + UnsetAddr *p; + + p = (UnsetAddr *)xmalloc(sizeof(UnsetAddr) * size); + CHECK_NULL_RETURN_MEMERR(p); + uslist->num = 0; + uslist->alloc = size; + uslist->us = p; + return 0; +} + +static void unset_addr_list_end(UnsetAddrList *uslist) +{ + if (IS_NOT_NULL(uslist->us)) + xfree(uslist->us); +} + +static int unset_addr_list_add(UnsetAddrList *uslist, int offset, + struct _Node *node) +{ + UnsetAddr *p; + int size; + + if (uslist->num >= uslist->alloc) + { + size = uslist->alloc * 2; + p = (UnsetAddr *)xrealloc(uslist->us, sizeof(UnsetAddr) * size); + CHECK_NULL_RETURN_MEMERR(p); + uslist->alloc = size; + uslist->us = p; + } + + uslist->us[uslist->num].offset = offset; + uslist->us[uslist->num].target = node; + uslist->num++; + return 0; +} +#endif /* USE_SUBEXP_CALL */ + +static int add_opcode(regex_t *reg, int opcode) +{ + BBUF_ADD1(reg, opcode); + return 0; +} + +#ifdef USE_COMBINATION_EXPLOSION_CHECK +static int add_state_check_num(regex_t *reg, int num) +{ + StateCheckNumType n = (StateCheckNumType)num; + + BBUF_ADD(reg, &n, SIZE_STATE_CHECK_NUM); + return 0; +} +#endif + +static int add_rel_addr(regex_t *reg, int addr) +{ + RelAddrType ra = (RelAddrType)addr; + + BBUF_ADD(reg, &ra, SIZE_RELADDR); + return 0; +} + +static int add_abs_addr(regex_t *reg, int addr) +{ + AbsAddrType ra = (AbsAddrType)addr; + + BBUF_ADD(reg, &ra, SIZE_ABSADDR); + return 0; +} + +static int add_length(regex_t *reg, OnigDistance len) +{ + LengthType l = (LengthType)len; + + BBUF_ADD(reg, &l, SIZE_LENGTH); + return 0; +} + +static int add_mem_num(regex_t *reg, int num) +{ + MemNumType n = (MemNumType)num; + + BBUF_ADD(reg, &n, SIZE_MEMNUM); + return 0; +} + +#if 0 +static int +add_pointer(regex_t* reg, void* addr) +{ + PointerType ptr = (PointerType )addr; + + BBUF_ADD(reg, &ptr, SIZE_POINTER); + return 0; +} +#endif + +static int add_option(regex_t *reg, OnigOptionType option) +{ + BBUF_ADD(reg, &option, SIZE_OPTION); + return 0; +} + +static int add_opcode_rel_addr(regex_t *reg, int opcode, int addr) +{ + int r; + + r = add_opcode(reg, opcode); + if (r) + return r; + r = add_rel_addr(reg, addr); + return r; +} + +static int add_bytes(regex_t *reg, UChar *bytes, OnigDistance len) +{ + BBUF_ADD(reg, bytes, len); + return 0; +} + +static int add_bitset(regex_t *reg, BitSetRef bs) +{ + BBUF_ADD(reg, bs, SIZE_BITSET); + return 0; +} + +static int add_opcode_option(regex_t *reg, int opcode, OnigOptionType option) +{ + int r; + + r = add_opcode(reg, opcode); + if (r) + return r; + r = add_option(reg, option); + return r; +} + +static int compile_length_tree(Node *node, regex_t *reg); +static int compile_tree(Node *node, regex_t *reg); + +#define IS_NEED_STR_LEN_OP_EXACT(op) \ + ((op) == OP_EXACTN || (op) == OP_EXACTMB2N || (op) == OP_EXACTMB3N \ + || (op) == OP_EXACTMBN || (op) == OP_EXACTN_IC) + +static int select_str_opcode(int mb_len, OnigDistance byte_len, int ignore_case) +{ + int op; + OnigDistance str_len = (byte_len + mb_len - 1) / mb_len; + + if (ignore_case) + { + switch (str_len) + { + case 1: + op = OP_EXACT1_IC; + break; + default: + op = OP_EXACTN_IC; + break; + } + } + else + { + switch (mb_len) + { + case 1: + switch (str_len) + { + case 1: + op = OP_EXACT1; + break; + case 2: + op = OP_EXACT2; + break; + case 3: + op = OP_EXACT3; + break; + case 4: + op = OP_EXACT4; + break; + case 5: + op = OP_EXACT5; + break; + default: + op = OP_EXACTN; + break; + } + break; + + case 2: + switch (str_len) + { + case 1: + op = OP_EXACTMB2N1; + break; + case 2: + op = OP_EXACTMB2N2; + break; + case 3: + op = OP_EXACTMB2N3; + break; + default: + op = OP_EXACTMB2N; + break; + } + break; + + case 3: + op = OP_EXACTMB3N; + break; + + default: + op = OP_EXACTMBN; + break; + } + } + return op; +} + +static int compile_tree_empty_check(Node *node, regex_t *reg, int empty_info) +{ + int r; + int saved_num_null_check = reg->num_null_check; + + if (empty_info != 0) + { + r = add_opcode(reg, OP_NULL_CHECK_START); + if (r) + return r; + r = add_mem_num(reg, reg->num_null_check); /* NULL CHECK ID */ + if (r) + return r; + reg->num_null_check++; + } + + r = compile_tree(node, reg); + if (r) + return r; + + if (empty_info != 0) + { + if (empty_info == NQ_TARGET_IS_EMPTY) + r = add_opcode(reg, OP_NULL_CHECK_END); + else if (empty_info == NQ_TARGET_IS_EMPTY_MEM) + r = add_opcode(reg, OP_NULL_CHECK_END_MEMST); + else if (empty_info == NQ_TARGET_IS_EMPTY_REC) + r = add_opcode(reg, OP_NULL_CHECK_END_MEMST_PUSH); + + if (r) + return r; + r = add_mem_num(reg, saved_num_null_check); /* NULL CHECK ID */ + } + return r; +} + +#ifdef USE_SUBEXP_CALL +static int compile_call(CallNode *node, regex_t *reg) +{ + int r; + + r = add_opcode(reg, OP_CALL); + if (r) + return r; + r = unset_addr_list_add(node->unset_addr_list, BBUF_GET_OFFSET_POS(reg), + node->target); + if (r) + return r; + r = add_abs_addr(reg, 0 /*dummy addr.*/); + return r; +} +#endif + +static int compile_tree_n_times(Node *node, int n, regex_t *reg) +{ + int i, r; + + for (i = 0; i < n; i++) + { + r = compile_tree(node, reg); + if (r) + return r; + } + return 0; +} + +static int add_compile_string_length(UChar *s ARG_UNUSED, int mb_len, + OnigDistance byte_len, + regex_t *reg ARG_UNUSED, int ignore_case) +{ + int len; + int op = select_str_opcode(mb_len, byte_len, ignore_case); + + len = SIZE_OPCODE; + + if (op == OP_EXACTMBN) + len += SIZE_LENGTH; + if (IS_NEED_STR_LEN_OP_EXACT(op)) + len += SIZE_LENGTH; + + len += (int)byte_len; + return len; +} + +static int add_compile_string(UChar *s, int mb_len, OnigDistance byte_len, + regex_t *reg, int ignore_case) +{ + int op = select_str_opcode(mb_len, byte_len, ignore_case); + add_opcode(reg, op); + + if (op == OP_EXACTMBN) + add_length(reg, mb_len); + + if (IS_NEED_STR_LEN_OP_EXACT(op)) + { + if (op == OP_EXACTN_IC) + add_length(reg, byte_len); + else + add_length(reg, byte_len / mb_len); + } + + add_bytes(reg, s, byte_len); + return 0; +} + +static int compile_length_string_node(Node *node, regex_t *reg) +{ + int rlen, r, len, prev_len, blen, ambig; + OnigEncoding enc = reg->enc; + UChar *p, *prev; + StrNode *sn; + + sn = NSTR(node); + if (sn->end <= sn->s) + return 0; + + ambig = NSTRING_IS_AMBIG(node); + + p = prev = sn->s; + prev_len = enclen(enc, p, sn->end); + p += prev_len; + blen = prev_len; + rlen = 0; + + for (; p < sn->end;) + { + len = enclen(enc, p, sn->end); + if (len == prev_len || ambig) + { + blen += len; + } + else + { + r = add_compile_string_length(prev, prev_len, blen, reg, ambig); + rlen += r; + prev = p; + blen = len; + prev_len = len; + } + p += len; + } + r = add_compile_string_length(prev, prev_len, blen, reg, ambig); + rlen += r; + return rlen; +} + +static int compile_length_string_raw_node(StrNode *sn, regex_t *reg) +{ + if (sn->end <= sn->s) + return 0; + + return add_compile_string_length(sn->s, 1 /* sb */, sn->end - sn->s, reg, 0); +} + +static int compile_string_node(Node *node, regex_t *reg) +{ + int r, len, prev_len, blen, ambig; + OnigEncoding enc = reg->enc; + UChar *p, *prev, *end; + StrNode *sn; + + sn = NSTR(node); + if (sn->end <= sn->s) + return 0; + + end = sn->end; + ambig = NSTRING_IS_AMBIG(node); + + p = prev = sn->s; + prev_len = enclen(enc, p, end); + p += prev_len; + blen = prev_len; + + for (; p < end;) + { + len = enclen(enc, p, end); + if (len == prev_len || ambig) + { + blen += len; + } + else + { + r = add_compile_string(prev, prev_len, blen, reg, ambig); + if (r) + return r; + + prev = p; + blen = len; + prev_len = len; + } + + p += len; + } + return add_compile_string(prev, prev_len, blen, reg, ambig); +} + +static int compile_string_raw_node(StrNode *sn, regex_t *reg) +{ + if (sn->end <= sn->s) + return 0; + + return add_compile_string(sn->s, 1 /* sb */, sn->end - sn->s, reg, 0); +} + +static int add_multi_byte_cclass(BBuf *mbuf, regex_t *reg) +{ +#ifdef PLATFORM_UNALIGNED_WORD_ACCESS + add_length(reg, mbuf->used); + return add_bytes(reg, mbuf->p, mbuf->used); +#else + int r, pad_size; + UChar *p = BBUF_GET_ADD_ADDRESS(reg) + SIZE_LENGTH; + + GET_ALIGNMENT_PAD_SIZE(p, pad_size); + add_length(reg, mbuf->used + (WORD_ALIGNMENT_SIZE - 1)); + if (pad_size != 0) + add_bytes(reg, PadBuf, pad_size); + + r = add_bytes(reg, mbuf->p, mbuf->used); + + /* padding for return value from compile_length_cclass_node() to be fix. */ + pad_size = (WORD_ALIGNMENT_SIZE - 1) - pad_size; + if (pad_size != 0) + add_bytes(reg, PadBuf, pad_size); + return r; +#endif +} + +static int compile_length_cclass_node(CClassNode *cc, regex_t *reg) +{ + int len; + + if (IS_NULL(cc->mbuf)) + { + len = SIZE_OPCODE + SIZE_BITSET; + } + else + { + if (ONIGENC_MBC_MINLEN(reg->enc) > 1 || bitset_is_empty(cc->bs)) + { + len = SIZE_OPCODE; + } + else + { + len = SIZE_OPCODE + SIZE_BITSET; + } +#ifdef PLATFORM_UNALIGNED_WORD_ACCESS + len += SIZE_LENGTH + cc->mbuf->used; +#else + len += SIZE_LENGTH + cc->mbuf->used + (WORD_ALIGNMENT_SIZE - 1); +#endif + } + + return len; +} + +static int compile_cclass_node(CClassNode *cc, regex_t *reg) +{ + int r; + + if (IS_NULL(cc->mbuf)) + { + if (IS_NCCLASS_NOT(cc)) + add_opcode(reg, OP_CCLASS_NOT); + else + add_opcode(reg, OP_CCLASS); + + r = add_bitset(reg, cc->bs); + } + else + { + if (ONIGENC_MBC_MINLEN(reg->enc) > 1 || bitset_is_empty(cc->bs)) + { + if (IS_NCCLASS_NOT(cc)) + add_opcode(reg, OP_CCLASS_MB_NOT); + else + add_opcode(reg, OP_CCLASS_MB); + + r = add_multi_byte_cclass(cc->mbuf, reg); + } + else + { + if (IS_NCCLASS_NOT(cc)) + add_opcode(reg, OP_CCLASS_MIX_NOT); + else + add_opcode(reg, OP_CCLASS_MIX); + + r = add_bitset(reg, cc->bs); + if (r) + return r; + r = add_multi_byte_cclass(cc->mbuf, reg); + } + } + + return r; +} + +static int entry_repeat_range(regex_t *reg, int id, int lower, int upper) +{ +#define REPEAT_RANGE_ALLOC 4 + + OnigRepeatRange *p; + + if (reg->repeat_range_alloc == 0) + { + p = (OnigRepeatRange *)xmalloc(sizeof(OnigRepeatRange) + * REPEAT_RANGE_ALLOC); + CHECK_NULL_RETURN_MEMERR(p); + reg->repeat_range = p; + reg->repeat_range_alloc = REPEAT_RANGE_ALLOC; + } + else if (reg->repeat_range_alloc <= id) + { + int n; + n = reg->repeat_range_alloc + REPEAT_RANGE_ALLOC; + p = (OnigRepeatRange *)xrealloc(reg->repeat_range, + sizeof(OnigRepeatRange) * n); + CHECK_NULL_RETURN_MEMERR(p); + reg->repeat_range = p; + reg->repeat_range_alloc = n; + } + else + { + p = reg->repeat_range; + } + + p[id].lower = lower; + p[id].upper = (IS_REPEAT_INFINITE(upper) ? 0x7fffffff : upper); + return 0; +} + +static int compile_range_repeat_node(QtfrNode *qn, int target_len, + int empty_info, regex_t *reg) +{ + int r; + int num_repeat = reg->num_repeat; + + r = add_opcode(reg, qn->greedy ? OP_REPEAT : OP_REPEAT_NG); + if (r) + return r; + r = add_mem_num(reg, num_repeat); /* OP_REPEAT ID */ + reg->num_repeat++; + if (r) + return r; + r = add_rel_addr(reg, target_len + SIZE_OP_REPEAT_INC); + if (r) + return r; + + r = entry_repeat_range(reg, num_repeat, qn->lower, qn->upper); + if (r) + return r; + + r = compile_tree_empty_check(qn->target, reg, empty_info); + if (r) + return r; + + if ( +#ifdef USE_SUBEXP_CALL + reg->num_call > 0 || +#endif + IS_QUANTIFIER_IN_REPEAT(qn)) + { + r = add_opcode(reg, qn->greedy ? OP_REPEAT_INC_SG : OP_REPEAT_INC_NG_SG); + } + else + { + r = add_opcode(reg, qn->greedy ? OP_REPEAT_INC : OP_REPEAT_INC_NG); + } + if (r) + return r; + r = add_mem_num(reg, num_repeat); /* OP_REPEAT ID */ + return r; +} + +static int is_anychar_star_quantifier(QtfrNode *qn) +{ + if (qn->greedy && IS_REPEAT_INFINITE(qn->upper) + && NTYPE(qn->target) == NT_CANY) + return 1; + else + return 0; +} + +#define QUANTIFIER_EXPAND_LIMIT_SIZE 50 +#define CKN_ON (ckn > 0) + +#ifdef USE_COMBINATION_EXPLOSION_CHECK + +static int compile_length_quantifier_node(QtfrNode *qn, regex_t *reg) +{ + int len, mod_tlen, cklen; + int ckn; + int infinite = IS_REPEAT_INFINITE(qn->upper); + int empty_info = qn->target_empty_info; + int tlen = compile_length_tree(qn->target, reg); + + if (tlen < 0) + return tlen; + + ckn = ((reg->num_comb_exp_check > 0) ? qn->comb_exp_check_num : 0); + + cklen = (CKN_ON ? SIZE_STATE_CHECK_NUM : 0); + + /* anychar repeat */ + if (NTYPE(qn->target) == NT_CANY) + { + if (qn->greedy && infinite) + { + if (IS_NOT_NULL(qn->next_head_exact) && !CKN_ON) + return SIZE_OP_ANYCHAR_STAR_PEEK_NEXT + tlen * qn->lower + cklen; + else + return SIZE_OP_ANYCHAR_STAR + tlen * qn->lower + cklen; + } + } + + if (empty_info != 0) + mod_tlen = tlen + (SIZE_OP_NULL_CHECK_START + SIZE_OP_NULL_CHECK_END); + else + mod_tlen = tlen; + + if (infinite && qn->lower <= 1) + { + if (qn->greedy) + { + if (qn->lower == 1) + len = SIZE_OP_JUMP; + else + len = 0; + + len += SIZE_OP_PUSH + cklen + mod_tlen + SIZE_OP_JUMP; + } + else + { + if (qn->lower == 0) + len = SIZE_OP_JUMP; + else + len = 0; + + len += mod_tlen + SIZE_OP_PUSH + cklen; + } + } + else if (qn->upper == 0) + { + if (qn->is_refered != 0) /* /(?<n>..){0}/ */ + len = SIZE_OP_JUMP + tlen; + else + len = 0; + } + else if (qn->upper == 1 && qn->greedy) + { + if (qn->lower == 0) + { + if (CKN_ON) + { + len = SIZE_OP_STATE_CHECK_PUSH + tlen; + } + else + { + len = SIZE_OP_PUSH + tlen; + } + } + else + { + len = tlen; + } + } + else if (!qn->greedy && qn->upper == 1 && qn->lower == 0) + { /* '??' */ + len = SIZE_OP_PUSH + cklen + SIZE_OP_JUMP + tlen; + } + else + { + len = SIZE_OP_REPEAT_INC + mod_tlen + SIZE_OPCODE + SIZE_RELADDR + + SIZE_MEMNUM; + if (CKN_ON) + len += SIZE_OP_STATE_CHECK; + } + + return len; +} + +static int compile_quantifier_node(QtfrNode *qn, regex_t *reg) +{ + int r, mod_tlen; + int ckn; + int infinite = IS_REPEAT_INFINITE(qn->upper); + int empty_info = qn->target_empty_info; + int tlen = compile_length_tree(qn->target, reg); + + if (tlen < 0) + return tlen; + + ckn = ((reg->num_comb_exp_check > 0) ? qn->comb_exp_check_num : 0); + + if (is_anychar_star_quantifier(qn)) + { + r = compile_tree_n_times(qn->target, qn->lower, reg); + if (r) + return r; + if (IS_NOT_NULL(qn->next_head_exact) && !CKN_ON) + { + if (IS_MULTILINE(reg->options)) + r = add_opcode(reg, OP_ANYCHAR_ML_STAR_PEEK_NEXT); + else + r = add_opcode(reg, OP_ANYCHAR_STAR_PEEK_NEXT); + if (r) + return r; + if (CKN_ON) + { + r = add_state_check_num(reg, ckn); + if (r) + return r; + } + + return add_bytes(reg, NSTR(qn->next_head_exact)->s, 1); + } + else + { + if (IS_MULTILINE(reg->options)) + { + r = add_opcode(reg, (CKN_ON ? OP_STATE_CHECK_ANYCHAR_ML_STAR + : OP_ANYCHAR_ML_STAR)); + } + else + { + r = add_opcode( + reg, (CKN_ON ? OP_STATE_CHECK_ANYCHAR_STAR : OP_ANYCHAR_STAR)); + } + if (r) + return r; + if (CKN_ON) + r = add_state_check_num(reg, ckn); + + return r; + } + } + + if (empty_info != 0) + mod_tlen = tlen + (SIZE_OP_NULL_CHECK_START + SIZE_OP_NULL_CHECK_END); + else + mod_tlen = tlen; + + if (infinite && qn->lower <= 1) + { + if (qn->greedy) + { + if (qn->lower == 1) + { + r = add_opcode_rel_addr( + reg, OP_JUMP, (CKN_ON ? SIZE_OP_STATE_CHECK_PUSH : SIZE_OP_PUSH)); + if (r) + return r; + } + + if (CKN_ON) + { + r = add_opcode(reg, OP_STATE_CHECK_PUSH); + if (r) + return r; + r = add_state_check_num(reg, ckn); + if (r) + return r; + r = add_rel_addr(reg, mod_tlen + SIZE_OP_JUMP); + } + else + { + r = add_opcode_rel_addr(reg, OP_PUSH, mod_tlen + SIZE_OP_JUMP); + } + if (r) + return r; + r = compile_tree_empty_check(qn->target, reg, empty_info); + if (r) + return r; + r = add_opcode_rel_addr( + reg, OP_JUMP, + -(mod_tlen + (int)SIZE_OP_JUMP + + (int)(CKN_ON ? SIZE_OP_STATE_CHECK_PUSH : SIZE_OP_PUSH))); + } + else + { + if (qn->lower == 0) + { + r = add_opcode_rel_addr(reg, OP_JUMP, mod_tlen); + if (r) + return r; + } + r = compile_tree_empty_check(qn->target, reg, empty_info); + if (r) + return r; + if (CKN_ON) + { + r = add_opcode(reg, OP_STATE_CHECK_PUSH_OR_JUMP); + if (r) + return r; + r = add_state_check_num(reg, ckn); + if (r) + return r; + r = add_rel_addr(reg, + -(mod_tlen + (int)SIZE_OP_STATE_CHECK_PUSH_OR_JUMP)); + } + else + r = add_opcode_rel_addr(reg, OP_PUSH, -(mod_tlen + (int)SIZE_OP_PUSH)); + } + } + else if (qn->upper == 0) + { + if (qn->is_refered != 0) + { /* /(?<n>..){0}/ */ + r = add_opcode_rel_addr(reg, OP_JUMP, tlen); + if (r) + return r; + r = compile_tree(qn->target, reg); + } + else + r = 0; + } + else if (qn->upper == 1 && qn->greedy) + { + if (qn->lower == 0) + { + if (CKN_ON) + { + r = add_opcode(reg, OP_STATE_CHECK_PUSH); + if (r) + return r; + r = add_state_check_num(reg, ckn); + if (r) + return r; + r = add_rel_addr(reg, tlen); + } + else + { + r = add_opcode_rel_addr(reg, OP_PUSH, tlen); + } + if (r) + return r; + } + + r = compile_tree(qn->target, reg); + } + else if (!qn->greedy && qn->upper == 1 && qn->lower == 0) + { /* '??' */ + if (CKN_ON) + { + r = add_opcode(reg, OP_STATE_CHECK_PUSH); + if (r) + return r; + r = add_state_check_num(reg, ckn); + if (r) + return r; + r = add_rel_addr(reg, SIZE_OP_JUMP); + } + else + { + r = add_opcode_rel_addr(reg, OP_PUSH, SIZE_OP_JUMP); + } + + if (r) + return r; + r = add_opcode_rel_addr(reg, OP_JUMP, tlen); + if (r) + return r; + r = compile_tree(qn->target, reg); + } + else + { + r = compile_range_repeat_node(qn, mod_tlen, empty_info, reg); + if (CKN_ON) + { + if (r) + return r; + r = add_opcode(reg, OP_STATE_CHECK); + if (r) + return r; + r = add_state_check_num(reg, ckn); + } + } + return r; +} + +#else /* USE_COMBINATION_EXPLOSION_CHECK */ + +static int compile_length_quantifier_node(QtfrNode *qn, regex_t *reg) +{ + int len, mod_tlen; + int infinite = IS_REPEAT_INFINITE(qn->upper); + int empty_info = qn->target_empty_info; + int tlen = compile_length_tree(qn->target, reg); + + if (tlen < 0) + return tlen; + + /* anychar repeat */ + if (NTYPE(qn->target) == NT_CANY) + { + if (qn->greedy && infinite) + { + if (IS_NOT_NULL(qn->next_head_exact)) + return SIZE_OP_ANYCHAR_STAR_PEEK_NEXT + tlen * qn->lower; + else + return SIZE_OP_ANYCHAR_STAR + tlen * qn->lower; + } + } + + if (empty_info != 0) + mod_tlen = tlen + (SIZE_OP_NULL_CHECK_START + SIZE_OP_NULL_CHECK_END); + else + mod_tlen = tlen; + + if (infinite + && (qn->lower <= 1 || tlen * qn->lower <= QUANTIFIER_EXPAND_LIMIT_SIZE)) + { + if (qn->lower == 1 && tlen > QUANTIFIER_EXPAND_LIMIT_SIZE) + { + len = SIZE_OP_JUMP; + } + else + { + len = tlen * qn->lower; + } + + if (qn->greedy) + { +# ifdef USE_OP_PUSH_OR_JUMP_EXACT + if (IS_NOT_NULL(qn->head_exact)) + len += SIZE_OP_PUSH_OR_JUMP_EXACT1 + mod_tlen + SIZE_OP_JUMP; + else +# endif + if (IS_NOT_NULL(qn->next_head_exact)) + len += SIZE_OP_PUSH_IF_PEEK_NEXT + mod_tlen + SIZE_OP_JUMP; + else + len += SIZE_OP_PUSH + mod_tlen + SIZE_OP_JUMP; + } + else + len += SIZE_OP_JUMP + mod_tlen + SIZE_OP_PUSH; + } + else if (qn->upper == 0 && qn->is_refered != 0) + { /* /(?<n>..){0}/ */ + len = SIZE_OP_JUMP + tlen; + } + else if (!infinite && qn->greedy + && (qn->upper == 1 + || (tlen + SIZE_OP_PUSH) * qn->upper + <= QUANTIFIER_EXPAND_LIMIT_SIZE)) + { + len = tlen * qn->lower; + len += (SIZE_OP_PUSH + tlen) * (qn->upper - qn->lower); + } + else if (!qn->greedy && qn->upper == 1 && qn->lower == 0) + { /* '??' */ + len = SIZE_OP_PUSH + SIZE_OP_JUMP + tlen; + } + else + { + len = SIZE_OP_REPEAT_INC + mod_tlen + SIZE_OPCODE + SIZE_RELADDR + + SIZE_MEMNUM; + } + + return len; +} + +static int compile_quantifier_node(QtfrNode *qn, regex_t *reg) +{ + int i, r, mod_tlen; + int infinite = IS_REPEAT_INFINITE(qn->upper); + int empty_info = qn->target_empty_info; + int tlen = compile_length_tree(qn->target, reg); + + if (tlen < 0) + return tlen; + + if (is_anychar_star_quantifier(qn)) + { + r = compile_tree_n_times(qn->target, qn->lower, reg); + if (r) + return r; + if (IS_NOT_NULL(qn->next_head_exact)) + { + if (IS_MULTILINE(reg->options)) + r = add_opcode(reg, OP_ANYCHAR_ML_STAR_PEEK_NEXT); + else + r = add_opcode(reg, OP_ANYCHAR_STAR_PEEK_NEXT); + if (r) + return r; + return add_bytes(reg, NSTR(qn->next_head_exact)->s, 1); + } + else + { + if (IS_MULTILINE(reg->options)) + return add_opcode(reg, OP_ANYCHAR_ML_STAR); + else + return add_opcode(reg, OP_ANYCHAR_STAR); + } + } + + if (empty_info != 0) + mod_tlen = tlen + (SIZE_OP_NULL_CHECK_START + SIZE_OP_NULL_CHECK_END); + else + mod_tlen = tlen; + + if (infinite + && (qn->lower <= 1 || tlen * qn->lower <= QUANTIFIER_EXPAND_LIMIT_SIZE)) + { + if (qn->lower == 1 && tlen > QUANTIFIER_EXPAND_LIMIT_SIZE) + { + if (qn->greedy) + { +# ifdef USE_OP_PUSH_OR_JUMP_EXACT + if (IS_NOT_NULL(qn->head_exact)) + r = add_opcode_rel_addr(reg, OP_JUMP, SIZE_OP_PUSH_OR_JUMP_EXACT1); + else +# endif + if (IS_NOT_NULL(qn->next_head_exact)) + r = add_opcode_rel_addr(reg, OP_JUMP, SIZE_OP_PUSH_IF_PEEK_NEXT); + else + r = add_opcode_rel_addr(reg, OP_JUMP, SIZE_OP_PUSH); + } + else + { + r = add_opcode_rel_addr(reg, OP_JUMP, SIZE_OP_JUMP); + } + if (r) + return r; + } + else + { + r = compile_tree_n_times(qn->target, qn->lower, reg); + if (r) + return r; + } + + if (qn->greedy) + { +# ifdef USE_OP_PUSH_OR_JUMP_EXACT + if (IS_NOT_NULL(qn->head_exact)) + { + r = add_opcode_rel_addr(reg, OP_PUSH_OR_JUMP_EXACT1, + mod_tlen + SIZE_OP_JUMP); + if (r) + return r; + add_bytes(reg, NSTR(qn->head_exact)->s, 1); + r = compile_tree_empty_check(qn->target, reg, empty_info); + if (r) + return r; + r = add_opcode_rel_addr( + reg, OP_JUMP, + -(mod_tlen + (int)SIZE_OP_JUMP + (int)SIZE_OP_PUSH_OR_JUMP_EXACT1)); + } + else +# endif + if (IS_NOT_NULL(qn->next_head_exact)) + { + r = add_opcode_rel_addr(reg, OP_PUSH_IF_PEEK_NEXT, + mod_tlen + SIZE_OP_JUMP); + if (r) + return r; + add_bytes(reg, NSTR(qn->next_head_exact)->s, 1); + r = compile_tree_empty_check(qn->target, reg, empty_info); + if (r) + return r; + r = add_opcode_rel_addr( + reg, OP_JUMP, + -(mod_tlen + (int)SIZE_OP_JUMP + (int)SIZE_OP_PUSH_IF_PEEK_NEXT)); + } + else + { + r = add_opcode_rel_addr(reg, OP_PUSH, mod_tlen + SIZE_OP_JUMP); + if (r) + return r; + r = compile_tree_empty_check(qn->target, reg, empty_info); + if (r) + return r; + r = add_opcode_rel_addr( + reg, OP_JUMP, -(mod_tlen + (int)SIZE_OP_JUMP + (int)SIZE_OP_PUSH)); + } + } + else + { + r = add_opcode_rel_addr(reg, OP_JUMP, mod_tlen); + if (r) + return r; + r = compile_tree_empty_check(qn->target, reg, empty_info); + if (r) + return r; + r = add_opcode_rel_addr(reg, OP_PUSH, -(mod_tlen + (int)SIZE_OP_PUSH)); + } + } + else if (qn->upper == 0 && qn->is_refered != 0) + { /* /(?<n>..){0}/ */ + r = add_opcode_rel_addr(reg, OP_JUMP, tlen); + if (r) + return r; + r = compile_tree(qn->target, reg); + } + else if (!infinite && qn->greedy + && (qn->upper == 1 + || (tlen + SIZE_OP_PUSH) * qn->upper + <= QUANTIFIER_EXPAND_LIMIT_SIZE)) + { + int n = qn->upper - qn->lower; + + r = compile_tree_n_times(qn->target, qn->lower, reg); + if (r) + return r; + + for (i = 0; i < n; i++) + { + r = add_opcode_rel_addr(reg, OP_PUSH, + (n - i) * tlen + (n - i - 1) * SIZE_OP_PUSH); + if (r) + return r; + r = compile_tree(qn->target, reg); + if (r) + return r; + } + } + else if (!qn->greedy && qn->upper == 1 && qn->lower == 0) + { /* '??' */ + r = add_opcode_rel_addr(reg, OP_PUSH, SIZE_OP_JUMP); + if (r) + return r; + r = add_opcode_rel_addr(reg, OP_JUMP, tlen); + if (r) + return r; + r = compile_tree(qn->target, reg); + } + else + { + r = compile_range_repeat_node(qn, mod_tlen, empty_info, reg); + } + return r; +} +#endif /* USE_COMBINATION_EXPLOSION_CHECK */ + +static int compile_length_option_node(EncloseNode *node, regex_t *reg) +{ + int tlen; + OnigOptionType prev = reg->options; + + reg->options = node->option; + tlen = compile_length_tree(node->target, reg); + reg->options = prev; + + if (tlen < 0) + return tlen; + + if (IS_DYNAMIC_OPTION(prev ^ node->option)) + { + return SIZE_OP_SET_OPTION_PUSH + SIZE_OP_SET_OPTION + SIZE_OP_FAIL + tlen + + SIZE_OP_SET_OPTION; + } + else + return tlen; +} + +static int compile_option_node(EncloseNode *node, regex_t *reg) +{ + int r; + OnigOptionType prev = reg->options; + + if (IS_DYNAMIC_OPTION(prev ^ node->option)) + { + r = add_opcode_option(reg, OP_SET_OPTION_PUSH, node->option); + if (r) + return r; + r = add_opcode_option(reg, OP_SET_OPTION, prev); + if (r) + return r; + r = add_opcode(reg, OP_FAIL); + if (r) + return r; + } + + reg->options = node->option; + r = compile_tree(node->target, reg); + reg->options = prev; + + if (IS_DYNAMIC_OPTION(prev ^ node->option)) + { + if (r) + return r; + r = add_opcode_option(reg, OP_SET_OPTION, prev); + } + return r; +} + +static int compile_length_enclose_node(EncloseNode *node, regex_t *reg) +{ + int len; + int tlen; + + if (node->type == ENCLOSE_OPTION) + return compile_length_option_node(node, reg); + + if (node->target) + { + tlen = compile_length_tree(node->target, reg); + if (tlen < 0) + return tlen; + } + else + tlen = 0; + + switch (node->type) + { + case ENCLOSE_MEMORY: +#ifdef USE_SUBEXP_CALL + if (IS_ENCLOSE_CALLED(node)) + { + len = SIZE_OP_MEMORY_START_PUSH + tlen + SIZE_OP_CALL + SIZE_OP_JUMP + + SIZE_OP_RETURN; + if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) + len += (IS_ENCLOSE_RECURSION(node) ? SIZE_OP_MEMORY_END_PUSH_REC + : SIZE_OP_MEMORY_END_PUSH); + else + len += (IS_ENCLOSE_RECURSION(node) ? SIZE_OP_MEMORY_END_REC + : SIZE_OP_MEMORY_END); + } + else if (IS_ENCLOSE_RECURSION(node)) + { + len = SIZE_OP_MEMORY_START_PUSH; + len += tlen + + (BIT_STATUS_AT(reg->bt_mem_end, node->regnum) + ? SIZE_OP_MEMORY_END_PUSH_REC + : SIZE_OP_MEMORY_END_REC); + } + else +#endif + { + if (BIT_STATUS_AT(reg->bt_mem_start, node->regnum)) + len = SIZE_OP_MEMORY_START_PUSH; + else + len = SIZE_OP_MEMORY_START; + + len += tlen + + (BIT_STATUS_AT(reg->bt_mem_end, node->regnum) + ? SIZE_OP_MEMORY_END_PUSH + : SIZE_OP_MEMORY_END); + } + break; + + case ENCLOSE_STOP_BACKTRACK: + if (IS_ENCLOSE_STOP_BT_SIMPLE_REPEAT(node)) + { + QtfrNode *qn = NQTFR(node->target); + tlen = compile_length_tree(qn->target, reg); + if (tlen < 0) + return tlen; + + len = tlen * qn->lower + SIZE_OP_PUSH + tlen + SIZE_OP_POP + + SIZE_OP_JUMP; + } + else + { + len = SIZE_OP_PUSH_STOP_BT + tlen + SIZE_OP_POP_STOP_BT; + } + break; + + case ENCLOSE_CONDITION: + len = SIZE_OP_CONDITION; + if (NTYPE(node->target) == NT_ALT) + { + Node *x = node->target; + + tlen = compile_length_tree(NCAR(x), reg); /* yes-node */ + if (tlen < 0) + return tlen; + len += tlen + SIZE_OP_JUMP; + if (NCDR(x) == NULL) + return ONIGERR_PARSER_BUG; + x = NCDR(x); + tlen = compile_length_tree(NCAR(x), reg); /* no-node */ + if (tlen < 0) + return tlen; + len += tlen; + if (NCDR(x) != NULL) + return ONIGERR_INVALID_CONDITION_PATTERN; + } + else + { + return ONIGERR_PARSER_BUG; + } + break; + + case ENCLOSE_ABSENT: + len = SIZE_OP_PUSH_ABSENT_POS + SIZE_OP_ABSENT + tlen + + SIZE_OP_ABSENT_END; + break; + + default: + return ONIGERR_TYPE_BUG; + break; + } + + return len; +} + +static int get_char_length_tree(Node *node, regex_t *reg, int *len); + +static int compile_enclose_node(EncloseNode *node, regex_t *reg) +{ + int r, len; + + if (node->type == ENCLOSE_OPTION) + return compile_option_node(node, reg); + + switch (node->type) + { + case ENCLOSE_MEMORY: +#ifdef USE_SUBEXP_CALL + if (IS_ENCLOSE_CALLED(node)) + { + r = add_opcode(reg, OP_CALL); + if (r) + return r; + node->call_addr + = BBUF_GET_OFFSET_POS(reg) + SIZE_ABSADDR + SIZE_OP_JUMP; + node->state |= NST_ADDR_FIXED; + r = add_abs_addr(reg, (int)node->call_addr); + if (r) + return r; + len = compile_length_tree(node->target, reg); + len += (SIZE_OP_MEMORY_START_PUSH + SIZE_OP_RETURN); + if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) + len += (IS_ENCLOSE_RECURSION(node) ? SIZE_OP_MEMORY_END_PUSH_REC + : SIZE_OP_MEMORY_END_PUSH); + else + len += (IS_ENCLOSE_RECURSION(node) ? SIZE_OP_MEMORY_END_REC + : SIZE_OP_MEMORY_END); + + r = add_opcode_rel_addr(reg, OP_JUMP, len); + if (r) + return r; + } +#endif + if (BIT_STATUS_AT(reg->bt_mem_start, node->regnum)) + r = add_opcode(reg, OP_MEMORY_START_PUSH); + else + r = add_opcode(reg, OP_MEMORY_START); + if (r) + return r; + r = add_mem_num(reg, node->regnum); + if (r) + return r; + r = compile_tree(node->target, reg); + if (r) + return r; +#ifdef USE_SUBEXP_CALL + if (IS_ENCLOSE_CALLED(node)) + { + if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) + r = add_opcode(reg, + (IS_ENCLOSE_RECURSION(node) ? OP_MEMORY_END_PUSH_REC + : OP_MEMORY_END_PUSH)); + else + r = add_opcode(reg, (IS_ENCLOSE_RECURSION(node) ? OP_MEMORY_END_REC + : OP_MEMORY_END)); + + if (r) + return r; + r = add_mem_num(reg, node->regnum); + if (r) + return r; + r = add_opcode(reg, OP_RETURN); + } + else if (IS_ENCLOSE_RECURSION(node)) + { + if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) + r = add_opcode(reg, OP_MEMORY_END_PUSH_REC); + else + r = add_opcode(reg, OP_MEMORY_END_REC); + if (r) + return r; + r = add_mem_num(reg, node->regnum); + } + else +#endif + { + if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) + r = add_opcode(reg, OP_MEMORY_END_PUSH); + else + r = add_opcode(reg, OP_MEMORY_END); + if (r) + return r; + r = add_mem_num(reg, node->regnum); + } + break; + + case ENCLOSE_STOP_BACKTRACK: + if (IS_ENCLOSE_STOP_BT_SIMPLE_REPEAT(node)) + { + QtfrNode *qn = NQTFR(node->target); + r = compile_tree_n_times(qn->target, qn->lower, reg); + if (r) + return r; + + len = compile_length_tree(qn->target, reg); + if (len < 0) + return len; + + r = add_opcode_rel_addr(reg, OP_PUSH, len + SIZE_OP_POP + SIZE_OP_JUMP); + if (r) + return r; + r = compile_tree(qn->target, reg); + if (r) + return r; + r = add_opcode(reg, OP_POP); + if (r) + return r; + r = add_opcode_rel_addr( + reg, OP_JUMP, + -((int)SIZE_OP_PUSH + len + (int)SIZE_OP_POP + (int)SIZE_OP_JUMP)); + } + else + { + r = add_opcode(reg, OP_PUSH_STOP_BT); + if (r) + return r; + r = compile_tree(node->target, reg); + if (r) + return r; + r = add_opcode(reg, OP_POP_STOP_BT); + } + break; + + case ENCLOSE_CONDITION: + r = add_opcode(reg, OP_CONDITION); + if (r) + return r; + r = add_mem_num(reg, node->regnum); + if (r) + return r; + + if (NTYPE(node->target) == NT_ALT) + { + Node *x = node->target; + int len2; + + len = compile_length_tree(NCAR(x), reg); /* yes-node */ + if (len < 0) + return len; + if (NCDR(x) == NULL) + return ONIGERR_PARSER_BUG; + x = NCDR(x); + len2 = compile_length_tree(NCAR(x), reg); /* no-node */ + if (len2 < 0) + return len2; + if (NCDR(x) != NULL) + return ONIGERR_INVALID_CONDITION_PATTERN; + + x = node->target; + r = add_rel_addr(reg, len + SIZE_OP_JUMP); + if (r) + return r; + r = compile_tree(NCAR(x), reg); /* yes-node */ + if (r) + return r; + r = add_opcode_rel_addr(reg, OP_JUMP, len2); + if (r) + return r; + x = NCDR(x); + r = compile_tree(NCAR(x), reg); /* no-node */ + } + else + { + return ONIGERR_PARSER_BUG; + } + break; + + case ENCLOSE_ABSENT: + len = compile_length_tree(node->target, reg); + if (len < 0) + return len; + + r = add_opcode(reg, OP_PUSH_ABSENT_POS); + if (r) + return r; + r = add_opcode_rel_addr(reg, OP_ABSENT, len + SIZE_OP_ABSENT_END); + if (r) + return r; + r = compile_tree(node->target, reg); + if (r) + return r; + r = add_opcode(reg, OP_ABSENT_END); + break; + + default: + return ONIGERR_TYPE_BUG; + break; + } + + return r; +} + +static int compile_length_anchor_node(AnchorNode *node, regex_t *reg) +{ + int len; + int tlen = 0; + + if (node->target) + { + tlen = compile_length_tree(node->target, reg); + if (tlen < 0) + return tlen; + } + + switch (node->type) + { + case ANCHOR_PREC_READ: + len = SIZE_OP_PUSH_POS + tlen + SIZE_OP_POP_POS; + break; + case ANCHOR_PREC_READ_NOT: + len = SIZE_OP_PUSH_POS_NOT + tlen + SIZE_OP_FAIL_POS; + break; + case ANCHOR_LOOK_BEHIND: + len = SIZE_OP_LOOK_BEHIND + tlen; + break; + case ANCHOR_LOOK_BEHIND_NOT: + len = SIZE_OP_PUSH_LOOK_BEHIND_NOT + tlen + SIZE_OP_FAIL_LOOK_BEHIND_NOT; + break; + + default: + len = SIZE_OPCODE; + break; + } + + return len; +} + +static int compile_anchor_node(AnchorNode *node, regex_t *reg) +{ + int r, len; + + switch (node->type) + { + case ANCHOR_BEGIN_BUF: + r = add_opcode(reg, OP_BEGIN_BUF); + break; + case ANCHOR_END_BUF: + r = add_opcode(reg, OP_END_BUF); + break; + case ANCHOR_BEGIN_LINE: + r = add_opcode(reg, OP_BEGIN_LINE); + break; + case ANCHOR_END_LINE: + r = add_opcode(reg, OP_END_LINE); + break; + case ANCHOR_SEMI_END_BUF: + r = add_opcode(reg, OP_SEMI_END_BUF); + break; + case ANCHOR_BEGIN_POSITION: + r = add_opcode(reg, OP_BEGIN_POSITION); + break; + + case ANCHOR_WORD_BOUND: + if (node->ascii_range) + r = add_opcode(reg, OP_ASCII_WORD_BOUND); + else + r = add_opcode(reg, OP_WORD_BOUND); + break; + case ANCHOR_NOT_WORD_BOUND: + if (node->ascii_range) + r = add_opcode(reg, OP_NOT_ASCII_WORD_BOUND); + else + r = add_opcode(reg, OP_NOT_WORD_BOUND); + break; +#ifdef USE_WORD_BEGIN_END + case ANCHOR_WORD_BEGIN: + if (node->ascii_range) + r = add_opcode(reg, OP_ASCII_WORD_BEGIN); + else + r = add_opcode(reg, OP_WORD_BEGIN); + break; + case ANCHOR_WORD_END: + if (node->ascii_range) + r = add_opcode(reg, OP_ASCII_WORD_END); + else + r = add_opcode(reg, OP_WORD_END); + break; +#endif + case ANCHOR_KEEP: + r = add_opcode(reg, OP_KEEP); + break; + + case ANCHOR_PREC_READ: + r = add_opcode(reg, OP_PUSH_POS); + if (r) + return r; + r = compile_tree(node->target, reg); + if (r) + return r; + r = add_opcode(reg, OP_POP_POS); + break; + + case ANCHOR_PREC_READ_NOT: + len = compile_length_tree(node->target, reg); + if (len < 0) + return len; + r = add_opcode_rel_addr(reg, OP_PUSH_POS_NOT, len + SIZE_OP_FAIL_POS); + if (r) + return r; + r = compile_tree(node->target, reg); + if (r) + return r; + r = add_opcode(reg, OP_FAIL_POS); + break; + + case ANCHOR_LOOK_BEHIND: { + int n; + r = add_opcode(reg, OP_LOOK_BEHIND); + if (r) + return r; + if (node->char_len < 0) + { + r = get_char_length_tree(node->target, reg, &n); + if (r) + return ONIGERR_INVALID_LOOK_BEHIND_PATTERN; + } + else + n = node->char_len; + r = add_length(reg, n); + if (r) + return r; + r = compile_tree(node->target, reg); + } + break; + + case ANCHOR_LOOK_BEHIND_NOT: { + int n; + len = compile_length_tree(node->target, reg); + r = add_opcode_rel_addr(reg, OP_PUSH_LOOK_BEHIND_NOT, + len + SIZE_OP_FAIL_LOOK_BEHIND_NOT); + if (r) + return r; + if (node->char_len < 0) + { + r = get_char_length_tree(node->target, reg, &n); + if (r) + return ONIGERR_INVALID_LOOK_BEHIND_PATTERN; + } + else + n = node->char_len; + r = add_length(reg, n); + if (r) + return r; + r = compile_tree(node->target, reg); + if (r) + return r; + r = add_opcode(reg, OP_FAIL_LOOK_BEHIND_NOT); + } + break; + + default: + return ONIGERR_TYPE_BUG; + break; + } + + return r; +} + +static int compile_length_tree(Node *node, regex_t *reg) +{ + int len, type, r; + + type = NTYPE(node); + switch (type) + { + case NT_LIST: + len = 0; + do + { + r = compile_length_tree(NCAR(node), reg); + if (r < 0) + return r; + len += r; + } while (IS_NOT_NULL(node = NCDR(node))); + r = len; + break; + + case NT_ALT: { + int n = 0; + len = 0; + do + { + r = compile_length_tree(NCAR(node), reg); + if (r < 0) + return r; + len += r; + n++; + } while (IS_NOT_NULL(node = NCDR(node))); + r = len; + r += (SIZE_OP_PUSH + SIZE_OP_JUMP) * (n - 1); + } + break; + + case NT_STR: + if (NSTRING_IS_RAW(node)) + r = compile_length_string_raw_node(NSTR(node), reg); + else + r = compile_length_string_node(node, reg); + break; + + case NT_CCLASS: + r = compile_length_cclass_node(NCCLASS(node), reg); + break; + + case NT_CTYPE: + case NT_CANY: + r = SIZE_OPCODE; + break; + + case NT_BREF: { + BRefNode *br = NBREF(node); + +#ifdef USE_BACKREF_WITH_LEVEL + if (IS_BACKREF_NEST_LEVEL(br)) + { + r = SIZE_OPCODE + SIZE_OPTION + SIZE_LENGTH + SIZE_LENGTH + + (SIZE_MEMNUM * br->back_num); + } + else +#endif + if (br->back_num == 1) + { + r = ((!IS_IGNORECASE(reg->options) && br->back_static[0] <= 2) + ? SIZE_OPCODE + : (SIZE_OPCODE + SIZE_MEMNUM)); + } + else + { + r = SIZE_OPCODE + SIZE_LENGTH + (SIZE_MEMNUM * br->back_num); + } + } + break; + +#ifdef USE_SUBEXP_CALL + case NT_CALL: + r = SIZE_OP_CALL; + break; +#endif + + case NT_QTFR: + r = compile_length_quantifier_node(NQTFR(node), reg); + break; + + case NT_ENCLOSE: + r = compile_length_enclose_node(NENCLOSE(node), reg); + break; + + case NT_ANCHOR: + r = compile_length_anchor_node(NANCHOR(node), reg); + break; + + default: + return ONIGERR_TYPE_BUG; + break; + } + + return r; +} + +static int compile_tree(Node *node, regex_t *reg) +{ + int n, type, len, pos, r = 0; + + type = NTYPE(node); + switch (type) + { + case NT_LIST: + do + { + r = compile_tree(NCAR(node), reg); + } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); + break; + + case NT_ALT: { + Node *x = node; + len = 0; + do + { + len += compile_length_tree(NCAR(x), reg); + if (NCDR(x) != NULL) + { + len += SIZE_OP_PUSH + SIZE_OP_JUMP; + } + } while (IS_NOT_NULL(x = NCDR(x))); + pos = reg->used + len; /* goal position */ + + do + { + len = compile_length_tree(NCAR(node), reg); + if (IS_NOT_NULL(NCDR(node))) + { + r = add_opcode_rel_addr(reg, OP_PUSH, len + SIZE_OP_JUMP); + if (r) + break; + } + r = compile_tree(NCAR(node), reg); + if (r) + break; + if (IS_NOT_NULL(NCDR(node))) + { + len = pos - (reg->used + SIZE_OP_JUMP); + r = add_opcode_rel_addr(reg, OP_JUMP, len); + if (r) + break; + } + } while (IS_NOT_NULL(node = NCDR(node))); + } + break; + + case NT_STR: + if (NSTRING_IS_RAW(node)) + r = compile_string_raw_node(NSTR(node), reg); + else + r = compile_string_node(node, reg); + break; + + case NT_CCLASS: + r = compile_cclass_node(NCCLASS(node), reg); + break; + + case NT_CTYPE: { + int op; + + switch (NCTYPE(node)->ctype) + { + case ONIGENC_CTYPE_WORD: + if (NCTYPE(node)->ascii_range != 0) + { + if (NCTYPE(node)->not!= 0) + op = OP_NOT_ASCII_WORD; + else + op = OP_ASCII_WORD; + } + else + { + if (NCTYPE(node)->not!= 0) + op = OP_NOT_WORD; + else + op = OP_WORD; + } + break; + default: + return ONIGERR_TYPE_BUG; + break; + } + r = add_opcode(reg, op); + } + break; + + case NT_CANY: + if (IS_MULTILINE(reg->options)) + r = add_opcode(reg, OP_ANYCHAR_ML); + else + r = add_opcode(reg, OP_ANYCHAR); + break; + + case NT_BREF: { + BRefNode *br = NBREF(node); + +#ifdef USE_BACKREF_WITH_LEVEL + if (IS_BACKREF_NEST_LEVEL(br)) + { + r = add_opcode(reg, OP_BACKREF_WITH_LEVEL); + if (r) + return r; + r = add_option(reg, (reg->options & ONIG_OPTION_IGNORECASE)); + if (r) + return r; + r = add_length(reg, br->nest_level); + if (r) + return r; + + goto add_bacref_mems; + } + else +#endif + if (br->back_num == 1) + { + n = br->back_static[0]; + if (IS_IGNORECASE(reg->options)) + { + r = add_opcode(reg, OP_BACKREFN_IC); + if (r) + return r; + r = add_mem_num(reg, n); + } + else + { + switch (n) + { + case 1: + r = add_opcode(reg, OP_BACKREF1); + break; + case 2: + r = add_opcode(reg, OP_BACKREF2); + break; + default: + r = add_opcode(reg, OP_BACKREFN); + if (r) + return r; + r = add_mem_num(reg, n); + break; + } + } + } + else + { + int i; + int *p; + + if (IS_IGNORECASE(reg->options)) + { + r = add_opcode(reg, OP_BACKREF_MULTI_IC); + } + else + { + r = add_opcode(reg, OP_BACKREF_MULTI); + } + if (r) + return r; + +#ifdef USE_BACKREF_WITH_LEVEL + add_bacref_mems: +#endif + r = add_length(reg, br->back_num); + if (r) + return r; + p = BACKREFS_P(br); + for (i = br->back_num - 1; i >= 0; i--) + { + r = add_mem_num(reg, p[i]); + if (r) + return r; + } + } + } + break; + +#ifdef USE_SUBEXP_CALL + case NT_CALL: + r = compile_call(NCALL(node), reg); + break; +#endif + + case NT_QTFR: + r = compile_quantifier_node(NQTFR(node), reg); + break; + + case NT_ENCLOSE: + r = compile_enclose_node(NENCLOSE(node), reg); + break; + + case NT_ANCHOR: + r = compile_anchor_node(NANCHOR(node), reg); + break; + + default: +#ifdef ONIG_DEBUG + fprintf(stderr, "compile_tree: undefined node type %d\n", NTYPE(node)); +#endif + break; + } + + return r; +} + +#ifdef USE_NAMED_GROUP + +static int noname_disable_map(Node **plink, GroupNumRemap *map, int *counter) +{ + int r = 0; + Node *node = *plink; + + switch (NTYPE(node)) + { + case NT_LIST: + case NT_ALT: + do + { + r = noname_disable_map(&(NCAR(node)), map, counter); + } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); + break; + + case NT_QTFR: { + Node **ptarget = &(NQTFR(node)->target); + Node *old = *ptarget; + r = noname_disable_map(ptarget, map, counter); + if (*ptarget != old && NTYPE(*ptarget) == NT_QTFR) + { + onig_reduce_nested_quantifier(node, *ptarget); + } + } + break; + + case NT_ENCLOSE: { + EncloseNode *en = NENCLOSE(node); + if (en->type == ENCLOSE_MEMORY) + { + if (IS_ENCLOSE_NAMED_GROUP(en)) + { + (*counter)++; + map[en->regnum].new_val = *counter; + en->regnum = *counter; + } + else if (en->regnum != 0) + { + *plink = en->target; + en->target = NULL_NODE; + onig_node_free(node); + r = noname_disable_map(plink, map, counter); + break; + } + } + r = noname_disable_map(&(en->target), map, counter); + } + break; + + case NT_ANCHOR: + if (NANCHOR(node)->target) + r = noname_disable_map(&(NANCHOR(node)->target), map, counter); + break; + + default: + break; + } + + return r; +} + +static int renumber_node_backref(Node *node, GroupNumRemap *map) +{ + int i, pos, n, old_num; + int *backs; + BRefNode *bn = NBREF(node); + + if (!IS_BACKREF_NAME_REF(bn)) + return ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED; + + old_num = bn->back_num; + if (IS_NULL(bn->back_dynamic)) + backs = bn->back_static; + else + backs = bn->back_dynamic; + + for (i = 0, pos = 0; i < old_num; i++) + { + n = map[backs[i]].new_val; + if (n > 0) + { + backs[pos] = n; + pos++; + } + } + + bn->back_num = pos; + return 0; +} + +static int renumber_by_map(Node *node, GroupNumRemap *map) +{ + int r = 0; + + switch (NTYPE(node)) + { + case NT_LIST: + case NT_ALT: + do + { + r = renumber_by_map(NCAR(node), map); + } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); + break; + case NT_QTFR: + r = renumber_by_map(NQTFR(node)->target, map); + break; + case NT_ENCLOSE: { + EncloseNode *en = NENCLOSE(node); + if (en->type == ENCLOSE_CONDITION) + en->regnum = map[en->regnum].new_val; + r = renumber_by_map(en->target, map); + } + break; + + case NT_BREF: + r = renumber_node_backref(node, map); + break; + + case NT_ANCHOR: + if (NANCHOR(node)->target) + r = renumber_by_map(NANCHOR(node)->target, map); + break; + + default: + break; + } + + return r; +} + +static int numbered_ref_check(Node *node) +{ + int r = 0; + + switch (NTYPE(node)) + { + case NT_LIST: + case NT_ALT: + do + { + r = numbered_ref_check(NCAR(node)); + } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); + break; + case NT_QTFR: + r = numbered_ref_check(NQTFR(node)->target); + break; + case NT_ENCLOSE: + r = numbered_ref_check(NENCLOSE(node)->target); + break; + + case NT_BREF: + if (!IS_BACKREF_NAME_REF(NBREF(node))) + return ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED; + break; + + case NT_ANCHOR: + if (NANCHOR(node)->target) + r = numbered_ref_check(NANCHOR(node)->target); + break; + + default: + break; + } + + return r; +} + +static int disable_noname_group_capture(Node **root, regex_t *reg, ScanEnv *env) +{ + int r, i, pos, counter; + BitStatusType loc; + GroupNumRemap *map; + + map = (GroupNumRemap *)xalloca(sizeof(GroupNumRemap) * (env->num_mem + 1)); + CHECK_NULL_RETURN_MEMERR(map); + for (i = 1; i <= env->num_mem; i++) + { + map[i].new_val = 0; + } + counter = 0; + r = noname_disable_map(root, map, &counter); + if (r != 0) + return r; + + r = renumber_by_map(*root, map); + if (r != 0) + return r; + + for (i = 1, pos = 1; i <= env->num_mem; i++) + { + if (map[i].new_val > 0) + { + SCANENV_MEM_NODES(env)[pos] = SCANENV_MEM_NODES(env)[i]; + pos++; + } + } + + loc = env->capture_history; + BIT_STATUS_CLEAR(env->capture_history); + for (i = 1; i <= ONIG_MAX_CAPTURE_HISTORY_GROUP; i++) + { + if (BIT_STATUS_AT(loc, i)) + { + BIT_STATUS_ON_AT_SIMPLE(env->capture_history, map[i].new_val); + } + } + + env->num_mem = env->num_named; + reg->num_mem = env->num_named; + + return onig_renumber_name_table(reg, map); +} +#endif /* USE_NAMED_GROUP */ + +#ifdef USE_SUBEXP_CALL +static int unset_addr_list_fix(UnsetAddrList *uslist, regex_t *reg) +{ + int i, offset; + EncloseNode *en; + AbsAddrType addr; + + for (i = 0; i < uslist->num; i++) + { + en = NENCLOSE(uslist->us[i].target); + if (!IS_ENCLOSE_ADDR_FIXED(en)) + return ONIGERR_PARSER_BUG; + addr = en->call_addr; + offset = uslist->us[i].offset; + + BBUF_WRITE(reg, offset, &addr, SIZE_ABSADDR); + } + return 0; +} +#endif + +#ifdef USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT +static int quantifiers_memory_node_info(Node *node) +{ + int r = 0; + + switch (NTYPE(node)) + { + case NT_LIST: + case NT_ALT: { + int v; + do + { + v = quantifiers_memory_node_info(NCAR(node)); + if (v > r) + r = v; + } while (v >= 0 && IS_NOT_NULL(node = NCDR(node))); + } + break; + +# ifdef USE_SUBEXP_CALL + case NT_CALL: + if (IS_CALL_RECURSION(NCALL(node))) + { + return NQ_TARGET_IS_EMPTY_REC; /* tiny version */ + } + else + r = quantifiers_memory_node_info(NCALL(node)->target); + break; +# endif + + case NT_QTFR: { + QtfrNode *qn = NQTFR(node); + if (qn->upper != 0) + { + r = quantifiers_memory_node_info(qn->target); + } + } + break; + + case NT_ENCLOSE: { + EncloseNode *en = NENCLOSE(node); + switch (en->type) + { + case ENCLOSE_MEMORY: + return NQ_TARGET_IS_EMPTY_MEM; + break; + + case ENCLOSE_OPTION: + case ENCLOSE_STOP_BACKTRACK: + case ENCLOSE_CONDITION: + case ENCLOSE_ABSENT: + r = quantifiers_memory_node_info(en->target); + break; + default: + break; + } + } + break; + + case NT_BREF: + case NT_STR: + case NT_CTYPE: + case NT_CCLASS: + case NT_CANY: + case NT_ANCHOR: + default: + break; + } + + return r; +} +#endif /* USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT */ + +static int get_min_match_length(Node *node, OnigDistance *min, ScanEnv *env) +{ + OnigDistance tmin; + int r = 0; + + *min = 0; + switch (NTYPE(node)) + { + case NT_BREF: { + int i; + int *backs; + Node **nodes = SCANENV_MEM_NODES(env); + BRefNode *br = NBREF(node); + if (br->state & NST_RECURSION) + break; + + backs = BACKREFS_P(br); + if (backs[0] > env->num_mem) + return ONIGERR_INVALID_BACKREF; + r = get_min_match_length(nodes[backs[0]], min, env); + if (r != 0) + break; + for (i = 1; i < br->back_num; i++) + { + if (backs[i] > env->num_mem) + return ONIGERR_INVALID_BACKREF; + r = get_min_match_length(nodes[backs[i]], &tmin, env); + if (r != 0) + break; + if (*min > tmin) + *min = tmin; + } + } + break; + +#ifdef USE_SUBEXP_CALL + case NT_CALL: + if (IS_CALL_RECURSION(NCALL(node))) + { + EncloseNode *en = NENCLOSE(NCALL(node)->target); + if (IS_ENCLOSE_MIN_FIXED(en)) + *min = en->min_len; + } + else + r = get_min_match_length(NCALL(node)->target, min, env); + break; +#endif + + case NT_LIST: + do + { + r = get_min_match_length(NCAR(node), &tmin, env); + if (r == 0) + *min += tmin; + } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); + break; + + case NT_ALT: { + Node *x, *y; + y = node; + do + { + x = NCAR(y); + r = get_min_match_length(x, &tmin, env); + if (r != 0) + break; + if (y == node) + *min = tmin; + else if (*min > tmin) + *min = tmin; + } while (r == 0 && IS_NOT_NULL(y = NCDR(y))); + } + break; + + case NT_STR: { + StrNode *sn = NSTR(node); + *min = sn->end - sn->s; + } + break; + + case NT_CTYPE: + *min = 1; + break; + + case NT_CCLASS: + case NT_CANY: + *min = 1; + break; + + case NT_QTFR: { + QtfrNode *qn = NQTFR(node); + + if (qn->lower > 0) + { + r = get_min_match_length(qn->target, min, env); + if (r == 0) + *min = distance_multiply(*min, qn->lower); + } + } + break; + + case NT_ENCLOSE: { + EncloseNode *en = NENCLOSE(node); + switch (en->type) + { + case ENCLOSE_MEMORY: + if (IS_ENCLOSE_MIN_FIXED(en)) + *min = en->min_len; + else + { + if (IS_ENCLOSE_MARK1(NENCLOSE(node))) + *min = 0; /* recursive */ + else + { + SET_ENCLOSE_STATUS(node, NST_MARK1); + r = get_min_match_length(en->target, min, env); + CLEAR_ENCLOSE_STATUS(node, NST_MARK1); + if (r == 0) + { + en->min_len = *min; + SET_ENCLOSE_STATUS(node, NST_MIN_FIXED); + } + } + } + break; + + case ENCLOSE_OPTION: + case ENCLOSE_STOP_BACKTRACK: + case ENCLOSE_CONDITION: + r = get_min_match_length(en->target, min, env); + break; + + case ENCLOSE_ABSENT: + break; + } + } + break; + + case NT_ANCHOR: + default: + break; + } + + return r; +} + +static int get_max_match_length(Node *node, OnigDistance *max, ScanEnv *env) +{ + OnigDistance tmax; + int r = 0; + + *max = 0; + switch (NTYPE(node)) + { + case NT_LIST: + do + { + r = get_max_match_length(NCAR(node), &tmax, env); + if (r == 0) + *max = distance_add(*max, tmax); + } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); + break; + + case NT_ALT: + do + { + r = get_max_match_length(NCAR(node), &tmax, env); + if (r == 0 && *max < tmax) + *max = tmax; + } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); + break; + + case NT_STR: { + StrNode *sn = NSTR(node); + *max = sn->end - sn->s; + } + break; + + case NT_CTYPE: + *max = ONIGENC_MBC_MAXLEN_DIST(env->enc); + break; + + case NT_CCLASS: + case NT_CANY: + *max = ONIGENC_MBC_MAXLEN_DIST(env->enc); + break; + + case NT_BREF: { + int i; + int *backs; + Node **nodes = SCANENV_MEM_NODES(env); + BRefNode *br = NBREF(node); + if (br->state & NST_RECURSION) + { + *max = ONIG_INFINITE_DISTANCE; + break; + } + backs = BACKREFS_P(br); + for (i = 0; i < br->back_num; i++) + { + if (backs[i] > env->num_mem) + return ONIGERR_INVALID_BACKREF; + r = get_max_match_length(nodes[backs[i]], &tmax, env); + if (r != 0) + break; + if (*max < tmax) + *max = tmax; + } + } + break; + +#ifdef USE_SUBEXP_CALL + case NT_CALL: + if (!IS_CALL_RECURSION(NCALL(node))) + r = get_max_match_length(NCALL(node)->target, max, env); + else + *max = ONIG_INFINITE_DISTANCE; + break; +#endif + + case NT_QTFR: { + QtfrNode *qn = NQTFR(node); + + if (qn->upper != 0) + { + r = get_max_match_length(qn->target, max, env); + if (r == 0 && *max != 0) + { + if (!IS_REPEAT_INFINITE(qn->upper)) + *max = distance_multiply(*max, qn->upper); + else + *max = ONIG_INFINITE_DISTANCE; + } + } + } + break; + + case NT_ENCLOSE: { + EncloseNode *en = NENCLOSE(node); + switch (en->type) + { + case ENCLOSE_MEMORY: + if (IS_ENCLOSE_MAX_FIXED(en)) + *max = en->max_len; + else + { + if (IS_ENCLOSE_MARK1(NENCLOSE(node))) + *max = ONIG_INFINITE_DISTANCE; + else + { + SET_ENCLOSE_STATUS(node, NST_MARK1); + r = get_max_match_length(en->target, max, env); + CLEAR_ENCLOSE_STATUS(node, NST_MARK1); + if (r == 0) + { + en->max_len = *max; + SET_ENCLOSE_STATUS(node, NST_MAX_FIXED); + } + } + } + break; + + case ENCLOSE_OPTION: + case ENCLOSE_STOP_BACKTRACK: + case ENCLOSE_CONDITION: + r = get_max_match_length(en->target, max, env); + break; + + case ENCLOSE_ABSENT: + break; + } + } + break; + + case NT_ANCHOR: + default: + break; + } + + return r; +} + +#define GET_CHAR_LEN_VARLEN -1 +#define GET_CHAR_LEN_TOP_ALT_VARLEN -2 + +/* fixed size pattern node only */ +static int get_char_length_tree1(Node *node, regex_t *reg, int *len, int level) +{ + int tlen; + int r = 0; + + level++; + *len = 0; + switch (NTYPE(node)) + { + case NT_LIST: + do + { + r = get_char_length_tree1(NCAR(node), reg, &tlen, level); + if (r == 0) + *len = (int)distance_add(*len, tlen); + } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); + break; + + case NT_ALT: { + int tlen2; + int varlen = 0; + + r = get_char_length_tree1(NCAR(node), reg, &tlen, level); + while (r == 0 && IS_NOT_NULL(node = NCDR(node))) + { + r = get_char_length_tree1(NCAR(node), reg, &tlen2, level); + if (r == 0) + { + if (tlen != tlen2) + varlen = 1; + } + } + if (r == 0) + { + if (varlen != 0) + { + if (level == 1) + r = GET_CHAR_LEN_TOP_ALT_VARLEN; + else + r = GET_CHAR_LEN_VARLEN; + } + else + *len = tlen; + } + } + break; + + case NT_STR: { + StrNode *sn = NSTR(node); + UChar *s = sn->s; + while (s < sn->end) + { + s += enclen(reg->enc, s, sn->end); + (*len)++; + } + } + break; + + case NT_QTFR: { + QtfrNode *qn = NQTFR(node); + if (qn->lower == qn->upper) + { + r = get_char_length_tree1(qn->target, reg, &tlen, level); + if (r == 0) + *len = (int)distance_multiply(tlen, qn->lower); + } + else + r = GET_CHAR_LEN_VARLEN; + } + break; + +#ifdef USE_SUBEXP_CALL + case NT_CALL: + if (!IS_CALL_RECURSION(NCALL(node))) + r = get_char_length_tree1(NCALL(node)->target, reg, len, level); + else + r = GET_CHAR_LEN_VARLEN; + break; +#endif + + case NT_CTYPE: + *len = 1; + break; + + case NT_CCLASS: + case NT_CANY: + *len = 1; + break; + + case NT_ENCLOSE: { + EncloseNode *en = NENCLOSE(node); + switch (en->type) + { + case ENCLOSE_MEMORY: +#ifdef USE_SUBEXP_CALL + if (IS_ENCLOSE_CLEN_FIXED(en)) + *len = en->char_len; + else + { + r = get_char_length_tree1(en->target, reg, len, level); + if (r == 0) + { + en->char_len = *len; + SET_ENCLOSE_STATUS(node, NST_CLEN_FIXED); + } + } + break; +#endif + case ENCLOSE_OPTION: + case ENCLOSE_STOP_BACKTRACK: + case ENCLOSE_CONDITION: + r = get_char_length_tree1(en->target, reg, len, level); + break; + case ENCLOSE_ABSENT: + default: + break; + } + } + break; + + case NT_ANCHOR: + break; + + default: + r = GET_CHAR_LEN_VARLEN; + break; + } + + return r; +} + +static int get_char_length_tree(Node *node, regex_t *reg, int *len) +{ + return get_char_length_tree1(node, reg, len, 0); +} + +/* x is not included y ==> 1 : 0 */ +static int is_not_included(Node *x, Node *y, regex_t *reg) +{ + int i; + OnigDistance len; + OnigCodePoint code; + UChar *p; + int ytype; + +retry: + ytype = NTYPE(y); + switch (NTYPE(x)) + { + case NT_CTYPE: { + switch (ytype) + { + case NT_CTYPE: + if (NCTYPE(y)->ctype == NCTYPE(x)->ctype + && NCTYPE(y)->not!= NCTYPE(x)->not&&NCTYPE(y)->ascii_range + == NCTYPE(x)->ascii_range) + return 1; + else + return 0; + break; + + case NT_CCLASS: + swap: { + Node *tmp; + tmp = x; + x = y; + y = tmp; + goto retry; + } + break; + + case NT_STR: + goto swap; + break; + + default: + break; + } + } + break; + + case NT_CCLASS: { + CClassNode *xc = NCCLASS(x); + switch (ytype) + { + case NT_CTYPE: + switch (NCTYPE(y)->ctype) + { + case ONIGENC_CTYPE_WORD: + if (NCTYPE(y)->not== 0) + { + if (IS_NULL(xc->mbuf) && !IS_NCCLASS_NOT(xc)) + { + for (i = 0; i < SINGLE_BYTE_SIZE; i++) + { + if (BITSET_AT(xc->bs, i)) + { + if (NCTYPE(y)->ascii_range) + { + if (IS_CODE_SB_WORD(reg->enc, i)) + return 0; + } + else + { + if (ONIGENC_IS_CODE_WORD(reg->enc, i)) + return 0; + } + } + } + return 1; + } + return 0; + } + else + { + if (IS_NOT_NULL(xc->mbuf)) + return 0; + for (i = 0; i < SINGLE_BYTE_SIZE; i++) + { + int is_word; + if (NCTYPE(y)->ascii_range) + is_word = IS_CODE_SB_WORD(reg->enc, i); + else + is_word = ONIGENC_IS_CODE_WORD(reg->enc, i); + if (!is_word) + { + if (!IS_NCCLASS_NOT(xc)) + { + if (BITSET_AT(xc->bs, i)) + return 0; + } + else + { + if (!BITSET_AT(xc->bs, i)) + return 0; + } + } + } + return 1; + } + break; + + default: + break; + } + break; + + case NT_CCLASS: { + int v; + CClassNode *yc = NCCLASS(y); + + for (i = 0; i < SINGLE_BYTE_SIZE; i++) + { + v = BITSET_AT(xc->bs, i); + if ((v != 0 && !IS_NCCLASS_NOT(xc)) + || (v == 0 && IS_NCCLASS_NOT(xc))) + { + v = BITSET_AT(yc->bs, i); + if ((v != 0 && !IS_NCCLASS_NOT(yc)) + || (v == 0 && IS_NCCLASS_NOT(yc))) + return 0; + } + } + if ((IS_NULL(xc->mbuf) && !IS_NCCLASS_NOT(xc)) + || (IS_NULL(yc->mbuf) && !IS_NCCLASS_NOT(yc))) + return 1; + return 0; + } + break; + + case NT_STR: + goto swap; + break; + + default: + break; + } + } + break; + + case NT_STR: { + StrNode *xs = NSTR(x); + if (NSTRING_LEN(x) == 0) + break; + + switch (ytype) + { + case NT_CTYPE: + switch (NCTYPE(y)->ctype) + { + case ONIGENC_CTYPE_WORD: + if (NCTYPE(y)->ascii_range) + { + if (ONIGENC_IS_MBC_ASCII_WORD(reg->enc, xs->s, xs->end)) + return NCTYPE(y)->not; + else + return !(NCTYPE(y)->not); + } + else + { + if (ONIGENC_IS_MBC_WORD(reg->enc, xs->s, xs->end)) + return NCTYPE(y)->not; + else + return !(NCTYPE(y)->not); + } + break; + default: + break; + } + break; + + case NT_CCLASS: { + CClassNode *cc = NCCLASS(y); + + code = ONIGENC_MBC_TO_CODE(reg->enc, xs->s, + xs->s + ONIGENC_MBC_MAXLEN(reg->enc)); + return (onig_is_code_in_cc(reg->enc, code, cc) != 0 ? 0 : 1); + } + break; + + case NT_STR: { + UChar *q; + StrNode *ys = NSTR(y); + len = NSTRING_LEN(x); + if (len > NSTRING_LEN(y)) + len = NSTRING_LEN(y); + if (NSTRING_IS_AMBIG(x) || NSTRING_IS_AMBIG(y)) + { + /* tiny version */ + return 0; + } + else + { + for (i = 0, p = ys->s, q = xs->s; (OnigDistance)i < len; + i++, p++, q++) + { + if (*p != *q) + return 1; + } + } + } + break; + + default: + break; + } + } + break; + + default: + break; + } + + return 0; +} + +static Node *get_head_value_node(Node *node, int exact, regex_t *reg) +{ + Node *n = NULL_NODE; + + switch (NTYPE(node)) + { + case NT_BREF: + case NT_ALT: + case NT_CANY: +#ifdef USE_SUBEXP_CALL + case NT_CALL: +#endif + break; + + case NT_CTYPE: + case NT_CCLASS: + if (exact == 0) + { + n = node; + } + break; + + case NT_LIST: + n = get_head_value_node(NCAR(node), exact, reg); + break; + + case NT_STR: { + StrNode *sn = NSTR(node); + + if (sn->end <= sn->s) + break; + + if (exact != 0 && !NSTRING_IS_RAW(node) && IS_IGNORECASE(reg->options)) + { + } + else + { + n = node; + } + } + break; + + case NT_QTFR: { + QtfrNode *qn = NQTFR(node); + if (qn->lower > 0) + { +#ifdef USE_OP_PUSH_OR_JUMP_EXACT + if (IS_NOT_NULL(qn->head_exact)) + n = qn->head_exact; + else +#endif + n = get_head_value_node(qn->target, exact, reg); + } + } + break; + + case NT_ENCLOSE: { + EncloseNode *en = NENCLOSE(node); + switch (en->type) + { + case ENCLOSE_OPTION: { + OnigOptionType options = reg->options; + + reg->options = NENCLOSE(node)->option; + n = get_head_value_node(NENCLOSE(node)->target, exact, reg); + reg->options = options; + } + break; + + case ENCLOSE_MEMORY: + case ENCLOSE_STOP_BACKTRACK: + case ENCLOSE_CONDITION: + n = get_head_value_node(en->target, exact, reg); + break; + + case ENCLOSE_ABSENT: + break; + } + } + break; + + case NT_ANCHOR: + if (NANCHOR(node)->type == ANCHOR_PREC_READ) + n = get_head_value_node(NANCHOR(node)->target, exact, reg); + break; + + default: + break; + } + + return n; +} + +static int check_type_tree(Node *node, int type_mask, int enclose_mask, + int anchor_mask) +{ + int type, r = 0; + + type = NTYPE(node); + if ((NTYPE2BIT(type) & type_mask) == 0) + return 1; + + switch (type) + { + case NT_LIST: + case NT_ALT: + do + { + r = check_type_tree(NCAR(node), type_mask, enclose_mask, anchor_mask); + } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); + break; + + case NT_QTFR: + r = check_type_tree(NQTFR(node)->target, type_mask, enclose_mask, + anchor_mask); + break; + + case NT_ENCLOSE: { + EncloseNode *en = NENCLOSE(node); + if ((en->type & enclose_mask) == 0) + return 1; + + r = check_type_tree(en->target, type_mask, enclose_mask, anchor_mask); + } + break; + + case NT_ANCHOR: + type = NANCHOR(node)->type; + if ((type & anchor_mask) == 0) + return 1; + + if (NANCHOR(node)->target) + r = check_type_tree(NANCHOR(node)->target, type_mask, enclose_mask, + anchor_mask); + break; + + default: + break; + } + return r; +} + +#ifdef USE_SUBEXP_CALL + +# define RECURSION_EXIST 1 +# define RECURSION_INFINITE 2 + +static int subexp_inf_recursive_check(Node *node, ScanEnv *env, int head) +{ + int type; + int r = 0; + + type = NTYPE(node); + switch (type) + { + case NT_LIST: { + Node *x; + OnigDistance min; + int ret; + + x = node; + do + { + ret = subexp_inf_recursive_check(NCAR(x), env, head); + if (ret < 0 || ret == RECURSION_INFINITE) + return ret; + r |= ret; + if (head) + { + ret = get_min_match_length(NCAR(x), &min, env); + if (ret != 0) + return ret; + if (min != 0) + head = 0; + } + } while (IS_NOT_NULL(x = NCDR(x))); + } + break; + + case NT_ALT: { + int ret; + r = RECURSION_EXIST; + do + { + ret = subexp_inf_recursive_check(NCAR(node), env, head); + if (ret < 0 || ret == RECURSION_INFINITE) + return ret; + r &= ret; + } while (IS_NOT_NULL(node = NCDR(node))); + } + break; + + case NT_QTFR: + r = subexp_inf_recursive_check(NQTFR(node)->target, env, head); + if (r == RECURSION_EXIST) + { + if (NQTFR(node)->lower == 0) + r = 0; + } + break; + + case NT_ANCHOR: { + AnchorNode *an = NANCHOR(node); + switch (an->type) + { + case ANCHOR_PREC_READ: + case ANCHOR_PREC_READ_NOT: + case ANCHOR_LOOK_BEHIND: + case ANCHOR_LOOK_BEHIND_NOT: + r = subexp_inf_recursive_check(an->target, env, head); + break; + } + } + break; + + case NT_CALL: + r = subexp_inf_recursive_check(NCALL(node)->target, env, head); + break; + + case NT_ENCLOSE: + if (IS_ENCLOSE_MARK2(NENCLOSE(node))) + return 0; + else if (IS_ENCLOSE_MARK1(NENCLOSE(node))) + return (head == 0 ? RECURSION_EXIST : RECURSION_INFINITE); + else + { + SET_ENCLOSE_STATUS(node, NST_MARK2); + r = subexp_inf_recursive_check(NENCLOSE(node)->target, env, head); + CLEAR_ENCLOSE_STATUS(node, NST_MARK2); + } + break; + + default: + break; + } + + return r; +} + +static int subexp_inf_recursive_check_trav(Node *node, ScanEnv *env) +{ + int type; + int r = 0; + + type = NTYPE(node); + switch (type) + { + case NT_LIST: + case NT_ALT: + do + { + r = subexp_inf_recursive_check_trav(NCAR(node), env); + } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); + break; + + case NT_QTFR: + r = subexp_inf_recursive_check_trav(NQTFR(node)->target, env); + break; + + case NT_ANCHOR: { + AnchorNode *an = NANCHOR(node); + switch (an->type) + { + case ANCHOR_PREC_READ: + case ANCHOR_PREC_READ_NOT: + case ANCHOR_LOOK_BEHIND: + case ANCHOR_LOOK_BEHIND_NOT: + r = subexp_inf_recursive_check_trav(an->target, env); + break; + } + } + break; + + case NT_ENCLOSE: { + EncloseNode *en = NENCLOSE(node); + + if (IS_ENCLOSE_RECURSION(en)) + { + SET_ENCLOSE_STATUS(node, NST_MARK1); + r = subexp_inf_recursive_check(en->target, env, 1); + if (r > 0) + return ONIGERR_NEVER_ENDING_RECURSION; + CLEAR_ENCLOSE_STATUS(node, NST_MARK1); + } + r = subexp_inf_recursive_check_trav(en->target, env); + } + + break; + + default: + break; + } + + return r; +} + +static int subexp_recursive_check(Node *node) +{ + int r = 0; + + switch (NTYPE(node)) + { + case NT_LIST: + case NT_ALT: + do + { + r |= subexp_recursive_check(NCAR(node)); + } while (IS_NOT_NULL(node = NCDR(node))); + break; + + case NT_QTFR: + r = subexp_recursive_check(NQTFR(node)->target); + break; + + case NT_ANCHOR: { + AnchorNode *an = NANCHOR(node); + switch (an->type) + { + case ANCHOR_PREC_READ: + case ANCHOR_PREC_READ_NOT: + case ANCHOR_LOOK_BEHIND: + case ANCHOR_LOOK_BEHIND_NOT: + r = subexp_recursive_check(an->target); + break; + } + } + break; + + case NT_CALL: + r = subexp_recursive_check(NCALL(node)->target); + if (r != 0) + SET_CALL_RECURSION(node); + break; + + case NT_ENCLOSE: + if (IS_ENCLOSE_MARK2(NENCLOSE(node))) + return 0; + else if (IS_ENCLOSE_MARK1(NENCLOSE(node))) + return 1; /* recursion */ + else + { + SET_ENCLOSE_STATUS(node, NST_MARK2); + r = subexp_recursive_check(NENCLOSE(node)->target); + CLEAR_ENCLOSE_STATUS(node, NST_MARK2); + } + break; + + default: + break; + } + + return r; +} + +static int subexp_recursive_check_trav(Node *node, ScanEnv *env) +{ +# define FOUND_CALLED_NODE 1 + + int type; + int r = 0; + + type = NTYPE(node); + switch (type) + { + case NT_LIST: + case NT_ALT: { + int ret; + do + { + ret = subexp_recursive_check_trav(NCAR(node), env); + if (ret == FOUND_CALLED_NODE) + r = FOUND_CALLED_NODE; + else if (ret < 0) + return ret; + } while (IS_NOT_NULL(node = NCDR(node))); + } + break; + + case NT_QTFR: + r = subexp_recursive_check_trav(NQTFR(node)->target, env); + if (NQTFR(node)->upper == 0) + { + if (r == FOUND_CALLED_NODE) + NQTFR(node)->is_refered = 1; + } + break; + + case NT_ANCHOR: { + AnchorNode *an = NANCHOR(node); + switch (an->type) + { + case ANCHOR_PREC_READ: + case ANCHOR_PREC_READ_NOT: + case ANCHOR_LOOK_BEHIND: + case ANCHOR_LOOK_BEHIND_NOT: + r = subexp_recursive_check_trav(an->target, env); + break; + } + } + break; + + case NT_ENCLOSE: { + EncloseNode *en = NENCLOSE(node); + + if (!IS_ENCLOSE_RECURSION(en)) + { + if (IS_ENCLOSE_CALLED(en)) + { + SET_ENCLOSE_STATUS(node, NST_MARK1); + r = subexp_recursive_check(en->target); + if (r != 0) + SET_ENCLOSE_STATUS(node, NST_RECURSION); + CLEAR_ENCLOSE_STATUS(node, NST_MARK1); + } + } + r = subexp_recursive_check_trav(en->target, env); + if (IS_ENCLOSE_CALLED(en)) + r |= FOUND_CALLED_NODE; + } + break; + + default: + break; + } + + return r; +} + +static int setup_subexp_call(Node *node, ScanEnv *env) +{ + int type; + int r = 0; + + type = NTYPE(node); + switch (type) + { + case NT_LIST: + do + { + r = setup_subexp_call(NCAR(node), env); + } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); + break; + + case NT_ALT: + do + { + r = setup_subexp_call(NCAR(node), env); + } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); + break; + + case NT_QTFR: + r = setup_subexp_call(NQTFR(node)->target, env); + break; + case NT_ENCLOSE: + r = setup_subexp_call(NENCLOSE(node)->target, env); + break; + + case NT_CALL: { + CallNode *cn = NCALL(node); + Node **nodes = SCANENV_MEM_NODES(env); + + if (cn->group_num != 0) + { + int gnum = cn->group_num; + +# ifdef USE_NAMED_GROUP + if (env->num_named > 0 + && IS_SYNTAX_BV(env->syntax, ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP) + && !ONIG_IS_OPTION_ON(env->option, ONIG_OPTION_CAPTURE_GROUP)) + { + return ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED; + } +# endif + if (gnum > env->num_mem) + { + onig_scan_env_set_error_string(env, ONIGERR_UNDEFINED_GROUP_REFERENCE, + cn->name, cn->name_end); + return ONIGERR_UNDEFINED_GROUP_REFERENCE; + } + +# ifdef USE_NAMED_GROUP + set_call_attr: +# endif + cn->target = nodes[cn->group_num]; + if (IS_NULL(cn->target)) + { + onig_scan_env_set_error_string(env, ONIGERR_UNDEFINED_NAME_REFERENCE, + cn->name, cn->name_end); + return ONIGERR_UNDEFINED_NAME_REFERENCE; + } + SET_ENCLOSE_STATUS(cn->target, NST_CALLED); + BIT_STATUS_ON_AT(env->bt_mem_start, cn->group_num); + cn->unset_addr_list = env->unset_addr_list; + } +# ifdef USE_NAMED_GROUP +# ifdef USE_PERL_SUBEXP_CALL + else if (cn->name == cn->name_end) + { + goto set_call_attr; + } +# endif + else + { + int *refs; + + int n = onig_name_to_group_numbers(env->reg, cn->name, cn->name_end, + &refs); + if (n <= 0) + { + onig_scan_env_set_error_string(env, ONIGERR_UNDEFINED_NAME_REFERENCE, + cn->name, cn->name_end); + return ONIGERR_UNDEFINED_NAME_REFERENCE; + } + else if (n > 1 + && !IS_SYNTAX_BV( + env->syntax, + ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME_CALL)) + { + onig_scan_env_set_error_string(env, + ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL, + cn->name, cn->name_end); + return ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL; + } + else + { + cn->group_num = refs[0]; + goto set_call_attr; + } + } +# endif + } + break; + + case NT_ANCHOR: { + AnchorNode *an = NANCHOR(node); + + switch (an->type) + { + case ANCHOR_PREC_READ: + case ANCHOR_PREC_READ_NOT: + case ANCHOR_LOOK_BEHIND: + case ANCHOR_LOOK_BEHIND_NOT: + r = setup_subexp_call(an->target, env); + break; + } + } + break; + + default: + break; + } + + return r; +} +#endif + +/* divide different length alternatives in look-behind. + (?<=A|B) ==> (?<=A)|(?<=B) + (?<!A|B) ==> (?<!A)(?<!B) +*/ +static int divide_look_behind_alternatives(Node *node) +{ + Node *head, *np, *insert_node; + AnchorNode *an = NANCHOR(node); + int anc_type = an->type; + + head = an->target; + np = NCAR(head); + swap_node(node, head); + NCAR(node) = head; + NANCHOR(head)->target = np; + + np = node; + while ((np = NCDR(np)) != NULL_NODE) + { + insert_node = onig_node_new_anchor(anc_type); + CHECK_NULL_RETURN_MEMERR(insert_node); + NANCHOR(insert_node)->target = NCAR(np); + NCAR(np) = insert_node; + } + + if (anc_type == ANCHOR_LOOK_BEHIND_NOT) + { + np = node; + do + { + SET_NTYPE(np, NT_LIST); /* alt -> list */ + } while ((np = NCDR(np)) != NULL_NODE); + } + return 0; +} + +static int setup_look_behind(Node *node, regex_t *reg, ScanEnv *env) +{ + int r, len; + AnchorNode *an = NANCHOR(node); + + r = get_char_length_tree(an->target, reg, &len); + if (r == 0) + an->char_len = len; + else if (r == GET_CHAR_LEN_VARLEN) + r = ONIGERR_INVALID_LOOK_BEHIND_PATTERN; + else if (r == GET_CHAR_LEN_TOP_ALT_VARLEN) + { + if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND)) + r = divide_look_behind_alternatives(node); + else + r = ONIGERR_INVALID_LOOK_BEHIND_PATTERN; + } + + return r; +} + +static int next_setup(Node *node, Node *next_node, regex_t *reg) +{ + int type; + +retry: + type = NTYPE(node); + if (type == NT_QTFR) + { + QtfrNode *qn = NQTFR(node); + if (qn->greedy && IS_REPEAT_INFINITE(qn->upper)) + { +#ifdef USE_QTFR_PEEK_NEXT + Node *n = get_head_value_node(next_node, 1, reg); + /* '\0': for UTF-16BE etc... */ + if (IS_NOT_NULL(n) && NSTR(n)->s[0] != '\0') + { + qn->next_head_exact = n; + } +#endif + /* automatic possessification a*b ==> (?>a*)b */ + if (qn->lower <= 1) + { + int ttype = NTYPE(qn->target); + if (IS_NODE_TYPE_SIMPLE(ttype)) + { + Node *x, *y; + x = get_head_value_node(qn->target, 0, reg); + if (IS_NOT_NULL(x)) + { + y = get_head_value_node(next_node, 0, reg); + if (IS_NOT_NULL(y) && is_not_included(x, y, reg)) + { + Node *en = onig_node_new_enclose(ENCLOSE_STOP_BACKTRACK); + CHECK_NULL_RETURN_MEMERR(en); + SET_ENCLOSE_STATUS(en, NST_STOP_BT_SIMPLE_REPEAT); + swap_node(node, en); + NENCLOSE(node)->target = en; + } + } + } + } + } + } + else if (type == NT_ENCLOSE) + { + EncloseNode *en = NENCLOSE(node); + if (en->type == ENCLOSE_MEMORY) + { + node = en->target; + goto retry; + } + } + return 0; +} + +static int update_string_node_case_fold(regex_t *reg, Node *node) +{ + UChar *p, *end, buf[ONIGENC_MBC_CASE_FOLD_MAXLEN]; + UChar *sbuf, *ebuf, *sp; + int r, i, len; + OnigDistance sbuf_size; + StrNode *sn = NSTR(node); + + end = sn->end; + sbuf_size = (end - sn->s) * 2; + sbuf = (UChar *)xmalloc(sbuf_size); + CHECK_NULL_RETURN_MEMERR(sbuf); + ebuf = sbuf + sbuf_size; + + sp = sbuf; + p = sn->s; + while (p < end) + { + len = ONIGENC_MBC_CASE_FOLD(reg->enc, reg->case_fold_flag, &p, end, buf); + for (i = 0; i < len; i++) + { + if (sp >= ebuf) + { + UChar *p = (UChar *)xrealloc(sbuf, sbuf_size * 2); + if (IS_NULL(p)) + { + xfree(sbuf); + return ONIGERR_MEMORY; + } + sbuf = p; + sp = sbuf + sbuf_size; + sbuf_size *= 2; + ebuf = sbuf + sbuf_size; + } + + *sp++ = buf[i]; + } + } + + r = onig_node_str_set(node, sbuf, sp); + + xfree(sbuf); + return r; +} + +static int expand_case_fold_make_rem_string(Node **rnode, UChar *s, UChar *end, + regex_t *reg) +{ + int r; + Node *node; + + node = onig_node_new_str(s, end); + if (IS_NULL(node)) + return ONIGERR_MEMORY; + + r = update_string_node_case_fold(reg, node); + if (r != 0) + { + onig_node_free(node); + return r; + } + + NSTRING_SET_AMBIG(node); + NSTRING_SET_DONT_GET_OPT_INFO(node); + *rnode = node; + return 0; +} + +static int is_case_fold_variable_len(int item_num, OnigCaseFoldCodeItem items[], + int slen) +{ + int i; + + for (i = 0; i < item_num; i++) + { + if (items[i].byte_len != slen) + { + return 1; + } + if (items[i].code_len != 1) + { + return 1; + } + } + return 0; +} + +static int expand_case_fold_string_alt(int item_num, + OnigCaseFoldCodeItem items[], UChar *p, + int slen, UChar *end, regex_t *reg, + Node **rnode) +{ + int r, i, j, len, varlen; + Node *anode, *var_anode, *snode, *xnode, *an; + UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN]; + + *rnode = var_anode = NULL_NODE; + + varlen = 0; + for (i = 0; i < item_num; i++) + { + if (items[i].byte_len != slen) + { + varlen = 1; + break; + } + } + + if (varlen != 0) + { + *rnode = var_anode = onig_node_new_alt(NULL_NODE, NULL_NODE); + if (IS_NULL(var_anode)) + return ONIGERR_MEMORY; + + xnode = onig_node_new_list(NULL, NULL); + if (IS_NULL(xnode)) + goto mem_err; + NCAR(var_anode) = xnode; + + anode = onig_node_new_alt(NULL_NODE, NULL_NODE); + if (IS_NULL(anode)) + goto mem_err; + NCAR(xnode) = anode; + } + else + { + *rnode = anode = onig_node_new_alt(NULL_NODE, NULL_NODE); + if (IS_NULL(anode)) + return ONIGERR_MEMORY; + } + + snode = onig_node_new_str(p, p + slen); + if (IS_NULL(snode)) + goto mem_err; + + NCAR(anode) = snode; + + for (i = 0; i < item_num; i++) + { + snode = onig_node_new_str(NULL, NULL); + if (IS_NULL(snode)) + goto mem_err; + + for (j = 0; j < items[i].code_len; j++) + { + len = ONIGENC_CODE_TO_MBC(reg->enc, items[i].code[j], buf); + if (len < 0) + { + r = len; + goto mem_err2; + } + + r = onig_node_str_cat(snode, buf, buf + len); + if (r != 0) + goto mem_err2; + } + + an = onig_node_new_alt(NULL_NODE, NULL_NODE); + if (IS_NULL(an)) + { + goto mem_err2; + } + + if (items[i].byte_len != slen) + { + Node *rem; + UChar *q = p + items[i].byte_len; + + if (q < end) + { + r = expand_case_fold_make_rem_string(&rem, q, end, reg); + if (r != 0) + { + onig_node_free(an); + goto mem_err2; + } + + xnode = onig_node_list_add(NULL_NODE, snode); + if (IS_NULL(xnode)) + { + onig_node_free(an); + onig_node_free(rem); + goto mem_err2; + } + if (IS_NULL(onig_node_list_add(xnode, rem))) + { + onig_node_free(an); + onig_node_free(xnode); + onig_node_free(rem); + goto mem_err; + } + + NCAR(an) = xnode; + } + else + { + NCAR(an) = snode; + } + + NCDR(var_anode) = an; + var_anode = an; + } + else + { + NCAR(an) = snode; + NCDR(anode) = an; + anode = an; + } + } + + return varlen; + +mem_err2: + onig_node_free(snode); + +mem_err: + onig_node_free(*rnode); + + return ONIGERR_MEMORY; +} + +static int expand_case_fold_string(Node *node, regex_t *reg) +{ +#define THRESHOLD_CASE_FOLD_ALT_FOR_EXPANSION 8 + + int r, n, len, alt_num; + int varlen = 0; + UChar *start, *end, *p; + Node *top_root, *root, *snode, *prev_node; + OnigCaseFoldCodeItem items[ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM]; + StrNode *sn = NSTR(node); + + if (NSTRING_IS_AMBIG(node)) + return 0; + + start = sn->s; + end = sn->end; + if (start >= end) + return 0; + + r = 0; + top_root = root = prev_node = snode = NULL_NODE; + alt_num = 1; + p = start; + while (p < end) + { + n = ONIGENC_GET_CASE_FOLD_CODES_BY_STR(reg->enc, reg->case_fold_flag, p, + end, items); + if (n < 0) + { + r = n; + goto err; + } + + len = enclen(reg->enc, p, end); + + varlen = is_case_fold_variable_len(n, items, len); + if (n == 0 || varlen == 0) + { + if (IS_NULL(snode)) + { + if (IS_NULL(root) && IS_NOT_NULL(prev_node)) + { + top_root = root = onig_node_list_add(NULL_NODE, prev_node); + if (IS_NULL(root)) + { + onig_node_free(prev_node); + goto mem_err; + } + } + + prev_node = snode = onig_node_new_str(NULL, NULL); + if (IS_NULL(snode)) + goto mem_err; + if (IS_NOT_NULL(root)) + { + if (IS_NULL(onig_node_list_add(root, snode))) + { + onig_node_free(snode); + goto mem_err; + } + } + } + + r = onig_node_str_cat(snode, p, p + len); + if (r != 0) + goto err; + } + else + { + alt_num *= (n + 1); + if (alt_num > THRESHOLD_CASE_FOLD_ALT_FOR_EXPANSION) + break; + + if (IS_NOT_NULL(snode)) + { + r = update_string_node_case_fold(reg, snode); + if (r == 0) + { + NSTRING_SET_AMBIG(snode); + } + } + if (IS_NULL(root) && IS_NOT_NULL(prev_node)) + { + top_root = root = onig_node_list_add(NULL_NODE, prev_node); + if (IS_NULL(root)) + { + onig_node_free(prev_node); + goto mem_err; + } + } + + r = expand_case_fold_string_alt(n, items, p, len, end, reg, &prev_node); + if (r < 0) + goto mem_err; + if (r == 1) + { + if (IS_NULL(root)) + { + top_root = prev_node; + } + else + { + if (IS_NULL(onig_node_list_add(root, prev_node))) + { + onig_node_free(prev_node); + goto mem_err; + } + } + + root = NCAR(prev_node); + } + else + { /* r == 0 */ + if (IS_NOT_NULL(root)) + { + if (IS_NULL(onig_node_list_add(root, prev_node))) + { + onig_node_free(prev_node); + goto mem_err; + } + } + } + + snode = NULL_NODE; + } + + p += len; + } + if (IS_NOT_NULL(snode)) + { + r = update_string_node_case_fold(reg, snode); + if (r == 0) + { + NSTRING_SET_AMBIG(snode); + } + } + + if (p < end) + { + Node *srem; + + r = expand_case_fold_make_rem_string(&srem, p, end, reg); + if (r != 0) + goto mem_err; + + if (IS_NOT_NULL(prev_node) && IS_NULL(root)) + { + top_root = root = onig_node_list_add(NULL_NODE, prev_node); + if (IS_NULL(root)) + { + onig_node_free(srem); + onig_node_free(prev_node); + goto mem_err; + } + } + + if (IS_NULL(root)) + { + prev_node = srem; + } + else + { + if (IS_NULL(onig_node_list_add(root, srem))) + { + onig_node_free(srem); + goto mem_err; + } + } + } + + /* ending */ + top_root = (IS_NOT_NULL(top_root) ? top_root : prev_node); + swap_node(node, top_root); + onig_node_free(top_root); + return 0; + +mem_err: + r = ONIGERR_MEMORY; + +err: + onig_node_free(top_root); + return r; +} + +#ifdef USE_COMBINATION_EXPLOSION_CHECK + +# define CEC_THRES_NUM_BIG_REPEAT 512 +# define CEC_INFINITE_NUM 0x7fffffff + +# define CEC_IN_INFINITE_REPEAT (1 << 0) +# define CEC_IN_FINITE_REPEAT (1 << 1) +# define CEC_CONT_BIG_REPEAT (1 << 2) + +static int setup_comb_exp_check(Node *node, int state, ScanEnv *env) +{ + int type; + int r = state; + + type = NTYPE(node); + switch (type) + { + case NT_LIST: { + Node *prev = NULL_NODE; + do + { + r = setup_comb_exp_check(NCAR(node), r, env); + prev = NCAR(node); + } while (r >= 0 && IS_NOT_NULL(node = NCDR(node))); + } + break; + + case NT_ALT: { + int ret; + do + { + ret = setup_comb_exp_check(NCAR(node), state, env); + r |= ret; + } while (ret >= 0 && IS_NOT_NULL(node = NCDR(node))); + } + break; + + case NT_QTFR: { + int child_state = state; + int add_state = 0; + QtfrNode *qn = NQTFR(node); + Node *target = qn->target; + int var_num; + + if (!IS_REPEAT_INFINITE(qn->upper)) + { + if (qn->upper > 1) + { + /* {0,1}, {1,1} are allowed */ + child_state |= CEC_IN_FINITE_REPEAT; + + /* check (a*){n,m}, (a+){n,m} => (a*){n,n}, (a+){n,n} */ + if (env->backrefed_mem == 0) + { + if (NTYPE(qn->target) == NT_ENCLOSE) + { + EncloseNode *en = NENCLOSE(qn->target); + if (en->type == ENCLOSE_MEMORY) + { + if (NTYPE(en->target) == NT_QTFR) + { + QtfrNode *q = NQTFR(en->target); + if (IS_REPEAT_INFINITE(q->upper) && q->greedy == qn->greedy) + { + qn->upper = (qn->lower == 0 ? 1 : qn->lower); + if (qn->upper == 1) + child_state = state; + } + } + } + } + } + } + } + + if (state & CEC_IN_FINITE_REPEAT) + { + qn->comb_exp_check_num = -1; + } + else + { + if (IS_REPEAT_INFINITE(qn->upper)) + { + var_num = CEC_INFINITE_NUM; + child_state |= CEC_IN_INFINITE_REPEAT; + } + else + { + var_num = qn->upper - qn->lower; + } + + if (var_num >= CEC_THRES_NUM_BIG_REPEAT) + add_state |= CEC_CONT_BIG_REPEAT; + + if (((state & CEC_IN_INFINITE_REPEAT) != 0 && var_num != 0) + || ((state & CEC_CONT_BIG_REPEAT) != 0 + && var_num >= CEC_THRES_NUM_BIG_REPEAT)) + { + if (qn->comb_exp_check_num == 0) + { + env->num_comb_exp_check++; + qn->comb_exp_check_num = env->num_comb_exp_check; + if (env->curr_max_regnum > env->comb_exp_max_regnum) + env->comb_exp_max_regnum = env->curr_max_regnum; + } + } + } + + r = setup_comb_exp_check(target, child_state, env); + r |= add_state; + } + break; + + case NT_ENCLOSE: { + EncloseNode *en = NENCLOSE(node); + + switch (en->type) + { + case ENCLOSE_MEMORY: { + if (env->curr_max_regnum < en->regnum) + env->curr_max_regnum = en->regnum; + + r = setup_comb_exp_check(en->target, state, env); + } + break; + + default: + r = setup_comb_exp_check(en->target, state, env); + break; + } + } + break; + +# ifdef USE_SUBEXP_CALL + case NT_CALL: + if (IS_CALL_RECURSION(NCALL(node))) + env->has_recursion = 1; + else + r = setup_comb_exp_check(NCALL(node)->target, state, env); + break; +# endif + + default: + break; + } + + return r; +} +#endif + +#define IN_ALT (1 << 0) +#define IN_NOT (1 << 1) +#define IN_REPEAT (1 << 2) +#define IN_VAR_REPEAT (1 << 3) +#define IN_CALL (1 << 4) +#define IN_RECCALL (1 << 5) + +/* setup_tree does the following work. + 1. check empty loop. (set qn->target_empty_info) + 2. expand ignore-case in char class. + 3. set memory status bit flags. (reg->mem_stats) + 4. set qn->head_exact for [push, exact] -> [push_or_jump_exact1, exact]. + 5. find invalid patterns in look-behind. + 6. expand repeated string. + */ +static int setup_tree(Node *node, regex_t *reg, int state, ScanEnv *env) +{ + int type; + int r = 0; + +restart: + type = NTYPE(node); + switch (type) + { + case NT_LIST: { + Node *prev = NULL_NODE; + do + { + r = setup_tree(NCAR(node), reg, state, env); + if (IS_NOT_NULL(prev) && r == 0) + { + r = next_setup(prev, NCAR(node), reg); + } + prev = NCAR(node); + } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); + } + break; + + case NT_ALT: + do + { + r = setup_tree(NCAR(node), reg, (state | IN_ALT), env); + } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); + break; + + case NT_CCLASS: + break; + + case NT_STR: + if (IS_IGNORECASE(reg->options) && !NSTRING_IS_RAW(node)) + { + r = expand_case_fold_string(node, reg); + } + break; + + case NT_CTYPE: + case NT_CANY: + break; + +#ifdef USE_SUBEXP_CALL + case NT_CALL: + break; +#endif + + case NT_BREF: { + int i; + int *p; + Node **nodes = SCANENV_MEM_NODES(env); + BRefNode *br = NBREF(node); + p = BACKREFS_P(br); + for (i = 0; i < br->back_num; i++) + { + if (p[i] > env->num_mem) + return ONIGERR_INVALID_BACKREF; + BIT_STATUS_ON_AT(env->backrefed_mem, p[i]); + BIT_STATUS_ON_AT(env->bt_mem_start, p[i]); +#ifdef USE_BACKREF_WITH_LEVEL + if (IS_BACKREF_NEST_LEVEL(br)) + { + BIT_STATUS_ON_AT(env->bt_mem_end, p[i]); + } +#endif + SET_ENCLOSE_STATUS(nodes[p[i]], NST_MEM_BACKREFED); + } + } + break; + + case NT_QTFR: { + OnigDistance d; + QtfrNode *qn = NQTFR(node); + Node *target = qn->target; + + if ((state & IN_REPEAT) != 0) + { + qn->state |= NST_IN_REPEAT; + } + + if (IS_REPEAT_INFINITE(qn->upper) || qn->upper >= 1) + { + r = get_min_match_length(target, &d, env); + if (r) + break; + if (d == 0) + { + qn->target_empty_info = NQ_TARGET_IS_EMPTY; +#ifdef USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT + r = quantifiers_memory_node_info(target); + if (r < 0) + break; + if (r > 0) + { + qn->target_empty_info = r; + } +#endif +#if 0 + r = get_max_match_length(target, &d, env); + if (r == 0 && d == 0) { + /* ()* ==> ()?, ()+ ==> () */ + qn->upper = 1; + if (qn->lower > 1) qn->lower = 1; + if (NTYPE(target) == NT_STR) { + qn->upper = qn->lower = 0; /* /(?:)+/ ==> // */ + } + } +#endif + } + } + + state |= IN_REPEAT; + if (qn->lower != qn->upper) + state |= IN_VAR_REPEAT; + r = setup_tree(target, reg, state, env); + if (r) + break; + + /* expand string */ +#define EXPAND_STRING_MAX_LENGTH 100 + if (NTYPE(target) == NT_STR) + { + if (qn->lower > 1) + { + int i, n = qn->lower; + OnigDistance len = NSTRING_LEN(target); + StrNode *sn = NSTR(target); + Node *np; + + np = onig_node_new_str(sn->s, sn->end); + if (IS_NULL(np)) + return ONIGERR_MEMORY; + NSTR(np)->flag = sn->flag; + + for (i = 1; i < n && (i + 1) * len <= EXPAND_STRING_MAX_LENGTH; i++) + { + r = onig_node_str_cat(np, sn->s, sn->end); + if (r) + { + onig_node_free(np); + return r; + } + } + if (i < qn->upper || IS_REPEAT_INFINITE(qn->upper)) + { + Node *np1, *np2; + + qn->lower -= i; + if (!IS_REPEAT_INFINITE(qn->upper)) + qn->upper -= i; + + np1 = onig_node_new_list(np, NULL); + if (IS_NULL(np1)) + { + onig_node_free(np); + return ONIGERR_MEMORY; + } + swap_node(np1, node); + np2 = onig_node_list_add(node, np1); + if (IS_NULL(np2)) + { + onig_node_free(np1); + return ONIGERR_MEMORY; + } + } + else + { + swap_node(np, node); + onig_node_free(np); + } + break; /* break case NT_QTFR: */ + } + } + +#ifdef USE_OP_PUSH_OR_JUMP_EXACT + if (qn->greedy && (qn->target_empty_info != 0)) + { + if (NTYPE(target) == NT_QTFR) + { + QtfrNode *tqn = NQTFR(target); + if (IS_NOT_NULL(tqn->head_exact)) + { + qn->head_exact = tqn->head_exact; + tqn->head_exact = NULL; + } + } + else + { + qn->head_exact = get_head_value_node(qn->target, 1, reg); + } + } +#endif + } + break; + + case NT_ENCLOSE: { + EncloseNode *en = NENCLOSE(node); + + switch (en->type) + { + case ENCLOSE_OPTION: { + OnigOptionType options = reg->options; + reg->options = NENCLOSE(node)->option; + r = setup_tree(NENCLOSE(node)->target, reg, state, env); + reg->options = options; + } + break; + + case ENCLOSE_MEMORY: + if ((state & (IN_ALT | IN_NOT | IN_VAR_REPEAT | IN_CALL)) != 0) + { + BIT_STATUS_ON_AT(env->bt_mem_start, en->regnum); + /* SET_ENCLOSE_STATUS(node, NST_MEM_IN_ALT_NOT); */ + } + if (IS_ENCLOSE_CALLED(en)) + state |= IN_CALL; + if (IS_ENCLOSE_RECURSION(en)) + state |= IN_RECCALL; + else if ((state & IN_RECCALL) != 0) + SET_CALL_RECURSION(node); + r = setup_tree(en->target, reg, state, env); + break; + + case ENCLOSE_STOP_BACKTRACK: { + Node *target = en->target; + r = setup_tree(target, reg, state, env); + if (NTYPE(target) == NT_QTFR) + { + QtfrNode *tqn = NQTFR(target); + if (IS_REPEAT_INFINITE(tqn->upper) && tqn->lower <= 1 + && tqn->greedy != 0) + { /* (?>a*), a*+ etc... */ + int qtype = NTYPE(tqn->target); + if (IS_NODE_TYPE_SIMPLE(qtype)) + SET_ENCLOSE_STATUS(node, NST_STOP_BT_SIMPLE_REPEAT); + } + } + } + break; + + case ENCLOSE_CONDITION: +#ifdef USE_NAMED_GROUP + if (!IS_ENCLOSE_NAME_REF(NENCLOSE(node)) && env->num_named > 0 + && IS_SYNTAX_BV(env->syntax, ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP) + && !ONIG_IS_OPTION_ON(env->option, ONIG_OPTION_CAPTURE_GROUP)) + { + return ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED; + } +#endif + if (NENCLOSE(node)->regnum > env->num_mem) + return ONIGERR_INVALID_BACKREF; + r = setup_tree(NENCLOSE(node)->target, reg, state, env); + break; + + case ENCLOSE_ABSENT: + r = setup_tree(NENCLOSE(node)->target, reg, state, env); + break; + } + } + break; + + case NT_ANCHOR: { + AnchorNode *an = NANCHOR(node); + + switch (an->type) + { + case ANCHOR_PREC_READ: + r = setup_tree(an->target, reg, state, env); + break; + case ANCHOR_PREC_READ_NOT: + r = setup_tree(an->target, reg, (state | IN_NOT), env); + break; + +/* allowed node types in look-behind */ +#define ALLOWED_TYPE_IN_LB \ + (BIT_NT_LIST | BIT_NT_ALT | BIT_NT_STR | BIT_NT_CCLASS | BIT_NT_CTYPE \ + | BIT_NT_CANY | BIT_NT_ANCHOR | BIT_NT_ENCLOSE | BIT_NT_QTFR | BIT_NT_CALL) + +#define ALLOWED_ENCLOSE_IN_LB (ENCLOSE_MEMORY | ENCLOSE_OPTION) +#define ALLOWED_ENCLOSE_IN_LB_NOT ENCLOSE_OPTION + +#define ALLOWED_ANCHOR_IN_LB \ + (ANCHOR_LOOK_BEHIND | ANCHOR_LOOK_BEHIND_NOT | ANCHOR_BEGIN_LINE \ + | ANCHOR_END_LINE | ANCHOR_BEGIN_BUF | ANCHOR_BEGIN_POSITION | ANCHOR_KEEP \ + | ANCHOR_WORD_BOUND | ANCHOR_NOT_WORD_BOUND | ANCHOR_WORD_BEGIN \ + | ANCHOR_WORD_END) +#define ALLOWED_ANCHOR_IN_LB_NOT \ + (ANCHOR_LOOK_BEHIND | ANCHOR_LOOK_BEHIND_NOT | ANCHOR_BEGIN_LINE \ + | ANCHOR_END_LINE | ANCHOR_BEGIN_BUF | ANCHOR_BEGIN_POSITION | ANCHOR_KEEP \ + | ANCHOR_WORD_BOUND | ANCHOR_NOT_WORD_BOUND | ANCHOR_WORD_BEGIN \ + | ANCHOR_WORD_END) + + case ANCHOR_LOOK_BEHIND: { + r = check_type_tree(an->target, ALLOWED_TYPE_IN_LB, + ALLOWED_ENCLOSE_IN_LB, ALLOWED_ANCHOR_IN_LB); + if (r < 0) + return r; + if (r > 0) + return ONIGERR_INVALID_LOOK_BEHIND_PATTERN; + if (NTYPE(node) != NT_ANCHOR) + goto restart; + r = setup_tree(an->target, reg, state, env); + if (r != 0) + return r; + r = setup_look_behind(node, reg, env); + } + break; + + case ANCHOR_LOOK_BEHIND_NOT: { + r = check_type_tree(an->target, ALLOWED_TYPE_IN_LB, + ALLOWED_ENCLOSE_IN_LB_NOT, + ALLOWED_ANCHOR_IN_LB_NOT); + if (r < 0) + return r; + if (r > 0) + return ONIGERR_INVALID_LOOK_BEHIND_PATTERN; + if (NTYPE(node) != NT_ANCHOR) + goto restart; + r = setup_tree(an->target, reg, (state | IN_NOT), env); + if (r != 0) + return r; + r = setup_look_behind(node, reg, env); + } + break; + } + } + break; + + default: + break; + } + + return r; +} + +#ifndef USE_SUNDAY_QUICK_SEARCH +/* set skip map for Boyer-Moore search */ +static int set_bm_skip(UChar *s, UChar *end, regex_t *reg, UChar skip[], + int **int_skip, int ignore_case) +{ + OnigDistance i, len; + int clen, flen, n, j, k; + UChar *p, + buf[ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM][ONIGENC_MBC_CASE_FOLD_MAXLEN]; + OnigCaseFoldCodeItem items[ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM]; + OnigEncoding enc = reg->enc; + + len = end - s; + if (len < ONIG_CHAR_TABLE_SIZE) + { + for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) + skip[i] = (UChar)len; + + n = 0; + for (i = 0; i < len - 1; i += clen) + { + p = s + i; + if (ignore_case) + n = ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc, reg->case_fold_flag, p, end, + items); + clen = enclen(enc, p, end); + if (p + clen > end) + clen = (int)(end - p); + + for (j = 0; j < n; j++) + { + if ((items[j].code_len != 1) || (items[j].byte_len != clen)) + return 1; /* different length isn't supported. */ + flen = ONIGENC_CODE_TO_MBC(enc, items[j].code[0], buf[j]); + if (flen != clen) + return 1; /* different length isn't supported. */ + } + for (j = 0; j < clen; j++) + { + skip[s[i + j]] = (UChar)(len - 1 - i - j); + for (k = 0; k < n; k++) + { + skip[buf[k][j]] = (UChar)(len - 1 - i - j); + } + } + } + } + else + { +# if OPT_EXACT_MAXLEN < ONIG_CHAR_TABLE_SIZE + /* This should not happen. */ + return ONIGERR_TYPE_BUG; +# else + if (IS_NULL(*int_skip)) + { + *int_skip = (int *)xmalloc(sizeof(int) * ONIG_CHAR_TABLE_SIZE); + if (IS_NULL(*int_skip)) + return ONIGERR_MEMORY; + } + for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) + (*int_skip)[i] = (int)len; + + n = 0; + for (i = 0; i < len - 1; i += clen) + { + p = s + i; + if (ignore_case) + n = ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc, reg->case_fold_flag, p, end, + items); + clen = enclen(enc, p, end); + if (p + clen > end) + clen = (int)(end - p); + + for (j = 0; j < n; j++) + { + if ((items[j].code_len != 1) || (items[j].byte_len != clen)) + return 1; /* different length isn't supported. */ + flen = ONIGENC_CODE_TO_MBC(enc, items[j].code[0], buf[j]); + if (flen != clen) + return 1; /* different length isn't supported. */ + } + for (j = 0; j < clen; j++) + { + (*int_skip)[s[i + j]] = (int)(len - 1 - i - j); + for (k = 0; k < n; k++) + { + (*int_skip)[buf[k][j]] = (int)(len - 1 - i - j); + } + } + } +# endif + } + return 0; +} + +#else /* USE_SUNDAY_QUICK_SEARCH */ + +/* set skip map for Sunday's quick search */ +static int set_bm_skip(UChar *s, UChar *end, regex_t *reg, UChar skip[], + int **int_skip, int ignore_case) +{ + OnigDistance i, len; + int clen, flen, n, j, k; + UChar *p, + buf[ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM][ONIGENC_MBC_CASE_FOLD_MAXLEN]; + OnigCaseFoldCodeItem items[ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM]; + OnigEncoding enc = reg->enc; + + len = end - s; + if (len < ONIG_CHAR_TABLE_SIZE) + { + for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) + skip[i] = (UChar)(len + 1); + + n = 0; + for (i = 0; i < len; i += clen) + { + p = s + i; + if (ignore_case) + n = ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc, reg->case_fold_flag, p, end, + items); + clen = enclen(enc, p, end); + if (p + clen > end) + clen = (int)(end - p); + + for (j = 0; j < n; j++) + { + if ((items[j].code_len != 1) || (items[j].byte_len != clen)) + return 1; /* different length isn't supported. */ + flen = ONIGENC_CODE_TO_MBC(enc, items[j].code[0], buf[j]); + if (flen != clen) + return 1; /* different length isn't supported. */ + } + for (j = 0; j < clen; j++) + { + skip[s[i + j]] = (UChar)(len - i - j); + for (k = 0; k < n; k++) + { + skip[buf[k][j]] = (UChar)(len - i - j); + } + } + } + } + else + { +# if OPT_EXACT_MAXLEN < ONIG_CHAR_TABLE_SIZE + /* This should not happen. */ + return ONIGERR_TYPE_BUG; +# else + if (IS_NULL(*int_skip)) + { + *int_skip = (int *)xmalloc(sizeof(int) * ONIG_CHAR_TABLE_SIZE); + if (IS_NULL(*int_skip)) + return ONIGERR_MEMORY; + } + for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) + (*int_skip)[i] = (int)(len + 1); + + n = 0; + for (i = 0; i < len; i += clen) + { + p = s + i; + if (ignore_case) + n = ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc, reg->case_fold_flag, p, end, + items); + clen = enclen(enc, p, end); + if (p + clen > end) + clen = (int)(end - p); + + for (j = 0; j < n; j++) + { + if ((items[j].code_len != 1) || (items[j].byte_len != clen)) + return 1; /* different length isn't supported. */ + flen = ONIGENC_CODE_TO_MBC(enc, items[j].code[0], buf[j]); + if (flen != clen) + return 1; /* different length isn't supported. */ + } + for (j = 0; j < clen; j++) + { + (*int_skip)[s[i + j]] = (int)(len - i - j); + for (k = 0; k < n; k++) + { + (*int_skip)[buf[k][j]] = (int)(len - i - j); + } + } + } +# endif + } + return 0; +} +#endif /* USE_SUNDAY_QUICK_SEARCH */ + +typedef struct +{ + OnigDistance min; /* min byte length */ + OnigDistance max; /* max byte length */ +} MinMaxLen; + +typedef struct +{ + MinMaxLen mmd; + OnigEncoding enc; + OnigOptionType options; + OnigCaseFoldType case_fold_flag; + ScanEnv *scan_env; +} OptEnv; + +typedef struct +{ + int left_anchor; + int right_anchor; +} OptAncInfo; + +typedef struct +{ + MinMaxLen mmd; /* info position */ + OptAncInfo anc; + + int reach_end; + int ignore_case; /* -1: unset, 0: case sensitive, 1: ignore case */ + int len; + UChar s[OPT_EXACT_MAXLEN]; +} OptExactInfo; + +typedef struct +{ + MinMaxLen mmd; /* info position */ + OptAncInfo anc; + + int value; /* weighted value */ + UChar map[ONIG_CHAR_TABLE_SIZE]; +} OptMapInfo; + +typedef struct +{ + MinMaxLen len; + + OptAncInfo anc; + OptExactInfo exb; /* boundary */ + OptExactInfo exm; /* middle */ + OptExactInfo expr; /* prec read (?=...) */ + + OptMapInfo map; /* boundary */ +} NodeOptInfo; + +static int map_position_value(OnigEncoding enc, int i) +{ + static const short int ByteValTable[] + = {5, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 1, 1, 10, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 4, 7, 4, 4, 4, 4, 4, 4, 5, 5, 5, + 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 6, + 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 5, 6, 5, 5, 5, 5, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 1}; + + if (i < numberof(ByteValTable)) + { + if (i == 0 && ONIGENC_MBC_MINLEN(enc) > 1) + return 20; + else + return (int)ByteValTable[i]; + } + else + return 4; /* Take it easy. */ +} + +static int distance_value(MinMaxLen *mm) +{ + /* 1000 / (min-max-dist + 1) */ + static const short int dist_vals[] + = {1000, 500, 333, 250, 200, 167, 143, 125, 111, 100, 91, 83, 77, 71, 67, + 63, 59, 56, 53, 50, 48, 45, 43, 42, 40, 38, 37, 36, 34, 33, + 32, 31, 30, 29, 29, 28, 27, 26, 26, 25, 24, 24, 23, 23, 22, + 22, 21, 21, 20, 20, 20, 19, 19, 19, 18, 18, 18, 17, 17, 17, + 16, 16, 16, 16, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 13, + 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 10, 10, 10, 10, 10}; + + OnigDistance d; + + if (mm->max == ONIG_INFINITE_DISTANCE) + return 0; + + d = mm->max - mm->min; + if (d < numberof(dist_vals)) + /* return dist_vals[d] * 16 / (mm->min + 12); */ + return (int)dist_vals[d]; + else + return 1; +} + +static int comp_distance_value(MinMaxLen *d1, MinMaxLen *d2, int v1, int v2) +{ + if (v2 <= 0) + return -1; + if (v1 <= 0) + return 1; + + v1 *= distance_value(d1); + v2 *= distance_value(d2); + + if (v2 > v1) + return 1; + if (v2 < v1) + return -1; + + if (d2->min < d1->min) + return 1; + if (d2->min > d1->min) + return -1; + return 0; +} + +static int is_equal_mml(MinMaxLen *a, MinMaxLen *b) +{ + return (a->min == b->min && a->max == b->max) ? 1 : 0; +} + +static void set_mml(MinMaxLen *mml, OnigDistance min, OnigDistance max) +{ + mml->min = min; + mml->max = max; +} + +static void clear_mml(MinMaxLen *mml) +{ + mml->min = mml->max = 0; +} + +static void copy_mml(MinMaxLen *to, MinMaxLen *from) +{ + to->min = from->min; + to->max = from->max; +} + +static void add_mml(MinMaxLen *to, MinMaxLen *from) +{ + to->min = distance_add(to->min, from->min); + to->max = distance_add(to->max, from->max); +} + +#if 0 +static void +add_len_mml(MinMaxLen* to, OnigDistance len) +{ + to->min = distance_add(to->min, len); + to->max = distance_add(to->max, len); +} +#endif + +static void alt_merge_mml(MinMaxLen *to, MinMaxLen *from) +{ + if (to->min > from->min) + to->min = from->min; + if (to->max < from->max) + to->max = from->max; +} + +static void copy_opt_env(OptEnv *to, OptEnv *from) +{ + *to = *from; +} + +static void clear_opt_anc_info(OptAncInfo *anc) +{ + anc->left_anchor = 0; + anc->right_anchor = 0; +} + +static void copy_opt_anc_info(OptAncInfo *to, OptAncInfo *from) +{ + *to = *from; +} + +static void concat_opt_anc_info(OptAncInfo *to, OptAncInfo *left, + OptAncInfo *right, OnigDistance left_len, + OnigDistance right_len) +{ + clear_opt_anc_info(to); + + to->left_anchor = left->left_anchor; + if (left_len == 0) + { + to->left_anchor |= right->left_anchor; + } + + to->right_anchor = right->right_anchor; + if (right_len == 0) + { + to->right_anchor |= left->right_anchor; + } + else + { + to->right_anchor |= (left->right_anchor & ANCHOR_PREC_READ_NOT); + } +} + +static int is_left_anchor(int anc) +{ + if (anc == ANCHOR_END_BUF || anc == ANCHOR_SEMI_END_BUF + || anc == ANCHOR_END_LINE || anc == ANCHOR_PREC_READ + || anc == ANCHOR_PREC_READ_NOT) + return 0; + + return 1; +} + +static int is_set_opt_anc_info(OptAncInfo *to, int anc) +{ + if ((to->left_anchor & anc) != 0) + return 1; + + return ((to->right_anchor & anc) != 0 ? 1 : 0); +} + +static void add_opt_anc_info(OptAncInfo *to, int anc) +{ + if (is_left_anchor(anc)) + to->left_anchor |= anc; + else + to->right_anchor |= anc; +} + +static void remove_opt_anc_info(OptAncInfo *to, int anc) +{ + if (is_left_anchor(anc)) + to->left_anchor &= ~anc; + else + to->right_anchor &= ~anc; +} + +static void alt_merge_opt_anc_info(OptAncInfo *to, OptAncInfo *add) +{ + to->left_anchor &= add->left_anchor; + to->right_anchor &= add->right_anchor; +} + +static int is_full_opt_exact_info(OptExactInfo *ex) +{ + return (ex->len >= OPT_EXACT_MAXLEN ? 1 : 0); +} + +static void clear_opt_exact_info(OptExactInfo *ex) +{ + clear_mml(&ex->mmd); + clear_opt_anc_info(&ex->anc); + ex->reach_end = 0; + ex->ignore_case = -1; /* unset */ + ex->len = 0; + ex->s[0] = '\0'; +} + +static void copy_opt_exact_info(OptExactInfo *to, OptExactInfo *from) +{ + *to = *from; +} + +static void concat_opt_exact_info(OptExactInfo *to, OptExactInfo *add, + OnigEncoding enc) +{ + int i, j, len; + UChar *p, *end; + OptAncInfo tanc; + + if (to->ignore_case < 0) + to->ignore_case = add->ignore_case; + else if (to->ignore_case != add->ignore_case) + return; /* avoid */ + + p = add->s; + end = p + add->len; + for (i = to->len; p < end;) + { + len = enclen(enc, p, end); + if (i + len > OPT_EXACT_MAXLEN) + break; + for (j = 0; j < len && p < end; j++) + to->s[i++] = *p++; + } + + to->len = i; + to->reach_end = (p == end ? add->reach_end : 0); + + concat_opt_anc_info(&tanc, &to->anc, &add->anc, 1, 1); + if (!to->reach_end) + tanc.right_anchor = 0; + copy_opt_anc_info(&to->anc, &tanc); +} + +static void concat_opt_exact_info_str(OptExactInfo *to, UChar *s, UChar *end, + int raw ARG_UNUSED, OnigEncoding enc) +{ + int i, j, len; + UChar *p; + + for (i = to->len, p = s; p < end && i < OPT_EXACT_MAXLEN;) + { + len = enclen(enc, p, end); + if (i + len > OPT_EXACT_MAXLEN) + break; + for (j = 0; j < len && p < end; j++) + to->s[i++] = *p++; + } + + to->len = i; +} + +static void alt_merge_opt_exact_info(OptExactInfo *to, OptExactInfo *add, + OptEnv *env) +{ + int i, j, len; + + if (add->len == 0 || to->len == 0) + { + clear_opt_exact_info(to); + return; + } + + if (!is_equal_mml(&to->mmd, &add->mmd)) + { + clear_opt_exact_info(to); + return; + } + + for (i = 0; i < to->len && i < add->len;) + { + if (to->s[i] != add->s[i]) + break; + len = enclen(env->enc, to->s + i, to->s + to->len); + + for (j = 1; j < len; j++) + { + if (to->s[i + j] != add->s[i + j]) + break; + } + if (j < len) + break; + i += len; + } + + if (!add->reach_end || i < add->len || i < to->len) + { + to->reach_end = 0; + } + to->len = i; + if (to->ignore_case < 0) + to->ignore_case = add->ignore_case; + else if (add->ignore_case >= 0) + to->ignore_case |= add->ignore_case; + + alt_merge_opt_anc_info(&to->anc, &add->anc); + if (!to->reach_end) + to->anc.right_anchor = 0; +} + +static void select_opt_exact_info(OnigEncoding enc, OptExactInfo *now, + OptExactInfo *alt) +{ + int v1, v2; + + v1 = now->len; + v2 = alt->len; + + if (v2 == 0) + { + return; + } + else if (v1 == 0) + { + copy_opt_exact_info(now, alt); + return; + } + else if (v1 <= 2 && v2 <= 2) + { + /* ByteValTable[x] is big value --> low price */ + v2 = map_position_value(enc, now->s[0]); + v1 = map_position_value(enc, alt->s[0]); + + if (now->len > 1) + v1 += 5; + if (alt->len > 1) + v2 += 5; + } + + if (now->ignore_case <= 0) + v1 *= 2; + if (alt->ignore_case <= 0) + v2 *= 2; + + if (comp_distance_value(&now->mmd, &alt->mmd, v1, v2) > 0) + copy_opt_exact_info(now, alt); +} + +static void clear_opt_map_info(OptMapInfo *map) +{ + static const OptMapInfo clean_info = { + {0, 0}, + {0, 0}, + 0, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; + + xmemcpy(map, &clean_info, sizeof(OptMapInfo)); +} + +static void copy_opt_map_info(OptMapInfo *to, OptMapInfo *from) +{ + *to = *from; +} + +static void add_char_opt_map_info(OptMapInfo *map, UChar c, OnigEncoding enc) +{ + if (map->map[c] == 0) + { + map->map[c] = 1; + map->value += map_position_value(enc, c); + } +} + +static int add_char_amb_opt_map_info(OptMapInfo *map, UChar *p, UChar *end, + OnigEncoding enc, + OnigCaseFoldType case_fold_flag) +{ + OnigCaseFoldCodeItem items[ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM]; + UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN]; + int i, n; + + add_char_opt_map_info(map, p[0], enc); + + case_fold_flag = DISABLE_CASE_FOLD_MULTI_CHAR(case_fold_flag); + n = ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc, case_fold_flag, p, end, items); + if (n < 0) + return n; + + for (i = 0; i < n; i++) + { + ONIGENC_CODE_TO_MBC(enc, items[i].code[0], buf); + add_char_opt_map_info(map, buf[0], enc); + } + + return 0; +} + +static void select_opt_map_info(OptMapInfo *now, OptMapInfo *alt) +{ + const int z = 1 << 15; /* 32768: something big value */ + + int v1, v2; + + if (alt->value == 0) + return; + if (now->value == 0) + { + copy_opt_map_info(now, alt); + return; + } + + v1 = z / now->value; + v2 = z / alt->value; + if (comp_distance_value(&now->mmd, &alt->mmd, v1, v2) > 0) + copy_opt_map_info(now, alt); +} + +static int comp_opt_exact_or_map_info(OptExactInfo *e, OptMapInfo *m) +{ +#define COMP_EM_BASE 20 + int ve, vm; + + if (m->value <= 0) + return -1; + + ve = COMP_EM_BASE * e->len * (e->ignore_case > 0 ? 1 : 2); + vm = COMP_EM_BASE * 5 * 2 / m->value; + return comp_distance_value(&e->mmd, &m->mmd, ve, vm); +} + +static void alt_merge_opt_map_info(OnigEncoding enc, OptMapInfo *to, + OptMapInfo *add) +{ + int i, val; + + /* if (! is_equal_mml(&to->mmd, &add->mmd)) return ; */ + if (to->value == 0) + return; + if (add->value == 0 || to->mmd.max < add->mmd.min) + { + clear_opt_map_info(to); + return; + } + + alt_merge_mml(&to->mmd, &add->mmd); + + val = 0; + for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) + { + if (add->map[i]) + to->map[i] = 1; + + if (to->map[i]) + val += map_position_value(enc, i); + } + to->value = val; + + alt_merge_opt_anc_info(&to->anc, &add->anc); +} + +static void set_bound_node_opt_info(NodeOptInfo *opt, MinMaxLen *mmd) +{ + copy_mml(&(opt->exb.mmd), mmd); + copy_mml(&(opt->expr.mmd), mmd); + copy_mml(&(opt->map.mmd), mmd); +} + +static void clear_node_opt_info(NodeOptInfo *opt) +{ + clear_mml(&opt->len); + clear_opt_anc_info(&opt->anc); + clear_opt_exact_info(&opt->exb); + clear_opt_exact_info(&opt->exm); + clear_opt_exact_info(&opt->expr); + clear_opt_map_info(&opt->map); +} + +static void copy_node_opt_info(NodeOptInfo *to, NodeOptInfo *from) +{ + *to = *from; +} + +static void concat_left_node_opt_info(OnigEncoding enc, NodeOptInfo *to, + NodeOptInfo *add) +{ + int exb_reach, exm_reach; + OptAncInfo tanc; + + concat_opt_anc_info(&tanc, &to->anc, &add->anc, to->len.max, add->len.max); + copy_opt_anc_info(&to->anc, &tanc); + + if (add->exb.len > 0 && to->len.max == 0) + { + concat_opt_anc_info(&tanc, &to->anc, &add->exb.anc, to->len.max, + add->len.max); + copy_opt_anc_info(&add->exb.anc, &tanc); + } + + if (add->map.value > 0 && to->len.max == 0) + { + if (add->map.mmd.max == 0) + add->map.anc.left_anchor |= to->anc.left_anchor; + } + + exb_reach = to->exb.reach_end; + exm_reach = to->exm.reach_end; + + if (add->len.max != 0) + to->exb.reach_end = to->exm.reach_end = 0; + + if (add->exb.len > 0) + { + if (exb_reach) + { + concat_opt_exact_info(&to->exb, &add->exb, enc); + clear_opt_exact_info(&add->exb); + } + else if (exm_reach) + { + concat_opt_exact_info(&to->exm, &add->exb, enc); + clear_opt_exact_info(&add->exb); + } + } + select_opt_exact_info(enc, &to->exm, &add->exb); + select_opt_exact_info(enc, &to->exm, &add->exm); + + if (to->expr.len > 0) + { + if (add->len.max > 0) + { + if (to->expr.len > (int)add->len.max) + to->expr.len = (int)add->len.max; + + if (to->expr.mmd.max == 0) + select_opt_exact_info(enc, &to->exb, &to->expr); + else + select_opt_exact_info(enc, &to->exm, &to->expr); + } + } + else if (add->expr.len > 0) + { + copy_opt_exact_info(&to->expr, &add->expr); + } + + select_opt_map_info(&to->map, &add->map); + + add_mml(&to->len, &add->len); +} + +static void alt_merge_node_opt_info(NodeOptInfo *to, NodeOptInfo *add, + OptEnv *env) +{ + alt_merge_opt_anc_info(&to->anc, &add->anc); + alt_merge_opt_exact_info(&to->exb, &add->exb, env); + alt_merge_opt_exact_info(&to->exm, &add->exm, env); + alt_merge_opt_exact_info(&to->expr, &add->expr, env); + alt_merge_opt_map_info(env->enc, &to->map, &add->map); + + alt_merge_mml(&to->len, &add->len); +} + +#define MAX_NODE_OPT_INFO_REF_COUNT 5 + +static int optimize_node_left(Node *node, NodeOptInfo *opt, OptEnv *env) +{ + int type; + int r = 0; + + clear_node_opt_info(opt); + set_bound_node_opt_info(opt, &env->mmd); + + type = NTYPE(node); + switch (type) + { + case NT_LIST: { + OptEnv nenv; + NodeOptInfo nopt; + Node *nd = node; + + copy_opt_env(&nenv, env); + do + { + r = optimize_node_left(NCAR(nd), &nopt, &nenv); + if (r == 0) + { + add_mml(&nenv.mmd, &nopt.len); + concat_left_node_opt_info(env->enc, opt, &nopt); + } + } while (r == 0 && IS_NOT_NULL(nd = NCDR(nd))); + } + break; + + case NT_ALT: { + NodeOptInfo nopt; + Node *nd = node; + + do + { + r = optimize_node_left(NCAR(nd), &nopt, env); + if (r == 0) + { + if (nd == node) + copy_node_opt_info(opt, &nopt); + else + alt_merge_node_opt_info(opt, &nopt, env); + } + } while ((r == 0) && IS_NOT_NULL(nd = NCDR(nd))); + } + break; + + case NT_STR: { + StrNode *sn = NSTR(node); + OnigDistance slen = sn->end - sn->s; + int is_raw = NSTRING_IS_RAW(node); + + if (!NSTRING_IS_AMBIG(node)) + { + concat_opt_exact_info_str(&opt->exb, sn->s, sn->end, is_raw, env->enc); + opt->exb.ignore_case = 0; + if (slen > 0) + { + add_char_opt_map_info(&opt->map, *(sn->s), env->enc); + } + set_mml(&opt->len, slen, slen); + } + else + { + OnigDistance max; + + if (NSTRING_IS_DONT_GET_OPT_INFO(node)) + { + int n = onigenc_strlen(env->enc, sn->s, sn->end); + max = ONIGENC_MBC_MAXLEN_DIST(env->enc) * n; + } + else + { + concat_opt_exact_info_str(&opt->exb, sn->s, sn->end, is_raw, + env->enc); + opt->exb.ignore_case = 1; + + if (slen > 0) + { + r = add_char_amb_opt_map_info(&opt->map, sn->s, sn->end, env->enc, + env->case_fold_flag); + if (r != 0) + break; + } + + max = slen; + } + + set_mml(&opt->len, slen, max); + } + + if ((OnigDistance)opt->exb.len == slen) + opt->exb.reach_end = 1; + } + break; + + case NT_CCLASS: { + int i, z; + CClassNode *cc = NCCLASS(node); + + /* no need to check ignore case. (set in setup_tree()) */ + + if (IS_NOT_NULL(cc->mbuf) || IS_NCCLASS_NOT(cc)) + { + OnigDistance min = ONIGENC_MBC_MINLEN(env->enc); + OnigDistance max = ONIGENC_MBC_MAXLEN_DIST(env->enc); + + set_mml(&opt->len, min, max); + } + else + { + for (i = 0; i < SINGLE_BYTE_SIZE; i++) + { + z = BITSET_AT(cc->bs, i); + if ((z && !IS_NCCLASS_NOT(cc)) || (!z && IS_NCCLASS_NOT(cc))) + { + add_char_opt_map_info(&opt->map, (UChar)i, env->enc); + } + } + set_mml(&opt->len, 1, 1); + } + } + break; + + case NT_CTYPE: { + int i, min, max; + int maxcode; + + max = ONIGENC_MBC_MAXLEN_DIST(env->enc); + + if (max == 1) + { + min = 1; + + maxcode = NCTYPE(node)->ascii_range ? 0x80 : SINGLE_BYTE_SIZE; + switch (NCTYPE(node)->ctype) + { + case ONIGENC_CTYPE_WORD: + if (NCTYPE(node)->not!= 0) + { + for (i = 0; i < SINGLE_BYTE_SIZE; i++) + { + if (!ONIGENC_IS_CODE_WORD(env->enc, i) || i >= maxcode) + { + add_char_opt_map_info(&opt->map, (UChar)i, env->enc); + } + } + } + else + { + for (i = 0; i < maxcode; i++) + { + if (ONIGENC_IS_CODE_WORD(env->enc, i)) + { + add_char_opt_map_info(&opt->map, (UChar)i, env->enc); + } + } + } + break; + } + } + else + { + min = ONIGENC_MBC_MINLEN(env->enc); + } + set_mml(&opt->len, min, max); + } + break; + + case NT_CANY: { + OnigDistance min = ONIGENC_MBC_MINLEN(env->enc); + OnigDistance max = ONIGENC_MBC_MAXLEN_DIST(env->enc); + set_mml(&opt->len, min, max); + } + break; + + case NT_ANCHOR: + switch (NANCHOR(node)->type) + { + case ANCHOR_BEGIN_BUF: + case ANCHOR_BEGIN_POSITION: + case ANCHOR_BEGIN_LINE: + case ANCHOR_END_BUF: + case ANCHOR_SEMI_END_BUF: + case ANCHOR_END_LINE: + case ANCHOR_LOOK_BEHIND: /* just for (?<=x).* */ + case ANCHOR_PREC_READ_NOT: /* just for (?!x).* */ + add_opt_anc_info(&opt->anc, NANCHOR(node)->type); + break; + + case ANCHOR_PREC_READ: { + NodeOptInfo nopt; + + r = optimize_node_left(NANCHOR(node)->target, &nopt, env); + if (r == 0) + { + if (nopt.exb.len > 0) + copy_opt_exact_info(&opt->expr, &nopt.exb); + else if (nopt.exm.len > 0) + copy_opt_exact_info(&opt->expr, &nopt.exm); + + opt->expr.reach_end = 0; + + if (nopt.map.value > 0) + copy_opt_map_info(&opt->map, &nopt.map); + } + } + break; + + case ANCHOR_LOOK_BEHIND_NOT: + break; + } + break; + + case NT_BREF: { + int i; + int *backs; + OnigDistance min, max, tmin, tmax; + Node **nodes = SCANENV_MEM_NODES(env->scan_env); + BRefNode *br = NBREF(node); + + if (br->state & NST_RECURSION) + { + set_mml(&opt->len, 0, ONIG_INFINITE_DISTANCE); + break; + } + backs = BACKREFS_P(br); + r = get_min_match_length(nodes[backs[0]], &min, env->scan_env); + if (r != 0) + break; + r = get_max_match_length(nodes[backs[0]], &max, env->scan_env); + if (r != 0) + break; + for (i = 1; i < br->back_num; i++) + { + r = get_min_match_length(nodes[backs[i]], &tmin, env->scan_env); + if (r != 0) + break; + r = get_max_match_length(nodes[backs[i]], &tmax, env->scan_env); + if (r != 0) + break; + if (min > tmin) + min = tmin; + if (max < tmax) + max = tmax; + } + if (r == 0) + set_mml(&opt->len, min, max); + } + break; + +#ifdef USE_SUBEXP_CALL + case NT_CALL: + if (IS_CALL_RECURSION(NCALL(node))) + set_mml(&opt->len, 0, ONIG_INFINITE_DISTANCE); + else + { + OnigOptionType save = env->options; + env->options = NENCLOSE(NCALL(node)->target)->option; + r = optimize_node_left(NCALL(node)->target, opt, env); + env->options = save; + } + break; +#endif + + case NT_QTFR: { + int i; + OnigDistance min, max; + NodeOptInfo nopt; + QtfrNode *qn = NQTFR(node); + + r = optimize_node_left(qn->target, &nopt, env); + if (r) + break; + + if (/*qn->lower == 0 &&*/ IS_REPEAT_INFINITE(qn->upper)) + { + if (env->mmd.max == 0 && NTYPE(qn->target) == NT_CANY && qn->greedy) + { + if (IS_MULTILINE(env->options)) + /* implicit anchor: /.*a/ ==> /\A.*a/ */ + add_opt_anc_info(&opt->anc, ANCHOR_ANYCHAR_STAR_ML); + else + add_opt_anc_info(&opt->anc, ANCHOR_ANYCHAR_STAR); + } + } + else + { + if (qn->lower > 0) + { + copy_node_opt_info(opt, &nopt); + if (nopt.exb.len > 0) + { + if (nopt.exb.reach_end) + { + for (i = 2; i <= qn->lower && !is_full_opt_exact_info(&opt->exb); + i++) + { + concat_opt_exact_info(&opt->exb, &nopt.exb, env->enc); + } + if (i < qn->lower) + { + opt->exb.reach_end = 0; + } + } + } + + if (qn->lower != qn->upper) + { + opt->exb.reach_end = 0; + opt->exm.reach_end = 0; + } + if (qn->lower > 1) + opt->exm.reach_end = 0; + } + } + + min = distance_multiply(nopt.len.min, qn->lower); + if (IS_REPEAT_INFINITE(qn->upper)) + max = (nopt.len.max > 0 ? ONIG_INFINITE_DISTANCE : 0); + else + max = distance_multiply(nopt.len.max, qn->upper); + + set_mml(&opt->len, min, max); + } + break; + + case NT_ENCLOSE: { + EncloseNode *en = NENCLOSE(node); + + switch (en->type) + { + case ENCLOSE_OPTION: { + OnigOptionType save = env->options; + + env->options = en->option; + r = optimize_node_left(en->target, opt, env); + env->options = save; + } + break; + + case ENCLOSE_MEMORY: +#ifdef USE_SUBEXP_CALL + en->opt_count++; + if (en->opt_count > MAX_NODE_OPT_INFO_REF_COUNT) + { + OnigDistance min, max; + + min = 0; + max = ONIG_INFINITE_DISTANCE; + if (IS_ENCLOSE_MIN_FIXED(en)) + min = en->min_len; + if (IS_ENCLOSE_MAX_FIXED(en)) + max = en->max_len; + set_mml(&opt->len, min, max); + } + else +#endif + { + r = optimize_node_left(en->target, opt, env); + + if (is_set_opt_anc_info(&opt->anc, ANCHOR_ANYCHAR_STAR_MASK)) + { + if (BIT_STATUS_AT(env->scan_env->backrefed_mem, en->regnum)) + remove_opt_anc_info(&opt->anc, ANCHOR_ANYCHAR_STAR_MASK); + } + } + break; + + case ENCLOSE_STOP_BACKTRACK: + case ENCLOSE_CONDITION: + r = optimize_node_left(en->target, opt, env); + break; + + case ENCLOSE_ABSENT: + set_mml(&opt->len, 0, ONIG_INFINITE_DISTANCE); + break; + } + } + break; + + default: +#ifdef ONIG_DEBUG + fprintf(stderr, "optimize_node_left: undefined node type %d\n", + NTYPE(node)); +#endif + r = ONIGERR_TYPE_BUG; + break; + } + + return r; +} + +static int set_optimize_exact_info(regex_t *reg, OptExactInfo *e) +{ + int r; + int allow_reverse; + + if (e->len == 0) + return 0; + + reg->exact = (UChar *)xmalloc(e->len); + CHECK_NULL_RETURN_MEMERR(reg->exact); + xmemcpy(reg->exact, e->s, e->len); + reg->exact_end = reg->exact + e->len; + + allow_reverse + = ONIGENC_IS_ALLOWED_REVERSE_MATCH(reg->enc, reg->exact, reg->exact_end); + + if (e->ignore_case > 0) + { + if (e->len >= 3 || (e->len >= 2 && allow_reverse)) + { + r = set_bm_skip(reg->exact, reg->exact_end, reg, reg->map, + &(reg->int_map), 1); + if (r == 0) + { + reg->optimize + = (allow_reverse != 0 ? ONIG_OPTIMIZE_EXACT_BM_IC + : ONIG_OPTIMIZE_EXACT_BM_NOT_REV_IC); + } + else + { + reg->optimize = ONIG_OPTIMIZE_EXACT_IC; + } + } + else + { + reg->optimize = ONIG_OPTIMIZE_EXACT_IC; + } + } + else + { + if (e->len >= 3 || (e->len >= 2 && allow_reverse)) + { + r = set_bm_skip(reg->exact, reg->exact_end, reg, reg->map, + &(reg->int_map), 0); + if (r == 0) + { + reg->optimize = (allow_reverse != 0 ? ONIG_OPTIMIZE_EXACT_BM + : ONIG_OPTIMIZE_EXACT_BM_NOT_REV); + } + else + { + reg->optimize = ONIG_OPTIMIZE_EXACT; + } + } + else + { + reg->optimize = ONIG_OPTIMIZE_EXACT; + } + } + + reg->dmin = e->mmd.min; + reg->dmax = e->mmd.max; + + if (reg->dmin != ONIG_INFINITE_DISTANCE) + { + reg->threshold_len = (int)(reg->dmin + (reg->exact_end - reg->exact)); + } + + return 0; +} + +static void set_optimize_map_info(regex_t *reg, OptMapInfo *m) +{ + int i; + + for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) + reg->map[i] = m->map[i]; + + reg->optimize = ONIG_OPTIMIZE_MAP; + reg->dmin = m->mmd.min; + reg->dmax = m->mmd.max; + + if (reg->dmin != ONIG_INFINITE_DISTANCE) + { + reg->threshold_len = (int)(reg->dmin + 1); + } +} + +static void set_sub_anchor(regex_t *reg, OptAncInfo *anc) +{ + reg->sub_anchor |= anc->left_anchor & ANCHOR_BEGIN_LINE; + reg->sub_anchor |= anc->right_anchor & ANCHOR_END_LINE; +} + +#if defined(ONIG_DEBUG_COMPILE) || defined(ONIG_DEBUG_MATCH) +static void print_optimize_info(FILE *f, regex_t *reg); +#endif + +static int set_optimize_info_from_tree(Node *node, regex_t *reg, + ScanEnv *scan_env) +{ + + int r; + NodeOptInfo opt; + OptEnv env; + + env.enc = reg->enc; + env.options = reg->options; + env.case_fold_flag = reg->case_fold_flag; + env.scan_env = scan_env; + clear_mml(&env.mmd); + + r = optimize_node_left(node, &opt, &env); + if (r) + return r; + + reg->anchor + = opt.anc.left_anchor + & (ANCHOR_BEGIN_BUF | ANCHOR_BEGIN_POSITION | ANCHOR_ANYCHAR_STAR + | ANCHOR_ANYCHAR_STAR_ML | ANCHOR_LOOK_BEHIND); + + if ((opt.anc.left_anchor & (ANCHOR_LOOK_BEHIND | ANCHOR_PREC_READ_NOT)) != 0) + reg->anchor &= ~ANCHOR_ANYCHAR_STAR_ML; + + reg->anchor + |= opt.anc.right_anchor + & (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF | ANCHOR_PREC_READ_NOT); + + if (reg->anchor & (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF)) + { + reg->anchor_dmin = opt.len.min; + reg->anchor_dmax = opt.len.max; + } + + if (opt.exb.len > 0 || opt.exm.len > 0) + { + select_opt_exact_info(reg->enc, &opt.exb, &opt.exm); + if (opt.map.value > 0 && comp_opt_exact_or_map_info(&opt.exb, &opt.map) > 0) + { + goto set_map; + } + else + { + r = set_optimize_exact_info(reg, &opt.exb); + set_sub_anchor(reg, &opt.exb.anc); + } + } + else if (opt.map.value > 0) + { + set_map: + set_optimize_map_info(reg, &opt.map); + set_sub_anchor(reg, &opt.map.anc); + } + else + { + reg->sub_anchor |= opt.anc.left_anchor & ANCHOR_BEGIN_LINE; + if (opt.len.max == 0) + reg->sub_anchor |= opt.anc.right_anchor & ANCHOR_END_LINE; + } + +#if defined(ONIG_DEBUG_COMPILE) || defined(ONIG_DEBUG_MATCH) + print_optimize_info(stderr, reg); +#endif + return r; +} + +static void clear_optimize_info(regex_t *reg) +{ + reg->optimize = ONIG_OPTIMIZE_NONE; + reg->anchor = 0; + reg->anchor_dmin = 0; + reg->anchor_dmax = 0; + reg->sub_anchor = 0; + reg->exact_end = (UChar *)NULL; + reg->threshold_len = 0; + if (IS_NOT_NULL(reg->exact)) + { + xfree(reg->exact); + reg->exact = (UChar *)NULL; + } +} + +#ifdef ONIG_DEBUG + +static void print_enc_string(FILE *fp, OnigEncoding enc, const UChar *s, + const UChar *end) +{ + fprintf(fp, "\nPATTERN: /"); + + if (ONIGENC_MBC_MINLEN(enc) > 1) + { + const UChar *p; + OnigCodePoint code; + + p = s; + while (p < end) + { + code = ONIGENC_MBC_TO_CODE(enc, p, end); + if (code >= 0x80) + { + fprintf(fp, " 0x%04x ", (int)code); + } + else + { + fputc((int)code, fp); + } + + p += enclen(enc, p, end); + } + } + else + { + while (s < end) + { + fputc((int)*s, fp); + s++; + } + } + + fprintf(fp, "/ (%s)\n", enc->name); +} +#endif /* ONIG_DEBUG */ + +#if defined(ONIG_DEBUG_COMPILE) || defined(ONIG_DEBUG_MATCH) +static void print_distance_range(FILE *f, OnigDistance a, OnigDistance b) +{ + if (a == ONIG_INFINITE_DISTANCE) + fputs("inf", f); + else + fprintf(f, "(%" PRIuPTR ")", a); + + fputs("-", f); + + if (b == ONIG_INFINITE_DISTANCE) + fputs("inf", f); + else + fprintf(f, "(%" PRIuPTR ")", b); +} + +static void print_anchor(FILE *f, int anchor) +{ + int q = 0; + + fprintf(f, "["); + + if (anchor & ANCHOR_BEGIN_BUF) + { + fprintf(f, "begin-buf"); + q = 1; + } + if (anchor & ANCHOR_BEGIN_LINE) + { + if (q) + fprintf(f, ", "); + q = 1; + fprintf(f, "begin-line"); + } + if (anchor & ANCHOR_BEGIN_POSITION) + { + if (q) + fprintf(f, ", "); + q = 1; + fprintf(f, "begin-pos"); + } + if (anchor & ANCHOR_END_BUF) + { + if (q) + fprintf(f, ", "); + q = 1; + fprintf(f, "end-buf"); + } + if (anchor & ANCHOR_SEMI_END_BUF) + { + if (q) + fprintf(f, ", "); + q = 1; + fprintf(f, "semi-end-buf"); + } + if (anchor & ANCHOR_END_LINE) + { + if (q) + fprintf(f, ", "); + q = 1; + fprintf(f, "end-line"); + } + if (anchor & ANCHOR_ANYCHAR_STAR) + { + if (q) + fprintf(f, ", "); + q = 1; + fprintf(f, "anychar-star"); + } + if (anchor & ANCHOR_ANYCHAR_STAR_ML) + { + if (q) + fprintf(f, ", "); + fprintf(f, "anychar-star-ml"); + } + + fprintf(f, "]"); +} + +static void print_optimize_info(FILE *f, regex_t *reg) +{ + static const char *on[] + = {"NONE", "EXACT", "EXACT_BM", "EXACT_BM_NOT_REV", + "EXACT_IC", "MAP", "EXACT_BM_IC", "EXACT_BM_NOT_REV_IC"}; + + fprintf(f, "optimize: %s\n", on[reg->optimize]); + fprintf(f, " anchor: "); + print_anchor(f, reg->anchor); + if ((reg->anchor & ANCHOR_END_BUF_MASK) != 0) + print_distance_range(f, reg->anchor_dmin, reg->anchor_dmax); + fprintf(f, "\n"); + + if (reg->optimize) + { + fprintf(f, " sub anchor: "); + print_anchor(f, reg->sub_anchor); + fprintf(f, "\n"); + } + fprintf(f, "\n"); + + if (reg->exact) + { + UChar *p; + fprintf(f, "exact: ["); + for (p = reg->exact; p < reg->exact_end; p++) + { + fputc(*p, f); + } + fprintf(f, "]: length: %" PRIdPTR "\n", (reg->exact_end - reg->exact)); + } + else if (reg->optimize & ONIG_OPTIMIZE_MAP) + { + int c, i, n = 0; + + for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) + if (reg->map[i]) + n++; + + fprintf(f, "map: n=%d\n", n); + if (n > 0) + { + c = 0; + fputc('[', f); + for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) + { + if (reg->map[i] != 0) + { + if (c > 0) + fputs(", ", f); + c++; + if (ONIGENC_MBC_MAXLEN(reg->enc) == 1 + && ONIGENC_IS_CODE_PRINT(reg->enc, (OnigCodePoint)i)) + fputc(i, f); + else + fprintf(f, "%d", i); + } + } + fprintf(f, "]\n"); + } + } +} +#endif /* ONIG_DEBUG_COMPILE || ONIG_DEBUG_MATCH */ + +extern void onig_free_body(regex_t *reg) +{ + if (IS_NOT_NULL(reg)) + { + if (IS_NOT_NULL(reg->p)) + xfree(reg->p); + if (IS_NOT_NULL(reg->exact)) + xfree(reg->exact); + if (IS_NOT_NULL(reg->int_map)) + xfree(reg->int_map); + if (IS_NOT_NULL(reg->int_map_backward)) + xfree(reg->int_map_backward); + if (IS_NOT_NULL(reg->repeat_range)) + xfree(reg->repeat_range); + if (IS_NOT_NULL(reg->chain)) + onig_free(reg->chain); + +#ifdef USE_NAMED_GROUP + onig_names_free(reg); +#endif + } +} + +extern void onig_free(regex_t *reg) +{ + if (IS_NOT_NULL(reg)) + { + onig_free_body(reg); + xfree(reg); + } +} + +#ifdef RUBY +size_t onig_memsize(const regex_t *reg) +{ + size_t size = sizeof(regex_t); + if (IS_NULL(reg)) + return 0; + if (IS_NOT_NULL(reg->p)) + size += reg->alloc; + if (IS_NOT_NULL(reg->exact)) + size += reg->exact_end - reg->exact; + if (IS_NOT_NULL(reg->int_map)) + size += sizeof(int) * ONIG_CHAR_TABLE_SIZE; + if (IS_NOT_NULL(reg->int_map_backward)) + size += sizeof(int) * ONIG_CHAR_TABLE_SIZE; + if (IS_NOT_NULL(reg->repeat_range)) + size += reg->repeat_range_alloc * sizeof(OnigRepeatRange); + if (IS_NOT_NULL(reg->chain)) + size += onig_memsize(reg->chain); + + return size; +} + +size_t onig_region_memsize(const OnigRegion *regs) +{ + size_t size = sizeof(*regs); + if (IS_NULL(regs)) + return 0; + size += regs->allocated * (sizeof(*regs->beg) + sizeof(*regs->end)); + return size; +} +#endif + +#define REGEX_TRANSFER(to, from) \ + do \ + { \ + onig_free_body(to); \ + xmemcpy(to, from, sizeof(regex_t)); \ + xfree(from); \ + } while (0) + +#if 0 +extern void +onig_transfer(regex_t* to, regex_t* from) +{ + REGEX_TRANSFER(to, from); +} +#endif + +#ifdef ONIG_DEBUG_COMPILE +static void print_compiled_byte_code_list(FILE *f, regex_t *reg); +#endif +#ifdef ONIG_DEBUG_PARSE_TREE +static void print_tree(FILE *f, Node *node); +#endif + +#ifdef RUBY +extern int onig_compile(regex_t *reg, const UChar *pattern, + const UChar *pattern_end, OnigErrorInfo *einfo) +{ + return onig_compile_ruby(reg, pattern, pattern_end, einfo, NULL, 0); +} +#endif + +#ifdef RUBY +extern int onig_compile_ruby(regex_t *reg, const UChar *pattern, + const UChar *pattern_end, OnigErrorInfo *einfo, + const char *sourcefile, int sourceline) +#else +extern int onig_compile(regex_t *reg, const UChar *pattern, + const UChar *pattern_end, OnigErrorInfo *einfo) +#endif +{ +#define COMPILE_INIT_SIZE 20 + + int r; + OnigDistance init_size; + Node *root; + ScanEnv scan_env = {0}; +#ifdef USE_SUBEXP_CALL + UnsetAddrList uslist; +#endif + + if (IS_NOT_NULL(einfo)) + einfo->par = (UChar *)NULL; + +#ifdef RUBY + scan_env.sourcefile = sourcefile; + scan_env.sourceline = sourceline; +#endif + +#ifdef ONIG_DEBUG + print_enc_string(stderr, reg->enc, pattern, pattern_end); +#endif + + if (reg->alloc == 0) + { + init_size = (pattern_end - pattern) * 2; + if (init_size <= 0) + init_size = COMPILE_INIT_SIZE; + r = BBUF_INIT(reg, init_size); + if (r != 0) + goto end; + } + else + reg->used = 0; + + reg->num_mem = 0; + reg->num_repeat = 0; + reg->num_null_check = 0; + reg->repeat_range_alloc = 0; + reg->repeat_range = (OnigRepeatRange *)NULL; +#ifdef USE_COMBINATION_EXPLOSION_CHECK + reg->num_comb_exp_check = 0; +#endif + + r = onig_parse_make_tree(&root, pattern, pattern_end, reg, &scan_env); + if (r != 0) + goto err; + +#ifdef ONIG_DEBUG_PARSE_TREE +# if 0 + fprintf(stderr, "ORIGINAL PARSE TREE:\n"); + print_tree(stderr, root); +# endif +#endif + +#ifdef USE_NAMED_GROUP + /* mixed use named group and no-named group */ + if (scan_env.num_named > 0 + && IS_SYNTAX_BV(scan_env.syntax, ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP) + && !ONIG_IS_OPTION_ON(reg->options, ONIG_OPTION_CAPTURE_GROUP)) + { + if (scan_env.num_named != scan_env.num_mem) + r = disable_noname_group_capture(&root, reg, &scan_env); + else + r = numbered_ref_check(root); + + if (r != 0) + goto err; + } +#endif + +#ifdef USE_SUBEXP_CALL + if (scan_env.num_call > 0) + { + r = unset_addr_list_init(&uslist, scan_env.num_call); + if (r != 0) + goto err; + scan_env.unset_addr_list = &uslist; + r = setup_subexp_call(root, &scan_env); + if (r != 0) + goto err_unset; + r = subexp_recursive_check_trav(root, &scan_env); + if (r < 0) + goto err_unset; + r = subexp_inf_recursive_check_trav(root, &scan_env); + if (r != 0) + goto err_unset; + + reg->num_call = scan_env.num_call; + } + else + reg->num_call = 0; +#endif + + r = setup_tree(root, reg, 0, &scan_env); + if (r != 0) + goto err_unset; + +#ifdef ONIG_DEBUG_PARSE_TREE + print_tree(stderr, root); +#endif + + reg->capture_history = scan_env.capture_history; + reg->bt_mem_start = scan_env.bt_mem_start; + reg->bt_mem_start |= reg->capture_history; + if (IS_FIND_CONDITION(reg->options)) + BIT_STATUS_ON_ALL(reg->bt_mem_end); + else + { + reg->bt_mem_end = scan_env.bt_mem_end; + reg->bt_mem_end |= reg->capture_history; + } + +#ifdef USE_COMBINATION_EXPLOSION_CHECK + if (scan_env.backrefed_mem == 0 +# ifdef USE_SUBEXP_CALL + || scan_env.num_call == 0 +# endif + ) + { + setup_comb_exp_check(root, 0, &scan_env); +# ifdef USE_SUBEXP_CALL + if (scan_env.has_recursion != 0) + { + scan_env.num_comb_exp_check = 0; + } + else +# endif + if (scan_env.comb_exp_max_regnum > 0) + { + int i; + for (i = 1; i <= scan_env.comb_exp_max_regnum; i++) + { + if (BIT_STATUS_AT(scan_env.backrefed_mem, i) != 0) + { + scan_env.num_comb_exp_check = 0; + break; + } + } + } + } + + reg->num_comb_exp_check = scan_env.num_comb_exp_check; +#endif + + clear_optimize_info(reg); +#ifndef ONIG_DONT_OPTIMIZE + r = set_optimize_info_from_tree(root, reg, &scan_env); + if (r != 0) + goto err_unset; +#endif + + if (IS_NOT_NULL(scan_env.mem_nodes_dynamic)) + { + xfree(scan_env.mem_nodes_dynamic); + scan_env.mem_nodes_dynamic = (Node **)NULL; + } + + r = compile_tree(root, reg); + if (r == 0) + { + r = add_opcode(reg, OP_END); +#ifdef USE_SUBEXP_CALL + if (scan_env.num_call > 0) + { + r = unset_addr_list_fix(&uslist, reg); + unset_addr_list_end(&uslist); + if (r) + goto err; + } +#endif + + if ((reg->num_repeat != 0) || (reg->bt_mem_end != 0)) + reg->stack_pop_level = STACK_POP_LEVEL_ALL; + else + { + if (reg->bt_mem_start != 0) + reg->stack_pop_level = STACK_POP_LEVEL_MEM_START; + else + reg->stack_pop_level = STACK_POP_LEVEL_FREE; + } + } +#ifdef USE_SUBEXP_CALL + else if (scan_env.num_call > 0) + { + unset_addr_list_end(&uslist); + } +#endif + onig_node_free(root); + +#ifdef ONIG_DEBUG_COMPILE +# ifdef USE_NAMED_GROUP + onig_print_names(stderr, reg); +# endif + print_compiled_byte_code_list(stderr, reg); +#endif + +end: + return r; + +err_unset: +#ifdef USE_SUBEXP_CALL + if (scan_env.num_call > 0) + { + unset_addr_list_end(&uslist); + } +#endif +err: + if (IS_NOT_NULL(scan_env.error)) + { + if (IS_NOT_NULL(einfo)) + { + einfo->enc = scan_env.enc; + einfo->par = scan_env.error; + einfo->par_end = scan_env.error_end; + } + } + + onig_node_free(root); + if (IS_NOT_NULL(scan_env.mem_nodes_dynamic)) + xfree(scan_env.mem_nodes_dynamic); + return r; +} + +static int onig_inited = 0; + +extern int onig_reg_init(regex_t *reg, OnigOptionType option, + OnigCaseFoldType case_fold_flag, OnigEncoding enc, + const OnigSyntaxType *syntax) +{ + if (!onig_inited) + onig_init(); + + if (IS_NULL(reg)) + return ONIGERR_INVALID_ARGUMENT; + + if (ONIGENC_IS_UNDEF(enc)) + return ONIGERR_DEFAULT_ENCODING_IS_NOT_SET; + + if ((option & (ONIG_OPTION_DONT_CAPTURE_GROUP | ONIG_OPTION_CAPTURE_GROUP)) + == (ONIG_OPTION_DONT_CAPTURE_GROUP | ONIG_OPTION_CAPTURE_GROUP)) + { + return ONIGERR_INVALID_COMBINATION_OF_OPTIONS; + } + + if ((option & ONIG_OPTION_NEGATE_SINGLELINE) != 0) + { + option |= syntax->options; + option &= ~ONIG_OPTION_SINGLELINE; + } + else + option |= syntax->options; + + (reg)->enc = enc; + (reg)->options = option; + (reg)->syntax = syntax; + (reg)->optimize = 0; + (reg)->exact = (UChar *)NULL; + (reg)->int_map = (int *)NULL; + (reg)->int_map_backward = (int *)NULL; + (reg)->chain = (regex_t *)NULL; + + (reg)->p = (UChar *)NULL; + (reg)->alloc = 0; + (reg)->used = 0; + (reg)->name_table = (void *)NULL; + + (reg)->case_fold_flag = case_fold_flag; + return 0; +} + +extern int onig_new_without_alloc(regex_t *reg, const UChar *pattern, + const UChar *pattern_end, + OnigOptionType option, OnigEncoding enc, + const OnigSyntaxType *syntax, + OnigErrorInfo *einfo) +{ + int r; + + r = onig_reg_init(reg, option, ONIGENC_CASE_FOLD_DEFAULT, enc, syntax); + if (r) + return r; + + r = onig_compile(reg, pattern, pattern_end, einfo); + return r; +} + +extern int onig_new(regex_t **reg, const UChar *pattern, + const UChar *pattern_end, OnigOptionType option, + OnigEncoding enc, const OnigSyntaxType *syntax, + OnigErrorInfo *einfo) +{ + int r; + + *reg = (regex_t *)xmalloc(sizeof(regex_t)); + if (IS_NULL(*reg)) + return ONIGERR_MEMORY; + + r = onig_reg_init(*reg, option, ONIGENC_CASE_FOLD_DEFAULT, enc, syntax); + if (r) + goto err; + + r = onig_compile(*reg, pattern, pattern_end, einfo); + if (r) + { + err: + onig_free(*reg); + *reg = NULL; + } + return r; +} + +extern int onig_initialize(OnigEncoding encodings[] ARG_UNUSED, + int n ARG_UNUSED) +{ + return onig_init(); +} + +extern int onig_init(void) +{ + if (onig_inited != 0) + return 0; + + onig_inited = 1; + +#if defined(ONIG_DEBUG_MEMLEAK) && defined(_MSC_VER) + _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); +#endif + + onigenc_init(); + /* onigenc_set_default_caseconv_table((UChar* )0); */ + +#ifdef ONIG_DEBUG_STATISTICS + onig_statistics_init(); +#endif + + return 0; +} + +static OnigEndCallListItemType *EndCallTop; + +extern void onig_add_end_call(void (*func)(void)) +{ + OnigEndCallListItemType *item; + + item = (OnigEndCallListItemType *)xmalloc(sizeof(*item)); + if (item == 0) + return; + + item->next = EndCallTop; + item->func = func; + + EndCallTop = item; +} + +static void exec_end_call_list(void) +{ + OnigEndCallListItemType *prev; + void (*func)(void); + + while (EndCallTop != 0) + { + func = EndCallTop->func; + (*func)(); + + prev = EndCallTop; + EndCallTop = EndCallTop->next; + xfree(prev); + } +} + +extern int onig_end(void) +{ + exec_end_call_list(); + +#ifdef ONIG_DEBUG_STATISTICS + onig_print_statistics(stderr); +#endif + +#if defined(ONIG_DEBUG_MEMLEAK) && defined(_MSC_VER) + _CrtDumpMemoryLeaks(); +#endif + + onig_inited = 0; + + return 0; +} + +extern int onig_is_in_code_range(const UChar *p, OnigCodePoint code) +{ + OnigCodePoint n, *data; + OnigCodePoint low, high, x; + + GET_CODE_POINT(n, p); + data = (OnigCodePoint *)p; + data++; + + for (low = 0, high = n; low < high;) + { + x = (low + high) >> 1; + if (code > data[x * 2 + 1]) + low = x + 1; + else + high = x; + } + + return ((low < n && code >= data[low * 2]) ? 1 : 0); +} + +extern int onig_is_code_in_cc_len(int elen, OnigCodePoint code, CClassNode *cc) +{ + int found; + + if (elen > 1 || (code >= SINGLE_BYTE_SIZE)) + { + if (IS_NULL(cc->mbuf)) + { + found = 0; + } + else + { + found = (onig_is_in_code_range(cc->mbuf->p, code) != 0 ? 1 : 0); + } + } + else + { + found = (BITSET_AT(cc->bs, code) == 0 ? 0 : 1); + } + + if (IS_NCCLASS_NOT(cc)) + return !found; + else + return found; +} + +extern int onig_is_code_in_cc(OnigEncoding enc, OnigCodePoint code, + CClassNode *cc) +{ + int len; + + if (ONIGENC_MBC_MINLEN(enc) > 1) + { + len = 2; + } + else + { + len = ONIGENC_CODE_TO_MBCLEN(enc, code); + } + return onig_is_code_in_cc_len(len, code, cc); +} + +#ifdef ONIG_DEBUG + +/* arguments type */ +# define ARG_SPECIAL -1 +# define ARG_NON 0 +# define ARG_RELADDR 1 +# define ARG_ABSADDR 2 +# define ARG_LENGTH 3 +# define ARG_MEMNUM 4 +# define ARG_OPTION 5 +# define ARG_STATE_CHECK 6 + +OnigOpInfoType OnigOpInfo[] + = {{OP_FINISH, "finish", ARG_NON}, + {OP_END, "end", ARG_NON}, + {OP_EXACT1, "exact1", ARG_SPECIAL}, + {OP_EXACT2, "exact2", ARG_SPECIAL}, + {OP_EXACT3, "exact3", ARG_SPECIAL}, + {OP_EXACT4, "exact4", ARG_SPECIAL}, + {OP_EXACT5, "exact5", ARG_SPECIAL}, + {OP_EXACTN, "exactn", ARG_SPECIAL}, + {OP_EXACTMB2N1, "exactmb2-n1", ARG_SPECIAL}, + {OP_EXACTMB2N2, "exactmb2-n2", ARG_SPECIAL}, + {OP_EXACTMB2N3, "exactmb2-n3", ARG_SPECIAL}, + {OP_EXACTMB2N, "exactmb2-n", ARG_SPECIAL}, + {OP_EXACTMB3N, "exactmb3n", ARG_SPECIAL}, + {OP_EXACTMBN, "exactmbn", ARG_SPECIAL}, + {OP_EXACT1_IC, "exact1-ic", ARG_SPECIAL}, + {OP_EXACTN_IC, "exactn-ic", ARG_SPECIAL}, + {OP_CCLASS, "cclass", ARG_SPECIAL}, + {OP_CCLASS_MB, "cclass-mb", ARG_SPECIAL}, + {OP_CCLASS_MIX, "cclass-mix", ARG_SPECIAL}, + {OP_CCLASS_NOT, "cclass-not", ARG_SPECIAL}, + {OP_CCLASS_MB_NOT, "cclass-mb-not", ARG_SPECIAL}, + {OP_CCLASS_MIX_NOT, "cclass-mix-not", ARG_SPECIAL}, + {OP_ANYCHAR, "anychar", ARG_NON}, + {OP_ANYCHAR_ML, "anychar-ml", ARG_NON}, + {OP_ANYCHAR_STAR, "anychar*", ARG_NON}, + {OP_ANYCHAR_ML_STAR, "anychar-ml*", ARG_NON}, + {OP_ANYCHAR_STAR_PEEK_NEXT, "anychar*-peek-next", ARG_SPECIAL}, + {OP_ANYCHAR_ML_STAR_PEEK_NEXT, "anychar-ml*-peek-next", ARG_SPECIAL}, + {OP_WORD, "word", ARG_NON}, + {OP_NOT_WORD, "not-word", ARG_NON}, + {OP_WORD_BOUND, "word-bound", ARG_NON}, + {OP_NOT_WORD_BOUND, "not-word-bound", ARG_NON}, + {OP_WORD_BEGIN, "word-begin", ARG_NON}, + {OP_WORD_END, "word-end", ARG_NON}, + {OP_ASCII_WORD, "ascii-word", ARG_NON}, + {OP_NOT_ASCII_WORD, "not-ascii-word", ARG_NON}, + {OP_ASCII_WORD_BOUND, "ascii-word-bound", ARG_NON}, + {OP_NOT_ASCII_WORD_BOUND, "not-ascii-word-bound", ARG_NON}, + {OP_ASCII_WORD_BEGIN, "ascii-word-begin", ARG_NON}, + {OP_ASCII_WORD_END, "ascii-word-end", ARG_NON}, + {OP_BEGIN_BUF, "begin-buf", ARG_NON}, + {OP_END_BUF, "end-buf", ARG_NON}, + {OP_BEGIN_LINE, "begin-line", ARG_NON}, + {OP_END_LINE, "end-line", ARG_NON}, + {OP_SEMI_END_BUF, "semi-end-buf", ARG_NON}, + {OP_BEGIN_POSITION, "begin-position", ARG_NON}, + {OP_BACKREF1, "backref1", ARG_NON}, + {OP_BACKREF2, "backref2", ARG_NON}, + {OP_BACKREFN, "backrefn", ARG_MEMNUM}, + {OP_BACKREFN_IC, "backrefn-ic", ARG_SPECIAL}, + {OP_BACKREF_MULTI, "backref_multi", ARG_SPECIAL}, + {OP_BACKREF_MULTI_IC, "backref_multi-ic", ARG_SPECIAL}, + {OP_BACKREF_WITH_LEVEL, "backref_at_level", ARG_SPECIAL}, + {OP_MEMORY_START_PUSH, "mem-start-push", ARG_MEMNUM}, + {OP_MEMORY_START, "mem-start", ARG_MEMNUM}, + {OP_MEMORY_END_PUSH, "mem-end-push", ARG_MEMNUM}, + {OP_MEMORY_END_PUSH_REC, "mem-end-push-rec", ARG_MEMNUM}, + {OP_MEMORY_END, "mem-end", ARG_MEMNUM}, + {OP_MEMORY_END_REC, "mem-end-rec", ARG_MEMNUM}, + {OP_SET_OPTION_PUSH, "set-option-push", ARG_OPTION}, + {OP_SET_OPTION, "set-option", ARG_OPTION}, + {OP_KEEP, "keep", ARG_NON}, + {OP_FAIL, "fail", ARG_NON}, + {OP_JUMP, "jump", ARG_RELADDR}, + {OP_PUSH, "push", ARG_RELADDR}, + {OP_POP, "pop", ARG_NON}, + {OP_PUSH_OR_JUMP_EXACT1, "push-or-jump-e1", ARG_SPECIAL}, + {OP_PUSH_IF_PEEK_NEXT, "push-if-peek-next", ARG_SPECIAL}, + {OP_REPEAT, "repeat", ARG_SPECIAL}, + {OP_REPEAT_NG, "repeat-ng", ARG_SPECIAL}, + {OP_REPEAT_INC, "repeat-inc", ARG_MEMNUM}, + {OP_REPEAT_INC_NG, "repeat-inc-ng", ARG_MEMNUM}, + {OP_REPEAT_INC_SG, "repeat-inc-sg", ARG_MEMNUM}, + {OP_REPEAT_INC_NG_SG, "repeat-inc-ng-sg", ARG_MEMNUM}, + {OP_NULL_CHECK_START, "null-check-start", ARG_MEMNUM}, + {OP_NULL_CHECK_END, "null-check-end", ARG_MEMNUM}, + {OP_NULL_CHECK_END_MEMST, "null-check-end-memst", ARG_MEMNUM}, + {OP_NULL_CHECK_END_MEMST_PUSH, "null-check-end-memst-push", ARG_MEMNUM}, + {OP_PUSH_POS, "push-pos", ARG_NON}, + {OP_POP_POS, "pop-pos", ARG_NON}, + {OP_PUSH_POS_NOT, "push-pos-not", ARG_RELADDR}, + {OP_FAIL_POS, "fail-pos", ARG_NON}, + {OP_PUSH_STOP_BT, "push-stop-bt", ARG_NON}, + {OP_POP_STOP_BT, "pop-stop-bt", ARG_NON}, + {OP_LOOK_BEHIND, "look-behind", ARG_SPECIAL}, + {OP_PUSH_LOOK_BEHIND_NOT, "push-look-behind-not", ARG_SPECIAL}, + {OP_FAIL_LOOK_BEHIND_NOT, "fail-look-behind-not", ARG_NON}, + {OP_PUSH_ABSENT_POS, "push-absent-pos", ARG_NON}, + {OP_ABSENT, "absent", ARG_RELADDR}, + {OP_ABSENT_END, "absent-end", ARG_NON}, + {OP_CALL, "call", ARG_ABSADDR}, + {OP_RETURN, "return", ARG_NON}, + {OP_CONDITION, "condition", ARG_SPECIAL}, + {OP_STATE_CHECK_PUSH, "state-check-push", ARG_SPECIAL}, + {OP_STATE_CHECK_PUSH_OR_JUMP, "state-check-push-or-jump", ARG_SPECIAL}, + {OP_STATE_CHECK, "state-check", ARG_STATE_CHECK}, + {OP_STATE_CHECK_ANYCHAR_STAR, "state-check-anychar*", ARG_STATE_CHECK}, + {OP_STATE_CHECK_ANYCHAR_ML_STAR, "state-check-anychar-ml*", + ARG_STATE_CHECK}, + {-1, "", ARG_NON}}; + +static const char *op2name(int opcode) +{ + int i; + + for (i = 0; OnigOpInfo[i].opcode >= 0; i++) + { + if (opcode == OnigOpInfo[i].opcode) + return OnigOpInfo[i].name; + } + return ""; +} + +static int op2arg_type(int opcode) +{ + int i; + + for (i = 0; OnigOpInfo[i].opcode >= 0; i++) + { + if (opcode == OnigOpInfo[i].opcode) + return OnigOpInfo[i].arg_type; + } + return ARG_SPECIAL; +} + +# ifdef ONIG_DEBUG_PARSE_TREE +static void Indent(FILE *f, int indent) +{ + int i; + for (i = 0; i < indent; i++) + putc(' ', f); +} +# endif /* ONIG_DEBUG_PARSE_TREE */ + +static void p_string(FILE *f, ptrdiff_t len, UChar *s) +{ + fputs(":", f); + while (len-- > 0) + { + fputc(*s++, f); + } +} + +static void p_len_string(FILE *f, LengthType len, int mb_len, UChar *s) +{ + int x = len * mb_len; + + fprintf(f, ":%d:", len); + while (x-- > 0) + { + fputc(*s++, f); + } +} + +extern void onig_print_compiled_byte_code(FILE *f, UChar *bp, UChar *bpend, + UChar **nextp, OnigEncoding enc) +{ + int i, n, arg_type; + RelAddrType addr; + LengthType len; + MemNumType mem; + StateCheckNumType scn; + OnigCodePoint code; + UChar *q; + + fprintf(f, "[%s", op2name(*bp)); + arg_type = op2arg_type(*bp); + if (arg_type != ARG_SPECIAL) + { + bp++; + switch (arg_type) + { + case ARG_NON: + break; + case ARG_RELADDR: + GET_RELADDR_INC(addr, bp); + fprintf(f, ":(%s%d)", (addr >= 0) ? "+" : "", addr); + break; + case ARG_ABSADDR: + GET_ABSADDR_INC(addr, bp); + fprintf(f, ":(%d)", addr); + break; + case ARG_LENGTH: + GET_LENGTH_INC(len, bp); + fprintf(f, ":%d", len); + break; + case ARG_MEMNUM: + mem = *((MemNumType *)bp); + bp += SIZE_MEMNUM; + fprintf(f, ":%d", mem); + break; + case ARG_OPTION: { + OnigOptionType option = *((OnigOptionType *)bp); + bp += SIZE_OPTION; + fprintf(f, ":%d", option); + } + break; + + case ARG_STATE_CHECK: + scn = *((StateCheckNumType *)bp); + bp += SIZE_STATE_CHECK_NUM; + fprintf(f, ":%d", scn); + break; + } + } + else + { + switch (*bp++) + { + case OP_EXACT1: + case OP_ANYCHAR_STAR_PEEK_NEXT: + case OP_ANYCHAR_ML_STAR_PEEK_NEXT: + p_string(f, 1, bp++); + break; + case OP_EXACT2: + p_string(f, 2, bp); + bp += 2; + break; + case OP_EXACT3: + p_string(f, 3, bp); + bp += 3; + break; + case OP_EXACT4: + p_string(f, 4, bp); + bp += 4; + break; + case OP_EXACT5: + p_string(f, 5, bp); + bp += 5; + break; + case OP_EXACTN: + GET_LENGTH_INC(len, bp); + p_len_string(f, len, 1, bp); + bp += len; + break; + + case OP_EXACTMB2N1: + p_string(f, 2, bp); + bp += 2; + break; + case OP_EXACTMB2N2: + p_string(f, 4, bp); + bp += 4; + break; + case OP_EXACTMB2N3: + p_string(f, 6, bp); + bp += 6; + break; + case OP_EXACTMB2N: + GET_LENGTH_INC(len, bp); + p_len_string(f, len, 2, bp); + bp += len * 2; + break; + case OP_EXACTMB3N: + GET_LENGTH_INC(len, bp); + p_len_string(f, len, 3, bp); + bp += len * 3; + break; + case OP_EXACTMBN: { + int mb_len; + + GET_LENGTH_INC(mb_len, bp); + GET_LENGTH_INC(len, bp); + fprintf(f, ":%d:%d:", mb_len, len); + n = len * mb_len; + while (n-- > 0) + { + fputc(*bp++, f); + } + } + break; + + case OP_EXACT1_IC: + len = enclen(enc, bp, bpend); + p_string(f, len, bp); + bp += len; + break; + case OP_EXACTN_IC: + GET_LENGTH_INC(len, bp); + p_len_string(f, len, 1, bp); + bp += len; + break; + + case OP_CCLASS: + n = bitset_on_num((BitSetRef)bp); + bp += SIZE_BITSET; + fprintf(f, ":%d", n); + break; + + case OP_CCLASS_NOT: + n = bitset_on_num((BitSetRef)bp); + bp += SIZE_BITSET; + fprintf(f, ":%d", n); + break; + + case OP_CCLASS_MB: + case OP_CCLASS_MB_NOT: + GET_LENGTH_INC(len, bp); + q = bp; +# ifndef PLATFORM_UNALIGNED_WORD_ACCESS + ALIGNMENT_RIGHT(q); +# endif + GET_CODE_POINT(code, q); + bp += len; + fprintf(f, ":%d:%d", (int)code, len); + break; + + case OP_CCLASS_MIX: + case OP_CCLASS_MIX_NOT: + n = bitset_on_num((BitSetRef)bp); + bp += SIZE_BITSET; + GET_LENGTH_INC(len, bp); + q = bp; +# ifndef PLATFORM_UNALIGNED_WORD_ACCESS + ALIGNMENT_RIGHT(q); +# endif + GET_CODE_POINT(code, q); + bp += len; + fprintf(f, ":%d:%d:%d", n, (int)code, len); + break; + + case OP_BACKREFN_IC: + mem = *((MemNumType *)bp); + bp += SIZE_MEMNUM; + fprintf(f, ":%d", mem); + break; + + case OP_BACKREF_MULTI_IC: + case OP_BACKREF_MULTI: + fputs(" ", f); + GET_LENGTH_INC(len, bp); + for (i = 0; i < len; i++) + { + GET_MEMNUM_INC(mem, bp); + if (i > 0) + fputs(", ", f); + fprintf(f, "%d", mem); + } + break; + + case OP_BACKREF_WITH_LEVEL: { + OnigOptionType option; + LengthType level; + + GET_OPTION_INC(option, bp); + fprintf(f, ":%d", option); + GET_LENGTH_INC(level, bp); + fprintf(f, ":%d", level); + + fputs(" ", f); + GET_LENGTH_INC(len, bp); + for (i = 0; i < len; i++) + { + GET_MEMNUM_INC(mem, bp); + if (i > 0) + fputs(", ", f); + fprintf(f, "%d", mem); + } + } + break; + + case OP_REPEAT: + case OP_REPEAT_NG: { + mem = *((MemNumType *)bp); + bp += SIZE_MEMNUM; + addr = *((RelAddrType *)bp); + bp += SIZE_RELADDR; + fprintf(f, ":%d:%d", mem, addr); + } + break; + + case OP_PUSH_OR_JUMP_EXACT1: + case OP_PUSH_IF_PEEK_NEXT: + addr = *((RelAddrType *)bp); + bp += SIZE_RELADDR; + fprintf(f, ":(%s%d)", (addr >= 0) ? "+" : "", addr); + p_string(f, 1, bp); + bp += 1; + break; + + case OP_LOOK_BEHIND: + GET_LENGTH_INC(len, bp); + fprintf(f, ":%d", len); + break; + + case OP_PUSH_LOOK_BEHIND_NOT: + GET_RELADDR_INC(addr, bp); + GET_LENGTH_INC(len, bp); + fprintf(f, ":%d:(%s%d)", len, (addr >= 0) ? "+" : "", addr); + break; + + case OP_STATE_CHECK_PUSH: + case OP_STATE_CHECK_PUSH_OR_JUMP: + scn = *((StateCheckNumType *)bp); + bp += SIZE_STATE_CHECK_NUM; + addr = *((RelAddrType *)bp); + bp += SIZE_RELADDR; + fprintf(f, ":%d:(%s%d)", scn, (addr >= 0) ? "+" : "", addr); + break; + + case OP_CONDITION: + GET_MEMNUM_INC(mem, bp); + GET_RELADDR_INC(addr, bp); + fprintf(f, ":%d:(%s%d)", mem, (addr >= 0) ? "+" : "", addr); + break; + + default: + fprintf(stderr, "onig_print_compiled_byte_code: undefined code %d\n", + bp[-1]); + } + } + fputs("]", f); + if (nextp) + *nextp = bp; +} + +# ifdef ONIG_DEBUG_COMPILE +static void print_compiled_byte_code_list(FILE *f, regex_t *reg) +{ + int ncode; + UChar *bp = reg->p; + UChar *end = reg->p + reg->used; + + fprintf(f, "code length: %d", reg->used); + + ncode = -1; + while (bp < end) + { + ncode++; + if (ncode % 5 == 0) + fprintf(f, "\n%ld:", bp - reg->p); + else + fprintf(f, " %ld:", bp - reg->p); + onig_print_compiled_byte_code(f, bp, end, &bp, reg->enc); + } + + fprintf(f, "\n"); +} +# endif /* ONIG_DEBUG_COMPILE */ + +# ifdef ONIG_DEBUG_PARSE_TREE +static void print_indent_tree(FILE *f, Node *node, int indent) +{ + int i, type, container_p = 0; + int add = 3; + UChar *p; + + Indent(f, indent); + if (IS_NULL(node)) + { + fprintf(f, "ERROR: null node!!!\n"); + exit(0); + } + + type = NTYPE(node); + switch (type) + { + case NT_LIST: + case NT_ALT: + if (NTYPE(node) == NT_LIST) + fprintf(f, "<list:%" PRIxPTR ">\n", (intptr_t)node); + else + fprintf(f, "<alt:%" PRIxPTR ">\n", (intptr_t)node); + + print_indent_tree(f, NCAR(node), indent + add); + while (IS_NOT_NULL(node = NCDR(node))) + { + if (NTYPE(node) != type) + { + fprintf(f, "ERROR: list/alt right is not a cons. %d\n", NTYPE(node)); + exit(0); + } + print_indent_tree(f, NCAR(node), indent + add); + } + break; + + case NT_STR: + fprintf(f, "<string%s:%" PRIxPTR ">", + (NSTRING_IS_RAW(node) ? "-raw" : ""), (intptr_t)node); + for (p = NSTR(node)->s; p < NSTR(node)->end; p++) + { + if (*p >= 0x20 && *p < 0x7f) + fputc(*p, f); + else + { + fprintf(f, " 0x%02x", *p); + } + } + break; + + case NT_CCLASS: + fprintf(f, "<cclass:%" PRIxPTR ">", (intptr_t)node); + if (IS_NCCLASS_NOT(NCCLASS(node))) + fputs("not ", f); + if (NCCLASS(node)->mbuf) + { + BBuf *bbuf = NCCLASS(node)->mbuf; + OnigCodePoint *data = (OnigCodePoint *)bbuf->p; + OnigCodePoint *end = (OnigCodePoint *)(bbuf->p + bbuf->used); + fprintf(f, "%d", *data++); + for (; data < end; data += 2) + { + fprintf(f, ","); + fprintf(f, "%04x-%04x", data[0], data[1]); + } + } + break; + + case NT_CTYPE: + fprintf(f, "<ctype:%" PRIxPTR "> ", (intptr_t)node); + switch (NCTYPE(node)->ctype) + { + case ONIGENC_CTYPE_WORD: + if (NCTYPE(node)->not!= 0) + fputs("not word", f); + else + fputs("word", f); + break; + + default: + fprintf(f, "ERROR: undefined ctype.\n"); + exit(0); + } + break; + + case NT_CANY: + fprintf(f, "<anychar:%" PRIxPTR ">", (intptr_t)node); + break; + + case NT_ANCHOR: + fprintf(f, "<anchor:%" PRIxPTR "> ", (intptr_t)node); + switch (NANCHOR(node)->type) + { + case ANCHOR_BEGIN_BUF: + fputs("begin buf", f); + break; + case ANCHOR_END_BUF: + fputs("end buf", f); + break; + case ANCHOR_BEGIN_LINE: + fputs("begin line", f); + break; + case ANCHOR_END_LINE: + fputs("end line", f); + break; + case ANCHOR_SEMI_END_BUF: + fputs("semi end buf", f); + break; + case ANCHOR_BEGIN_POSITION: + fputs("begin position", f); + break; + + case ANCHOR_WORD_BOUND: + fputs("word bound", f); + break; + case ANCHOR_NOT_WORD_BOUND: + fputs("not word bound", f); + break; +# ifdef USE_WORD_BEGIN_END + case ANCHOR_WORD_BEGIN: + fputs("word begin", f); + break; + case ANCHOR_WORD_END: + fputs("word end", f); + break; +# endif + case ANCHOR_PREC_READ: + fputs("prec read", f); + container_p = TRUE; + break; + case ANCHOR_PREC_READ_NOT: + fputs("prec read not", f); + container_p = TRUE; + break; + case ANCHOR_LOOK_BEHIND: + fputs("look_behind", f); + container_p = TRUE; + break; + case ANCHOR_LOOK_BEHIND_NOT: + fputs("look_behind_not", f); + container_p = TRUE; + break; + case ANCHOR_KEEP: + fputs("keep", f); + break; + + default: + fprintf(f, "ERROR: undefined anchor type.\n"); + break; + } + break; + + case NT_BREF: { + int *p; + BRefNode *br = NBREF(node); + p = BACKREFS_P(br); + fprintf(f, "<backref:%" PRIxPTR ">", (intptr_t)node); + for (i = 0; i < br->back_num; i++) + { + if (i > 0) + fputs(", ", f); + fprintf(f, "%d", p[i]); + } + } + break; + +# ifdef USE_SUBEXP_CALL + case NT_CALL: { + CallNode *cn = NCALL(node); + fprintf(f, "<call:%" PRIxPTR ">", (intptr_t)node); + p_string(f, cn->name_end - cn->name, cn->name); + } + break; +# endif + + case NT_QTFR: + fprintf(f, "<quantifier:%" PRIxPTR ">{%d,%d}%s\n", (intptr_t)node, + NQTFR(node)->lower, NQTFR(node)->upper, + (NQTFR(node)->greedy ? "" : "?")); + print_indent_tree(f, NQTFR(node)->target, indent + add); + break; + + case NT_ENCLOSE: + fprintf(f, "<enclose:%" PRIxPTR "> ", (intptr_t)node); + switch (NENCLOSE(node)->type) + { + case ENCLOSE_OPTION: + fprintf(f, "option:%d", NENCLOSE(node)->option); + break; + case ENCLOSE_MEMORY: + fprintf(f, "memory:%d", NENCLOSE(node)->regnum); + break; + case ENCLOSE_STOP_BACKTRACK: + fprintf(f, "stop-bt"); + break; + case ENCLOSE_CONDITION: + fprintf(f, "condition:%d", NENCLOSE(node)->regnum); + break; + case ENCLOSE_ABSENT: + fprintf(f, "absent"); + break; + + default: + break; + } + fprintf(f, "\n"); + print_indent_tree(f, NENCLOSE(node)->target, indent + add); + break; + + default: + fprintf(f, "print_indent_tree: undefined node type %d\n", NTYPE(node)); + break; + } + + if (type != NT_LIST && type != NT_ALT && type != NT_QTFR + && type != NT_ENCLOSE) + fprintf(f, "\n"); + + if (container_p) + print_indent_tree(f, NANCHOR(node)->target, indent + add); + + fflush(f); +} + +static void print_tree(FILE *f, Node *node) +{ + print_indent_tree(f, node, 0); +} +# endif /* ONIG_DEBUG_PARSE_TREE */ +#endif /* ONIG_DEBUG */ diff --git a/lib/edbee-lib/vendor/onig/regenc.c b/lib/edbee-lib/vendor/onig/regenc.c new file mode 100644 index 00000000..fbcc014e --- /dev/null +++ b/lib/edbee-lib/vendor/onig/regenc.c @@ -0,0 +1,1045 @@ +/********************************************************************** + regenc.c - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regint.h" + +OnigEncoding OnigEncDefaultCharEncoding = ONIG_ENCODING_INIT_DEFAULT; + +extern int onigenc_init(void) +{ + return 0; +} + +extern OnigEncoding onigenc_get_default_encoding(void) +{ + return OnigEncDefaultCharEncoding; +} + +extern int onigenc_set_default_encoding(OnigEncoding enc) +{ + OnigEncDefaultCharEncoding = enc; + return 0; +} + +extern int onigenc_mbclen_approximate(const OnigUChar *p, const OnigUChar *e, + OnigEncoding enc) +{ + int ret = ONIGENC_PRECISE_MBC_ENC_LEN(enc, p, e); + if (ONIGENC_MBCLEN_CHARFOUND_P(ret)) + return ONIGENC_MBCLEN_CHARFOUND_LEN(ret); + else if (ONIGENC_MBCLEN_NEEDMORE_P(ret)) + return (int)(e - p) + ONIGENC_MBCLEN_NEEDMORE_LEN(ret); + return 1; +} + +extern UChar *onigenc_get_right_adjust_char_head(OnigEncoding enc, + const UChar *start, + const UChar *s, + const UChar *end) +{ + UChar *p = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s, end); + if (p < s) + { + p += enclen(enc, p, end); + } + return p; +} + +extern UChar *onigenc_get_right_adjust_char_head_with_prev(OnigEncoding enc, + const UChar *start, + const UChar *s, + const UChar *end, + const UChar **prev) +{ + UChar *p = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s, end); + + if (p < s) + { + if (prev) + *prev = (const UChar *)p; + p += enclen(enc, p, end); + } + else + { + if (prev) + *prev = (const UChar *)NULL; /* Sorry */ + } + return p; +} + +extern UChar *onigenc_get_prev_char_head(OnigEncoding enc, const UChar *start, + const UChar *s, const UChar *end) +{ + if (s <= start) + return (UChar *)NULL; + + return ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s - 1, end); +} + +extern UChar *onigenc_step_back(OnigEncoding enc, const UChar *start, + const UChar *s, const UChar *end, int n) +{ + while (ONIG_IS_NOT_NULL(s) && n-- > 0) + { + if (s <= start) + return (UChar *)NULL; + + s = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s - 1, end); + } + return (UChar *)s; +} + +extern UChar *onigenc_step(OnigEncoding enc, const UChar *p, const UChar *end, + int n) +{ + UChar *q = (UChar *)p; + while (n-- > 0) + { + q += ONIGENC_MBC_ENC_LEN(enc, q, end); + } + return (q <= end ? q : NULL); +} + +extern int onigenc_strlen(OnigEncoding enc, const UChar *p, const UChar *end) +{ + int n = 0; + UChar *q = (UChar *)p; + + while (q < end) + { + q += ONIGENC_MBC_ENC_LEN(enc, q, end); + n++; + } + return n; +} + +extern int onigenc_strlen_null(OnigEncoding enc, const UChar *s) +{ + int n = 0; + UChar *p = (UChar *)s; + UChar *e; + + while (1) + { + if (*p == '\0') + { + UChar *q; + int len = ONIGENC_MBC_MINLEN(enc); + + if (len == 1) + return n; + q = p + 1; + while (len > 1) + { + if (*q != '\0') + break; + q++; + len--; + } + if (len == 1) + return n; + } + e = p + ONIGENC_MBC_MAXLEN(enc); + p += ONIGENC_MBC_ENC_LEN(enc, p, e); + n++; + } +} + +extern int onigenc_str_bytelen_null(OnigEncoding enc, const UChar *s) +{ + UChar *start = (UChar *)s; + UChar *p = (UChar *)s; + UChar *e; + + while (1) + { + if (*p == '\0') + { + UChar *q; + int len = ONIGENC_MBC_MINLEN(enc); + + if (len == 1) + return (int)(p - start); + q = p + 1; + while (len > 1) + { + if (*q != '\0') + break; + q++; + len--; + } + if (len == 1) + return (int)(p - start); + } + e = p + ONIGENC_MBC_MAXLEN(enc); + p += ONIGENC_MBC_ENC_LEN(enc, p, e); + } +} + +const UChar OnigEncAsciiToLowerCaseTable[] = { + '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\241', + '\242', '\243', '\244', '\245', '\246', '\247', '\250', '\251', '\252', + '\253', '\254', '\255', '\256', '\257', '\260', '\261', '\262', '\263', + '\264', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\274', + '\275', '\276', '\277', '\300', '\301', '\302', '\303', '\304', '\305', + '\306', '\307', '\310', '\311', '\312', '\313', '\314', '\315', '\316', + '\317', '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327', + '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337', '\340', + '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', + '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', + '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', + '\374', '\375', '\376', '\377', +}; + +#ifdef USE_UPPER_CASE_TABLE +const UChar OnigEncAsciiToUpperCaseTable[256] = { + '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\101', '\102', '\103', '\104', '\105', '\106', '\107', + '\110', '\111', '\112', '\113', '\114', '\115', '\116', '\117', '\120', + '\121', '\122', '\123', '\124', '\125', '\126', '\127', '\130', '\131', + '\132', '\133', '\134', '\135', '\136', '\137', '\140', '\101', '\102', + '\103', '\104', '\105', '\106', '\107', '\110', '\111', '\112', '\113', + '\114', '\115', '\116', '\117', '\120', '\121', '\122', '\123', '\124', + '\125', '\126', '\127', '\130', '\131', '\132', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\241', + '\242', '\243', '\244', '\245', '\246', '\247', '\250', '\251', '\252', + '\253', '\254', '\255', '\256', '\257', '\260', '\261', '\262', '\263', + '\264', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\274', + '\275', '\276', '\277', '\300', '\301', '\302', '\303', '\304', '\305', + '\306', '\307', '\310', '\311', '\312', '\313', '\314', '\315', '\316', + '\317', '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327', + '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337', '\340', + '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', + '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', + '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', + '\374', '\375', '\376', '\377', +}; +#endif + +const unsigned short OnigEncAsciiCtypeTable[256] + = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, + 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, + 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, + 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, + 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, + 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, + 0x41a0, 0x4008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000}; + +const UChar OnigEncISO_8859_1_ToLowerCaseTable[256] + = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', + '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', + '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', + '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', + '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', + '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\241', + '\242', '\243', '\244', '\245', '\246', '\247', '\250', '\251', '\252', + '\253', '\254', '\255', '\256', '\257', '\260', '\261', '\262', '\263', + '\264', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\274', + '\275', '\276', '\277', '\340', '\341', '\342', '\343', '\344', '\345', + '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', + '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327', + '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', '\340', + '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', + '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', + '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', + '\374', '\375', '\376', '\377'}; + +#ifdef USE_UPPER_CASE_TABLE +const UChar OnigEncISO_8859_1_ToUpperCaseTable[256] = { + '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', + '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', + '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', + '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', + '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', + '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', + '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', + '\077', '\100', '\101', '\102', '\103', '\104', '\105', '\106', '\107', + '\110', '\111', '\112', '\113', '\114', '\115', '\116', '\117', '\120', + '\121', '\122', '\123', '\124', '\125', '\126', '\127', '\130', '\131', + '\132', '\133', '\134', '\135', '\136', '\137', '\140', '\101', '\102', + '\103', '\104', '\105', '\106', '\107', '\110', '\111', '\112', '\113', + '\114', '\115', '\116', '\117', '\120', '\121', '\122', '\123', '\124', + '\125', '\126', '\127', '\130', '\131', '\132', '\173', '\174', '\175', + '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', + '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', + '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\241', + '\242', '\243', '\244', '\245', '\246', '\247', '\250', '\251', '\252', + '\253', '\254', '\255', '\256', '\257', '\260', '\261', '\262', '\263', + '\264', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\274', + '\275', '\276', '\277', '\300', '\301', '\302', '\303', '\304', '\305', + '\306', '\307', '\310', '\311', '\312', '\313', '\314', '\315', '\316', + '\317', '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327', + '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337', '\300', + '\301', '\302', '\303', '\304', '\305', '\306', '\307', '\310', '\311', + '\312', '\313', '\314', '\315', '\316', '\317', '\320', '\321', '\322', + '\323', '\324', '\325', '\326', '\367', '\330', '\331', '\332', '\333', + '\334', '\335', '\336', '\377', +}; +#endif + +#if 0 +extern void +onigenc_set_default_caseconv_table(const UChar* table ARG_UNUSED) +{ + /* nothing */ + /* obsoleted. */ +} +#endif + +extern UChar *onigenc_get_left_adjust_char_head(OnigEncoding enc, + const UChar *start, + const UChar *s, + const UChar *end) +{ + return ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s, end); +} + +const OnigPairCaseFoldCodes OnigAsciiLowerMap[] + = {{0x41, 0x61}, {0x42, 0x62}, {0x43, 0x63}, {0x44, 0x64}, {0x45, 0x65}, + {0x46, 0x66}, {0x47, 0x67}, {0x48, 0x68}, {0x49, 0x69}, {0x4a, 0x6a}, + {0x4b, 0x6b}, {0x4c, 0x6c}, {0x4d, 0x6d}, {0x4e, 0x6e}, {0x4f, 0x6f}, + {0x50, 0x70}, {0x51, 0x71}, {0x52, 0x72}, {0x53, 0x73}, {0x54, 0x74}, + {0x55, 0x75}, {0x56, 0x76}, {0x57, 0x77}, {0x58, 0x78}, {0x59, 0x79}, + {0x5a, 0x7a}}; + +extern int onigenc_ascii_apply_all_case_fold(OnigCaseFoldType flag ARG_UNUSED, + OnigApplyAllCaseFoldFunc f, + void *arg, + OnigEncoding enc ARG_UNUSED) +{ + OnigCodePoint code; + int i, r; + + for (i = 0; i < numberof(OnigAsciiLowerMap); i++) + { + code = OnigAsciiLowerMap[i].to; + r = (*f)(OnigAsciiLowerMap[i].from, &code, 1, arg); + if (r != 0) + return r; + + code = OnigAsciiLowerMap[i].from; + r = (*f)(OnigAsciiLowerMap[i].to, &code, 1, arg); + if (r != 0) + return r; + } + + return 0; +} + +extern int onigenc_ascii_get_case_fold_codes_by_str( + OnigCaseFoldType flag ARG_UNUSED, const OnigUChar *p, + const OnigUChar *end ARG_UNUSED, OnigCaseFoldCodeItem items[], + OnigEncoding enc ARG_UNUSED) +{ + if (0x41 <= *p && *p <= 0x5a) + { + items[0].byte_len = 1; + items[0].code_len = 1; + items[0].code[0] = (OnigCodePoint)(*p + 0x20); + return 1; + } + else if (0x61 <= *p && *p <= 0x7a) + { + items[0].byte_len = 1; + items[0].code_len = 1; + items[0].code[0] = (OnigCodePoint)(*p - 0x20); + return 1; + } + else + return 0; +} + +static int ss_apply_all_case_fold(OnigCaseFoldType flag ARG_UNUSED, + OnigApplyAllCaseFoldFunc f, void *arg) +{ + OnigCodePoint ss[] = {0x73, 0x73}; + + return (*f)((OnigCodePoint)0xdf, ss, 2, arg); +} + +extern int onigenc_apply_all_case_fold_with_map( + int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, + OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void *arg) +{ + OnigCodePoint code; + int i, r; + + r = onigenc_ascii_apply_all_case_fold(flag, f, arg, 0); + if (r != 0) + return r; + + for (i = 0; i < map_size; i++) + { + code = map[i].to; + r = (*f)(map[i].from, &code, 1, arg); + if (r != 0) + return r; + + code = map[i].from; + r = (*f)(map[i].to, &code, 1, arg); + if (r != 0) + return r; + } + + if (ess_tsett_flag != 0) + return ss_apply_all_case_fold(flag, f, arg); + + return 0; +} + +extern int onigenc_get_case_fold_codes_by_str_with_map( + int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, + OnigCaseFoldType flag ARG_UNUSED, const OnigUChar *p, const OnigUChar *end, + OnigCaseFoldCodeItem items[]) +{ + if (0x41 <= *p && *p <= 0x5a) + { + items[0].byte_len = 1; + items[0].code_len = 1; + items[0].code[0] = (OnigCodePoint)(*p + 0x20); + if (*p == 0x53 && ess_tsett_flag != 0 && end > p + 1 + && (*(p + 1) == 0x53 || *(p + 1) == 0x73)) + { + /* SS */ + items[1].byte_len = 2; + items[1].code_len = 1; + items[1].code[0] = (OnigCodePoint)0xdf; + return 2; + } + else + return 1; + } + else if (0x61 <= *p && *p <= 0x7a) + { + items[0].byte_len = 1; + items[0].code_len = 1; + items[0].code[0] = (OnigCodePoint)(*p - 0x20); + if (*p == 0x73 && ess_tsett_flag != 0 && end > p + 1 + && (*(p + 1) == 0x73 || *(p + 1) == 0x53)) + { + /* ss */ + items[1].byte_len = 2; + items[1].code_len = 1; + items[1].code[0] = (OnigCodePoint)0xdf; + return 2; + } + else + return 1; + } + else if (*p == 0xdf && ess_tsett_flag != 0) + { + items[0].byte_len = 1; + items[0].code_len = 2; + items[0].code[0] = (OnigCodePoint)'s'; + items[0].code[1] = (OnigCodePoint)'s'; + + items[1].byte_len = 1; + items[1].code_len = 2; + items[1].code[0] = (OnigCodePoint)'S'; + items[1].code[1] = (OnigCodePoint)'S'; + + items[2].byte_len = 1; + items[2].code_len = 2; + items[2].code[0] = (OnigCodePoint)'s'; + items[2].code[1] = (OnigCodePoint)'S'; + + items[3].byte_len = 1; + items[3].code_len = 2; + items[3].code[0] = (OnigCodePoint)'S'; + items[3].code[1] = (OnigCodePoint)'s'; + + return 4; + } + else + { + int i; + + for (i = 0; i < map_size; i++) + { + if (*p == map[i].from) + { + items[0].byte_len = 1; + items[0].code_len = 1; + items[0].code[0] = map[i].to; + return 1; + } + else if (*p == map[i].to) + { + items[0].byte_len = 1; + items[0].code_len = 1; + items[0].code[0] = map[i].from; + return 1; + } + } + } + + return 0; +} + +extern int onigenc_not_support_get_ctype_code_range( + OnigCtype ctype ARG_UNUSED, OnigCodePoint *sb_out ARG_UNUSED, + const OnigCodePoint *ranges[] ARG_UNUSED, OnigEncoding enc) +{ + return ONIG_NO_SUPPORT_CONFIG; +} + +extern int onigenc_is_mbc_newline_0x0a(const UChar *p, const UChar *end, + OnigEncoding enc ARG_UNUSED) +{ + if (p < end) + { + if (*p == 0x0a) + return 1; + } + return 0; +} + +/* for single byte encodings */ +extern int onigenc_ascii_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED, + const UChar **p, const UChar *end, + UChar *lower, + OnigEncoding enc ARG_UNUSED) +{ + *lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(**p); + + (*p)++; + return 1; /* return byte length of converted char to lower */ +} + +#if 0 +extern int +onigenc_ascii_is_mbc_ambiguous(OnigCaseFoldType flag ARG_UNUSED, + const UChar** pp, const UChar* end ARG_UNUSED) +{ + const UChar* p = *pp; + + (*pp)++; + return ONIGENC_IS_ASCII_CODE_CASE_AMBIG(*p); +} +#endif + +extern int onigenc_single_byte_mbc_enc_len(const UChar *p ARG_UNUSED, + const UChar *e ARG_UNUSED, + OnigEncoding enc ARG_UNUSED) +{ + return 1; +} + +extern OnigCodePoint +onigenc_single_byte_mbc_to_code(const UChar *p, const UChar *end ARG_UNUSED, + OnigEncoding enc ARG_UNUSED) +{ + return (OnigCodePoint)(*p); +} + +extern int onigenc_single_byte_code_to_mbclen(OnigCodePoint code ARG_UNUSED, + OnigEncoding enc ARG_UNUSED) +{ + return 1; +} + +extern int onigenc_single_byte_code_to_mbc(OnigCodePoint code, UChar *buf, + OnigEncoding enc ARG_UNUSED) +{ +#ifdef RUBY + if (code > 0xff) + rb_raise(rb_eRangeError, "%u out of char range", code); +#endif + *buf = (UChar)(code & 0xff); + return 1; +} + +extern UChar *onigenc_single_byte_left_adjust_char_head( + const UChar *start ARG_UNUSED, const UChar *s, const UChar *end ARG_UNUSED, + OnigEncoding enc ARG_UNUSED) +{ + return (UChar *)s; +} + +extern int +onigenc_always_true_is_allowed_reverse_match(const UChar *s ARG_UNUSED, + const UChar *end ARG_UNUSED, + OnigEncoding enc ARG_UNUSED) +{ + return TRUE; +} + +extern int +onigenc_always_false_is_allowed_reverse_match(const UChar *s ARG_UNUSED, + const UChar *end ARG_UNUSED, + OnigEncoding enc ARG_UNUSED) +{ + return FALSE; +} + +extern int onigenc_ascii_is_code_ctype(OnigCodePoint code, unsigned int ctype, + OnigEncoding enc ARG_UNUSED) +{ + if (code < 128) + return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype); + else + return FALSE; +} + +extern OnigCodePoint onigenc_mbn_mbc_to_code(OnigEncoding enc, const UChar *p, + const UChar *end) +{ + int c, i, len; + OnigCodePoint n; + + len = enclen(enc, p, end); + n = (OnigCodePoint)(*p++); + if (len == 1) + return n; + + for (i = 1; i < len; i++) + { + if (p >= end) + break; + c = *p++; + n <<= 8; + n += c; + } + return n; +} + +extern int onigenc_mbn_mbc_case_fold(OnigEncoding enc, + OnigCaseFoldType flag ARG_UNUSED, + const UChar **pp, + const UChar *end ARG_UNUSED, UChar *lower) +{ + int len; + const UChar *p = *pp; + + if (ONIGENC_IS_MBC_ASCII(p)) + { + *lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p); + (*pp)++; + return 1; + } + else + { + int i; + + len = enclen(enc, p, end); + for (i = 0; i < len; i++) + { + *lower++ = *p++; + } + (*pp) += len; + return len; /* return byte length of converted to lower char */ + } +} + +#if 0 +extern int +onigenc_mbn_is_mbc_ambiguous(OnigEncoding enc, OnigCaseFoldType flag, + const UChar** pp, const UChar* end ARG_UNUSED) +{ + const UChar* p = *pp; + + if (ONIGENC_IS_MBC_ASCII(p)) { + (*pp)++; + return ONIGENC_IS_ASCII_CODE_CASE_AMBIG(*p); + } + + (*pp) += enclen(enc, p); + return FALSE; +} +#endif + +extern int onigenc_mb2_code_to_mbclen(OnigCodePoint code, + OnigEncoding enc ARG_UNUSED) +{ + if (code <= 0xff) + return 1; + if (code <= 0xffff) + return 2; + return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE; +} + +extern int onigenc_mb4_code_to_mbclen(OnigCodePoint code, + OnigEncoding enc ARG_UNUSED) +{ + if ((code & 0xff000000) != 0) + return 4; + else if ((code & 0xff0000) != 0) + return 3; + else if ((code & 0xff00) != 0) + return 2; + else + return 1; +} + +extern int onigenc_mb2_code_to_mbc(OnigEncoding enc, OnigCodePoint code, + UChar *buf) +{ + UChar *p = buf; + + if ((code & 0xff00) != 0) + { + *p++ = (UChar)((code >> 8) & 0xff); + } + *p++ = (UChar)(code & 0xff); + +#if 1 + if (enclen(enc, buf, p) != (p - buf)) + return ONIGERR_INVALID_CODE_POINT_VALUE; +#endif + return (int)(p - buf); +} + +extern int onigenc_mb4_code_to_mbc(OnigEncoding enc, OnigCodePoint code, + UChar *buf) +{ + UChar *p = buf; + + if ((code & 0xff000000) != 0) + { + *p++ = (UChar)((code >> 24) & 0xff); + } + if ((code & 0xff0000) != 0 || p != buf) + { + *p++ = (UChar)((code >> 16) & 0xff); + } + if ((code & 0xff00) != 0 || p != buf) + { + *p++ = (UChar)((code >> 8) & 0xff); + } + *p++ = (UChar)(code & 0xff); + +#if 1 + if (enclen(enc, buf, p) != (p - buf)) + return ONIGERR_INVALID_CODE_POINT_VALUE; +#endif + return (int)(p - buf); +} + +extern int onigenc_minimum_property_name_to_ctype(OnigEncoding enc, + const UChar *p, + const UChar *end) +{ + static const PosixBracketEntryType PBS[] = { + POSIX_BRACKET_ENTRY_INIT("Alnum", ONIGENC_CTYPE_ALNUM), + POSIX_BRACKET_ENTRY_INIT("Alpha", ONIGENC_CTYPE_ALPHA), + POSIX_BRACKET_ENTRY_INIT("Blank", ONIGENC_CTYPE_BLANK), + POSIX_BRACKET_ENTRY_INIT("Cntrl", ONIGENC_CTYPE_CNTRL), + POSIX_BRACKET_ENTRY_INIT("Digit", ONIGENC_CTYPE_DIGIT), + POSIX_BRACKET_ENTRY_INIT("Graph", ONIGENC_CTYPE_GRAPH), + POSIX_BRACKET_ENTRY_INIT("Lower", ONIGENC_CTYPE_LOWER), + POSIX_BRACKET_ENTRY_INIT("Print", ONIGENC_CTYPE_PRINT), + POSIX_BRACKET_ENTRY_INIT("Punct", ONIGENC_CTYPE_PUNCT), + POSIX_BRACKET_ENTRY_INIT("Space", ONIGENC_CTYPE_SPACE), + POSIX_BRACKET_ENTRY_INIT("Upper", ONIGENC_CTYPE_UPPER), + POSIX_BRACKET_ENTRY_INIT("XDigit", ONIGENC_CTYPE_XDIGIT), + POSIX_BRACKET_ENTRY_INIT("ASCII", ONIGENC_CTYPE_ASCII), + POSIX_BRACKET_ENTRY_INIT("Word", ONIGENC_CTYPE_WORD), + }; + + const PosixBracketEntryType *pb; + int len; + + len = onigenc_strlen(enc, p, end); + for (pb = PBS; pb < PBS + numberof(PBS); pb++) + { + if (len == pb->len + && onigenc_with_ascii_strnicmp(enc, p, end, pb->name, pb->len) == 0) + return pb->ctype; + } + + return ONIGERR_INVALID_CHAR_PROPERTY_NAME; +} + +extern int onigenc_mb2_is_code_ctype(OnigEncoding enc, OnigCodePoint code, + unsigned int ctype) +{ + if (code < 128) + return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype); + else + { + if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) + { + return (ONIGENC_CODE_TO_MBCLEN(enc, code) > 1 ? TRUE : FALSE); + } + } + + return FALSE; +} + +extern int onigenc_mb4_is_code_ctype(OnigEncoding enc, OnigCodePoint code, + unsigned int ctype) +{ + if (code < 128) + return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype); + else + { + if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) + { + return (ONIGENC_CODE_TO_MBCLEN(enc, code) > 1 ? TRUE : FALSE); + } + } + + return FALSE; +} + +extern int onigenc_with_ascii_strncmp(OnigEncoding enc, const UChar *p, + const UChar *end, + const UChar *sascii /* ascii */, int n) +{ + int x, c; + + while (n-- > 0) + { + if (p >= end) + return (int)(*sascii); + + c = (int)ONIGENC_MBC_TO_CODE(enc, p, end); + x = *sascii - c; + if (x) + return x; + + sascii++; + p += enclen(enc, p, end); + } + return 0; +} + +extern int onigenc_with_ascii_strnicmp(OnigEncoding enc, const UChar *p, + const UChar *end, + const UChar *sascii /* ascii */, int n) +{ + int x, c; + + while (n-- > 0) + { + if (p >= end) + return (int)(*sascii); + + c = (int)ONIGENC_MBC_TO_CODE(enc, p, end); + if (ONIGENC_IS_ASCII_CODE(c)) + c = ONIGENC_ASCII_CODE_TO_LOWER_CASE(c); + x = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*sascii) - c; + if (x) + return x; + + sascii++; + p += enclen(enc, p, end); + } + return 0; +} + +#if 0 +/* Property management */ +static int +resize_property_list(int new_size, const OnigCodePoint*** plist, int* psize) +{ + size_t size; + const OnigCodePoint **list = *plist; + + size = sizeof(OnigCodePoint*) * new_size; + if (IS_NULL(list)) { + list = (const OnigCodePoint** )xmalloc(size); + if (IS_NULL(list)) return ONIGERR_MEMORY; + } + else { + const OnigCodePoint **tmp; + tmp = (const OnigCodePoint** )xrealloc((void* )list, size); + if (IS_NULL(tmp)) return ONIGERR_MEMORY; + list = tmp; + } + + *plist = list; + *psize = new_size; + + return 0; +} + +extern int +onigenc_property_list_add_property(UChar* name, const OnigCodePoint* prop, + hash_table_type **table, const OnigCodePoint*** plist, int *pnum, + int *psize) +{ +# define PROP_INIT_SIZE 16 + + int r; + + if (*psize <= *pnum) { + int new_size = (*psize == 0 ? PROP_INIT_SIZE : *psize * 2); + r = resize_property_list(new_size, plist, psize); + if (r != 0) return r; + } + + (*plist)[*pnum] = prop; + + if (ONIG_IS_NULL(*table)) { + *table = onig_st_init_strend_table_with_size(PROP_INIT_SIZE); + if (ONIG_IS_NULL(*table)) return ONIGERR_MEMORY; + } + + *pnum = *pnum + 1; + onig_st_insert_strend(*table, name, name + strlen((char* )name), + (hash_data_type )(*pnum + ONIGENC_MAX_STD_CTYPE)); + return 0; +} +#endif + +extern int onigenc_ascii_only_case_map(OnigCaseFoldType *flagP, + const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, + OnigUChar *to_end, + const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + int codepoint_length; + + while (*pp < end && to < to_end) + { + codepoint_length = ONIGENC_PRECISE_MBC_ENC_LEN(enc, *pp, end); + if (codepoint_length < 0) + return codepoint_length; /* encoding invalid */ + code = ONIGENC_MBC_TO_CODE(enc, *pp, end); + *pp += codepoint_length; + + if (code >= 'a' && code <= 'z' && (flags & ONIGENC_CASE_UPCASE)) + { + flags |= ONIGENC_CASE_MODIFIED; + code += 'A' - 'a'; + } + else if (code >= 'A' && code <= 'Z' + && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) + { + flags |= ONIGENC_CASE_MODIFIED; + code += 'a' - 'A'; + } + to += ONIGENC_CODE_TO_MBC(enc, code, to); + if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase + for capitalize */ + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE); + } + *flagP = flags; + return (int)(to - to_start); +} + +extern int onigenc_single_byte_ascii_only_case_map( + OnigCaseFoldType *flagP, const OnigUChar **pp, const OnigUChar *end, + OnigUChar *to, OnigUChar *to_end, const struct OnigEncodingTypeST *enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp < end && to < to_end) + { + code = *(*pp)++; + + if (code >= 'a' && code <= 'z' && (flags & ONIGENC_CASE_UPCASE)) + { + flags |= ONIGENC_CASE_MODIFIED; + code += 'A' - 'a'; + } + else if (code >= 'A' && code <= 'Z' + && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) + { + flags |= ONIGENC_CASE_MODIFIED; + code += 'a' - 'A'; + } + *to++ = code; + if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase + for capitalize */ + flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE + | ONIGENC_CASE_TITLECASE); + } + *flagP = flags; + return (int)(to - to_start); +} diff --git a/lib/edbee-lib/vendor/onig/regenc.h b/lib/edbee-lib/vendor/onig/regenc.h new file mode 100644 index 00000000..c56f2d02 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/regenc.h @@ -0,0 +1,320 @@ +#ifndef ONIGMO_REGENC_H +#define ONIGMO_REGENC_H +/********************************************************************** + regenc.h - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if !defined(RUBY) && (defined(RUBY_EXPORT) || defined(ONIG_ENC_REGISTER)) +# define RUBY +#endif +#ifdef RUBY +# ifndef ONIGMO_REGINT_H +# ifndef RUBY_EXTERN +# include "ruby/config.h" +# include "ruby/defines.h" +# endif +# endif +#else /* RUBY */ +# ifndef PACKAGE +/* PACKAGE is defined in config.h */ +# include "config.h" +# endif +#endif /* RUBY */ + +#ifdef ONIG_ESCAPE_UCHAR_COLLISION +# undef ONIG_ESCAPE_UCHAR_COLLISION +#endif + +#ifdef RUBY +# include "ruby/onigmo.h" +#else +# include "onigmo.h" +#endif + +RUBY_SYMBOL_EXPORT_BEGIN + +typedef struct +{ + OnigCodePoint from; + OnigCodePoint to; +} OnigPairCaseFoldCodes; + +#ifndef NULL +# define NULL ((void *)0) +#endif + +#ifndef TRUE +# define TRUE 1 +#endif + +#ifndef FALSE +# define FALSE 0 +#endif + +#ifndef ARG_UNUSED +# if defined(__GNUC__) +# define ARG_UNUSED __attribute__((unused)) +# else +# define ARG_UNUSED +# endif +#endif + +#define ONIG_IS_NULL(p) (((void *)(p)) == (void *)0) +#define ONIG_IS_NOT_NULL(p) (((void *)(p)) != (void *)0) +#define ONIG_CHECK_NULL_RETURN(p) \ + if (ONIG_IS_NULL(p)) \ + return NULL +#define ONIG_CHECK_NULL_RETURN_VAL(p, val) \ + if (ONIG_IS_NULL(p)) \ + return (val) + +#define enclen(enc, p, e) \ + ((enc->max_enc_len == enc->min_enc_len) ? enc->min_enc_len \ + : ONIGENC_MBC_ENC_LEN(enc, p, e)) + +/* character types bit flag */ +#define BIT_CTYPE_NEWLINE (1 << ONIGENC_CTYPE_NEWLINE) +#define BIT_CTYPE_ALPHA (1 << ONIGENC_CTYPE_ALPHA) +#define BIT_CTYPE_BLANK (1 << ONIGENC_CTYPE_BLANK) +#define BIT_CTYPE_CNTRL (1 << ONIGENC_CTYPE_CNTRL) +#define BIT_CTYPE_DIGIT (1 << ONIGENC_CTYPE_DIGIT) +#define BIT_CTYPE_GRAPH (1 << ONIGENC_CTYPE_GRAPH) +#define BIT_CTYPE_LOWER (1 << ONIGENC_CTYPE_LOWER) +#define BIT_CTYPE_PRINT (1 << ONIGENC_CTYPE_PRINT) +#define BIT_CTYPE_PUNCT (1 << ONIGENC_CTYPE_PUNCT) +#define BIT_CTYPE_SPACE (1 << ONIGENC_CTYPE_SPACE) +#define BIT_CTYPE_UPPER (1 << ONIGENC_CTYPE_UPPER) +#define BIT_CTYPE_XDIGIT (1 << ONIGENC_CTYPE_XDIGIT) +#define BIT_CTYPE_WORD (1 << ONIGENC_CTYPE_WORD) +#define BIT_CTYPE_ALNUM (1 << ONIGENC_CTYPE_ALNUM) +#define BIT_CTYPE_ASCII (1 << ONIGENC_CTYPE_ASCII) + +#define CTYPE_TO_BIT(ctype) (1 << (ctype)) +#define CTYPE_IS_WORD_GRAPH_PRINT(ctype) \ + ((ctype) == ONIGENC_CTYPE_WORD || (ctype) == ONIGENC_CTYPE_GRAPH \ + || (ctype) == ONIGENC_CTYPE_PRINT) + +typedef struct +{ + short int len; + const UChar name[6]; + int ctype; +} PosixBracketEntryType; + +#define POSIX_BRACKET_ENTRY_INIT(name, ctype) \ + {(short int)(sizeof(name) - 1), (name), (ctype)} + +#ifndef numberof +# define numberof(array) (int)(sizeof(array) / sizeof((array)[0])) +#endif + +#define USE_CRNL_AS_LINE_TERMINATOR +#define USE_UNICODE_PROPERTIES +#define USE_UNICODE_AGE_PROPERTIES +/* #define USE_UNICODE_CASE_FOLD_TURKISH_AZERI */ +/* #define USE_UNICODE_ALL_LINE_TERMINATORS */ /* see Unicode.org UTS #18 */ + +#define ONIG_ENCODING_INIT_DEFAULT ONIG_ENCODING_ASCII + +/* for encoding system implementation (internal) */ +ONIG_EXTERN int onigenc_ascii_apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, + void *arg, OnigEncoding enc); +ONIG_EXTERN int onigenc_ascii_get_case_fold_codes_by_str( + OnigCaseFoldType flag, const OnigUChar *p, const OnigUChar *end, + OnigCaseFoldCodeItem items[], OnigEncoding enc); +ONIG_EXTERN int onigenc_apply_all_case_fold_with_map( + int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, + OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void *arg); +ONIG_EXTERN int onigenc_get_case_fold_codes_by_str_with_map( + int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, + OnigCaseFoldType flag, const OnigUChar *p, const OnigUChar *end, + OnigCaseFoldCodeItem items[]); +ONIG_EXTERN int +onigenc_not_support_get_ctype_code_range(OnigCtype ctype, OnigCodePoint *sb_out, + const OnigCodePoint *ranges[], + OnigEncoding enc); +ONIG_EXTERN int onigenc_is_mbc_newline_0x0a(const UChar *p, const UChar *end, + OnigEncoding enc); +ONIG_EXTERN int onigenc_single_byte_ascii_only_case_map( + OnigCaseFoldType *flagP, const OnigUChar **pp, const OnigUChar *end, + OnigUChar *to, OnigUChar *to_end, const struct OnigEncodingTypeST *enc); + +/* methods for single byte encoding */ +ONIG_EXTERN int onigenc_ascii_mbc_case_fold(OnigCaseFoldType flag, + const UChar **p, const UChar *end, + UChar *lower, OnigEncoding enc); +ONIG_EXTERN int onigenc_single_byte_mbc_enc_len(const UChar *p, const UChar *e, + OnigEncoding enc); +ONIG_EXTERN OnigCodePoint onigenc_single_byte_mbc_to_code(const UChar *p, + const UChar *end, + OnigEncoding enc); +ONIG_EXTERN int onigenc_single_byte_code_to_mbclen(OnigCodePoint code, + OnigEncoding enc); +ONIG_EXTERN int onigenc_single_byte_code_to_mbc(OnigCodePoint code, UChar *buf, + OnigEncoding enc); +ONIG_EXTERN UChar *onigenc_single_byte_left_adjust_char_head( + const UChar *start, const UChar *s, const OnigUChar *end, OnigEncoding enc); +ONIG_EXTERN int onigenc_always_true_is_allowed_reverse_match(const UChar *s, + const UChar *end, + OnigEncoding enc); +ONIG_EXTERN int onigenc_always_false_is_allowed_reverse_match(const UChar *s, + const UChar *end, + OnigEncoding enc); +ONIG_EXTERN int onigenc_ascii_is_code_ctype(OnigCodePoint code, + unsigned int ctype, + OnigEncoding enc); + +/* methods for multi byte encoding */ +ONIG_EXTERN OnigCodePoint onigenc_mbn_mbc_to_code(OnigEncoding enc, + const UChar *p, + const UChar *end); +ONIG_EXTERN int onigenc_mbn_mbc_case_fold(OnigEncoding enc, + OnigCaseFoldType flag, + const UChar **p, const UChar *end, + UChar *lower); +ONIG_EXTERN int onigenc_mb2_code_to_mbclen(OnigCodePoint code, + OnigEncoding enc); +ONIG_EXTERN int onigenc_mb2_code_to_mbc(OnigEncoding enc, OnigCodePoint code, + UChar *buf); +ONIG_EXTERN int onigenc_minimum_property_name_to_ctype(OnigEncoding enc, + const UChar *p, + const UChar *end); +ONIG_EXTERN int onigenc_unicode_property_name_to_ctype(OnigEncoding enc, + const UChar *p, + const UChar *end); +ONIG_EXTERN int onigenc_mb2_is_code_ctype(OnigEncoding enc, OnigCodePoint code, + unsigned int ctype); +ONIG_EXTERN int onigenc_mb4_code_to_mbclen(OnigCodePoint code, + OnigEncoding enc); +ONIG_EXTERN int onigenc_mb4_code_to_mbc(OnigEncoding enc, OnigCodePoint code, + UChar *buf); +ONIG_EXTERN int onigenc_mb4_is_code_ctype(OnigEncoding enc, OnigCodePoint code, + unsigned int ctype); + +ONIG_EXTERN int onigenc_unicode_case_map(OnigCaseFoldType *flagP, + const OnigUChar **pp, + const OnigUChar *end, OnigUChar *to, + OnigUChar *to_end, + const struct OnigEncodingTypeST *enc); + +/* in enc/unicode.c */ +ONIG_EXTERN int onigenc_unicode_is_code_ctype(OnigCodePoint code, + unsigned int ctype, + OnigEncoding enc); +ONIG_EXTERN int +onigenc_utf16_32_get_ctype_code_range(OnigCtype ctype, OnigCodePoint *sb_out, + const OnigCodePoint *ranges[], + OnigEncoding enc); +ONIG_EXTERN int onigenc_unicode_ctype_code_range(int ctype, + const OnigCodePoint *ranges[]); +ONIG_EXTERN int onigenc_unicode_get_case_fold_codes_by_str( + OnigEncoding enc, OnigCaseFoldType flag, const OnigUChar *p, + const OnigUChar *end, OnigCaseFoldCodeItem items[]); +ONIG_EXTERN int onigenc_unicode_mbc_case_fold(OnigEncoding enc, + OnigCaseFoldType flag, + const UChar **pp, + const UChar *end, UChar *fold); +ONIG_EXTERN int onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag, + OnigApplyAllCaseFoldFunc f, + void *arg, + OnigEncoding enc); + +#define UTF16_IS_SURROGATE_FIRST(c) (((c) & 0xfc) == 0xd8) +#define UTF16_IS_SURROGATE_SECOND(c) (((c) & 0xfc) == 0xdc) +#define UTF16_IS_SURROGATE(c) (((c) & 0xf8) == 0xd8) +#define UNICODE_VALID_CODEPOINT_P(c) \ + (((c) <= 0x10ffff) && !((c) < 0x10000 && UTF16_IS_SURROGATE((c) >> 8))) + +#define ONIGENC_ISO_8859_1_TO_LOWER_CASE(c) \ + OnigEncISO_8859_1_ToLowerCaseTable[c] +#define ONIGENC_ISO_8859_1_TO_UPPER_CASE(c) \ + OnigEncISO_8859_1_ToUpperCaseTable[c] + +ONIG_EXTERN const UChar OnigEncISO_8859_1_ToLowerCaseTable[]; +ONIG_EXTERN const UChar OnigEncISO_8859_1_ToUpperCaseTable[]; + +ONIG_EXTERN int onigenc_with_ascii_strncmp(OnigEncoding enc, const UChar *p, + const UChar *end, + const UChar *sascii /* ascii */, + int n); +ONIG_EXTERN int onigenc_with_ascii_strnicmp(OnigEncoding enc, const UChar *p, + const UChar *end, + const UChar *sascii /* ascii */, + int n); +ONIG_EXTERN UChar *onigenc_step(OnigEncoding enc, const UChar *p, + const UChar *end, int n); + +/* defined in regexec.c, but used in enc/xxx.c */ +extern int onig_is_in_code_range(const UChar *p, OnigCodePoint code); + +ONIG_EXTERN OnigEncoding OnigEncDefaultCharEncoding; +ONIG_EXTERN const UChar OnigEncAsciiToLowerCaseTable[]; +ONIG_EXTERN const UChar OnigEncAsciiToUpperCaseTable[]; +ONIG_EXTERN const unsigned short OnigEncAsciiCtypeTable[]; + +#define ONIGENC_IS_ASCII_CODE(code) ((code) < 0x80) +#define ONIGENC_ASCII_CODE_TO_LOWER_CASE(c) OnigEncAsciiToLowerCaseTable[c] +#define ONIGENC_ASCII_CODE_TO_UPPER_CASE(c) OnigEncAsciiToUpperCaseTable[c] +#define ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype) \ + ((OnigEncAsciiCtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) +#define ONIGENC_IS_ASCII_CODE_CASE_AMBIG(code) \ + (ONIGENC_IS_ASCII_CODE_CTYPE(code, ONIGENC_CTYPE_UPPER) \ + || ONIGENC_IS_ASCII_CODE_CTYPE(code, ONIGENC_CTYPE_LOWER)) + +/* Check if the code is in the range. (from <= code && code <= to) */ +#define ONIGENC_IS_IN_RANGE(code, from, to) \ + ((OnigCodePoint)((code) - (from)) <= (OnigCodePoint)((to) - (from))) + +#ifdef ONIG_ENC_REGISTER +extern int ONIG_ENC_REGISTER(const char *, OnigEncoding); +# define OnigEncodingName(n) encoding_##n +# define OnigEncodingDeclare(n) \ + static const OnigEncodingType OnigEncodingName(n) +# define OnigEncodingDefine(f, n) \ + OnigEncodingDeclare(n); \ + void Init_##f(void) \ + { \ + ONIG_ENC_REGISTER(OnigEncodingName(n).name, &OnigEncodingName(n)); \ + } \ + OnigEncodingDeclare(n) +#else +# define OnigEncodingName(n) OnigEncoding##n +# define OnigEncodingDeclare(n) const OnigEncodingType OnigEncodingName(n) +# define OnigEncodingDefine(f, n) OnigEncodingDeclare(n) +#endif + +/* macros for define replica encoding and encoding alias */ +#define ENC_REPLICATE(name, orig) +#define ENC_ALIAS(name, orig) +#define ENC_DUMMY(name) + +RUBY_SYMBOL_EXPORT_END + +#endif /* ONIGMO_REGENC_H */ diff --git a/lib/edbee-lib/vendor/onig/regerror.c b/lib/edbee-lib/vendor/onig/regerror.c new file mode 100644 index 00000000..461ab2db --- /dev/null +++ b/lib/edbee-lib/vendor/onig/regerror.c @@ -0,0 +1,483 @@ +/********************************************************************** + regerror.c - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regint.h" +#include <stdio.h> /* for vsnprintf() */ + +#include <stdarg.h> + +extern UChar *onig_error_code_to_format(OnigPosition code) +{ + const char *p; + + if (code >= 0) + return (UChar *)0; + + switch (code) + { + case ONIG_MISMATCH: + p = "mismatch"; + break; + case ONIG_NO_SUPPORT_CONFIG: + p = "no support in this configuration"; + break; + case ONIGERR_MEMORY: + p = "failed to allocate memory"; + break; + case ONIGERR_TYPE_BUG: + p = "undefined type (bug)"; + break; + case ONIGERR_PARSER_BUG: + p = "internal parser error (bug)"; + break; + case ONIGERR_STACK_BUG: + p = "stack error (bug)"; + break; + case ONIGERR_UNDEFINED_BYTECODE: + p = "undefined bytecode (bug)"; + break; + case ONIGERR_UNEXPECTED_BYTECODE: + p = "unexpected bytecode (bug)"; + break; + case ONIGERR_MATCH_STACK_LIMIT_OVER: + p = "match-stack limit over"; + break; + case ONIGERR_PARSE_DEPTH_LIMIT_OVER: + p = "parse depth limit over"; + break; + case ONIGERR_DEFAULT_ENCODING_IS_NOT_SET: + p = "default multibyte-encoding is not set"; + break; + case ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR: + p = "can't convert to wide-char on specified multibyte-encoding"; + break; + case ONIGERR_INVALID_ARGUMENT: + p = "invalid argument"; + break; + case ONIGERR_END_PATTERN_AT_LEFT_BRACE: + p = "end pattern at left brace"; + break; + case ONIGERR_END_PATTERN_AT_LEFT_BRACKET: + p = "end pattern at left bracket"; + break; + case ONIGERR_EMPTY_CHAR_CLASS: + p = "empty char-class"; + break; + case ONIGERR_PREMATURE_END_OF_CHAR_CLASS: + p = "premature end of char-class"; + break; + case ONIGERR_END_PATTERN_AT_ESCAPE: + p = "end pattern at escape"; + break; + case ONIGERR_END_PATTERN_AT_META: + p = "end pattern at meta"; + break; + case ONIGERR_END_PATTERN_AT_CONTROL: + p = "end pattern at control"; + break; + case ONIGERR_META_CODE_SYNTAX: + p = "invalid meta-code syntax"; + break; + case ONIGERR_CONTROL_CODE_SYNTAX: + p = "invalid control-code syntax"; + break; + case ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE: + p = "char-class value at end of range"; + break; + case ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE: + p = "char-class value at start of range"; + break; + case ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS: + p = "unmatched range specifier in char-class"; + break; + case ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED: + p = "target of repeat operator is not specified"; + break; + case ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID: + p = "target of repeat operator is invalid"; + break; + case ONIGERR_NESTED_REPEAT_OPERATOR: + p = "nested repeat operator"; + break; + case ONIGERR_UNMATCHED_CLOSE_PARENTHESIS: + p = "unmatched close parenthesis"; + break; + case ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS: + p = "end pattern with unmatched parenthesis"; + break; + case ONIGERR_END_PATTERN_IN_GROUP: + p = "end pattern in group"; + break; + case ONIGERR_UNDEFINED_GROUP_OPTION: + p = "undefined group option"; + break; + case ONIGERR_INVALID_POSIX_BRACKET_TYPE: + p = "invalid POSIX bracket type"; + break; + case ONIGERR_INVALID_LOOK_BEHIND_PATTERN: + p = "invalid pattern in look-behind"; + break; + case ONIGERR_INVALID_REPEAT_RANGE_PATTERN: + p = "invalid repeat range {lower,upper}"; + break; + case ONIGERR_INVALID_CONDITION_PATTERN: + p = "invalid conditional pattern"; + break; + case ONIGERR_TOO_BIG_NUMBER: + p = "too big number"; + break; + case ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE: + p = "too big number for repeat range"; + break; + case ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE: + p = "upper is smaller than lower in repeat range"; + break; + case ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS: + p = "empty range in char class"; + break; + case ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE: + p = "mismatch multibyte code length in char-class range"; + break; + case ONIGERR_TOO_MANY_MULTI_BYTE_RANGES: + p = "too many multibyte code ranges are specified"; + break; + case ONIGERR_TOO_SHORT_MULTI_BYTE_STRING: + p = "too short multibyte code string"; + break; + case ONIGERR_TOO_BIG_BACKREF_NUMBER: + p = "too big backref number"; + break; + case ONIGERR_INVALID_BACKREF: +#ifdef USE_NAMED_GROUP + p = "invalid backref number/name"; + break; +#else + p = "invalid backref number"; + break; +#endif + case ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED: + p = "numbered backref/call is not allowed. (use name)"; + break; + case ONIGERR_TOO_SHORT_DIGITS: + p = "too short digits"; + break; + case ONIGERR_TOO_LONG_WIDE_CHAR_VALUE: + p = "too long wide-char value"; + break; + case ONIGERR_EMPTY_GROUP_NAME: + p = "group name is empty"; + break; + case ONIGERR_INVALID_GROUP_NAME: + p = "invalid group name <%n>"; + break; + case ONIGERR_INVALID_CHAR_IN_GROUP_NAME: +#ifdef USE_NAMED_GROUP + p = "invalid char in group name <%n>"; + break; +#else + p = "invalid char in group number <%n>"; + break; +#endif + case ONIGERR_UNDEFINED_NAME_REFERENCE: + p = "undefined name <%n> reference"; + break; + case ONIGERR_UNDEFINED_GROUP_REFERENCE: + p = "undefined group <%n> reference"; + break; + case ONIGERR_MULTIPLEX_DEFINED_NAME: + p = "multiplex defined name <%n>"; + break; + case ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL: + p = "multiplex definition name <%n> call"; + break; + case ONIGERR_NEVER_ENDING_RECURSION: + p = "never ending recursion"; + break; + case ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY: + p = "group number is too big for capture history"; + break; + case ONIGERR_INVALID_CHAR_PROPERTY_NAME: + p = "invalid character property name {%n}"; + break; + case ONIGERR_TOO_MANY_CAPTURE_GROUPS: + p = "too many capture groups are specified"; + break; + case ONIGERR_INVALID_CODE_POINT_VALUE: + p = "invalid code point value"; + break; + case ONIGERR_TOO_BIG_WIDE_CHAR_VALUE: + p = "too big wide-char value"; + break; + case ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION: + p = "not supported encoding combination"; + break; + case ONIGERR_INVALID_COMBINATION_OF_OPTIONS: + p = "invalid combination of options"; + break; + + default: + p = "undefined error code"; + break; + } + + return (UChar *)p; +} + +static void sprint_byte(char *s, unsigned int v) +{ + xsnprintf(s, 3, "%02x", (v & 0377)); +} + +static void sprint_byte_with_x(char *s, unsigned int v) +{ + xsnprintf(s, 5, "\\x%02x", (v & 0377)); +} + +static int to_ascii(OnigEncoding enc, UChar *s, UChar *end, UChar buf[], + int buf_size, int *is_over) +{ + int len; + UChar *p; + OnigCodePoint code; + + if (ONIGENC_MBC_MINLEN(enc) > 1) + { + p = s; + len = 0; + while (p < end) + { + code = ONIGENC_MBC_TO_CODE(enc, p, end); + if (code >= 0x80) + { + if (code > 0xffff && len + 10 <= buf_size) + { + sprint_byte_with_x((char *)(&(buf[len])), (unsigned int)(code >> 24)); + sprint_byte((char *)(&(buf[len + 4])), (unsigned int)(code >> 16)); + sprint_byte((char *)(&(buf[len + 6])), (unsigned int)(code >> 8)); + sprint_byte((char *)(&(buf[len + 8])), (unsigned int)code); + len += 10; + } + else if (len + 6 <= buf_size) + { + sprint_byte_with_x((char *)(&(buf[len])), (unsigned int)(code >> 8)); + sprint_byte((char *)(&(buf[len + 4])), (unsigned int)code); + len += 6; + } + else + { + break; + } + } + else + { + buf[len++] = (UChar)code; + } + + p += enclen(enc, p, end); + if (len >= buf_size) + break; + } + + *is_over = ((p < end) ? 1 : 0); + } + else + { + len = (int)MIN((end - s), buf_size); + xmemcpy(buf, s, (size_t)len); + *is_over = ((buf_size < (end - s)) ? 1 : 0); + } + + return len; +} + +/* for ONIG_MAX_ERROR_MESSAGE_LEN */ +#define MAX_ERROR_PAR_LEN 30 + +extern int onig_error_code_to_str(UChar *s, OnigPosition code, ...) +{ + UChar *p, *q; + OnigErrorInfo *einfo; + size_t len; + int is_over; + UChar parbuf[MAX_ERROR_PAR_LEN]; + va_list vargs; + + va_start(vargs, code); + + switch (code) + { + case ONIGERR_UNDEFINED_NAME_REFERENCE: + case ONIGERR_UNDEFINED_GROUP_REFERENCE: + case ONIGERR_MULTIPLEX_DEFINED_NAME: + case ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL: + case ONIGERR_INVALID_GROUP_NAME: + case ONIGERR_INVALID_CHAR_IN_GROUP_NAME: + case ONIGERR_INVALID_CHAR_PROPERTY_NAME: + einfo = va_arg(vargs, OnigErrorInfo *); + len = to_ascii(einfo->enc, einfo->par, einfo->par_end, parbuf, + MAX_ERROR_PAR_LEN - 3, &is_over); + q = onig_error_code_to_format(code); + p = s; + while (*q != '\0') + { + if (*q == '%') + { + q++; + if (*q == 'n') + { /* '%n': name */ + xmemcpy(p, parbuf, len); + p += len; + if (is_over != 0) + { + xmemcpy(p, "...", 3); + p += 3; + } + q++; + } + else + goto normal_char; + } + else + { + normal_char: + *p++ = *q++; + } + } + *p = '\0'; + len = p - s; + break; + + default: + q = onig_error_code_to_format(code); + if (q) + { + len = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, q); + xmemcpy(s, q, len); + } + else + { + len = 0; + } + s[len] = '\0'; + break; + } + + va_end(vargs); + return (int)len; +} + +void onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, + UChar *pat, UChar *pat_end, const UChar *fmt, + va_list args) +{ + size_t need; + int n, len; + UChar *p, *s, *bp; + UChar bs[6]; + + n = xvsnprintf((char *)buf, bufsize, (const char *)fmt, args); + + need = (pat_end - pat) * 4 + 4; + + if (n + need < (size_t)bufsize) + { + static const char sep[] = ": /"; + memcpy((char *)buf + n, sep, sizeof(sep)); + s = buf + onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, buf); + + p = pat; + while (p < pat_end) + { + if (ONIGENC_IS_MBC_HEAD(enc, p, pat_end)) + { + len = enclen(enc, p, pat_end); + if (ONIGENC_MBC_MINLEN(enc) == 1) + { + while (len-- > 0) + *s++ = *p++; + } + else + { /* for UTF16/32 */ + int blen; + + while (len-- > 0) + { + sprint_byte_with_x((char *)bs, (unsigned int)(*p++)); + blen = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, bs); + bp = bs; + while (blen-- > 0) + *s++ = *bp++; + } + } + } + else if (*p == '\\') + { + *s++ = *p++; + len = enclen(enc, p, pat_end); + while (len-- > 0) + *s++ = *p++; + } + else if (*p == '/') + { + *s++ = (unsigned char)'\\'; + *s++ = *p++; + } + else if (!ONIGENC_IS_CODE_PRINT(enc, *p) + && !ONIGENC_IS_CODE_SPACE(enc, *p)) + { + sprint_byte_with_x((char *)bs, (unsigned int)(*p++)); + len = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, bs); + bp = bs; + while (len-- > 0) + *s++ = *bp++; + } + else + { + *s++ = *p++; + } + } + + *s++ = '/'; + *s = '\0'; + } +} + +#if 0 /* unused */ +void +onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, + UChar* pat, UChar* pat_end, const UChar *fmt, ...) +{ + va_list args; + va_start(args, fmt); + onig_vsnprintf_with_pattern(buf, bufsize, enc, + pat, pat_end, fmt, args); + va_end(args); +} +#endif diff --git a/lib/edbee-lib/vendor/onig/regexec.c b/lib/edbee-lib/vendor/onig/regexec.c new file mode 100644 index 00000000..375dc090 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/regexec.c @@ -0,0 +1,5382 @@ +/********************************************************************** + regexec.c - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regint.h" + +#ifdef RUBY +# undef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE +#else +# define USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE +#endif + +#ifndef USE_TOKEN_THREADED_VM +# ifdef __GNUC__ +# define USE_TOKEN_THREADED_VM 1 +# else +# define USE_TOKEN_THREADED_VM 0 +# endif +#endif + +#ifdef RUBY +# define ENC_DUMMY_FLAG (1 << 24) +static inline int rb_enc_asciicompat(OnigEncoding enc) +{ + return ONIGENC_MBC_MINLEN(enc) == 1 + && !((enc)->ruby_encoding_index & ENC_DUMMY_FLAG); +} +# undef ONIGENC_IS_MBC_ASCII_WORD +# define ONIGENC_IS_MBC_ASCII_WORD(enc, s, end) \ + (rb_enc_asciicompat(enc) \ + ? (ISALNUM(*s) || *s == '_') \ + : onigenc_ascii_is_code_ctype(ONIGENC_MBC_TO_CODE(enc, s, end), \ + ONIGENC_CTYPE_WORD, enc)) +#endif /* RUBY */ + +#ifdef USE_CRNL_AS_LINE_TERMINATOR +# define ONIGENC_IS_MBC_CRNL(enc, p, end) \ + (ONIGENC_MBC_TO_CODE(enc, p, end) == 13 \ + && ONIGENC_MBC_TO_CODE(enc, (p + enclen(enc, p, end)), end) == 10) +# define ONIGENC_IS_MBC_NEWLINE_EX(enc, p, start, end, option, check_prev) \ + is_mbc_newline_ex((enc), (p), (start), (end), (option), (check_prev)) +static int is_mbc_newline_ex(OnigEncoding enc, const UChar *p, + const UChar *start, const UChar *end, + OnigOptionType option, int check_prev) +{ + if (IS_NEWLINE_CRLF(option)) + { + if (ONIGENC_MBC_TO_CODE(enc, p, end) == 0x0a) + { + if (check_prev) + { + const UChar *prev = onigenc_get_prev_char_head(enc, start, p, end); + if ((prev != NULL) && ONIGENC_MBC_TO_CODE(enc, prev, end) == 0x0d) + return 0; + else + return 1; + } + else + return 1; + } + else + { + const UChar *pnext = p + enclen(enc, p, end); + if (pnext < end && ONIGENC_MBC_TO_CODE(enc, p, end) == 0x0d + && ONIGENC_MBC_TO_CODE(enc, pnext, end) == 0x0a) + return 1; + if (ONIGENC_IS_MBC_NEWLINE(enc, p, end)) + return 1; + return 0; + } + } + else + { + return ONIGENC_IS_MBC_NEWLINE(enc, p, end); + } +} +#else /* USE_CRNL_AS_LINE_TERMINATOR */ +# define ONIGENC_IS_MBC_NEWLINE_EX(enc, p, start, end, option, check_prev) \ + ONIGENC_IS_MBC_NEWLINE((enc), (p), (end)) +#endif /* USE_CRNL_AS_LINE_TERMINATOR */ + +#ifdef USE_CAPTURE_HISTORY +static void history_tree_free(OnigCaptureTreeNode *node); + +static void history_tree_clear(OnigCaptureTreeNode *node) +{ + int i; + + if (IS_NOT_NULL(node)) + { + for (i = 0; i < node->num_childs; i++) + { + if (IS_NOT_NULL(node->childs[i])) + { + history_tree_free(node->childs[i]); + } + } + for (i = 0; i < node->allocated; i++) + { + node->childs[i] = (OnigCaptureTreeNode *)0; + } + node->num_childs = 0; + node->beg = ONIG_REGION_NOTPOS; + node->end = ONIG_REGION_NOTPOS; + node->group = -1; + xfree(node->childs); + node->childs = (OnigCaptureTreeNode **)0; + } +} + +static void history_tree_free(OnigCaptureTreeNode *node) +{ + history_tree_clear(node); + xfree(node); +} + +static void history_root_free(OnigRegion *r) +{ + if (IS_NOT_NULL(r->history_root)) + { + history_tree_free(r->history_root); + r->history_root = (OnigCaptureTreeNode *)0; + } +} + +static OnigCaptureTreeNode *history_node_new(void) +{ + OnigCaptureTreeNode *node; + + node = (OnigCaptureTreeNode *)xmalloc(sizeof(OnigCaptureTreeNode)); + CHECK_NULL_RETURN(node); + node->childs = (OnigCaptureTreeNode **)0; + node->allocated = 0; + node->num_childs = 0; + node->group = -1; + node->beg = ONIG_REGION_NOTPOS; + node->end = ONIG_REGION_NOTPOS; + + return node; +} + +static int history_tree_add_child(OnigCaptureTreeNode *parent, + OnigCaptureTreeNode *child) +{ +# define HISTORY_TREE_INIT_ALLOC_SIZE 8 + + if (parent->num_childs >= parent->allocated) + { + int n, i; + + if (IS_NULL(parent->childs)) + { + n = HISTORY_TREE_INIT_ALLOC_SIZE; + parent->childs + = (OnigCaptureTreeNode **)xmalloc(sizeof(OnigCaptureTreeNode *) * n); + CHECK_NULL_RETURN_MEMERR(parent->childs); + } + else + { + OnigCaptureTreeNode **tmp; + n = parent->allocated * 2; + tmp = (OnigCaptureTreeNode **)xrealloc(parent->childs, + sizeof(OnigCaptureTreeNode *) * n); + if (tmp == 0) + { + history_tree_clear(parent); + return ONIGERR_MEMORY; + } + parent->childs = tmp; + } + for (i = parent->allocated; i < n; i++) + { + parent->childs[i] = (OnigCaptureTreeNode *)0; + } + parent->allocated = n; + } + + parent->childs[parent->num_childs] = child; + parent->num_childs++; + return 0; +} + +static OnigCaptureTreeNode *history_tree_clone(OnigCaptureTreeNode *node) +{ + int i, r; + OnigCaptureTreeNode *clone, *child; + + clone = history_node_new(); + CHECK_NULL_RETURN(clone); + + clone->beg = node->beg; + clone->end = node->end; + for (i = 0; i < node->num_childs; i++) + { + child = history_tree_clone(node->childs[i]); + if (IS_NULL(child)) + { + history_tree_free(clone); + return (OnigCaptureTreeNode *)0; + } + r = history_tree_add_child(clone, child); + if (r != 0) + { + history_tree_free(child); + history_tree_free(clone); + return (OnigCaptureTreeNode *)0; + } + } + + return clone; +} + +extern OnigCaptureTreeNode *onig_get_capture_tree(OnigRegion *region) +{ + return region->history_root; +} +#endif /* USE_CAPTURE_HISTORY */ + +extern void onig_region_clear(OnigRegion *region) +{ + int i; + + for (i = 0; i < region->num_regs; i++) + { + region->beg[i] = region->end[i] = ONIG_REGION_NOTPOS; + } +#ifdef USE_CAPTURE_HISTORY + history_root_free(region); +#endif +} + +extern int onig_region_resize(OnigRegion *region, int n) +{ + region->num_regs = n; + + if (n < ONIG_NREGION) + n = ONIG_NREGION; + + if (region->allocated == 0) + { + region->beg = (OnigPosition *)xmalloc(n * sizeof(OnigPosition)); + if (region->beg == 0) + return ONIGERR_MEMORY; + + region->end = (OnigPosition *)xmalloc(n * sizeof(OnigPosition)); + if (region->end == 0) + { + xfree(region->beg); + return ONIGERR_MEMORY; + } + + region->allocated = n; + } + else if (region->allocated < n) + { + OnigPosition *tmp; + + region->allocated = 0; + tmp = (OnigPosition *)xrealloc(region->beg, n * sizeof(OnigPosition)); + if (tmp == 0) + { + xfree(region->beg); + xfree(region->end); + return ONIGERR_MEMORY; + } + region->beg = tmp; + tmp = (OnigPosition *)xrealloc(region->end, n * sizeof(OnigPosition)); + if (tmp == 0) + { + xfree(region->beg); + xfree(region->end); + return ONIGERR_MEMORY; + } + region->end = tmp; + + region->allocated = n; + } + + return 0; +} + +static int onig_region_resize_clear(OnigRegion *region, int n) +{ + int r; + + r = onig_region_resize(region, n); + if (r != 0) + return r; + onig_region_clear(region); + return 0; +} + +extern int onig_region_set(OnigRegion *region, int at, int beg, int end) +{ + if (at < 0) + return ONIGERR_INVALID_ARGUMENT; + + if (at >= region->allocated) + { + int r = onig_region_resize(region, at + 1); + if (r < 0) + return r; + } + + region->beg[at] = beg; + region->end[at] = end; + return 0; +} + +extern void onig_region_init(OnigRegion *region) +{ + region->num_regs = 0; + region->allocated = 0; + region->beg = (OnigPosition *)0; + region->end = (OnigPosition *)0; + region->history_root = (OnigCaptureTreeNode *)0; +} + +extern OnigRegion *onig_region_new(void) +{ + OnigRegion *r; + + r = (OnigRegion *)xmalloc(sizeof(OnigRegion)); + if (r) + onig_region_init(r); + return r; +} + +extern void onig_region_free(OnigRegion *r, int free_self) +{ + if (r) + { + if (r->allocated > 0) + { + if (r->beg) + xfree(r->beg); + if (r->end) + xfree(r->end); + r->allocated = 0; + } +#ifdef USE_CAPTURE_HISTORY + history_root_free(r); +#endif + if (free_self) + xfree(r); + } +} + +extern void onig_region_copy(OnigRegion *to, const OnigRegion *from) +{ +#define RREGC_SIZE (sizeof(int) * from->num_regs) + int i, r; + + if (to == from) + return; + + r = onig_region_resize(to, from->num_regs); + if (r) + return; + + for (i = 0; i < from->num_regs; i++) + { + to->beg[i] = from->beg[i]; + to->end[i] = from->end[i]; + } + to->num_regs = from->num_regs; + +#ifdef USE_CAPTURE_HISTORY + history_root_free(to); + + if (IS_NOT_NULL(from->history_root)) + { + to->history_root = history_tree_clone(from->history_root); + } +#endif +} + +/** stack **/ +#define INVALID_STACK_INDEX -1 + +/* stack type */ +/* used by normal-POP */ +#define STK_ALT 0x0001 +#define STK_LOOK_BEHIND_NOT 0x0002 +#define STK_POS_NOT 0x0003 +/* handled by normal-POP */ +#define STK_MEM_START 0x0100 +#define STK_MEM_END 0x8200 +#define STK_REPEAT_INC 0x0300 +#define STK_STATE_CHECK_MARK 0x1000 +/* avoided by normal-POP */ +#define STK_NULL_CHECK_START 0x3000 +#define STK_NULL_CHECK_END 0x5000 /* for recursive call */ +#define STK_MEM_END_MARK 0x8400 +#define STK_POS 0x0500 /* used when POP-POS */ +#define STK_STOP_BT 0x0600 /* mark for "(?>...)" */ +#define STK_REPEAT 0x0700 +#define STK_CALL_FRAME 0x0800 +#define STK_RETURN 0x0900 +#define STK_VOID 0x0a00 /* for fill a blank */ +#define STK_ABSENT_POS 0x0b00 /* for absent */ +#define STK_ABSENT 0x0c00 /* absent inner loop marker */ + +/* stack type check mask */ +#define STK_MASK_POP_USED 0x00ff +#define STK_MASK_TO_VOID_TARGET 0x10ff +#define STK_MASK_MEM_END_OR_MARK 0x8000 /* MEM_END or MEM_END_MARK */ + +#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE +# define MATCH_ARG_INIT(msa, arg_option, arg_region, arg_start, arg_gpos) \ + do \ + { \ + (msa).stack_p = (void *)0; \ + (msa).options = (arg_option); \ + (msa).region = (arg_region); \ + (msa).start = (arg_start); \ + (msa).gpos = (arg_gpos); \ + (msa).best_len = ONIG_MISMATCH; \ + } while (0) +#else +# define MATCH_ARG_INIT(msa, arg_option, arg_region, arg_start, arg_gpos) \ + do \ + { \ + (msa).stack_p = (void *)0; \ + (msa).options = (arg_option); \ + (msa).region = (arg_region); \ + (msa).start = (arg_start); \ + (msa).gpos = (arg_gpos); \ + } while (0) +#endif + +#ifdef USE_COMBINATION_EXPLOSION_CHECK + +# define STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE 16 + +# define STATE_CHECK_BUFF_INIT(msa, str_len, offset, state_num) \ + do \ + { \ + if ((state_num) > 0 && str_len >= STATE_CHECK_STRING_THRESHOLD_LEN) \ + { \ + unsigned int size \ + = (unsigned int)(((str_len) + 1) * (state_num) + 7) >> 3; \ + offset = ((offset) * (state_num)) >> 3; \ + if (size > 0 && offset < size && size < STATE_CHECK_BUFF_MAX_SIZE) \ + { \ + if (size >= STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE) \ + { \ + (msa).state_check_buff = (void *)xmalloc(size); \ + CHECK_NULL_RETURN_MEMERR((msa).state_check_buff); \ + } \ + else \ + (msa).state_check_buff = (void *)xalloca(size); \ + xmemset(((char *)((msa).state_check_buff) + (offset)), 0, \ + (size_t)(size - (offset))); \ + (msa).state_check_buff_size = size; \ + } \ + else \ + { \ + (msa).state_check_buff = (void *)0; \ + (msa).state_check_buff_size = 0; \ + } \ + } \ + else \ + { \ + (msa).state_check_buff = (void *)0; \ + (msa).state_check_buff_size = 0; \ + } \ + } while (0) + +# define MATCH_ARG_FREE(msa) \ + do \ + { \ + if ((msa).stack_p) \ + xfree((msa).stack_p); \ + if ((msa).state_check_buff_size \ + >= STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE) \ + { \ + if ((msa).state_check_buff) \ + xfree((msa).state_check_buff); \ + } \ + } while (0) +#else /* USE_COMBINATION_EXPLOSION_CHECK */ +# define MATCH_ARG_FREE(msa) \ + if ((msa).stack_p) \ + xfree((msa).stack_p) +#endif /* USE_COMBINATION_EXPLOSION_CHECK */ + +#define MAX_PTR_NUM 100 + +#define STACK_INIT(alloc_addr, heap_addr, ptr_num, stack_num) \ + do \ + { \ + if (ptr_num > MAX_PTR_NUM) \ + { \ + alloc_addr = (char *)xmalloc(sizeof(OnigStackIndex) * (ptr_num)); \ + heap_addr = alloc_addr; \ + if (msa->stack_p) \ + { \ + stk_alloc = (OnigStackType *)(msa->stack_p); \ + stk_base = stk_alloc; \ + stk = stk_base; \ + stk_end = stk_base + msa->stack_n; \ + } \ + else \ + { \ + stk_alloc \ + = (OnigStackType *)xalloca(sizeof(OnigStackType) * (stack_num)); \ + stk_base = stk_alloc; \ + stk = stk_base; \ + stk_end = stk_base + (stack_num); \ + } \ + } \ + else if (msa->stack_p) \ + { \ + alloc_addr = (char *)xalloca(sizeof(OnigStackIndex) * (ptr_num)); \ + heap_addr = NULL; \ + stk_alloc = (OnigStackType *)(msa->stack_p); \ + stk_base = stk_alloc; \ + stk = stk_base; \ + stk_end = stk_base + msa->stack_n; \ + } \ + else \ + { \ + alloc_addr = (char *)xalloca(sizeof(OnigStackIndex) * (ptr_num) \ + + sizeof(OnigStackType) * (stack_num)); \ + heap_addr = NULL; \ + stk_alloc = (OnigStackType *)(alloc_addr \ + + sizeof(OnigStackIndex) * (ptr_num)); \ + stk_base = stk_alloc; \ + stk = stk_base; \ + stk_end = stk_base + (stack_num); \ + } \ + } while (0) + +#define STACK_SAVE \ + do \ + { \ + if (stk_base != stk_alloc) \ + { \ + msa->stack_p = stk_base; \ + msa->stack_n = stk_end - stk_base; /* TODO: check overflow */ \ + }; \ + } while (0) + +static unsigned int MatchStackLimitSize = DEFAULT_MATCH_STACK_LIMIT_SIZE; + +extern unsigned int onig_get_match_stack_limit_size(void) +{ + return MatchStackLimitSize; +} + +extern int onig_set_match_stack_limit_size(unsigned int size) +{ + MatchStackLimitSize = size; + return 0; +} + +static int stack_double(OnigStackType **arg_stk_base, + OnigStackType **arg_stk_end, OnigStackType **arg_stk, + OnigStackType *stk_alloc, OnigMatchArg *msa) +{ + size_t n; + OnigStackType *x, *stk_base, *stk_end, *stk; + + stk_base = *arg_stk_base; + stk_end = *arg_stk_end; + stk = *arg_stk; + + n = stk_end - stk_base; + if (stk_base == stk_alloc && IS_NULL(msa->stack_p)) + { + x = (OnigStackType *)xmalloc(sizeof(OnigStackType) * n * 2); + if (IS_NULL(x)) + { + STACK_SAVE; + return ONIGERR_MEMORY; + } + xmemcpy(x, stk_base, n * sizeof(OnigStackType)); + n *= 2; + } + else + { + unsigned int limit_size = MatchStackLimitSize; + n *= 2; + if (limit_size != 0 && n > limit_size) + { + if ((unsigned int)(stk_end - stk_base) == limit_size) + return ONIGERR_MATCH_STACK_LIMIT_OVER; + else + n = limit_size; + } + x = (OnigStackType *)xrealloc(stk_base, sizeof(OnigStackType) * n); + if (IS_NULL(x)) + { + STACK_SAVE; + return ONIGERR_MEMORY; + } + } + *arg_stk = x + (stk - stk_base); + *arg_stk_base = x; + *arg_stk_end = x + n; + return 0; +} + +#define STACK_ENSURE(n) \ + do \ + { \ + if (stk_end - stk < (n)) \ + { \ + int r = stack_double(&stk_base, &stk_end, &stk, stk_alloc, msa); \ + if (r != 0) \ + { \ + STACK_SAVE; \ + if (xmalloc_base) \ + xfree(xmalloc_base); \ + return r; \ + } \ + } \ + } while (0) + +#define STACK_AT(index) (stk_base + (index)) +#define GET_STACK_INDEX(stk) ((stk) - stk_base) + +#define STACK_PUSH_TYPE(stack_type) \ + do \ + { \ + STACK_ENSURE(1); \ + stk->type = (stack_type); \ + STACK_INC; \ + } while (0) + +#define IS_TO_VOID_TARGET(stk) (((stk)->type & STK_MASK_TO_VOID_TARGET) != 0) + +#ifdef USE_COMBINATION_EXPLOSION_CHECK +# define STATE_CHECK_POS(s, snum) \ + (((s) - str) * num_comb_exp_check + ((snum) - 1)) +# define STATE_CHECK_VAL(v, snum) \ + do \ + { \ + if (state_check_buff != NULL) \ + { \ + int x = STATE_CHECK_POS(s, snum); \ + (v) = state_check_buff[x / 8] & (1 << (x % 8)); \ + } \ + else \ + (v) = 0; \ + } while (0) + +# define ELSE_IF_STATE_CHECK_MARK(stk) \ + else if ((stk)->type == STK_STATE_CHECK_MARK) \ + { \ + int x = STATE_CHECK_POS(stk->u.state.pstr, stk->u.state.state_check); \ + state_check_buff[x / 8] |= (1 << (x % 8)); \ + } + +# define STACK_PUSH(stack_type, pat, s, sprev, keep) \ + do \ + { \ + STACK_ENSURE(1); \ + stk->type = (stack_type); \ + stk->u.state.pcode = (pat); \ + stk->u.state.pstr = (s); \ + stk->u.state.pstr_prev = (sprev); \ + stk->u.state.state_check = 0; \ + stk->u.state.pkeep = (keep); \ + STACK_INC; \ + } while (0) + +# define STACK_PUSH_ENSURED(stack_type, pat) \ + do \ + { \ + stk->type = (stack_type); \ + stk->u.state.pcode = (pat); \ + stk->u.state.state_check = 0; \ + STACK_INC; \ + } while (0) + +# define STACK_PUSH_ALT_WITH_STATE_CHECK(pat, s, sprev, snum, keep) \ + do \ + { \ + STACK_ENSURE(1); \ + stk->type = STK_ALT; \ + stk->u.state.pcode = (pat); \ + stk->u.state.pstr = (s); \ + stk->u.state.pstr_prev = (sprev); \ + stk->u.state.state_check = ((state_check_buff != NULL) ? (snum) : 0); \ + stk->u.state.pkeep = (keep); \ + STACK_INC; \ + } while (0) + +# define STACK_PUSH_STATE_CHECK(s, snum) \ + do \ + { \ + if (state_check_buff != NULL) \ + { \ + STACK_ENSURE(1); \ + stk->type = STK_STATE_CHECK_MARK; \ + stk->u.state.pstr = (s); \ + stk->u.state.state_check = (snum); \ + STACK_INC; \ + } \ + } while (0) + +#else /* USE_COMBINATION_EXPLOSION_CHECK */ + +# define ELSE_IF_STATE_CHECK_MARK(stk) + +# define STACK_PUSH(stack_type, pat, s, sprev, keep) \ + do \ + { \ + STACK_ENSURE(1); \ + stk->type = (stack_type); \ + stk->u.state.pcode = (pat); \ + stk->u.state.pstr = (s); \ + stk->u.state.pstr_prev = (sprev); \ + stk->u.state.pkeep = (keep); \ + STACK_INC; \ + } while (0) + +# define STACK_PUSH_ENSURED(stack_type, pat) \ + do \ + { \ + stk->type = (stack_type); \ + stk->u.state.pcode = (pat); \ + STACK_INC; \ + } while (0) +#endif /* USE_COMBINATION_EXPLOSION_CHECK */ + +#define STACK_PUSH_ALT(pat, s, sprev, keep) \ + STACK_PUSH(STK_ALT, pat, s, sprev, keep) +#define STACK_PUSH_POS(s, sprev, keep) \ + STACK_PUSH(STK_POS, NULL_UCHARP, s, sprev, keep) +#define STACK_PUSH_POS_NOT(pat, s, sprev, keep) \ + STACK_PUSH(STK_POS_NOT, pat, s, sprev, keep) +#define STACK_PUSH_ABSENT STACK_PUSH_TYPE(STK_ABSENT) +#define STACK_PUSH_STOP_BT STACK_PUSH_TYPE(STK_STOP_BT) +#define STACK_PUSH_LOOK_BEHIND_NOT(pat, s, sprev, keep) \ + STACK_PUSH(STK_LOOK_BEHIND_NOT, pat, s, sprev, keep) + +#define STACK_PUSH_REPEAT(id, pat) \ + do \ + { \ + STACK_ENSURE(1); \ + stk->type = STK_REPEAT; \ + stk->u.repeat.num = (id); \ + stk->u.repeat.pcode = (pat); \ + stk->u.repeat.count = 0; \ + STACK_INC; \ + } while (0) + +#define STACK_PUSH_REPEAT_INC(sindex) \ + do \ + { \ + STACK_ENSURE(1); \ + stk->type = STK_REPEAT_INC; \ + stk->u.repeat_inc.si = (sindex); \ + STACK_INC; \ + } while (0) + +#define STACK_PUSH_MEM_START(mnum, s) \ + do \ + { \ + STACK_ENSURE(1); \ + stk->type = STK_MEM_START; \ + stk->u.mem.num = (mnum); \ + stk->u.mem.pstr = (s); \ + stk->u.mem.start = mem_start_stk[mnum]; \ + stk->u.mem.end = mem_end_stk[mnum]; \ + mem_start_stk[mnum] = GET_STACK_INDEX(stk); \ + mem_end_stk[mnum] = INVALID_STACK_INDEX; \ + STACK_INC; \ + } while (0) + +#define STACK_PUSH_MEM_END(mnum, s) \ + do \ + { \ + STACK_ENSURE(1); \ + stk->type = STK_MEM_END; \ + stk->u.mem.num = (mnum); \ + stk->u.mem.pstr = (s); \ + stk->u.mem.start = mem_start_stk[mnum]; \ + stk->u.mem.end = mem_end_stk[mnum]; \ + mem_end_stk[mnum] = GET_STACK_INDEX(stk); \ + STACK_INC; \ + } while (0) + +#define STACK_PUSH_MEM_END_MARK(mnum) \ + do \ + { \ + STACK_ENSURE(1); \ + stk->type = STK_MEM_END_MARK; \ + stk->u.mem.num = (mnum); \ + STACK_INC; \ + } while (0) + +#define STACK_GET_MEM_START(mnum, k) \ + do \ + { \ + int level = 0; \ + k = stk; \ + while (k > stk_base) \ + { \ + k--; \ + if ((k->type & STK_MASK_MEM_END_OR_MARK) != 0 && k->u.mem.num == (mnum)) \ + { \ + level++; \ + } \ + else if (k->type == STK_MEM_START && k->u.mem.num == (mnum)) \ + { \ + if (level == 0) \ + break; \ + level--; \ + } \ + } \ + } while (0) + +#define STACK_GET_MEM_RANGE(k, mnum, start, end) \ + do \ + { \ + int level = 0; \ + while (k < stk) \ + { \ + if (k->type == STK_MEM_START && k->u.mem.num == (mnum)) \ + { \ + if (level == 0) \ + (start) = k->u.mem.pstr; \ + level++; \ + } \ + else if (k->type == STK_MEM_END && k->u.mem.num == (mnum)) \ + { \ + level--; \ + if (level == 0) \ + { \ + (end) = k->u.mem.pstr; \ + break; \ + } \ + } \ + k++; \ + } \ + } while (0) + +#define STACK_PUSH_NULL_CHECK_START(cnum, s) \ + do \ + { \ + STACK_ENSURE(1); \ + stk->type = STK_NULL_CHECK_START; \ + stk->u.null_check.num = (cnum); \ + stk->u.null_check.pstr = (s); \ + STACK_INC; \ + } while (0) + +#define STACK_PUSH_NULL_CHECK_END(cnum) \ + do \ + { \ + STACK_ENSURE(1); \ + stk->type = STK_NULL_CHECK_END; \ + stk->u.null_check.num = (cnum); \ + STACK_INC; \ + } while (0) + +#define STACK_PUSH_CALL_FRAME(pat) \ + do \ + { \ + STACK_ENSURE(1); \ + stk->type = STK_CALL_FRAME; \ + stk->u.call_frame.ret_addr = (pat); \ + STACK_INC; \ + } while (0) + +#define STACK_PUSH_RETURN \ + do \ + { \ + STACK_ENSURE(1); \ + stk->type = STK_RETURN; \ + STACK_INC; \ + } while (0) + +#define STACK_PUSH_ABSENT_POS(start, end) \ + do \ + { \ + STACK_ENSURE(1); \ + stk->type = STK_ABSENT_POS; \ + stk->u.absent_pos.abs_pstr = (start); \ + stk->u.absent_pos.end_pstr = (end); \ + STACK_INC; \ + } while (0) + +#ifdef ONIG_DEBUG +# define STACK_BASE_CHECK(p, at) \ + if ((p) < stk_base) \ + { \ + fprintf(stderr, "at %s\n", at); \ + goto stack_error; \ + } +#else +# define STACK_BASE_CHECK(p, at) +#endif + +#define STACK_POP_ONE \ + do \ + { \ + stk--; \ + STACK_BASE_CHECK(stk, "STACK_POP_ONE"); \ + } while (0) + +#define STACK_POP \ + do \ + { \ + switch (pop_level) \ + { \ + case STACK_POP_LEVEL_FREE: \ + while (1) \ + { \ + stk--; \ + STACK_BASE_CHECK(stk, "STACK_POP"); \ + if ((stk->type & STK_MASK_POP_USED) != 0) \ + break; \ + ELSE_IF_STATE_CHECK_MARK(stk); \ + } \ + break; \ + case STACK_POP_LEVEL_MEM_START: \ + while (1) \ + { \ + stk--; \ + STACK_BASE_CHECK(stk, "STACK_POP 2"); \ + if ((stk->type & STK_MASK_POP_USED) != 0) \ + break; \ + else if (stk->type == STK_MEM_START) \ + { \ + mem_start_stk[stk->u.mem.num] = stk->u.mem.start; \ + mem_end_stk[stk->u.mem.num] = stk->u.mem.end; \ + } \ + ELSE_IF_STATE_CHECK_MARK(stk); \ + } \ + break; \ + default: \ + while (1) \ + { \ + stk--; \ + STACK_BASE_CHECK(stk, "STACK_POP 3"); \ + if ((stk->type & STK_MASK_POP_USED) != 0) \ + break; \ + else if (stk->type == STK_MEM_START) \ + { \ + mem_start_stk[stk->u.mem.num] = stk->u.mem.start; \ + mem_end_stk[stk->u.mem.num] = stk->u.mem.end; \ + } \ + else if (stk->type == STK_REPEAT_INC) \ + { \ + STACK_AT(stk->u.repeat_inc.si)->u.repeat.count--; \ + } \ + else if (stk->type == STK_MEM_END) \ + { \ + mem_start_stk[stk->u.mem.num] = stk->u.mem.start; \ + mem_end_stk[stk->u.mem.num] = stk->u.mem.end; \ + } \ + ELSE_IF_STATE_CHECK_MARK(stk); \ + } \ + break; \ + } \ + } while (0) + +#define STACK_POP_TIL_POS_NOT \ + do \ + { \ + while (1) \ + { \ + stk--; \ + STACK_BASE_CHECK(stk, "STACK_POP_TIL_POS_NOT"); \ + if (stk->type == STK_POS_NOT) \ + break; \ + else if (stk->type == STK_MEM_START) \ + { \ + mem_start_stk[stk->u.mem.num] = stk->u.mem.start; \ + mem_end_stk[stk->u.mem.num] = stk->u.mem.end; \ + } \ + else if (stk->type == STK_REPEAT_INC) \ + { \ + STACK_AT(stk->u.repeat_inc.si)->u.repeat.count--; \ + } \ + else if (stk->type == STK_MEM_END) \ + { \ + mem_start_stk[stk->u.mem.num] = stk->u.mem.start; \ + mem_end_stk[stk->u.mem.num] = stk->u.mem.end; \ + } \ + ELSE_IF_STATE_CHECK_MARK(stk); \ + } \ + } while (0) + +#define STACK_POP_TIL_LOOK_BEHIND_NOT \ + do \ + { \ + while (1) \ + { \ + stk--; \ + STACK_BASE_CHECK(stk, "STACK_POP_TIL_LOOK_BEHIND_NOT"); \ + if (stk->type == STK_LOOK_BEHIND_NOT) \ + break; \ + else if (stk->type == STK_MEM_START) \ + { \ + mem_start_stk[stk->u.mem.num] = stk->u.mem.start; \ + mem_end_stk[stk->u.mem.num] = stk->u.mem.end; \ + } \ + else if (stk->type == STK_REPEAT_INC) \ + { \ + STACK_AT(stk->u.repeat_inc.si)->u.repeat.count--; \ + } \ + else if (stk->type == STK_MEM_END) \ + { \ + mem_start_stk[stk->u.mem.num] = stk->u.mem.start; \ + mem_end_stk[stk->u.mem.num] = stk->u.mem.end; \ + } \ + ELSE_IF_STATE_CHECK_MARK(stk); \ + } \ + } while (0) + +#define STACK_POP_TIL_ABSENT \ + do \ + { \ + while (1) \ + { \ + stk--; \ + STACK_BASE_CHECK(stk, "STACK_POP_TIL_ABSENT"); \ + if (stk->type == STK_ABSENT) \ + break; \ + else if (stk->type == STK_MEM_START) \ + { \ + mem_start_stk[stk->u.mem.num] = stk->u.mem.start; \ + mem_end_stk[stk->u.mem.num] = stk->u.mem.end; \ + } \ + else if (stk->type == STK_REPEAT_INC) \ + { \ + STACK_AT(stk->u.repeat_inc.si)->u.repeat.count--; \ + } \ + else if (stk->type == STK_MEM_END) \ + { \ + mem_start_stk[stk->u.mem.num] = stk->u.mem.start; \ + mem_end_stk[stk->u.mem.num] = stk->u.mem.end; \ + } \ + ELSE_IF_STATE_CHECK_MARK(stk); \ + } \ + } while (0) + +#define STACK_POP_ABSENT_POS(start, end) \ + do \ + { \ + stk--; \ + STACK_BASE_CHECK(stk, "STACK_POP_ABSENT_POS"); \ + (start) = stk->u.absent_pos.abs_pstr; \ + (end) = stk->u.absent_pos.end_pstr; \ + } while (0) + +#define STACK_POS_END(k) \ + do \ + { \ + k = stk; \ + while (1) \ + { \ + k--; \ + STACK_BASE_CHECK(k, "STACK_POS_END"); \ + if (IS_TO_VOID_TARGET(k)) \ + { \ + k->type = STK_VOID; \ + } \ + else if (k->type == STK_POS) \ + { \ + k->type = STK_VOID; \ + break; \ + } \ + } \ + } while (0) + +#define STACK_STOP_BT_END \ + do \ + { \ + OnigStackType *k = stk; \ + while (1) \ + { \ + k--; \ + STACK_BASE_CHECK(k, "STACK_STOP_BT_END"); \ + if (IS_TO_VOID_TARGET(k)) \ + { \ + k->type = STK_VOID; \ + } \ + else if (k->type == STK_STOP_BT) \ + { \ + k->type = STK_VOID; \ + break; \ + } \ + } \ + } while (0) + +#define STACK_NULL_CHECK(isnull, id, s) \ + do \ + { \ + OnigStackType *k = stk; \ + while (1) \ + { \ + k--; \ + STACK_BASE_CHECK(k, "STACK_NULL_CHECK"); \ + if (k->type == STK_NULL_CHECK_START) \ + { \ + if (k->u.null_check.num == (id)) \ + { \ + (isnull) = (k->u.null_check.pstr == (s)); \ + break; \ + } \ + } \ + } \ + } while (0) + +#define STACK_NULL_CHECK_REC(isnull, id, s) \ + do \ + { \ + int level = 0; \ + OnigStackType *k = stk; \ + while (1) \ + { \ + k--; \ + STACK_BASE_CHECK(k, "STACK_NULL_CHECK_REC"); \ + if (k->type == STK_NULL_CHECK_START) \ + { \ + if (k->u.null_check.num == (id)) \ + { \ + if (level == 0) \ + { \ + (isnull) = (k->u.null_check.pstr == (s)); \ + break; \ + } \ + else \ + level--; \ + } \ + } \ + else if (k->type == STK_NULL_CHECK_END) \ + { \ + level++; \ + } \ + } \ + } while (0) + +#define STACK_NULL_CHECK_MEMST(isnull, id, s, reg) \ + do \ + { \ + OnigStackType *k = stk; \ + while (1) \ + { \ + k--; \ + STACK_BASE_CHECK(k, "STACK_NULL_CHECK_MEMST"); \ + if (k->type == STK_NULL_CHECK_START) \ + { \ + if (k->u.null_check.num == (id)) \ + { \ + if (k->u.null_check.pstr != (s)) \ + { \ + (isnull) = 0; \ + break; \ + } \ + else \ + { \ + UChar *endp; \ + (isnull) = 1; \ + while (k < stk) \ + { \ + if (k->type == STK_MEM_START) \ + { \ + if (k->u.mem.end == INVALID_STACK_INDEX) \ + { \ + (isnull) = 0; \ + break; \ + } \ + if (BIT_STATUS_AT(reg->bt_mem_end, k->u.mem.num)) \ + endp = STACK_AT(k->u.mem.end)->u.mem.pstr; \ + else \ + endp = (UChar *)k->u.mem.end; \ + if (STACK_AT(k->u.mem.start)->u.mem.pstr != endp) \ + { \ + (isnull) = 0; \ + break; \ + } \ + else if (endp != s) \ + { \ + (isnull) = -1; /* empty, but position changed */ \ + } \ + } \ + k++; \ + } \ + break; \ + } \ + } \ + } \ + } \ + } while (0) + +#define STACK_NULL_CHECK_MEMST_REC(isnull, id, s, reg) \ + do \ + { \ + int level = 0; \ + OnigStackType *k = stk; \ + while (1) \ + { \ + k--; \ + STACK_BASE_CHECK(k, "STACK_NULL_CHECK_MEMST_REC"); \ + if (k->type == STK_NULL_CHECK_START) \ + { \ + if (k->u.null_check.num == (id)) \ + { \ + if (level == 0) \ + { \ + if (k->u.null_check.pstr != (s)) \ + { \ + (isnull) = 0; \ + break; \ + } \ + else \ + { \ + UChar *endp; \ + (isnull) = 1; \ + while (k < stk) \ + { \ + if (k->type == STK_MEM_START) \ + { \ + if (k->u.mem.end == INVALID_STACK_INDEX) \ + { \ + (isnull) = 0; \ + break; \ + } \ + if (BIT_STATUS_AT(reg->bt_mem_end, k->u.mem.num)) \ + endp = STACK_AT(k->u.mem.end)->u.mem.pstr; \ + else \ + endp = (UChar *)k->u.mem.end; \ + if (STACK_AT(k->u.mem.start)->u.mem.pstr != endp) \ + { \ + (isnull) = 0; \ + break; \ + } \ + else if (endp != s) \ + { \ + (isnull) = -1; /* empty, but position changed */ \ + } \ + } \ + k++; \ + } \ + break; \ + } \ + } \ + else \ + { \ + level--; \ + } \ + } \ + } \ + else if (k->type == STK_NULL_CHECK_END) \ + { \ + if (k->u.null_check.num == (id)) \ + level++; \ + } \ + } \ + } while (0) + +#define STACK_GET_REPEAT(id, k) \ + do \ + { \ + int level = 0; \ + k = stk; \ + while (1) \ + { \ + k--; \ + STACK_BASE_CHECK(k, "STACK_GET_REPEAT"); \ + if (k->type == STK_REPEAT) \ + { \ + if (level == 0) \ + { \ + if (k->u.repeat.num == (id)) \ + { \ + break; \ + } \ + } \ + } \ + else if (k->type == STK_CALL_FRAME) \ + level--; \ + else if (k->type == STK_RETURN) \ + level++; \ + } \ + } while (0) + +#define STACK_RETURN(addr) \ + do \ + { \ + int level = 0; \ + OnigStackType *k = stk; \ + while (1) \ + { \ + k--; \ + STACK_BASE_CHECK(k, "STACK_RETURN"); \ + if (k->type == STK_CALL_FRAME) \ + { \ + if (level == 0) \ + { \ + (addr) = k->u.call_frame.ret_addr; \ + break; \ + } \ + else \ + level--; \ + } \ + else if (k->type == STK_RETURN) \ + level++; \ + } \ + } while (0) + +#define STRING_CMP(s1, s2, len) \ + do \ + { \ + while (len-- > 0) \ + { \ + if (*s1++ != *s2++) \ + goto fail; \ + } \ + } while (0) + +#define STRING_CMP_IC(case_fold_flag, s1, ps2, len, text_end) \ + do \ + { \ + if (string_cmp_ic(encode, case_fold_flag, s1, ps2, len, text_end) == 0) \ + goto fail; \ + } while (0) + +static int string_cmp_ic(OnigEncoding enc, int case_fold_flag, UChar *s1, + UChar **ps2, OnigDistance mblen, const UChar *text_end) +{ + UChar buf1[ONIGENC_MBC_CASE_FOLD_MAXLEN]; + UChar buf2[ONIGENC_MBC_CASE_FOLD_MAXLEN]; + UChar *p1, *p2, *end1, *s2; + int len1, len2; + + s2 = *ps2; + end1 = s1 + mblen; + while (s1 < end1) + { + len1 = ONIGENC_MBC_CASE_FOLD(enc, case_fold_flag, &s1, text_end, buf1); + len2 = ONIGENC_MBC_CASE_FOLD(enc, case_fold_flag, &s2, text_end, buf2); + if (len1 != len2) + return 0; + p1 = buf1; + p2 = buf2; + while (len1-- > 0) + { + if (*p1 != *p2) + return 0; + p1++; + p2++; + } + } + + *ps2 = s2; + return 1; +} + +#define STRING_CMP_VALUE(s1, s2, len, is_fail) \ + do \ + { \ + is_fail = 0; \ + while (len-- > 0) \ + { \ + if (*s1++ != *s2++) \ + { \ + is_fail = 1; \ + break; \ + } \ + } \ + } while (0) + +#define STRING_CMP_VALUE_IC(case_fold_flag, s1, ps2, len, text_end, is_fail) \ + do \ + { \ + if (string_cmp_ic(encode, case_fold_flag, s1, ps2, len, text_end) == 0) \ + is_fail = 1; \ + else \ + is_fail = 0; \ + } while (0) + +#define IS_EMPTY_STR (str == end) +#define ON_STR_BEGIN(s) ((s) == str) +#define ON_STR_END(s) ((s) == end) +#ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE +# define DATA_ENSURE_CHECK1 (s < right_range) +# define DATA_ENSURE_CHECK(n) (s + (n) <= right_range) +# define DATA_ENSURE(n) \ + if (s + (n) > right_range) \ + goto fail +# define ABSENT_END_POS right_range +#else +# define DATA_ENSURE_CHECK1 (s < end) +# define DATA_ENSURE_CHECK(n) (s + (n) <= end) +# define DATA_ENSURE(n) \ + if (s + (n) > end) \ + goto fail +# define ABSENT_END_POS end +#endif /* USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE */ + +#ifdef USE_CAPTURE_HISTORY +static int make_capture_history_tree(OnigCaptureTreeNode *node, + OnigStackType **kp, OnigStackType *stk_top, + UChar *str, regex_t *reg) +{ + int n, r; + OnigCaptureTreeNode *child; + OnigStackType *k = *kp; + + while (k < stk_top) + { + if (k->type == STK_MEM_START) + { + n = k->u.mem.num; + if (n <= ONIG_MAX_CAPTURE_HISTORY_GROUP + && BIT_STATUS_AT(reg->capture_history, n) != 0) + { + child = history_node_new(); + CHECK_NULL_RETURN_MEMERR(child); + child->group = n; + child->beg = k->u.mem.pstr - str; + r = history_tree_add_child(node, child); + if (r != 0) + { + history_tree_free(child); + return r; + } + *kp = (k + 1); + r = make_capture_history_tree(child, kp, stk_top, str, reg); + if (r != 0) + return r; + + k = *kp; + child->end = k->u.mem.pstr - str; + } + } + else if (k->type == STK_MEM_END) + { + if (k->u.mem.num == node->group) + { + node->end = k->u.mem.pstr - str; + *kp = k; + return 0; + } + } + k++; + } + + return 1; /* 1: root node ending. */ +} +#endif /* USE_CAPTURE_HISTORY */ + +#ifdef USE_BACKREF_WITH_LEVEL +static int mem_is_in_memp(int mem, int num, UChar *memp) +{ + int i; + MemNumType m; + + for (i = 0; i < num; i++) + { + GET_MEMNUM_INC(m, memp); + if (mem == (int)m) + return 1; + } + return 0; +} + +static int backref_match_at_nested_level(regex_t *reg, OnigStackType *top, + OnigStackType *stk_base, + int ignore_case, int case_fold_flag, + int nest, int mem_num, UChar *memp, + UChar **s, const UChar *send) +{ + UChar *ss, *p, *pstart, *pend = NULL_UCHARP; + int level; + OnigStackType *k; + + level = 0; + k = top; + k--; + while (k >= stk_base) + { + if (k->type == STK_CALL_FRAME) + { + level--; + } + else if (k->type == STK_RETURN) + { + level++; + } + else if (level == nest) + { + if (k->type == STK_MEM_START) + { + if (mem_is_in_memp(k->u.mem.num, mem_num, memp)) + { + pstart = k->u.mem.pstr; + if (pend != NULL_UCHARP) + { + if (pend - pstart > send - *s) + return 0; /* or goto next_mem; */ + p = pstart; + ss = *s; + + if (ignore_case != 0) + { + if (string_cmp_ic(reg->enc, case_fold_flag, pstart, &ss, + pend - pstart, send) + == 0) + return 0; /* or goto next_mem; */ + } + else + { + while (p < pend) + { + if (*p++ != *ss++) + return 0; /* or goto next_mem; */ + } + } + + *s = ss; + return 1; + } + } + } + else if (k->type == STK_MEM_END) + { + if (mem_is_in_memp(k->u.mem.num, mem_num, memp)) + { + pend = k->u.mem.pstr; + } + } + } + k--; + } + + return 0; +} +#endif /* USE_BACKREF_WITH_LEVEL */ + +#ifdef ONIG_DEBUG_STATISTICS + +# ifdef _WIN32 +# include <windows.h> +static LARGE_INTEGER ts, te, freq; +# define GETTIME(t) QueryPerformanceCounter(&(t)) +# define TIMEDIFF(te, ts) \ + (unsigned long)(((te).QuadPart - (ts).QuadPart) * 1000000 / freq.QuadPart) +# else /* _WIN32 */ + +# define USE_TIMEOFDAY + +# ifdef USE_TIMEOFDAY +# ifdef HAVE_SYS_TIME_H +# include <sys/time.h> +# endif +# ifdef HAVE_UNISTD_H +# include <unistd.h> +# endif +static struct timeval ts, te; +# define GETTIME(t) gettimeofday(&(t), (struct timezone *)0) +# define TIMEDIFF(te, ts) \ + (((te).tv_usec - (ts).tv_usec) \ + + (((te).tv_sec - (ts).tv_sec) * 1000000)) +# else /* USE_TIMEOFDAY */ +# ifdef HAVE_SYS_TIMES_H +# include <sys/times.h> +# endif +static struct tms ts, te; +# define GETTIME(t) times(&(t)) +# define TIMEDIFF(te, ts) ((te).tms_utime - (ts).tms_utime) +# endif /* USE_TIMEOFDAY */ + +# endif /* _WIN32 */ + +static int OpCounter[256]; +static int OpPrevCounter[256]; +static unsigned long OpTime[256]; +static int OpCurr = OP_FINISH; +static int OpPrevTarget = OP_FAIL; +static int MaxStackDepth = 0; + +# define MOP_IN(opcode) \ + do \ + { \ + if (opcode == OpPrevTarget) \ + OpPrevCounter[OpCurr]++; \ + OpCurr = opcode; \ + OpCounter[opcode]++; \ + GETTIME(ts); \ + } while (0) + +# define MOP_OUT \ + do \ + { \ + GETTIME(te); \ + OpTime[OpCurr] += TIMEDIFF(te, ts); \ + } while (0) + +extern void onig_statistics_init(void) +{ + int i; + for (i = 0; i < 256; i++) + { + OpCounter[i] = OpPrevCounter[i] = 0; + OpTime[i] = 0; + } + MaxStackDepth = 0; +# ifdef _WIN32 + QueryPerformanceFrequency(&freq); +# endif +} + +extern void onig_print_statistics(FILE *f) +{ + int i; + fprintf(f, " count prev time\n"); + for (i = 0; OnigOpInfo[i].opcode >= 0; i++) + { + fprintf(f, "%8d: %8d: %10lu: %s\n", OpCounter[i], OpPrevCounter[i], + OpTime[i], OnigOpInfo[i].name); + } + fprintf(f, "\nmax stack depth: %d\n", MaxStackDepth); +} + +# define STACK_INC \ + do \ + { \ + stk++; \ + if (stk - stk_base > MaxStackDepth) \ + MaxStackDepth = stk - stk_base; \ + } while (0) + +#else /* ONIG_DEBUG_STATISTICS */ +# define STACK_INC stk++ + +# define MOP_IN(opcode) +# define MOP_OUT +#endif /* ONIG_DEBUG_STATISTICS */ + +#ifdef ONIG_DEBUG_MATCH +static char *stack_type_str(int stack_type) +{ + switch (stack_type) + { + case STK_ALT: + return "Alt "; + case STK_LOOK_BEHIND_NOT: + return "LBNot "; + case STK_POS_NOT: + return "PosNot"; + case STK_MEM_START: + return "MemS "; + case STK_MEM_END: + return "MemE "; + case STK_REPEAT_INC: + return "RepInc"; + case STK_STATE_CHECK_MARK: + return "StChMk"; + case STK_NULL_CHECK_START: + return "NulChS"; + case STK_NULL_CHECK_END: + return "NulChE"; + case STK_MEM_END_MARK: + return "MemEMk"; + case STK_POS: + return "Pos "; + case STK_STOP_BT: + return "StopBt"; + case STK_REPEAT: + return "Rep "; + case STK_CALL_FRAME: + return "Call "; + case STK_RETURN: + return "Ret "; + case STK_VOID: + return "Void "; + case STK_ABSENT_POS: + return "AbsPos"; + case STK_ABSENT: + return "Absent"; + default: + return " "; + } +} +#endif + +/* match data(str - end) from position (sstart). */ +/* if sstart == str then set sprev to NULL. */ +static OnigPosition match_at(regex_t *reg, const UChar *str, const UChar *end, +#ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE + const UChar *right_range, +#endif + const UChar *sstart, UChar *sprev, + OnigMatchArg *msa) +{ + static const UChar FinishCode[] = {OP_FINISH}; + + int i, num_mem, pop_level; + ptrdiff_t n, best_len; + LengthType tlen, tlen2; + MemNumType mem; + RelAddrType addr; + OnigOptionType option = reg->options; + OnigEncoding encode = reg->enc; + OnigCaseFoldType case_fold_flag = reg->case_fold_flag; + UChar *s, *q, *sbegin; + UChar *p = reg->p; + UChar *pkeep; + char *alloca_base; + char *xmalloc_base = NULL; + OnigStackType *stk_alloc, *stk_base, *stk, *stk_end; + OnigStackType *stkp; /* used as any purpose. */ + OnigStackIndex si; + OnigStackIndex *repeat_stk; + OnigStackIndex *mem_start_stk, *mem_end_stk; +#ifdef USE_COMBINATION_EXPLOSION_CHECK + int scv; + unsigned char *state_check_buff = msa->state_check_buff; + int num_comb_exp_check = reg->num_comb_exp_check; +#endif + +#if USE_TOKEN_THREADED_VM +# define OP_OFFSET 1 +# define VM_LOOP JUMP; +# define VM_LOOP_END +# define CASE(x) \ + L_##x : sbegin = s; \ + OPCODE_EXEC_HOOK; +# define DEFAULT \ + L_DEFAULT: +# define NEXT \ + sprev = sbegin; \ + JUMP +# define JUMP goto *oplabels[*p++] + + static const void *oplabels[] + = {&&L_OP_FINISH, /* matching process terminator (no more alternative) */ + &&L_OP_END, /* pattern code terminator (success end) */ + + &&L_OP_EXACT1, /* single byte, N = 1 */ + &&L_OP_EXACT2, /* single byte, N = 2 */ + &&L_OP_EXACT3, /* single byte, N = 3 */ + &&L_OP_EXACT4, /* single byte, N = 4 */ + &&L_OP_EXACT5, /* single byte, N = 5 */ + &&L_OP_EXACTN, /* single byte */ + &&L_OP_EXACTMB2N1, /* mb-length = 2 N = 1 */ + &&L_OP_EXACTMB2N2, /* mb-length = 2 N = 2 */ + &&L_OP_EXACTMB2N3, /* mb-length = 2 N = 3 */ + &&L_OP_EXACTMB2N, /* mb-length = 2 */ + &&L_OP_EXACTMB3N, /* mb-length = 3 */ + &&L_OP_EXACTMBN, /* other length */ + + &&L_OP_EXACT1_IC, /* single byte, N = 1, ignore case */ + &&L_OP_EXACTN_IC, /* single byte, ignore case */ + + &&L_OP_CCLASS, + &&L_OP_CCLASS_MB, + &&L_OP_CCLASS_MIX, + &&L_OP_CCLASS_NOT, + &&L_OP_CCLASS_MB_NOT, + &&L_OP_CCLASS_MIX_NOT, + + &&L_OP_ANYCHAR, /* "." */ + &&L_OP_ANYCHAR_ML, /* "." multi-line */ + &&L_OP_ANYCHAR_STAR, /* ".*" */ + &&L_OP_ANYCHAR_ML_STAR, /* ".*" multi-line */ + &&L_OP_ANYCHAR_STAR_PEEK_NEXT, + &&L_OP_ANYCHAR_ML_STAR_PEEK_NEXT, + + &&L_OP_WORD, + &&L_OP_NOT_WORD, + &&L_OP_WORD_BOUND, + &&L_OP_NOT_WORD_BOUND, +# ifdef USE_WORD_BEGIN_END + &&L_OP_WORD_BEGIN, + &&L_OP_WORD_END, +# else + &&L_DEFAULT, + &&L_DEFAULT, +# endif + &&L_OP_ASCII_WORD, + &&L_OP_NOT_ASCII_WORD, + &&L_OP_ASCII_WORD_BOUND, + &&L_OP_NOT_ASCII_WORD_BOUND, +# ifdef USE_WORD_BEGIN_END + &&L_OP_ASCII_WORD_BEGIN, + &&L_OP_ASCII_WORD_END, +# else + &&L_DEFAULT, + &&L_DEFAULT, +# endif + + &&L_OP_BEGIN_BUF, + &&L_OP_END_BUF, + &&L_OP_BEGIN_LINE, + &&L_OP_END_LINE, + &&L_OP_SEMI_END_BUF, + &&L_OP_BEGIN_POSITION, + + &&L_OP_BACKREF1, + &&L_OP_BACKREF2, + &&L_OP_BACKREFN, + &&L_OP_BACKREFN_IC, + &&L_OP_BACKREF_MULTI, + &&L_OP_BACKREF_MULTI_IC, +# ifdef USE_BACKREF_WITH_LEVEL + &&L_OP_BACKREF_WITH_LEVEL, /* \k<xxx+n>, \k<xxx-n> */ +# else + &&L_DEFAULT, +# endif + &&L_OP_MEMORY_START, + &&L_OP_MEMORY_START_PUSH, /* push back-tracker to stack */ + &&L_OP_MEMORY_END_PUSH, /* push back-tracker to stack */ +# ifdef USE_SUBEXP_CALL + &&L_OP_MEMORY_END_PUSH_REC, /* push back-tracker to stack */ +# else + &&L_DEFAULT, +# endif + &&L_OP_MEMORY_END, +# ifdef USE_SUBEXP_CALL + &&L_OP_MEMORY_END_REC, /* push marker to stack */ +# else + &&L_DEFAULT, +# endif + + &&L_OP_KEEP, + + &&L_OP_FAIL, /* pop stack and move */ + &&L_OP_JUMP, + &&L_OP_PUSH, + &&L_OP_POP, +# ifdef USE_OP_PUSH_OR_JUMP_EXACT + &&L_OP_PUSH_OR_JUMP_EXACT1, /* if match exact then push, else jump. */ +# else + &&L_DEFAULT, +# endif + &&L_OP_PUSH_IF_PEEK_NEXT, /* if match exact then push, else none. */ + &&L_OP_REPEAT, /* {n,m} */ + &&L_OP_REPEAT_NG, /* {n,m}? (non greedy) */ + &&L_OP_REPEAT_INC, + &&L_OP_REPEAT_INC_NG, /* non greedy */ + &&L_OP_REPEAT_INC_SG, /* search and get in stack */ + &&L_OP_REPEAT_INC_NG_SG, /* search and get in stack (non greedy) */ + &&L_OP_NULL_CHECK_START, /* null loop checker start */ + &&L_OP_NULL_CHECK_END, /* null loop checker end */ +# ifdef USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT + &&L_OP_NULL_CHECK_END_MEMST, /* null loop checker end (with capture + status) */ +# else + &&L_DEFAULT, +# endif +# ifdef USE_SUBEXP_CALL + &&L_OP_NULL_CHECK_END_MEMST_PUSH, /* with capture status and push + check-end */ +# else + &&L_DEFAULT, +# endif + + &&L_OP_PUSH_POS, /* (?=...) start */ + &&L_OP_POP_POS, /* (?=...) end */ + &&L_OP_PUSH_POS_NOT, /* (?!...) start */ + &&L_OP_FAIL_POS, /* (?!...) end */ + &&L_OP_PUSH_STOP_BT, /* (?>...) start */ + &&L_OP_POP_STOP_BT, /* (?>...) end */ + &&L_OP_LOOK_BEHIND, /* (?<=...) start (no needs end opcode) */ + &&L_OP_PUSH_LOOK_BEHIND_NOT, /* (?<!...) start */ + &&L_OP_FAIL_LOOK_BEHIND_NOT, /* (?<!...) end */ + &&L_OP_PUSH_ABSENT_POS, /* (?~...) start */ + &&L_OP_ABSENT, /* (?~...) start of inner loop */ + &&L_OP_ABSENT_END, /* (?~...) end */ + +# ifdef USE_SUBEXP_CALL + &&L_OP_CALL, /* \g<name> */ + &&L_OP_RETURN, +# else + &&L_DEFAULT, + &&L_DEFAULT, +# endif + &&L_OP_CONDITION, + +# ifdef USE_COMBINATION_EXPLOSION_CHECK + &&L_OP_STATE_CHECK_PUSH, /* combination explosion check and push */ + &&L_OP_STATE_CHECK_PUSH_OR_JUMP, /* check ok -> push, else jump */ + &&L_OP_STATE_CHECK, /* check only */ +# else + &&L_DEFAULT, + &&L_DEFAULT, + &&L_DEFAULT, +# endif +# ifdef USE_COMBINATION_EXPLOSION_CHECK + &&L_OP_STATE_CHECK_ANYCHAR_STAR, + &&L_OP_STATE_CHECK_ANYCHAR_ML_STAR, +# else + &&L_DEFAULT, + &&L_DEFAULT, +# endif + /* no need: IS_DYNAMIC_OPTION() == 0 */ +# if 0 /* no need: IS_DYNAMIC_OPTION() == 0 */ + &&L_OP_SET_OPTION_PUSH, /* set option and push recover option */ + &&L_OP_SET_OPTION /* set option */ +# else + &&L_DEFAULT, + &&L_DEFAULT +# endif + }; +#else /* USE_TOKEN_THREADED_VM */ + +# define OP_OFFSET 0 +# define VM_LOOP \ + while (1) \ + { \ + OPCODE_EXEC_HOOK; \ + sbegin = s; \ + switch (*p++) \ + { +# define VM_LOOP_END \ + } \ + sprev = sbegin; \ + } +# define CASE(x) case x: +# define DEFAULT default: +# define NEXT break +# define JUMP \ + continue; \ + break +#endif /* USE_TOKEN_THREADED_VM */ + +#ifdef USE_SUBEXP_CALL +/* Stack #0 is used to store the pattern itself and used for (?R), \g<0>, + etc. Additional space is required. */ +# define ADD_NUMMEM 1 +#else +/* Stack #0 not is used. */ +# define ADD_NUMMEM 0 +#endif + + n = reg->num_repeat + (reg->num_mem + ADD_NUMMEM) * 2; + + STACK_INIT(alloca_base, xmalloc_base, n, INIT_MATCH_STACK_SIZE); + pop_level = reg->stack_pop_level; + num_mem = reg->num_mem; + repeat_stk = (OnigStackIndex *)alloca_base; + + mem_start_stk = (OnigStackIndex *)(repeat_stk + reg->num_repeat); + mem_end_stk = mem_start_stk + (num_mem + ADD_NUMMEM); + { + OnigStackIndex *pp = mem_start_stk; + for (; pp < repeat_stk + n; pp += 2) + { + pp[0] = INVALID_STACK_INDEX; + pp[1] = INVALID_STACK_INDEX; + } + } +#ifndef USE_SUBEXP_CALL + mem_start_stk--; /* for index start from 1, + mem_start_stk[1]..mem_start_stk[num_mem] */ + mem_end_stk--; /* for index start from 1, + mem_end_stk[1]..mem_end_stk[num_mem] */ +#endif + +#ifdef ONIG_DEBUG_MATCH + fprintf(stderr, + "match_at: str: %" PRIuPTR " (%p), end: %" PRIuPTR + " (%p), start: %" PRIuPTR " (%p), sprev: %" PRIuPTR " (%p)\n", + (uintptr_t)str, str, (uintptr_t)end, end, (uintptr_t)sstart, sstart, + (uintptr_t)sprev, sprev); + fprintf(stderr, "size: %d, start offset: %d\n", (int)(end - str), + (int)(sstart - str)); + fprintf(stderr, "\n ofs> str stk:type addr:opcode\n"); +#endif + + STACK_PUSH_ENSURED(STK_ALT, (UChar *)FinishCode); /* bottom stack */ + best_len = ONIG_MISMATCH; + s = (UChar *)sstart; + pkeep = (UChar *)sstart; + +#ifdef ONIG_DEBUG_MATCH +# define OPCODE_EXEC_HOOK \ + if (s) \ + { \ + UChar *op, *q, *bp, buf[50]; \ + int len; \ + op = p - OP_OFFSET; \ + fprintf(stderr, "%4" PRIdPTR "> \"", \ + (*op == OP_FINISH) ? (ptrdiff_t)-1 : s - str); \ + bp = buf; \ + q = s; \ + if (*op != OP_FINISH) \ + { /* s may not be a valid pointer if OP_FINISH. */ \ + for (i = 0; i < 7 && q < end; i++) \ + { \ + len = enclen(encode, q, end); \ + while (len-- > 0) \ + *bp++ = *q++; \ + } \ + if (q < end) \ + { \ + xmemcpy(bp, "...", 3); \ + bp += 3; \ + } \ + } \ + xmemcpy(bp, "\"", 1); \ + bp += 1; \ + *bp = 0; \ + fputs((char *)buf, stderr); \ + for (i = 0; i < 20 - (bp - buf); i++) \ + fputc(' ', stderr); \ + fprintf(stderr, "%4" PRIdPTR ":%s %4" PRIdPTR ":", stk - stk_base - 1, \ + (stk > stk_base) ? stack_type_str(stk[-1].type) : " ", \ + (op == FinishCode) ? (ptrdiff_t)-1 : op - reg->p); \ + onig_print_compiled_byte_code(stderr, op, reg->p + reg->used, NULL, \ + encode); \ + fprintf(stderr, "\n"); \ + } +#else +# define OPCODE_EXEC_HOOK ((void)0) +#endif + + VM_LOOP + { + CASE(OP_END) MOP_IN(OP_END); + n = s - sstart; + if (n > best_len) + { + OnigRegion *region; +#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE + if (IS_FIND_LONGEST(option)) + { + if (n > msa->best_len) + { + msa->best_len = n; + msa->best_s = (UChar *)sstart; + } + else + goto end_best_len; + } +#endif + best_len = n; + region = msa->region; + if (region) + { + region->beg[0] = ((pkeep > s) ? s : pkeep) - str; + region->end[0] = s - str; + for (i = 1; i <= num_mem; i++) + { + if (mem_end_stk[i] != INVALID_STACK_INDEX) + { + if (BIT_STATUS_AT(reg->bt_mem_start, i)) + region->beg[i] = STACK_AT(mem_start_stk[i])->u.mem.pstr - str; + else + region->beg[i] = (UChar *)((void *)mem_start_stk[i]) - str; + + region->end[i] = (BIT_STATUS_AT(reg->bt_mem_end, i) + ? STACK_AT(mem_end_stk[i])->u.mem.pstr + : (UChar *)((void *)mem_end_stk[i])) + - str; + } + else + { + region->beg[i] = region->end[i] = ONIG_REGION_NOTPOS; + } + } + +#ifdef USE_CAPTURE_HISTORY + if (reg->capture_history != 0) + { + int r; + OnigCaptureTreeNode *node; + + if (IS_NULL(region->history_root)) + { + region->history_root = node = history_node_new(); + CHECK_NULL_RETURN_MEMERR(node); + } + else + { + node = region->history_root; + history_tree_clear(node); + } + + node->group = 0; + node->beg = ((pkeep > s) ? s : pkeep) - str; + node->end = s - str; + + stkp = stk_base; + r = make_capture_history_tree(region->history_root, &stkp, stk, + (UChar *)str, reg); + if (r < 0) + { + best_len = r; /* error code */ + goto finish; + } + } +#endif /* USE_CAPTURE_HISTORY */ + } /* if (region) */ + } /* n > best_len */ + +#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE + end_best_len: +#endif + MOP_OUT; + + if (IS_FIND_CONDITION(option)) + { + if (IS_FIND_NOT_EMPTY(option) && s == sstart) + { + best_len = ONIG_MISMATCH; + goto fail; /* for retry */ + } + if (IS_FIND_LONGEST(option) && DATA_ENSURE_CHECK1) + { + goto fail; /* for retry */ + } + } + + /* default behavior: return first-matching result. */ + goto finish; + NEXT; + + CASE(OP_EXACT1) MOP_IN(OP_EXACT1); +#if 0 + DATA_ENSURE(1); + if (*p != *s) goto fail; + p++; s++; +#endif + if (*p != *s++) + goto fail; + DATA_ENSURE(0); + p++; + MOP_OUT; + NEXT; + + CASE(OP_EXACT1_IC) MOP_IN(OP_EXACT1_IC); + { + int len; + UChar *q, lowbuf[ONIGENC_MBC_CASE_FOLD_MAXLEN]; + + DATA_ENSURE(1); + len = ONIGENC_MBC_CASE_FOLD( + encode, + /* DISABLE_CASE_FOLD_MULTI_CHAR(case_fold_flag), */ + case_fold_flag, &s, end, lowbuf); + DATA_ENSURE(0); + q = lowbuf; + while (len-- > 0) + { + if (*p != *q) + { + goto fail; + } + p++; + q++; + } + } + MOP_OUT; + NEXT; + + CASE(OP_EXACT2) MOP_IN(OP_EXACT2); + DATA_ENSURE(2); + if (*p != *s) + goto fail; + p++; + s++; + if (*p != *s) + goto fail; + sprev = s; + p++; + s++; + MOP_OUT; + JUMP; + + CASE(OP_EXACT3) MOP_IN(OP_EXACT3); + DATA_ENSURE(3); + if (*p != *s) + goto fail; + p++; + s++; + if (*p != *s) + goto fail; + p++; + s++; + if (*p != *s) + goto fail; + sprev = s; + p++; + s++; + MOP_OUT; + JUMP; + + CASE(OP_EXACT4) MOP_IN(OP_EXACT4); + DATA_ENSURE(4); + if (*p != *s) + goto fail; + p++; + s++; + if (*p != *s) + goto fail; + p++; + s++; + if (*p != *s) + goto fail; + p++; + s++; + if (*p != *s) + goto fail; + sprev = s; + p++; + s++; + MOP_OUT; + JUMP; + + CASE(OP_EXACT5) MOP_IN(OP_EXACT5); + DATA_ENSURE(5); + if (*p != *s) + goto fail; + p++; + s++; + if (*p != *s) + goto fail; + p++; + s++; + if (*p != *s) + goto fail; + p++; + s++; + if (*p != *s) + goto fail; + p++; + s++; + if (*p != *s) + goto fail; + sprev = s; + p++; + s++; + MOP_OUT; + JUMP; + + CASE(OP_EXACTN) MOP_IN(OP_EXACTN); + GET_LENGTH_INC(tlen, p); + DATA_ENSURE(tlen); + while (tlen-- > 0) + { + if (*p++ != *s++) + goto fail; + } + sprev = s - 1; + MOP_OUT; + JUMP; + + CASE(OP_EXACTN_IC) MOP_IN(OP_EXACTN_IC); + { + int len; + UChar *q, *endp, lowbuf[ONIGENC_MBC_CASE_FOLD_MAXLEN]; + + GET_LENGTH_INC(tlen, p); + endp = p + tlen; + + while (p < endp) + { + sprev = s; + DATA_ENSURE(1); + len = ONIGENC_MBC_CASE_FOLD( + encode, + /* DISABLE_CASE_FOLD_MULTI_CHAR(case_fold_flag), */ + case_fold_flag, &s, end, lowbuf); + DATA_ENSURE(0); + q = lowbuf; + while (len-- > 0) + { + if (*p != *q) + goto fail; + p++; + q++; + } + } + } + + MOP_OUT; + JUMP; + + CASE(OP_EXACTMB2N1) MOP_IN(OP_EXACTMB2N1); + DATA_ENSURE(2); + if (*p != *s) + goto fail; + p++; + s++; + if (*p != *s) + goto fail; + p++; + s++; + MOP_OUT; + NEXT; + + CASE(OP_EXACTMB2N2) MOP_IN(OP_EXACTMB2N2); + DATA_ENSURE(4); + if (*p != *s) + goto fail; + p++; + s++; + if (*p != *s) + goto fail; + p++; + s++; + sprev = s; + if (*p != *s) + goto fail; + p++; + s++; + if (*p != *s) + goto fail; + p++; + s++; + MOP_OUT; + JUMP; + + CASE(OP_EXACTMB2N3) MOP_IN(OP_EXACTMB2N3); + DATA_ENSURE(6); + if (*p != *s) + goto fail; + p++; + s++; + if (*p != *s) + goto fail; + p++; + s++; + if (*p != *s) + goto fail; + p++; + s++; + if (*p != *s) + goto fail; + p++; + s++; + sprev = s; + if (*p != *s) + goto fail; + p++; + s++; + if (*p != *s) + goto fail; + p++; + s++; + MOP_OUT; + JUMP; + + CASE(OP_EXACTMB2N) MOP_IN(OP_EXACTMB2N); + GET_LENGTH_INC(tlen, p); + DATA_ENSURE(tlen * 2); + while (tlen-- > 0) + { + if (*p != *s) + goto fail; + p++; + s++; + if (*p != *s) + goto fail; + p++; + s++; + } + sprev = s - 2; + MOP_OUT; + JUMP; + + CASE(OP_EXACTMB3N) MOP_IN(OP_EXACTMB3N); + GET_LENGTH_INC(tlen, p); + DATA_ENSURE(tlen * 3); + while (tlen-- > 0) + { + if (*p != *s) + goto fail; + p++; + s++; + if (*p != *s) + goto fail; + p++; + s++; + if (*p != *s) + goto fail; + p++; + s++; + } + sprev = s - 3; + MOP_OUT; + JUMP; + + CASE(OP_EXACTMBN) MOP_IN(OP_EXACTMBN); + GET_LENGTH_INC(tlen, p); /* mb-len */ + GET_LENGTH_INC(tlen2, p); /* string len */ + tlen2 *= tlen; + DATA_ENSURE(tlen2); + while (tlen2-- > 0) + { + if (*p != *s) + goto fail; + p++; + s++; + } + sprev = s - tlen; + MOP_OUT; + JUMP; + + CASE(OP_CCLASS) MOP_IN(OP_CCLASS); + DATA_ENSURE(1); + if (BITSET_AT(((BitSetRef)p), *s) == 0) + goto fail; + p += SIZE_BITSET; + s += enclen(encode, s, end); /* OP_CCLASS can match mb-code. \D, \S */ + MOP_OUT; + NEXT; + + CASE(OP_CCLASS_MB) MOP_IN(OP_CCLASS_MB); + if (!ONIGENC_IS_MBC_HEAD(encode, s, end)) + goto fail; + + cclass_mb: + GET_LENGTH_INC(tlen, p); + { + OnigCodePoint code; + UChar *ss; + int mb_len; + + DATA_ENSURE(1); + mb_len = enclen(encode, s, end); + DATA_ENSURE(mb_len); + ss = s; + s += mb_len; + code = ONIGENC_MBC_TO_CODE(encode, ss, s); + +#ifdef PLATFORM_UNALIGNED_WORD_ACCESS + if (!onig_is_in_code_range(p, code)) + goto fail; +#else + q = p; + ALIGNMENT_RIGHT(q); + if (!onig_is_in_code_range(q, code)) + goto fail; +#endif + } + p += tlen; + MOP_OUT; + NEXT; + + CASE(OP_CCLASS_MIX) MOP_IN(OP_CCLASS_MIX); + DATA_ENSURE(1); + if (ONIGENC_IS_MBC_HEAD(encode, s, end)) + { + p += SIZE_BITSET; + goto cclass_mb; + } + else + { + if (BITSET_AT(((BitSetRef)p), *s) == 0) + goto fail; + + p += SIZE_BITSET; + GET_LENGTH_INC(tlen, p); + p += tlen; + s++; + } + MOP_OUT; + NEXT; + + CASE(OP_CCLASS_NOT) MOP_IN(OP_CCLASS_NOT); + DATA_ENSURE(1); + if (BITSET_AT(((BitSetRef)p), *s) != 0) + goto fail; + p += SIZE_BITSET; + s += enclen(encode, s, end); + MOP_OUT; + NEXT; + + CASE(OP_CCLASS_MB_NOT) MOP_IN(OP_CCLASS_MB_NOT); + DATA_ENSURE(1); + if (!ONIGENC_IS_MBC_HEAD(encode, s, end)) + { + s++; + GET_LENGTH_INC(tlen, p); + p += tlen; + goto cc_mb_not_success; + } + + cclass_mb_not: + GET_LENGTH_INC(tlen, p); + { + OnigCodePoint code; + UChar *ss; + int mb_len = enclen(encode, s, end); + + if (!DATA_ENSURE_CHECK(mb_len)) + { + DATA_ENSURE(1); + s = (UChar *)end; + p += tlen; + goto cc_mb_not_success; + } + + ss = s; + s += mb_len; + code = ONIGENC_MBC_TO_CODE(encode, ss, s); + +#ifdef PLATFORM_UNALIGNED_WORD_ACCESS + if (onig_is_in_code_range(p, code)) + goto fail; +#else + q = p; + ALIGNMENT_RIGHT(q); + if (onig_is_in_code_range(q, code)) + goto fail; +#endif + } + p += tlen; + + cc_mb_not_success: + MOP_OUT; + NEXT; + + CASE(OP_CCLASS_MIX_NOT) MOP_IN(OP_CCLASS_MIX_NOT); + DATA_ENSURE(1); + if (ONIGENC_IS_MBC_HEAD(encode, s, end)) + { + p += SIZE_BITSET; + goto cclass_mb_not; + } + else + { + if (BITSET_AT(((BitSetRef)p), *s) != 0) + goto fail; + + p += SIZE_BITSET; + GET_LENGTH_INC(tlen, p); + p += tlen; + s++; + } + MOP_OUT; + NEXT; + + CASE(OP_ANYCHAR) MOP_IN(OP_ANYCHAR); + DATA_ENSURE(1); + n = enclen(encode, s, end); + DATA_ENSURE(n); + if (ONIGENC_IS_MBC_NEWLINE_EX(encode, s, str, end, option, 0)) + goto fail; + s += n; + MOP_OUT; + NEXT; + + CASE(OP_ANYCHAR_ML) MOP_IN(OP_ANYCHAR_ML); + DATA_ENSURE(1); + n = enclen(encode, s, end); + DATA_ENSURE(n); + s += n; + MOP_OUT; + NEXT; + + CASE(OP_ANYCHAR_STAR) MOP_IN(OP_ANYCHAR_STAR); + while (DATA_ENSURE_CHECK1) + { + STACK_PUSH_ALT(p, s, sprev, pkeep); + n = enclen(encode, s, end); + DATA_ENSURE(n); + if (ONIGENC_IS_MBC_NEWLINE_EX(encode, s, str, end, option, 0)) + goto fail; + sprev = s; + s += n; + } + MOP_OUT; + NEXT; + + CASE(OP_ANYCHAR_ML_STAR) MOP_IN(OP_ANYCHAR_ML_STAR); + while (DATA_ENSURE_CHECK1) + { + STACK_PUSH_ALT(p, s, sprev, pkeep); + n = enclen(encode, s, end); + if (n > 1) + { + DATA_ENSURE(n); + sprev = s; + s += n; + } + else + { + sprev = s; + s++; + } + } + MOP_OUT; + NEXT; + + CASE(OP_ANYCHAR_STAR_PEEK_NEXT) MOP_IN(OP_ANYCHAR_STAR_PEEK_NEXT); + while (DATA_ENSURE_CHECK1) + { + if (*p == *s) + { + STACK_PUSH_ALT(p + 1, s, sprev, pkeep); + } + n = enclen(encode, s, end); + DATA_ENSURE(n); + if (ONIGENC_IS_MBC_NEWLINE_EX(encode, s, str, end, option, 0)) + goto fail; + sprev = s; + s += n; + } + p++; + MOP_OUT; + NEXT; + + CASE(OP_ANYCHAR_ML_STAR_PEEK_NEXT) MOP_IN(OP_ANYCHAR_ML_STAR_PEEK_NEXT); + while (DATA_ENSURE_CHECK1) + { + if (*p == *s) + { + STACK_PUSH_ALT(p + 1, s, sprev, pkeep); + } + n = enclen(encode, s, end); + if (n > 1) + { + DATA_ENSURE(n); + sprev = s; + s += n; + } + else + { + sprev = s; + s++; + } + } + p++; + MOP_OUT; + NEXT; + +#ifdef USE_COMBINATION_EXPLOSION_CHECK + CASE(OP_STATE_CHECK_ANYCHAR_STAR) MOP_IN(OP_STATE_CHECK_ANYCHAR_STAR); + GET_STATE_CHECK_NUM_INC(mem, p); + while (DATA_ENSURE_CHECK1) + { + STATE_CHECK_VAL(scv, mem); + if (scv) + goto fail; + + STACK_PUSH_ALT_WITH_STATE_CHECK(p, s, sprev, mem, pkeep); + n = enclen(encode, s, end); + DATA_ENSURE(n); + if (ONIGENC_IS_MBC_NEWLINE_EX(encode, s, str, end, option, 0)) + goto fail; + sprev = s; + s += n; + } + MOP_OUT; + NEXT; + + CASE(OP_STATE_CHECK_ANYCHAR_ML_STAR) + MOP_IN(OP_STATE_CHECK_ANYCHAR_ML_STAR); + + GET_STATE_CHECK_NUM_INC(mem, p); + while (DATA_ENSURE_CHECK1) + { + STATE_CHECK_VAL(scv, mem); + if (scv) + goto fail; + + STACK_PUSH_ALT_WITH_STATE_CHECK(p, s, sprev, mem, pkeep); + n = enclen(encode, s, end); + if (n > 1) + { + DATA_ENSURE(n); + sprev = s; + s += n; + } + else + { + sprev = s; + s++; + } + } + MOP_OUT; + NEXT; +#endif /* USE_COMBINATION_EXPLOSION_CHECK */ + + CASE(OP_WORD) MOP_IN(OP_WORD); + DATA_ENSURE(1); + if (!ONIGENC_IS_MBC_WORD(encode, s, end)) + goto fail; + + s += enclen(encode, s, end); + MOP_OUT; + NEXT; + + CASE(OP_ASCII_WORD) MOP_IN(OP_ASCII_WORD); + DATA_ENSURE(1); + if (!ONIGENC_IS_MBC_ASCII_WORD(encode, s, end)) + goto fail; + + s += enclen(encode, s, end); + MOP_OUT; + NEXT; + + CASE(OP_NOT_WORD) MOP_IN(OP_NOT_WORD); + DATA_ENSURE(1); + if (ONIGENC_IS_MBC_WORD(encode, s, end)) + goto fail; + + s += enclen(encode, s, end); + MOP_OUT; + NEXT; + + CASE(OP_NOT_ASCII_WORD) MOP_IN(OP_NOT_ASCII_WORD); + DATA_ENSURE(1); + if (ONIGENC_IS_MBC_ASCII_WORD(encode, s, end)) + goto fail; + + s += enclen(encode, s, end); + MOP_OUT; + NEXT; + + CASE(OP_WORD_BOUND) MOP_IN(OP_WORD_BOUND); + if (ON_STR_BEGIN(s)) + { + DATA_ENSURE(1); + if (!ONIGENC_IS_MBC_WORD(encode, s, end)) + goto fail; + } + else if (ON_STR_END(s)) + { + if (!ONIGENC_IS_MBC_WORD(encode, sprev, end)) + goto fail; + } + else + { + if (ONIGENC_IS_MBC_WORD(encode, s, end) + == ONIGENC_IS_MBC_WORD(encode, sprev, end)) + goto fail; + } + MOP_OUT; + JUMP; + + CASE(OP_ASCII_WORD_BOUND) MOP_IN(OP_ASCII_WORD_BOUND); + if (ON_STR_BEGIN(s)) + { + DATA_ENSURE(1); + if (!ONIGENC_IS_MBC_ASCII_WORD(encode, s, end)) + goto fail; + } + else if (ON_STR_END(s)) + { + if (!ONIGENC_IS_MBC_ASCII_WORD(encode, sprev, end)) + goto fail; + } + else + { + if (ONIGENC_IS_MBC_ASCII_WORD(encode, s, end) + == ONIGENC_IS_MBC_ASCII_WORD(encode, sprev, end)) + goto fail; + } + MOP_OUT; + JUMP; + + CASE(OP_NOT_WORD_BOUND) MOP_IN(OP_NOT_WORD_BOUND); + if (ON_STR_BEGIN(s)) + { + if (DATA_ENSURE_CHECK1 && ONIGENC_IS_MBC_WORD(encode, s, end)) + goto fail; + } + else if (ON_STR_END(s)) + { + if (ONIGENC_IS_MBC_WORD(encode, sprev, end)) + goto fail; + } + else + { + if (ONIGENC_IS_MBC_WORD(encode, s, end) + != ONIGENC_IS_MBC_WORD(encode, sprev, end)) + goto fail; + } + MOP_OUT; + JUMP; + + CASE(OP_NOT_ASCII_WORD_BOUND) MOP_IN(OP_NOT_ASCII_WORD_BOUND); + if (ON_STR_BEGIN(s)) + { + if (DATA_ENSURE_CHECK1 && ONIGENC_IS_MBC_ASCII_WORD(encode, s, end)) + goto fail; + } + else if (ON_STR_END(s)) + { + if (ONIGENC_IS_MBC_ASCII_WORD(encode, sprev, end)) + goto fail; + } + else + { + if (ONIGENC_IS_MBC_ASCII_WORD(encode, s, end) + != ONIGENC_IS_MBC_ASCII_WORD(encode, sprev, end)) + goto fail; + } + MOP_OUT; + JUMP; + +#ifdef USE_WORD_BEGIN_END + CASE(OP_WORD_BEGIN) MOP_IN(OP_WORD_BEGIN); + if (DATA_ENSURE_CHECK1 && ONIGENC_IS_MBC_WORD(encode, s, end)) + { + if (ON_STR_BEGIN(s) || !ONIGENC_IS_MBC_WORD(encode, sprev, end)) + { + MOP_OUT; + JUMP; + } + } + goto fail; + NEXT; + + CASE(OP_ASCII_WORD_BEGIN) MOP_IN(OP_ASCII_WORD_BEGIN); + if (DATA_ENSURE_CHECK1 && ONIGENC_IS_MBC_ASCII_WORD(encode, s, end)) + { + if (ON_STR_BEGIN(s) || !ONIGENC_IS_MBC_ASCII_WORD(encode, sprev, end)) + { + MOP_OUT; + JUMP; + } + } + goto fail; + NEXT; + + CASE(OP_WORD_END) MOP_IN(OP_WORD_END); + if (!ON_STR_BEGIN(s) && ONIGENC_IS_MBC_WORD(encode, sprev, end)) + { + if (ON_STR_END(s) || !ONIGENC_IS_MBC_WORD(encode, s, end)) + { + MOP_OUT; + JUMP; + } + } + goto fail; + NEXT; + + CASE(OP_ASCII_WORD_END) MOP_IN(OP_ASCII_WORD_END); + if (!ON_STR_BEGIN(s) && ONIGENC_IS_MBC_ASCII_WORD(encode, sprev, end)) + { + if (ON_STR_END(s) || !ONIGENC_IS_MBC_ASCII_WORD(encode, s, end)) + { + MOP_OUT; + JUMP; + } + } + goto fail; + NEXT; +#endif + + CASE(OP_BEGIN_BUF) MOP_IN(OP_BEGIN_BUF); + if (!ON_STR_BEGIN(s)) + goto fail; + if (IS_NOTBOS(msa->options)) + goto fail; + + MOP_OUT; + JUMP; + + CASE(OP_END_BUF) MOP_IN(OP_END_BUF); + if (!ON_STR_END(s)) + goto fail; + if (IS_NOTEOS(msa->options)) + goto fail; + + MOP_OUT; + JUMP; + + CASE(OP_BEGIN_LINE) MOP_IN(OP_BEGIN_LINE); + if (ON_STR_BEGIN(s)) + { + if (IS_NOTBOL(msa->options)) + goto fail; + MOP_OUT; + JUMP; + } + else if (ONIGENC_IS_MBC_NEWLINE(encode, sprev, end) +#ifdef USE_CRNL_AS_LINE_TERMINATOR + && !(IS_NEWLINE_CRLF(option) + && ONIGENC_IS_MBC_CRNL(encode, sprev, end)) +#endif + && !ON_STR_END(s)) + { + MOP_OUT; + JUMP; + } + goto fail; + NEXT; + + CASE(OP_END_LINE) MOP_IN(OP_END_LINE); + if (ON_STR_END(s)) + { +#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE + if (IS_EMPTY_STR + || !ONIGENC_IS_MBC_NEWLINE_EX(encode, sprev, str, end, option, 1)) + { +#endif + if (IS_NOTEOL(msa->options)) + goto fail; + MOP_OUT; + JUMP; +#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE + } +#endif + } + else if (ONIGENC_IS_MBC_NEWLINE_EX(encode, s, str, end, option, 1)) + { + MOP_OUT; + JUMP; + } + goto fail; + NEXT; + + CASE(OP_SEMI_END_BUF) MOP_IN(OP_SEMI_END_BUF); + if (ON_STR_END(s)) + { +#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE + if (IS_EMPTY_STR + || !ONIGENC_IS_MBC_NEWLINE_EX(encode, sprev, str, end, option, 1)) + { +#endif + if (IS_NOTEOL(msa->options)) + goto fail; + MOP_OUT; + JUMP; +#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE + } +#endif + } + else if (ONIGENC_IS_MBC_NEWLINE_EX(encode, s, str, end, option, 1)) + { + UChar *ss = s + enclen(encode, s, end); + if (ON_STR_END(ss)) + { + MOP_OUT; + JUMP; + } +#ifdef USE_CRNL_AS_LINE_TERMINATOR + else if (IS_NEWLINE_CRLF(option) && ONIGENC_IS_MBC_CRNL(encode, s, end)) + { + ss += enclen(encode, ss, end); + if (ON_STR_END(ss)) + { + MOP_OUT; + JUMP; + } + } +#endif + } + goto fail; + NEXT; + + CASE(OP_BEGIN_POSITION) MOP_IN(OP_BEGIN_POSITION); + if (s != msa->gpos) + goto fail; + + MOP_OUT; + JUMP; + + CASE(OP_MEMORY_START_PUSH) MOP_IN(OP_MEMORY_START_PUSH); + GET_MEMNUM_INC(mem, p); + STACK_PUSH_MEM_START(mem, s); + MOP_OUT; + JUMP; + + CASE(OP_MEMORY_START) MOP_IN(OP_MEMORY_START); + GET_MEMNUM_INC(mem, p); + mem_start_stk[mem] = (OnigStackIndex)((void *)s); + MOP_OUT; + JUMP; + + CASE(OP_MEMORY_END_PUSH) MOP_IN(OP_MEMORY_END_PUSH); + GET_MEMNUM_INC(mem, p); + STACK_PUSH_MEM_END(mem, s); + MOP_OUT; + JUMP; + + CASE(OP_MEMORY_END) MOP_IN(OP_MEMORY_END); + GET_MEMNUM_INC(mem, p); + mem_end_stk[mem] = (OnigStackIndex)((void *)s); + MOP_OUT; + JUMP; + + CASE(OP_KEEP) MOP_IN(OP_KEEP); + pkeep = s; + MOP_OUT; + JUMP; + +#ifdef USE_SUBEXP_CALL + CASE(OP_MEMORY_END_PUSH_REC) MOP_IN(OP_MEMORY_END_PUSH_REC); + GET_MEMNUM_INC(mem, p); + STACK_GET_MEM_START(mem, stkp); /* should be before push mem-end. */ + STACK_PUSH_MEM_END(mem, s); + mem_start_stk[mem] = GET_STACK_INDEX(stkp); + MOP_OUT; + JUMP; + + CASE(OP_MEMORY_END_REC) MOP_IN(OP_MEMORY_END_REC); + GET_MEMNUM_INC(mem, p); + mem_end_stk[mem] = (OnigStackIndex)((void *)s); + STACK_GET_MEM_START(mem, stkp); + + if (BIT_STATUS_AT(reg->bt_mem_start, mem)) + mem_start_stk[mem] = GET_STACK_INDEX(stkp); + else + mem_start_stk[mem] = (OnigStackIndex)((void *)stkp->u.mem.pstr); + + STACK_PUSH_MEM_END_MARK(mem); + MOP_OUT; + JUMP; +#endif + + CASE(OP_BACKREF1) MOP_IN(OP_BACKREF1); + mem = 1; + goto backref; + NEXT; + + CASE(OP_BACKREF2) MOP_IN(OP_BACKREF2); + mem = 2; + goto backref; + NEXT; + + CASE(OP_BACKREFN) MOP_IN(OP_BACKREFN); + GET_MEMNUM_INC(mem, p); + backref: { + int len; + UChar *pstart, *pend; + + /* if you want to remove following line, + you should check in parse and compile time. */ + if (mem > num_mem) + goto fail; + if (mem_end_stk[mem] == INVALID_STACK_INDEX) + goto fail; + if (mem_start_stk[mem] == INVALID_STACK_INDEX) + goto fail; + + if (BIT_STATUS_AT(reg->bt_mem_start, mem)) + pstart = STACK_AT(mem_start_stk[mem])->u.mem.pstr; + else + pstart = (UChar *)((void *)mem_start_stk[mem]); + + pend = (BIT_STATUS_AT(reg->bt_mem_end, mem) + ? STACK_AT(mem_end_stk[mem])->u.mem.pstr + : (UChar *)((void *)mem_end_stk[mem])); + n = pend - pstart; + DATA_ENSURE(n); + sprev = s; + STRING_CMP(pstart, s, n); + while (sprev + (len = enclen(encode, sprev, end)) < s) + sprev += len; + + MOP_OUT; + JUMP; + } + + CASE(OP_BACKREFN_IC) MOP_IN(OP_BACKREFN_IC); + GET_MEMNUM_INC(mem, p); + { + int len; + UChar *pstart, *pend; + + /* if you want to remove following line, + you should check in parse and compile time. */ + if (mem > num_mem) + goto fail; + if (mem_end_stk[mem] == INVALID_STACK_INDEX) + goto fail; + if (mem_start_stk[mem] == INVALID_STACK_INDEX) + goto fail; + + if (BIT_STATUS_AT(reg->bt_mem_start, mem)) + pstart = STACK_AT(mem_start_stk[mem])->u.mem.pstr; + else + pstart = (UChar *)((void *)mem_start_stk[mem]); + + pend = (BIT_STATUS_AT(reg->bt_mem_end, mem) + ? STACK_AT(mem_end_stk[mem])->u.mem.pstr + : (UChar *)((void *)mem_end_stk[mem])); + n = pend - pstart; + DATA_ENSURE(n); + sprev = s; + STRING_CMP_IC(case_fold_flag, pstart, &s, (int)n, end); + while (sprev + (len = enclen(encode, sprev, end)) < s) + sprev += len; + + MOP_OUT; + JUMP; + } + NEXT; + + CASE(OP_BACKREF_MULTI) MOP_IN(OP_BACKREF_MULTI); + { + int len, is_fail; + UChar *pstart, *pend, *swork; + + GET_LENGTH_INC(tlen, p); + for (i = 0; i < tlen; i++) + { + GET_MEMNUM_INC(mem, p); + + if (mem_end_stk[mem] == INVALID_STACK_INDEX) + continue; + if (mem_start_stk[mem] == INVALID_STACK_INDEX) + continue; + + if (BIT_STATUS_AT(reg->bt_mem_start, mem)) + pstart = STACK_AT(mem_start_stk[mem])->u.mem.pstr; + else + pstart = (UChar *)((void *)mem_start_stk[mem]); + + pend = (BIT_STATUS_AT(reg->bt_mem_end, mem) + ? STACK_AT(mem_end_stk[mem])->u.mem.pstr + : (UChar *)((void *)mem_end_stk[mem])); + n = pend - pstart; + DATA_ENSURE(n); + sprev = s; + swork = s; + STRING_CMP_VALUE(pstart, swork, n, is_fail); + if (is_fail) + continue; + s = swork; + while (sprev + (len = enclen(encode, sprev, end)) < s) + sprev += len; + + p += (SIZE_MEMNUM * (tlen - i - 1)); + break; /* success */ + } + if (i == tlen) + goto fail; + MOP_OUT; + JUMP; + } + NEXT; + + CASE(OP_BACKREF_MULTI_IC) MOP_IN(OP_BACKREF_MULTI_IC); + { + int len, is_fail; + UChar *pstart, *pend, *swork; + + GET_LENGTH_INC(tlen, p); + for (i = 0; i < tlen; i++) + { + GET_MEMNUM_INC(mem, p); + + if (mem_end_stk[mem] == INVALID_STACK_INDEX) + continue; + if (mem_start_stk[mem] == INVALID_STACK_INDEX) + continue; + + if (BIT_STATUS_AT(reg->bt_mem_start, mem)) + pstart = STACK_AT(mem_start_stk[mem])->u.mem.pstr; + else + pstart = (UChar *)((void *)mem_start_stk[mem]); + + pend = (BIT_STATUS_AT(reg->bt_mem_end, mem) + ? STACK_AT(mem_end_stk[mem])->u.mem.pstr + : (UChar *)((void *)mem_end_stk[mem])); + n = pend - pstart; + DATA_ENSURE(n); + sprev = s; + swork = s; + STRING_CMP_VALUE_IC(case_fold_flag, pstart, &swork, n, end, is_fail); + if (is_fail) + continue; + s = swork; + while (sprev + (len = enclen(encode, sprev, end)) < s) + sprev += len; + + p += (SIZE_MEMNUM * (tlen - i - 1)); + break; /* success */ + } + if (i == tlen) + goto fail; + MOP_OUT; + JUMP; + } + +#ifdef USE_BACKREF_WITH_LEVEL + CASE(OP_BACKREF_WITH_LEVEL) + { + int len; + OnigOptionType ic; + LengthType level; + + GET_OPTION_INC(ic, p); + GET_LENGTH_INC(level, p); + GET_LENGTH_INC(tlen, p); + + sprev = s; + if (backref_match_at_nested_level(reg, stk, stk_base, ic, case_fold_flag, + (int)level, (int)tlen, p, &s, end)) + { + while (sprev + (len = enclen(encode, sprev, end)) < s) + sprev += len; + + p += (SIZE_MEMNUM * tlen); + } + else + goto fail; + + MOP_OUT; + JUMP; + } + +#endif + +#if 0 /* no need: IS_DYNAMIC_OPTION() == 0 */ + CASE(OP_SET_OPTION_PUSH) MOP_IN(OP_SET_OPTION_PUSH); + GET_OPTION_INC(option, p); + STACK_PUSH_ALT(p, s, sprev, pkeep); + p += SIZE_OP_SET_OPTION + SIZE_OP_FAIL; + MOP_OUT; + JUMP; + + CASE(OP_SET_OPTION) MOP_IN(OP_SET_OPTION); + GET_OPTION_INC(option, p); + MOP_OUT; + JUMP; +#endif + + CASE(OP_NULL_CHECK_START) MOP_IN(OP_NULL_CHECK_START); + GET_MEMNUM_INC(mem, p); /* mem: null check id */ + STACK_PUSH_NULL_CHECK_START(mem, s); + MOP_OUT; + JUMP; + + CASE(OP_NULL_CHECK_END) MOP_IN(OP_NULL_CHECK_END); + { + int isnull; + + GET_MEMNUM_INC(mem, p); /* mem: null check id */ + STACK_NULL_CHECK(isnull, mem, s); + if (isnull) + { +#ifdef ONIG_DEBUG_MATCH + fprintf(stderr, "NULL_CHECK_END: skip id:%d, s:%" PRIuPTR " (%p)\n", + (int)mem, (uintptr_t)s, s); +#endif + null_check_found: + /* empty loop founded, skip next instruction */ + switch (*p++) + { + case OP_JUMP: + case OP_PUSH: + p += SIZE_RELADDR; + break; + case OP_REPEAT_INC: + case OP_REPEAT_INC_NG: + case OP_REPEAT_INC_SG: + case OP_REPEAT_INC_NG_SG: + p += SIZE_MEMNUM; + break; + default: + goto unexpected_bytecode_error; + break; + } + } + } + MOP_OUT; + JUMP; + +#ifdef USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT + CASE(OP_NULL_CHECK_END_MEMST) MOP_IN(OP_NULL_CHECK_END_MEMST); + { + int isnull; + + GET_MEMNUM_INC(mem, p); /* mem: null check id */ + STACK_NULL_CHECK_MEMST(isnull, mem, s, reg); + if (isnull) + { +# ifdef ONIG_DEBUG_MATCH + fprintf(stderr, + "NULL_CHECK_END_MEMST: skip id:%d, s:%" PRIuPTR " (%p)\n", + (int)mem, (uintptr_t)s, s); +# endif + if (isnull == -1) + goto fail; + goto null_check_found; + } + } + MOP_OUT; + JUMP; +#endif + +#ifdef USE_SUBEXP_CALL + CASE(OP_NULL_CHECK_END_MEMST_PUSH) + MOP_IN(OP_NULL_CHECK_END_MEMST_PUSH); + { + int isnull; + + GET_MEMNUM_INC(mem, p); /* mem: null check id */ +# ifdef USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT + STACK_NULL_CHECK_MEMST_REC(isnull, mem, s, reg); +# else + STACK_NULL_CHECK_REC(isnull, mem, s); +# endif + if (isnull) + { +# ifdef ONIG_DEBUG_MATCH + fprintf(stderr, + "NULL_CHECK_END_MEMST_PUSH: skip id:%d, s:%" PRIuPTR " (%p)\n", + (int)mem, (uintptr_t)s, s); +# endif + if (isnull == -1) + goto fail; + goto null_check_found; + } + else + { + STACK_PUSH_NULL_CHECK_END(mem); + } + } + MOP_OUT; + JUMP; +#endif + + CASE(OP_JUMP) MOP_IN(OP_JUMP); + GET_RELADDR_INC(addr, p); + p += addr; + MOP_OUT; + CHECK_INTERRUPT_IN_MATCH_AT; + JUMP; + + CASE(OP_PUSH) MOP_IN(OP_PUSH); + GET_RELADDR_INC(addr, p); + STACK_PUSH_ALT(p + addr, s, sprev, pkeep); + MOP_OUT; + JUMP; + +#ifdef USE_COMBINATION_EXPLOSION_CHECK + CASE(OP_STATE_CHECK_PUSH) MOP_IN(OP_STATE_CHECK_PUSH); + GET_STATE_CHECK_NUM_INC(mem, p); + STATE_CHECK_VAL(scv, mem); + if (scv) + goto fail; + + GET_RELADDR_INC(addr, p); + STACK_PUSH_ALT_WITH_STATE_CHECK(p + addr, s, sprev, mem, pkeep); + MOP_OUT; + JUMP; + + CASE(OP_STATE_CHECK_PUSH_OR_JUMP) MOP_IN(OP_STATE_CHECK_PUSH_OR_JUMP); + GET_STATE_CHECK_NUM_INC(mem, p); + GET_RELADDR_INC(addr, p); + STATE_CHECK_VAL(scv, mem); + if (scv) + { + p += addr; + } + else + { + STACK_PUSH_ALT_WITH_STATE_CHECK(p + addr, s, sprev, mem, pkeep); + } + MOP_OUT; + JUMP; + + CASE(OP_STATE_CHECK) MOP_IN(OP_STATE_CHECK); + GET_STATE_CHECK_NUM_INC(mem, p); + STATE_CHECK_VAL(scv, mem); + if (scv) + goto fail; + + STACK_PUSH_STATE_CHECK(s, mem); + MOP_OUT; + JUMP; +#endif /* USE_COMBINATION_EXPLOSION_CHECK */ + + CASE(OP_POP) MOP_IN(OP_POP); + STACK_POP_ONE; + MOP_OUT; + JUMP; + +#ifdef USE_OP_PUSH_OR_JUMP_EXACT + CASE(OP_PUSH_OR_JUMP_EXACT1) MOP_IN(OP_PUSH_OR_JUMP_EXACT1); + GET_RELADDR_INC(addr, p); + if (*p == *s && DATA_ENSURE_CHECK1) + { + p++; + STACK_PUSH_ALT(p + addr, s, sprev, pkeep); + MOP_OUT; + JUMP; + } + p += (addr + 1); + MOP_OUT; + JUMP; +#endif + + CASE(OP_PUSH_IF_PEEK_NEXT) MOP_IN(OP_PUSH_IF_PEEK_NEXT); + GET_RELADDR_INC(addr, p); + if (*p == *s) + { + p++; + STACK_PUSH_ALT(p + addr, s, sprev, pkeep); + MOP_OUT; + JUMP; + } + p++; + MOP_OUT; + JUMP; + + CASE(OP_REPEAT) MOP_IN(OP_REPEAT); + { + GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */ + GET_RELADDR_INC(addr, p); + + STACK_ENSURE(1); + repeat_stk[mem] = GET_STACK_INDEX(stk); + STACK_PUSH_REPEAT(mem, p); + + if (reg->repeat_range[mem].lower == 0) + { + STACK_PUSH_ALT(p + addr, s, sprev, pkeep); + } + } + MOP_OUT; + JUMP; + + CASE(OP_REPEAT_NG) MOP_IN(OP_REPEAT_NG); + { + GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */ + GET_RELADDR_INC(addr, p); + + STACK_ENSURE(1); + repeat_stk[mem] = GET_STACK_INDEX(stk); + STACK_PUSH_REPEAT(mem, p); + + if (reg->repeat_range[mem].lower == 0) + { + STACK_PUSH_ALT(p, s, sprev, pkeep); + p += addr; + } + } + MOP_OUT; + JUMP; + + CASE(OP_REPEAT_INC) MOP_IN(OP_REPEAT_INC); + GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */ + si = repeat_stk[mem]; + stkp = STACK_AT(si); + + repeat_inc: + stkp->u.repeat.count++; + if (stkp->u.repeat.count >= reg->repeat_range[mem].upper) + { + /* end of repeat. Nothing to do. */ + } + else if (stkp->u.repeat.count >= reg->repeat_range[mem].lower) + { + STACK_PUSH_ALT(p, s, sprev, pkeep); + p = STACK_AT(si)->u.repeat.pcode; /* Don't use stkp after PUSH. */ + } + else + { + p = stkp->u.repeat.pcode; + } + STACK_PUSH_REPEAT_INC(si); + MOP_OUT; + CHECK_INTERRUPT_IN_MATCH_AT; + JUMP; + + CASE(OP_REPEAT_INC_SG) MOP_IN(OP_REPEAT_INC_SG); + GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */ + STACK_GET_REPEAT(mem, stkp); + si = GET_STACK_INDEX(stkp); + goto repeat_inc; + NEXT; + + CASE(OP_REPEAT_INC_NG) MOP_IN(OP_REPEAT_INC_NG); + GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */ + si = repeat_stk[mem]; + stkp = STACK_AT(si); + + repeat_inc_ng: + stkp->u.repeat.count++; + if (stkp->u.repeat.count < reg->repeat_range[mem].upper) + { + if (stkp->u.repeat.count >= reg->repeat_range[mem].lower) + { + UChar *pcode = stkp->u.repeat.pcode; + + STACK_PUSH_REPEAT_INC(si); + STACK_PUSH_ALT(pcode, s, sprev, pkeep); + } + else + { + p = stkp->u.repeat.pcode; + STACK_PUSH_REPEAT_INC(si); + } + } + else if (stkp->u.repeat.count == reg->repeat_range[mem].upper) + { + STACK_PUSH_REPEAT_INC(si); + } + MOP_OUT; + CHECK_INTERRUPT_IN_MATCH_AT; + JUMP; + + CASE(OP_REPEAT_INC_NG_SG) MOP_IN(OP_REPEAT_INC_NG_SG); + GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */ + STACK_GET_REPEAT(mem, stkp); + si = GET_STACK_INDEX(stkp); + goto repeat_inc_ng; + NEXT; + + CASE(OP_PUSH_POS) MOP_IN(OP_PUSH_POS); + STACK_PUSH_POS(s, sprev, pkeep); + MOP_OUT; + JUMP; + + CASE(OP_POP_POS) MOP_IN(OP_POP_POS); + { + STACK_POS_END(stkp); + s = stkp->u.state.pstr; + sprev = stkp->u.state.pstr_prev; + } + MOP_OUT; + JUMP; + + CASE(OP_PUSH_POS_NOT) MOP_IN(OP_PUSH_POS_NOT); + GET_RELADDR_INC(addr, p); + STACK_PUSH_POS_NOT(p + addr, s, sprev, pkeep); + MOP_OUT; + JUMP; + + CASE(OP_FAIL_POS) MOP_IN(OP_FAIL_POS); + STACK_POP_TIL_POS_NOT; + goto fail; + NEXT; + + CASE(OP_PUSH_STOP_BT) MOP_IN(OP_PUSH_STOP_BT); + STACK_PUSH_STOP_BT; + MOP_OUT; + JUMP; + + CASE(OP_POP_STOP_BT) MOP_IN(OP_POP_STOP_BT); + STACK_STOP_BT_END; + MOP_OUT; + JUMP; + + CASE(OP_LOOK_BEHIND) MOP_IN(OP_LOOK_BEHIND); + GET_LENGTH_INC(tlen, p); + s = (UChar *)ONIGENC_STEP_BACK(encode, str, s, end, (int)tlen); + if (IS_NULL(s)) + goto fail; + sprev = (UChar *)onigenc_get_prev_char_head(encode, str, s, end); + MOP_OUT; + JUMP; + + CASE(OP_PUSH_LOOK_BEHIND_NOT) MOP_IN(OP_PUSH_LOOK_BEHIND_NOT); + GET_RELADDR_INC(addr, p); + GET_LENGTH_INC(tlen, p); + q = (UChar *)ONIGENC_STEP_BACK(encode, str, s, end, (int)tlen); + if (IS_NULL(q)) + { + /* too short case -> success. ex. /(?<!XXX)a/.match("a") + If you want to change to fail, replace following line. */ + p += addr; + /* goto fail; */ + } + else + { + STACK_PUSH_LOOK_BEHIND_NOT(p + addr, s, sprev, pkeep); + s = q; + sprev = (UChar *)onigenc_get_prev_char_head(encode, str, s, end); + } + MOP_OUT; + JUMP; + + CASE(OP_FAIL_LOOK_BEHIND_NOT) MOP_IN(OP_FAIL_LOOK_BEHIND_NOT); + STACK_POP_TIL_LOOK_BEHIND_NOT; + goto fail; + NEXT; + + CASE(OP_PUSH_ABSENT_POS) MOP_IN(OP_PUSH_ABSENT_POS); + /* Save the absent-start-pos and the original end-pos. */ + STACK_PUSH_ABSENT_POS(s, ABSENT_END_POS); + MOP_OUT; + JUMP; + + CASE(OP_ABSENT) MOP_IN(OP_ABSENT); + { + const UChar *aend = ABSENT_END_POS; + UChar *absent; + UChar *selfp = p - 1; + + STACK_POP_ABSENT_POS(absent, ABSENT_END_POS); /* Restore end-pos. */ + GET_RELADDR_INC(addr, p); +#ifdef ONIG_DEBUG_MATCH + fprintf(stderr, "ABSENT: s:%p, end:%p, absent:%p, aend:%p\n", s, end, + absent, aend); +#endif + if ((absent > aend) && (s > absent)) + { + /* An empty match occurred in (?~...) at the start point. + * Never match. */ + STACK_POP; + goto fail; + } + else if ((s >= aend) && (s > absent)) + { + if (s > aend) + { + /* Only one (or less) character matched in the last iteration. + * This is not a possible point. */ + goto fail; + } + /* All possible points were found. Try matching after (?~...). */ + DATA_ENSURE(0); + p += addr; + } + else + { + STACK_PUSH_ALT(p + addr, s, sprev, pkeep); /* Push possible point. */ + n = enclen(encode, s, end); + STACK_PUSH_ABSENT_POS(absent, + ABSENT_END_POS); /* Save the original pos. */ + STACK_PUSH_ALT(selfp, s + n, s, pkeep); /* Next iteration. */ + STACK_PUSH_ABSENT; + ABSENT_END_POS = aend; + } + } + MOP_OUT; + JUMP; + + CASE(OP_ABSENT_END) MOP_IN(OP_ABSENT_END); + /* The pattern inside (?~...) was matched. + * Set the end-pos temporary and go to next iteration. */ + if (sprev < ABSENT_END_POS) + ABSENT_END_POS = sprev; +#ifdef ONIG_DEBUG_MATCH + fprintf(stderr, "ABSENT_END: end:%p\n", ABSENT_END_POS); +#endif + STACK_POP_TIL_ABSENT; + goto fail; + NEXT; + +#ifdef USE_SUBEXP_CALL + CASE(OP_CALL) MOP_IN(OP_CALL); + GET_ABSADDR_INC(addr, p); + STACK_PUSH_CALL_FRAME(p); + p = reg->p + addr; + MOP_OUT; + JUMP; + + CASE(OP_RETURN) MOP_IN(OP_RETURN); + STACK_RETURN(p); + STACK_PUSH_RETURN; + MOP_OUT; + JUMP; +#endif + + CASE(OP_CONDITION) MOP_IN(OP_CONDITION); + GET_MEMNUM_INC(mem, p); + GET_RELADDR_INC(addr, p); + if ((mem > num_mem) || (mem_end_stk[mem] == INVALID_STACK_INDEX) + || (mem_start_stk[mem] == INVALID_STACK_INDEX)) + { + p += addr; + } + MOP_OUT; + JUMP; + + CASE(OP_FINISH) + goto finish; + NEXT; + + CASE(OP_FAIL) + if (0) + { + /* fall */ + fail: + MOP_OUT; + } + MOP_IN(OP_FAIL); + STACK_POP; + p = stk->u.state.pcode; + s = stk->u.state.pstr; + sprev = stk->u.state.pstr_prev; + pkeep = stk->u.state.pkeep; + +#ifdef USE_COMBINATION_EXPLOSION_CHECK + if (stk->u.state.state_check != 0) + { + stk->type = STK_STATE_CHECK_MARK; + stk++; + } +#endif + + MOP_OUT; + JUMP; + + DEFAULT + goto bytecode_error; + } + VM_LOOP_END + +finish: + STACK_SAVE; + if (xmalloc_base) + xfree(xmalloc_base); + return best_len; + +#ifdef ONIG_DEBUG +stack_error: + STACK_SAVE; + if (xmalloc_base) + xfree(xmalloc_base); + return ONIGERR_STACK_BUG; +#endif + +bytecode_error: + STACK_SAVE; + if (xmalloc_base) + xfree(xmalloc_base); + return ONIGERR_UNDEFINED_BYTECODE; + +unexpected_bytecode_error: + STACK_SAVE; + if (xmalloc_base) + xfree(xmalloc_base); + return ONIGERR_UNEXPECTED_BYTECODE; +} + +static UChar *slow_search(OnigEncoding enc, UChar *target, UChar *target_end, + const UChar *text, const UChar *text_end, + UChar *text_range) +{ + UChar *t, *p, *s, *end; + + end = (UChar *)text_end; + end -= target_end - target - 1; + if (end > text_range) + end = text_range; + + s = (UChar *)text; + + if (enc->max_enc_len == enc->min_enc_len) + { + int n = enc->max_enc_len; + + while (s < end) + { + if (*s == *target) + { + p = s + 1; + t = target + 1; + if (target_end == t || memcmp(t, p, target_end - t) == 0) + return s; + } + s += n; + } + return (UChar *)NULL; + } + while (s < end) + { + if (*s == *target) + { + p = s + 1; + t = target + 1; + if (target_end == t || memcmp(t, p, target_end - t) == 0) + return s; + } + s += enclen(enc, s, text_end); + } + + return (UChar *)NULL; +} + +static int str_lower_case_match(OnigEncoding enc, int case_fold_flag, + const UChar *t, const UChar *tend, + const UChar *p, const UChar *end) +{ + int lowlen; + UChar *q, lowbuf[ONIGENC_MBC_CASE_FOLD_MAXLEN]; + + while (t < tend) + { + lowlen = ONIGENC_MBC_CASE_FOLD(enc, case_fold_flag, &p, end, lowbuf); + q = lowbuf; + while (lowlen > 0) + { + if (*t++ != *q++) + return 0; + lowlen--; + } + } + + return 1; +} + +static UChar *slow_search_ic(OnigEncoding enc, int case_fold_flag, + UChar *target, UChar *target_end, + const UChar *text, const UChar *text_end, + UChar *text_range) +{ + UChar *s, *end; + + end = (UChar *)text_end; + end -= target_end - target - 1; + if (end > text_range) + end = text_range; + + s = (UChar *)text; + + while (s < end) + { + if (str_lower_case_match(enc, case_fold_flag, target, target_end, s, + text_end)) + return s; + + s += enclen(enc, s, text_end); + } + + return (UChar *)NULL; +} + +static UChar *slow_search_backward(OnigEncoding enc, UChar *target, + UChar *target_end, const UChar *text, + const UChar *adjust_text, + const UChar *text_end, + const UChar *text_start) +{ + UChar *t, *p, *s; + + s = (UChar *)text_end; + s -= (target_end - target); + if (s > text_start) + s = (UChar *)text_start; + else + s = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, adjust_text, s, text_end); + + while (s >= text) + { + if (*s == *target) + { + p = s + 1; + t = target + 1; + while (t < target_end) + { + if (*t != *p++) + break; + t++; + } + if (t == target_end) + return s; + } + s = (UChar *)onigenc_get_prev_char_head(enc, adjust_text, s, text_end); + } + + return (UChar *)NULL; +} + +static UChar *slow_search_backward_ic(OnigEncoding enc, int case_fold_flag, + UChar *target, UChar *target_end, + const UChar *text, + const UChar *adjust_text, + const UChar *text_end, + const UChar *text_start) +{ + UChar *s; + + s = (UChar *)text_end; + s -= (target_end - target); + if (s > text_start) + s = (UChar *)text_start; + else + s = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, adjust_text, s, text_end); + + while (s >= text) + { + if (str_lower_case_match(enc, case_fold_flag, target, target_end, s, + text_end)) + return s; + + s = (UChar *)onigenc_get_prev_char_head(enc, adjust_text, s, text_end); + } + + return (UChar *)NULL; +} + +#ifndef USE_SUNDAY_QUICK_SEARCH +/* Boyer-Moore-Horspool search applied to a multibyte string */ +static UChar *bm_search_notrev(regex_t *reg, const UChar *target, + const UChar *target_end, const UChar *text, + const UChar *text_end, const UChar *text_range) +{ + const UChar *s, *se, *t, *p, *end; + const UChar *tail; + ptrdiff_t skip, tlen1; + +# ifdef ONIG_DEBUG_SEARCH + fprintf(stderr, + "bm_search_notrev: text: %" PRIuPTR " (%p), text_end: %" PRIuPTR + " (%p), text_range: %" PRIuPTR " (%p)\n", + (uintptr_t)text, text, (uintptr_t)text_end, text_end, + (uintptr_t)text_range, text_range); +# endif + + tail = target_end - 1; + tlen1 = tail - target; + end = text_range; + if (end + tlen1 > text_end) + end = text_end - tlen1; + + s = text; + + if (IS_NULL(reg->int_map)) + { + while (s < end) + { + p = se = s + tlen1; + t = tail; + while (*p == *t) + { + if (t == target) + return (UChar *)s; + p--; + t--; + } + skip = reg->map[*se]; + t = s; + do + { + s += enclen(reg->enc, s, end); + } while ((s - t) < skip && s < end); + } + } + else + { +# if OPT_EXACT_MAXLEN >= ONIG_CHAR_TABLE_SIZE + while (s < end) + { + p = se = s + tlen1; + t = tail; + while (*p == *t) + { + if (t == target) + return (UChar *)s; + p--; + t--; + } + skip = reg->int_map[*se]; + t = s; + do + { + s += enclen(reg->enc, s, end); + } while ((s - t) < skip && s < end); + } +# endif + } + + return (UChar *)NULL; +} + +/* Boyer-Moore-Horspool search */ +static UChar *bm_search(regex_t *reg, const UChar *target, + const UChar *target_end, const UChar *text, + const UChar *text_end, const UChar *text_range) +{ + const UChar *s, *t, *p, *end; + const UChar *tail; + +# ifdef ONIG_DEBUG_SEARCH + fprintf(stderr, + "bm_search: text: %" PRIuPTR " (%p), text_end: %" PRIuPTR + " (%p), text_range: %" PRIuPTR " (%p)\n", + (uintptr_t)text, text, (uintptr_t)text_end, text_end, + (uintptr_t)text_range, text_range); +# endif + + end = text_range + (target_end - target) - 1; + if (end > text_end) + end = text_end; + + tail = target_end - 1; + s = text + (target_end - target) - 1; + if (IS_NULL(reg->int_map)) + { + while (s < end) + { + p = s; + t = tail; +# ifdef ONIG_DEBUG_SEARCH + fprintf(stderr, "bm_search_loop: pos: %" PRIdPTR " %s\n", + (intptr_t)(s - text), s); +# endif + while (*p == *t) + { + if (t == target) + return (UChar *)p; + p--; + t--; + } + s += reg->map[*s]; + } + } + else + { /* see int_map[] */ +# if OPT_EXACT_MAXLEN >= ONIG_CHAR_TABLE_SIZE + while (s < end) + { + p = s; + t = tail; + while (*p == *t) + { + if (t == target) + return (UChar *)p; + p--; + t--; + } + s += reg->int_map[*s]; + } +# endif + } + return (UChar *)NULL; +} + +/* Boyer-Moore-Horspool search applied to a multibyte string (ignore case) */ +static UChar *bm_search_notrev_ic(regex_t *reg, const UChar *target, + const UChar *target_end, const UChar *text, + const UChar *text_end, + const UChar *text_range) +{ + const UChar *s, *se, *t, *end; + const UChar *tail; + ptrdiff_t skip, tlen1; + OnigEncoding enc = reg->enc; + int case_fold_flag = reg->case_fold_flag; + +# ifdef ONIG_DEBUG_SEARCH + fprintf(stderr, + "bm_search_notrev_ic: text: %d (%p), text_end: %d (%p), text_range: " + "%d (%p)\n", + (int)text, text, (int)text_end, text_end, (int)text_range, + text_range); +# endif + + tail = target_end - 1; + tlen1 = tail - target; + end = text_range; + if (end + tlen1 > text_end) + end = text_end - tlen1; + + s = text; + + if (IS_NULL(reg->int_map)) + { + while (s < end) + { + se = s + tlen1; + if (str_lower_case_match(enc, case_fold_flag, target, target_end, s, + se + 1)) + return (UChar *)s; + skip = reg->map[*se]; + t = s; + do + { + s += enclen(reg->enc, s, end); + } while ((s - t) < skip && s < end); + } + } + else + { +# if OPT_EXACT_MAXLEN >= ONIG_CHAR_TABLE_SIZE + while (s < end) + { + se = s + tlen1; + if (str_lower_case_match(enc, case_fold_flag, target, target_end, s, + se + 1)) + return (UChar *)s; + skip = reg->int_map[*se]; + t = s; + do + { + s += enclen(reg->enc, s, end); + } while ((s - t) < skip && s < end); + } +# endif + } + + return (UChar *)NULL; +} + +/* Boyer-Moore-Horspool search (ignore case) */ +static UChar *bm_search_ic(regex_t *reg, const UChar *target, + const UChar *target_end, const UChar *text, + const UChar *text_end, const UChar *text_range) +{ + const UChar *s, *p, *end; + const UChar *tail; + OnigEncoding enc = reg->enc; + int case_fold_flag = reg->case_fold_flag; + +# ifdef ONIG_DEBUG_SEARCH + fprintf( + stderr, + "bm_search_ic: text: %d (%p), text_end: %d (%p), text_range: %d (%p)\n", + (int)text, text, (int)text_end, text_end, (int)text_range, text_range); +# endif + + end = text_range + (target_end - target) - 1; + if (end > text_end) + end = text_end; + + tail = target_end - 1; + s = text + (target_end - target) - 1; + if (IS_NULL(reg->int_map)) + { + while (s < end) + { + p = s - (target_end - target) + 1; + if (str_lower_case_match(enc, case_fold_flag, target, target_end, p, + s + 1)) + return (UChar *)p; + s += reg->map[*s]; + } + } + else + { /* see int_map[] */ +# if OPT_EXACT_MAXLEN >= ONIG_CHAR_TABLE_SIZE + while (s < end) + { + p = s - (target_end - target) + 1; + if (str_lower_case_match(enc, case_fold_flag, target, target_end, p, + s + 1)) + return (UChar *)p; + s += reg->int_map[*s]; + } +# endif + } + return (UChar *)NULL; +} + +#else /* USE_SUNDAY_QUICK_SEARCH */ + +/* Sunday's quick search applied to a multibyte string */ +static UChar *bm_search_notrev(regex_t *reg, const UChar *target, + const UChar *target_end, const UChar *text, + const UChar *text_end, const UChar *text_range) +{ + const UChar *s, *se, *t, *p, *end; + const UChar *tail; + ptrdiff_t skip, tlen1; + OnigEncoding enc = reg->enc; + +# ifdef ONIG_DEBUG_SEARCH + fprintf(stderr, + "bm_search_notrev: text: %" PRIuPTR " (%p), text_end: %" PRIuPTR + " (%p), text_range: %" PRIuPTR " (%p)\n", + (uintptr_t)text, text, (uintptr_t)text_end, text_end, + (uintptr_t)text_range, text_range); +# endif + + tail = target_end - 1; + tlen1 = tail - target; + end = text_range; + if (end + tlen1 > text_end) + end = text_end - tlen1; + + s = text; + + if (IS_NULL(reg->int_map)) + { + while (s < end) + { + p = se = s + tlen1; + t = tail; + while (*p == *t) + { + if (t == target) + return (UChar *)s; + p--; + t--; + } + if (s + 1 >= end) + break; + skip = reg->map[se[1]]; + t = s; + do + { + s += enclen(enc, s, end); + } while ((s - t) < skip && s < end); + } + } + else + { +# if OPT_EXACT_MAXLEN >= ONIG_CHAR_TABLE_SIZE + while (s < end) + { + p = se = s + tlen1; + t = tail; + while (*p == *t) + { + if (t == target) + return (UChar *)s; + p--; + t--; + } + if (s + 1 >= end) + break; + skip = reg->int_map[se[1]]; + t = s; + do + { + s += enclen(enc, s, end); + } while ((s - t) < skip && s < end); + } +# endif + } + + return (UChar *)NULL; +} + +/* Sunday's quick search */ +static UChar *bm_search(regex_t *reg, const UChar *target, + const UChar *target_end, const UChar *text, + const UChar *text_end, const UChar *text_range) +{ + const UChar *s, *t, *p, *end; + const UChar *tail; + ptrdiff_t tlen1; + +# ifdef ONIG_DEBUG_SEARCH + fprintf(stderr, + "bm_search: text: %" PRIuPTR " (%p), text_end: %" PRIuPTR + " (%p), text_range: %" PRIuPTR " (%p)\n", + (uintptr_t)text, text, (uintptr_t)text_end, text_end, + (uintptr_t)text_range, text_range); +# endif + + tail = target_end - 1; + tlen1 = tail - target; + end = text_range + tlen1; + if (end > text_end) + end = text_end; + + s = text + tlen1; + if (IS_NULL(reg->int_map)) + { + while (s < end) + { + p = s; + t = tail; + while (*p == *t) + { + if (t == target) + return (UChar *)p; + p--; + t--; + } + if (s + 1 >= end) + break; + s += reg->map[s[1]]; + } + } + else + { /* see int_map[] */ +# if OPT_EXACT_MAXLEN >= ONIG_CHAR_TABLE_SIZE + while (s < end) + { + p = s; + t = tail; + while (*p == *t) + { + if (t == target) + return (UChar *)p; + p--; + t--; + } + if (s + 1 >= end) + break; + s += reg->int_map[s[1]]; + } +# endif + } + return (UChar *)NULL; +} + +/* Sunday's quick search applied to a multibyte string (ignore case) */ +static UChar *bm_search_notrev_ic(regex_t *reg, const UChar *target, + const UChar *target_end, const UChar *text, + const UChar *text_end, + const UChar *text_range) +{ + const UChar *s, *se, *t, *end; + const UChar *tail; + ptrdiff_t skip, tlen1; + OnigEncoding enc = reg->enc; + int case_fold_flag = reg->case_fold_flag; + +# ifdef ONIG_DEBUG_SEARCH + fprintf(stderr, + "bm_search_notrev_ic: text: %" PRIuPTR " (%p), text_end: %" PRIuPTR + " (%p), text_range: %" PRIuPTR " (%p)\n", + (uintptr_t)text, text, (uintptr_t)text_end, text_end, + (uintptr_t)text_range, text_range); +# endif + + tail = target_end - 1; + tlen1 = tail - target; + end = text_range; + if (end + tlen1 > text_end) + end = text_end - tlen1; + + s = text; + + if (IS_NULL(reg->int_map)) + { + while (s < end) + { + se = s + tlen1; + if (str_lower_case_match(enc, case_fold_flag, target, target_end, s, + se + 1)) + return (UChar *)s; + if (s + 1 >= end) + break; + skip = reg->map[se[1]]; + t = s; + do + { + s += enclen(enc, s, end); + } while ((s - t) < skip && s < end); + } + } + else + { +# if OPT_EXACT_MAXLEN >= ONIG_CHAR_TABLE_SIZE + while (s < end) + { + se = s + tlen1; + if (str_lower_case_match(enc, case_fold_flag, target, target_end, s, + se + 1)) + return (UChar *)s; + if (s + 1 >= end) + break; + skip = reg->int_map[se[1]]; + t = s; + do + { + s += enclen(enc, s, end); + } while ((s - t) < skip && s < end); + } +# endif + } + + return (UChar *)NULL; +} + +/* Sunday's quick search (ignore case) */ +static UChar *bm_search_ic(regex_t *reg, const UChar *target, + const UChar *target_end, const UChar *text, + const UChar *text_end, const UChar *text_range) +{ + const UChar *s, *p, *end; + const UChar *tail; + ptrdiff_t tlen1; + OnigEncoding enc = reg->enc; + int case_fold_flag = reg->case_fold_flag; + +# ifdef ONIG_DEBUG_SEARCH + fprintf(stderr, + "bm_search_ic: text: %" PRIuPTR " (%p), text_end: %" PRIuPTR + " (%p), text_range: %" PRIuPTR " (%p)\n", + (uintptr_t)text, text, (uintptr_t)text_end, text_end, + (uintptr_t)text_range, text_range); +# endif + + tail = target_end - 1; + tlen1 = tail - target; + end = text_range + tlen1; + if (end > text_end) + end = text_end; + + s = text + tlen1; + if (IS_NULL(reg->int_map)) + { + while (s < end) + { + p = s - tlen1; + if (str_lower_case_match(enc, case_fold_flag, target, target_end, p, + s + 1)) + return (UChar *)p; + if (s + 1 >= end) + break; + s += reg->map[s[1]]; + } + } + else + { /* see int_map[] */ +# if OPT_EXACT_MAXLEN >= ONIG_CHAR_TABLE_SIZE + while (s < end) + { + p = s - tlen1; + if (str_lower_case_match(enc, case_fold_flag, target, target_end, p, + s + 1)) + return (UChar *)p; + if (s + 1 >= end) + break; + s += reg->int_map[s[1]]; + } +# endif + } + return (UChar *)NULL; +} +#endif /* USE_SUNDAY_QUICK_SEARCH */ + +#ifdef USE_INT_MAP_BACKWARD +static int set_bm_backward_skip(UChar *s, UChar *end, + OnigEncoding enc ARG_UNUSED, int **skip) +{ + int i, len; + + if (IS_NULL(*skip)) + { + *skip = (int *)xmalloc(sizeof(int) * ONIG_CHAR_TABLE_SIZE); + if (IS_NULL(*skip)) + return ONIGERR_MEMORY; + } + + len = (int)(end - s); + for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) + (*skip)[i] = len; + + for (i = len - 1; i > 0; i--) + (*skip)[s[i]] = i; + + return 0; +} + +static UChar *bm_search_backward(regex_t *reg, const UChar *target, + const UChar *target_end, const UChar *text, + const UChar *adjust_text, + const UChar *text_end, const UChar *text_start) +{ + const UChar *s, *t, *p; + + s = text_end - (target_end - target); + if (text_start < s) + s = text_start; + else + s = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, adjust_text, s, text_end); + + while (s >= text) + { + p = s; + t = target; + while (t < target_end && *p == *t) + { + p++; + t++; + } + if (t == target_end) + return (UChar *)s; + + s -= reg->int_map_backward[*s]; + s = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, adjust_text, s, text_end); + } + + return (UChar *)NULL; +} +#endif + +static UChar *map_search(OnigEncoding enc, UChar map[], const UChar *text, + const UChar *text_range, const UChar *text_end) +{ + const UChar *s = text; + + while (s < text_range) + { + if (map[*s]) + return (UChar *)s; + + s += enclen(enc, s, text_end); + } + return (UChar *)NULL; +} + +static UChar *map_search_backward(OnigEncoding enc, UChar map[], + const UChar *text, const UChar *adjust_text, + const UChar *text_start, + const UChar *text_end) +{ + const UChar *s = text_start; + + while (s >= text) + { + if (map[*s]) + return (UChar *)s; + + s = onigenc_get_prev_char_head(enc, adjust_text, s, text_end); + } + return (UChar *)NULL; +} + +extern OnigPosition onig_match(regex_t *reg, const UChar *str, const UChar *end, + const UChar *at, OnigRegion *region, + OnigOptionType option) +{ + ptrdiff_t r; + UChar *prev; + OnigMatchArg msa; + + MATCH_ARG_INIT(msa, option, region, at, at); +#ifdef USE_COMBINATION_EXPLOSION_CHECK + { + int offset = at - str; + STATE_CHECK_BUFF_INIT(msa, end - str, offset, reg->num_comb_exp_check); + } +#endif + + if (region) + { + r = onig_region_resize_clear(region, reg->num_mem + 1); + } + else + r = 0; + + if (r == 0) + { + prev = (UChar *)onigenc_get_prev_char_head(reg->enc, str, at, end); + r = match_at(reg, str, end, +#ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE + end, +#endif + at, prev, &msa); + } + + MATCH_ARG_FREE(msa); + return r; +} + +static int forward_search_range(regex_t *reg, const UChar *str, + const UChar *end, UChar *s, UChar *range, + UChar **low, UChar **high, UChar **low_prev) +{ + UChar *p, *pprev = (UChar *)NULL; + +#ifdef ONIG_DEBUG_SEARCH + fprintf(stderr, + "forward_search_range: str: %" PRIuPTR " (%p), end: %" PRIuPTR + " (%p), s: %" PRIuPTR " (%p), range: %" PRIuPTR " (%p)\n", + (uintptr_t)str, str, (uintptr_t)end, end, (uintptr_t)s, s, + (uintptr_t)range, range); +#endif + + p = s; + if (reg->dmin > 0) + { + if (ONIGENC_IS_SINGLEBYTE(reg->enc)) + { + p += reg->dmin; + } + else + { + UChar *q = p + reg->dmin; + while (p < q) + p += enclen(reg->enc, p, end); + } + } + +retry: + switch (reg->optimize) + { + case ONIG_OPTIMIZE_EXACT: + p = slow_search(reg->enc, reg->exact, reg->exact_end, p, end, range); + break; + case ONIG_OPTIMIZE_EXACT_IC: + p = slow_search_ic(reg->enc, reg->case_fold_flag, reg->exact, + reg->exact_end, p, end, range); + break; + + case ONIG_OPTIMIZE_EXACT_BM: + p = bm_search(reg, reg->exact, reg->exact_end, p, end, range); + break; + + case ONIG_OPTIMIZE_EXACT_BM_NOT_REV: + p = bm_search_notrev(reg, reg->exact, reg->exact_end, p, end, range); + break; + + case ONIG_OPTIMIZE_EXACT_BM_IC: + p = bm_search_ic(reg, reg->exact, reg->exact_end, p, end, range); + break; + + case ONIG_OPTIMIZE_EXACT_BM_NOT_REV_IC: + p = bm_search_notrev_ic(reg, reg->exact, reg->exact_end, p, end, range); + break; + + case ONIG_OPTIMIZE_MAP: + p = map_search(reg->enc, reg->map, p, range, end); + break; + } + + if (p && p < range) + { + if (p - reg->dmin < s) + { + retry_gate: + pprev = p; + p += enclen(reg->enc, p, end); + goto retry; + } + + if (reg->sub_anchor) + { + UChar *prev; + + switch (reg->sub_anchor) + { + case ANCHOR_BEGIN_LINE: + if (!ON_STR_BEGIN(p)) + { + prev = onigenc_get_prev_char_head(reg->enc, (pprev ? pprev : str), + p, end); + if (!ONIGENC_IS_MBC_NEWLINE_EX(reg->enc, prev, str, end, + reg->options, 0)) + goto retry_gate; + } + break; + + case ANCHOR_END_LINE: + if (ON_STR_END(p)) + { +#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE + prev = (UChar *)onigenc_get_prev_char_head( + reg->enc, (pprev ? pprev : str), p); + if (prev + && ONIGENC_IS_MBC_NEWLINE_EX(reg->enc, prev, str, end, + reg->options, 1)) + goto retry_gate; +#endif + } + else if (!ONIGENC_IS_MBC_NEWLINE_EX(reg->enc, p, str, end, + reg->options, 1)) + goto retry_gate; + break; + } + } + + if (reg->dmax == 0) + { + *low = p; + if (low_prev) + { + if (*low > s) + *low_prev = onigenc_get_prev_char_head(reg->enc, s, p, end); + else + *low_prev = onigenc_get_prev_char_head(reg->enc, + (pprev ? pprev : str), p, end); + } + } + else + { + if (reg->dmax != ONIG_INFINITE_DISTANCE) + { + *low = p - reg->dmax; + if (*low > s) + { + *low = onigenc_get_right_adjust_char_head_with_prev( + reg->enc, s, *low, end, (const UChar **)low_prev); + if (low_prev && IS_NULL(*low_prev)) + *low_prev = onigenc_get_prev_char_head( + reg->enc, (pprev ? pprev : s), *low, end); + } + else + { + if (low_prev) + *low_prev = onigenc_get_prev_char_head( + reg->enc, (pprev ? pprev : str), *low, end); + } + } + } + /* no needs to adjust *high, *high is used as range check only */ + *high = p - reg->dmin; + +#ifdef ONIG_DEBUG_SEARCH + fprintf(stderr, + "forward_search_range success: low: %" PRIdPTR ", high: %" PRIdPTR + ", dmin: %" PRIdPTR ", dmax: %" PRIdPTR "\n", + *low - str, *high - str, reg->dmin, reg->dmax); +#endif + return 1; /* success */ + } + + return 0; /* fail */ +} + +#define BM_BACKWARD_SEARCH_LENGTH_THRESHOLD 100 + +static int backward_search_range(regex_t *reg, const UChar *str, + const UChar *end, UChar *s, const UChar *range, + UChar *adjrange, UChar **low, UChar **high) +{ + UChar *p; + + range += reg->dmin; + p = s; + +retry: + switch (reg->optimize) + { + case ONIG_OPTIMIZE_EXACT: + exact_method: + p = slow_search_backward(reg->enc, reg->exact, reg->exact_end, range, + adjrange, end, p); + break; + + case ONIG_OPTIMIZE_EXACT_IC: + case ONIG_OPTIMIZE_EXACT_BM_IC: + case ONIG_OPTIMIZE_EXACT_BM_NOT_REV_IC: + p = slow_search_backward_ic(reg->enc, reg->case_fold_flag, reg->exact, + reg->exact_end, range, adjrange, end, p); + break; + + case ONIG_OPTIMIZE_EXACT_BM: + case ONIG_OPTIMIZE_EXACT_BM_NOT_REV: +#ifdef USE_INT_MAP_BACKWARD + if (IS_NULL(reg->int_map_backward)) + { + int r; + if (s - range < BM_BACKWARD_SEARCH_LENGTH_THRESHOLD) + goto exact_method; + + r = set_bm_backward_skip(reg->exact, reg->exact_end, reg->enc, + &(reg->int_map_backward)); + if (r) + return r; + } + p = bm_search_backward(reg, reg->exact, reg->exact_end, range, adjrange, + end, p); +#else + goto exact_method; +#endif + break; + + case ONIG_OPTIMIZE_MAP: + p = map_search_backward(reg->enc, reg->map, range, adjrange, p, end); + break; + } + + if (p) + { + if (reg->sub_anchor) + { + UChar *prev; + + switch (reg->sub_anchor) + { + case ANCHOR_BEGIN_LINE: + if (!ON_STR_BEGIN(p)) + { + prev = onigenc_get_prev_char_head(reg->enc, str, p, end); + if (!ONIGENC_IS_MBC_NEWLINE_EX(reg->enc, prev, str, end, + reg->options, 0)) + { + p = prev; + goto retry; + } + } + break; + + case ANCHOR_END_LINE: + if (ON_STR_END(p)) + { +#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE + prev = onigenc_get_prev_char_head(reg->enc, adjrange, p); + if (IS_NULL(prev)) + goto fail; + if (ONIGENC_IS_MBC_NEWLINE_EX(reg->enc, prev, str, end, + reg->options, 1)) + { + p = prev; + goto retry; + } +#endif + } + else if (!ONIGENC_IS_MBC_NEWLINE_EX(reg->enc, p, str, end, + reg->options, 1)) + { + p = onigenc_get_prev_char_head(reg->enc, adjrange, p, end); + if (IS_NULL(p)) + goto fail; + goto retry; + } + break; + } + } + + /* no needs to adjust *high, *high is used as range check only */ + if (reg->dmax != ONIG_INFINITE_DISTANCE) + { + *low = p - reg->dmax; + *high = p - reg->dmin; + *high + = onigenc_get_right_adjust_char_head(reg->enc, adjrange, *high, end); + } + +#ifdef ONIG_DEBUG_SEARCH + fprintf(stderr, "backward_search_range: low: %d, high: %d\n", + (int)(*low - str), (int)(*high - str)); +#endif + return 1; /* success */ + } + +fail: +#ifdef ONIG_DEBUG_SEARCH + fprintf(stderr, "backward_search_range: fail.\n"); +#endif + return 0; /* fail */ +} + +extern OnigPosition onig_search(regex_t *reg, const UChar *str, + const UChar *end, const UChar *start, + const UChar *range, OnigRegion *region, + OnigOptionType option) +{ + return onig_search_gpos(reg, str, end, start, start, range, region, option); +} + +extern OnigPosition onig_search_gpos(regex_t *reg, const UChar *str, + const UChar *end, const UChar *global_pos, + const UChar *start, const UChar *range, + OnigRegion *region, OnigOptionType option) +{ + ptrdiff_t r; + UChar *s, *prev; + OnigMatchArg msa; +#ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE + const UChar *orig_start = start; + const UChar *orig_range = range; +#endif + +#ifdef ONIG_DEBUG_SEARCH + fprintf(stderr, + "onig_search (entry point): str: %" PRIuPTR " (%p), end: %" PRIuPTR + ", start: %" PRIuPTR ", range: %" PRIuPTR "\n", + (uintptr_t)str, str, end - str, start - str, range - str); +#endif + + if (region) + { + r = onig_region_resize_clear(region, reg->num_mem + 1); + if (r) + goto finish_no_msa; + } + + if (start > end || start < str) + goto mismatch_no_msa; + +#ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE +# ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE +# define MATCH_AND_RETURN_CHECK(upper_range) \ + r = match_at(reg, str, end, (upper_range), s, prev, &msa); \ + if (r != ONIG_MISMATCH) \ + { \ + if (r >= 0) \ + { \ + if (!IS_FIND_LONGEST(reg->options)) \ + { \ + goto match; \ + } \ + } \ + else \ + goto finish; /* error */ \ + } +# else +# define MATCH_AND_RETURN_CHECK(upper_range) \ + r = match_at(reg, str, end, (upper_range), s, prev, &msa); \ + if (r != ONIG_MISMATCH) \ + { \ + if (r >= 0) \ + { \ + goto match; \ + } \ + else \ + goto finish; /* error */ \ + } +# endif /* USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE */ +#else +# ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE +# define MATCH_AND_RETURN_CHECK(none) \ + r = match_at(reg, str, end, s, prev, &msa); \ + if (r != ONIG_MISMATCH) \ + { \ + if (r >= 0) \ + { \ + if (!IS_FIND_LONGEST(reg->options)) \ + { \ + goto match; \ + } \ + } \ + else \ + goto finish; /* error */ \ + } +# else +# define MATCH_AND_RETURN_CHECK(none) \ + r = match_at(reg, str, end, s, prev, &msa); \ + if (r != ONIG_MISMATCH) \ + { \ + if (r >= 0) \ + { \ + goto match; \ + } \ + else \ + goto finish; /* error */ \ + } +# endif /* USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE */ +#endif /* USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE */ + + /* anchor optimize: resume search range */ + if (reg->anchor != 0 && str < end) + { + UChar *min_semi_end, *max_semi_end; + + if (reg->anchor & ANCHOR_BEGIN_POSITION) + { + /* search start-position only */ + begin_position: + if (range > start) + { + if (global_pos > start) + { + if (global_pos < range) + range = global_pos + 1; + } + else + range = start + 1; + } + else + range = start; + } + else if (reg->anchor & ANCHOR_BEGIN_BUF) + { + /* search str-position only */ + if (range > start) + { + if (start != str) + goto mismatch_no_msa; + range = str + 1; + } + else + { + if (range <= str) + { + start = str; + range = str; + } + else + goto mismatch_no_msa; + } + } + else if (reg->anchor & ANCHOR_END_BUF) + { + min_semi_end = max_semi_end = (UChar *)end; + + end_buf: + if ((OnigDistance)(max_semi_end - str) < reg->anchor_dmin) + goto mismatch_no_msa; + + if (range > start) + { + if ((OnigDistance)(min_semi_end - start) > reg->anchor_dmax) + { + start = min_semi_end - reg->anchor_dmax; + if (start < end) + start + = onigenc_get_right_adjust_char_head(reg->enc, str, start, end); + } + if ((OnigDistance)(max_semi_end - (range - 1)) < reg->anchor_dmin) + { + range = max_semi_end - reg->anchor_dmin + 1; + } + + if (start > range) + goto mismatch_no_msa; + /* If start == range, match with empty at end. + Backward search is used. */ + } + else + { + if ((OnigDistance)(min_semi_end - range) > reg->anchor_dmax) + { + range = min_semi_end - reg->anchor_dmax; + } + if ((OnigDistance)(max_semi_end - start) < reg->anchor_dmin) + { + start = max_semi_end - reg->anchor_dmin; + start = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, str, start, end); + } + if (range > start) + goto mismatch_no_msa; + } + } + else if (reg->anchor & ANCHOR_SEMI_END_BUF) + { + UChar *pre_end = ONIGENC_STEP_BACK(reg->enc, str, end, end, 1); + + max_semi_end = (UChar *)end; + if (ONIGENC_IS_MBC_NEWLINE(reg->enc, pre_end, end)) + { + min_semi_end = pre_end; + +#ifdef USE_CRNL_AS_LINE_TERMINATOR + pre_end = ONIGENC_STEP_BACK(reg->enc, str, pre_end, end, 1); + if (IS_NOT_NULL(pre_end) && IS_NEWLINE_CRLF(reg->options) + && ONIGENC_IS_MBC_CRNL(reg->enc, pre_end, end)) + { + min_semi_end = pre_end; + } +#endif + if (min_semi_end > str && start <= min_semi_end) + { + goto end_buf; + } + } + else + { + min_semi_end = (UChar *)end; + goto end_buf; + } + } + else if ((reg->anchor & ANCHOR_ANYCHAR_STAR_ML)) + { + goto begin_position; + } + } + else if (str == end) + { /* empty string */ + static const UChar address_for_empty_string[] = ""; + +#ifdef ONIG_DEBUG_SEARCH + fprintf(stderr, "onig_search: empty string.\n"); +#endif + + if (reg->threshold_len == 0) + { + start = end = str = address_for_empty_string; + s = (UChar *)start; + prev = (UChar *)NULL; + + MATCH_ARG_INIT(msa, option, region, start, start); +#ifdef USE_COMBINATION_EXPLOSION_CHECK + msa.state_check_buff = (void *)0; + msa.state_check_buff_size = 0; /* NO NEED, for valgrind */ +#endif + MATCH_AND_RETURN_CHECK(end); + goto mismatch; + } + goto mismatch_no_msa; + } + +#ifdef ONIG_DEBUG_SEARCH + fprintf(stderr, "onig_search(apply anchor): end: %d, start: %d, range: %d\n", + (int)(end - str), (int)(start - str), (int)(range - str)); +#endif + + MATCH_ARG_INIT(msa, option, region, start, global_pos); +#ifdef USE_COMBINATION_EXPLOSION_CHECK + { + int offset = (MIN(start, range) - str); + STATE_CHECK_BUFF_INIT(msa, end - str, offset, reg->num_comb_exp_check); + } +#endif + + s = (UChar *)start; + if (range > start) + { /* forward search */ + if (s > str) + prev = onigenc_get_prev_char_head(reg->enc, str, s, end); + else + prev = (UChar *)NULL; + + if (reg->optimize != ONIG_OPTIMIZE_NONE) + { + UChar *sch_range, *low, *high, *low_prev; + + sch_range = (UChar *)range; + if (reg->dmax != 0) + { + if (reg->dmax == ONIG_INFINITE_DISTANCE) + sch_range = (UChar *)end; + else + { + sch_range += reg->dmax; + if (sch_range > end) + sch_range = (UChar *)end; + } + } + + if ((end - start) < reg->threshold_len) + goto mismatch; + + if (reg->dmax != ONIG_INFINITE_DISTANCE) + { + do + { + if (!forward_search_range(reg, str, end, s, sch_range, &low, &high, + &low_prev)) + goto mismatch; + if (s < low) + { + s = low; + prev = low_prev; + } + while (s <= high) + { + MATCH_AND_RETURN_CHECK(orig_range); + prev = s; + s += enclen(reg->enc, s, end); + } + } while (s < range); + goto mismatch; + } + else + { /* check only. */ + if (!forward_search_range(reg, str, end, s, sch_range, &low, &high, + (UChar **)NULL)) + goto mismatch; + + if ((reg->anchor & ANCHOR_ANYCHAR_STAR) != 0) + { + do + { + MATCH_AND_RETURN_CHECK(orig_range); + prev = s; + s += enclen(reg->enc, s, end); + + if ((reg->anchor & (ANCHOR_LOOK_BEHIND | ANCHOR_PREC_READ_NOT)) + == 0) + { + while (!ONIGENC_IS_MBC_NEWLINE_EX(reg->enc, prev, str, end, + reg->options, 0) + && s < range) + { + prev = s; + s += enclen(reg->enc, s, end); + } + } + } while (s < range); + goto mismatch; + } + } + } + + do + { + MATCH_AND_RETURN_CHECK(orig_range); + prev = s; + s += enclen(reg->enc, s, end); + } while (s < range); + + if (s == range) + { /* because empty match with /$/. */ + MATCH_AND_RETURN_CHECK(orig_range); + } + } + else + { /* backward search */ + if (reg->optimize != ONIG_OPTIMIZE_NONE) + { + UChar *low, *high, *adjrange, *sch_start; + + if (range < end) + adjrange = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, str, range, end); + else + adjrange = (UChar *)end; + + if (reg->dmax != ONIG_INFINITE_DISTANCE + && (end - range) >= reg->threshold_len) + { + do + { + sch_start = s + reg->dmax; + if (sch_start > end) + sch_start = (UChar *)end; + if (backward_search_range(reg, str, end, sch_start, range, adjrange, + &low, &high) + <= 0) + goto mismatch; + + if (s > high) + s = high; + + while (s >= low) + { + prev = onigenc_get_prev_char_head(reg->enc, str, s, end); + MATCH_AND_RETURN_CHECK(orig_start); + s = prev; + } + } while (s >= range); + goto mismatch; + } + else + { /* check only. */ + if ((end - range) < reg->threshold_len) + goto mismatch; + + sch_start = s; + if (reg->dmax != 0) + { + if (reg->dmax == ONIG_INFINITE_DISTANCE) + sch_start = (UChar *)end; + else + { + sch_start += reg->dmax; + if (sch_start > end) + sch_start = (UChar *)end; + else + sch_start = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, start, + sch_start, end); + } + } + if (backward_search_range(reg, str, end, sch_start, range, adjrange, + &low, &high) + <= 0) + goto mismatch; + } + } + + do + { + prev = onigenc_get_prev_char_head(reg->enc, str, s, end); + MATCH_AND_RETURN_CHECK(orig_start); + s = prev; + } while (s >= range); + } + +mismatch: +#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE + if (IS_FIND_LONGEST(reg->options)) + { + if (msa.best_len >= 0) + { + s = msa.best_s; + goto match; + } + } +#endif + r = ONIG_MISMATCH; + +finish: + MATCH_ARG_FREE(msa); + + /* If result is mismatch and no FIND_NOT_EMPTY option, + then the region is not set in match_at(). */ + if (IS_FIND_NOT_EMPTY(reg->options) && region) + { + onig_region_clear(region); + } + +#ifdef ONIG_DEBUG + if (r != ONIG_MISMATCH) + fprintf(stderr, "onig_search: error %" PRIdPTRDIFF "\n", r); +#endif + return r; + +mismatch_no_msa: + r = ONIG_MISMATCH; +finish_no_msa: +#ifdef ONIG_DEBUG + if (r != ONIG_MISMATCH) + fprintf(stderr, "onig_search: error %" PRIdPTRDIFF "\n", r); +#endif + return r; + +match: + MATCH_ARG_FREE(msa); + return s - str; +} + +extern OnigPosition onig_scan(regex_t *reg, const UChar *str, const UChar *end, + OnigRegion *region, OnigOptionType option, + int (*scan_callback)(OnigPosition, OnigPosition, + OnigRegion *, void *), + void *callback_arg) +{ + OnigPosition r; + OnigPosition n; + int rs; + const UChar *start; + + n = 0; + start = str; + while (1) + { + r = onig_search(reg, str, end, start, end, region, option); + if (r >= 0) + { + rs = scan_callback(n, r, region, callback_arg); + n++; + if (rs != 0) + return rs; + + if (region->end[0] == start - str) + start++; + else + start = str + region->end[0]; + + if (start > end) + break; + } + else if (r == ONIG_MISMATCH) + { + break; + } + else + { /* error */ + return r; + } + } + + return n; +} + +extern OnigEncoding onig_get_encoding(const regex_t *reg) +{ + return reg->enc; +} + +extern OnigOptionType onig_get_options(const regex_t *reg) +{ + return reg->options; +} + +extern OnigCaseFoldType onig_get_case_fold_flag(const regex_t *reg) +{ + return reg->case_fold_flag; +} + +extern const OnigSyntaxType *onig_get_syntax(const regex_t *reg) +{ + return reg->syntax; +} + +extern int onig_number_of_captures(const regex_t *reg) +{ + return reg->num_mem; +} + +extern int onig_number_of_capture_histories(const regex_t *reg) +{ +#ifdef USE_CAPTURE_HISTORY + int i, n; + + n = 0; + for (i = 0; i <= ONIG_MAX_CAPTURE_HISTORY_GROUP; i++) + { + if (BIT_STATUS_AT(reg->capture_history, i) != 0) + n++; + } + return n; +#else + return 0; +#endif +} + +extern void onig_copy_encoding(OnigEncodingType *to, OnigEncoding from) +{ + *to = *from; +} diff --git a/lib/edbee-lib/vendor/onig/regext.c b/lib/edbee-lib/vendor/onig/regext.c new file mode 100644 index 00000000..36b72aea --- /dev/null +++ b/lib/edbee-lib/vendor/onig/regext.c @@ -0,0 +1,222 @@ +/********************************************************************** + regext.c - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regint.h" + +static void conv_ext0be32(const UChar *s, const UChar *end, UChar *conv) +{ + while (s < end) + { + *conv++ = '\0'; + *conv++ = '\0'; + *conv++ = '\0'; + *conv++ = *s++; + } +} + +static void conv_ext0le32(const UChar *s, const UChar *end, UChar *conv) +{ + while (s < end) + { + *conv++ = *s++; + *conv++ = '\0'; + *conv++ = '\0'; + *conv++ = '\0'; + } +} + +static void conv_ext0be(const UChar *s, const UChar *end, UChar *conv) +{ + while (s < end) + { + *conv++ = '\0'; + *conv++ = *s++; + } +} + +static void conv_ext0le(const UChar *s, const UChar *end, UChar *conv) +{ + while (s < end) + { + *conv++ = *s++; + *conv++ = '\0'; + } +} + +static void conv_swap4bytes(const UChar *s, const UChar *end, UChar *conv) +{ + while (s < end) + { + *conv++ = s[3]; + *conv++ = s[2]; + *conv++ = s[1]; + *conv++ = s[0]; + s += 4; + } +} + +static void conv_swap2bytes(const UChar *s, const UChar *end, UChar *conv) +{ + while (s < end) + { + *conv++ = s[1]; + *conv++ = s[0]; + s += 2; + } +} + +static int conv_encoding(OnigEncoding from, OnigEncoding to, const UChar *s, + const UChar *end, UChar **conv, UChar **conv_end) +{ + ptrdiff_t len = end - s; + + if (to == ONIG_ENCODING_UTF16_BE) + { + if (from == ONIG_ENCODING_ASCII || from == ONIG_ENCODING_ISO_8859_1) + { + *conv = (UChar *)xmalloc(len * 2); + CHECK_NULL_RETURN_MEMERR(*conv); + *conv_end = *conv + (len * 2); + conv_ext0be(s, end, *conv); + return 0; + } + else if (from == ONIG_ENCODING_UTF16_LE) + { + swap16: + *conv = (UChar *)xmalloc(len); + CHECK_NULL_RETURN_MEMERR(*conv); + *conv_end = *conv + len; + conv_swap2bytes(s, end, *conv); + return 0; + } + } + else if (to == ONIG_ENCODING_UTF16_LE) + { + if (from == ONIG_ENCODING_ASCII || from == ONIG_ENCODING_ISO_8859_1) + { + *conv = (UChar *)xmalloc(len * 2); + CHECK_NULL_RETURN_MEMERR(*conv); + *conv_end = *conv + (len * 2); + conv_ext0le(s, end, *conv); + return 0; + } + else if (from == ONIG_ENCODING_UTF16_BE) + { + goto swap16; + } + } + if (to == ONIG_ENCODING_UTF32_BE) + { + if (from == ONIG_ENCODING_ASCII || from == ONIG_ENCODING_ISO_8859_1) + { + *conv = (UChar *)xmalloc(len * 4); + CHECK_NULL_RETURN_MEMERR(*conv); + *conv_end = *conv + (len * 4); + conv_ext0be32(s, end, *conv); + return 0; + } + else if (from == ONIG_ENCODING_UTF32_LE) + { + swap32: + *conv = (UChar *)xmalloc(len); + CHECK_NULL_RETURN_MEMERR(*conv); + *conv_end = *conv + len; + conv_swap4bytes(s, end, *conv); + return 0; + } + } + else if (to == ONIG_ENCODING_UTF32_LE) + { + if (from == ONIG_ENCODING_ASCII || from == ONIG_ENCODING_ISO_8859_1) + { + *conv = (UChar *)xmalloc(len * 4); + CHECK_NULL_RETURN_MEMERR(*conv); + *conv_end = *conv + (len * 4); + conv_ext0le32(s, end, *conv); + return 0; + } + else if (from == ONIG_ENCODING_UTF32_BE) + { + goto swap32; + } + } + + return ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION; +} + +extern int onig_new_deluxe(regex_t **reg, const UChar *pattern, + const UChar *pattern_end, OnigCompileInfo *ci, + OnigErrorInfo *einfo) +{ + int r; + UChar *cpat, *cpat_end; + + if (IS_NOT_NULL(einfo)) + einfo->par = (UChar *)NULL; + + if (ci->pattern_enc != ci->target_enc) + { + r = conv_encoding(ci->pattern_enc, ci->target_enc, pattern, pattern_end, + &cpat, &cpat_end); + if (r) + return r; + } + else + { + cpat = (UChar *)pattern; + cpat_end = (UChar *)pattern_end; + } + + *reg = (regex_t *)xmalloc(sizeof(regex_t)); + if (IS_NULL(*reg)) + { + r = ONIGERR_MEMORY; + goto err2; + } + + r = onig_reg_init(*reg, ci->option, ci->case_fold_flag, ci->target_enc, + ci->syntax); + if (r) + goto err; + + r = onig_compile(*reg, cpat, cpat_end, einfo); + if (r) + { + err: + onig_free(*reg); + *reg = NULL; + } + +err2: + if (cpat != pattern) + xfree(cpat); + + return r; +} diff --git a/lib/edbee-lib/vendor/onig/reggnu.c b/lib/edbee-lib/vendor/onig/reggnu.c new file mode 100644 index 00000000..3afd1899 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/reggnu.c @@ -0,0 +1,142 @@ +/********************************************************************** + reggnu.c - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regint.h" + +#ifndef ONIGMOGNU_H +# include "onigmognu.h" +#endif + +extern void re_free_registers(OnigRegion *r) +{ + /* 0: don't free self */ + onig_region_free(r, 0); +} + +extern int re_adjust_startpos(regex_t *reg, const char *string, int size, + int startpos, int range) +{ + if (startpos > 0 && ONIGENC_MBC_MAXLEN(reg->enc) != 1 && startpos < size) + { + UChar *p; + UChar *s = (UChar *)string + startpos; + UChar *e = (UChar *)string + size; + + if (range > 0) + { + p = onigenc_get_right_adjust_char_head(reg->enc, (UChar *)string, s, e); + } + else + { + p = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, (UChar *)string, s, e); + } + return (int)(p - (UChar *)string); + } + + return startpos; +} + +extern int re_match(regex_t *reg, const char *str, int size, int pos, + struct re_registers *regs) +{ + return (int)onig_match(reg, (UChar *)str, (UChar *)(str + size), + (UChar *)(str + pos), regs, ONIG_OPTION_NONE); +} + +extern int re_search(regex_t *bufp, const char *string, int size, int startpos, + int range, struct re_registers *regs) +{ + return (int)onig_search(bufp, (UChar *)string, (UChar *)(string + size), + (UChar *)(string + startpos), + (UChar *)(string + startpos + range), regs, + ONIG_OPTION_NONE); +} + +extern int re_compile_pattern(const char *pattern, int size, regex_t *reg, + char *ebuf) +{ + int r; + OnigErrorInfo einfo; + + r = onig_compile(reg, (UChar *)pattern, (UChar *)(pattern + size), &einfo); + if (r != ONIG_NORMAL) + { + if (IS_NOT_NULL(ebuf)) + (void)onig_error_code_to_str((UChar *)ebuf, r, &einfo); + } + + return r; +} + +extern void re_free_pattern(regex_t *reg) +{ + onig_free(reg); +} + +extern int re_alloc_pattern(regex_t **reg) +{ + *reg = (regex_t *)xmalloc(sizeof(regex_t)); + if (IS_NULL(*reg)) + return ONIGERR_MEMORY; + + return onig_reg_init(*reg, ONIG_OPTION_DEFAULT, ONIGENC_CASE_FOLD_DEFAULT, + OnigEncDefaultCharEncoding, OnigDefaultSyntax); +} + +extern void re_set_casetable(const char *table) +{ + /* onigenc_set_default_caseconv_table((UChar* )table); */ +} + +extern void re_mbcinit(int mb_code) +{ + OnigEncoding enc; + + switch (mb_code) + { + case RE_MBCTYPE_ASCII: + enc = ONIG_ENCODING_ASCII; + break; + case RE_MBCTYPE_EUC: + enc = ONIG_ENCODING_EUC_JP; + break; + case RE_MBCTYPE_SJIS: + enc = ONIG_ENCODING_SJIS; + break; + case RE_MBCTYPE_UTF8: + enc = ONIG_ENCODING_UTF8; + break; + default: + return; + break; + } + + onigenc_set_default_encoding(enc); +} diff --git a/lib/edbee-lib/vendor/onig/regint.h b/lib/edbee-lib/vendor/onig/regint.h new file mode 100644 index 00000000..b422d07b --- /dev/null +++ b/lib/edbee-lib/vendor/onig/regint.h @@ -0,0 +1,1024 @@ +#ifndef ONIGMO_REGINT_H +#define ONIGMO_REGINT_H +/********************************************************************** + regint.h - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2013 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* for debug */ +/* #define ONIG_DEBUG_PARSE_TREE */ +/* #define ONIG_DEBUG_COMPILE */ +/* #define ONIG_DEBUG_SEARCH */ +/* #define ONIG_DEBUG_MATCH */ +/* #define ONIG_DEBUG_MEMLEAK */ +/* #define ONIG_DONT_OPTIMIZE */ + +/* for byte-code statistical data. */ +/* #define ONIG_DEBUG_STATISTICS */ + +#if defined(ONIG_DEBUG_PARSE_TREE) || defined(ONIG_DEBUG_MATCH) \ + || defined(ONIG_DEBUG_SEARCH) || defined(ONIG_DEBUG_COMPILE) \ + || defined(ONIG_DEBUG_STATISTICS) || defined(ONIG_DEBUG_MEMLEAK) +# ifndef ONIG_DEBUG +# define ONIG_DEBUG +# endif +#endif + +#ifndef UNALIGNED_WORD_ACCESS +# if defined(__i386) || defined(__i386__) || defined(_M_IX86) \ + || defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) \ + || defined(__powerpc64__) || defined(__mc68020__) +# define UNALIGNED_WORD_ACCESS 1 +# else +# define UNALIGNED_WORD_ACCESS 0 +# endif +#endif + +#if UNALIGNED_WORD_ACCESS +# define PLATFORM_UNALIGNED_WORD_ACCESS +#endif + +/* config */ +/* spec. config */ +#define USE_NAMED_GROUP +#define USE_SUBEXP_CALL +#define USE_PERL_SUBEXP_CALL +#define USE_CAPITAL_P_NAMED_GROUP +#define USE_BACKREF_WITH_LEVEL /* \k<name+n>, \k<name-n> */ +#define USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT /* /(?:()|())*\2/ */ +#define USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE /* /\n$/ =~ "\n" */ +#define USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATOR +/* !!! moved to regenc.h. */ /* #define USE_CRNL_AS_LINE_TERMINATOR */ +#define USE_NO_INVALID_QUANTIFIER + +/* internal config */ +/* #define USE_OP_PUSH_OR_JUMP_EXACT */ +#define USE_QTFR_PEEK_NEXT +#define USE_ST_LIBRARY +#define USE_SUNDAY_QUICK_SEARCH + +#define INIT_MATCH_STACK_SIZE 160 +#define DEFAULT_MATCH_STACK_LIMIT_SIZE 0 /* unlimited */ +#define DEFAULT_PARSE_DEPTH_LIMIT 4096 + +#define OPT_EXACT_MAXLEN 24 + +/* check config */ +#if defined(USE_PERL_SUBEXP_CALL) || defined(USE_CAPITAL_P_NAMED_GROUP) +# if !defined(USE_NAMED_GROUP) || !defined(USE_SUBEXP_CALL) +# error USE_NAMED_GROUP and USE_SUBEXP_CALL must be defined. +# endif +#endif + +#if defined(__GNUC__) +# define ARG_UNUSED __attribute__((unused)) +#else +# define ARG_UNUSED +#endif + +#if !defined(RUBY) && defined(RUBY_EXPORT) +# define RUBY +#endif +#ifdef RUBY +# ifndef RUBY_DEFINES_H +# include "ruby/ruby.h" +# undef xmalloc +# undef xrealloc +# undef xcalloc +# undef xfree +# endif +#else /* RUBY */ +# include "config.h" +# if SIZEOF_LONG_LONG > 0 +# define LONG_LONG long long +# endif +#endif /* RUBY */ + +#include <stdarg.h> + +/* */ +/* escape other system UChar definition */ +#ifdef ONIG_ESCAPE_UCHAR_COLLISION +# undef ONIG_ESCAPE_UCHAR_COLLISION +#endif + +#define USE_WORD_BEGIN_END /* "\<": word-begin, "\>": word-end */ +#ifdef RUBY +# undef USE_CAPTURE_HISTORY +#else +# define USE_CAPTURE_HISTORY +#endif +#define USE_VARIABLE_META_CHARS +#define USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE +/* #define USE_COMBINATION_EXPLOSION_CHECK */ /* (X*)* */ + +#ifndef xmalloc +# define xmalloc malloc +# define xrealloc realloc +# define xcalloc calloc +# define xfree free +#endif + +#ifdef RUBY + +# define CHECK_INTERRUPT_IN_MATCH_AT rb_thread_check_ints() +# define onig_st_init_table st_init_table +# define onig_st_init_table_with_size st_init_table_with_size +# define onig_st_init_numtable st_init_numtable +# define onig_st_init_numtable_with_size st_init_numtable_with_size +# define onig_st_init_strtable st_init_strtable +# define onig_st_init_strtable_with_size st_init_strtable_with_size +# define onig_st_delete st_delete +# define onig_st_delete_safe st_delete_safe +# define onig_st_insert st_insert +# define onig_st_lookup st_lookup +# define onig_st_foreach st_foreach +# define onig_st_add_direct st_add_direct +# define onig_st_free_table st_free_table +# define onig_st_cleanup_safe st_cleanup_safe +# define onig_st_copy st_copy +# define onig_st_nothing_key_clone st_nothing_key_clone +# define onig_st_nothing_key_free st_nothing_key_free +# define onig_st_is_member st_is_member + +# define USE_UPPER_CASE_TABLE +#else /* RUBY */ + +# define CHECK_INTERRUPT_IN_MATCH_AT + +# define st_init_table onig_st_init_table +# define st_init_table_with_size onig_st_init_table_with_size +# define st_init_numtable onig_st_init_numtable +# define st_init_numtable_with_size onig_st_init_numtable_with_size +# define st_init_strtable onig_st_init_strtable +# define st_init_strtable_with_size onig_st_init_strtable_with_size +# define st_delete onig_st_delete +# define st_delete_safe onig_st_delete_safe +# define st_insert onig_st_insert +# define st_lookup onig_st_lookup +# define st_foreach onig_st_foreach +# define st_add_direct onig_st_add_direct +# define st_free_table onig_st_free_table +# define st_cleanup_safe onig_st_cleanup_safe +# define st_copy onig_st_copy +# define st_nothing_key_clone onig_st_nothing_key_clone +# define st_nothing_key_free onig_st_nothing_key_free +/* */ +# define onig_st_is_member st_is_member + +#endif /* RUBY */ + +#define STATE_CHECK_STRING_THRESHOLD_LEN 7 +#define STATE_CHECK_BUFF_MAX_SIZE 0x4000 + +#define xmemset memset +#define xmemcpy memcpy +#define xmemmove memmove + +#if ((defined(RUBY_MSVCRT_VERSION) && RUBY_MSVCRT_VERSION >= 90) \ + || (!defined(RUBY_MSVCRT_VERSION) && defined(_WIN32))) \ + && !defined(__GNUC__) +# define xalloca _alloca +# define xvsnprintf(buf, size, fmt, args) \ + _vsnprintf_s(buf, size, _TRUNCATE, fmt, args) +# define xsnprintf sprintf_s +# define xstrcat(dest, src, size) strcat_s(dest, size, src) +#else +# define xalloca alloca +# define xvsnprintf vsnprintf +# define xsnprintf snprintf +# define xstrcat(dest, src, size) strcat(dest, src) +#endif + +#if defined(ONIG_DEBUG_MEMLEAK) && defined(_MSC_VER) +# define _CRTDBG_MAP_ALLOC +# include <malloc.h> +# include <crtdbg.h> +#endif + +#include <stdlib.h> + +#if defined(HAVE_ALLOCA_H) && (defined(_AIX) || !defined(__GNUC__)) +# include <alloca.h> +#endif + +#include <string.h> + +#include <ctype.h> +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif + +#ifdef HAVE_STDINT_H +# include <stdint.h> +#endif + +#ifdef HAVE_INTTYPES_H +# include <inttypes.h> +#endif + +#include <stddef.h> + +#ifdef _WIN32 +# include <malloc.h> /* for alloca() */ +#endif + +#ifdef ONIG_DEBUG +# include <stdio.h> +#endif + +#ifdef _WIN32 +# if defined(_MSC_VER) && (_MSC_VER < 1300) +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +typedef int intptr_t; +# endif +# ifndef _UINTPTR_T_DEFINED +# define _UINTPTR_T_DEFINED +typedef unsigned int uintptr_t; +# endif +# endif +#endif /* _WIN32 */ + +#ifndef PRIdPTR +# ifdef _WIN64 +# define PRIdPTR "I64d" +# define PRIuPTR "I64u" +# define PRIxPTR "I64x" +# else +# define PRIdPTR "ld" +# define PRIuPTR "lu" +# define PRIxPTR "lx" +# endif +#endif + +#ifndef PRIdPTRDIFF +# define PRIdPTRDIFF PRIdPTR +#endif + +#include "regenc.h" + +RUBY_SYMBOL_EXPORT_BEGIN + +#ifdef MIN +# undef MIN +#endif +#ifdef MAX +# undef MAX +#endif +#define MIN(a, b) (((a) > (b)) ? (b) : (a)) +#define MAX(a, b) (((a) < (b)) ? (b) : (a)) + +#define IS_NULL(p) (((void *)(p)) == (void *)0) +#define IS_NOT_NULL(p) (((void *)(p)) != (void *)0) +#define CHECK_NULL_RETURN(p) \ + if (IS_NULL(p)) \ + return NULL +#define CHECK_NULL_RETURN_MEMERR(p) \ + if (IS_NULL(p)) \ + return ONIGERR_MEMORY +#define NULL_UCHARP ((UChar *)0) + +#define ONIG_LAST_CODE_POINT (~((OnigCodePoint)0)) + +#ifdef PLATFORM_UNALIGNED_WORD_ACCESS + +# define PLATFORM_GET_INC(val, p, type) \ + do \ + { \ + val = *(type *)p; \ + (p) += sizeof(type); \ + } while (0) + +#else + +# define PLATFORM_GET_INC(val, p, type) \ + do \ + { \ + xmemcpy(&val, (p), sizeof(type)); \ + (p) += sizeof(type); \ + } while (0) + +/* sizeof(OnigCodePoint) */ +# define WORD_ALIGNMENT_SIZE SIZEOF_LONG + +# define GET_ALIGNMENT_PAD_SIZE(addr, pad_size) \ + do \ + { \ + (pad_size) \ + = WORD_ALIGNMENT_SIZE - ((uintptr_t)(addr) % WORD_ALIGNMENT_SIZE); \ + if ((pad_size) == WORD_ALIGNMENT_SIZE) \ + (pad_size) = 0; \ + } while (0) + +# define ALIGNMENT_RIGHT(addr) \ + do \ + { \ + (addr) += (WORD_ALIGNMENT_SIZE - 1); \ + (addr) -= ((uintptr_t)(addr) % WORD_ALIGNMENT_SIZE); \ + } while (0) + +#endif /* PLATFORM_UNALIGNED_WORD_ACCESS */ + +/* stack pop level */ +#define STACK_POP_LEVEL_FREE 0 +#define STACK_POP_LEVEL_MEM_START 1 +#define STACK_POP_LEVEL_ALL 2 + +/* optimize flags */ +#define ONIG_OPTIMIZE_NONE 0 +#define ONIG_OPTIMIZE_EXACT 1 /* Slow Search */ +#define ONIG_OPTIMIZE_EXACT_BM 2 /* Boyer Moore Search */ +#define ONIG_OPTIMIZE_EXACT_BM_NOT_REV \ + 3 /* BM (applied to a multibyte string) */ +#define ONIG_OPTIMIZE_EXACT_IC 4 /* Slow Search (ignore case) */ +#define ONIG_OPTIMIZE_MAP 5 /* char map */ +#define ONIG_OPTIMIZE_EXACT_BM_IC 6 /* BM (ignore case) */ +#define ONIG_OPTIMIZE_EXACT_BM_NOT_REV_IC \ + 7 /* BM (applied to a multibyte string) (ignore case) */ + +/* bit status */ +typedef unsigned int BitStatusType; + +#define BIT_STATUS_BITS_NUM (sizeof(BitStatusType) * 8) +#define BIT_STATUS_CLEAR(stats) (stats) = 0 +#define BIT_STATUS_ON_ALL(stats) (stats) = ~((BitStatusType)0) +#define BIT_STATUS_AT(stats, n) \ + ((n) < (int)BIT_STATUS_BITS_NUM ? ((stats) & ((BitStatusType)1 << n)) \ + : ((stats) & 1)) + +#define BIT_STATUS_ON_AT(stats, n) \ + do \ + { \ + if ((n) < (int)BIT_STATUS_BITS_NUM) \ + (stats) |= (1 << (n)); \ + else \ + (stats) |= 1; \ + } while (0) + +#define BIT_STATUS_ON_AT_SIMPLE(stats, n) \ + do \ + { \ + if ((n) < (int)BIT_STATUS_BITS_NUM) \ + (stats) |= (1 << (n)); \ + } while (0) + +#define INT_MAX_LIMIT ((1UL << (SIZEOF_INT * 8 - 1)) - 1) + +#define DIGITVAL(code) ((code) - '0') +#define ODIGITVAL(code) DIGITVAL(code) +#define XDIGITVAL(enc, code) \ + (ONIGENC_IS_CODE_DIGIT(enc, code) \ + ? DIGITVAL(code) \ + : (ONIGENC_IS_CODE_UPPER(enc, code) ? (code) - 'A' + 10 \ + : (code) - 'a' + 10)) + +#define IS_SINGLELINE(option) ((option) & ONIG_OPTION_SINGLELINE) +#define IS_MULTILINE(option) ((option) & ONIG_OPTION_MULTILINE) +#define IS_IGNORECASE(option) ((option) & ONIG_OPTION_IGNORECASE) +#define IS_EXTEND(option) ((option) & ONIG_OPTION_EXTEND) +#define IS_FIND_LONGEST(option) ((option) & ONIG_OPTION_FIND_LONGEST) +#define IS_FIND_NOT_EMPTY(option) ((option) & ONIG_OPTION_FIND_NOT_EMPTY) +#define IS_FIND_CONDITION(option) \ + ((option) & (ONIG_OPTION_FIND_LONGEST | ONIG_OPTION_FIND_NOT_EMPTY)) +#define IS_NOTBOL(option) ((option) & ONIG_OPTION_NOTBOL) +#define IS_NOTEOL(option) ((option) & ONIG_OPTION_NOTEOL) +#define IS_NOTBOS(option) ((option) & ONIG_OPTION_NOTBOS) +#define IS_NOTEOS(option) ((option) & ONIG_OPTION_NOTEOS) +#define IS_ASCII_RANGE(option) ((option) & ONIG_OPTION_ASCII_RANGE) +#define IS_POSIX_BRACKET_ALL_RANGE(option) \ + ((option) & ONIG_OPTION_POSIX_BRACKET_ALL_RANGE) +#define IS_WORD_BOUND_ALL_RANGE(option) \ + ((option) & ONIG_OPTION_WORD_BOUND_ALL_RANGE) +#define IS_NEWLINE_CRLF(option) ((option) & ONIG_OPTION_NEWLINE_CRLF) + +/* OP_SET_OPTION is required for these options. +#define IS_DYNAMIC_OPTION(option) \ + (((option) & (ONIG_OPTION_MULTILINE | ONIG_OPTION_IGNORECASE)) != 0) +*/ +/* ignore-case and multibyte status are included in compiled code. */ +#define IS_DYNAMIC_OPTION(option) 0 + +#define DISABLE_CASE_FOLD_MULTI_CHAR(case_fold_flag) \ + ((case_fold_flag) & ~INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) + +#define REPEAT_INFINITE -1 +#define IS_REPEAT_INFINITE(n) ((n) == REPEAT_INFINITE) + +/* bitset */ +#define BITS_PER_BYTE 8 +#define SINGLE_BYTE_SIZE (1 << BITS_PER_BYTE) +#define BITS_IN_ROOM ((int)sizeof(Bits) * BITS_PER_BYTE) +#define BITSET_SIZE (SINGLE_BYTE_SIZE / BITS_IN_ROOM) + +#ifdef PLATFORM_UNALIGNED_WORD_ACCESS +typedef unsigned int Bits; +#else +typedef unsigned char Bits; +#endif +typedef Bits BitSet[BITSET_SIZE]; +typedef Bits *BitSetRef; + +#define SIZE_BITSET (int)sizeof(BitSet) + +#define BITSET_CLEAR(bs) \ + do \ + { \ + int i; \ + for (i = 0; i < BITSET_SIZE; i++) \ + { \ + (bs)[i] = 0; \ + } \ + } while (0) + +#define BS_ROOM(bs, pos) (bs)[(int)(pos) / BITS_IN_ROOM] +#define BS_BIT(pos) (1U << ((int)(pos) % BITS_IN_ROOM)) + +#define BITSET_AT(bs, pos) (BS_ROOM(bs, pos) & BS_BIT(pos)) +#define BITSET_SET_BIT(bs, pos) BS_ROOM(bs, pos) |= BS_BIT(pos) +#define BITSET_CLEAR_BIT(bs, pos) BS_ROOM(bs, pos) &= ~(BS_BIT(pos)) +#define BITSET_INVERT_BIT(bs, pos) BS_ROOM(bs, pos) ^= BS_BIT(pos) + +/* bytes buffer */ +typedef struct _BBuf +{ + UChar *p; + unsigned int used; + unsigned int alloc; +} BBuf; + +#define BBUF_INIT(buf, size) onig_bbuf_init((BBuf *)(buf), (size)) + +#define BBUF_SIZE_INC(buf, inc) \ + do \ + { \ + UChar *tmp; \ + (buf)->alloc += (inc); \ + tmp = (UChar *)xrealloc((buf)->p, (buf)->alloc); \ + if (IS_NULL(tmp)) \ + return (ONIGERR_MEMORY); \ + (buf)->p = tmp; \ + } while (0) + +#define BBUF_EXPAND(buf, low) \ + do \ + { \ + UChar *tmp; \ + do \ + { \ + (buf)->alloc *= 2; \ + } while ((buf)->alloc < (unsigned int)low); \ + tmp = (UChar *)xrealloc((buf)->p, (buf)->alloc); \ + if (IS_NULL(tmp)) \ + return (ONIGERR_MEMORY); \ + (buf)->p = tmp; \ + } while (0) + +#define BBUF_ENSURE_SIZE(buf, size) \ + do \ + { \ + unsigned int new_alloc = (buf)->alloc; \ + while (new_alloc < (unsigned int)(size)) \ + { \ + new_alloc *= 2; \ + } \ + if ((buf)->alloc != new_alloc) \ + { \ + UChar *tmp; \ + tmp = (UChar *)xrealloc((buf)->p, new_alloc); \ + if (IS_NULL(tmp)) \ + return (ONIGERR_MEMORY); \ + (buf)->p = tmp; \ + (buf)->alloc = new_alloc; \ + } \ + } while (0) + +#define BBUF_WRITE(buf, pos, bytes, n) \ + do \ + { \ + int used = (pos) + (int)(n); \ + if ((buf)->alloc < (unsigned int)used) \ + BBUF_EXPAND((buf), used); \ + xmemcpy((buf)->p + (pos), (bytes), (n)); \ + if ((buf)->used < (unsigned int)used) \ + (buf)->used = used; \ + } while (0) + +#define BBUF_WRITE1(buf, pos, byte) \ + do \ + { \ + int used = (pos) + 1; \ + if ((buf)->alloc < (unsigned int)used) \ + BBUF_EXPAND((buf), used); \ + (buf)->p[(pos)] = (UChar)(byte); \ + if ((buf)->used < (unsigned int)used) \ + (buf)->used = used; \ + } while (0) + +#define BBUF_ADD(buf, bytes, n) BBUF_WRITE((buf), (buf)->used, (bytes), (n)) +#define BBUF_ADD1(buf, byte) BBUF_WRITE1((buf), (buf)->used, (byte)) +#define BBUF_GET_ADD_ADDRESS(buf) ((buf)->p + (buf)->used) +#define BBUF_GET_OFFSET_POS(buf) ((buf)->used) + +/* from < to */ +#define BBUF_MOVE_RIGHT(buf, from, to, n) \ + do \ + { \ + if ((unsigned int)((to) + (n)) > (buf)->alloc) \ + BBUF_EXPAND((buf), (to) + (n)); \ + xmemmove((buf)->p + (to), (buf)->p + (from), (n)); \ + if ((unsigned int)((to) + (n)) > (buf)->used) \ + (buf)->used = (to) + (n); \ + } while (0) + +/* from > to */ +#define BBUF_MOVE_LEFT(buf, from, to, n) \ + do \ + { \ + xmemmove((buf)->p + (to), (buf)->p + (from), (n)); \ + } while (0) + +/* from > to */ +#define BBUF_MOVE_LEFT_REDUCE(buf, from, to) \ + do \ + { \ + xmemmove((buf)->p + (to), (buf)->p + (from), (buf)->used - (from)); \ + (buf)->used -= (from - to); \ + } while (0) + +#define BBUF_INSERT(buf, pos, bytes, n) \ + do \ + { \ + if (pos >= (buf)->used) \ + { \ + BBUF_WRITE(buf, pos, bytes, n); \ + } \ + else \ + { \ + BBUF_MOVE_RIGHT((buf), (pos), (pos) + (n), ((buf)->used - (pos))); \ + xmemcpy((buf)->p + (pos), (bytes), (n)); \ + } \ + } while (0) + +#define BBUF_GET_BYTE(buf, pos) (buf)->p[(pos)] + +#define ANCHOR_BEGIN_BUF (1 << 0) +#define ANCHOR_BEGIN_LINE (1 << 1) +#define ANCHOR_BEGIN_POSITION (1 << 2) +#define ANCHOR_END_BUF (1 << 3) +#define ANCHOR_SEMI_END_BUF (1 << 4) +#define ANCHOR_END_LINE (1 << 5) + +#define ANCHOR_WORD_BOUND (1 << 6) +#define ANCHOR_NOT_WORD_BOUND (1 << 7) +#define ANCHOR_WORD_BEGIN (1 << 8) +#define ANCHOR_WORD_END (1 << 9) +#define ANCHOR_PREC_READ (1 << 10) +#define ANCHOR_PREC_READ_NOT (1 << 11) +#define ANCHOR_LOOK_BEHIND (1 << 12) +#define ANCHOR_LOOK_BEHIND_NOT (1 << 13) + +#define ANCHOR_ANYCHAR_STAR (1 << 14) /* ".*" optimize info */ +#define ANCHOR_ANYCHAR_STAR_ML (1 << 15) /* ".*" optimize info (multi-line) */ + +#define ANCHOR_KEEP (1 << 16) + +/* operation code */ +enum OpCode +{ + OP_FINISH = 0, /* matching process terminator (no more alternative) */ + OP_END = 1, /* pattern code terminator (success end) */ + + OP_EXACT1 = 2, /* single byte, N = 1 */ + OP_EXACT2, /* single byte, N = 2 */ + OP_EXACT3, /* single byte, N = 3 */ + OP_EXACT4, /* single byte, N = 4 */ + OP_EXACT5, /* single byte, N = 5 */ + OP_EXACTN, /* single byte */ + OP_EXACTMB2N1, /* mb-length = 2 N = 1 */ + OP_EXACTMB2N2, /* mb-length = 2 N = 2 */ + OP_EXACTMB2N3, /* mb-length = 2 N = 3 */ + OP_EXACTMB2N, /* mb-length = 2 */ + OP_EXACTMB3N, /* mb-length = 3 */ + OP_EXACTMBN, /* other length */ + + OP_EXACT1_IC, /* single byte, N = 1, ignore case */ + OP_EXACTN_IC, /* single byte, ignore case */ + + OP_CCLASS, + OP_CCLASS_MB, + OP_CCLASS_MIX, + OP_CCLASS_NOT, + OP_CCLASS_MB_NOT, + OP_CCLASS_MIX_NOT, + + OP_ANYCHAR, /* "." */ + OP_ANYCHAR_ML, /* "." multi-line */ + OP_ANYCHAR_STAR, /* ".*" */ + OP_ANYCHAR_ML_STAR, /* ".*" multi-line */ + OP_ANYCHAR_STAR_PEEK_NEXT, + OP_ANYCHAR_ML_STAR_PEEK_NEXT, + + OP_WORD, + OP_NOT_WORD, + OP_WORD_BOUND, + OP_NOT_WORD_BOUND, + OP_WORD_BEGIN, + OP_WORD_END, + + OP_ASCII_WORD, + OP_NOT_ASCII_WORD, + OP_ASCII_WORD_BOUND, + OP_NOT_ASCII_WORD_BOUND, + OP_ASCII_WORD_BEGIN, + OP_ASCII_WORD_END, + + OP_BEGIN_BUF, + OP_END_BUF, + OP_BEGIN_LINE, + OP_END_LINE, + OP_SEMI_END_BUF, + OP_BEGIN_POSITION, + + OP_BACKREF1, + OP_BACKREF2, + OP_BACKREFN, + OP_BACKREFN_IC, + OP_BACKREF_MULTI, + OP_BACKREF_MULTI_IC, + OP_BACKREF_WITH_LEVEL, /* \k<xxx+n>, \k<xxx-n> */ + + OP_MEMORY_START, + OP_MEMORY_START_PUSH, /* push back-tracker to stack */ + OP_MEMORY_END_PUSH, /* push back-tracker to stack */ + OP_MEMORY_END_PUSH_REC, /* push back-tracker to stack */ + OP_MEMORY_END, + OP_MEMORY_END_REC, /* push marker to stack */ + + OP_KEEP, + + OP_FAIL, /* pop stack and move */ + OP_JUMP, + OP_PUSH, + OP_POP, + OP_PUSH_OR_JUMP_EXACT1, /* if match exact then push, else jump. */ + OP_PUSH_IF_PEEK_NEXT, /* if match exact then push, else none. */ + OP_REPEAT, /* {n,m} */ + OP_REPEAT_NG, /* {n,m}? (non greedy) */ + OP_REPEAT_INC, + OP_REPEAT_INC_NG, /* non greedy */ + OP_REPEAT_INC_SG, /* search and get in stack */ + OP_REPEAT_INC_NG_SG, /* search and get in stack (non greedy) */ + OP_NULL_CHECK_START, /* null loop checker start */ + OP_NULL_CHECK_END, /* null loop checker end */ + OP_NULL_CHECK_END_MEMST, /* null loop checker end (with capture status) */ + OP_NULL_CHECK_END_MEMST_PUSH, /* with capture status and push check-end */ + + OP_PUSH_POS, /* (?=...) start */ + OP_POP_POS, /* (?=...) end */ + OP_PUSH_POS_NOT, /* (?!...) start */ + OP_FAIL_POS, /* (?!...) end */ + OP_PUSH_STOP_BT, /* (?>...) start */ + OP_POP_STOP_BT, /* (?>...) end */ + OP_LOOK_BEHIND, /* (?<=...) start (no needs end opcode) */ + OP_PUSH_LOOK_BEHIND_NOT, /* (?<!...) start */ + OP_FAIL_LOOK_BEHIND_NOT, /* (?<!...) end */ + OP_PUSH_ABSENT_POS, /* (?~...) start */ + OP_ABSENT, /* (?~...) start of inner loop */ + OP_ABSENT_END, /* (?~...) end */ + + OP_CALL, /* \g<name> */ + OP_RETURN, + + OP_CONDITION, + + OP_STATE_CHECK_PUSH, /* combination explosion check and push */ + OP_STATE_CHECK_PUSH_OR_JUMP, /* check ok -> push, else jump */ + OP_STATE_CHECK, /* check only */ + OP_STATE_CHECK_ANYCHAR_STAR, + OP_STATE_CHECK_ANYCHAR_ML_STAR, + + /* no need: IS_DYNAMIC_OPTION() == 0 */ + OP_SET_OPTION_PUSH, /* set option and push recover option */ + OP_SET_OPTION /* set option */ +}; + +typedef int RelAddrType; +typedef int AbsAddrType; +typedef int LengthType; +typedef int RepeatNumType; +typedef short int MemNumType; +typedef short int StateCheckNumType; +typedef void *PointerType; + +#define SIZE_OPCODE 1 +#define SIZE_RELADDR (int)sizeof(RelAddrType) +#define SIZE_ABSADDR (int)sizeof(AbsAddrType) +#define SIZE_LENGTH (int)sizeof(LengthType) +#define SIZE_MEMNUM (int)sizeof(MemNumType) +#define SIZE_STATE_CHECK_NUM (int)sizeof(StateCheckNumType) +#define SIZE_REPEATNUM (int)sizeof(RepeatNumType) +#define SIZE_OPTION (int)sizeof(OnigOptionType) +#define SIZE_CODE_POINT (int)sizeof(OnigCodePoint) +#define SIZE_POINTER (int)sizeof(PointerType) + +#define GET_RELADDR_INC(addr, p) PLATFORM_GET_INC(addr, p, RelAddrType) +#define GET_ABSADDR_INC(addr, p) PLATFORM_GET_INC(addr, p, AbsAddrType) +#define GET_LENGTH_INC(len, p) PLATFORM_GET_INC(len, p, LengthType) +#define GET_MEMNUM_INC(num, p) PLATFORM_GET_INC(num, p, MemNumType) +#define GET_REPEATNUM_INC(num, p) PLATFORM_GET_INC(num, p, RepeatNumType) +#define GET_OPTION_INC(option, p) PLATFORM_GET_INC(option, p, OnigOptionType) +#define GET_POINTER_INC(ptr, p) PLATFORM_GET_INC(ptr, p, PointerType) +#define GET_STATE_CHECK_NUM_INC(num, p) \ + PLATFORM_GET_INC(num, p, StateCheckNumType) + +/* code point's address must be aligned address. */ +#define GET_CODE_POINT(code, p) code = *((OnigCodePoint *)(p)) +#define GET_BYTE_INC(byte, p) \ + do \ + { \ + byte = *(p); \ + (p)++; \ + } while (0) + +/* op-code + arg size */ +#define SIZE_OP_ANYCHAR_STAR SIZE_OPCODE +#define SIZE_OP_ANYCHAR_STAR_PEEK_NEXT (SIZE_OPCODE + 1) +#define SIZE_OP_JUMP (SIZE_OPCODE + SIZE_RELADDR) +#define SIZE_OP_PUSH (SIZE_OPCODE + SIZE_RELADDR) +#define SIZE_OP_POP SIZE_OPCODE +#define SIZE_OP_PUSH_OR_JUMP_EXACT1 (SIZE_OPCODE + SIZE_RELADDR + 1) +#define SIZE_OP_PUSH_IF_PEEK_NEXT (SIZE_OPCODE + SIZE_RELADDR + 1) +#define SIZE_OP_REPEAT_INC (SIZE_OPCODE + SIZE_MEMNUM) +#define SIZE_OP_REPEAT_INC_NG (SIZE_OPCODE + SIZE_MEMNUM) +#define SIZE_OP_PUSH_POS SIZE_OPCODE +#define SIZE_OP_PUSH_POS_NOT (SIZE_OPCODE + SIZE_RELADDR) +#define SIZE_OP_POP_POS SIZE_OPCODE +#define SIZE_OP_FAIL_POS SIZE_OPCODE +#define SIZE_OP_SET_OPTION (SIZE_OPCODE + SIZE_OPTION) +#define SIZE_OP_SET_OPTION_PUSH (SIZE_OPCODE + SIZE_OPTION) +#define SIZE_OP_FAIL SIZE_OPCODE +#define SIZE_OP_MEMORY_START (SIZE_OPCODE + SIZE_MEMNUM) +#define SIZE_OP_MEMORY_START_PUSH (SIZE_OPCODE + SIZE_MEMNUM) +#define SIZE_OP_MEMORY_END_PUSH (SIZE_OPCODE + SIZE_MEMNUM) +#define SIZE_OP_MEMORY_END_PUSH_REC (SIZE_OPCODE + SIZE_MEMNUM) +#define SIZE_OP_MEMORY_END (SIZE_OPCODE + SIZE_MEMNUM) +#define SIZE_OP_MEMORY_END_REC (SIZE_OPCODE + SIZE_MEMNUM) +#define SIZE_OP_PUSH_STOP_BT SIZE_OPCODE +#define SIZE_OP_POP_STOP_BT SIZE_OPCODE +#define SIZE_OP_NULL_CHECK_START (SIZE_OPCODE + SIZE_MEMNUM) +#define SIZE_OP_NULL_CHECK_END (SIZE_OPCODE + SIZE_MEMNUM) +#define SIZE_OP_LOOK_BEHIND (SIZE_OPCODE + SIZE_LENGTH) +#define SIZE_OP_PUSH_LOOK_BEHIND_NOT (SIZE_OPCODE + SIZE_RELADDR + SIZE_LENGTH) +#define SIZE_OP_FAIL_LOOK_BEHIND_NOT SIZE_OPCODE +#define SIZE_OP_CALL (SIZE_OPCODE + SIZE_ABSADDR) +#define SIZE_OP_RETURN SIZE_OPCODE +#define SIZE_OP_CONDITION (SIZE_OPCODE + SIZE_MEMNUM + SIZE_RELADDR) +#define SIZE_OP_PUSH_ABSENT_POS SIZE_OPCODE +#define SIZE_OP_ABSENT (SIZE_OPCODE + SIZE_RELADDR) +#define SIZE_OP_ABSENT_END SIZE_OPCODE + +#ifdef USE_COMBINATION_EXPLOSION_CHECK +# define SIZE_OP_STATE_CHECK (SIZE_OPCODE + SIZE_STATE_CHECK_NUM) +# define SIZE_OP_STATE_CHECK_PUSH \ + (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR) +# define SIZE_OP_STATE_CHECK_PUSH_OR_JUMP \ + (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR) +# define SIZE_OP_STATE_CHECK_ANYCHAR_STAR (SIZE_OPCODE + SIZE_STATE_CHECK_NUM) +#endif + +#define MC_ESC(syn) (syn)->meta_char_table.esc +#define MC_ANYCHAR(syn) (syn)->meta_char_table.anychar +#define MC_ANYTIME(syn) (syn)->meta_char_table.anytime +#define MC_ZERO_OR_ONE_TIME(syn) (syn)->meta_char_table.zero_or_one_time +#define MC_ONE_OR_MORE_TIME(syn) (syn)->meta_char_table.one_or_more_time +#define MC_ANYCHAR_ANYTIME(syn) (syn)->meta_char_table.anychar_anytime + +#define IS_MC_ESC_CODE(code, syn) \ + ((code) == MC_ESC(syn) \ + && !IS_SYNTAX_OP2((syn), ONIG_SYN_OP2_INEFFECTIVE_ESCAPE)) + +#define SYN_POSIX_COMMON_OP \ + (ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_POSIX_BRACKET \ + | ONIG_SYN_OP_DECIMAL_BACKREF | ONIG_SYN_OP_BRACKET_CC \ + | ONIG_SYN_OP_ASTERISK_ZERO_INF | ONIG_SYN_OP_LINE_ANCHOR \ + | ONIG_SYN_OP_ESC_CONTROL_CHARS) + +#define SYN_GNU_REGEX_OP \ + (ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_BRACKET_CC \ + | ONIG_SYN_OP_POSIX_BRACKET | ONIG_SYN_OP_DECIMAL_BACKREF \ + | ONIG_SYN_OP_BRACE_INTERVAL | ONIG_SYN_OP_LPAREN_SUBEXP \ + | ONIG_SYN_OP_VBAR_ALT | ONIG_SYN_OP_ASTERISK_ZERO_INF \ + | ONIG_SYN_OP_PLUS_ONE_INF | ONIG_SYN_OP_QMARK_ZERO_ONE \ + | ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR | ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR \ + | ONIG_SYN_OP_ESC_W_WORD | ONIG_SYN_OP_ESC_B_WORD_BOUND \ + | ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END | ONIG_SYN_OP_ESC_S_WHITE_SPACE \ + | ONIG_SYN_OP_ESC_D_DIGIT | ONIG_SYN_OP_LINE_ANCHOR) + +#define SYN_GNU_REGEX_BV \ + (ONIG_SYN_CONTEXT_INDEP_ANCHORS | ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS \ + | ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS | ONIG_SYN_ALLOW_INVALID_INTERVAL \ + | ONIG_SYN_BACKSLASH_ESCAPE_IN_CC | ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC) + +#define NCCLASS_FLAGS(cc) ((cc)->flags) +#define NCCLASS_FLAG_SET(cc, flag) (NCCLASS_FLAGS(cc) |= (flag)) +#define NCCLASS_FLAG_CLEAR(cc, flag) (NCCLASS_FLAGS(cc) &= ~(flag)) +#define IS_NCCLASS_FLAG_ON(cc, flag) ((NCCLASS_FLAGS(cc) & (flag)) != 0) + +/* cclass node */ +#define FLAG_NCCLASS_NOT (1 << 0) + +#define NCCLASS_SET_NOT(nd) NCCLASS_FLAG_SET(nd, FLAG_NCCLASS_NOT) +#define NCCLASS_CLEAR_NOT(nd) NCCLASS_FLAG_CLEAR(nd, FLAG_NCCLASS_NOT) +#define IS_NCCLASS_NOT(nd) IS_NCCLASS_FLAG_ON(nd, FLAG_NCCLASS_NOT) + +typedef struct +{ + int type; + /* struct _Node* next; */ + /* unsigned int flags; */ +} NodeBase; + +typedef struct +{ + NodeBase base; + unsigned int flags; + BitSet bs; + BBuf *mbuf; /* multi-byte info or NULL */ +} CClassNode; + +typedef intptr_t OnigStackIndex; + +typedef struct _OnigStackType +{ + unsigned int type; + union + { + struct + { + UChar *pcode; /* byte code position */ + UChar *pstr; /* string position */ + UChar *pstr_prev; /* previous char position of pstr */ +#ifdef USE_COMBINATION_EXPLOSION_CHECK + unsigned int state_check; +#endif + UChar *pkeep; /* keep pattern position */ + } state; + struct + { + int count; /* for OP_REPEAT_INC, OP_REPEAT_INC_NG */ + UChar *pcode; /* byte code position (head of repeated target) */ + int num; /* repeat id */ + } repeat; + struct + { + OnigStackIndex si; /* index of stack */ + } repeat_inc; + struct + { + int num; /* memory num */ + UChar *pstr; /* start/end position */ + /* Following information is set, if this stack type is MEM-START */ + OnigStackIndex start; /* prev. info (for backtrack "(...)*" ) */ + OnigStackIndex end; /* prev. info (for backtrack "(...)*" ) */ + } mem; + struct + { + int num; /* null check id */ + UChar *pstr; /* start position */ + } null_check; +#ifdef USE_SUBEXP_CALL + struct + { + UChar *ret_addr; /* byte code position */ + int num; /* null check id */ + UChar *pstr; /* string position */ + } call_frame; +#endif + struct + { + UChar *abs_pstr; /* absent start position */ + const UChar *end_pstr; /* end position */ + } absent_pos; + } u; +} OnigStackType; + +typedef struct +{ + void *stack_p; + size_t stack_n; + OnigOptionType options; + OnigRegion *region; + const UChar *start; /* search start position */ + const UChar *gpos; /* global position (for \G: BEGIN_POSITION) */ +#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE + OnigPosition best_len; /* for ONIG_OPTION_FIND_LONGEST */ + UChar *best_s; +#endif +#ifdef USE_COMBINATION_EXPLOSION_CHECK + void *state_check_buff; + int state_check_buff_size; +#endif +} OnigMatchArg; + +#define IS_CODE_SB_WORD(enc, code) \ + (ONIGENC_IS_CODE_ASCII(code) && ONIGENC_IS_CODE_WORD(enc, code)) + +typedef struct OnigEndCallListItem +{ + struct OnigEndCallListItem *next; + void (*func)(void); +} OnigEndCallListItemType; + +extern void onig_add_end_call(void (*func)(void)); + +#ifdef ONIG_DEBUG + +typedef struct +{ + short int opcode; + const char *name; + short int arg_type; +} OnigOpInfoType; + +extern OnigOpInfoType OnigOpInfo[]; + +extern void onig_print_compiled_byte_code(FILE *f, UChar *bp, UChar *bpend, + UChar **nextp, OnigEncoding enc); + +# ifdef ONIG_DEBUG_STATISTICS +extern void onig_statistics_init(void); +extern void onig_print_statistics(FILE *f); +# endif +#endif + +extern UChar *onig_error_code_to_format(OnigPosition code); +extern void onig_vsnprintf_with_pattern(UChar buf[], int bufsize, + OnigEncoding enc, UChar *pat, + UChar *pat_end, const UChar *fmt, + va_list args); +extern void onig_snprintf_with_pattern(UChar buf[], int bufsize, + OnigEncoding enc, UChar *pat, + UChar *pat_end, const UChar *fmt, ...); +extern int onig_bbuf_init(BBuf *buf, OnigDistance size); +extern int onig_compile(regex_t *reg, const UChar *pattern, + const UChar *pattern_end, OnigErrorInfo *einfo); +#ifdef RUBY +extern int onig_compile_ruby(regex_t *reg, const UChar *pattern, + const UChar *pattern_end, OnigErrorInfo *einfo, + const char *sourcefile, int sourceline); +#endif +extern void onig_transfer(regex_t *to, regex_t *from); +extern int onig_is_code_in_cc(OnigEncoding enc, OnigCodePoint code, + CClassNode *cc); +extern int onig_is_code_in_cc_len(int enclen, OnigCodePoint code, + CClassNode *cc); + +/* strend hash */ +typedef void hash_table_type; +#ifdef RUBY +# include "ruby/st.h" +#else +# include "st.h" +#endif +typedef st_data_t hash_data_type; + +extern hash_table_type *onig_st_init_strend_table_with_size(st_index_t size); +extern int onig_st_lookup_strend(hash_table_type *table, const UChar *str_key, + const UChar *end_key, hash_data_type *value); +extern int onig_st_insert_strend(hash_table_type *table, const UChar *str_key, + const UChar *end_key, hash_data_type value); + +#ifdef RUBY +extern size_t onig_memsize(const regex_t *reg); +extern size_t onig_region_memsize(const struct re_registers *regs); +#endif + +RUBY_SYMBOL_EXPORT_END + +#endif /* ONIGMO_REGINT_H */ diff --git a/lib/edbee-lib/vendor/onig/regparse.c b/lib/edbee-lib/vendor/onig/regparse.c new file mode 100644 index 00000000..fcd2c1c8 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/regparse.c @@ -0,0 +1,8064 @@ +/********************************************************************** + regparse.c - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regparse.h" +#include <stdarg.h> + +#define WARN_BUFSIZE 256 + +#define CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS + +const OnigSyntaxType OnigSyntaxRuby = { + ((SYN_GNU_REGEX_OP | ONIG_SYN_OP_QMARK_NON_GREEDY | ONIG_SYN_OP_ESC_OCTAL3 + | ONIG_SYN_OP_ESC_X_HEX2 | ONIG_SYN_OP_ESC_X_BRACE_HEX8 + | ONIG_SYN_OP_ESC_CONTROL_CHARS | ONIG_SYN_OP_ESC_C_CONTROL) + & ~ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END), + (ONIG_SYN_OP2_QMARK_GROUP_EFFECT | ONIG_SYN_OP2_OPTION_RUBY + | ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP | ONIG_SYN_OP2_ESC_K_NAMED_BACKREF + | ONIG_SYN_OP2_ESC_G_SUBEXP_CALL | ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY + | ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT + | ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT | ONIG_SYN_OP2_CCLASS_SET_OP + | ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL + | ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META | ONIG_SYN_OP2_ESC_V_VTAB + | ONIG_SYN_OP2_ESC_H_XDIGIT | +#ifndef RUBY + ONIG_SYN_OP2_ESC_U_HEX4 | +#endif + ONIG_SYN_OP2_ESC_CAPITAL_X_EXTENDED_GRAPHEME_CLUSTER + | ONIG_SYN_OP2_QMARK_LPAREN_CONDITION + | ONIG_SYN_OP2_ESC_CAPITAL_R_LINEBREAK | ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP + | ONIG_SYN_OP2_QMARK_TILDE_ABSENT), + (SYN_GNU_REGEX_BV | ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV + | ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND + | ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP + | ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME + | ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY | ONIG_SYN_WARN_CC_OP_NOT_ESCAPED + | ONIG_SYN_WARN_CC_DUP | ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT), + (ONIG_OPTION_ASCII_RANGE | ONIG_OPTION_POSIX_BRACKET_ALL_RANGE + | ONIG_OPTION_WORD_BOUND_ALL_RANGE), + { + (OnigCodePoint)'\\' /* esc */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ + }}; + +const OnigSyntaxType *OnigDefaultSyntax = ONIG_SYNTAX_RUBY; + +extern void onig_null_warn(const char *s ARG_UNUSED) {} + +#ifdef DEFAULT_WARN_FUNCTION +static OnigWarnFunc onig_warn = (OnigWarnFunc)DEFAULT_WARN_FUNCTION; +#else +static OnigWarnFunc onig_warn = onig_null_warn; +#endif + +#ifdef DEFAULT_VERB_WARN_FUNCTION +static OnigWarnFunc onig_verb_warn = (OnigWarnFunc)DEFAULT_VERB_WARN_FUNCTION; +#else +static OnigWarnFunc onig_verb_warn = onig_null_warn; +#endif + +extern void onig_set_warn_func(OnigWarnFunc f) +{ + onig_warn = f; +} + +extern void onig_set_verb_warn_func(OnigWarnFunc f) +{ + onig_verb_warn = f; +} + +static void CC_DUP_WARN(ScanEnv *env); + +static unsigned int ParseDepthLimit = DEFAULT_PARSE_DEPTH_LIMIT; + +extern unsigned int onig_get_parse_depth_limit(void) +{ + return ParseDepthLimit; +} + +extern int onig_set_parse_depth_limit(unsigned int depth) +{ + if (depth == 0) + ParseDepthLimit = DEFAULT_PARSE_DEPTH_LIMIT; + else + ParseDepthLimit = depth; + return 0; +} + +static void bbuf_free(BBuf *bbuf) +{ + if (IS_NOT_NULL(bbuf)) + { + if (IS_NOT_NULL(bbuf->p)) + xfree(bbuf->p); + xfree(bbuf); + } +} + +static int bbuf_clone(BBuf **rto, BBuf *from) +{ + int r; + BBuf *to; + + *rto = to = (BBuf *)xmalloc(sizeof(BBuf)); + CHECK_NULL_RETURN_MEMERR(to); + r = BBUF_INIT(to, from->alloc); + if (r != 0) + return r; + to->used = from->used; + xmemcpy(to->p, from->p, from->used); + return 0; +} + +#define BACKREF_REL_TO_ABS(rel_no, env) ((env)->num_mem + 1 + (rel_no)) + +#define ONOFF(v, f, negative) (negative) ? ((v) &= ~(f)) : ((v) |= (f)) + +#define MBCODE_START_POS(enc) \ + (OnigCodePoint)(ONIGENC_MBC_MINLEN(enc) > 1 ? 0 : 0x80) + +#define SET_ALL_MULTI_BYTE_RANGE(enc, pbuf) \ + add_code_range_to_buf(pbuf, env, MBCODE_START_POS(enc), ONIG_LAST_CODE_POINT) + +#define ADD_ALL_MULTI_BYTE_RANGE(enc, mbuf) \ + do \ + { \ + if (!ONIGENC_IS_SINGLEBYTE(enc)) \ + { \ + r = SET_ALL_MULTI_BYTE_RANGE(enc, &(mbuf)); \ + if (r) \ + return r; \ + } \ + } while (0) + +#define BITSET_SET_BIT_CHKDUP(bs, pos) \ + do \ + { \ + if (BITSET_AT(bs, pos)) \ + CC_DUP_WARN(env); \ + BS_ROOM(bs, pos) |= BS_BIT(pos); \ + } while (0) + +#define BITSET_IS_EMPTY(bs, empty) \ + do \ + { \ + int i; \ + empty = 1; \ + for (i = 0; i < BITSET_SIZE; i++) \ + { \ + if ((bs)[i] != 0) \ + { \ + empty = 0; \ + break; \ + } \ + } \ + } while (0) + +static void bitset_set_range(ScanEnv *env, BitSetRef bs, int from, int to) +{ + int i; + for (i = from; i <= to && i < SINGLE_BYTE_SIZE; i++) + { + BITSET_SET_BIT_CHKDUP(bs, i); + } +} + +#if 0 +static void +bitset_set_all(BitSetRef bs) +{ + int i; + for (i = 0; i < BITSET_SIZE; i++) { bs[i] = ~((Bits )0); } +} +#endif + +static void bitset_invert(BitSetRef bs) +{ + int i; + for (i = 0; i < BITSET_SIZE; i++) + { + bs[i] = ~(bs[i]); + } +} + +static void bitset_invert_to(BitSetRef from, BitSetRef to) +{ + int i; + for (i = 0; i < BITSET_SIZE; i++) + { + to[i] = ~(from[i]); + } +} + +static void bitset_and(BitSetRef dest, BitSetRef bs) +{ + int i; + for (i = 0; i < BITSET_SIZE; i++) + { + dest[i] &= bs[i]; + } +} + +static void bitset_or(BitSetRef dest, BitSetRef bs) +{ + int i; + for (i = 0; i < BITSET_SIZE; i++) + { + dest[i] |= bs[i]; + } +} + +static void bitset_copy(BitSetRef dest, BitSetRef bs) +{ + int i; + for (i = 0; i < BITSET_SIZE; i++) + { + dest[i] = bs[i]; + } +} + +#if defined(USE_NAMED_GROUP) && !defined(USE_ST_LIBRARY) +extern int onig_strncmp(const UChar *s1, const UChar *s2, int n) +{ + int x; + + while (n-- > 0) + { + x = *s2++ - *s1++; + if (x) + return x; + } + return 0; +} +#endif + +extern void onig_strcpy(UChar *dest, const UChar *src, const UChar *end) +{ + ptrdiff_t len = end - src; + if (len > 0) + { + xmemcpy(dest, src, len); + dest[len] = (UChar)0; + } +} + +#ifdef USE_NAMED_GROUP +static UChar *strdup_with_null(OnigEncoding enc, UChar *s, UChar *end) +{ + ptrdiff_t slen; + int term_len, i; + UChar *r; + + slen = end - s; + term_len = ONIGENC_MBC_MINLEN(enc); + + r = (UChar *)xmalloc(slen + term_len); + CHECK_NULL_RETURN(r); + xmemcpy(r, s, slen); + + for (i = 0; i < term_len; i++) + r[slen + i] = (UChar)0; + + return r; +} +#endif + +/* scan pattern methods */ +#define PEND_VALUE 0 + +#ifdef __GNUC__ +/* get rid of Wunused-but-set-variable and Wuninitialized */ +# define PFETCH_READY \ + UChar *pfetch_prev = NULL; \ + (void)pfetch_prev +#else +# define PFETCH_READY UChar *pfetch_prev +#endif +#define PEND (p < end ? 0 : 1) +#define PUNFETCH p = pfetch_prev +#define PINC \ + do \ + { \ + pfetch_prev = p; \ + p += enclen(enc, p, end); \ + } while (0) +#define PFETCH(c) \ + do \ + { \ + c = ((enc->max_enc_len == 1) ? *p : ONIGENC_MBC_TO_CODE(enc, p, end)); \ + pfetch_prev = p; \ + p += enclen(enc, p, end); \ + } while (0) + +#define PINC_S \ + do \ + { \ + p += enclen(enc, p, end); \ + } while (0) +#define PFETCH_S(c) \ + do \ + { \ + c = ((enc->max_enc_len == 1) ? *p : ONIGENC_MBC_TO_CODE(enc, p, end)); \ + p += enclen(enc, p, end); \ + } while (0) + +#define PPEEK (p < end ? ONIGENC_MBC_TO_CODE(enc, p, end) : PEND_VALUE) +#define PPEEK_IS(c) (PPEEK == (OnigCodePoint)c) + +static UChar *strcat_capa(UChar *dest, UChar *dest_end, const UChar *src, + const UChar *src_end, size_t capa) +{ + UChar *r; + + if (dest) + r = (UChar *)xrealloc(dest, capa + 1); + else + r = (UChar *)xmalloc(capa + 1); + + CHECK_NULL_RETURN(r); + onig_strcpy(r + (dest_end - dest), src, src_end); + return r; +} + +/* dest on static area */ +static UChar *strcat_capa_from_static(UChar *dest, UChar *dest_end, + const UChar *src, const UChar *src_end, + size_t capa) +{ + UChar *r; + + r = (UChar *)xmalloc(capa + 1); + CHECK_NULL_RETURN(r); + onig_strcpy(r, dest, dest_end); + onig_strcpy(r + (dest_end - dest), src, src_end); + return r; +} + +#ifdef USE_ST_LIBRARY + +# ifdef RUBY +# include "ruby/st.h" +# else +# include "st.h" +# endif + +typedef struct +{ + const UChar *s; + const UChar *end; +} st_str_end_key; + +static int str_end_cmp(st_data_t xp, st_data_t yp) +{ + const st_str_end_key *x, *y; + const UChar *p, *q; + int c; + + x = (const st_str_end_key *)xp; + y = (const st_str_end_key *)yp; + if ((x->end - x->s) != (y->end - y->s)) + return 1; + + p = x->s; + q = y->s; + while (p < x->end) + { + c = (int)*p - (int)*q; + if (c != 0) + return c; + + p++; + q++; + } + + return 0; +} + +static st_index_t str_end_hash(st_data_t xp) +{ + const st_str_end_key *x = (const st_str_end_key *)xp; + const UChar *p; + st_index_t val = 0; + + p = x->s; + while (p < x->end) + { + val = val * 997 + (int)*p++; + } + + return val + (val >> 5); +} + +extern hash_table_type *onig_st_init_strend_table_with_size(st_index_t size) +{ + static const struct st_hash_type hashType = { + str_end_cmp, + str_end_hash, + }; + + return (hash_table_type *)onig_st_init_table_with_size(&hashType, size); +} + +extern int onig_st_lookup_strend(hash_table_type *table, const UChar *str_key, + const UChar *end_key, hash_data_type *value) +{ + st_str_end_key key; + + key.s = (UChar *)str_key; + key.end = (UChar *)end_key; + + return onig_st_lookup(table, (st_data_t)(&key), value); +} + +extern int onig_st_insert_strend(hash_table_type *table, const UChar *str_key, + const UChar *end_key, hash_data_type value) +{ + st_str_end_key *key; + int result; + + key = (st_str_end_key *)xmalloc(sizeof(st_str_end_key)); + key->s = (UChar *)str_key; + key->end = (UChar *)end_key; + result = onig_st_insert(table, (st_data_t)key, value); + if (result) + { + xfree(key); + } + return result; +} + +#endif /* USE_ST_LIBRARY */ + +#ifdef USE_NAMED_GROUP + +# define INIT_NAME_BACKREFS_ALLOC_NUM 8 + +typedef struct +{ + UChar *name; + size_t name_len; /* byte length */ + int back_num; /* number of backrefs */ + int back_alloc; + int back_ref1; + int *back_refs; +} NameEntry; + +# ifdef USE_ST_LIBRARY + +typedef st_table NameTable; +typedef st_data_t HashDataType; /* 1.6 st.h doesn't define st_data_t type */ + +# ifdef ONIG_DEBUG +static int i_print_name_entry(UChar *key, NameEntry *e, void *arg) +{ + int i; + FILE *fp = (FILE *)arg; + + fprintf(fp, "%s: ", e->name); + if (e->back_num == 0) + fputs("-", fp); + else if (e->back_num == 1) + fprintf(fp, "%d", e->back_ref1); + else + { + for (i = 0; i < e->back_num; i++) + { + if (i > 0) + fprintf(fp, ", "); + fprintf(fp, "%d", e->back_refs[i]); + } + } + fputs("\n", fp); + return ST_CONTINUE; +} + +extern int onig_print_names(FILE *fp, regex_t *reg) +{ + NameTable *t = (NameTable *)reg->name_table; + + if (IS_NOT_NULL(t)) + { + fprintf(fp, "name table\n"); + onig_st_foreach(t, i_print_name_entry, (HashDataType)fp); + fputs("\n", fp); + } + return 0; +} +# endif /* ONIG_DEBUG */ + +static int i_free_name_entry(UChar *key, NameEntry *e, void *arg ARG_UNUSED) +{ + xfree(e->name); + if (IS_NOT_NULL(e->back_refs)) + xfree(e->back_refs); + xfree(key); + xfree(e); + return ST_DELETE; +} + +static int names_clear(regex_t *reg) +{ + NameTable *t = (NameTable *)reg->name_table; + + if (IS_NOT_NULL(t)) + { + onig_st_foreach(t, i_free_name_entry, 0); + } + return 0; +} + +extern int onig_names_free(regex_t *reg) +{ + int r; + NameTable *t; + + r = names_clear(reg); + if (r) + return r; + + t = (NameTable *)reg->name_table; + if (IS_NOT_NULL(t)) + onig_st_free_table(t); + reg->name_table = (void *)NULL; + return 0; +} + +static NameEntry *name_find(regex_t *reg, const UChar *name, + const UChar *name_end) +{ + NameEntry *e; + NameTable *t = (NameTable *)reg->name_table; + + e = (NameEntry *)NULL; + if (IS_NOT_NULL(t)) + { + onig_st_lookup_strend(t, name, name_end, (HashDataType *)((void *)(&e))); + } + return e; +} + +typedef struct +{ + int (*func)(const UChar *, const UChar *, int, int *, regex_t *, void *); + regex_t *reg; + void *arg; + int ret; + OnigEncoding enc; +} INamesArg; + +static int i_names(UChar *key ARG_UNUSED, NameEntry *e, INamesArg *arg) +{ + int r = (*(arg->func))(e->name, e->name + e->name_len, e->back_num, + (e->back_num > 1 ? e->back_refs : &(e->back_ref1)), + arg->reg, arg->arg); + if (r != 0) + { + arg->ret = r; + return ST_STOP; + } + return ST_CONTINUE; +} + +extern int onig_foreach_name(regex_t *reg, + int (*func)(const UChar *, const UChar *, int, + int *, regex_t *, void *), + void *arg) +{ + INamesArg narg; + NameTable *t = (NameTable *)reg->name_table; + + narg.ret = 0; + if (IS_NOT_NULL(t)) + { + narg.func = func; + narg.reg = reg; + narg.arg = arg; + narg.enc = reg->enc; /* should be pattern encoding. */ + onig_st_foreach(t, i_names, (HashDataType)&narg); + } + return narg.ret; +} + +static int i_renumber_name(UChar *key ARG_UNUSED, NameEntry *e, + GroupNumRemap *map) +{ + int i; + + if (e->back_num > 1) + { + for (i = 0; i < e->back_num; i++) + { + e->back_refs[i] = map[e->back_refs[i]].new_val; + } + } + else if (e->back_num == 1) + { + e->back_ref1 = map[e->back_ref1].new_val; + } + + return ST_CONTINUE; +} + +extern int onig_renumber_name_table(regex_t *reg, GroupNumRemap *map) +{ + NameTable *t = (NameTable *)reg->name_table; + + if (IS_NOT_NULL(t)) + { + onig_st_foreach(t, i_renumber_name, (HashDataType)map); + } + return 0; +} + +extern int onig_number_of_names(const regex_t *reg) +{ + NameTable *t = (NameTable *)reg->name_table; + + if (IS_NOT_NULL(t)) + return (int)t->num_entries; + else + return 0; +} + +# else /* USE_ST_LIBRARY */ + +# define INIT_NAMES_ALLOC_NUM 8 + +typedef struct +{ + NameEntry *e; + int num; + int alloc; +} NameTable; + +# ifdef ONIG_DEBUG +extern int onig_print_names(FILE *fp, regex_t *reg) +{ + int i, j; + NameEntry *e; + NameTable *t = (NameTable *)reg->name_table; + + if (IS_NOT_NULL(t) && t->num > 0) + { + fprintf(fp, "name table\n"); + for (i = 0; i < t->num; i++) + { + e = &(t->e[i]); + fprintf(fp, "%s: ", e->name); + if (e->back_num == 0) + { + fputs("-", fp); + } + else if (e->back_num == 1) + { + fprintf(fp, "%d", e->back_ref1); + } + else + { + for (j = 0; j < e->back_num; j++) + { + if (j > 0) + fprintf(fp, ", "); + fprintf(fp, "%d", e->back_refs[j]); + } + } + fputs("\n", fp); + } + fputs("\n", fp); + } + return 0; +} +# endif + +static int names_clear(regex_t *reg) +{ + int i; + NameEntry *e; + NameTable *t = (NameTable *)reg->name_table; + + if (IS_NOT_NULL(t)) + { + for (i = 0; i < t->num; i++) + { + e = &(t->e[i]); + if (IS_NOT_NULL(e->name)) + { + xfree(e->name); + e->name = NULL; + e->name_len = 0; + e->back_num = 0; + e->back_alloc = 0; + if (IS_NOT_NULL(e->back_refs)) + xfree(e->back_refs); + e->back_refs = (int *)NULL; + } + } + if (IS_NOT_NULL(t->e)) + { + xfree(t->e); + t->e = NULL; + } + t->num = 0; + } + return 0; +} + +extern int onig_names_free(regex_t *reg) +{ + int r; + NameTable *t; + + r = names_clear(reg); + if (r) + return r; + + t = (NameTable *)reg->name_table; + if (IS_NOT_NULL(t)) + xfree(t); + reg->name_table = NULL; + return 0; +} + +static NameEntry *name_find(regex_t *reg, const UChar *name, + const UChar *name_end) +{ + int i, len; + NameEntry *e; + NameTable *t = (NameTable *)reg->name_table; + + if (IS_NOT_NULL(t)) + { + len = name_end - name; + for (i = 0; i < t->num; i++) + { + e = &(t->e[i]); + if (len == e->name_len && onig_strncmp(name, e->name, len) == 0) + return e; + } + } + return (NameEntry *)NULL; +} + +extern int onig_foreach_name(regex_t *reg, + int (*func)(const UChar *, const UChar *, int, + int *, regex_t *, void *), + void *arg) +{ + int i, r; + NameEntry *e; + NameTable *t = (NameTable *)reg->name_table; + + if (IS_NOT_NULL(t)) + { + for (i = 0; i < t->num; i++) + { + e = &(t->e[i]); + r = (*func)(e->name, e->name + e->name_len, e->back_num, + (e->back_num > 1 ? e->back_refs : &(e->back_ref1)), reg, arg); + if (r != 0) + return r; + } + } + return 0; +} + +extern int onig_number_of_names(const regex_t *reg) +{ + NameTable *t = (NameTable *)reg->name_table; + + if (IS_NOT_NULL(t)) + return t->num; + else + return 0; +} + +# endif /* else USE_ST_LIBRARY */ + +static int name_add(regex_t *reg, UChar *name, UChar *name_end, int backref, + ScanEnv *env) +{ + int alloc; + NameEntry *e; + NameTable *t = (NameTable *)reg->name_table; + + if (name_end - name <= 0) + return ONIGERR_EMPTY_GROUP_NAME; + + e = name_find(reg, name, name_end); + if (IS_NULL(e)) + { +# ifdef USE_ST_LIBRARY + if (IS_NULL(t)) + { + t = onig_st_init_strend_table_with_size(5); + reg->name_table = (void *)t; + } + e = (NameEntry *)xmalloc(sizeof(NameEntry)); + CHECK_NULL_RETURN_MEMERR(e); + + e->name = strdup_with_null(reg->enc, name, name_end); + if (IS_NULL(e->name)) + { + xfree(e); + return ONIGERR_MEMORY; + } + onig_st_insert_strend(t, e->name, (e->name + (name_end - name)), + (HashDataType)e); + + e->name_len = name_end - name; + e->back_num = 0; + e->back_alloc = 0; + e->back_refs = (int *)NULL; + +# else + + if (IS_NULL(t)) + { + alloc = INIT_NAMES_ALLOC_NUM; + t = (NameTable *)xmalloc(sizeof(NameTable)); + CHECK_NULL_RETURN_MEMERR(t); + t->e = NULL; + t->alloc = 0; + t->num = 0; + + t->e = (NameEntry *)xmalloc(sizeof(NameEntry) * alloc); + if (IS_NULL(t->e)) + { + xfree(t); + return ONIGERR_MEMORY; + } + t->alloc = alloc; + reg->name_table = t; + goto clear; + } + else if (t->num == t->alloc) + { + int i; + NameEntry *p; + + alloc = t->alloc * 2; + p = (NameEntry *)xrealloc(t->e, sizeof(NameEntry) * alloc); + CHECK_NULL_RETURN_MEMERR(p); + t->e = p; + t->alloc = alloc; + + clear: + for (i = t->num; i < t->alloc; i++) + { + t->e[i].name = NULL; + t->e[i].name_len = 0; + t->e[i].back_num = 0; + t->e[i].back_alloc = 0; + t->e[i].back_refs = (int *)NULL; + } + } + e = &(t->e[t->num]); + t->num++; + e->name = strdup_with_null(reg->enc, name, name_end); + if (IS_NULL(e->name)) + return ONIGERR_MEMORY; + e->name_len = name_end - name; +# endif + } + + if (e->back_num >= 1 + && !IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME)) + { + onig_scan_env_set_error_string(env, ONIGERR_MULTIPLEX_DEFINED_NAME, name, + name_end); + return ONIGERR_MULTIPLEX_DEFINED_NAME; + } + + e->back_num++; + if (e->back_num == 1) + { + e->back_ref1 = backref; + } + else + { + if (e->back_num == 2) + { + alloc = INIT_NAME_BACKREFS_ALLOC_NUM; + e->back_refs = (int *)xmalloc(sizeof(int) * alloc); + CHECK_NULL_RETURN_MEMERR(e->back_refs); + e->back_alloc = alloc; + e->back_refs[0] = e->back_ref1; + e->back_refs[1] = backref; + } + else + { + if (e->back_num > e->back_alloc) + { + int *p; + alloc = e->back_alloc * 2; + p = (int *)xrealloc(e->back_refs, sizeof(int) * alloc); + CHECK_NULL_RETURN_MEMERR(p); + e->back_refs = p; + e->back_alloc = alloc; + } + e->back_refs[e->back_num - 1] = backref; + } + } + + return 0; +} + +extern int onig_name_to_group_numbers(regex_t *reg, const UChar *name, + const UChar *name_end, int **nums) +{ + NameEntry *e = name_find(reg, name, name_end); + + if (IS_NULL(e)) + return ONIGERR_UNDEFINED_NAME_REFERENCE; + + switch (e->back_num) + { + case 0: + *nums = 0; + break; + case 1: + *nums = &(e->back_ref1); + break; + default: + *nums = e->back_refs; + break; + } + return e->back_num; +} + +extern int onig_name_to_backref_number(regex_t *reg, const UChar *name, + const UChar *name_end, + const OnigRegion *region) +{ + int i, n, *nums; + + n = onig_name_to_group_numbers(reg, name, name_end, &nums); + if (n < 0) + return n; + else if (n == 0) + return ONIGERR_PARSER_BUG; + else if (n == 1) + return nums[0]; + else + { + if (IS_NOT_NULL(region)) + { + for (i = n - 1; i >= 0; i--) + { + if (region->beg[nums[i]] != ONIG_REGION_NOTPOS) + return nums[i]; + } + } + return nums[n - 1]; + } +} + +#else /* USE_NAMED_GROUP */ + +extern int onig_name_to_group_numbers(regex_t *reg, const UChar *name, + const UChar *name_end, int **nums) +{ + return ONIG_NO_SUPPORT_CONFIG; +} + +extern int onig_name_to_backref_number(regex_t *reg, const UChar *name, + const UChar *name_end, + const OnigRegion *region) +{ + return ONIG_NO_SUPPORT_CONFIG; +} + +extern int onig_foreach_name(regex_t *reg, + int (*func)(const UChar *, const UChar *, int, + int *, regex_t *, void *), + void *arg) +{ + return ONIG_NO_SUPPORT_CONFIG; +} + +extern int onig_number_of_names(const regex_t *reg) +{ + return 0; +} +#endif /* else USE_NAMED_GROUP */ + +extern int onig_noname_group_capture_is_active(const regex_t *reg) +{ + if (ONIG_IS_OPTION_ON(reg->options, ONIG_OPTION_DONT_CAPTURE_GROUP)) + return 0; + +#ifdef USE_NAMED_GROUP + if (onig_number_of_names(reg) > 0 + && IS_SYNTAX_BV(reg->syntax, ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP) + && !ONIG_IS_OPTION_ON(reg->options, ONIG_OPTION_CAPTURE_GROUP)) + { + return 0; + } +#endif + + return 1; +} + +#define INIT_SCANENV_MEMNODES_ALLOC_SIZE 16 + +static void scan_env_clear(ScanEnv *env) +{ + int i; + + BIT_STATUS_CLEAR(env->capture_history); + BIT_STATUS_CLEAR(env->bt_mem_start); + BIT_STATUS_CLEAR(env->bt_mem_end); + BIT_STATUS_CLEAR(env->backrefed_mem); + env->error = (UChar *)NULL; + env->error_end = (UChar *)NULL; + env->num_call = 0; + env->num_mem = 0; +#ifdef USE_NAMED_GROUP + env->num_named = 0; +#endif + env->mem_alloc = 0; + env->mem_nodes_dynamic = (Node **)NULL; + + for (i = 0; i < SCANENV_MEMNODES_SIZE; i++) + env->mem_nodes_static[i] = NULL_NODE; + +#ifdef USE_COMBINATION_EXPLOSION_CHECK + env->num_comb_exp_check = 0; + env->comb_exp_max_regnum = 0; + env->curr_max_regnum = 0; + env->has_recursion = 0; +#endif + env->parse_depth = 0; + env->warnings_flag = 0; +} + +static int scan_env_add_mem_entry(ScanEnv *env) +{ + int i, need, alloc; + Node **p; + + need = env->num_mem + 1; + if (need > ONIG_MAX_CAPTURE_GROUP_NUM) + return ONIGERR_TOO_MANY_CAPTURE_GROUPS; + if (need >= SCANENV_MEMNODES_SIZE) + { + if (env->mem_alloc <= need) + { + if (IS_NULL(env->mem_nodes_dynamic)) + { + alloc = INIT_SCANENV_MEMNODES_ALLOC_SIZE; + p = (Node **)xmalloc(sizeof(Node *) * alloc); + CHECK_NULL_RETURN_MEMERR(p); + xmemcpy(p, env->mem_nodes_static, + sizeof(Node *) * SCANENV_MEMNODES_SIZE); + } + else + { + alloc = env->mem_alloc * 2; + p = (Node **)xrealloc(env->mem_nodes_dynamic, sizeof(Node *) * alloc); + CHECK_NULL_RETURN_MEMERR(p); + } + + for (i = env->num_mem + 1; i < alloc; i++) + p[i] = NULL_NODE; + + env->mem_nodes_dynamic = p; + env->mem_alloc = alloc; + } + } + + env->num_mem++; + return env->num_mem; +} + +static int scan_env_set_mem_node(ScanEnv *env, int num, Node *node) +{ + if (env->num_mem >= num) + SCANENV_MEM_NODES(env)[num] = node; + else + return ONIGERR_PARSER_BUG; + return 0; +} + +extern void onig_node_free(Node *node) +{ +start: + if (IS_NULL(node)) + return; + + switch (NTYPE(node)) + { + case NT_STR: + if (NSTR(node)->capa != 0 && IS_NOT_NULL(NSTR(node)->s) + && NSTR(node)->s != NSTR(node)->buf) + { + xfree(NSTR(node)->s); + } + break; + + case NT_LIST: + case NT_ALT: + onig_node_free(NCAR(node)); + { + Node *next_node = NCDR(node); + + xfree(node); + node = next_node; + goto start; + } + break; + + case NT_CCLASS: { + CClassNode *cc = NCCLASS(node); + + if (cc->mbuf) + bbuf_free(cc->mbuf); + } + break; + + case NT_QTFR: + if (NQTFR(node)->target) + onig_node_free(NQTFR(node)->target); + break; + + case NT_ENCLOSE: + if (NENCLOSE(node)->target) + onig_node_free(NENCLOSE(node)->target); + break; + + case NT_BREF: + if (IS_NOT_NULL(NBREF(node)->back_dynamic)) + xfree(NBREF(node)->back_dynamic); + break; + + case NT_ANCHOR: + if (NANCHOR(node)->target) + onig_node_free(NANCHOR(node)->target); + break; + } + + xfree(node); +} + +static Node *node_new(void) +{ + Node *node; + + node = (Node *)xmalloc(sizeof(Node)); + /* xmemset(node, 0, sizeof(Node)); */ + return node; +} + +static void initialize_cclass(CClassNode *cc) +{ + BITSET_CLEAR(cc->bs); + /* cc->base.flags = 0; */ + cc->flags = 0; + cc->mbuf = NULL; +} + +static Node *node_new_cclass(void) +{ + Node *node = node_new(); + CHECK_NULL_RETURN(node); + + SET_NTYPE(node, NT_CCLASS); + initialize_cclass(NCCLASS(node)); + return node; +} + +static Node *node_new_ctype(int type, int not, int ascii_range) +{ + Node *node = node_new(); + CHECK_NULL_RETURN(node); + + SET_NTYPE(node, NT_CTYPE); + NCTYPE(node)->ctype = type; + NCTYPE(node)->not = not; + NCTYPE(node)->ascii_range = ascii_range; + return node; +} + +static Node *node_new_anychar(void) +{ + Node *node = node_new(); + CHECK_NULL_RETURN(node); + + SET_NTYPE(node, NT_CANY); + return node; +} + +static Node *node_new_list(Node *left, Node *right) +{ + Node *node = node_new(); + CHECK_NULL_RETURN(node); + + SET_NTYPE(node, NT_LIST); + NCAR(node) = left; + NCDR(node) = right; + return node; +} + +extern Node *onig_node_new_list(Node *left, Node *right) +{ + return node_new_list(left, right); +} + +extern Node *onig_node_list_add(Node *list, Node *x) +{ + Node *n; + + n = onig_node_new_list(x, NULL); + if (IS_NULL(n)) + return NULL_NODE; + + if (IS_NOT_NULL(list)) + { + while (IS_NOT_NULL(NCDR(list))) + list = NCDR(list); + + NCDR(list) = n; + } + + return n; +} + +extern Node *onig_node_new_alt(Node *left, Node *right) +{ + Node *node = node_new(); + CHECK_NULL_RETURN(node); + + SET_NTYPE(node, NT_ALT); + NCAR(node) = left; + NCDR(node) = right; + return node; +} + +extern Node *onig_node_new_anchor(int type) +{ + Node *node = node_new(); + CHECK_NULL_RETURN(node); + + SET_NTYPE(node, NT_ANCHOR); + NANCHOR(node)->type = type; + NANCHOR(node)->target = NULL; + NANCHOR(node)->char_len = -1; + NANCHOR(node)->ascii_range = 0; + return node; +} + +static Node *node_new_backref(int back_num, int *backrefs, int by_name, +#ifdef USE_BACKREF_WITH_LEVEL + int exist_level, int nest_level, +#endif + ScanEnv *env) +{ + int i; + Node *node = node_new(); + + CHECK_NULL_RETURN(node); + + SET_NTYPE(node, NT_BREF); + NBREF(node)->state = 0; + NBREF(node)->back_num = back_num; + NBREF(node)->back_dynamic = (int *)NULL; + if (by_name != 0) + NBREF(node)->state |= NST_NAME_REF; + +#ifdef USE_BACKREF_WITH_LEVEL + if (exist_level != 0) + { + NBREF(node)->state |= NST_NEST_LEVEL; + NBREF(node)->nest_level = nest_level; + } +#endif + + for (i = 0; i < back_num; i++) + { + if (backrefs[i] <= env->num_mem + && IS_NULL(SCANENV_MEM_NODES(env)[backrefs[i]])) + { + NBREF(node)->state |= NST_RECURSION; /* /...(\1).../ */ + break; + } + } + + if (back_num <= NODE_BACKREFS_SIZE) + { + for (i = 0; i < back_num; i++) + NBREF(node)->back_static[i] = backrefs[i]; + } + else + { + int *p = (int *)xmalloc(sizeof(int) * back_num); + if (IS_NULL(p)) + { + onig_node_free(node); + return NULL; + } + NBREF(node)->back_dynamic = p; + for (i = 0; i < back_num; i++) + p[i] = backrefs[i]; + } + return node; +} + +#ifdef USE_SUBEXP_CALL +static Node *node_new_call(UChar *name, UChar *name_end, int gnum) +{ + Node *node = node_new(); + CHECK_NULL_RETURN(node); + + SET_NTYPE(node, NT_CALL); + NCALL(node)->state = 0; + NCALL(node)->target = NULL_NODE; + NCALL(node)->name = name; + NCALL(node)->name_end = name_end; + NCALL(node)->group_num = gnum; /* call by number if gnum != 0 */ + return node; +} +#endif + +static Node *node_new_quantifier(int lower, int upper, int by_number) +{ + Node *node = node_new(); + CHECK_NULL_RETURN(node); + + SET_NTYPE(node, NT_QTFR); + NQTFR(node)->state = 0; + NQTFR(node)->target = NULL; + NQTFR(node)->lower = lower; + NQTFR(node)->upper = upper; + NQTFR(node)->greedy = 1; + NQTFR(node)->target_empty_info = NQ_TARGET_ISNOT_EMPTY; + NQTFR(node)->head_exact = NULL_NODE; + NQTFR(node)->next_head_exact = NULL_NODE; + NQTFR(node)->is_refered = 0; + if (by_number != 0) + NQTFR(node)->state |= NST_BY_NUMBER; + +#ifdef USE_COMBINATION_EXPLOSION_CHECK + NQTFR(node)->comb_exp_check_num = 0; +#endif + + return node; +} + +static Node *node_new_enclose(int type) +{ + Node *node = node_new(); + CHECK_NULL_RETURN(node); + + SET_NTYPE(node, NT_ENCLOSE); + NENCLOSE(node)->type = type; + NENCLOSE(node)->state = 0; + NENCLOSE(node)->regnum = 0; + NENCLOSE(node)->option = 0; + NENCLOSE(node)->target = NULL; + NENCLOSE(node)->call_addr = -1; + NENCLOSE(node)->opt_count = 0; + return node; +} + +extern Node *onig_node_new_enclose(int type) +{ + return node_new_enclose(type); +} + +static Node *node_new_enclose_memory(OnigOptionType option, int is_named) +{ + Node *node = node_new_enclose(ENCLOSE_MEMORY); + CHECK_NULL_RETURN(node); + if (is_named != 0) + SET_ENCLOSE_STATUS(node, NST_NAMED_GROUP); + +#ifdef USE_SUBEXP_CALL + NENCLOSE(node)->option = option; +#endif + return node; +} + +static Node *node_new_option(OnigOptionType option) +{ + Node *node = node_new_enclose(ENCLOSE_OPTION); + CHECK_NULL_RETURN(node); + NENCLOSE(node)->option = option; + return node; +} + +extern int onig_node_str_cat(Node *node, const UChar *s, const UChar *end) +{ + ptrdiff_t addlen = end - s; + + if (addlen > 0) + { + ptrdiff_t len = NSTR(node)->end - NSTR(node)->s; + + if (NSTR(node)->capa > 0 || (len + addlen > NODE_STR_BUF_SIZE - 1)) + { + UChar *p; + ptrdiff_t capa = len + addlen + NODE_STR_MARGIN; + + if (capa <= NSTR(node)->capa) + { + onig_strcpy(NSTR(node)->s + len, s, end); + } + else + { + if (NSTR(node)->s == NSTR(node)->buf) + p = strcat_capa_from_static(NSTR(node)->s, NSTR(node)->end, s, end, + capa); + else + p = strcat_capa(NSTR(node)->s, NSTR(node)->end, s, end, capa); + + CHECK_NULL_RETURN_MEMERR(p); + NSTR(node)->s = p; + NSTR(node)->capa = (int)capa; + } + } + else + { + onig_strcpy(NSTR(node)->s + len, s, end); + } + NSTR(node)->end = NSTR(node)->s + len + addlen; + } + + return 0; +} + +extern int onig_node_str_set(Node *node, const UChar *s, const UChar *end) +{ + onig_node_str_clear(node); + return onig_node_str_cat(node, s, end); +} + +static int node_str_cat_char(Node *node, UChar c) +{ + UChar s[1]; + + s[0] = c; + return onig_node_str_cat(node, s, s + 1); +} + +static int node_str_cat_codepoint(Node *node, OnigEncoding enc, OnigCodePoint c) +{ + UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN]; + int num = ONIGENC_CODE_TO_MBC(enc, c, buf); + if (num < 0) + return num; + return onig_node_str_cat(node, buf, buf + num); +} + +#if 0 +extern void +onig_node_conv_to_str_node(Node* node, int flag) +{ + SET_NTYPE(node, NT_STR); + NSTR(node)->flag = flag; + NSTR(node)->capa = 0; + NSTR(node)->s = NSTR(node)->buf; + NSTR(node)->end = NSTR(node)->buf; +} +#endif + +extern void onig_node_str_clear(Node *node) +{ + if (NSTR(node)->capa != 0 && IS_NOT_NULL(NSTR(node)->s) + && NSTR(node)->s != NSTR(node)->buf) + { + xfree(NSTR(node)->s); + } + + NSTR(node)->capa = 0; + NSTR(node)->flag = 0; + NSTR(node)->s = NSTR(node)->buf; + NSTR(node)->end = NSTR(node)->buf; +} + +static Node *node_new_str(const UChar *s, const UChar *end) +{ + Node *node = node_new(); + CHECK_NULL_RETURN(node); + + SET_NTYPE(node, NT_STR); + NSTR(node)->capa = 0; + NSTR(node)->flag = 0; + NSTR(node)->s = NSTR(node)->buf; + NSTR(node)->end = NSTR(node)->buf; + if (onig_node_str_cat(node, s, end)) + { + onig_node_free(node); + return NULL; + } + return node; +} + +extern Node *onig_node_new_str(const UChar *s, const UChar *end) +{ + return node_new_str(s, end); +} + +static Node *node_new_str_raw(UChar *s, UChar *end) +{ + Node *node = node_new_str(s, end); + if (IS_NOT_NULL(node)) + NSTRING_SET_RAW(node); + return node; +} + +static Node *node_new_empty(void) +{ + return node_new_str(NULL, NULL); +} + +static Node *node_new_str_raw_char(UChar c) +{ + UChar p[1]; + + p[0] = c; + return node_new_str_raw(p, p + 1); +} + +static Node *str_node_split_last_char(StrNode *sn, OnigEncoding enc) +{ + const UChar *p; + Node *n = NULL_NODE; + + if (sn->end > sn->s) + { + p = onigenc_get_prev_char_head(enc, sn->s, sn->end, sn->end); + if (p && p > sn->s) + { /* can be split. */ + n = node_new_str(p, sn->end); + if (IS_NOT_NULL(n) && (sn->flag & NSTR_RAW) != 0) + NSTRING_SET_RAW(n); + sn->end = (UChar *)p; + } + } + return n; +} + +static int str_node_can_be_split(StrNode *sn, OnigEncoding enc) +{ + if (sn->end > sn->s) + { + return ((enclen(enc, sn->s, sn->end) < sn->end - sn->s) ? 1 : 0); + } + return 0; +} + +#ifdef USE_PAD_TO_SHORT_BYTE_CHAR +static int node_str_head_pad(StrNode *sn, int num, UChar val) +{ + UChar buf[NODE_STR_BUF_SIZE]; + int i, len; + + len = sn->end - sn->s; + onig_strcpy(buf, sn->s, sn->end); + onig_strcpy(&(sn->s[num]), buf, buf + len); + sn->end += num; + + for (i = 0; i < num; i++) + { + sn->s[i] = val; + } +} +#endif + +extern int onig_scan_unsigned_number(UChar **src, const UChar *end, + OnigEncoding enc) +{ + unsigned int num, val; + OnigCodePoint c; + UChar *p = *src; + PFETCH_READY; + + num = 0; + while (!PEND) + { + PFETCH(c); + if (ONIGENC_IS_CODE_DIGIT(enc, c)) + { + val = (unsigned int)DIGITVAL(c); + if ((INT_MAX_LIMIT - val) / 10UL < num) + return -1; /* overflow */ + + num = num * 10 + val; + } + else + { + PUNFETCH; + break; + } + } + *src = p; + return num; +} + +static int scan_unsigned_hexadecimal_number(UChar **src, UChar *end, int minlen, + int maxlen, OnigEncoding enc) +{ + OnigCodePoint c; + unsigned int num, val; + int restlen; + UChar *p = *src; + PFETCH_READY; + + restlen = maxlen - minlen; + num = 0; + while (!PEND && maxlen-- != 0) + { + PFETCH(c); + if (ONIGENC_IS_CODE_XDIGIT(enc, c)) + { + val = (unsigned int)XDIGITVAL(enc, c); + if ((INT_MAX_LIMIT - val) / 16UL < num) + return -1; /* overflow */ + + num = (num << 4) + XDIGITVAL(enc, c); + } + else + { + PUNFETCH; + maxlen++; + break; + } + } + if (maxlen > restlen) + return -2; /* not enough digits */ + *src = p; + return num; +} + +static int scan_unsigned_octal_number(UChar **src, UChar *end, int maxlen, + OnigEncoding enc) +{ + OnigCodePoint c; + unsigned int num, val; + UChar *p = *src; + PFETCH_READY; + + num = 0; + while (!PEND && maxlen-- != 0) + { + PFETCH(c); + if (ONIGENC_IS_CODE_DIGIT(enc, c) && c < '8') + { + val = ODIGITVAL(c); + if ((INT_MAX_LIMIT - val) / 8UL < num) + return -1; /* overflow */ + + num = (num << 3) + val; + } + else + { + PUNFETCH; + break; + } + } + *src = p; + return num; +} + +#define BBUF_WRITE_CODE_POINT(bbuf, pos, code) \ + BBUF_WRITE(bbuf, pos, &(code), SIZE_CODE_POINT) + +/* data format: + [n][from-1][to-1][from-2][to-2] ... [from-n][to-n] + (all data size is OnigCodePoint) + */ +static int new_code_range(BBuf **pbuf) +{ +#define INIT_MULTI_BYTE_RANGE_SIZE (SIZE_CODE_POINT * 5) + int r; + OnigCodePoint n; + BBuf *bbuf; + + bbuf = *pbuf = (BBuf *)xmalloc(sizeof(BBuf)); + CHECK_NULL_RETURN_MEMERR(*pbuf); + r = BBUF_INIT(*pbuf, INIT_MULTI_BYTE_RANGE_SIZE); + if (r) + return r; + + n = 0; + BBUF_WRITE_CODE_POINT(bbuf, 0, n); + return 0; +} + +static int add_code_range_to_buf0(BBuf **pbuf, ScanEnv *env, OnigCodePoint from, + OnigCodePoint to, int checkdup) +{ + int r, inc_n, pos; + OnigCodePoint low, high, bound, x; + OnigCodePoint n, *data; + BBuf *bbuf; + + if (from > to) + { + n = from; + from = to; + to = n; + } + + if (IS_NULL(*pbuf)) + { + r = new_code_range(pbuf); + if (r) + return r; + bbuf = *pbuf; + n = 0; + } + else + { + bbuf = *pbuf; + GET_CODE_POINT(n, bbuf->p); + } + data = (OnigCodePoint *)(bbuf->p); + data++; + + bound = (from == 0) ? 0 : n; + for (low = 0; low < bound;) + { + x = (low + bound) >> 1; + if (from - 1 > data[x * 2 + 1]) + low = x + 1; + else + bound = x; + } + + high = (to == ONIG_LAST_CODE_POINT) ? n : low; + for (bound = n; high < bound;) + { + x = (high + bound) >> 1; + if (to + 1 >= data[x * 2]) + high = x + 1; + else + bound = x; + } + /* data[(low-1)*2+1] << from <= data[low*2] + * data[(high-1)*2+1] <= to << data[high*2] + */ + + inc_n = low + 1 - high; + if (n + inc_n > ONIG_MAX_MULTI_BYTE_RANGES_NUM) + return ONIGERR_TOO_MANY_MULTI_BYTE_RANGES; + + if (inc_n != 1) + { + if (checkdup && from <= data[low * 2 + 1] + && (data[low * 2] <= from || data[low * 2 + 1] <= to)) + CC_DUP_WARN(env); + if (from > data[low * 2]) + from = data[low * 2]; + if (to < data[(high - 1) * 2 + 1]) + to = data[(high - 1) * 2 + 1]; + } + + if (inc_n != 0) + { + int from_pos = SIZE_CODE_POINT * (1 + high * 2); + int to_pos = SIZE_CODE_POINT * (1 + (low + 1) * 2); + + if (inc_n > 0) + { + if (high < n) + { + int size = (n - high) * 2 * SIZE_CODE_POINT; + BBUF_MOVE_RIGHT(bbuf, from_pos, to_pos, size); + } + } + else + { + BBUF_MOVE_LEFT_REDUCE(bbuf, from_pos, to_pos); + } + } + + pos = SIZE_CODE_POINT * (1 + low * 2); + BBUF_ENSURE_SIZE(bbuf, pos + SIZE_CODE_POINT * 2); + BBUF_WRITE_CODE_POINT(bbuf, pos, from); + BBUF_WRITE_CODE_POINT(bbuf, pos + SIZE_CODE_POINT, to); + n += inc_n; + BBUF_WRITE_CODE_POINT(bbuf, 0, n); + + return 0; +} + +static int add_code_range_to_buf(BBuf **pbuf, ScanEnv *env, OnigCodePoint from, + OnigCodePoint to) +{ + return add_code_range_to_buf0(pbuf, env, from, to, 1); +} + +static int add_code_range0(BBuf **pbuf, ScanEnv *env, OnigCodePoint from, + OnigCodePoint to, int checkdup) +{ + if (from > to) + { + if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC)) + return 0; + else + return ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS; + } + + return add_code_range_to_buf0(pbuf, env, from, to, checkdup); +} + +static int add_code_range(BBuf **pbuf, ScanEnv *env, OnigCodePoint from, + OnigCodePoint to) +{ + return add_code_range0(pbuf, env, from, to, 1); +} + +static int not_code_range_buf(OnigEncoding enc, BBuf *bbuf, BBuf **pbuf, + ScanEnv *env) +{ + int r, i, n; + OnigCodePoint pre, from, *data, to = 0; + + *pbuf = (BBuf *)NULL; + if (IS_NULL(bbuf)) + { + set_all: + return SET_ALL_MULTI_BYTE_RANGE(enc, pbuf); + } + + data = (OnigCodePoint *)(bbuf->p); + GET_CODE_POINT(n, data); + data++; + if (n <= 0) + goto set_all; + + r = 0; + pre = MBCODE_START_POS(enc); + for (i = 0; i < n; i++) + { + from = data[i * 2]; + to = data[i * 2 + 1]; + if (pre <= from - 1) + { + r = add_code_range_to_buf(pbuf, env, pre, from - 1); + if (r != 0) + return r; + } + if (to == ONIG_LAST_CODE_POINT) + break; + pre = to + 1; + } + if (to < ONIG_LAST_CODE_POINT) + { + r = add_code_range_to_buf(pbuf, env, to + 1, ONIG_LAST_CODE_POINT); + } + return r; +} + +#define SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2) \ + do \ + { \ + BBuf *tbuf; \ + int tnot; \ + tnot = not1; \ + not1 = not2; \ + not2 = tnot; \ + tbuf = bbuf1; \ + bbuf1 = bbuf2; \ + bbuf2 = tbuf; \ + } while (0) + +static int or_code_range_buf(OnigEncoding enc, BBuf *bbuf1, int not1, + BBuf *bbuf2, int not2, BBuf **pbuf, ScanEnv *env) +{ + int r; + OnigCodePoint i, n1, *data1; + OnigCodePoint from, to; + + *pbuf = (BBuf *)NULL; + if (IS_NULL(bbuf1) && IS_NULL(bbuf2)) + { + if (not1 != 0 || not2 != 0) + return SET_ALL_MULTI_BYTE_RANGE(enc, pbuf); + return 0; + } + + r = 0; + if (IS_NULL(bbuf2)) + SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2); + + if (IS_NULL(bbuf1)) + { + if (not1 != 0) + { + return SET_ALL_MULTI_BYTE_RANGE(enc, pbuf); + } + else + { + if (not2 == 0) + { + return bbuf_clone(pbuf, bbuf2); + } + else + { + return not_code_range_buf(enc, bbuf2, pbuf, env); + } + } + } + + if (not1 != 0) + SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2); + + data1 = (OnigCodePoint *)(bbuf1->p); + GET_CODE_POINT(n1, data1); + data1++; + + if (not2 == 0 && not1 == 0) + { /* 1 OR 2 */ + r = bbuf_clone(pbuf, bbuf2); + } + else if (not1 == 0) + { /* 1 OR (not 2) */ + r = not_code_range_buf(enc, bbuf2, pbuf, env); + } + if (r != 0) + return r; + + for (i = 0; i < n1; i++) + { + from = data1[i * 2]; + to = data1[i * 2 + 1]; + r = add_code_range_to_buf(pbuf, env, from, to); + if (r != 0) + return r; + } + return 0; +} + +static int and_code_range1(BBuf **pbuf, ScanEnv *env, OnigCodePoint from1, + OnigCodePoint to1, OnigCodePoint *data, int n) +{ + int i, r; + OnigCodePoint from2, to2; + + for (i = 0; i < n; i++) + { + from2 = data[i * 2]; + to2 = data[i * 2 + 1]; + if (from2 < from1) + { + if (to2 < from1) + continue; + else + { + from1 = to2 + 1; + } + } + else if (from2 <= to1) + { + if (to2 < to1) + { + if (from1 <= from2 - 1) + { + r = add_code_range_to_buf(pbuf, env, from1, from2 - 1); + if (r != 0) + return r; + } + from1 = to2 + 1; + } + else + { + to1 = from2 - 1; + } + } + else + { + from1 = from2; + } + if (from1 > to1) + break; + } + if (from1 <= to1) + { + r = add_code_range_to_buf(pbuf, env, from1, to1); + if (r != 0) + return r; + } + return 0; +} + +static int and_code_range_buf(BBuf *bbuf1, int not1, BBuf *bbuf2, int not2, + BBuf **pbuf, ScanEnv *env) +{ + int r; + OnigCodePoint i, j, n1, n2, *data1, *data2; + OnigCodePoint from, to, from1, to1, from2, to2; + + *pbuf = (BBuf *)NULL; + if (IS_NULL(bbuf1)) + { + if (not1 != 0 && IS_NOT_NULL(bbuf2)) /* not1 != 0 -> not2 == 0 */ + return bbuf_clone(pbuf, bbuf2); + return 0; + } + else if (IS_NULL(bbuf2)) + { + if (not2 != 0) + return bbuf_clone(pbuf, bbuf1); + return 0; + } + + if (not1 != 0) + SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2); + + data1 = (OnigCodePoint *)(bbuf1->p); + data2 = (OnigCodePoint *)(bbuf2->p); + GET_CODE_POINT(n1, data1); + GET_CODE_POINT(n2, data2); + data1++; + data2++; + + if (not2 == 0 && not1 == 0) + { /* 1 AND 2 */ + for (i = 0; i < n1; i++) + { + from1 = data1[i * 2]; + to1 = data1[i * 2 + 1]; + for (j = 0; j < n2; j++) + { + from2 = data2[j * 2]; + to2 = data2[j * 2 + 1]; + if (from2 > to1) + break; + if (to2 < from1) + continue; + from = MAX(from1, from2); + to = MIN(to1, to2); + r = add_code_range_to_buf(pbuf, env, from, to); + if (r != 0) + return r; + } + } + } + else if (not1 == 0) + { /* 1 AND (not 2) */ + for (i = 0; i < n1; i++) + { + from1 = data1[i * 2]; + to1 = data1[i * 2 + 1]; + r = and_code_range1(pbuf, env, from1, to1, data2, n2); + if (r != 0) + return r; + } + } + + return 0; +} + +static int and_cclass(CClassNode *dest, CClassNode *cc, ScanEnv *env) +{ + OnigEncoding enc = env->enc; + int r, not1, not2; + BBuf *buf1, *buf2, *pbuf = 0; + BitSetRef bsr1, bsr2; + BitSet bs1, bs2; + + not1 = IS_NCCLASS_NOT(dest); + bsr1 = dest->bs; + buf1 = dest->mbuf; + not2 = IS_NCCLASS_NOT(cc); + bsr2 = cc->bs; + buf2 = cc->mbuf; + + if (not1 != 0) + { + bitset_invert_to(bsr1, bs1); + bsr1 = bs1; + } + if (not2 != 0) + { + bitset_invert_to(bsr2, bs2); + bsr2 = bs2; + } + bitset_and(bsr1, bsr2); + if (bsr1 != dest->bs) + { + bitset_copy(dest->bs, bsr1); + bsr1 = dest->bs; + } + if (not1 != 0) + { + bitset_invert(dest->bs); + } + + if (!ONIGENC_IS_SINGLEBYTE(enc)) + { + if (not1 != 0 && not2 != 0) + { + r = or_code_range_buf(enc, buf1, 0, buf2, 0, &pbuf, env); + } + else + { + r = and_code_range_buf(buf1, not1, buf2, not2, &pbuf, env); + if (r == 0 && not1 != 0) + { + BBuf *tbuf = 0; + r = not_code_range_buf(enc, pbuf, &tbuf, env); + bbuf_free(pbuf); + pbuf = tbuf; + } + } + if (r != 0) + { + bbuf_free(pbuf); + return r; + } + + dest->mbuf = pbuf; + bbuf_free(buf1); + return r; + } + return 0; +} + +static int or_cclass(CClassNode *dest, CClassNode *cc, ScanEnv *env) +{ + OnigEncoding enc = env->enc; + int r, not1, not2; + BBuf *buf1, *buf2, *pbuf = 0; + BitSetRef bsr1, bsr2; + BitSet bs1, bs2; + + not1 = IS_NCCLASS_NOT(dest); + bsr1 = dest->bs; + buf1 = dest->mbuf; + not2 = IS_NCCLASS_NOT(cc); + bsr2 = cc->bs; + buf2 = cc->mbuf; + + if (not1 != 0) + { + bitset_invert_to(bsr1, bs1); + bsr1 = bs1; + } + if (not2 != 0) + { + bitset_invert_to(bsr2, bs2); + bsr2 = bs2; + } + bitset_or(bsr1, bsr2); + if (bsr1 != dest->bs) + { + bitset_copy(dest->bs, bsr1); + bsr1 = dest->bs; + } + if (not1 != 0) + { + bitset_invert(dest->bs); + } + + if (!ONIGENC_IS_SINGLEBYTE(enc)) + { + if (not1 != 0 && not2 != 0) + { + r = and_code_range_buf(buf1, 0, buf2, 0, &pbuf, env); + } + else + { + r = or_code_range_buf(enc, buf1, not1, buf2, not2, &pbuf, env); + if (r == 0 && not1 != 0) + { + BBuf *tbuf = 0; + r = not_code_range_buf(enc, pbuf, &tbuf, env); + bbuf_free(pbuf); + pbuf = tbuf; + } + } + if (r != 0) + { + bbuf_free(pbuf); + return r; + } + + dest->mbuf = pbuf; + bbuf_free(buf1); + return r; + } + else + return 0; +} + +static void UNKNOWN_ESC_WARN(ScanEnv *env, int c); + +static OnigCodePoint conv_backslash_value(OnigCodePoint c, ScanEnv *env) +{ + if (IS_SYNTAX_OP(env->syntax, ONIG_SYN_OP_ESC_CONTROL_CHARS)) + { + switch (c) + { + case 'n': + return '\n'; + case 't': + return '\t'; + case 'r': + return '\r'; + case 'f': + return '\f'; + case 'a': + return '\007'; + case 'b': + return '\010'; + case 'e': + return '\033'; + case 'v': + if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_ESC_V_VTAB)) + return '\v'; + break; + + default: + if (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z')) + UNKNOWN_ESC_WARN(env, c); + break; + } + } + return c; +} + +#ifdef USE_NO_INVALID_QUANTIFIER +# define is_invalid_quantifier_target(node) 0 +#else +static int is_invalid_quantifier_target(Node *node) +{ + switch (NTYPE(node)) + { + case NT_ANCHOR: + return 1; + break; + + case NT_ENCLOSE: + /* allow enclosed elements */ + /* return is_invalid_quantifier_target(NENCLOSE(node)->target); */ + break; + + case NT_LIST: + do + { + if (!is_invalid_quantifier_target(NCAR(node))) + return 0; + } while (IS_NOT_NULL(node = NCDR(node))); + return 0; + break; + + case NT_ALT: + do + { + if (is_invalid_quantifier_target(NCAR(node))) + return 1; + } while (IS_NOT_NULL(node = NCDR(node))); + break; + + default: + break; + } + return 0; +} +#endif + +/* ?:0, *:1, +:2, ??:3, *?:4, +?:5 */ +static int popular_quantifier_num(QtfrNode *q) +{ + if (q->greedy) + { + if (q->lower == 0) + { + if (q->upper == 1) + return 0; + else if (IS_REPEAT_INFINITE(q->upper)) + return 1; + } + else if (q->lower == 1) + { + if (IS_REPEAT_INFINITE(q->upper)) + return 2; + } + } + else + { + if (q->lower == 0) + { + if (q->upper == 1) + return 3; + else if (IS_REPEAT_INFINITE(q->upper)) + return 4; + } + else if (q->lower == 1) + { + if (IS_REPEAT_INFINITE(q->upper)) + return 5; + } + } + return -1; +} + +enum ReduceType +{ + RQ_ASIS = 0, /* as is */ + RQ_DEL = 1, /* delete parent */ + RQ_A, /* to '*' */ + RQ_AQ, /* to '*?' */ + RQ_QQ, /* to '??' */ + RQ_P_QQ, /* to '+)??' */ + RQ_PQ_Q /* to '+?)?' */ +}; + +static enum ReduceType const ReduceTypeTable[6][6] = { + /* '?', '*', '+', '??', '*?', '+?' p / c */ + {RQ_DEL, RQ_A, RQ_A, RQ_QQ, RQ_AQ, RQ_ASIS}, /* '?' */ + {RQ_DEL, RQ_DEL, RQ_DEL, RQ_P_QQ, RQ_P_QQ, RQ_DEL}, /* '*' */ + {RQ_A, RQ_A, RQ_DEL, RQ_ASIS, RQ_P_QQ, RQ_DEL}, /* '+' */ + {RQ_DEL, RQ_AQ, RQ_AQ, RQ_DEL, RQ_AQ, RQ_AQ}, /* '??' */ + {RQ_DEL, RQ_DEL, RQ_DEL, RQ_DEL, RQ_DEL, RQ_DEL}, /* '*?' */ + {RQ_ASIS, RQ_PQ_Q, RQ_DEL, RQ_AQ, RQ_AQ, RQ_DEL} /* '+?' */ +}; + +extern void onig_reduce_nested_quantifier(Node *pnode, Node *cnode) +{ + int pnum, cnum; + QtfrNode *p, *c; + + p = NQTFR(pnode); + c = NQTFR(cnode); + pnum = popular_quantifier_num(p); + cnum = popular_quantifier_num(c); + if (pnum < 0 || cnum < 0) + return; + + switch (ReduceTypeTable[cnum][pnum]) + { + case RQ_DEL: + *pnode = *cnode; + break; + case RQ_A: + p->target = c->target; + p->lower = 0; + p->upper = REPEAT_INFINITE; + p->greedy = 1; + break; + case RQ_AQ: + p->target = c->target; + p->lower = 0; + p->upper = REPEAT_INFINITE; + p->greedy = 0; + break; + case RQ_QQ: + p->target = c->target; + p->lower = 0; + p->upper = 1; + p->greedy = 0; + break; + case RQ_P_QQ: + p->target = cnode; + p->lower = 0; + p->upper = 1; + p->greedy = 0; + c->lower = 1; + c->upper = REPEAT_INFINITE; + c->greedy = 1; + return; + break; + case RQ_PQ_Q: + p->target = cnode; + p->lower = 0; + p->upper = 1; + p->greedy = 1; + c->lower = 1; + c->upper = REPEAT_INFINITE; + c->greedy = 0; + return; + break; + case RQ_ASIS: + p->target = cnode; + return; + break; + } + + c->target = NULL_NODE; + onig_node_free(cnode); +} + +enum TokenSyms +{ + TK_EOT = 0, /* end of token */ + TK_RAW_BYTE = 1, + TK_CHAR, + TK_STRING, + TK_CODE_POINT, + TK_ANYCHAR, + TK_CHAR_TYPE, + TK_BACKREF, + TK_CALL, + TK_ANCHOR, + TK_OP_REPEAT, + TK_INTERVAL, + TK_ANYCHAR_ANYTIME, /* SQL '%' == .* */ + TK_ALT, + TK_SUBEXP_OPEN, + TK_SUBEXP_CLOSE, + TK_CC_OPEN, + TK_QUOTE_OPEN, + TK_CHAR_PROPERTY, /* \p{...}, \P{...} */ + TK_LINEBREAK, + TK_EXTENDED_GRAPHEME_CLUSTER, + TK_KEEP, + /* in cc */ + TK_CC_CLOSE, + TK_CC_RANGE, + TK_POSIX_BRACKET_OPEN, + TK_CC_AND, /* && */ + TK_CC_CC_OPEN /* [ */ +}; + +typedef struct +{ + enum TokenSyms type; + int escaped; + int base; /* is number: 8, 16 (used in [....]) */ + UChar *backp; + union + { + UChar *s; + int c; + OnigCodePoint code; + struct + { + int subtype; + int ascii_range; + } anchor; + struct + { + int lower; + int upper; + int greedy; + int possessive; + } repeat; + struct + { + int num; + int ref1; + int *refs; + int by_name; +#ifdef USE_BACKREF_WITH_LEVEL + int exist_level; + int level; /* \k<name+n> */ +#endif + } backref; + struct + { + UChar *name; + UChar *name_end; + int gnum; + int rel; + } call; + struct + { + int ctype; + int not; + } prop; + } u; +} OnigToken; + +static int fetch_range_quantifier(UChar **src, UChar *end, OnigToken *tok, + ScanEnv *env) +{ + int low, up, syn_allow, non_low = 0; + int r = 0; + OnigCodePoint c; + OnigEncoding enc = env->enc; + UChar *p = *src; + PFETCH_READY; + + syn_allow = IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_INVALID_INTERVAL); + + if (PEND) + { + if (syn_allow) + return 1; /* "....{" : OK! */ + else + return ONIGERR_END_PATTERN_AT_LEFT_BRACE; /* "....{" syntax error */ + } + + if (!syn_allow) + { + c = PPEEK; + if (c == ')' || c == '(' || c == '|') + { + return ONIGERR_END_PATTERN_AT_LEFT_BRACE; + } + } + + low = onig_scan_unsigned_number(&p, end, env->enc); + if (low < 0) + return ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE; + if (low > ONIG_MAX_REPEAT_NUM) + return ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE; + + if (p == *src) + { /* can't read low */ + if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV)) + { + /* allow {,n} as {0,n} */ + low = 0; + non_low = 1; + } + else + goto invalid; + } + + if (PEND) + goto invalid; + PFETCH(c); + if (c == ',') + { + UChar *prev = p; + up = onig_scan_unsigned_number(&p, end, env->enc); + if (up < 0) + return ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE; + if (up > ONIG_MAX_REPEAT_NUM) + return ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE; + + if (p == prev) + { + if (non_low != 0) + goto invalid; + up = REPEAT_INFINITE; /* {n,} : {n,infinite} */ + } + } + else + { + if (non_low != 0) + goto invalid; + + PUNFETCH; + up = low; /* {n} : exact n times */ + r = 2; /* fixed */ + } + + if (PEND) + goto invalid; + PFETCH(c); + if (IS_SYNTAX_OP(env->syntax, ONIG_SYN_OP_ESC_BRACE_INTERVAL)) + { + if (c != MC_ESC(env->syntax)) + goto invalid; + if (PEND) + goto invalid; + PFETCH(c); + } + if (c != '}') + goto invalid; + + if (!IS_REPEAT_INFINITE(up) && low > up) + { + return ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE; + } + + tok->type = TK_INTERVAL; + tok->u.repeat.lower = low; + tok->u.repeat.upper = up; + *src = p; + return r; /* 0: normal {n,m}, 2: fixed {n} */ + +invalid: + if (syn_allow) + return 1; /* OK */ + else + return ONIGERR_INVALID_REPEAT_RANGE_PATTERN; +} + +/* \M-, \C-, \c, or \... */ +static int fetch_escaped_value(UChar **src, UChar *end, ScanEnv *env, + OnigCodePoint *val) +{ + int v; + OnigCodePoint c; + OnigEncoding enc = env->enc; + UChar *p = *src; + + if (PEND) + return ONIGERR_END_PATTERN_AT_ESCAPE; + + PFETCH_S(c); + switch (c) + { + case 'M': + if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META)) + { + if (PEND) + return ONIGERR_END_PATTERN_AT_META; + PFETCH_S(c); + if (c != '-') + return ONIGERR_META_CODE_SYNTAX; + if (PEND) + return ONIGERR_END_PATTERN_AT_META; + PFETCH_S(c); + if (c == MC_ESC(env->syntax)) + { + v = fetch_escaped_value(&p, end, env, &c); + if (v < 0) + return v; + } + c = ((c & 0xff) | 0x80); + } + else + goto backslash; + break; + + case 'C': + if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL)) + { + if (PEND) + return ONIGERR_END_PATTERN_AT_CONTROL; + PFETCH_S(c); + if (c != '-') + return ONIGERR_CONTROL_CODE_SYNTAX; + goto control; + } + else + goto backslash; + + case 'c': + if (IS_SYNTAX_OP(env->syntax, ONIG_SYN_OP_ESC_C_CONTROL)) + { + control: + if (PEND) + return ONIGERR_END_PATTERN_AT_CONTROL; + PFETCH_S(c); + if (c == '?') + { + c = 0177; + } + else + { + if (c == MC_ESC(env->syntax)) + { + v = fetch_escaped_value(&p, end, env, &c); + if (v < 0) + return v; + } + c &= 0x9f; + } + break; + } + /* fall through */ + + default: { + backslash: + c = conv_backslash_value(c, env); + } + break; + } + + *src = p; + *val = c; + return 0; +} + +static int fetch_token(OnigToken *tok, UChar **src, UChar *end, ScanEnv *env); + +static OnigCodePoint get_name_end_code_point(OnigCodePoint start) +{ + switch (start) + { + case '<': + return (OnigCodePoint)'>'; + break; + case '\'': + return (OnigCodePoint)'\''; + break; + case '(': + return (OnigCodePoint)')'; + break; + case '{': + return (OnigCodePoint)'}'; + break; + default: + break; + } + + return (OnigCodePoint)0; +} + +#ifdef USE_NAMED_GROUP +# ifdef RUBY +# define ONIGENC_IS_CODE_NAME(enc, c) TRUE +# else +# define ONIGENC_IS_CODE_NAME(enc, c) ONIGENC_IS_CODE_WORD(enc, c) +# endif + +# ifdef USE_BACKREF_WITH_LEVEL +/* + \k<name+n>, \k<name-n> + \k<num+n>, \k<num-n> + \k<-num+n>, \k<-num-n> +*/ +static int fetch_name_with_level(OnigCodePoint start_code, UChar **src, + UChar *end, UChar **rname_end, ScanEnv *env, + int *rback_num, int *rlevel) +{ + int r, sign, is_num, exist_level; + OnigCodePoint end_code; + OnigCodePoint c = 0; + OnigEncoding enc = env->enc; + UChar *name_end; + UChar *pnum_head; + UChar *p = *src; + PFETCH_READY; + + *rback_num = 0; + is_num = exist_level = 0; + sign = 1; + pnum_head = *src; + + end_code = get_name_end_code_point(start_code); + + name_end = end; + r = 0; + if (PEND) + { + return ONIGERR_EMPTY_GROUP_NAME; + } + else + { + PFETCH(c); + if (c == end_code) + return ONIGERR_EMPTY_GROUP_NAME; + + if (ONIGENC_IS_CODE_DIGIT(enc, c)) + { + is_num = 1; + } + else if (c == '-') + { + is_num = 2; + sign = -1; + pnum_head = p; + } + else if (!ONIGENC_IS_CODE_NAME(enc, c)) + { + r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME; + } + } + + while (!PEND) + { + name_end = p; + PFETCH(c); + if (c == end_code || c == ')' || c == '+' || c == '-') + { + if (is_num == 2) + r = ONIGERR_INVALID_GROUP_NAME; + break; + } + + if (is_num != 0) + { + if (ONIGENC_IS_CODE_DIGIT(enc, c)) + { + is_num = 1; + } + else + { + r = ONIGERR_INVALID_GROUP_NAME; + is_num = 0; + } + } + else if (!ONIGENC_IS_CODE_NAME(enc, c)) + { + r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME; + } + } + + if (r == 0 && c != end_code) + { + if (c == '+' || c == '-') + { + int level; + int flag = (c == '-' ? -1 : 1); + + if (PEND) + { + r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME; + goto end; + } + PFETCH(c); + if (!ONIGENC_IS_CODE_DIGIT(enc, c)) + goto err; + PUNFETCH; + level = onig_scan_unsigned_number(&p, end, enc); + if (level < 0) + return ONIGERR_TOO_BIG_NUMBER; + *rlevel = (level * flag); + exist_level = 1; + + if (!PEND) + { + PFETCH(c); + if (c == end_code) + goto end; + } + } + + err: + r = ONIGERR_INVALID_GROUP_NAME; + name_end = end; + } + +end: + if (r == 0) + { + if (is_num != 0) + { + *rback_num = onig_scan_unsigned_number(&pnum_head, name_end, enc); + if (*rback_num < 0) + return ONIGERR_TOO_BIG_NUMBER; + else if (*rback_num == 0) + goto err; + + *rback_num *= sign; + } + + *rname_end = name_end; + *src = p; + return (exist_level ? 1 : 0); + } + else + { + onig_scan_env_set_error_string(env, r, *src, name_end); + return r; + } +} +# endif /* USE_BACKREF_WITH_LEVEL */ + +/* + ref: 0 -> define name (don't allow number name) + 1 -> reference name (allow number name) +*/ +static int fetch_name(OnigCodePoint start_code, UChar **src, UChar *end, + UChar **rname_end, ScanEnv *env, int *rback_num, int ref) +{ + int r, is_num, sign; + OnigCodePoint end_code; + OnigCodePoint c = 0; + OnigEncoding enc = env->enc; + UChar *name_end; + UChar *pnum_head; + UChar *p = *src; + + *rback_num = 0; + + end_code = get_name_end_code_point(start_code); + + name_end = end; + pnum_head = *src; + r = 0; + is_num = 0; + sign = 1; + if (PEND) + { + return ONIGERR_EMPTY_GROUP_NAME; + } + else + { + PFETCH_S(c); + if (c == end_code) + return ONIGERR_EMPTY_GROUP_NAME; + + if (ONIGENC_IS_CODE_DIGIT(enc, c)) + { + if (ref == 1) + is_num = 1; + else + { + r = ONIGERR_INVALID_GROUP_NAME; + is_num = 0; + } + } + else if (c == '-') + { + if (ref == 1) + { + is_num = 2; + sign = -1; + pnum_head = p; + } + else + { + r = ONIGERR_INVALID_GROUP_NAME; + is_num = 0; + } + } + else if (!ONIGENC_IS_CODE_NAME(enc, c)) + { + r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME; + } + } + + if (r == 0) + { + while (!PEND) + { + name_end = p; + PFETCH_S(c); + if (c == end_code || c == ')') + { + if (is_num == 2) + { + r = ONIGERR_INVALID_GROUP_NAME; + goto teardown; + } + break; + } + + if (is_num != 0) + { + if (ONIGENC_IS_CODE_DIGIT(enc, c)) + { + is_num = 1; + } + else + { + if (!ONIGENC_IS_CODE_WORD(enc, c)) + r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME; + else + r = ONIGERR_INVALID_GROUP_NAME; + goto teardown; + } + } + else + { + if (!ONIGENC_IS_CODE_NAME(enc, c)) + { + r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME; + goto teardown; + } + } + } + + if (c != end_code) + { + r = ONIGERR_INVALID_GROUP_NAME; + name_end = end; + goto err; + } + + if (is_num != 0) + { + *rback_num = onig_scan_unsigned_number(&pnum_head, name_end, enc); + if (*rback_num < 0) + return ONIGERR_TOO_BIG_NUMBER; + else if (*rback_num == 0) + { + r = ONIGERR_INVALID_GROUP_NAME; + goto err; + } + + *rback_num *= sign; + } + + *rname_end = name_end; + *src = p; + return 0; + } + else + { + teardown: + while (!PEND) + { + name_end = p; + PFETCH_S(c); + if (c == end_code || c == ')') + break; + } + if (PEND) + name_end = end; + + err: + onig_scan_env_set_error_string(env, r, *src, name_end); + return r; + } +} +#else +static int fetch_name(OnigCodePoint start_code, UChar **src, UChar *end, + UChar **rname_end, ScanEnv *env, int *rback_num, int ref) +{ + int r, is_num, sign; + OnigCodePoint end_code; + OnigCodePoint c = 0; + UChar *name_end; + OnigEncoding enc = env->enc; + UChar *pnum_head; + UChar *p = *src; + PFETCH_READY; + + *rback_num = 0; + + end_code = get_name_end_code_point(start_code); + + *rname_end = name_end = end; + r = 0; + pnum_head = *src; + is_num = 0; + sign = 1; + + if (PEND) + { + return ONIGERR_EMPTY_GROUP_NAME; + } + else + { + PFETCH(c); + if (c == end_code) + return ONIGERR_EMPTY_GROUP_NAME; + + if (ONIGENC_IS_CODE_DIGIT(enc, c)) + { + is_num = 1; + } + else if (c == '-') + { + is_num = 2; + sign = -1; + pnum_head = p; + } + else + { + r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME; + } + } + + while (!PEND) + { + name_end = p; + + PFETCH(c); + if (c == end_code || c == ')') + break; + if (!ONIGENC_IS_CODE_DIGIT(enc, c)) + r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME; + } + if (r == 0 && c != end_code) + { + r = ONIGERR_INVALID_GROUP_NAME; + name_end = end; + } + + if (r == 0) + { + *rback_num = onig_scan_unsigned_number(&pnum_head, name_end, enc); + if (*rback_num < 0) + return ONIGERR_TOO_BIG_NUMBER; + else if (*rback_num == 0) + { + r = ONIGERR_INVALID_GROUP_NAME; + goto err; + } + *rback_num *= sign; + + *rname_end = name_end; + *src = p; + return 0; + } + else + { + err: + onig_scan_env_set_error_string(env, r, *src, name_end); + return r; + } +} +#endif /* USE_NAMED_GROUP */ + +static void onig_syntax_warn(ScanEnv *env, const char *fmt, ...) +{ + va_list args; + UChar buf[WARN_BUFSIZE]; + va_start(args, fmt); + onig_vsnprintf_with_pattern(buf, WARN_BUFSIZE, env->enc, env->pattern, + env->pattern_end, (const UChar *)fmt, args); + va_end(args); +#ifdef RUBY + if (env->sourcefile == NULL) + rb_warn("%s", (char *)buf); + else + rb_compile_warn(env->sourcefile, env->sourceline, "%s", (char *)buf); +#else + (*onig_warn)((char *)buf); +#endif +} + +static void CC_ESC_WARN(ScanEnv *env, UChar *c) +{ + if (onig_warn == onig_null_warn) + return; + + if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_WARN_CC_OP_NOT_ESCAPED) + && IS_SYNTAX_BV(env->syntax, ONIG_SYN_BACKSLASH_ESCAPE_IN_CC)) + { + onig_syntax_warn(env, "character class has '%s' without escape", c); + } +} + +static void CLOSE_BRACKET_WITHOUT_ESC_WARN(ScanEnv *env, UChar *c) +{ + if (onig_warn == onig_null_warn) + return; + + if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_WARN_CC_OP_NOT_ESCAPED)) + { + onig_syntax_warn(env, "regular expression has '%s' without escape", c); + } +} + +#ifndef RTEST +# define RTEST(v) 1 +#endif + +static void CC_DUP_WARN(ScanEnv *env) +{ + if (onig_warn == onig_null_warn || !RTEST(ruby_verbose)) + return; + + if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_WARN_CC_DUP) + && !(env->warnings_flag & ONIG_SYN_WARN_CC_DUP)) + { + env->warnings_flag |= ONIG_SYN_WARN_CC_DUP; + onig_syntax_warn(env, "character class has duplicated range"); + } +} + +static void UNKNOWN_ESC_WARN(ScanEnv *env, int c) +{ + if (onig_warn == onig_null_warn || !RTEST(ruby_verbose)) + return; + onig_syntax_warn(env, "Unknown escape \\%c is ignored", c); +} + +static UChar *find_str_position(OnigCodePoint s[], int n, UChar *from, + UChar *to, UChar **next, OnigEncoding enc) +{ + int i; + OnigCodePoint x; + UChar *q; + UChar *p = from; + + while (p < to) + { + x = ONIGENC_MBC_TO_CODE(enc, p, to); + q = p + enclen(enc, p, to); + if (x == s[0]) + { + for (i = 1; i < n && q < to; i++) + { + x = ONIGENC_MBC_TO_CODE(enc, q, to); + if (x != s[i]) + break; + q += enclen(enc, q, to); + } + if (i >= n) + { + if (IS_NOT_NULL(next)) + *next = q; + return p; + } + } + p = q; + } + return NULL_UCHARP; +} + +static int str_exist_check_with_esc(OnigCodePoint s[], int n, UChar *from, + UChar *to, OnigCodePoint bad, + OnigEncoding enc, const OnigSyntaxType *syn) +{ + int i, in_esc; + OnigCodePoint x; + UChar *q; + UChar *p = from; + + in_esc = 0; + while (p < to) + { + if (in_esc) + { + in_esc = 0; + p += enclen(enc, p, to); + } + else + { + x = ONIGENC_MBC_TO_CODE(enc, p, to); + q = p + enclen(enc, p, to); + if (x == s[0]) + { + for (i = 1; i < n && q < to; i++) + { + x = ONIGENC_MBC_TO_CODE(enc, q, to); + if (x != s[i]) + break; + q += enclen(enc, q, to); + } + if (i >= n) + return 1; + p += enclen(enc, p, to); + } + else + { + x = ONIGENC_MBC_TO_CODE(enc, p, to); + if (x == bad) + return 0; + else if (x == MC_ESC(syn)) + in_esc = 1; + p = q; + } + } + } + return 0; +} + +static int fetch_token_in_cc(OnigToken *tok, UChar **src, UChar *end, + ScanEnv *env) +{ + int num; + OnigCodePoint c, c2; + const OnigSyntaxType *syn = env->syntax; + OnigEncoding enc = env->enc; + UChar *prev; + UChar *p = *src; + PFETCH_READY; + + if (PEND) + { + tok->type = TK_EOT; + return tok->type; + } + + PFETCH(c); + tok->type = TK_CHAR; + tok->base = 0; + tok->u.c = c; + tok->escaped = 0; + + if (c == ']') + { + tok->type = TK_CC_CLOSE; + } + else if (c == '-') + { + tok->type = TK_CC_RANGE; + } + else if (c == MC_ESC(syn)) + { + if (!IS_SYNTAX_BV(syn, ONIG_SYN_BACKSLASH_ESCAPE_IN_CC)) + goto end; + + if (PEND) + return ONIGERR_END_PATTERN_AT_ESCAPE; + + PFETCH(c); + tok->escaped = 1; + tok->u.c = c; + switch (c) + { + case 'w': + tok->type = TK_CHAR_TYPE; + tok->u.prop.ctype = ONIGENC_CTYPE_WORD; + tok->u.prop.not = 0; + break; + case 'W': + tok->type = TK_CHAR_TYPE; + tok->u.prop.ctype = ONIGENC_CTYPE_WORD; + tok->u.prop.not = 1; + break; + case 'd': + tok->type = TK_CHAR_TYPE; + tok->u.prop.ctype = ONIGENC_CTYPE_DIGIT; + tok->u.prop.not = 0; + break; + case 'D': + tok->type = TK_CHAR_TYPE; + tok->u.prop.ctype = ONIGENC_CTYPE_DIGIT; + tok->u.prop.not = 1; + break; + case 's': + tok->type = TK_CHAR_TYPE; + tok->u.prop.ctype = ONIGENC_CTYPE_SPACE; + tok->u.prop.not = 0; + break; + case 'S': + tok->type = TK_CHAR_TYPE; + tok->u.prop.ctype = ONIGENC_CTYPE_SPACE; + tok->u.prop.not = 1; + break; + case 'h': + if (!IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) + break; + tok->type = TK_CHAR_TYPE; + tok->u.prop.ctype = ONIGENC_CTYPE_XDIGIT; + tok->u.prop.not = 0; + break; + case 'H': + if (!IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) + break; + tok->type = TK_CHAR_TYPE; + tok->u.prop.ctype = ONIGENC_CTYPE_XDIGIT; + tok->u.prop.not = 1; + break; + + case 'p': + case 'P': + if (PEND) + break; + + c2 = PPEEK; + if (c2 == '{' + && IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY)) + { + PINC; + tok->type = TK_CHAR_PROPERTY; + tok->u.prop.not = (c == 'P' ? 1 : 0); + + if (!PEND + && IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT)) + { + PFETCH(c2); + if (c2 == '^') + { + tok->u.prop.not = (tok->u.prop.not== 0 ? 1 : 0); + } + else + PUNFETCH; + } + } + else + { + onig_syntax_warn(env, "invalid Unicode Property \\%c", c); + } + break; + + case 'x': + if (PEND) + break; + + prev = p; + if (PPEEK_IS('{') && IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_X_BRACE_HEX8)) + { + PINC; + num = scan_unsigned_hexadecimal_number(&p, end, 0, 8, enc); + if (num < 0) + return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE; + if (!PEND) + { + c2 = PPEEK; + if (ONIGENC_IS_CODE_XDIGIT(enc, c2)) + return ONIGERR_TOO_LONG_WIDE_CHAR_VALUE; + } + + if (p > prev + enclen(enc, prev, end) && !PEND && (PPEEK_IS('}'))) + { + PINC; + tok->type = TK_CODE_POINT; + tok->base = 16; + tok->u.code = (OnigCodePoint)num; + } + else + { + /* can't read nothing or invalid format */ + p = prev; + } + } + else if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_X_HEX2)) + { + num = scan_unsigned_hexadecimal_number(&p, end, 0, 2, enc); + if (num < 0) + return ONIGERR_TOO_BIG_NUMBER; + if (p == prev) + { /* can't read nothing. */ + num = 0; /* but, it's not error */ + } + tok->type = TK_RAW_BYTE; + tok->base = 16; + tok->u.c = num; + } + break; + + case 'u': + if (PEND) + break; + + prev = p; + if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_U_HEX4)) + { + num = scan_unsigned_hexadecimal_number(&p, end, 4, 4, enc); + if (num < -1) + return ONIGERR_TOO_SHORT_DIGITS; + else if (num < 0) + return ONIGERR_TOO_BIG_NUMBER; + if (p == prev) + { /* can't read nothing. */ + num = 0; /* but, it's not error */ + } + tok->type = TK_CODE_POINT; + tok->base = 16; + tok->u.code = (OnigCodePoint)num; + } + break; + + case 'o': + if (PEND) + break; + + prev = p; + if (PPEEK_IS('{') && IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_O_BRACE_OCTAL)) + { + PINC; + num = scan_unsigned_octal_number(&p, end, 11, enc); + if (num < 0) + return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE; + if (!PEND) + { + c2 = PPEEK; + if (ONIGENC_IS_CODE_DIGIT(enc, c2) && c2 < '8') + return ONIGERR_TOO_LONG_WIDE_CHAR_VALUE; + } + + if (p > prev + enclen(enc, prev, end) && !PEND && (PPEEK_IS('}'))) + { + PINC; + tok->type = TK_CODE_POINT; + tok->base = 8; + tok->u.code = (OnigCodePoint)num; + } + else + { + /* can't read nothing or invalid format */ + p = prev; + } + } + break; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_OCTAL3)) + { + PUNFETCH; + prev = p; + num = scan_unsigned_octal_number(&p, end, 3, enc); + if (num < 0 || 0xff < num) + return ONIGERR_TOO_BIG_NUMBER; + if (p == prev) + { /* can't read nothing. */ + num = 0; /* but, it's not error */ + } + tok->type = TK_RAW_BYTE; + tok->base = 8; + tok->u.c = num; + } + break; + + default: + PUNFETCH; + num = fetch_escaped_value(&p, end, env, &c2); + if (num < 0) + return num; + if ((OnigCodePoint)tok->u.c != c2) + { + tok->u.code = (OnigCodePoint)c2; + tok->type = TK_CODE_POINT; + } + break; + } + } + else if (c == '[') + { + if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_POSIX_BRACKET) && (PPEEK_IS(':'))) + { + OnigCodePoint send[] = {(OnigCodePoint)':', (OnigCodePoint)']'}; + tok->backp = p; /* point at '[' is read */ + PINC; + if (str_exist_check_with_esc(send, 2, p, end, (OnigCodePoint)']', enc, + syn)) + { + tok->type = TK_POSIX_BRACKET_OPEN; + } + else + { + PUNFETCH; + goto cc_in_cc; + } + } + else + { + cc_in_cc: + if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_CCLASS_SET_OP)) + { + tok->type = TK_CC_CC_OPEN; + } + else + { + CC_ESC_WARN(env, (UChar *)"["); + } + } + } + else if (c == '&') + { + if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_CCLASS_SET_OP) && !PEND + && (PPEEK_IS('&'))) + { + PINC; + tok->type = TK_CC_AND; + } + } + +end: + *src = p; + return tok->type; +} + +#ifdef USE_NAMED_GROUP +static int fetch_named_backref_token(OnigCodePoint c, OnigToken *tok, + UChar **src, UChar *end, ScanEnv *env) +{ + int r, num; + const OnigSyntaxType *syn = env->syntax; + UChar *prev; + UChar *p = *src; + UChar *name_end; + int *backs; + int back_num; + + prev = p; + +# ifdef USE_BACKREF_WITH_LEVEL + name_end = NULL_UCHARP; /* no need. escape gcc warning. */ + r = fetch_name_with_level(c, &p, end, &name_end, env, &back_num, + &tok->u.backref.level); + if (r == 1) + tok->u.backref.exist_level = 1; + else + tok->u.backref.exist_level = 0; +# else + r = fetch_name(&p, end, &name_end, env, &back_num, 1); +# endif + if (r < 0) + return r; + + if (back_num != 0) + { + if (back_num < 0) + { + back_num = BACKREF_REL_TO_ABS(back_num, env); + if (back_num <= 0) + return ONIGERR_INVALID_BACKREF; + } + + if (IS_SYNTAX_BV(syn, ONIG_SYN_STRICT_CHECK_BACKREF)) + { + if (back_num > env->num_mem || IS_NULL(SCANENV_MEM_NODES(env)[back_num])) + return ONIGERR_INVALID_BACKREF; + } + tok->type = TK_BACKREF; + tok->u.backref.by_name = 0; + tok->u.backref.num = 1; + tok->u.backref.ref1 = back_num; + } + else + { + num = onig_name_to_group_numbers(env->reg, prev, name_end, &backs); + if (num <= 0) + { + onig_scan_env_set_error_string(env, ONIGERR_UNDEFINED_NAME_REFERENCE, + prev, name_end); + return ONIGERR_UNDEFINED_NAME_REFERENCE; + } + if (IS_SYNTAX_BV(syn, ONIG_SYN_STRICT_CHECK_BACKREF)) + { + int i; + for (i = 0; i < num; i++) + { + if (backs[i] > env->num_mem + || IS_NULL(SCANENV_MEM_NODES(env)[backs[i]])) + return ONIGERR_INVALID_BACKREF; + } + } + + tok->type = TK_BACKREF; + tok->u.backref.by_name = 1; + if (num == 1 || IS_SYNTAX_BV(syn, ONIG_SYN_USE_LEFT_MOST_NAMED_GROUP)) + { + tok->u.backref.num = 1; + tok->u.backref.ref1 = backs[0]; + } + else + { + tok->u.backref.num = num; + tok->u.backref.refs = backs; + } + } + *src = p; + return 0; +} +#endif + +static int fetch_token(OnigToken *tok, UChar **src, UChar *end, ScanEnv *env) +{ + int r, num; + OnigCodePoint c; + OnigEncoding enc = env->enc; + const OnigSyntaxType *syn = env->syntax; + UChar *prev; + UChar *p = *src; + PFETCH_READY; + +start: + if (PEND) + { + tok->type = TK_EOT; + return tok->type; + } + + tok->type = TK_STRING; + tok->base = 0; + tok->backp = p; + + PFETCH(c); + if (IS_MC_ESC_CODE(c, syn)) + { + if (PEND) + return ONIGERR_END_PATTERN_AT_ESCAPE; + + tok->backp = p; + PFETCH(c); + + tok->u.c = c; + tok->escaped = 1; + switch (c) + { + case '*': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF)) + break; + tok->type = TK_OP_REPEAT; + tok->u.repeat.lower = 0; + tok->u.repeat.upper = REPEAT_INFINITE; + goto greedy_check; + break; + + case '+': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_PLUS_ONE_INF)) + break; + tok->type = TK_OP_REPEAT; + tok->u.repeat.lower = 1; + tok->u.repeat.upper = REPEAT_INFINITE; + goto greedy_check; + break; + + case '?': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_QMARK_ZERO_ONE)) + break; + tok->type = TK_OP_REPEAT; + tok->u.repeat.lower = 0; + tok->u.repeat.upper = 1; + greedy_check: + if (!PEND && PPEEK_IS('?') + && IS_SYNTAX_OP(syn, ONIG_SYN_OP_QMARK_NON_GREEDY)) + { + PFETCH(c); + tok->u.repeat.greedy = 0; + tok->u.repeat.possessive = 0; + } + else + { + possessive_check: + if (!PEND && PPEEK_IS('+') + && ((IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT) + && tok->type != TK_INTERVAL) + || (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL) + && tok->type == TK_INTERVAL))) + { + PFETCH(c); + tok->u.repeat.greedy = 1; + tok->u.repeat.possessive = 1; + } + else + { + tok->u.repeat.greedy = 1; + tok->u.repeat.possessive = 0; + } + } + break; + + case '{': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_BRACE_INTERVAL)) + break; + r = fetch_range_quantifier(&p, end, tok, env); + if (r < 0) + return r; /* error */ + if (r == 0) + goto greedy_check; + else if (r == 2) + { /* {n} */ + if (IS_SYNTAX_BV(syn, ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY)) + goto possessive_check; + + goto greedy_check; + } + /* r == 1 : normal char */ + break; + + case '|': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_VBAR_ALT)) + break; + tok->type = TK_ALT; + break; + + case '(': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_LPAREN_SUBEXP)) + break; + tok->type = TK_SUBEXP_OPEN; + break; + + case ')': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_LPAREN_SUBEXP)) + break; + tok->type = TK_SUBEXP_CLOSE; + break; + + case 'w': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_W_WORD)) + break; + tok->type = TK_CHAR_TYPE; + tok->u.prop.ctype = ONIGENC_CTYPE_WORD; + tok->u.prop.not = 0; + break; + + case 'W': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_W_WORD)) + break; + tok->type = TK_CHAR_TYPE; + tok->u.prop.ctype = ONIGENC_CTYPE_WORD; + tok->u.prop.not = 1; + break; + + case 'b': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_B_WORD_BOUND)) + break; + tok->type = TK_ANCHOR; + tok->u.anchor.subtype = ANCHOR_WORD_BOUND; + tok->u.anchor.ascii_range = IS_ASCII_RANGE(env->option) + && !IS_WORD_BOUND_ALL_RANGE(env->option); + break; + + case 'B': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_B_WORD_BOUND)) + break; + tok->type = TK_ANCHOR; + tok->u.anchor.subtype = ANCHOR_NOT_WORD_BOUND; + tok->u.anchor.ascii_range = IS_ASCII_RANGE(env->option) + && !IS_WORD_BOUND_ALL_RANGE(env->option); + break; + +#ifdef USE_WORD_BEGIN_END + case '<': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END)) + break; + tok->type = TK_ANCHOR; + tok->u.anchor.subtype = ANCHOR_WORD_BEGIN; + tok->u.anchor.ascii_range = IS_ASCII_RANGE(env->option); + break; + + case '>': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END)) + break; + tok->type = TK_ANCHOR; + tok->u.anchor.subtype = ANCHOR_WORD_END; + tok->u.anchor.ascii_range = IS_ASCII_RANGE(env->option); + break; +#endif + + case 's': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_S_WHITE_SPACE)) + break; + tok->type = TK_CHAR_TYPE; + tok->u.prop.ctype = ONIGENC_CTYPE_SPACE; + tok->u.prop.not = 0; + break; + + case 'S': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_S_WHITE_SPACE)) + break; + tok->type = TK_CHAR_TYPE; + tok->u.prop.ctype = ONIGENC_CTYPE_SPACE; + tok->u.prop.not = 1; + break; + + case 'd': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_D_DIGIT)) + break; + tok->type = TK_CHAR_TYPE; + tok->u.prop.ctype = ONIGENC_CTYPE_DIGIT; + tok->u.prop.not = 0; + break; + + case 'D': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_D_DIGIT)) + break; + tok->type = TK_CHAR_TYPE; + tok->u.prop.ctype = ONIGENC_CTYPE_DIGIT; + tok->u.prop.not = 1; + break; + + case 'h': + if (!IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) + break; + tok->type = TK_CHAR_TYPE; + tok->u.prop.ctype = ONIGENC_CTYPE_XDIGIT; + tok->u.prop.not = 0; + break; + + case 'H': + if (!IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) + break; + tok->type = TK_CHAR_TYPE; + tok->u.prop.ctype = ONIGENC_CTYPE_XDIGIT; + tok->u.prop.not = 1; + break; + + case 'A': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR)) + break; + begin_buf: + tok->type = TK_ANCHOR; + tok->u.anchor.subtype = ANCHOR_BEGIN_BUF; + break; + + case 'Z': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR)) + break; + tok->type = TK_ANCHOR; + tok->u.anchor.subtype = ANCHOR_SEMI_END_BUF; + break; + + case 'z': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR)) + break; + end_buf: + tok->type = TK_ANCHOR; + tok->u.anchor.subtype = ANCHOR_END_BUF; + break; + + case 'G': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR)) + break; + tok->type = TK_ANCHOR; + tok->u.anchor.subtype = ANCHOR_BEGIN_POSITION; + break; + + case '`': + if (!IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR)) + break; + goto begin_buf; + break; + + case '\'': + if (!IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR)) + break; + goto end_buf; + break; + + case 'x': + if (PEND) + break; + + prev = p; + if (PPEEK_IS('{') && IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_X_BRACE_HEX8)) + { + PINC; + num = scan_unsigned_hexadecimal_number(&p, end, 0, 8, enc); + if (num < 0) + return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE; + if (!PEND) + { + if (ONIGENC_IS_CODE_XDIGIT(enc, PPEEK)) + return ONIGERR_TOO_LONG_WIDE_CHAR_VALUE; + } + + if ((p > prev + enclen(enc, prev, end)) && !PEND && PPEEK_IS('}')) + { + PINC; + tok->type = TK_CODE_POINT; + tok->u.code = (OnigCodePoint)num; + } + else + { + /* can't read nothing or invalid format */ + p = prev; + } + } + else if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_X_HEX2)) + { + num = scan_unsigned_hexadecimal_number(&p, end, 0, 2, enc); + if (num < 0) + return ONIGERR_TOO_BIG_NUMBER; + if (p == prev) + { /* can't read nothing. */ + num = 0; /* but, it's not error */ + } + tok->type = TK_RAW_BYTE; + tok->base = 16; + tok->u.c = num; + } + break; + + case 'u': + if (PEND) + break; + + prev = p; + if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_U_HEX4)) + { + num = scan_unsigned_hexadecimal_number(&p, end, 4, 4, enc); + if (num < -1) + return ONIGERR_TOO_SHORT_DIGITS; + else if (num < 0) + return ONIGERR_TOO_BIG_NUMBER; + if (p == prev) + { /* can't read nothing. */ + num = 0; /* but, it's not error */ + } + tok->type = TK_CODE_POINT; + tok->base = 16; + tok->u.code = (OnigCodePoint)num; + } + break; + + case 'o': + if (PEND) + break; + + prev = p; + if (PPEEK_IS('{') && IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_O_BRACE_OCTAL)) + { + PINC; + num = scan_unsigned_octal_number(&p, end, 11, enc); + if (num < 0) + return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE; + if (!PEND) + { + OnigCodePoint c = PPEEK; + if (ONIGENC_IS_CODE_DIGIT(enc, c) && c < '8') + return ONIGERR_TOO_LONG_WIDE_CHAR_VALUE; + } + + if ((p > prev + enclen(enc, prev, end)) && !PEND && PPEEK_IS('}')) + { + PINC; + tok->type = TK_CODE_POINT; + tok->u.code = (OnigCodePoint)num; + } + else + { + /* can't read nothing or invalid format */ + p = prev; + } + } + break; + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + PUNFETCH; + prev = p; + num = onig_scan_unsigned_number(&p, end, enc); + if (num < 0 || num > ONIG_MAX_BACKREF_NUM) + { + goto skip_backref; + } + + if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_DECIMAL_BACKREF) + && (num <= env->num_mem || num <= 9)) + { /* This spec. from GNU regex */ + if (IS_SYNTAX_BV(syn, ONIG_SYN_STRICT_CHECK_BACKREF)) + { + if (num > env->num_mem || IS_NULL(SCANENV_MEM_NODES(env)[num])) + return ONIGERR_INVALID_BACKREF; + } + + tok->type = TK_BACKREF; + tok->u.backref.num = 1; + tok->u.backref.ref1 = num; + tok->u.backref.by_name = 0; +#ifdef USE_BACKREF_WITH_LEVEL + tok->u.backref.exist_level = 0; +#endif + break; + } + + skip_backref: + if (c == '8' || c == '9') + { + /* normal char */ + p = prev; + PINC; + break; + } + + p = prev; + /* fall through */ + case '0': + if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_OCTAL3)) + { + prev = p; + num = scan_unsigned_octal_number(&p, end, (c == '0' ? 2 : 3), enc); + if (num < 0) + return ONIGERR_TOO_BIG_NUMBER; + if (p == prev) + { /* can't read nothing. */ + num = 0; /* but, it's not error */ + } + tok->type = TK_RAW_BYTE; + tok->base = 8; + tok->u.c = num; + } + else if (c != '0') + { + PINC; + } + break; + +#ifdef USE_NAMED_GROUP + case 'k': + if (!PEND && IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_K_NAMED_BACKREF)) + { + PFETCH(c); + if (c == '<' || c == '\'') + { + r = fetch_named_backref_token(c, tok, &p, end, env); + if (r < 0) + return r; + } + else + { + PUNFETCH; + onig_syntax_warn(env, "invalid back reference"); + } + } + break; +#endif + +#if defined(USE_SUBEXP_CALL) || defined(USE_NAMED_GROUP) + case 'g': +# ifdef USE_NAMED_GROUP + if (!PEND && IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_G_BRACE_BACKREF)) + { + PFETCH(c); + if (c == '{') + { + r = fetch_named_backref_token(c, tok, &p, end, env); + if (r < 0) + return r; + } + else + PUNFETCH; + } +# endif +# ifdef USE_SUBEXP_CALL + if (!PEND && IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_G_SUBEXP_CALL)) + { + PFETCH(c); + if (c == '<' || c == '\'') + { + int gnum = -1, rel = 0; + UChar *name_end; + OnigCodePoint cnext; + + cnext = PPEEK; + if (cnext == '0') + { + PINC; + if (PPEEK_IS(get_name_end_code_point(c))) + { /* \g<0>, \g'0' */ + PINC; + name_end = p; + gnum = 0; + } + } + else if (cnext == '+') + { + PINC; + rel = 1; + } + prev = p; + if (gnum < 0) + { + r = fetch_name((OnigCodePoint)c, &p, end, &name_end, env, &gnum, + 1); + if (r < 0) + return r; + } + + tok->type = TK_CALL; + tok->u.call.name = prev; + tok->u.call.name_end = name_end; + tok->u.call.gnum = gnum; + tok->u.call.rel = rel; + } + else + { + onig_syntax_warn(env, "invalid subexp call"); + PUNFETCH; + } + } +# endif + break; +#endif + + case 'Q': + if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE)) + { + tok->type = TK_QUOTE_OPEN; + } + break; + + case 'p': + case 'P': + if (PPEEK_IS('{') + && IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY)) + { + PINC; + tok->type = TK_CHAR_PROPERTY; + tok->u.prop.not = (c == 'P' ? 1 : 0); + + if (!PEND + && IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT)) + { + PFETCH(c); + if (c == '^') + { + tok->u.prop.not = (tok->u.prop.not== 0 ? 1 : 0); + } + else + PUNFETCH; + } + } + else + { + onig_syntax_warn(env, "invalid Unicode Property \\%c", c); + } + break; + + case 'R': + if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_CAPITAL_R_LINEBREAK)) + { + tok->type = TK_LINEBREAK; + } + break; + + case 'X': + if (IS_SYNTAX_OP2(syn, + ONIG_SYN_OP2_ESC_CAPITAL_X_EXTENDED_GRAPHEME_CLUSTER)) + { + tok->type = TK_EXTENDED_GRAPHEME_CLUSTER; + } + break; + + case 'K': + if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP)) + { + tok->type = TK_KEEP; + } + break; + + default: { + OnigCodePoint c2; + + PUNFETCH; + num = fetch_escaped_value(&p, end, env, &c2); + if (num < 0) + return num; + /* set_raw: */ + if ((OnigCodePoint)tok->u.c != c2) + { + tok->type = TK_CODE_POINT; + tok->u.code = (OnigCodePoint)c2; + } + else + { /* string */ + p = tok->backp + enclen(enc, tok->backp, end); + } + } + break; + } + } + else + { + tok->u.c = c; + tok->escaped = 0; + +#ifdef USE_VARIABLE_META_CHARS + if ((c != ONIG_INEFFECTIVE_META_CHAR) + && IS_SYNTAX_OP(syn, ONIG_SYN_OP_VARIABLE_META_CHARACTERS)) + { + if (c == MC_ANYCHAR(syn)) + goto any_char; + else if (c == MC_ANYTIME(syn)) + goto anytime; + else if (c == MC_ZERO_OR_ONE_TIME(syn)) + goto zero_or_one_time; + else if (c == MC_ONE_OR_MORE_TIME(syn)) + goto one_or_more_time; + else if (c == MC_ANYCHAR_ANYTIME(syn)) + { + tok->type = TK_ANYCHAR_ANYTIME; + goto out; + } + } +#endif + + switch (c) + { + case '.': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_DOT_ANYCHAR)) + break; +#ifdef USE_VARIABLE_META_CHARS + any_char: +#endif + tok->type = TK_ANYCHAR; + break; + + case '*': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_ASTERISK_ZERO_INF)) + break; +#ifdef USE_VARIABLE_META_CHARS + anytime: +#endif + tok->type = TK_OP_REPEAT; + tok->u.repeat.lower = 0; + tok->u.repeat.upper = REPEAT_INFINITE; + goto greedy_check; + break; + + case '+': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_PLUS_ONE_INF)) + break; +#ifdef USE_VARIABLE_META_CHARS + one_or_more_time: +#endif + tok->type = TK_OP_REPEAT; + tok->u.repeat.lower = 1; + tok->u.repeat.upper = REPEAT_INFINITE; + goto greedy_check; + break; + + case '?': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_QMARK_ZERO_ONE)) + break; +#ifdef USE_VARIABLE_META_CHARS + zero_or_one_time: +#endif + tok->type = TK_OP_REPEAT; + tok->u.repeat.lower = 0; + tok->u.repeat.upper = 1; + goto greedy_check; + break; + + case '{': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_BRACE_INTERVAL)) + break; + r = fetch_range_quantifier(&p, end, tok, env); + if (r < 0) + return r; /* error */ + if (r == 0) + goto greedy_check; + else if (r == 2) + { /* {n} */ + if (IS_SYNTAX_BV(syn, ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY)) + goto possessive_check; + + goto greedy_check; + } + /* r == 1 : normal char */ + break; + + case '|': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_VBAR_ALT)) + break; + tok->type = TK_ALT; + break; + + case '(': + if (PPEEK_IS('?') + && IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_QMARK_GROUP_EFFECT)) + { + PINC; + if (PPEEK_IS('#')) + { + PFETCH(c); + while (1) + { + if (PEND) + return ONIGERR_END_PATTERN_IN_GROUP; + PFETCH(c); + if (c == MC_ESC(syn)) + { + if (!PEND) + PFETCH(c); + } + else + { + if (c == ')') + break; + } + } + goto start; + } +#ifdef USE_PERL_SUBEXP_CALL + /* (?&name), (?n), (?R), (?0), (?+n), (?-n) */ + c = PPEEK; + if ((c == '&' || c == 'R' || ONIGENC_IS_CODE_DIGIT(enc, c)) + && IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_SUBEXP_CALL)) + { + /* (?&name), (?n), (?R), (?0) */ + int gnum; + UChar *name; + UChar *name_end; + + if (c == 'R' || c == '0') + { + PINC; /* skip 'R' / '0' */ + if (!PPEEK_IS(')')) + return ONIGERR_INVALID_GROUP_NAME; + PINC; /* skip ')' */ + name_end = name = p; + gnum = 0; + } + else + { + int numref = 1; + if (c == '&') + { /* (?&name) */ + PINC; + numref = 0; /* don't allow number name */ + } + name = p; + r = fetch_name((OnigCodePoint)'(', &p, end, &name_end, env, &gnum, + numref); + if (r < 0) + return r; + } + + tok->type = TK_CALL; + tok->u.call.name = name; + tok->u.call.name_end = name_end; + tok->u.call.gnum = gnum; + tok->u.call.rel = 0; + break; + } + else if ((c == '-' || c == '+') + && IS_SYNTAX_OP2(env->syntax, + ONIG_SYN_OP2_QMARK_SUBEXP_CALL)) + { + /* (?+n), (?-n) */ + int gnum; + UChar *name; + UChar *name_end; + OnigCodePoint cnext; + PFETCH_READY; + + PINC; /* skip '-' / '+' */ + cnext = PPEEK; + if (ONIGENC_IS_CODE_DIGIT(enc, cnext)) + { + if (c == '-') + PUNFETCH; + name = p; + r = fetch_name((OnigCodePoint)'(', &p, end, &name_end, env, &gnum, + 1); + if (r < 0) + return r; + + tok->type = TK_CALL; + tok->u.call.name = name; + tok->u.call.name_end = name_end; + tok->u.call.gnum = gnum; + tok->u.call.rel = 1; + break; + } + } +#endif /* USE_PERL_SUBEXP_CALL */ +#ifdef USE_CAPITAL_P_NAMED_GROUP + if (PPEEK_IS('P') + && IS_SYNTAX_OP2(env->syntax, + ONIG_SYN_OP2_QMARK_CAPITAL_P_NAMED_GROUP)) + { + int gnum; + UChar *name; + UChar *name_end; + PFETCH_READY; + + PINC; /* skip 'P' */ + if (PEND) + return ONIGERR_UNDEFINED_GROUP_OPTION; + PFETCH(c); + if (c == '=') + { /* (?P=name): backref */ + r = fetch_named_backref_token((OnigCodePoint)'(', tok, &p, end, + env); + if (r < 0) + return r; + break; + } + else if (c == '>') + { /* (?P>name): subexp call */ + name = p; + r = fetch_name((OnigCodePoint)'(', &p, end, &name_end, env, &gnum, + 0); + if (r < 0) + return r; + + tok->type = TK_CALL; + tok->u.call.name = name; + tok->u.call.name_end = name_end; + tok->u.call.gnum = gnum; + tok->u.call.rel = 0; + break; + } + } +#endif /* USE_CAPITAL_P_NAMED_GROUP */ + PUNFETCH; + } + + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_LPAREN_SUBEXP)) + break; + tok->type = TK_SUBEXP_OPEN; + break; + + case ')': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_LPAREN_SUBEXP)) + break; + tok->type = TK_SUBEXP_CLOSE; + break; + + case '^': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_LINE_ANCHOR)) + break; + tok->type = TK_ANCHOR; + tok->u.anchor.subtype + = (IS_SINGLELINE(env->option) ? ANCHOR_BEGIN_BUF + : ANCHOR_BEGIN_LINE); + break; + + case '$': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_LINE_ANCHOR)) + break; + tok->type = TK_ANCHOR; + tok->u.anchor.subtype + = (IS_SINGLELINE(env->option) ? ANCHOR_SEMI_END_BUF + : ANCHOR_END_LINE); + break; + + case '[': + if (!IS_SYNTAX_OP(syn, ONIG_SYN_OP_BRACKET_CC)) + break; + tok->type = TK_CC_OPEN; + break; + + case ']': + if (*src > env->pattern) /* /].../ is allowed. */ + CLOSE_BRACKET_WITHOUT_ESC_WARN(env, (UChar *)"]"); + break; + + case '#': + if (IS_EXTEND(env->option)) + { + while (!PEND) + { + PFETCH(c); + if (ONIGENC_IS_CODE_NEWLINE(enc, c)) + break; + } + goto start; + break; + } + break; + + case ' ': + case '\t': + case '\n': + case '\r': + case '\f': + if (IS_EXTEND(env->option)) + goto start; + break; + + default: + /* string */ + break; + } + } + +#ifdef USE_VARIABLE_META_CHARS +out: +#endif + *src = p; + return tok->type; +} + +static int add_ctype_to_cc_by_range(CClassNode *cc, int ctype ARG_UNUSED, + int not, ScanEnv *env, OnigCodePoint sb_out, + const OnigCodePoint mbr[]) +{ + int i, r; + OnigCodePoint j; + + int n = ONIGENC_CODE_RANGE_NUM(mbr); + + if (not== 0) + { + for (i = 0; i < n; i++) + { + for (j = ONIGENC_CODE_RANGE_FROM(mbr, i); + j <= ONIGENC_CODE_RANGE_TO(mbr, i); j++) + { + if (j >= sb_out) + { + if (j > ONIGENC_CODE_RANGE_FROM(mbr, i)) + { + r = add_code_range_to_buf(&(cc->mbuf), env, j, + ONIGENC_CODE_RANGE_TO(mbr, i)); + if (r != 0) + return r; + i++; + } + + goto sb_end; + } + BITSET_SET_BIT_CHKDUP(cc->bs, j); + } + } + + sb_end: + for (; i < n; i++) + { + r = add_code_range_to_buf(&(cc->mbuf), env, + ONIGENC_CODE_RANGE_FROM(mbr, i), + ONIGENC_CODE_RANGE_TO(mbr, i)); + if (r != 0) + return r; + } + } + else + { + OnigCodePoint prev = 0; + + for (i = 0; i < n; i++) + { + for (j = prev; j < ONIGENC_CODE_RANGE_FROM(mbr, i); j++) + { + if (j >= sb_out) + { + goto sb_end2; + } + BITSET_SET_BIT_CHKDUP(cc->bs, j); + } + prev = ONIGENC_CODE_RANGE_TO(mbr, i) + 1; + } + for (j = prev; j < sb_out; j++) + { + BITSET_SET_BIT_CHKDUP(cc->bs, j); + } + + sb_end2: + prev = sb_out; + + for (i = 0; i < n; i++) + { + if (prev < ONIGENC_CODE_RANGE_FROM(mbr, i)) + { + r = add_code_range_to_buf(&(cc->mbuf), env, prev, + ONIGENC_CODE_RANGE_FROM(mbr, i) - 1); + if (r != 0) + return r; + } + prev = ONIGENC_CODE_RANGE_TO(mbr, i) + 1; + } + if (prev < 0x7fffffff) + { + r = add_code_range_to_buf(&(cc->mbuf), env, prev, 0x7fffffff); + if (r != 0) + return r; + } + } + + return 0; +} + +static int add_ctype_to_cc(CClassNode *cc, int ctype, int not, int ascii_range, + ScanEnv *env) +{ + int maxcode; + int c, r; + const OnigCodePoint *ranges; + OnigCodePoint sb_out; + OnigEncoding enc = env->enc; + + r = ONIGENC_GET_CTYPE_CODE_RANGE(enc, ctype, &sb_out, &ranges); + if (r == 0) + { + if (ascii_range) + { + CClassNode ccwork; + initialize_cclass(&ccwork); + r = add_ctype_to_cc_by_range(&ccwork, ctype, not, env, sb_out, ranges); + if (r == 0) + { + if (not) + { + r = add_code_range_to_buf0(&(ccwork.mbuf), env, 0x80, + ONIG_LAST_CODE_POINT, FALSE); + } + else + { + CClassNode ccascii; + initialize_cclass(&ccascii); + if (ONIGENC_MBC_MINLEN(env->enc) > 1) + { + r = add_code_range(&(ccascii.mbuf), env, 0x00, 0x7F); + } + else + { + bitset_set_range(env, ccascii.bs, 0x00, 0x7F); + r = 0; + } + if (r == 0) + { + r = and_cclass(&ccwork, &ccascii, env); + } + if (IS_NOT_NULL(ccascii.mbuf)) + bbuf_free(ccascii.mbuf); + } + if (r == 0) + { + r = or_cclass(cc, &ccwork, env); + } + if (IS_NOT_NULL(ccwork.mbuf)) + bbuf_free(ccwork.mbuf); + } + } + else + { + r = add_ctype_to_cc_by_range(cc, ctype, not, env, sb_out, ranges); + } + return r; + } + else if (r != ONIG_NO_SUPPORT_CONFIG) + { + return r; + } + + maxcode = ascii_range ? 0x80 : SINGLE_BYTE_SIZE; + r = 0; + switch (ctype) + { + case ONIGENC_CTYPE_ALPHA: + case ONIGENC_CTYPE_BLANK: + case ONIGENC_CTYPE_CNTRL: + case ONIGENC_CTYPE_DIGIT: + case ONIGENC_CTYPE_LOWER: + case ONIGENC_CTYPE_PUNCT: + case ONIGENC_CTYPE_SPACE: + case ONIGENC_CTYPE_UPPER: + case ONIGENC_CTYPE_XDIGIT: + case ONIGENC_CTYPE_ASCII: + case ONIGENC_CTYPE_ALNUM: + if (not!= 0) + { + for (c = 0; c < SINGLE_BYTE_SIZE; c++) + { + if (!ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint)c, ctype)) + BITSET_SET_BIT_CHKDUP(cc->bs, c); + } + ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf); + } + else + { + for (c = 0; c < SINGLE_BYTE_SIZE; c++) + { + if (ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint)c, ctype)) + BITSET_SET_BIT_CHKDUP(cc->bs, c); + } + } + break; + + case ONIGENC_CTYPE_GRAPH: + case ONIGENC_CTYPE_PRINT: + if (not!= 0) + { + for (c = 0; c < SINGLE_BYTE_SIZE; c++) + { + if (!ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint)c, ctype) + || c >= maxcode) + BITSET_SET_BIT_CHKDUP(cc->bs, c); + } + if (ascii_range) + ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf); + } + else + { + for (c = 0; c < maxcode; c++) + { + if (ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint)c, ctype)) + BITSET_SET_BIT_CHKDUP(cc->bs, c); + } + if (!ascii_range) + ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf); + } + break; + + case ONIGENC_CTYPE_WORD: + if (not== 0) + { + for (c = 0; c < maxcode; c++) + { + if (ONIGENC_IS_CODE_WORD(enc, c)) + BITSET_SET_BIT_CHKDUP(cc->bs, c); + } + if (!ascii_range) + ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf); + } + else + { + for (c = 0; c < SINGLE_BYTE_SIZE; c++) + { + if ((ONIGENC_CODE_TO_MBCLEN(enc, c) + > 0) /* check invalid code point */ + && (!ONIGENC_IS_CODE_WORD(enc, c) || c >= maxcode)) + BITSET_SET_BIT_CHKDUP(cc->bs, c); + } + if (ascii_range) + ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf); + } + break; + + default: + return ONIGERR_PARSER_BUG; + break; + } + + return r; +} + +static int parse_posix_bracket(CClassNode *cc, CClassNode *asc_cc, UChar **src, + UChar *end, ScanEnv *env) +{ +#define POSIX_BRACKET_CHECK_LIMIT_LENGTH 20 +#define POSIX_BRACKET_NAME_MIN_LEN 4 + + static const PosixBracketEntryType PBS[] = { + POSIX_BRACKET_ENTRY_INIT("alnum", ONIGENC_CTYPE_ALNUM), + POSIX_BRACKET_ENTRY_INIT("alpha", ONIGENC_CTYPE_ALPHA), + POSIX_BRACKET_ENTRY_INIT("blank", ONIGENC_CTYPE_BLANK), + POSIX_BRACKET_ENTRY_INIT("cntrl", ONIGENC_CTYPE_CNTRL), + POSIX_BRACKET_ENTRY_INIT("digit", ONIGENC_CTYPE_DIGIT), + POSIX_BRACKET_ENTRY_INIT("graph", ONIGENC_CTYPE_GRAPH), + POSIX_BRACKET_ENTRY_INIT("lower", ONIGENC_CTYPE_LOWER), + POSIX_BRACKET_ENTRY_INIT("print", ONIGENC_CTYPE_PRINT), + POSIX_BRACKET_ENTRY_INIT("punct", ONIGENC_CTYPE_PUNCT), + POSIX_BRACKET_ENTRY_INIT("space", ONIGENC_CTYPE_SPACE), + POSIX_BRACKET_ENTRY_INIT("upper", ONIGENC_CTYPE_UPPER), + POSIX_BRACKET_ENTRY_INIT("xdigit", ONIGENC_CTYPE_XDIGIT), + POSIX_BRACKET_ENTRY_INIT("ascii", ONIGENC_CTYPE_ASCII), + POSIX_BRACKET_ENTRY_INIT("word", ONIGENC_CTYPE_WORD), + }; + + const PosixBracketEntryType *pb; + int not, i, r; + int ascii_range; + OnigCodePoint c; + OnigEncoding enc = env->enc; + UChar *p = *src; + + if (PPEEK_IS('^')) + { + PINC_S; + not = 1; + } + else + not = 0; + + if (onigenc_strlen(enc, p, end) < POSIX_BRACKET_NAME_MIN_LEN + 3) + goto not_posix_bracket; + + ascii_range + = IS_ASCII_RANGE(env->option) && !IS_POSIX_BRACKET_ALL_RANGE(env->option); + for (pb = PBS; pb < PBS + numberof(PBS); pb++) + { + if (onigenc_with_ascii_strncmp(enc, p, end, pb->name, pb->len) == 0) + { + p = (UChar *)onigenc_step(enc, p, end, pb->len); + if (onigenc_with_ascii_strncmp(enc, p, end, (UChar *)":]", 2) != 0) + return ONIGERR_INVALID_POSIX_BRACKET_TYPE; + + r = add_ctype_to_cc(cc, pb->ctype, not, ascii_range, env); + if (r != 0) + return r; + + if (IS_NOT_NULL(asc_cc)) + { + if (pb->ctype != ONIGENC_CTYPE_WORD && pb->ctype != ONIGENC_CTYPE_ASCII + && !ascii_range) + r = add_ctype_to_cc(asc_cc, pb->ctype, not, ascii_range, env); + if (r != 0) + return r; + } + + PINC_S; + PINC_S; + *src = p; + return 0; + } + } + +not_posix_bracket: + c = 0; + i = 0; + while (!PEND && ((c = PPEEK) != ':') && c != ']') + { + PINC_S; + if (++i > POSIX_BRACKET_CHECK_LIMIT_LENGTH) + break; + } + if (c == ':' && !PEND) + { + PINC_S; + if (!PEND) + { + PFETCH_S(c); + if (c == ']') + return ONIGERR_INVALID_POSIX_BRACKET_TYPE; + } + } + + return 1; /* 1: is not POSIX bracket, but no error. */ +} + +static int fetch_char_property_to_ctype(UChar **src, UChar *end, ScanEnv *env) +{ + int r; + OnigCodePoint c; + OnigEncoding enc = env->enc; + UChar *prev, *start, *p = *src; + + r = 0; + start = prev = p; + + while (!PEND) + { + prev = p; + PFETCH_S(c); + if (c == '}') + { + r = ONIGENC_PROPERTY_NAME_TO_CTYPE(enc, start, prev); + if (r < 0) + break; + + *src = p; + return r; + } + else if (c == '(' || c == ')' || c == '{' || c == '|') + { + r = ONIGERR_INVALID_CHAR_PROPERTY_NAME; + break; + } + } + + onig_scan_env_set_error_string(env, r, *src, prev); + return r; +} + +static int cclass_case_fold(Node **np, CClassNode *cc, CClassNode *asc_cc, + ScanEnv *env); + +static int parse_char_property(Node **np, OnigToken *tok, UChar **src, + UChar *end, ScanEnv *env) +{ + int r, ctype; + CClassNode *cc; + + ctype = fetch_char_property_to_ctype(src, end, env); + if (ctype < 0) + return ctype; + + *np = node_new_cclass(); + CHECK_NULL_RETURN_MEMERR(*np); + cc = NCCLASS(*np); + r = add_ctype_to_cc(cc, ctype, 0, 0, env); + if (r != 0) + return r; + if (tok->u.prop.not!= 0) + NCCLASS_SET_NOT(cc); + + if (IS_IGNORECASE(env->option)) + { + if (ctype != ONIGENC_CTYPE_ASCII) + r = cclass_case_fold(np, cc, cc, env); + } + return r; +} + +enum CCSTATE +{ + CCS_VALUE, + CCS_RANGE, + CCS_COMPLETE, + CCS_START +}; + +enum CCVALTYPE +{ + CCV_SB, + CCV_CODE_POINT, + CCV_CLASS +}; + +static int next_state_class(CClassNode *cc, CClassNode *asc_cc, + OnigCodePoint *vs, enum CCVALTYPE *type, + enum CCSTATE *state, ScanEnv *env) +{ + int r; + + if (*state == CCS_RANGE) + return ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE; + + if (*state == CCS_VALUE && *type != CCV_CLASS) + { + if (*type == CCV_SB) + { + BITSET_SET_BIT_CHKDUP(cc->bs, (int)(*vs)); + if (IS_NOT_NULL(asc_cc)) + BITSET_SET_BIT(asc_cc->bs, (int)(*vs)); + } + else if (*type == CCV_CODE_POINT) + { + r = add_code_range(&(cc->mbuf), env, *vs, *vs); + if (r < 0) + return r; + if (IS_NOT_NULL(asc_cc)) + { + r = add_code_range0(&(asc_cc->mbuf), env, *vs, *vs, 0); + if (r < 0) + return r; + } + } + } + + *state = CCS_VALUE; + *type = CCV_CLASS; + return 0; +} + +static int next_state_val(CClassNode *cc, CClassNode *asc_cc, OnigCodePoint *vs, + OnigCodePoint v, int *vs_israw, int v_israw, + enum CCVALTYPE intype, enum CCVALTYPE *type, + enum CCSTATE *state, ScanEnv *env) +{ + int r; + + switch (*state) + { + case CCS_VALUE: + if (*type == CCV_SB) + { + BITSET_SET_BIT_CHKDUP(cc->bs, (int)(*vs)); + if (IS_NOT_NULL(asc_cc)) + BITSET_SET_BIT(asc_cc->bs, (int)(*vs)); + } + else if (*type == CCV_CODE_POINT) + { + r = add_code_range(&(cc->mbuf), env, *vs, *vs); + if (r < 0) + return r; + if (IS_NOT_NULL(asc_cc)) + { + r = add_code_range0(&(asc_cc->mbuf), env, *vs, *vs, 0); + if (r < 0) + return r; + } + } + break; + + case CCS_RANGE: + if (intype == *type) + { + if (intype == CCV_SB) + { + if (*vs > 0xff || v > 0xff) + return ONIGERR_INVALID_CODE_POINT_VALUE; + + if (*vs > v) + { + if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC)) + goto ccs_range_end; + else + return ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS; + } + bitset_set_range(env, cc->bs, (int)*vs, (int)v); + if (IS_NOT_NULL(asc_cc)) + bitset_set_range(env, asc_cc->bs, (int)*vs, (int)v); + } + else + { + r = add_code_range(&(cc->mbuf), env, *vs, v); + if (r < 0) + return r; + if (IS_NOT_NULL(asc_cc)) + { + r = add_code_range0(&(asc_cc->mbuf), env, *vs, v, 0); + if (r < 0) + return r; + } + } + } + else + { +#if 0 + if (intype == CCV_CODE_POINT && *type == CCV_SB) { +#endif + if (*vs > v) + { + if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC)) + goto ccs_range_end; + else + return ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS; + } + bitset_set_range(env, cc->bs, (int)*vs, (int)(v < 0xff ? v : 0xff)); + r = add_code_range(&(cc->mbuf), env, (OnigCodePoint)*vs, v); + if (r < 0) + return r; + if (IS_NOT_NULL(asc_cc)) + { + bitset_set_range(env, asc_cc->bs, (int)*vs, + (int)(v < 0xff ? v : 0xff)); + r = add_code_range0(&(asc_cc->mbuf), env, (OnigCodePoint)*vs, v, 0); + if (r < 0) + return r; + } +#if 0 + } + else + return ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE; +#endif + } + ccs_range_end: + *state = CCS_COMPLETE; + break; + + case CCS_COMPLETE: + case CCS_START: + *state = CCS_VALUE; + break; + + default: + break; + } + + *vs_israw = v_israw; + *vs = v; + *type = intype; + return 0; +} + +static int code_exist_check(OnigCodePoint c, UChar *from, UChar *end, + int ignore_escaped, ScanEnv *env) +{ + int in_esc; + OnigCodePoint code; + OnigEncoding enc = env->enc; + UChar *p = from; + + in_esc = 0; + while (!PEND) + { + if (ignore_escaped && in_esc) + { + in_esc = 0; + } + else + { + PFETCH_S(code); + if (code == c) + return 1; + if (code == MC_ESC(env->syntax)) + in_esc = 1; + } + } + return 0; +} + +static int parse_char_class(Node **np, Node **asc_np, OnigToken *tok, + UChar **src, UChar *end, ScanEnv *env) +{ + int r, neg, len, fetched, and_start; + OnigCodePoint v, vs; + UChar *p; + Node *node; + Node *asc_node; + CClassNode *cc, *prev_cc; + CClassNode *asc_cc, *asc_prev_cc; + CClassNode work_cc, asc_work_cc; + + enum CCSTATE state; + enum CCVALTYPE val_type, in_type; + int val_israw, in_israw; + + *np = *asc_np = NULL_NODE; + env->parse_depth++; + if (env->parse_depth > ParseDepthLimit) + return ONIGERR_PARSE_DEPTH_LIMIT_OVER; + prev_cc = asc_prev_cc = (CClassNode *)NULL; + r = fetch_token_in_cc(tok, src, end, env); + if (r == TK_CHAR && tok->u.c == '^' && tok->escaped == 0) + { + neg = 1; + r = fetch_token_in_cc(tok, src, end, env); + } + else + { + neg = 0; + } + + if (r < 0) + return r; + if (r == TK_CC_CLOSE) + { + if (!code_exist_check((OnigCodePoint)']', *src, env->pattern_end, 1, env)) + return ONIGERR_EMPTY_CHAR_CLASS; + + CC_ESC_WARN(env, (UChar *)"]"); + r = tok->type = TK_CHAR; /* allow []...] */ + } + + *np = node = node_new_cclass(); + CHECK_NULL_RETURN_MEMERR(node); + cc = NCCLASS(node); + + if (IS_IGNORECASE(env->option)) + { + *asc_np = asc_node = node_new_cclass(); + CHECK_NULL_RETURN_MEMERR(asc_node); + asc_cc = NCCLASS(asc_node); + } + else + { + asc_node = NULL_NODE; + asc_cc = NULL; + } + + and_start = 0; + state = CCS_START; + p = *src; + while (r != TK_CC_CLOSE) + { + fetched = 0; + switch (r) + { + case TK_CHAR: + if ((tok->u.code >= SINGLE_BYTE_SIZE) + || (len = ONIGENC_CODE_TO_MBCLEN(env->enc, tok->u.c)) > 1) + { + in_type = CCV_CODE_POINT; + } + else if (len < 0) + { + r = len; + goto err; + } + else + { + sb_char: + in_type = CCV_SB; + } + v = (OnigCodePoint)tok->u.c; + in_israw = 0; + goto val_entry2; + break; + + case TK_RAW_BYTE: + /* tok->base != 0 : octal or hexadec. */ + if (!ONIGENC_IS_SINGLEBYTE(env->enc) && tok->base != 0) + { + UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN]; + UChar *bufe = buf + ONIGENC_CODE_TO_MBC_MAXLEN; + UChar *psave = p; + int i, base = tok->base; + + buf[0] = (UChar)tok->u.c; + for (i = 1; i < ONIGENC_MBC_MAXLEN(env->enc); i++) + { + r = fetch_token_in_cc(tok, &p, end, env); + if (r < 0) + goto err; + if (r != TK_RAW_BYTE || tok->base != base) + { + fetched = 1; + break; + } + buf[i] = (UChar)tok->u.c; + } + + if (i < ONIGENC_MBC_MINLEN(env->enc)) + { + r = ONIGERR_TOO_SHORT_MULTI_BYTE_STRING; + goto err; + } + + len = enclen(env->enc, buf, buf + i); + if (i < len) + { + r = ONIGERR_TOO_SHORT_MULTI_BYTE_STRING; + goto err; + } + else if (i > len) + { /* fetch back */ + p = psave; + for (i = 1; i < len; i++) + { + (void)fetch_token_in_cc(tok, &p, end, env); + /* no need to check the retun value (already checked above) */ + } + fetched = 0; + } + + if (i == 1) + { + v = (OnigCodePoint)buf[0]; + goto raw_single; + } + else + { + v = ONIGENC_MBC_TO_CODE(env->enc, buf, bufe); + in_type = CCV_CODE_POINT; + } + } + else + { + v = (OnigCodePoint)tok->u.c; + raw_single: + in_type = CCV_SB; + } + in_israw = 1; + goto val_entry2; + break; + + case TK_CODE_POINT: + v = tok->u.code; + in_israw = 1; + val_entry: + len = ONIGENC_CODE_TO_MBCLEN(env->enc, v); + if (len < 0) + { + r = len; + goto err; + } + in_type = (len == 1 ? CCV_SB : CCV_CODE_POINT); + val_entry2: + r = next_state_val(cc, asc_cc, &vs, v, &val_israw, in_israw, in_type, + &val_type, &state, env); + if (r != 0) + goto err; + break; + + case TK_POSIX_BRACKET_OPEN: + r = parse_posix_bracket(cc, asc_cc, &p, end, env); + if (r < 0) + goto err; + if (r == 1) + { /* is not POSIX bracket */ + CC_ESC_WARN(env, (UChar *)"["); + p = tok->backp; + v = (OnigCodePoint)tok->u.c; + in_israw = 0; + goto val_entry; + } + goto next_class; + break; + + case TK_CHAR_TYPE: + r = add_ctype_to_cc(cc, tok->u.prop.ctype, tok->u.prop.not, + IS_ASCII_RANGE(env->option), env); + if (r != 0) + return r; + if (IS_NOT_NULL(asc_cc)) + { + if (tok->u.prop.ctype != ONIGENC_CTYPE_WORD) + r = add_ctype_to_cc(asc_cc, tok->u.prop.ctype, tok->u.prop.not, + IS_ASCII_RANGE(env->option), env); + if (r != 0) + return r; + } + + next_class: + r = next_state_class(cc, asc_cc, &vs, &val_type, &state, env); + if (r != 0) + goto err; + break; + + case TK_CHAR_PROPERTY: { + int ctype; + + ctype = fetch_char_property_to_ctype(&p, end, env); + if (ctype < 0) + return ctype; + r = add_ctype_to_cc(cc, ctype, tok->u.prop.not, 0, env); + if (r != 0) + return r; + if (IS_NOT_NULL(asc_cc)) + { + if (ctype != ONIGENC_CTYPE_ASCII) + r = add_ctype_to_cc(asc_cc, ctype, tok->u.prop.not, 0, env); + if (r != 0) + return r; + } + goto next_class; + } + break; + + case TK_CC_RANGE: + if (state == CCS_VALUE) + { + r = fetch_token_in_cc(tok, &p, end, env); + if (r < 0) + goto err; + fetched = 1; + if (r == TK_CC_CLOSE) + { /* allow [x-] */ + range_end_val: + v = (OnigCodePoint)'-'; + in_israw = 0; + goto val_entry; + } + else if (r == TK_CC_AND) + { + CC_ESC_WARN(env, (UChar *)"-"); + goto range_end_val; + } + state = CCS_RANGE; + } + else if (state == CCS_START) + { + /* [-xa] is allowed */ + v = (OnigCodePoint)tok->u.c; + in_israw = 0; + + r = fetch_token_in_cc(tok, &p, end, env); + if (r < 0) + goto err; + fetched = 1; + /* [--x] or [a&&-x] is warned. */ + if (r == TK_CC_RANGE || and_start != 0) + CC_ESC_WARN(env, (UChar *)"-"); + + goto val_entry; + } + else if (state == CCS_RANGE) + { + CC_ESC_WARN(env, (UChar *)"-"); + goto sb_char; /* [!--x] is allowed */ + } + else + { /* CCS_COMPLETE */ + r = fetch_token_in_cc(tok, &p, end, env); + if (r < 0) + goto err; + fetched = 1; + if (r == TK_CC_CLOSE) + goto range_end_val; /* allow [a-b-] */ + else if (r == TK_CC_AND) + { + CC_ESC_WARN(env, (UChar *)"-"); + goto range_end_val; + } + + if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC)) + { + CC_ESC_WARN(env, (UChar *)"-"); + goto range_end_val; /* [0-9-a] is allowed as [0-9\-a] */ + } + r = ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS; + goto err; + } + break; + + case TK_CC_CC_OPEN: /* [ */ + { + Node *anode, *aasc_node; + CClassNode *acc; + + r = parse_char_class(&anode, &aasc_node, tok, &p, end, env); + if (r == 0) + { + acc = NCCLASS(anode); + r = or_cclass(cc, acc, env); + } + if (r == 0 && IS_NOT_NULL(aasc_node)) + { + acc = NCCLASS(aasc_node); + r = or_cclass(asc_cc, acc, env); + } + onig_node_free(anode); + onig_node_free(aasc_node); + if (r != 0) + goto err; + } + break; + + case TK_CC_AND: /* && */ + { + if (state == CCS_VALUE) + { + r = next_state_val(cc, asc_cc, &vs, 0, &val_israw, 0, val_type, + &val_type, &state, env); + if (r != 0) + goto err; + } + /* initialize local variables */ + and_start = 1; + state = CCS_START; + + if (IS_NOT_NULL(prev_cc)) + { + r = and_cclass(prev_cc, cc, env); + if (r != 0) + goto err; + bbuf_free(cc->mbuf); + if (IS_NOT_NULL(asc_cc)) + { + r = and_cclass(asc_prev_cc, asc_cc, env); + if (r != 0) + goto err; + bbuf_free(asc_cc->mbuf); + } + } + else + { + prev_cc = cc; + cc = &work_cc; + if (IS_NOT_NULL(asc_cc)) + { + asc_prev_cc = asc_cc; + asc_cc = &asc_work_cc; + } + } + initialize_cclass(cc); + if (IS_NOT_NULL(asc_cc)) + initialize_cclass(asc_cc); + } + break; + + case TK_EOT: + r = ONIGERR_PREMATURE_END_OF_CHAR_CLASS; + goto err; + break; + default: + r = ONIGERR_PARSER_BUG; + goto err; + break; + } + + if (fetched) + r = tok->type; + else + { + r = fetch_token_in_cc(tok, &p, end, env); + if (r < 0) + goto err; + } + } + + if (state == CCS_VALUE) + { + r = next_state_val(cc, asc_cc, &vs, 0, &val_israw, 0, val_type, &val_type, + &state, env); + if (r != 0) + goto err; + } + + if (IS_NOT_NULL(prev_cc)) + { + r = and_cclass(prev_cc, cc, env); + if (r != 0) + goto err; + bbuf_free(cc->mbuf); + cc = prev_cc; + if (IS_NOT_NULL(asc_cc)) + { + r = and_cclass(asc_prev_cc, asc_cc, env); + if (r != 0) + goto err; + bbuf_free(asc_cc->mbuf); + asc_cc = asc_prev_cc; + } + } + + if (neg != 0) + { + NCCLASS_SET_NOT(cc); + if (IS_NOT_NULL(asc_cc)) + NCCLASS_SET_NOT(asc_cc); + } + else + { + NCCLASS_CLEAR_NOT(cc); + if (IS_NOT_NULL(asc_cc)) + NCCLASS_CLEAR_NOT(asc_cc); + } + if (IS_NCCLASS_NOT(cc) + && IS_SYNTAX_BV(env->syntax, ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC)) + { + int is_empty; + + is_empty = (IS_NULL(cc->mbuf) ? 1 : 0); + if (is_empty != 0) + BITSET_IS_EMPTY(cc->bs, is_empty); + + if (is_empty == 0) + { +#define NEWLINE_CODE 0x0a + + if (ONIGENC_IS_CODE_NEWLINE(env->enc, NEWLINE_CODE)) + { + if (ONIGENC_CODE_TO_MBCLEN(env->enc, NEWLINE_CODE) == 1) + BITSET_SET_BIT_CHKDUP(cc->bs, NEWLINE_CODE); + else + { + r = add_code_range(&(cc->mbuf), env, NEWLINE_CODE, NEWLINE_CODE); + if (r < 0) + goto err; + } + } + } + } + *src = p; + env->parse_depth--; + return 0; + +err: + if (cc != NCCLASS(*np)) + bbuf_free(cc->mbuf); + if (IS_NOT_NULL(asc_cc) && (asc_cc != NCCLASS(*asc_np))) + bbuf_free(asc_cc->mbuf); + return r; +} + +static int parse_subexp(Node **top, OnigToken *tok, int term, UChar **src, + UChar *end, ScanEnv *env); + +static int parse_enclose(Node **np, OnigToken *tok, int term, UChar **src, + UChar *end, ScanEnv *env) +{ + int r = 0, num; + Node *target, *work1 = NULL, *work2 = NULL; + OnigOptionType option; + OnigCodePoint c; + OnigEncoding enc = env->enc; + +#ifdef USE_NAMED_GROUP + int list_capture; +#endif + + UChar *p = *src; + PFETCH_READY; + + *np = NULL; + if (PEND) + return ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS; + + option = env->option; + if (PPEEK_IS('?') + && IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_GROUP_EFFECT)) + { + PINC; + if (PEND) + return ONIGERR_END_PATTERN_IN_GROUP; + + PFETCH(c); + switch (c) + { + case ':': /* (?:...) grouping only */ + group: + r = fetch_token(tok, &p, end, env); + if (r < 0) + return r; + r = parse_subexp(np, tok, term, &p, end, env); + if (r < 0) + return r; + *src = p; + return 1; /* group */ + break; + + case '=': + *np = onig_node_new_anchor(ANCHOR_PREC_READ); + break; + case '!': /* preceding read */ + *np = onig_node_new_anchor(ANCHOR_PREC_READ_NOT); + break; + case '>': /* (?>...) stop backtrack */ + *np = node_new_enclose(ENCLOSE_STOP_BACKTRACK); + break; + case '~': /* (?~...) absent operator */ + if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_TILDE_ABSENT)) + { + *np = node_new_enclose(ENCLOSE_ABSENT); + } + else + { + return ONIGERR_UNDEFINED_GROUP_OPTION; + } + break; + +#ifdef USE_NAMED_GROUP + case '\'': + if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP)) + { + goto named_group1; + } + else + return ONIGERR_UNDEFINED_GROUP_OPTION; + break; + +# ifdef USE_CAPITAL_P_NAMED_GROUP + case 'P': /* (?P<name>...) */ + if (!PEND + && IS_SYNTAX_OP2(env->syntax, + ONIG_SYN_OP2_QMARK_CAPITAL_P_NAMED_GROUP)) + { + PFETCH(c); + if (c == '<') + goto named_group1; + } + return ONIGERR_UNDEFINED_GROUP_OPTION; + break; +# endif +#endif + + case '<': /* look behind (?<=...), (?<!...) */ + if (PEND) + return ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS; + PFETCH(c); + if (c == '=') + *np = onig_node_new_anchor(ANCHOR_LOOK_BEHIND); + else if (c == '!') + *np = onig_node_new_anchor(ANCHOR_LOOK_BEHIND_NOT); +#ifdef USE_NAMED_GROUP + else + { /* (?<name>...) */ + if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP)) + { + UChar *name; + UChar *name_end; + + PUNFETCH; + c = '<'; + + named_group1: + list_capture = 0; + +# ifdef USE_CAPTURE_HISTORY + named_group2: +# endif + name = p; + r = fetch_name((OnigCodePoint)c, &p, end, &name_end, env, &num, 0); + if (r < 0) + return r; + + num = scan_env_add_mem_entry(env); + if (num < 0) + return num; + if (list_capture != 0 && num >= (int)BIT_STATUS_BITS_NUM) + return ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY; + + r = name_add(env->reg, name, name_end, num, env); + if (r != 0) + return r; + *np = node_new_enclose_memory(env->option, 1); + CHECK_NULL_RETURN_MEMERR(*np); + NENCLOSE(*np)->regnum = num; + if (list_capture != 0) + BIT_STATUS_ON_AT_SIMPLE(env->capture_history, num); + env->num_named++; + } + else + { + return ONIGERR_UNDEFINED_GROUP_OPTION; + } + } +#else + else + { + return ONIGERR_UNDEFINED_GROUP_OPTION; + } +#endif + break; + +#ifdef USE_CAPTURE_HISTORY + case '@': + if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY)) + { +# ifdef USE_NAMED_GROUP + if (!PEND + && IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP)) + { + PFETCH(c); + if (c == '<' || c == '\'') + { + list_capture = 1; + goto named_group2; /* (?@<name>...) */ + } + PUNFETCH; + } +# endif + *np = node_new_enclose_memory(env->option, 0); + CHECK_NULL_RETURN_MEMERR(*np); + num = scan_env_add_mem_entry(env); + if (num < 0) + return num; + if (num >= (int)BIT_STATUS_BITS_NUM) + return ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY; + + NENCLOSE(*np)->regnum = num; + BIT_STATUS_ON_AT_SIMPLE(env->capture_history, num); + } + else + { + return ONIGERR_UNDEFINED_GROUP_OPTION; + } + break; +#endif /* USE_CAPTURE_HISTORY */ + + case '(': /* conditional expression: (?(cond)yes), (?(cond)yes|no) */ + if (!PEND + && IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_LPAREN_CONDITION)) + { + UChar *name = NULL; + UChar *name_end; + PFETCH(c); + if (ONIGENC_IS_CODE_DIGIT(enc, c)) + { /* (n) */ + PUNFETCH; + r = fetch_name((OnigCodePoint)'(', &p, end, &name_end, env, &num, + 1); + if (r < 0) + return r; +#if 0 + /* Relative number is not currently supported. (same as Perl) */ + if (num < 0) { + num = BACKREF_REL_TO_ABS(num, env); + if (num <= 0) + return ONIGERR_INVALID_BACKREF; + } +#endif + if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_STRICT_CHECK_BACKREF)) + { + if (num > env->num_mem || IS_NULL(SCANENV_MEM_NODES(env)[num])) + return ONIGERR_INVALID_BACKREF; + } + } +#ifdef USE_NAMED_GROUP + else if (c == '<' || c == '\'') + { /* (<name>), ('name') */ + name = p; + r = fetch_named_backref_token(c, tok, &p, end, env); + if (r < 0) + return r; + if (!PPEEK_IS(')')) + return ONIGERR_UNDEFINED_GROUP_OPTION; + PINC; + + if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_USE_LEFT_MOST_NAMED_GROUP)) + { + num = tok->u.backref.ref1; + } + else + { + /* FIXME: + * Use left most named group for now. This is the same as Perl. + * However this should use the same strategy as normal back- + * references on Ruby syntax; search right to left. */ + int len = tok->u.backref.num; + num = len > 1 ? tok->u.backref.refs[0] : tok->u.backref.ref1; + } + } +#endif + else + return ONIGERR_INVALID_CONDITION_PATTERN; + *np = node_new_enclose(ENCLOSE_CONDITION); + CHECK_NULL_RETURN_MEMERR(*np); + NENCLOSE(*np)->regnum = num; + if (IS_NOT_NULL(name)) + NENCLOSE(*np)->state |= NST_NAME_REF; + } + else + return ONIGERR_UNDEFINED_GROUP_OPTION; + break; + +#if 0 + case '|': /* branch reset: (?|...) */ + if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_VBAR_BRANCH_RESET)) { + /* TODO */ + } + else + return ONIGERR_UNDEFINED_GROUP_OPTION; + break; +#endif + + case '^': /* loads default options */ + if (!PEND && IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_PERL)) + { + /* d-imsx */ + ONOFF(option, ONIG_OPTION_ASCII_RANGE, 1); + ONOFF(option, ONIG_OPTION_IGNORECASE, 1); + ONOFF(option, ONIG_OPTION_SINGLELINE, 0); + ONOFF(option, ONIG_OPTION_MULTILINE, 1); + ONOFF(option, ONIG_OPTION_EXTEND, 1); + PFETCH(c); + } +#if 0 + else if (!PEND && IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_RUBY)) { + /* d-imx */ + ONOFF(option, ONIG_OPTION_ASCII_RANGE, 0); + ONOFF(option, ONIG_OPTION_POSIX_BRACKET_ALL_RANGE, 0); + ONOFF(option, ONIG_OPTION_WORD_BOUND_ALL_RANGE, 0); + ONOFF(option, ONIG_OPTION_IGNORECASE, 1); + ONOFF(option, ONIG_OPTION_MULTILINE, 1); + ONOFF(option, ONIG_OPTION_EXTEND, 1); + PFETCH(c); + } +#endif + else + { + return ONIGERR_UNDEFINED_GROUP_OPTION; + } + /* fall through */ +#ifdef USE_POSIXLINE_OPTION + case 'p': +#endif + case '-': + case 'i': + case 'm': + case 's': + case 'x': + case 'a': + case 'd': + case 'l': + case 'u': { + int neg = 0; + + while (1) + { + switch (c) + { + case ':': + case ')': + break; + + case '-': + neg = 1; + break; + case 'x': + ONOFF(option, ONIG_OPTION_EXTEND, neg); + break; + case 'i': + ONOFF(option, ONIG_OPTION_IGNORECASE, neg); + break; + case 's': + if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_PERL)) + { + ONOFF(option, ONIG_OPTION_MULTILINE, neg); + } + else + return ONIGERR_UNDEFINED_GROUP_OPTION; + break; + + case 'm': + if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_PERL)) + { + ONOFF(option, ONIG_OPTION_SINGLELINE, (neg == 0 ? 1 : 0)); + } + else if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_RUBY)) + { + ONOFF(option, ONIG_OPTION_MULTILINE, neg); + } + else + return ONIGERR_UNDEFINED_GROUP_OPTION; + break; +#ifdef USE_POSIXLINE_OPTION + case 'p': + ONOFF(option, ONIG_OPTION_MULTILINE | ONIG_OPTION_SINGLELINE, + neg); + break; +#endif + + case 'a': /* limits \d, \s, \w and POSIX brackets to ASCII range */ + if ((IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_PERL) + || IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_RUBY)) + && (neg == 0)) + { + ONOFF(option, ONIG_OPTION_ASCII_RANGE, 0); + ONOFF(option, ONIG_OPTION_POSIX_BRACKET_ALL_RANGE, 1); + ONOFF(option, ONIG_OPTION_WORD_BOUND_ALL_RANGE, 1); + } + else + return ONIGERR_UNDEFINED_GROUP_OPTION; + break; + + case 'u': + if ((IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_PERL) + || IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_RUBY)) + && (neg == 0)) + { + ONOFF(option, ONIG_OPTION_ASCII_RANGE, 1); + ONOFF(option, ONIG_OPTION_POSIX_BRACKET_ALL_RANGE, 1); + ONOFF(option, ONIG_OPTION_WORD_BOUND_ALL_RANGE, 1); + } + else + return ONIGERR_UNDEFINED_GROUP_OPTION; + break; + + case 'd': + if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_PERL) + && (neg == 0)) + { + ONOFF(option, ONIG_OPTION_ASCII_RANGE, 1); + } + else if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_RUBY) + && (neg == 0)) + { + ONOFF(option, ONIG_OPTION_ASCII_RANGE, 0); + ONOFF(option, ONIG_OPTION_POSIX_BRACKET_ALL_RANGE, 0); + ONOFF(option, ONIG_OPTION_WORD_BOUND_ALL_RANGE, 0); + } + else + return ONIGERR_UNDEFINED_GROUP_OPTION; + break; + + case 'l': + if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_PERL) + && (neg == 0)) + { + ONOFF(option, ONIG_OPTION_ASCII_RANGE, 1); + } + else + return ONIGERR_UNDEFINED_GROUP_OPTION; + break; + + default: + return ONIGERR_UNDEFINED_GROUP_OPTION; + } + + if (c == ')') + { + *np = node_new_option(option); + CHECK_NULL_RETURN_MEMERR(*np); + *src = p; + return 2; /* option only */ + } + else if (c == ':') + { + OnigOptionType prev = env->option; + + env->option = option; + r = fetch_token(tok, &p, end, env); + if (r < 0) + { + env->option = prev; + return r; + } + r = parse_subexp(&target, tok, term, &p, end, env); + env->option = prev; + if (r < 0) + return r; + *np = node_new_option(option); + CHECK_NULL_RETURN_MEMERR(*np); + NENCLOSE(*np)->target = target; + *src = p; + return 0; + } + + if (PEND) + return ONIGERR_END_PATTERN_IN_GROUP; + PFETCH(c); + } + } + break; + + default: + return ONIGERR_UNDEFINED_GROUP_OPTION; + } + } + else + { + if (ONIG_IS_OPTION_ON(env->option, ONIG_OPTION_DONT_CAPTURE_GROUP)) + goto group; + + *np = node_new_enclose_memory(env->option, 0); + CHECK_NULL_RETURN_MEMERR(*np); + num = scan_env_add_mem_entry(env); + if (num < 0) + return num; + NENCLOSE(*np)->regnum = num; + } + + CHECK_NULL_RETURN_MEMERR(*np); + r = fetch_token(tok, &p, end, env); + if (r < 0) + return r; + r = parse_subexp(&target, tok, term, &p, end, env); + if (r < 0) + { + onig_node_free(target); + return r; + } + + if (NTYPE(*np) == NT_ANCHOR) + NANCHOR(*np)->target = target; + else + { + NENCLOSE(*np)->target = target; + if (NENCLOSE(*np)->type == ENCLOSE_MEMORY) + { + /* Don't move this to previous of parse_subexp() */ + r = scan_env_set_mem_node(env, NENCLOSE(*np)->regnum, *np); + if (r != 0) + return r; + } + else if (NENCLOSE(*np)->type == ENCLOSE_CONDITION) + { + if (NTYPE(target) != NT_ALT) + { + /* convert (?(cond)yes) to (?(cond)yes|empty) */ + work1 = node_new_empty(); + if (IS_NULL(work1)) + goto err; + work2 = onig_node_new_alt(work1, NULL_NODE); + if (IS_NULL(work2)) + goto err; + work1 = onig_node_new_alt(target, work2); + if (IS_NULL(work1)) + goto err; + NENCLOSE(*np)->target = work1; + } + } + } + + *src = p; + return 0; + +err: + onig_node_free(work1); + onig_node_free(work2); + onig_node_free(*np); + *np = NULL; + return ONIGERR_MEMORY; +} + +static const char *const PopularQStr[] = {"?", "*", "+", "??", "*?", "+?"}; + +static const char *const ReduceQStr[] + = {"", "", "*", "*?", "??", "+ and ??", "+? and ?"}; + +static int set_quantifier(Node *qnode, Node *target, int group, ScanEnv *env) +{ + QtfrNode *qn; + + qn = NQTFR(qnode); + if (qn->lower == 1 && qn->upper == 1) + { + return 1; + } + + switch (NTYPE(target)) + { + case NT_STR: + if (!group) + { + StrNode *sn = NSTR(target); + if (str_node_can_be_split(sn, env->enc)) + { + Node *n = str_node_split_last_char(sn, env->enc); + if (IS_NOT_NULL(n)) + { + qn->target = n; + return 2; + } + } + } + break; + + case NT_QTFR: { /* check redundant double repeat. */ + /* verbose warn (?:.?)? etc... but not warn (.?)? etc... */ + QtfrNode *qnt = NQTFR(target); + int nestq_num = popular_quantifier_num(qn); + int targetq_num = popular_quantifier_num(qnt); + +#ifdef USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATOR + if (nestq_num >= 0 && targetq_num >= 0 + && IS_SYNTAX_BV(env->syntax, ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT)) + { + switch (ReduceTypeTable[targetq_num][nestq_num]) + { + case RQ_ASIS: + break; + + case RQ_DEL: + if (onig_warn != onig_null_warn) + { + onig_syntax_warn(env, + "regular expression has redundant nested repeat " + "operator '%s'", + PopularQStr[targetq_num]); + } + goto warn_exit; + break; + + default: + if (onig_warn != onig_null_warn) + { + onig_syntax_warn( + env, + "nested repeat operator '%s' and '%s' was replaced with '%s' " + "in regular expression", + PopularQStr[targetq_num], PopularQStr[nestq_num], + ReduceQStr[ReduceTypeTable[targetq_num][nestq_num]]); + } + goto warn_exit; + break; + } + } + + warn_exit: +#endif + if (targetq_num >= 0) + { + if (nestq_num >= 0) + { + onig_reduce_nested_quantifier(qnode, target); + goto q_exit; + } + else if (targetq_num == 1 || targetq_num == 2) + { /* * or + */ + /* (?:a*){n,m}, (?:a+){n,m} => (?:a*){n,n}, (?:a+){n,n} */ + if (!IS_REPEAT_INFINITE(qn->upper) && qn->upper > 1 && qn->greedy) + { + qn->upper = (qn->lower == 0 ? 1 : qn->lower); + } + } + } + } + break; + + default: + break; + } + + qn->target = target; +q_exit: + return 0; +} + +#ifndef CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS +static int clear_not_flag_cclass(CClassNode *cc, OnigEncoding enc) +{ + BBuf *tbuf; + int r; + + if (IS_NCCLASS_NOT(cc)) + { + bitset_invert(cc->bs); + + if (!ONIGENC_IS_SINGLEBYTE(enc)) + { + r = not_code_range_buf(enc, cc->mbuf, &tbuf); + if (r != 0) + return r; + + bbuf_free(cc->mbuf); + cc->mbuf = tbuf; + } + + NCCLASS_CLEAR_NOT(cc); + } + + return 0; +} +#endif /* CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS */ + +typedef struct +{ + ScanEnv *env; + CClassNode *cc; + CClassNode *asc_cc; + Node *alt_root; + Node **ptail; +} IApplyCaseFoldArg; + +static int i_apply_case_fold(OnigCodePoint from, OnigCodePoint to[], int to_len, + void *arg) +{ + IApplyCaseFoldArg *iarg; + ScanEnv *env; + CClassNode *cc; + CClassNode *asc_cc; + BitSetRef bs; + int add_flag, r; + + iarg = (IApplyCaseFoldArg *)arg; + env = iarg->env; + cc = iarg->cc; + asc_cc = iarg->asc_cc; + bs = cc->bs; + + if (IS_NULL(asc_cc)) + { + add_flag = 0; + } + else if (ONIGENC_IS_ASCII_CODE(from) == ONIGENC_IS_ASCII_CODE(*to)) + { + add_flag = 1; + } + else + { + add_flag = onig_is_code_in_cc(env->enc, from, asc_cc); + if (IS_NCCLASS_NOT(asc_cc)) + add_flag = !add_flag; + } + + if (to_len == 1) + { + int is_in = onig_is_code_in_cc(env->enc, from, cc); +#ifdef CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS + if ((is_in != 0 && !IS_NCCLASS_NOT(cc)) + || (is_in == 0 && IS_NCCLASS_NOT(cc))) + { + if (add_flag) + { + if (ONIGENC_MBC_MINLEN(env->enc) > 1 || *to >= SINGLE_BYTE_SIZE) + { + r = add_code_range0(&(cc->mbuf), env, *to, *to, 0); + if (r < 0) + return r; + } + else + { + BITSET_SET_BIT(bs, *to); + } + } + } +#else + if (is_in != 0) + { + if (add_flag) + { + if (ONIGENC_MBC_MINLEN(env->enc) > 1 || *to >= SINGLE_BYTE_SIZE) + { + if (IS_NCCLASS_NOT(cc)) + clear_not_flag_cclass(cc, env->enc); + r = add_code_range0(&(cc->mbuf), env, *to, *to, 0); + if (r < 0) + return r; + } + else + { + if (IS_NCCLASS_NOT(cc)) + { + BITSET_CLEAR_BIT(bs, *to); + } + else + { + BITSET_SET_BIT(bs, *to); + } + } + } + } +#endif /* CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS */ + } + else + { + int r, i, len; + UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN]; + Node *snode = NULL_NODE; + + if (onig_is_code_in_cc(env->enc, from, cc) +#ifdef CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS + && !IS_NCCLASS_NOT(cc) +#endif + ) + { + for (i = 0; i < to_len; i++) + { + len = ONIGENC_CODE_TO_MBC(env->enc, to[i], buf); + if (i == 0) + { + snode = onig_node_new_str(buf, buf + len); + CHECK_NULL_RETURN_MEMERR(snode); + + /* char-class expanded multi-char only + compare with string folded at match time. */ + NSTRING_SET_AMBIG(snode); + } + else + { + r = onig_node_str_cat(snode, buf, buf + len); + if (r < 0) + { + onig_node_free(snode); + return r; + } + } + } + + *(iarg->ptail) = onig_node_new_alt(snode, NULL_NODE); + CHECK_NULL_RETURN_MEMERR(*(iarg->ptail)); + iarg->ptail = &(NCDR((*(iarg->ptail)))); + } + } + + return 0; +} + +static int cclass_case_fold(Node **np, CClassNode *cc, CClassNode *asc_cc, + ScanEnv *env) +{ + int r; + IApplyCaseFoldArg iarg; + + iarg.env = env; + iarg.cc = cc; + iarg.asc_cc = asc_cc; + iarg.alt_root = NULL_NODE; + iarg.ptail = &(iarg.alt_root); + + r = ONIGENC_APPLY_ALL_CASE_FOLD(env->enc, env->case_fold_flag, + i_apply_case_fold, &iarg); + if (r != 0) + { + onig_node_free(iarg.alt_root); + return r; + } + if (IS_NOT_NULL(iarg.alt_root)) + { + Node *work = onig_node_new_alt(*np, iarg.alt_root); + if (IS_NULL(work)) + { + onig_node_free(iarg.alt_root); + return ONIGERR_MEMORY; + } + *np = work; + } + return r; +} + +static int node_linebreak(Node **np, ScanEnv *env) +{ + /* same as (?>\x0D\x0A|[\x0A-\x0D\x{85}\x{2028}\x{2029}]) */ + Node *left = NULL; + Node *right = NULL; + Node *target1 = NULL; + Node *target2 = NULL; + CClassNode *cc; + int num1, num2, r; + UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN * 2]; + + /* \x0D\x0A */ + num1 = ONIGENC_CODE_TO_MBC(env->enc, 0x0D, buf); + if (num1 < 0) + return num1; + num2 = ONIGENC_CODE_TO_MBC(env->enc, 0x0A, buf + num1); + if (num2 < 0) + return num2; + left = node_new_str_raw(buf, buf + num1 + num2); + if (IS_NULL(left)) + goto err; + + /* [\x0A-\x0D] or [\x0A-\x0D\x{85}\x{2028}\x{2029}] */ + right = node_new_cclass(); + if (IS_NULL(right)) + goto err; + cc = NCCLASS(right); + if (ONIGENC_MBC_MINLEN(env->enc) > 1) + { + r = add_code_range(&(cc->mbuf), env, 0x0A, 0x0D); + if (r != 0) + goto err; + } + else + { + bitset_set_range(env, cc->bs, 0x0A, 0x0D); + } + + /* TODO: move this block to enc/unicode.c */ + if (ONIGENC_IS_UNICODE(env->enc)) + { + /* UTF-8, UTF-16BE/LE, UTF-32BE/LE */ + r = add_code_range(&(cc->mbuf), env, 0x85, 0x85); + if (r != 0) + goto err; + r = add_code_range(&(cc->mbuf), env, 0x2028, 0x2029); + if (r != 0) + goto err; + } + + /* ...|... */ + target1 = onig_node_new_alt(right, NULL_NODE); + if (IS_NULL(target1)) + goto err; + right = NULL; + target2 = onig_node_new_alt(left, target1); + if (IS_NULL(target2)) + goto err; + left = NULL; + target1 = NULL; + + /* (?>...) */ + *np = node_new_enclose(ENCLOSE_STOP_BACKTRACK); + if (IS_NULL(*np)) + goto err; + NENCLOSE(*np)->target = target2; + return ONIG_NORMAL; + +err: + onig_node_free(left); + onig_node_free(right); + onig_node_free(target1); + onig_node_free(target2); + return ONIGERR_MEMORY; +} + +static int propname2ctype(ScanEnv *env, const char *propname) +{ + UChar *name = (UChar *)propname; + int ctype = env->enc->property_name_to_ctype(ONIG_ENCODING_ASCII, name, + name + strlen(propname)); + return ctype; +} + +static int node_extended_grapheme_cluster(Node **np, ScanEnv *env) +{ + Node *tmp = NULL; + Node *np1 = NULL; + Node *list = NULL; + Node *list2 = NULL; + Node *alt = NULL; + Node *alt2 = NULL; + BBuf *pbuf1 = NULL; + int r = 0; + int num1; + UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN * 2]; + OnigOptionType option; + +#ifdef USE_UNICODE_PROPERTIES + if (ONIGENC_IS_UNICODE(env->enc)) + { + /* UTF-8, UTF-16BE/LE, UTF-32BE/LE */ + CClassNode *cc; + OnigCodePoint sb_out = (ONIGENC_MBC_MINLEN(env->enc) > 1) ? 0x00 : 0x80; + int extend = propname2ctype(env, "Grapheme_Cluster_Break=Extend"); + + /* Prepend* + * ( RI-sequence | Hangul-Syllable | !Control ) + * ( Grapheme_Extend | SpacingMark )* */ + + /* ( Grapheme_Extend | SpacingMark )* */ + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc(cc, extend, 0, 0, env); + if (r != 0) + goto err; + r = add_ctype_to_cc( + cc, propname2ctype(env, "Grapheme_Cluster_Break=SpacingMark"), 0, 0, + env); + if (r != 0) + goto err; + r = add_code_range(&(cc->mbuf), env, 0x200D, 0x200D); + if (r != 0) + goto err; + + tmp = node_new_quantifier(0, REPEAT_INFINITE, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = node_new_list(np1, NULL_NODE); + if (IS_NULL(tmp)) + goto err; + list = tmp; + np1 = NULL; + + /* ( RI-sequence | Hangul-Syllable | !Control ) */ + /* !Control */ + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc( + cc, propname2ctype(env, "Grapheme_Cluster_Break=Control"), 1, 0, env); + if (r != 0) + goto err; + if (ONIGENC_MBC_MINLEN(env->enc) > 1) + { + BBuf *pbuf2 = NULL; + r = add_code_range(&pbuf1, env, 0x0a, 0x0a); + if (r != 0) + goto err; + r = add_code_range(&pbuf1, env, 0x0d, 0x0d); + if (r != 0) + goto err; + r = and_code_range_buf(cc->mbuf, 0, pbuf1, 1, &pbuf2, env); + if (r != 0) + { + bbuf_free(pbuf2); + goto err; + } + bbuf_free(pbuf1); + pbuf1 = NULL; + bbuf_free(cc->mbuf); + cc->mbuf = pbuf2; + } + else + { + BITSET_CLEAR_BIT(cc->bs, 0x0a); + BITSET_CLEAR_BIT(cc->bs, 0x0d); + } + + tmp = onig_node_new_alt(np1, NULL_NODE); + if (IS_NULL(tmp)) + goto err; + alt = tmp; + np1 = NULL; + + /* Hangul-Syllable + * := L* V+ T* + * | L* LV V* T* + * | L* LVT T* + * | L+ + * | T+ */ + + /* T+ */ + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=T"), 0, + 0, env); + if (r != 0) + goto err; + + tmp = node_new_quantifier(1, REPEAT_INFINITE, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = onig_node_new_alt(np1, alt); + if (IS_NULL(tmp)) + goto err; + alt = tmp; + np1 = NULL; + + /* L+ */ + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=L"), 0, + 0, env); + if (r != 0) + goto err; + + tmp = node_new_quantifier(1, REPEAT_INFINITE, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = onig_node_new_alt(np1, alt); + if (IS_NULL(tmp)) + goto err; + alt = tmp; + np1 = NULL; + + /* L* LVT T* */ + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=T"), 0, + 0, env); + if (r != 0) + goto err; + + tmp = node_new_quantifier(0, REPEAT_INFINITE, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = node_new_list(np1, NULL_NODE); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=LVT"), + 0, 0, env); + if (r != 0) + goto err; + + tmp = node_new_list(np1, list2); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=L"), 0, + 0, env); + if (r != 0) + goto err; + + tmp = node_new_quantifier(0, REPEAT_INFINITE, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = node_new_list(np1, list2); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + tmp = onig_node_new_alt(list2, alt); + if (IS_NULL(tmp)) + goto err; + alt = tmp; + list2 = NULL; + + /* L* LV V* T* */ + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=T"), 0, + 0, env); + if (r != 0) + goto err; + + tmp = node_new_quantifier(0, REPEAT_INFINITE, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = node_new_list(np1, NULL_NODE); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=V"), 0, + 0, env); + if (r != 0) + goto err; + + tmp = node_new_quantifier(0, REPEAT_INFINITE, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = node_new_list(np1, list2); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=LV"), 0, + 0, env); + if (r != 0) + goto err; + + tmp = node_new_list(np1, list2); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=L"), 0, + 0, env); + if (r != 0) + goto err; + + tmp = node_new_quantifier(0, REPEAT_INFINITE, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = node_new_list(np1, list2); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + tmp = onig_node_new_alt(list2, alt); + if (IS_NULL(tmp)) + goto err; + alt = tmp; + list2 = NULL; + + /* L* V+ T* */ + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=T"), 0, + 0, env); + if (r != 0) + goto err; + + tmp = node_new_quantifier(0, REPEAT_INFINITE, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = node_new_list(np1, NULL_NODE); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=V"), 0, + 0, env); + if (r != 0) + goto err; + + tmp = node_new_quantifier(1, REPEAT_INFINITE, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = node_new_list(np1, list2); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=L"), 0, + 0, env); + if (r != 0) + goto err; + + tmp = node_new_quantifier(0, REPEAT_INFINITE, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = node_new_list(np1, list2); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + tmp = onig_node_new_alt(list2, alt); + if (IS_NULL(tmp)) + goto err; + alt = tmp; + list2 = NULL; + + /* Emoji sequence := (E_Base | EBG) Extend* E_Modifier? + * (ZWJ (Glue_After_Zwj | EBG Extend* E_Modifier?) )* */ + + /* ZWJ (Glue_After_Zwj | E_Base_GAZ Extend* E_Modifier?) */ + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc( + cc, propname2ctype(env, "Grapheme_Cluster_Break=E_Modifier"), 0, 0, + env); + if (r != 0) + goto err; + + tmp = node_new_quantifier(0, 1, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = node_new_list(np1, NULL_NODE); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc(cc, extend, 0, 0, env); + if (r != 0) + goto err; + + tmp = node_new_quantifier(0, REPEAT_INFINITE, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = node_new_list(np1, list2); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc( + cc, propname2ctype(env, "Grapheme_Cluster_Break=E_Base_GAZ"), 0, 0, + env); + if (r != 0) + goto err; + + tmp = node_new_list(np1, list2); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + tmp = onig_node_new_alt(list2, NULL_NODE); + if (IS_NULL(tmp)) + goto err; + alt2 = tmp; + list2 = NULL; + + /* Glue_After_Zwj */ + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc(cc, extend, 0, 0, env); + if (r != 0) + goto err; + + tmp = node_new_quantifier(0, REPEAT_INFINITE, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = node_new_list(np1, NULL_NODE); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + { + static const OnigCodePoint ranges[] = { + 13, 0x1F308, 0x1F308, 0x1F33E, 0x1F33E, 0x1F373, 0x1F373, + 0x1F393, 0x1F393, 0x1F3A4, 0x1F3A4, 0x1F3A8, 0x1F3A8, 0x1F3EB, + 0x1F3EB, 0x1F3ED, 0x1F3ED, 0x1F4BB, 0x1F4BC, 0x1F527, 0x1F527, + 0x1F52C, 0x1F52C, 0x1F680, 0x1F680, 0x1F692, 0x1F692, + }; + r = add_ctype_to_cc_by_range(cc, -1, 0, env, sb_out, ranges); + if (r != 0) + goto err; + } + r = add_ctype_to_cc( + cc, propname2ctype(env, "Grapheme_Cluster_Break=Glue_After_Zwj"), 0, 0, + env); + if (r != 0) + goto err; + + tmp = node_new_list(np1, list2); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + tmp = onig_node_new_alt(list2, alt2); + if (IS_NULL(tmp)) + goto err; + alt2 = tmp; + list2 = NULL; + + /* Emoji variation sequence + * http://unicode.org/Public/emoji/4.0/emoji-zwj-sequences.txt + */ + r = ONIGENC_CODE_TO_MBC(env->enc, 0xfe0f, buf); + if (r < 0) + goto err; + np1 = node_new_str_raw(buf, buf + r); + if (IS_NULL(np1)) + goto err; + + tmp = node_new_quantifier(0, 1, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = node_new_list(np1, NULL_NODE); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + { + static const OnigCodePoint ranges[] = { + 4, 0x2640, 0x2640, 0x2642, 0x2642, 0x2695, 0x2696, 0x2708, 0x2708, + }; + r = add_ctype_to_cc_by_range(cc, -1, 0, env, sb_out, ranges); + if (r != 0) + goto err; + } + + tmp = node_new_list(np1, list2); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + tmp = onig_node_new_alt(list2, alt2); + if (IS_NULL(tmp)) + goto err; + alt2 = tmp; + list2 = NULL; + + tmp = node_new_list(alt2, NULL_NODE); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + alt2 = NULL; + + /* ZWJ */ + r = ONIGENC_CODE_TO_MBC(env->enc, 0x200D, buf); + if (r < 0) + goto err; + np1 = node_new_str_raw(buf, buf + r); + if (IS_NULL(np1)) + goto err; + + tmp = node_new_list(np1, list2); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + tmp = node_new_quantifier(0, REPEAT_INFINITE, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = list2; + np1 = tmp; + list2 = NULL; + + tmp = node_new_list(np1, NULL_NODE); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + /* E_Modifier? */ + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc( + cc, propname2ctype(env, "Grapheme_Cluster_Break=E_Modifier"), 0, 0, + env); + if (r != 0) + goto err; + + tmp = node_new_quantifier(0, 1, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = node_new_list(np1, list2); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + /* Extend* */ + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc(cc, extend, 0, 0, env); + if (r != 0) + goto err; + + tmp = node_new_quantifier(0, REPEAT_INFINITE, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = node_new_list(np1, list2); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + /* (E_Base | EBG) */ + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + { + static const OnigCodePoint ranges[] = { + 8, 0x1F3C2, 0x1F3C2, 0x1F3C7, 0x1F3C7, 0x1F3CC, + 0x1F3CC, 0x1F3F3, 0x1F3F3, 0x1F441, 0x1F441, 0x1F46F, + 0x1F46F, 0x1F574, 0x1F574, 0x1F6CC, 0x1F6CC, + }; + r = add_ctype_to_cc_by_range(cc, -1, 0, env, sb_out, ranges); + if (r != 0) + goto err; + } + r = add_ctype_to_cc( + cc, propname2ctype(env, "Grapheme_Cluster_Break=E_Base"), 0, 0, env); + if (r != 0) + goto err; + r = add_ctype_to_cc( + cc, propname2ctype(env, "Grapheme_Cluster_Break=E_Base_GAZ"), 0, 0, + env); + if (r != 0) + goto err; + + tmp = node_new_list(np1, list2); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + tmp = onig_node_new_alt(list2, alt); + if (IS_NULL(tmp)) + goto err; + alt = tmp; + list2 = NULL; + + /* ZWJ (E_Base_GAZ | Glue_After_Zwj) E_Modifier? */ + /* a sequence starting with ZWJ seems artificial, but GraphemeBreakTest + * has such examples. + * http://www.unicode.org/Public/9.0.0/ucd/auxiliary/GraphemeBreakTest.html + */ + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc( + cc, propname2ctype(env, "Grapheme_Cluster_Break=E_Modifier"), 0, 0, + env); + if (r != 0) + goto err; + + tmp = node_new_quantifier(0, 1, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = node_new_list(np1, NULL_NODE); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc( + cc, propname2ctype(env, "Grapheme_Cluster_Break=Glue_After_Zwj"), 0, 0, + env); + if (r != 0) + goto err; + r = add_ctype_to_cc( + cc, propname2ctype(env, "Grapheme_Cluster_Break=E_Base_GAZ"), 0, 0, + env); + if (r != 0) + goto err; + + tmp = node_new_list(np1, list2); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + r = ONIGENC_CODE_TO_MBC(env->enc, 0x200D, buf); + if (r < 0) + goto err; + np1 = node_new_str_raw(buf, buf + r); + if (IS_NULL(np1)) + goto err; + + tmp = node_new_list(np1, list2); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + tmp = onig_node_new_alt(list2, alt); + if (IS_NULL(tmp)) + goto err; + alt = tmp; + list2 = NULL; + + /* RI-Sequence := Regional_Indicator{2} */ + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_code_range(&(cc->mbuf), env, 0x1F1E6, 0x1F1FF); + if (r != 0) + goto err; + + tmp = node_new_quantifier(2, 2, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = node_new_list(np1, list2); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + tmp = onig_node_new_alt(list2, alt); + if (IS_NULL(tmp)) + goto err; + alt = tmp; + list2 = NULL; + + tmp = node_new_list(alt, list); + if (IS_NULL(tmp)) + goto err; + list = tmp; + alt = NULL; + + /* Prepend* */ + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc( + cc, propname2ctype(env, "Grapheme_Cluster_Break=Prepend"), 0, 0, env); + if (r != 0) + goto err; + + tmp = node_new_quantifier(0, REPEAT_INFINITE, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = node_new_list(np1, list); + if (IS_NULL(tmp)) + goto err; + list = tmp; + np1 = NULL; + + /* PerlSyntax: (?s:.), RubySyntax: (?m:.) */ + np1 = node_new_anychar(); + if (IS_NULL(np1)) + goto err; + + option = env->option; + ONOFF(option, ONIG_OPTION_MULTILINE, 0); + tmp = node_new_option(option); + if (IS_NULL(tmp)) + goto err; + NENCLOSE(tmp)->target = np1; + np1 = tmp; + + tmp = onig_node_new_alt(np1, NULL_NODE); + if (IS_NULL(tmp)) + goto err; + alt = tmp; + np1 = NULL; + + /* Prepend+ */ + r = ONIGENC_CODE_TO_MBC(env->enc, 0x200D, buf); + if (r < 0) + goto err; + np1 = node_new_str_raw(buf, buf + r); + if (IS_NULL(np1)) + goto err; + + tmp = node_new_quantifier(0, 1, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = node_new_list(np1, NULL_NODE); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + np1 = node_new_cclass(); + if (IS_NULL(np1)) + goto err; + cc = NCCLASS(np1); + r = add_ctype_to_cc( + cc, propname2ctype(env, "Grapheme_Cluster_Break=Prepend"), 0, 0, env); + if (r != 0) + goto err; + + tmp = node_new_quantifier(1, REPEAT_INFINITE, 0); + if (IS_NULL(tmp)) + goto err; + NQTFR(tmp)->target = np1; + np1 = tmp; + + tmp = node_new_list(np1, list2); + if (IS_NULL(tmp)) + goto err; + list2 = tmp; + np1 = NULL; + + tmp = onig_node_new_alt(list2, alt); + if (IS_NULL(tmp)) + goto err; + alt = tmp; + list2 = NULL; + + tmp = onig_node_new_alt(list, alt); + if (IS_NULL(tmp)) + goto err; + alt = tmp; + list = NULL; + } + else +#endif /* USE_UNICODE_PROPERTIES */ + { + /* PerlSyntax: (?s:.), RubySyntax: (?m:.) */ + np1 = node_new_anychar(); + if (IS_NULL(np1)) + goto err; + + option = env->option; + ONOFF(option, ONIG_OPTION_MULTILINE, 0); + tmp = node_new_option(option); + if (IS_NULL(tmp)) + goto err; + NENCLOSE(tmp)->target = np1; + np1 = tmp; + + alt = onig_node_new_alt(np1, NULL_NODE); + if (IS_NULL(alt)) + goto err; + np1 = NULL; + } + + /* \x0D\x0A */ + r = ONIGENC_CODE_TO_MBC(env->enc, 0x0D, buf); + if (r < 0) + goto err; + num1 = r; + r = ONIGENC_CODE_TO_MBC(env->enc, 0x0A, buf + num1); + if (r < 0) + goto err; + np1 = node_new_str_raw(buf, buf + num1 + r); + if (IS_NULL(np1)) + goto err; + + tmp = onig_node_new_alt(np1, alt); + if (IS_NULL(tmp)) + goto err; + alt = tmp; + np1 = NULL; + + /* (?>\x0D\x0A|...) */ + tmp = node_new_enclose(ENCLOSE_STOP_BACKTRACK); + if (IS_NULL(tmp)) + goto err; + NENCLOSE(tmp)->target = alt; + np1 = tmp; + +#ifdef USE_UNICODE_PROPERTIES + if (ONIGENC_IS_UNICODE(env->enc)) + { + /* Don't ignore case. */ + option = env->option; + ONOFF(option, ONIG_OPTION_IGNORECASE, 1); + *np = node_new_option(option); + if (IS_NULL(*np)) + goto err; + NENCLOSE(*np)->target = np1; + } + else +#endif + { + *np = np1; + } + return ONIG_NORMAL; + +err: + onig_node_free(np1); + onig_node_free(list); + onig_node_free(list2); + onig_node_free(alt); + onig_node_free(alt2); + bbuf_free(pbuf1); + return (r == 0) ? ONIGERR_MEMORY : r; +} + +static int countbits(unsigned int bits) +{ + bits = (bits & 0x55555555) + ((bits >> 1) & 0x55555555); + bits = (bits & 0x33333333) + ((bits >> 2) & 0x33333333); + bits = (bits & 0x0f0f0f0f) + ((bits >> 4) & 0x0f0f0f0f); + bits = (bits & 0x00ff00ff) + ((bits >> 8) & 0x00ff00ff); + return (bits & 0x0000ffff) + ((bits >> 16) & 0x0000ffff); +} + +static int is_onechar_cclass(CClassNode *cc, OnigCodePoint *code) +{ + const OnigCodePoint not_found = ONIG_LAST_CODE_POINT; + OnigCodePoint c = not_found; + int i; + BBuf *bbuf = cc->mbuf; + + if (IS_NCCLASS_NOT(cc)) + return 0; + + /* check bbuf */ + if (IS_NOT_NULL(bbuf)) + { + OnigCodePoint n, *data; + GET_CODE_POINT(n, bbuf->p); + data = (OnigCodePoint *)(bbuf->p) + 1; + if ((n == 1) && (data[0] == data[1])) + { + /* only one char found in the bbuf, save the code point. */ + c = data[0]; + if (((c < SINGLE_BYTE_SIZE) && BITSET_AT(cc->bs, c))) + { + /* skip if c is included in the bitset */ + c = not_found; + } + } + else + { + return 0; /* the bbuf contains multiple chars */ + } + } + + /* check bitset */ + for (i = 0; i < BITSET_SIZE; i++) + { + Bits b1 = cc->bs[i]; + if (b1 != 0) + { + if (((b1 & (b1 - 1)) == 0) && (c == not_found)) + { + c = BITS_IN_ROOM * i + countbits(b1 - 1); + } + else + { + return 0; /* the character class contains multiple chars */ + } + } + } + + if (c != not_found) + { + *code = c; + return 1; + } + + /* the character class contains no char. */ + return 0; +} + +static int parse_exp(Node **np, OnigToken *tok, int term, UChar **src, + UChar *end, ScanEnv *env) +{ + int r, len, group = 0; + Node *qn; + Node **targetp; + + *np = NULL; + if (tok->type == (enum TokenSyms)term) + goto end_of_token; + + switch (tok->type) + { + case TK_ALT: + case TK_EOT: + end_of_token: + *np = node_new_empty(); + return tok->type; + break; + + case TK_SUBEXP_OPEN: + r = parse_enclose(np, tok, TK_SUBEXP_CLOSE, src, end, env); + if (r < 0) + return r; + if (r == 1) + group = 1; + else if (r == 2) + { /* option only */ + Node *target; + OnigOptionType prev = env->option; + + env->option = NENCLOSE(*np)->option; + r = fetch_token(tok, src, end, env); + if (r < 0) + { + env->option = prev; + return r; + } + r = parse_subexp(&target, tok, term, src, end, env); + env->option = prev; + if (r < 0) + { + onig_node_free(target); + return r; + } + NENCLOSE(*np)->target = target; + return tok->type; + } + break; + + case TK_SUBEXP_CLOSE: + if (!IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP)) + return ONIGERR_UNMATCHED_CLOSE_PARENTHESIS; + + if (tok->escaped) + goto tk_raw_byte; + else + goto tk_byte; + break; + + case TK_LINEBREAK: + r = node_linebreak(np, env); + if (r < 0) + return r; + break; + + case TK_EXTENDED_GRAPHEME_CLUSTER: + r = node_extended_grapheme_cluster(np, env); + if (r < 0) + return r; + break; + + case TK_KEEP: + *np = onig_node_new_anchor(ANCHOR_KEEP); + CHECK_NULL_RETURN_MEMERR(*np); + break; + + case TK_STRING: + tk_byte: { + *np = node_new_str(tok->backp, *src); + CHECK_NULL_RETURN_MEMERR(*np); + + string_loop: + while (1) + { + r = fetch_token(tok, src, end, env); + if (r < 0) + return r; + if (r == TK_STRING) + { + r = onig_node_str_cat(*np, tok->backp, *src); + } +#ifndef NUMBERED_CHAR_IS_NOT_CASE_AMBIG + else if (r == TK_CODE_POINT) + { + r = node_str_cat_codepoint(*np, env->enc, tok->u.code); + } +#endif + else + { + break; + } + if (r < 0) + return r; + } + + string_end: + targetp = np; + goto repeat; + } + break; + + case TK_RAW_BYTE: + tk_raw_byte: { + *np = node_new_str_raw_char((UChar)tok->u.c); + CHECK_NULL_RETURN_MEMERR(*np); + len = 1; + while (1) + { + if (len >= ONIGENC_MBC_MINLEN(env->enc)) + { + if (len == enclen(env->enc, NSTR(*np)->s, NSTR(*np)->end)) + { + r = fetch_token(tok, src, end, env); + NSTRING_CLEAR_RAW(*np); + goto string_end; + } + } + + r = fetch_token(tok, src, end, env); + if (r < 0) + return r; + if (r != TK_RAW_BYTE) + { + /* Don't use this, it is wrong for little endian encodings. */ +#ifdef USE_PAD_TO_SHORT_BYTE_CHAR + int rem; + if (len < ONIGENC_MBC_MINLEN(env->enc)) + { + rem = ONIGENC_MBC_MINLEN(env->enc) - len; + (void)node_str_head_pad(NSTR(*np), rem, (UChar)0); + if (len + rem == enclen(env->enc, NSTR(*np)->s)) + { + NSTRING_CLEAR_RAW(*np); + goto string_end; + } + } +#endif + return ONIGERR_TOO_SHORT_MULTI_BYTE_STRING; + } + + r = node_str_cat_char(*np, (UChar)tok->u.c); + if (r < 0) + return r; + + len++; + } + } + break; + + case TK_CODE_POINT: { + *np = node_new_empty(); + CHECK_NULL_RETURN_MEMERR(*np); + r = node_str_cat_codepoint(*np, env->enc, tok->u.code); + if (r != 0) + return r; +#ifdef NUMBERED_CHAR_IS_NOT_CASE_AMBIG + NSTRING_SET_RAW(*np); +#else + goto string_loop; +#endif + } + break; + + case TK_QUOTE_OPEN: { + OnigCodePoint end_op[2]; + UChar *qstart, *qend, *nextp; + + end_op[0] = (OnigCodePoint)MC_ESC(env->syntax); + end_op[1] = (OnigCodePoint)'E'; + qstart = *src; + qend = find_str_position(end_op, 2, qstart, end, &nextp, env->enc); + if (IS_NULL(qend)) + { + nextp = qend = end; + } + *np = node_new_str(qstart, qend); + CHECK_NULL_RETURN_MEMERR(*np); + *src = nextp; + } + break; + + case TK_CHAR_TYPE: { + switch (tok->u.prop.ctype) + { + case ONIGENC_CTYPE_WORD: + *np = node_new_ctype(tok->u.prop.ctype, tok->u.prop.not, + IS_ASCII_RANGE(env->option)); + CHECK_NULL_RETURN_MEMERR(*np); + break; + + case ONIGENC_CTYPE_SPACE: + case ONIGENC_CTYPE_DIGIT: + case ONIGENC_CTYPE_XDIGIT: { + CClassNode *cc; + + *np = node_new_cclass(); + CHECK_NULL_RETURN_MEMERR(*np); + cc = NCCLASS(*np); + r = add_ctype_to_cc(cc, tok->u.prop.ctype, 0, + IS_ASCII_RANGE(env->option), env); + if (r != 0) + return r; + if (tok->u.prop.not!= 0) + NCCLASS_SET_NOT(cc); + } + break; + + default: + return ONIGERR_PARSER_BUG; + break; + } + } + break; + + case TK_CHAR_PROPERTY: + r = parse_char_property(np, tok, src, end, env); + if (r != 0) + return r; + break; + + case TK_CC_OPEN: { + Node *asc_node; + CClassNode *cc; + OnigCodePoint code; + + r = parse_char_class(np, &asc_node, tok, src, end, env); + if (r != 0) + { + onig_node_free(asc_node); + return r; + } + + cc = NCCLASS(*np); + if (is_onechar_cclass(cc, &code)) + { + onig_node_free(*np); + onig_node_free(asc_node); + *np = node_new_empty(); + CHECK_NULL_RETURN_MEMERR(*np); + r = node_str_cat_codepoint(*np, env->enc, code); + if (r != 0) + return r; + goto string_loop; + } + if (IS_IGNORECASE(env->option)) + { + r = cclass_case_fold(np, cc, NCCLASS(asc_node), env); + if (r != 0) + { + onig_node_free(asc_node); + return r; + } + } + onig_node_free(asc_node); + } + break; + + case TK_ANYCHAR: + *np = node_new_anychar(); + CHECK_NULL_RETURN_MEMERR(*np); + break; + + case TK_ANYCHAR_ANYTIME: + *np = node_new_anychar(); + CHECK_NULL_RETURN_MEMERR(*np); + qn = node_new_quantifier(0, REPEAT_INFINITE, 0); + CHECK_NULL_RETURN_MEMERR(qn); + NQTFR(qn)->target = *np; + *np = qn; + break; + + case TK_BACKREF: + len = tok->u.backref.num; + *np = node_new_backref( + len, (len > 1 ? tok->u.backref.refs : &(tok->u.backref.ref1)), + tok->u.backref.by_name, +#ifdef USE_BACKREF_WITH_LEVEL + tok->u.backref.exist_level, tok->u.backref.level, +#endif + env); + CHECK_NULL_RETURN_MEMERR(*np); + break; + +#ifdef USE_SUBEXP_CALL + case TK_CALL: { + int gnum = tok->u.call.gnum; + + if (gnum < 0 || tok->u.call.rel != 0) + { + if (gnum > 0) + gnum--; + gnum = BACKREF_REL_TO_ABS(gnum, env); + if (gnum <= 0) + return ONIGERR_INVALID_BACKREF; + } + *np = node_new_call(tok->u.call.name, tok->u.call.name_end, gnum); + CHECK_NULL_RETURN_MEMERR(*np); + env->num_call++; + } + break; +#endif + + case TK_ANCHOR: + *np = onig_node_new_anchor(tok->u.anchor.subtype); + CHECK_NULL_RETURN_MEMERR(*np); + NANCHOR(*np)->ascii_range = tok->u.anchor.ascii_range; + break; + + case TK_OP_REPEAT: + case TK_INTERVAL: + if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS)) + { + if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS)) + return ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED; + else + *np = node_new_empty(); + } + else + { + goto tk_byte; + } + break; + + default: + return ONIGERR_PARSER_BUG; + break; + } + + { + targetp = np; + + re_entry: + r = fetch_token(tok, src, end, env); + if (r < 0) + return r; + + repeat: + if (r == TK_OP_REPEAT || r == TK_INTERVAL) + { + if (is_invalid_quantifier_target(*targetp)) + return ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID; + + qn = node_new_quantifier(tok->u.repeat.lower, tok->u.repeat.upper, + (r == TK_INTERVAL ? 1 : 0)); + CHECK_NULL_RETURN_MEMERR(qn); + NQTFR(qn)->greedy = tok->u.repeat.greedy; + r = set_quantifier(qn, *targetp, group, env); + if (r < 0) + { + onig_node_free(qn); + return r; + } + + if (tok->u.repeat.possessive != 0) + { + Node *en; + en = node_new_enclose(ENCLOSE_STOP_BACKTRACK); + if (IS_NULL(en)) + { + onig_node_free(qn); + return ONIGERR_MEMORY; + } + NENCLOSE(en)->target = qn; + qn = en; + } + + if (r == 0) + { + *targetp = qn; + } + else if (r == 1) + { + onig_node_free(qn); + } + else if (r == 2) + { /* split case: /abc+/ */ + Node *tmp; + + *targetp = node_new_list(*targetp, NULL); + if (IS_NULL(*targetp)) + { + onig_node_free(qn); + return ONIGERR_MEMORY; + } + tmp = NCDR(*targetp) = node_new_list(qn, NULL); + if (IS_NULL(tmp)) + { + onig_node_free(qn); + return ONIGERR_MEMORY; + } + targetp = &(NCAR(tmp)); + } + goto re_entry; + } + } + + return r; +} + +static int parse_branch(Node **top, OnigToken *tok, int term, UChar **src, + UChar *end, ScanEnv *env) +{ + int r; + Node *node, **headp; + + *top = NULL; + r = parse_exp(&node, tok, term, src, end, env); + if (r < 0) + { + onig_node_free(node); + return r; + } + + if (r == TK_EOT || r == term || r == TK_ALT) + { + *top = node; + } + else + { + *top = node_new_list(node, NULL); + headp = &(NCDR(*top)); + while (r != TK_EOT && r != term && r != TK_ALT) + { + r = parse_exp(&node, tok, term, src, end, env); + if (r < 0) + { + onig_node_free(node); + return r; + } + + if (NTYPE(node) == NT_LIST) + { + *headp = node; + while (IS_NOT_NULL(NCDR(node))) + node = NCDR(node); + headp = &(NCDR(node)); + } + else + { + *headp = node_new_list(node, NULL); + headp = &(NCDR(*headp)); + } + } + } + + return r; +} + +/* term_tok: TK_EOT or TK_SUBEXP_CLOSE */ +static int parse_subexp(Node **top, OnigToken *tok, int term, UChar **src, + UChar *end, ScanEnv *env) +{ + int r; + Node *node, **headp; + + *top = NULL; + env->parse_depth++; + if (env->parse_depth > ParseDepthLimit) + return ONIGERR_PARSE_DEPTH_LIMIT_OVER; + r = parse_branch(&node, tok, term, src, end, env); + if (r < 0) + { + onig_node_free(node); + return r; + } + + if (r == term) + { + *top = node; + } + else if (r == TK_ALT) + { + *top = onig_node_new_alt(node, NULL); + headp = &(NCDR(*top)); + while (r == TK_ALT) + { + r = fetch_token(tok, src, end, env); + if (r < 0) + return r; + r = parse_branch(&node, tok, term, src, end, env); + if (r < 0) + { + onig_node_free(node); + return r; + } + + *headp = onig_node_new_alt(node, NULL); + headp = &(NCDR(*headp)); + } + + if (tok->type != (enum TokenSyms)term) + goto err; + } + else + { + onig_node_free(node); + err: + if (term == TK_SUBEXP_CLOSE) + return ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS; + else + return ONIGERR_PARSER_BUG; + } + + env->parse_depth--; + return r; +} + +static int parse_regexp(Node **top, UChar **src, UChar *end, ScanEnv *env) +{ + int r; + OnigToken tok; + + r = fetch_token(&tok, src, end, env); + if (r < 0) + return r; + r = parse_subexp(top, &tok, TK_EOT, src, end, env); + if (r < 0) + return r; + +#ifdef USE_SUBEXP_CALL + if (env->num_call > 0) + { + /* Capture the pattern itself. It is used for (?R), (?0) and \g<0>. */ + const int num = 0; + Node *np; + np = node_new_enclose_memory(env->option, 0); + CHECK_NULL_RETURN_MEMERR(np); + NENCLOSE(np)->regnum = num; + NENCLOSE(np)->target = *top; + r = scan_env_set_mem_node(env, num, np); + if (r != 0) + { + onig_node_free(np); + return r; + } + *top = np; + } +#endif + return 0; +} + +extern int onig_parse_make_tree(Node **root, const UChar *pattern, + const UChar *end, regex_t *reg, ScanEnv *env) +{ + int r; + UChar *p; + +#ifdef USE_NAMED_GROUP + names_clear(reg); +#endif + + scan_env_clear(env); + env->option = reg->options; + env->case_fold_flag = reg->case_fold_flag; + env->enc = reg->enc; + env->syntax = reg->syntax; + env->pattern = (UChar *)pattern; + env->pattern_end = (UChar *)end; + env->reg = reg; + + *root = NULL; + p = (UChar *)pattern; + r = parse_regexp(root, &p, (UChar *)end, env); + reg->num_mem = env->num_mem; + return r; +} + +extern void onig_scan_env_set_error_string(ScanEnv *env, int ecode ARG_UNUSED, + UChar *arg, UChar *arg_end) +{ + env->error = arg; + env->error_end = arg_end; +} diff --git a/lib/edbee-lib/vendor/onig/regparse.h b/lib/edbee-lib/vendor/onig/regparse.h new file mode 100644 index 00000000..e5b746ce --- /dev/null +++ b/lib/edbee-lib/vendor/onig/regparse.h @@ -0,0 +1,385 @@ +#ifndef ONIGMO_REGPARSE_H +#define ONIGMO_REGPARSE_H +/********************************************************************** + regparse.h - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regint.h" + +RUBY_SYMBOL_EXPORT_BEGIN + +/* node type */ +#define NT_STR 0 +#define NT_CCLASS 1 +#define NT_CTYPE 2 +#define NT_CANY 3 +#define NT_BREF 4 +#define NT_QTFR 5 +#define NT_ENCLOSE 6 +#define NT_ANCHOR 7 +#define NT_LIST 8 +#define NT_ALT 9 +#define NT_CALL 10 + +/* node type bit */ +#define NTYPE2BIT(type) (1 << (type)) + +#define BIT_NT_STR NTYPE2BIT(NT_STR) +#define BIT_NT_CCLASS NTYPE2BIT(NT_CCLASS) +#define BIT_NT_CTYPE NTYPE2BIT(NT_CTYPE) +#define BIT_NT_CANY NTYPE2BIT(NT_CANY) +#define BIT_NT_BREF NTYPE2BIT(NT_BREF) +#define BIT_NT_QTFR NTYPE2BIT(NT_QTFR) +#define BIT_NT_ENCLOSE NTYPE2BIT(NT_ENCLOSE) +#define BIT_NT_ANCHOR NTYPE2BIT(NT_ANCHOR) +#define BIT_NT_LIST NTYPE2BIT(NT_LIST) +#define BIT_NT_ALT NTYPE2BIT(NT_ALT) +#define BIT_NT_CALL NTYPE2BIT(NT_CALL) + +#define IS_NODE_TYPE_SIMPLE(type) \ + ((NTYPE2BIT(type) \ + & (BIT_NT_STR | BIT_NT_CCLASS | BIT_NT_CTYPE | BIT_NT_CANY | BIT_NT_BREF)) \ + != 0) + +#define NTYPE(node) ((node)->u.base.type) +#define SET_NTYPE(node, ntype) \ + do \ + { \ + int value = ntype; \ + memcpy(&((node)->u.base.type), &value, sizeof(int)); \ + } while (0) + +#define NSTR(node) (&((node)->u.str)) +#define NCCLASS(node) (&((node)->u.cclass)) +#define NCTYPE(node) (&((node)->u.ctype)) +#define NBREF(node) (&((node)->u.bref)) +#define NQTFR(node) (&((node)->u.qtfr)) +#define NENCLOSE(node) (&((node)->u.enclose)) +#define NANCHOR(node) (&((node)->u.anchor)) +#define NCONS(node) (&((node)->u.cons)) +#define NCALL(node) (&((node)->u.call)) + +#define NCAR(node) (NCONS(node)->car) +#define NCDR(node) (NCONS(node)->cdr) + +#define ANCHOR_ANYCHAR_STAR_MASK (ANCHOR_ANYCHAR_STAR | ANCHOR_ANYCHAR_STAR_ML) +#define ANCHOR_END_BUF_MASK (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF) + +#define ENCLOSE_MEMORY (1 << 0) +#define ENCLOSE_OPTION (1 << 1) +#define ENCLOSE_STOP_BACKTRACK (1 << 2) +#define ENCLOSE_CONDITION (1 << 3) +#define ENCLOSE_ABSENT (1 << 4) + +#define NODE_STR_MARGIN 16 +#define NODE_STR_BUF_SIZE 24 /* sizeof(CClassNode) - sizeof(int)*4 */ +#define NODE_BACKREFS_SIZE 6 + +#define NSTR_RAW (1 << 0) /* by backslashed number */ +#define NSTR_AMBIG (1 << 1) +#define NSTR_DONT_GET_OPT_INFO (1 << 2) + +#define NSTRING_LEN(node) (OnigDistance)((node)->u.str.end - (node)->u.str.s) +#define NSTRING_SET_RAW(node) (node)->u.str.flag |= NSTR_RAW +#define NSTRING_CLEAR_RAW(node) (node)->u.str.flag &= ~NSTR_RAW +#define NSTRING_SET_AMBIG(node) (node)->u.str.flag |= NSTR_AMBIG +#define NSTRING_SET_DONT_GET_OPT_INFO(node) \ + (node)->u.str.flag |= NSTR_DONT_GET_OPT_INFO +#define NSTRING_IS_RAW(node) (((node)->u.str.flag & NSTR_RAW) != 0) +#define NSTRING_IS_AMBIG(node) (((node)->u.str.flag & NSTR_AMBIG) != 0) +#define NSTRING_IS_DONT_GET_OPT_INFO(node) \ + (((node)->u.str.flag & NSTR_DONT_GET_OPT_INFO) != 0) + +#define BACKREFS_P(br) \ + (IS_NOT_NULL((br)->back_dynamic) ? (br)->back_dynamic : (br)->back_static); + +#define NQ_TARGET_ISNOT_EMPTY 0 +#define NQ_TARGET_IS_EMPTY 1 +#define NQ_TARGET_IS_EMPTY_MEM 2 +#define NQ_TARGET_IS_EMPTY_REC 3 + +/* status bits */ +#define NST_MIN_FIXED (1 << 0) +#define NST_MAX_FIXED (1 << 1) +#define NST_CLEN_FIXED (1 << 2) +#define NST_MARK1 (1 << 3) +#define NST_MARK2 (1 << 4) +#define NST_MEM_BACKREFED (1 << 5) +#define NST_STOP_BT_SIMPLE_REPEAT (1 << 6) +#define NST_RECURSION (1 << 7) +#define NST_CALLED (1 << 8) +#define NST_ADDR_FIXED (1 << 9) +#define NST_NAMED_GROUP (1 << 10) +#define NST_NAME_REF (1 << 11) +#define NST_IN_REPEAT (1 << 12) /* STK_REPEAT is nested in stack. */ +#define NST_NEST_LEVEL (1 << 13) +#define NST_BY_NUMBER (1 << 14) /* {n,m} */ + +#define SET_ENCLOSE_STATUS(node, f) (node)->u.enclose.state |= (f) +#define CLEAR_ENCLOSE_STATUS(node, f) (node)->u.enclose.state &= ~(f) + +#define IS_ENCLOSE_CALLED(en) (((en)->state & NST_CALLED) != 0) +#define IS_ENCLOSE_ADDR_FIXED(en) (((en)->state & NST_ADDR_FIXED) != 0) +#define IS_ENCLOSE_RECURSION(en) (((en)->state & NST_RECURSION) != 0) +#define IS_ENCLOSE_MARK1(en) (((en)->state & NST_MARK1) != 0) +#define IS_ENCLOSE_MARK2(en) (((en)->state & NST_MARK2) != 0) +#define IS_ENCLOSE_MIN_FIXED(en) (((en)->state & NST_MIN_FIXED) != 0) +#define IS_ENCLOSE_MAX_FIXED(en) (((en)->state & NST_MAX_FIXED) != 0) +#define IS_ENCLOSE_CLEN_FIXED(en) (((en)->state & NST_CLEN_FIXED) != 0) +#define IS_ENCLOSE_STOP_BT_SIMPLE_REPEAT(en) \ + (((en)->state & NST_STOP_BT_SIMPLE_REPEAT) != 0) +#define IS_ENCLOSE_NAMED_GROUP(en) (((en)->state & NST_NAMED_GROUP) != 0) +#define IS_ENCLOSE_NAME_REF(en) (((en)->state & NST_NAME_REF) != 0) + +#define SET_CALL_RECURSION(node) (node)->u.call.state |= NST_RECURSION +#define IS_CALL_RECURSION(cn) (((cn)->state & NST_RECURSION) != 0) +#define IS_CALL_NAME_REF(cn) (((cn)->state & NST_NAME_REF) != 0) +#define IS_BACKREF_NAME_REF(bn) (((bn)->state & NST_NAME_REF) != 0) +#define IS_BACKREF_NEST_LEVEL(bn) (((bn)->state & NST_NEST_LEVEL) != 0) +#define IS_QUANTIFIER_IN_REPEAT(qn) (((qn)->state & NST_IN_REPEAT) != 0) +#define IS_QUANTIFIER_BY_NUMBER(qn) (((qn)->state & NST_BY_NUMBER) != 0) + +#define CALLNODE_REFNUM_UNDEF -1 + +typedef struct +{ + NodeBase base; + UChar *s; + UChar *end; + unsigned int flag; + int capa; /* (allocated size - 1) or 0: use buf[] */ + UChar buf[NODE_STR_BUF_SIZE]; +} StrNode; + +typedef struct +{ + NodeBase base; + int state; + struct _Node *target; + int lower; + int upper; + int greedy; + int target_empty_info; + struct _Node *head_exact; + struct _Node *next_head_exact; + int is_refered; /* include called node. don't eliminate even if {0} */ +#ifdef USE_COMBINATION_EXPLOSION_CHECK + int comb_exp_check_num; /* 1,2,3...: check, 0: no check */ +#endif +} QtfrNode; + +typedef struct +{ + NodeBase base; + int state; + int type; + int regnum; + OnigOptionType option; + AbsAddrType call_addr; + struct _Node *target; + /* for multiple call reference */ + OnigDistance min_len; /* min length (byte) */ + OnigDistance max_len; /* max length (byte) */ + int char_len; /* character length */ + int opt_count; /* referenced count in optimize_node_left() */ +} EncloseNode; + +#ifdef USE_SUBEXP_CALL + +typedef struct +{ + int offset; + struct _Node *target; +} UnsetAddr; + +typedef struct +{ + int num; + int alloc; + UnsetAddr *us; +} UnsetAddrList; + +typedef struct +{ + NodeBase base; + int state; + int group_num; + UChar *name; + UChar *name_end; + struct _Node *target; /* EncloseNode : ENCLOSE_MEMORY */ + UnsetAddrList *unset_addr_list; +} CallNode; + +#endif + +typedef struct +{ + NodeBase base; + int state; + int back_num; + int back_static[NODE_BACKREFS_SIZE]; + int *back_dynamic; + int nest_level; +} BRefNode; + +typedef struct +{ + NodeBase base; + int type; + struct _Node *target; + int char_len; + int ascii_range; +} AnchorNode; + +typedef struct +{ + NodeBase base; + struct _Node *car; + struct _Node *cdr; +} ConsAltNode; + +typedef struct +{ + NodeBase base; + int ctype; + int not; + int ascii_range; +} CtypeNode; + +typedef struct _Node +{ + union + { + NodeBase base; + StrNode str; + CClassNode cclass; + QtfrNode qtfr; + EncloseNode enclose; + BRefNode bref; + AnchorNode anchor; + ConsAltNode cons; + CtypeNode ctype; +#ifdef USE_SUBEXP_CALL + CallNode call; +#endif + } u; +} Node; + +#define NULL_NODE ((Node *)0) + +#define SCANENV_MEMNODES_SIZE 8 +#define SCANENV_MEM_NODES(senv) \ + (IS_NOT_NULL((senv)->mem_nodes_dynamic) ? (senv)->mem_nodes_dynamic \ + : (senv)->mem_nodes_static) + +typedef struct +{ + OnigOptionType option; + OnigCaseFoldType case_fold_flag; + OnigEncoding enc; + const OnigSyntaxType *syntax; + BitStatusType capture_history; + BitStatusType bt_mem_start; + BitStatusType bt_mem_end; + BitStatusType backrefed_mem; + UChar *pattern; + UChar *pattern_end; + UChar *error; + UChar *error_end; + regex_t *reg; /* for reg->names only */ +#ifdef USE_SUBEXP_CALL + UnsetAddrList *unset_addr_list; +#endif + int num_call; + int num_mem; +#ifdef USE_NAMED_GROUP + int num_named; +#endif + int mem_alloc; + Node *mem_nodes_static[SCANENV_MEMNODES_SIZE]; + Node **mem_nodes_dynamic; +#ifdef USE_COMBINATION_EXPLOSION_CHECK + int num_comb_exp_check; + int comb_exp_max_regnum; + int curr_max_regnum; + int has_recursion; +#endif + unsigned int parse_depth; + int warnings_flag; +#ifdef RUBY + const char *sourcefile; + int sourceline; +#endif +} ScanEnv; + +#define IS_SYNTAX_OP(syn, opm) (((syn)->op & (opm)) != 0) +#define IS_SYNTAX_OP2(syn, opm) (((syn)->op2 & (opm)) != 0) +#define IS_SYNTAX_BV(syn, bvm) (((syn)->behavior & (bvm)) != 0) + +#ifdef USE_NAMED_GROUP +typedef struct +{ + int new_val; +} GroupNumRemap; + +extern int onig_renumber_name_table(regex_t *reg, GroupNumRemap *map); +#endif + +extern int onig_strncmp(const UChar *s1, const UChar *s2, int n); +extern void onig_strcpy(UChar *dest, const UChar *src, const UChar *end); +extern void onig_scan_env_set_error_string(ScanEnv *env, int ecode, UChar *arg, + UChar *arg_end); +extern int onig_scan_unsigned_number(UChar **src, const UChar *end, + OnigEncoding enc); +extern void onig_reduce_nested_quantifier(Node *pnode, Node *cnode); +extern void onig_node_conv_to_str_node(Node *node, int raw); +extern int onig_node_str_cat(Node *node, const UChar *s, const UChar *end); +extern int onig_node_str_set(Node *node, const UChar *s, const UChar *end); +extern void onig_node_free(Node *node); +extern Node *onig_node_new_enclose(int type); +extern Node *onig_node_new_anchor(int type); +extern Node *onig_node_new_str(const UChar *s, const UChar *end); +extern Node *onig_node_new_list(Node *left, Node *right); +extern Node *onig_node_list_add(Node *list, Node *x); +extern Node *onig_node_new_alt(Node *left, Node *right); +extern void onig_node_str_clear(Node *node); +extern int onig_names_free(regex_t *reg); +extern int onig_parse_make_tree(Node **root, const UChar *pattern, + const UChar *end, regex_t *reg, ScanEnv *env); +extern int onig_free_shared_cclass_table(void); + +#ifdef ONIG_DEBUG +# ifdef USE_NAMED_GROUP +extern int onig_print_names(FILE *, regex_t *); +# endif +#endif + +RUBY_SYMBOL_EXPORT_END + +#endif /* ONIGMO_REGPARSE_H */ diff --git a/lib/edbee-lib/vendor/onig/regposerr.c b/lib/edbee-lib/vendor/onig/regposerr.c new file mode 100644 index 00000000..0a93d3be --- /dev/null +++ b/lib/edbee-lib/vendor/onig/regposerr.c @@ -0,0 +1,103 @@ +/********************************************************************** + regposerr.c - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "config.h" +#include "onigmoposix.h" +#include <string.h> + +#if defined(__GNUC__) +# define ARG_UNUSED __attribute__((unused)) +#else +# define ARG_UNUSED +#endif + +#if defined(_WIN32) && !defined(__GNUC__) +# define xsnprintf sprintf_s +# define xstrncpy(dest, src, size) strncpy_s(dest, size, src, _TRUNCATE) +#else +# define xsnprintf snprintf +# define xstrncpy strncpy +#endif + +#define numberof(array) (int)(sizeof(array) / sizeof((array)[0])) + +static const char *ESTRING[] = { + NULL, "failed to match", /* REG_NOMATCH */ + "Invalid regular expression", /* REG_BADPAT */ + "invalid collating element referenced", /* REG_ECOLLATE */ + "invalid character class type referenced", /* REG_ECTYPE */ + "bad backslash-escape sequence", /* REG_EESCAPE */ + "invalid back reference number", /* REG_ESUBREG */ + "imbalanced [ and ]", /* REG_EBRACK */ + "imbalanced ( and )", /* REG_EPAREN */ + "imbalanced { and }", /* REG_EBRACE */ + "invalid repeat range {n,m}", /* REG_BADBR */ + "invalid range", /* REG_ERANGE */ + "Out of memory", /* REG_ESPACE */ + "? * + not preceded by valid regular expression", /* REG_BADRPT */ + + /* Extended errors */ + "internal error", /* REG_EONIG_INTERNAL */ + "invalid wide char value", /* REG_EONIG_BADWC */ + "invalid argument", /* REG_EONIG_BADARG */ +}; + +#include <stdio.h> + +extern size_t regerror(int posix_ecode, const regex_t *reg ARG_UNUSED, + char *buf, size_t size) +{ + const char *s; + char tbuf[35]; + size_t len; + + if (posix_ecode > 0 && posix_ecode < numberof(ESTRING)) + { + s = ESTRING[posix_ecode]; + } + else if (posix_ecode == 0) + { + s = ""; + } + else + { + xsnprintf(tbuf, sizeof(tbuf), "undefined error code (%d)", posix_ecode); + s = tbuf; + } + + len = strlen(s) + 1; /* use strlen() because s is ascii encoding. */ + + if (buf != NULL && size > 0) + { + xstrncpy(buf, s, size - 1); + buf[size - 1] = '\0'; + } + return len; +} diff --git a/lib/edbee-lib/vendor/onig/regposix.c b/lib/edbee-lib/vendor/onig/regposix.c new file mode 100644 index 00000000..c15f1e86 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/regposix.c @@ -0,0 +1,312 @@ +/********************************************************************** + regposix.c - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#define regex_t onig_regex_t +#include "regint.h" +#undef regex_t +#include "onigmoposix.h" + +#define ONIG_C(reg) ((onig_regex_t *)((reg)->onig)) +#define PONIG_C(reg) ((onig_regex_t **)(&(reg)->onig)) + +/* #define ENC_STRING_LEN(enc,s,len) len = strlen(s) */ +#define ENC_STRING_LEN(enc, s, len) \ + do \ + { \ + if (ONIGENC_MBC_MINLEN(enc) == 1) \ + { \ + UChar *tmps = (UChar *)(s); \ + while (*tmps != 0) \ + tmps++; \ + len = (int)(tmps - (UChar *)(s)); \ + } \ + else \ + { \ + len = onigenc_str_bytelen_null(enc, (UChar *)s); \ + } \ + } while (0) + +typedef struct +{ + int onig_err; + int posix_err; +} O2PERR; + +static int onig2posix_error_code(int code) +{ + static const O2PERR o2p[] = { + {ONIG_MISMATCH, REG_NOMATCH}, + {ONIG_NO_SUPPORT_CONFIG, REG_EONIG_INTERNAL}, + {ONIGERR_MEMORY, REG_ESPACE}, + {ONIGERR_MATCH_STACK_LIMIT_OVER, REG_EONIG_INTERNAL}, + {ONIGERR_TYPE_BUG, REG_EONIG_INTERNAL}, + {ONIGERR_PARSER_BUG, REG_EONIG_INTERNAL}, + {ONIGERR_STACK_BUG, REG_EONIG_INTERNAL}, + {ONIGERR_UNDEFINED_BYTECODE, REG_EONIG_INTERNAL}, + {ONIGERR_UNEXPECTED_BYTECODE, REG_EONIG_INTERNAL}, + {ONIGERR_DEFAULT_ENCODING_IS_NOT_SET, REG_EONIG_BADARG}, + {ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR, REG_EONIG_BADARG}, + {ONIGERR_INVALID_ARGUMENT, REG_EONIG_BADARG}, + {ONIGERR_END_PATTERN_AT_LEFT_BRACE, REG_EBRACE}, + {ONIGERR_END_PATTERN_AT_LEFT_BRACKET, REG_EBRACK}, + {ONIGERR_EMPTY_CHAR_CLASS, REG_ECTYPE}, + {ONIGERR_PREMATURE_END_OF_CHAR_CLASS, REG_ECTYPE}, + {ONIGERR_END_PATTERN_AT_ESCAPE, REG_EESCAPE}, + {ONIGERR_END_PATTERN_AT_META, REG_EESCAPE}, + {ONIGERR_END_PATTERN_AT_CONTROL, REG_EESCAPE}, + {ONIGERR_META_CODE_SYNTAX, REG_BADPAT}, + {ONIGERR_CONTROL_CODE_SYNTAX, REG_BADPAT}, + {ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE, REG_ECTYPE}, + {ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE, REG_ECTYPE}, + {ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS, REG_ECTYPE}, + {ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED, REG_BADRPT}, + {ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID, REG_BADRPT}, + {ONIGERR_NESTED_REPEAT_OPERATOR, REG_BADRPT}, + {ONIGERR_UNMATCHED_CLOSE_PARENTHESIS, REG_EPAREN}, + {ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS, REG_EPAREN}, + {ONIGERR_END_PATTERN_IN_GROUP, REG_BADPAT}, + {ONIGERR_UNDEFINED_GROUP_OPTION, REG_BADPAT}, + {ONIGERR_INVALID_POSIX_BRACKET_TYPE, REG_BADPAT}, + {ONIGERR_INVALID_LOOK_BEHIND_PATTERN, REG_BADPAT}, + {ONIGERR_INVALID_REPEAT_RANGE_PATTERN, REG_BADPAT}, + {ONIGERR_TOO_BIG_NUMBER, REG_BADPAT}, + {ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE, REG_BADBR}, + {ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE, REG_BADBR}, + {ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS, REG_ECTYPE}, + {ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE, REG_ECTYPE}, + {ONIGERR_TOO_MANY_MULTI_BYTE_RANGES, REG_ECTYPE}, + {ONIGERR_TOO_SHORT_MULTI_BYTE_STRING, REG_BADPAT}, + {ONIGERR_TOO_BIG_BACKREF_NUMBER, REG_ESUBREG}, + {ONIGERR_INVALID_BACKREF, REG_ESUBREG}, + {ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED, REG_BADPAT}, + {ONIGERR_TOO_BIG_WIDE_CHAR_VALUE, REG_EONIG_BADWC}, + {ONIGERR_TOO_LONG_WIDE_CHAR_VALUE, REG_EONIG_BADWC}, + {ONIGERR_INVALID_CODE_POINT_VALUE, REG_EONIG_BADWC}, + {ONIGERR_EMPTY_GROUP_NAME, REG_BADPAT}, + {ONIGERR_INVALID_GROUP_NAME, REG_BADPAT}, + {ONIGERR_INVALID_CHAR_IN_GROUP_NAME, REG_BADPAT}, + {ONIGERR_UNDEFINED_NAME_REFERENCE, REG_BADPAT}, + {ONIGERR_UNDEFINED_GROUP_REFERENCE, REG_BADPAT}, + {ONIGERR_MULTIPLEX_DEFINED_NAME, REG_BADPAT}, + {ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL, REG_BADPAT}, + {ONIGERR_NEVER_ENDING_RECURSION, REG_BADPAT}, + {ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY, REG_BADPAT}, + {ONIGERR_INVALID_CHAR_PROPERTY_NAME, REG_BADPAT}, + {ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION, REG_EONIG_BADARG}, + + }; + + int i; + + if (code >= 0) + return 0; + + for (i = 0; i < numberof(o2p); i++) + { + if (code == o2p[i].onig_err) + return o2p[i].posix_err; + } + + return REG_EONIG_INTERNAL; /* but, unknown error code */ +} + +extern int regcomp(regex_t *reg, const char *pattern, int posix_options) +{ + int r, len; + const OnigSyntaxType *syntax = OnigDefaultSyntax; + OnigOptionType options; + + if ((posix_options & REG_EXTENDED) == 0) + syntax = ONIG_SYNTAX_POSIX_BASIC; + + options = syntax->options; + if ((posix_options & REG_ICASE) != 0) + ONIG_OPTION_ON(options, ONIG_OPTION_IGNORECASE); + if ((posix_options & REG_NEWLINE) != 0) + { + ONIG_OPTION_ON(options, ONIG_OPTION_NEGATE_SINGLELINE); + ONIG_OPTION_OFF(options, ONIG_OPTION_SINGLELINE); + } + + reg->comp_options = posix_options; + + ENC_STRING_LEN(OnigEncDefaultCharEncoding, pattern, len); + r = onig_new(PONIG_C(reg), (UChar *)pattern, (UChar *)(pattern + len), + options, OnigEncDefaultCharEncoding, syntax, + (OnigErrorInfo *)NULL); + if (r != ONIG_NORMAL) + { + return onig2posix_error_code(r); + } + + reg->re_nsub = ONIG_C(reg)->num_mem; + return 0; +} + +extern int regexec(regex_t *reg, const char *str, size_t nmatch, + regmatch_t pmatch[], int posix_options) +{ + int r, i, len; + UChar *end; + OnigRegion *region = NULL; + OnigOptionType options; + + options = ONIG_OPTION_NONE; + if ((posix_options & REG_NOTBOL) != 0) + options |= ONIG_OPTION_NOTBOL; + if ((posix_options & REG_NOTEOL) != 0) + options |= ONIG_OPTION_NOTEOL; + + if ((reg->comp_options & REG_NOSUB) != 0) + { + nmatch = 0; + } + else if (nmatch != 0) + { + region = onig_region_new(); + if (region == NULL) + return REG_ESPACE; + } + + ENC_STRING_LEN(ONIG_C(reg)->enc, str, len); + end = (UChar *)(str + len); + r = (int)onig_search(ONIG_C(reg), (UChar *)str, end, (UChar *)str, end, + region, options); + + if (r >= 0) + { + r = 0; /* Match */ + for (i = 0; i < (int)nmatch; i++) + { + pmatch[i].rm_so = (regoff_t)region->beg[i]; + pmatch[i].rm_eo = (regoff_t)region->end[i]; + } + } + else if (r == ONIG_MISMATCH) + { + r = REG_NOMATCH; + for (i = 0; i < (int)nmatch; i++) + pmatch[i].rm_so = pmatch[i].rm_eo = ONIG_REGION_NOTPOS; + } + else + { + r = onig2posix_error_code(r); + } + + if (region != NULL) + onig_region_free(region, 1); + +#if 0 + if (reg->re_nsub > nmatch - 1) + reg->re_nsub = (nmatch <= 1 ? 0 : nmatch - 1); +#endif + + return r; +} + +extern void regfree(regex_t *reg) +{ + onig_free(ONIG_C(reg)); +} + +extern void reg_set_encoding(int mb_code) +{ + OnigEncoding enc; + + switch (mb_code) + { + case REG_POSIX_ENCODING_ASCII: + enc = ONIG_ENCODING_ASCII; + break; + case REG_POSIX_ENCODING_EUC_JP: + enc = ONIG_ENCODING_EUC_JP; + break; + case REG_POSIX_ENCODING_SJIS: + enc = ONIG_ENCODING_SJIS; + break; + case REG_POSIX_ENCODING_UTF8: + enc = ONIG_ENCODING_UTF8; + break; + case REG_POSIX_ENCODING_UTF16_BE: + enc = ONIG_ENCODING_UTF16_BE; + break; + case REG_POSIX_ENCODING_UTF16_LE: + enc = ONIG_ENCODING_UTF16_LE; + break; + + default: + return; + break; + } + + onigenc_set_default_encoding(enc); +} + +extern int reg_name_to_group_numbers(regex_t *reg, const unsigned char *name, + const unsigned char *name_end, int **nums) +{ + return onig_name_to_group_numbers(ONIG_C(reg), name, name_end, nums); +} + +typedef struct +{ + int (*func)(const unsigned char *, const unsigned char *, int, int *, + regex_t *, void *); + regex_t *reg; + void *arg; +} i_wrap; + +static int i_wrapper(const UChar *name, const UChar *name_end, int ng, int *gs, + onig_regex_t *reg ARG_UNUSED, void *arg) +{ + i_wrap *warg = (i_wrap *)arg; + + return (*warg->func)(name, name_end, ng, gs, warg->reg, warg->arg); +} + +extern int reg_foreach_name(regex_t *reg, + int (*func)(const unsigned char *, + const unsigned char *, int, int *, + regex_t *, void *), + void *arg) +{ + i_wrap warg; + + warg.func = func; + warg.reg = reg; + warg.arg = arg; + + return onig_foreach_name(ONIG_C(reg), i_wrapper, &warg); +} + +extern int reg_number_of_names(regex_t *reg) +{ + return onig_number_of_names(ONIG_C(reg)); +} diff --git a/lib/edbee-lib/vendor/onig/regsyntax.c b/lib/edbee-lib/vendor/onig/regsyntax.c new file mode 100644 index 00000000..edb749f1 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/regsyntax.c @@ -0,0 +1,395 @@ +/********************************************************************** + regsyntax.c - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regint.h" + +const OnigSyntaxType OnigSyntaxASIS + = {0, + ONIG_SYN_OP2_INEFFECTIVE_ESCAPE, + 0, + ONIG_OPTION_NONE, + { + (OnigCodePoint)'\\' /* esc */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ + }}; + +const OnigSyntaxType OnigSyntaxPosixBasic + = {(SYN_POSIX_COMMON_OP | ONIG_SYN_OP_ESC_LPAREN_SUBEXP + | ONIG_SYN_OP_ESC_BRACE_INTERVAL), + 0, + 0, + (ONIG_OPTION_SINGLELINE | ONIG_OPTION_MULTILINE), + { + (OnigCodePoint)'\\' /* esc */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ + }}; + +const OnigSyntaxType OnigSyntaxPosixExtended + = {(SYN_POSIX_COMMON_OP | ONIG_SYN_OP_LPAREN_SUBEXP + | ONIG_SYN_OP_BRACE_INTERVAL | ONIG_SYN_OP_PLUS_ONE_INF + | ONIG_SYN_OP_QMARK_ZERO_ONE | ONIG_SYN_OP_VBAR_ALT), + 0, + (ONIG_SYN_CONTEXT_INDEP_ANCHORS | ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS + | ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS + | ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP + | ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC), + (ONIG_OPTION_SINGLELINE | ONIG_OPTION_MULTILINE), + { + (OnigCodePoint)'\\' /* esc */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ + }}; + +const OnigSyntaxType OnigSyntaxEmacs + = {(ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_BRACKET_CC + | ONIG_SYN_OP_ESC_BRACE_INTERVAL | ONIG_SYN_OP_ESC_LPAREN_SUBEXP + | ONIG_SYN_OP_ESC_VBAR_ALT | ONIG_SYN_OP_ASTERISK_ZERO_INF + | ONIG_SYN_OP_PLUS_ONE_INF | ONIG_SYN_OP_QMARK_ZERO_ONE + | ONIG_SYN_OP_DECIMAL_BACKREF | ONIG_SYN_OP_LINE_ANCHOR + | ONIG_SYN_OP_ESC_CONTROL_CHARS), + ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR, + ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC, + ONIG_OPTION_NONE, + { + (OnigCodePoint)'\\' /* esc */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ + }}; + +const OnigSyntaxType OnigSyntaxGrep + = {(ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_BRACKET_CC + | ONIG_SYN_OP_POSIX_BRACKET | ONIG_SYN_OP_ESC_BRACE_INTERVAL + | ONIG_SYN_OP_ESC_LPAREN_SUBEXP | ONIG_SYN_OP_ESC_VBAR_ALT + | ONIG_SYN_OP_ASTERISK_ZERO_INF | ONIG_SYN_OP_ESC_PLUS_ONE_INF + | ONIG_SYN_OP_ESC_QMARK_ZERO_ONE | ONIG_SYN_OP_LINE_ANCHOR + | ONIG_SYN_OP_ESC_W_WORD | ONIG_SYN_OP_ESC_B_WORD_BOUND + | ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END | ONIG_SYN_OP_DECIMAL_BACKREF), + 0, + (ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC | ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC), + ONIG_OPTION_NONE, + { + (OnigCodePoint)'\\' /* esc */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ + }}; + +const OnigSyntaxType OnigSyntaxGnuRegex + = {SYN_GNU_REGEX_OP, + 0, + SYN_GNU_REGEX_BV, + ONIG_OPTION_NONE, + { + (OnigCodePoint)'\\' /* esc */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ + }}; + +const OnigSyntaxType OnigSyntaxJava + = {((SYN_GNU_REGEX_OP | ONIG_SYN_OP_QMARK_NON_GREEDY + | ONIG_SYN_OP_ESC_CONTROL_CHARS | ONIG_SYN_OP_ESC_C_CONTROL + | ONIG_SYN_OP_ESC_OCTAL3 | ONIG_SYN_OP_ESC_X_HEX2) + & ~ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END), + (ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE | ONIG_SYN_OP2_QMARK_GROUP_EFFECT + | ONIG_SYN_OP2_OPTION_PERL | ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT + | ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL | ONIG_SYN_OP2_CCLASS_SET_OP + | ONIG_SYN_OP2_ESC_V_VTAB | ONIG_SYN_OP2_ESC_U_HEX4 + | ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY), + (SYN_GNU_REGEX_BV | ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND), + (ONIG_OPTION_SINGLELINE | ONIG_OPTION_ASCII_RANGE + | ONIG_OPTION_WORD_BOUND_ALL_RANGE), + { + (OnigCodePoint)'\\' /* esc */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ + }}; + +/* Perl 5.8 */ +const OnigSyntaxType OnigSyntaxPerl58 = { + ((SYN_GNU_REGEX_OP | ONIG_SYN_OP_QMARK_NON_GREEDY | ONIG_SYN_OP_ESC_OCTAL3 + | ONIG_SYN_OP_ESC_X_HEX2 | ONIG_SYN_OP_ESC_X_BRACE_HEX8 + | ONIG_SYN_OP_ESC_CONTROL_CHARS | ONIG_SYN_OP_ESC_C_CONTROL) + & ~ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END), + (ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE | ONIG_SYN_OP2_QMARK_GROUP_EFFECT + | ONIG_SYN_OP2_OPTION_PERL | ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY + | ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT + | ONIG_SYN_OP2_ESC_CAPITAL_X_EXTENDED_GRAPHEME_CLUSTER + | ONIG_SYN_OP2_QMARK_LPAREN_CONDITION), + SYN_GNU_REGEX_BV, + ONIG_OPTION_SINGLELINE, + { + (OnigCodePoint)'\\' /* esc */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ + }}; + +/* Perl 5.8 + named group */ +const OnigSyntaxType OnigSyntaxPerl58_NG = { + ((SYN_GNU_REGEX_OP | ONIG_SYN_OP_QMARK_NON_GREEDY | ONIG_SYN_OP_ESC_OCTAL3 + | ONIG_SYN_OP_ESC_X_HEX2 | ONIG_SYN_OP_ESC_X_BRACE_HEX8 + | ONIG_SYN_OP_ESC_CONTROL_CHARS | ONIG_SYN_OP_ESC_C_CONTROL) + & ~ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END), + (ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE | ONIG_SYN_OP2_QMARK_GROUP_EFFECT + | ONIG_SYN_OP2_OPTION_PERL | ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY + | ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT + | ONIG_SYN_OP2_ESC_CAPITAL_X_EXTENDED_GRAPHEME_CLUSTER + | ONIG_SYN_OP2_QMARK_LPAREN_CONDITION | ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP + | ONIG_SYN_OP2_ESC_K_NAMED_BACKREF | ONIG_SYN_OP2_ESC_G_SUBEXP_CALL), + (SYN_GNU_REGEX_BV | ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP + | ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME), + ONIG_OPTION_SINGLELINE, + { + (OnigCodePoint)'\\' /* esc */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ + }}; + +/* Perl 5.10+ */ +const OnigSyntaxType OnigSyntaxPerl = { + ((SYN_GNU_REGEX_OP | ONIG_SYN_OP_QMARK_NON_GREEDY | ONIG_SYN_OP_ESC_OCTAL3 + | ONIG_SYN_OP_ESC_X_HEX2 | ONIG_SYN_OP_ESC_X_BRACE_HEX8 + | ONIG_SYN_OP_ESC_CONTROL_CHARS | ONIG_SYN_OP_ESC_O_BRACE_OCTAL + | ONIG_SYN_OP_ESC_C_CONTROL) + & ~ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END), + (ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE | ONIG_SYN_OP2_QMARK_GROUP_EFFECT + | ONIG_SYN_OP2_OPTION_PERL | ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY + | ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT + | ONIG_SYN_OP2_ESC_CAPITAL_X_EXTENDED_GRAPHEME_CLUSTER + | ONIG_SYN_OP2_QMARK_LPAREN_CONDITION | ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT + | ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL + | ONIG_SYN_OP2_ESC_CAPITAL_R_LINEBREAK | ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP + | ONIG_SYN_OP2_QMARK_SUBEXP_CALL | ONIG_SYN_OP2_ESC_G_BRACE_BACKREF + | ONIG_SYN_OP2_QMARK_CAPITAL_P_NAMED_GROUP + | ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP | ONIG_SYN_OP2_ESC_K_NAMED_BACKREF), + (SYN_GNU_REGEX_BV | ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME + | ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME_CALL + | ONIG_SYN_USE_LEFT_MOST_NAMED_GROUP), + (ONIG_OPTION_SINGLELINE | ONIG_OPTION_CAPTURE_GROUP), + { + (OnigCodePoint)'\\' /* esc */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ + }}; + +const OnigSyntaxType OnigSyntaxPython = { + ((SYN_GNU_REGEX_OP | ONIG_SYN_OP_QMARK_NON_GREEDY | ONIG_SYN_OP_ESC_OCTAL3 + | ONIG_SYN_OP_ESC_X_HEX2 | ONIG_SYN_OP_ESC_X_BRACE_HEX8 + | ONIG_SYN_OP_ESC_CONTROL_CHARS | ONIG_SYN_OP_ESC_C_CONTROL) + & ~ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END), + (ONIG_SYN_OP2_QMARK_GROUP_EFFECT | ONIG_SYN_OP2_OPTION_PERL + | ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY + | ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT + | ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT | ONIG_SYN_OP2_ESC_V_VTAB + | ONIG_SYN_OP2_ESC_U_HEX4 | ONIG_SYN_OP2_QMARK_LPAREN_CONDITION + | ONIG_SYN_OP2_QMARK_CAPITAL_P_NAMED_GROUP), + (SYN_GNU_REGEX_BV | ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV), + (ONIG_OPTION_SINGLELINE | ONIG_OPTION_ASCII_RANGE), + { + (OnigCodePoint)'\\' /* esc */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */ + , + (OnigCodePoint)ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */ + }}; + +extern int onig_set_default_syntax(const OnigSyntaxType *syntax) +{ + if (IS_NULL(syntax)) + syntax = ONIG_SYNTAX_RUBY; + + OnigDefaultSyntax = syntax; + return 0; +} + +extern void onig_copy_syntax(OnigSyntaxType *to, const OnigSyntaxType *from) +{ + *to = *from; +} + +extern void onig_set_syntax_op(OnigSyntaxType *syntax, unsigned int op) +{ + syntax->op = op; +} + +extern void onig_set_syntax_op2(OnigSyntaxType *syntax, unsigned int op2) +{ + syntax->op2 = op2; +} + +extern void onig_set_syntax_behavior(OnigSyntaxType *syntax, + unsigned int behavior) +{ + syntax->behavior = behavior; +} + +extern void onig_set_syntax_options(OnigSyntaxType *syntax, + OnigOptionType options) +{ + syntax->options = options; +} + +extern unsigned int onig_get_syntax_op(const OnigSyntaxType *syntax) +{ + return syntax->op; +} + +extern unsigned int onig_get_syntax_op2(const OnigSyntaxType *syntax) +{ + return syntax->op2; +} + +extern unsigned int onig_get_syntax_behavior(const OnigSyntaxType *syntax) +{ + return syntax->behavior; +} + +extern OnigOptionType onig_get_syntax_options(const OnigSyntaxType *syntax) +{ + return syntax->options; +} + +#ifdef USE_VARIABLE_META_CHARS +extern int onig_set_meta_char(OnigSyntaxType *enc, unsigned int what, + OnigCodePoint code) +{ + switch (what) + { + case ONIG_META_CHAR_ESCAPE: + enc->meta_char_table.esc = code; + break; + case ONIG_META_CHAR_ANYCHAR: + enc->meta_char_table.anychar = code; + break; + case ONIG_META_CHAR_ANYTIME: + enc->meta_char_table.anytime = code; + break; + case ONIG_META_CHAR_ZERO_OR_ONE_TIME: + enc->meta_char_table.zero_or_one_time = code; + break; + case ONIG_META_CHAR_ONE_OR_MORE_TIME: + enc->meta_char_table.one_or_more_time = code; + break; + case ONIG_META_CHAR_ANYCHAR_ANYTIME: + enc->meta_char_table.anychar_anytime = code; + break; + default: + return ONIGERR_INVALID_ARGUMENT; + break; + } + return 0; +} +#endif /* USE_VARIABLE_META_CHARS */ diff --git a/lib/edbee-lib/vendor/onig/regtrav.c b/lib/edbee-lib/vendor/onig/regtrav.c new file mode 100644 index 00000000..cf6611e1 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/regtrav.c @@ -0,0 +1,85 @@ +/********************************************************************** + regtrav.c - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2004 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "regint.h" + +#ifdef USE_CAPTURE_HISTORY + +static int capture_tree_traverse(OnigCaptureTreeNode *node, int at, + int (*callback_func)(int, OnigPosition, + OnigPosition, int, int, + void *), + int level, void *arg) +{ + int r, i; + + if (node == (OnigCaptureTreeNode *)0) + return 0; + + if ((at & ONIG_TRAVERSE_CALLBACK_AT_FIRST) != 0) + { + r = (*callback_func)(node->group, node->beg, node->end, level, + ONIG_TRAVERSE_CALLBACK_AT_FIRST, arg); + if (r != 0) + return r; + } + + for (i = 0; i < node->num_childs; i++) + { + r = capture_tree_traverse(node->childs[i], at, callback_func, level + 1, + arg); + if (r != 0) + return r; + } + + if ((at & ONIG_TRAVERSE_CALLBACK_AT_LAST) != 0) + { + r = (*callback_func)(node->group, node->beg, node->end, level, + ONIG_TRAVERSE_CALLBACK_AT_LAST, arg); + if (r != 0) + return r; + } + + return 0; +} +#endif /* USE_CAPTURE_HISTORY */ + +extern int onig_capture_tree_traverse(OnigRegion *region, int at, + int (*callback_func)(int, OnigPosition, + OnigPosition, int, + int, void *), + void *arg) +{ +#ifdef USE_CAPTURE_HISTORY + return capture_tree_traverse(region->history_root, at, callback_func, 0, arg); +#else + return ONIG_NO_SUPPORT_CONFIG; +#endif +} diff --git a/lib/edbee-lib/vendor/onig/regversion.c b/lib/edbee-lib/vendor/onig/regversion.c new file mode 100644 index 00000000..fa826c44 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/regversion.c @@ -0,0 +1,53 @@ +/********************************************************************** + regversion.c - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> + * Copyright (c) 2011-2017 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "onigmo.h" + +#define TOSTR_(a) #a +#define ONIG_VERSION_TOSTR_(a, b, c) TOSTR_(a) "." TOSTR_(b) "." TOSTR_(c) +#define ONIG_VERSION_STRING \ + ONIG_VERSION_TOSTR_(ONIGMO_VERSION_MAJOR, ONIGMO_VERSION_MINOR, \ + ONIGMO_VERSION_TEENY) + +extern const char *onig_version(void) +{ + const char *s = ONIG_VERSION_STRING; + + return s; +} + +extern const char *onig_copyright(void) +{ + const char *s + = "Onigmo " ONIG_VERSION_STRING " : Copyright (C) 2002-2016 K.Kosako, " + "2011-2017 K.Takata"; + + return s; +} diff --git a/lib/edbee-lib/vendor/onig/sample/Makefile.am b/lib/edbee-lib/vendor/onig/sample/Makefile.am new file mode 100644 index 00000000..6bca32a5 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/sample/Makefile.am @@ -0,0 +1,29 @@ +noinst_PROGRAMS = encode listcap names posix simple sql syntax scan crnl + +libname = $(top_builddir)/libonigmo.la +LDADD = $(libname) +INCLUDES = -I$(top_srcdir) -I$(includedir) + +encode_SOURCES = encode.c +listcap_SOURCES = listcap.c +names_SOURCES = names.c +posix_SOURCES = posix.c +simple_SOURCES = simple.c +sql_SOURCES = sql.c +syntax_SOURCES = syntax.c +scan_SOURCES = scan.c +crnl_SOURCES = crnl.c + + +sampledir = $(top_builddir)/sample + +test: encode$(EXEEXT) listcap$(EXEEXT) names$(EXEEXT) posix$(EXEEXT) simple$(EXEEXT) sql$(EXEEXT) syntax$(EXEEXT) scan$(EXEEXT) crnl$(EXEEXT) + $(sampledir)/encode + $(sampledir)/listcap + $(sampledir)/names + $(sampledir)/posix + $(sampledir)/simple + $(sampledir)/sql + $(sampledir)/syntax + $(sampledir)/scan + $(sampledir)/crnl diff --git a/lib/edbee-lib/vendor/onig/sample/Makefile.in b/lib/edbee-lib/vendor/onig/sample/Makefile.in new file mode 100644 index 00000000..ecb77e07 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/sample/Makefile.in @@ -0,0 +1,596 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = encode$(EXEEXT) listcap$(EXEEXT) names$(EXEEXT) \ + posix$(EXEEXT) simple$(EXEEXT) sql$(EXEEXT) syntax$(EXEEXT) \ + scan$(EXEEXT) crnl$(EXEEXT) +subdir = sample +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_crnl_OBJECTS = crnl.$(OBJEXT) +crnl_OBJECTS = $(am_crnl_OBJECTS) +crnl_LDADD = $(LDADD) +crnl_DEPENDENCIES = $(libname) +am_encode_OBJECTS = encode.$(OBJEXT) +encode_OBJECTS = $(am_encode_OBJECTS) +encode_LDADD = $(LDADD) +encode_DEPENDENCIES = $(libname) +am_listcap_OBJECTS = listcap.$(OBJEXT) +listcap_OBJECTS = $(am_listcap_OBJECTS) +listcap_LDADD = $(LDADD) +listcap_DEPENDENCIES = $(libname) +am_names_OBJECTS = names.$(OBJEXT) +names_OBJECTS = $(am_names_OBJECTS) +names_LDADD = $(LDADD) +names_DEPENDENCIES = $(libname) +am_posix_OBJECTS = posix.$(OBJEXT) +posix_OBJECTS = $(am_posix_OBJECTS) +posix_LDADD = $(LDADD) +posix_DEPENDENCIES = $(libname) +am_scan_OBJECTS = scan.$(OBJEXT) +scan_OBJECTS = $(am_scan_OBJECTS) +scan_LDADD = $(LDADD) +scan_DEPENDENCIES = $(libname) +am_simple_OBJECTS = simple.$(OBJEXT) +simple_OBJECTS = $(am_simple_OBJECTS) +simple_LDADD = $(LDADD) +simple_DEPENDENCIES = $(libname) +am_sql_OBJECTS = sql.$(OBJEXT) +sql_OBJECTS = $(am_sql_OBJECTS) +sql_LDADD = $(LDADD) +sql_DEPENDENCIES = $(libname) +am_syntax_OBJECTS = syntax.$(OBJEXT) +syntax_OBJECTS = $(am_syntax_OBJECTS) +syntax_LDADD = $(LDADD) +syntax_DEPENDENCIES = $(libname) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(crnl_SOURCES) $(encode_SOURCES) $(listcap_SOURCES) \ + $(names_SOURCES) $(posix_SOURCES) $(scan_SOURCES) \ + $(simple_SOURCES) $(sql_SOURCES) $(syntax_SOURCES) +DIST_SOURCES = $(crnl_SOURCES) $(encode_SOURCES) $(listcap_SOURCES) \ + $(names_SOURCES) $(posix_SOURCES) $(scan_SOURCES) \ + $(simple_SOURCES) $(sql_SOURCES) $(syntax_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LTVERSION = @LTVERSION@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +RUBYDIR = @RUBYDIR@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STATISTICS = @STATISTICS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +python_prog = @python_prog@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +libname = $(top_builddir)/libonigmo.la +LDADD = $(libname) +INCLUDES = -I$(top_srcdir) -I$(includedir) +encode_SOURCES = encode.c +listcap_SOURCES = listcap.c +names_SOURCES = names.c +posix_SOURCES = posix.c +simple_SOURCES = simple.c +sql_SOURCES = sql.c +syntax_SOURCES = syntax.c +scan_SOURCES = scan.c +crnl_SOURCES = crnl.c +sampledir = $(top_builddir)/sample +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sample/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign sample/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +crnl$(EXEEXT): $(crnl_OBJECTS) $(crnl_DEPENDENCIES) $(EXTRA_crnl_DEPENDENCIES) + @rm -f crnl$(EXEEXT) + $(LINK) $(crnl_OBJECTS) $(crnl_LDADD) $(LIBS) +encode$(EXEEXT): $(encode_OBJECTS) $(encode_DEPENDENCIES) $(EXTRA_encode_DEPENDENCIES) + @rm -f encode$(EXEEXT) + $(LINK) $(encode_OBJECTS) $(encode_LDADD) $(LIBS) +listcap$(EXEEXT): $(listcap_OBJECTS) $(listcap_DEPENDENCIES) $(EXTRA_listcap_DEPENDENCIES) + @rm -f listcap$(EXEEXT) + $(LINK) $(listcap_OBJECTS) $(listcap_LDADD) $(LIBS) +names$(EXEEXT): $(names_OBJECTS) $(names_DEPENDENCIES) $(EXTRA_names_DEPENDENCIES) + @rm -f names$(EXEEXT) + $(LINK) $(names_OBJECTS) $(names_LDADD) $(LIBS) +posix$(EXEEXT): $(posix_OBJECTS) $(posix_DEPENDENCIES) $(EXTRA_posix_DEPENDENCIES) + @rm -f posix$(EXEEXT) + $(LINK) $(posix_OBJECTS) $(posix_LDADD) $(LIBS) +scan$(EXEEXT): $(scan_OBJECTS) $(scan_DEPENDENCIES) $(EXTRA_scan_DEPENDENCIES) + @rm -f scan$(EXEEXT) + $(LINK) $(scan_OBJECTS) $(scan_LDADD) $(LIBS) +simple$(EXEEXT): $(simple_OBJECTS) $(simple_DEPENDENCIES) $(EXTRA_simple_DEPENDENCIES) + @rm -f simple$(EXEEXT) + $(LINK) $(simple_OBJECTS) $(simple_LDADD) $(LIBS) +sql$(EXEEXT): $(sql_OBJECTS) $(sql_DEPENDENCIES) $(EXTRA_sql_DEPENDENCIES) + @rm -f sql$(EXEEXT) + $(LINK) $(sql_OBJECTS) $(sql_LDADD) $(LIBS) +syntax$(EXEEXT): $(syntax_OBJECTS) $(syntax_DEPENDENCIES) $(EXTRA_syntax_DEPENDENCIES) + @rm -f syntax$(EXEEXT) + $(LINK) $(syntax_OBJECTS) $(syntax_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crnl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encode.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listcap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/names.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posix.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scan.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sql.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syntax.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +test: encode$(EXEEXT) listcap$(EXEEXT) names$(EXEEXT) posix$(EXEEXT) simple$(EXEEXT) sql$(EXEEXT) syntax$(EXEEXT) scan$(EXEEXT) crnl$(EXEEXT) + $(sampledir)/encode + $(sampledir)/listcap + $(sampledir)/names + $(sampledir)/posix + $(sampledir)/simple + $(sampledir)/sql + $(sampledir)/syntax + $(sampledir)/scan + $(sampledir)/crnl + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/lib/edbee-lib/vendor/onig/sample/crnl.c b/lib/edbee-lib/vendor/onig/sample/crnl.c new file mode 100644 index 00000000..6ffafc13 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/sample/crnl.c @@ -0,0 +1,229 @@ +/* + * crnl.c 2007/05/30 K.Kosako + * + * !!! You should enable USE_CRNL_AS_LINE_TERMINATOR. !!! + * + * USE_CRNL_AS_LINE_TERMINATOR config test program. + */ +#include <stdio.h> +#include <string.h> +#include "onigmo.h" + +/* #define USE_UNICODE_ALL_LINE_TERMINATORS */ + +static int nfail = 0; + +static void result(int no, int from, int to, int expected_from, int expected_to) +{ + fprintf(stderr, "%3d: ", no); + if (from == expected_from && to == expected_to) + { + fprintf(stderr, "Success\n"); + } + else + { + fprintf(stderr, "Fail: expected: (%d-%d), result: (%d-%d)\n", expected_from, + expected_to, from, to); + + nfail++; + } +} + +static int x0(int no, char *pattern_arg, char *str_arg, int start_offset, + int expected_from, int expected_to, int backward) +{ + int r; + unsigned char *start, *range, *end; + regex_t *reg; + OnigErrorInfo einfo; + OnigRegion *region; + UChar *pattern, *str; + + pattern = (UChar *)pattern_arg; + str = (UChar *)str_arg; + + r = onig_new(®, pattern, pattern + strlen((char *)pattern), + ONIG_OPTION_NEWLINE_CRLF, ONIG_ENCODING_UTF8, + ONIG_SYNTAX_DEFAULT, &einfo); + if (r != ONIG_NORMAL) + { + OnigUChar s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str(s, r, &einfo); + fprintf(stderr, "ERROR: %s\n", s); + return -1; + } + + region = onig_region_new(); + + end = str + strlen((char *)str); + if (backward) + { + start = end + start_offset; + range = str; + } + else + { + start = str + start_offset; + range = end; + } + r = onig_search(reg, str, end, start, range, region, ONIG_OPTION_NONE); + if (r >= 0) + { + result(no, region->beg[0], region->end[0], expected_from, expected_to); + } + else if (r == ONIG_MISMATCH) + { + result(no, r, -1, expected_from, expected_to); + } + else + { /* error */ + OnigUChar s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str(s, r); + fprintf(stderr, "ERROR: %s\n", s); + return -1; + } + + onig_region_free(region, 1 /* 1:free self, 0:free contents only */); + onig_free(reg); + return 0; +} + +static int x(int no, char *pattern_arg, char *str_arg, int expected_from, + int expected_to) +{ + return x0(no, pattern_arg, str_arg, 0, expected_from, expected_to, 0); +} + +static int f0(int no, char *pattern_arg, char *str_arg, int start_offset, + int backward) +{ + return x0(no, pattern_arg, str_arg, start_offset, -1, -1, backward); +} + +static int f(int no, char *pattern_arg, char *str_arg) +{ + return x(no, pattern_arg, str_arg, -1, -1); +} + +extern int main(int argc, char *argv[]) +{ + x(1, "", "\r\n", 0, 0); + /* x( 2, ".", "\r\n", 0, 1); */ + f(2, ".", "\r\n"); + f(3, "..", "\r\n"); + x(4, "^", "\r\n", 0, 0); + x(5, "\\n^", "\r\nf", 1, 2); + x(6, "\\n^a", "\r\na", 1, 3); + x(7, "$", "\r\n", 0, 0); + x(8, "T$", "T\r\n", 0, 1); +#ifdef USE_UNICODE_ALL_LINE_TERMINATORS + x(9, "T$", "T\raT\r\n", 0, 1); +#else + x(9, "T$", "T\raT\r\n", 3, 4); +#endif + x(10, "\\z", "\r\n", 2, 2); + f(11, "a\\z", "a\r\n"); + x(12, "\\Z", "\r\n", 0, 0); + x(13, "\\Z", "\r\na", 3, 3); + x(14, "\\Z", "\r\n\r\n\n", 4, 4); + x(15, "\\Z", "\r\n\r\nX", 5, 5); + x(16, "a\\Z", "a\r\n", 0, 1); + x(17, "aaaaaaaaaaaaaaa\\Z", "aaaaaaaaaaaaaaa\r\n", 0, 15); + x(18, "a|$", "b\r\n", 1, 1); +#ifdef USE_UNICODE_ALL_LINE_TERMINATORS + x(19, "$|b", "\rb", 0, 0); +#else + x(19, "$|b", "\rb", 1, 2); +#endif + x(20, "a$|ab$", "\r\nab\r\n", 2, 4); + + x(21, "a|\\Z", "b\r\n", 1, 1); +#ifdef USE_UNICODE_ALL_LINE_TERMINATORS + x(22, "\\Z|b", "\rb", 0, 0); +#else + x(22, "\\Z|b", "\rb", 1, 2); +#endif + x(23, "a\\Z|ab\\Z", "\r\nab\r\n", 2, 4); + x(24, "(?=a$).", "a\r\n", 0, 1); +#ifdef USE_UNICODE_ALL_LINE_TERMINATORS + x(25, "(?=a$).", "a\r", 0, 1); + f(26, "(?!a$)..", "a\r"); +#else + f(25, "(?=a$).", "a\r"); + x(26, "(?!a$)..", "a\r", 0, 2); +#endif + /* x(27, "(?<=a$).\\n", "a\r\n", 1, 3); */ + x(27, "(?<=a$)\\r\\n", "a\r\n", 1, 3); + /* f(28, "(?<!a$).\\n", "a\r\n"); */ + f(28, "(?<!a$)\\r\\n", "a\r\n"); + x(29, "(?=a\\Z).", "a\r\n", 0, 1); +#ifdef USE_UNICODE_ALL_LINE_TERMINATORS + x(30, "(?=a\\Z).", "a\r", 0, 1); + f(31, "(?!a\\Z)..", "a\r"); +#else + f(30, "(?=a\\Z).", "a\r"); + x(31, "(?!a\\Z)..", "a\r", 0, 2); +#endif + + x(32, ".*$", "aa\r\n", 0, 2); +#ifdef USE_UNICODE_ALL_LINE_TERMINATORS + x(33, ".*$", "aa\r", 0, 2); +#else + x(33, ".*$", "aa\r", 0, 3); +#endif + x(34, "\\R{3}", "\r\r\n\n", 0, 4); + x(35, "$", "\n", 0, 0); + x(36, "T$", "T\n", 0, 1); + x(37, "(?m).", "\r\n", 0, 1); + x(38, "(?m)..", "\r\n", 0, 2); + x0(39, "^", "\n.", 1, 1, 1, 0); + x0(40, "^", "\r\n.", 1, 2, 2, 0); + x0(41, "^", "\r\n.", 2, 2, 2, 0); + x0(42, "$", "\n\n", 1, 1, 1, 0); + x0(43, "$", "\r\n\n", 1, 2, 2, 0); + x0(44, "$", "\r\n\n", 2, 2, 2, 0); +#ifdef USE_UNICODE_ALL_LINE_TERMINATORS + x0(45, "^$", "\n\r", 1, 1, 1, 0); +#else + f0(45, "^$", "\n\r", 1, 0); +#endif + x0(46, "^$", "\n\r\n", 1, 1, 1, 0); + x0(47, "^$", "\r\n\n", 1, 2, 2, 0); + x0(48, "\\Z", "\r\n\n", 1, 2, 2, 0); + f0(49, ".(?=\\Z)", "\r\n", 1, 0); + x0(50, "(?=\\Z)", "\r\n", 1, 2, 2, 0); + x0(51, "(?<=^).", "\r\n.", 0, 2, 3, 0); + x0(52, "(?<=^).", "\r\n.", 1, 2, 3, 0); + x0(53, "(?<=^).", "\r\n.", 2, 2, 3, 0); + x0(54, "^a", "\r\na", 0, 2, 3, 0); + x0(55, "^a", "\r\na", 1, 2, 3, 0); + x0(56, "(?m)$.{1,2}a", "\r\na", 0, 0, 3, 0); + f0(57, "(?m)$.{1,2}a", "\r\na", 1, 0); + x0(58, ".*b", "\r\naaab\r\n", 1, 2, 6, 0); + + /* backward search */ + /* x0(59, "$", "\n\n", 0, 1, 1, 1); */ /* BUG? */ + x0(60, "$", "\n\n", -1, 1, 1, 1); + x0(61, "$", "\n\r\n", -1, 1, 1, 1); + x0(62, "$", "\n\r\n", -2, 1, 1, 1); + x0(63, "^$", "\n\r\n", -1, 1, 1, 1); + x0(64, "^$", "\n\r\n", 0, 1, 1, 1); + x0(65, "^$", "\r\n\n", 0, 2, 2, 1); + x0(66, "^a", "\r\na", 0, 2, 3, 1); + /* x0(67, "^a", "\r\na", -1, 2, 3, 1); */ + f0(67, "^a", "\r\na", -1, + 1); /* This should not match after the fix of Issue #22. */ + f0(68, "^a", "\r\na", -2, 1); + + onig_end(); + + if (nfail > 0) + { + fprintf(stderr, "\n"); + fprintf(stderr, "!!! You have to enable USE_CRNL_AS_LINE_TERMINATOR\n"); + fprintf(stderr, "!!! in regenc.h for this test program.\n"); + fprintf(stderr, "\n"); + } + + return nfail; +} diff --git a/lib/edbee-lib/vendor/onig/sample/encode.c b/lib/edbee-lib/vendor/onig/sample/encode.c new file mode 100644 index 00000000..27bc04e7 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/sample/encode.c @@ -0,0 +1,321 @@ +/* + * encode.c + */ +#include <stdio.h> +#include "onigmo.h" + +static int search(regex_t *reg, unsigned char *str, unsigned char *end) +{ + int r; + unsigned char *start, *range; + OnigRegion *region; + + region = onig_region_new(); + + start = str; + range = end; + r = onig_search(reg, str, end, start, range, region, ONIG_OPTION_NONE); + if (r >= 0) + { + int i; + + fprintf(stderr, "match at %d (%s)\n", r, + ONIGENC_NAME(onig_get_encoding(reg))); + for (i = 0; i < region->num_regs; i++) + { + fprintf(stderr, "%d: (%ld-%ld)\n", i, region->beg[i], region->end[i]); + } + } + else if (r == ONIG_MISMATCH) + { + fprintf(stderr, "search fail (%s)\n", ONIGENC_NAME(onig_get_encoding(reg))); + } + else + { /* error */ + OnigUChar s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str(s, r); + fprintf(stderr, "ERROR: %s\n", s); + fprintf(stderr, " (%s)\n", ONIGENC_NAME(onig_get_encoding(reg))); + return -1; + } + + onig_region_free(region, 1 /* 1:free self, 0:free contents only */); + return 0; +} + +static int exec(OnigEncoding enc, OnigOptionType options, char *apattern, + char *astr) +{ + int r; + unsigned char *end; + regex_t *reg; + OnigErrorInfo einfo; + UChar *pattern = (UChar *)apattern; + UChar *str = (UChar *)astr; + + r = onig_new(®, pattern, pattern + onigenc_str_bytelen_null(enc, pattern), + options, enc, ONIG_SYNTAX_DEFAULT, &einfo); + if (r != ONIG_NORMAL) + { + OnigUChar s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str(s, r, &einfo); + fprintf(stderr, "ERROR: %s\n", s); + return -1; + } + + end = str + onigenc_str_bytelen_null(enc, str); + r = search(reg, str, end); + + onig_free(reg); + onig_end(); + return 0; +} + +static OnigCaseFoldType CF = ONIGENC_CASE_FOLD_MIN; + +#if 0 +static void +set_case_fold(OnigCaseFoldType cf) +{ + CF = cf; +} +#endif + +static int exec_deluxe(OnigEncoding pattern_enc, OnigEncoding str_enc, + OnigOptionType options, char *apattern, char *astr) +{ + int r; + unsigned char *end; + regex_t *reg; + OnigCompileInfo ci; + OnigErrorInfo einfo; + UChar *pattern = (UChar *)apattern; + UChar *str = (UChar *)astr; + + ci.num_of_elements = 5; + ci.pattern_enc = pattern_enc; + ci.target_enc = str_enc; + ci.syntax = ONIG_SYNTAX_DEFAULT; + ci.option = options; + ci.case_fold_flag = CF; + + r = onig_new_deluxe(®, pattern, + pattern + onigenc_str_bytelen_null(pattern_enc, pattern), + &ci, &einfo); + if (r != ONIG_NORMAL) + { + OnigUChar s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str(s, r, &einfo); + fprintf(stderr, "ERROR: %s\n", s); + return -1; + } + + end = str + onigenc_str_bytelen_null(str_enc, str); + r = search(reg, str, end); + + onig_free(reg); + onig_end(); + return 0; +} + +extern int main(int argc, char *argv[]) +{ + int r = 0; + /* ISO 8859-1 test */ + static unsigned char str[] = {0xc7, 0xd6, 0xfe, 0xea, 0xe0, 0xe2, 0x00}; + static unsigned char pattern[] + = {'(', '?', 'u', ')', 0xe7, 0xf6, 0xde, '\\', 'w', '+', 0x00}; + + r |= exec(ONIG_ENCODING_WINDOWS_1250, ONIG_OPTION_IGNORECASE, "aBc\\w", + " AbCd"); + r |= exec(ONIG_ENCODING_WINDOWS_1251, ONIG_OPTION_IGNORECASE, "aBc\\w", + " AbCd"); + r |= exec(ONIG_ENCODING_WINDOWS_1252, ONIG_OPTION_IGNORECASE, "aBc\\w", + " AbCd"); + r |= exec(ONIG_ENCODING_WINDOWS_1253, ONIG_OPTION_IGNORECASE, "aBc\\w", + " AbCd"); + r |= exec(ONIG_ENCODING_WINDOWS_1254, ONIG_OPTION_IGNORECASE, "aBc\\w", + " AbCd"); + r |= exec(ONIG_ENCODING_WINDOWS_1257, ONIG_OPTION_IGNORECASE, "aBc\\w", + " AbCd"); + + r |= exec(ONIG_ENCODING_ISO_8859_1, ONIG_OPTION_IGNORECASE, " [a-c\337z] ", + " SS "); + r |= exec(ONIG_ENCODING_ISO_8859_1, ONIG_OPTION_IGNORECASE, " [\330-\341] ", + " SS "); + + r |= exec(ONIG_ENCODING_ISO_8859_2, ONIG_OPTION_IGNORECASE, "\337 ", + " Ss "); + r |= exec(ONIG_ENCODING_ISO_8859_2, ONIG_OPTION_IGNORECASE, "SS ", + " \337 "); + /* Ignore the following result. It also fails with Oniguruma 5.9.5. */ + /* r |= */ exec(ONIG_ENCODING_ISO_8859_2, ONIG_OPTION_IGNORECASE, "\\A\\S\\z", + "ss"); + + r |= exec(ONIG_ENCODING_ISO_8859_2, ONIG_OPTION_IGNORECASE, "[ac]+", + "bbbaAaCCC"); + + r |= exec(ONIG_ENCODING_ISO_8859_3, ONIG_OPTION_IGNORECASE, "[ac]+", + "bbbaAaCCC"); + r |= exec(ONIG_ENCODING_ISO_8859_4, ONIG_OPTION_IGNORECASE, "[ac]+", + "bbbaAaCCC"); + r |= exec(ONIG_ENCODING_ISO_8859_5, ONIG_OPTION_IGNORECASE, "[ac]+", + "bbbaAaCCC"); + r |= exec(ONIG_ENCODING_ISO_8859_6, ONIG_OPTION_IGNORECASE, "[ac]+", + "bbbaAaCCC"); + r |= exec(ONIG_ENCODING_ISO_8859_7, ONIG_OPTION_IGNORECASE, "[ac]+", + "bbbaAaCCC"); + r |= exec(ONIG_ENCODING_ISO_8859_8, ONIG_OPTION_IGNORECASE, "[ac]+", + "bbbaAaCCC"); + r |= exec(ONIG_ENCODING_ISO_8859_9, ONIG_OPTION_IGNORECASE, "[ac]+", + "bbbaAaCCC"); + r |= exec(ONIG_ENCODING_ISO_8859_10, ONIG_OPTION_IGNORECASE, "[ac]+", + "bbbaAaCCC"); + r |= exec(ONIG_ENCODING_ISO_8859_11, ONIG_OPTION_IGNORECASE, "[ac]+", + "bbbaAaCCC"); + r |= exec(ONIG_ENCODING_ISO_8859_13, ONIG_OPTION_IGNORECASE, "[ac]+", + "bbbaAaCCC"); + r |= exec(ONIG_ENCODING_ISO_8859_14, ONIG_OPTION_IGNORECASE, "[ac]+", + "bbbaAaCCC"); + r |= exec(ONIG_ENCODING_ISO_8859_15, ONIG_OPTION_IGNORECASE, (char *)pattern, + (char *)str); + r |= exec(ONIG_ENCODING_ISO_8859_16, ONIG_OPTION_IGNORECASE, (char *)pattern, + (char *)str); + + r |= exec(ONIG_ENCODING_KOI8_R, ONIG_OPTION_IGNORECASE, "a+", "bbbaaaccc"); + r |= exec(ONIG_ENCODING_KOI8_U, ONIG_OPTION_IGNORECASE, "a+", "bbbaaaccc"); + r |= exec(ONIG_ENCODING_EUC_TW, ONIG_OPTION_IGNORECASE, "b*a+?c+", + "bbbaaaccc"); + r |= exec(ONIG_ENCODING_EUC_KR, ONIG_OPTION_IGNORECASE, "a+", "bbbaaaccc"); + r |= exec(ONIG_ENCODING_EUC_CN, ONIG_OPTION_IGNORECASE, "c+", "bbbaaaccc"); + r |= exec(ONIG_ENCODING_BIG5, ONIG_OPTION_IGNORECASE, "a+", "bbbaaaccc"); + + r |= exec(ONIG_ENCODING_ISO_8859_1, ONIG_OPTION_IGNORECASE, "\337", "SS"); + r |= exec(ONIG_ENCODING_ISO_8859_1, ONIG_OPTION_IGNORECASE, "SS", "\337"); + r |= exec(ONIG_ENCODING_ISO_8859_1, ONIG_OPTION_IGNORECASE, "SSb\337ssc", + "a\337bSS\337cd"); + r |= exec(ONIG_ENCODING_ISO_8859_1, ONIG_OPTION_IGNORECASE, "[a\337]{0,2}", + "aSS"); + r |= exec(ONIG_ENCODING_ISO_8859_1, ONIG_OPTION_IGNORECASE, "is", "iss"); + + r |= exec_deluxe(ONIG_ENCODING_ASCII, ONIG_ENCODING_UTF16_BE, + ONIG_OPTION_NONE, "a+", + "\000b\000a\000a\000a\000c\000c\000\000"); + + r |= exec_deluxe(ONIG_ENCODING_ASCII, ONIG_ENCODING_UTF16_LE, + ONIG_OPTION_NONE, "a+", + "b\000a\000a\000a\000a\000c\000\000\000"); + + r |= exec_deluxe(ONIG_ENCODING_UTF16_BE, ONIG_ENCODING_UTF16_LE, + ONIG_OPTION_NONE, "\000b\000a\000a\000a\000c\000c\000\000", + "x\000b\000a\000a\000a\000c\000c\000\000\000"); + + r |= exec_deluxe(ONIG_ENCODING_UTF16_LE, ONIG_ENCODING_UTF16_BE, + ONIG_OPTION_NONE, "b\000a\000a\000a\000c\000c\000\000\000", + "\000x\000b\000a\000a\000a\000c\000c\000\000"); + + r |= exec_deluxe(ONIG_ENCODING_UTF32_BE, ONIG_ENCODING_UTF32_LE, + ONIG_OPTION_NONE, + "\000\000\000b\000\000\000a\000\000\000a\000\000\000a\000" + "\000\000c\000\000\000c\000\000\000\000", + "x\000\000\000b\000\000\000a\000\000\000a\000\000\000a\000" + "\000\000c\000\000\000c\000\000\000\000\000\000\000"); + + r |= exec_deluxe(ONIG_ENCODING_UTF32_LE, ONIG_ENCODING_UTF32_BE, + ONIG_OPTION_NONE, + "b\000\000\000a\000\000\000a\000\000\000a\000\000\000c\000" + "\000\000c\000\000\000\000\000\000\000", + "\000\000\000x\000\000\000b\000\000\000a\000\000\000a\000" + "\000\000a\000\000\000c\000\000\000c\000\000\000\000"); + + r |= exec_deluxe(ONIG_ENCODING_ISO_8859_1, ONIG_ENCODING_UTF16_BE, + ONIG_OPTION_IGNORECASE, "\337", "\000S\000S\000\000"); + + r |= exec_deluxe(ONIG_ENCODING_ISO_8859_1, ONIG_ENCODING_UTF16_BE, + ONIG_OPTION_IGNORECASE, "SS", "\000\337\000\000"); + + r |= exec_deluxe(ONIG_ENCODING_ISO_8859_1, ONIG_ENCODING_UTF16_LE, + ONIG_OPTION_IGNORECASE, "\337", "S\000S\000\000\000"); + + r |= exec_deluxe(ONIG_ENCODING_ISO_8859_1, ONIG_ENCODING_UTF32_BE, + ONIG_OPTION_IGNORECASE, "SS", + "\000\000\000\337\000\000\000\000"); + + r |= exec_deluxe(ONIG_ENCODING_ISO_8859_1, ONIG_ENCODING_UTF32_LE, + ONIG_OPTION_IGNORECASE, "\337", + "S\000\000\000S\000\000\000\000\000\000\000"); + + r |= exec( + ONIG_ENCODING_UTF16_BE, ONIG_OPTION_NONE, + "\000[\000[\000:\000a\000l\000n\000u\000m\000:\000]\000]\000+\000\000", + "\000#\002\120\000a\000Z\012\077\012\076\012\075\000\000"); + /* 0x0a3d == \012\075 : is not alnum */ + /* 0x0a3e == \012\076 : is alnum */ + + r |= exec(ONIG_ENCODING_UTF16_BE, ONIG_OPTION_NONE, + "\000\\\000d\000+\000\000", + "\0003\0001\377\020\377\031\377\032\000\000"); + + r |= exec(ONIG_ENCODING_GB18030, ONIG_OPTION_IGNORECASE, "(Aa\\d)+", + "BaA5Aa0234"); + + r |= exec_deluxe(ONIG_ENCODING_ISO_8859_1, ONIG_ENCODING_UTF16_BE, + ONIG_OPTION_NONE, + "^\\P{Hiragana}\\p{^Hiragana}(\\p{Hiragana}+)$", + "\060\100\060\240\060\101\060\102\060\226\060\237\000\000"); + + r |= exec_deluxe(ONIG_ENCODING_UTF16_BE, ONIG_ENCODING_UTF16_BE, + ONIG_OPTION_IGNORECASE, "\000[\000\337\000]\000\000", + "\000S\000S\000\000"); + + r |= exec_deluxe(ONIG_ENCODING_UTF16_BE, ONIG_ENCODING_UTF16_BE, + ONIG_OPTION_IGNORECASE, "\000[\000\337\000]\000\000", + "\000s\000S\000\000"); + + r |= exec_deluxe(ONIG_ENCODING_UTF16_BE, ONIG_ENCODING_UTF16_BE, + ONIG_OPTION_IGNORECASE, + "\000^\000[\000\001\000-\377\375\000]\000$\000\000", + "\000s\000S\000\000"); + + r |= exec_deluxe(ONIG_ENCODING_UTF16_BE, ONIG_ENCODING_UTF16_BE, + ONIG_OPTION_IGNORECASE, "\000S\000S\000\000", + "\000S\000T\000\337\000\000"); + + r |= exec_deluxe(ONIG_ENCODING_UTF16_BE, ONIG_ENCODING_UTF16_BE, + ONIG_OPTION_IGNORECASE, "\000S\000T\000S\000S\000\000", + "\000S\000t\000s\000S\000\000"); + + { + UChar pat[] = {0x1f, 0xfc, 0x00, 0x00}; + UChar str1[] = {0x21, 0x26, 0x1f, 0xbe, 0x00, 0x00}; + UChar str2[] = {0x1f, 0xf3, 0x00, 0x00}; + + r |= exec_deluxe(ONIG_ENCODING_UTF16_BE, ONIG_ENCODING_UTF16_BE, + ONIG_OPTION_IGNORECASE, (char *)pat, (char *)str1); + + r |= exec_deluxe(ONIG_ENCODING_UTF16_BE, ONIG_ENCODING_UTF16_BE, + ONIG_OPTION_IGNORECASE, (char *)pat, (char *)str2); + } + +#if 0 + /* You should define USE_UNICODE_CASE_FOLD_TURKISH_AZERI in regenc.h. */ + + set_case_fold(ONIGENC_CASE_FOLD_TURKISH_AZERI); + + r |= exec_deluxe(ONIG_ENCODING_UTF8, ONIG_ENCODING_UTF8, + ONIG_OPTION_IGNORECASE, + "Ii", "\304\261\304\260"); + + r |= exec_deluxe(ONIG_ENCODING_UTF16_BE, ONIG_ENCODING_UTF16_BE, + ONIG_OPTION_IGNORECASE, + "\000I\000i\000\000", "\001\061\001\060\000\000"); + + r |= exec_deluxe(ONIG_ENCODING_UTF16_BE, ONIG_ENCODING_UTF16_BE, + ONIG_OPTION_IGNORECASE, + "\001\061\001\060\000\000", "\000I\000i\000\000"); + + set_case_fold(ONIGENC_CASE_FOLD_MIN); +#endif + + return r; +} diff --git a/lib/edbee-lib/vendor/onig/sample/listcap.c b/lib/edbee-lib/vendor/onig/sample/listcap.c new file mode 100644 index 00000000..8a0ac70f --- /dev/null +++ b/lib/edbee-lib/vendor/onig/sample/listcap.c @@ -0,0 +1,136 @@ +/* + * listcap.c + * + * capture history (?@...) sample. + */ +#include <stdio.h> +#include <string.h> +#include "onigmo.h" + +static int node_callback(int group, OnigPosition beg, OnigPosition end, + int level, int at, void *arg) +{ + int i; + + if (at != ONIG_TRAVERSE_CALLBACK_AT_FIRST) + return -1; /* error */ + + /* indent */ + for (i = 0; i < level * 2; i++) + fputc(' ', stderr); + + fprintf(stderr, "%d: (%ld-%ld)\n", group, beg, end); + return 0; +} + +static int node_callback_last(int group, OnigPosition beg, OnigPosition end, + int level, int at, void *arg) +{ + int i; + + if (at != ONIG_TRAVERSE_CALLBACK_AT_LAST) + return -1; /* error */ + + /* indent */ + for (i = 0; i < level * 2; i++) + fputc(' ', stderr); + + fprintf(stderr, "%d: (%ld-%ld)\n", group, beg, end); + return 0; +} + +extern int ex(unsigned char *str, unsigned char *pattern, + OnigSyntaxType *syntax) +{ + int r; + unsigned char *start, *range, *end; + regex_t *reg; + OnigErrorInfo einfo; + OnigRegion *region; + + r = onig_new(®, pattern, pattern + strlen((char *)pattern), + ONIG_OPTION_DEFAULT, ONIG_ENCODING_ASCII, syntax, &einfo); + if (r != ONIG_NORMAL) + { + OnigUChar s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str(s, r, &einfo); + fprintf(stderr, "ERROR: %s\n", s); + return -1; + } + + fprintf(stderr, "number of captures: %d\n", onig_number_of_captures(reg)); + fprintf(stderr, "number of capture histories: %d\n", + onig_number_of_capture_histories(reg)); + + region = onig_region_new(); + + end = str + strlen((char *)str); + start = str; + range = end; + r = onig_search(reg, str, end, start, range, region, ONIG_OPTION_NONE); + if (r >= 0) + { + int i; + + fprintf(stderr, "match at %d\n", r); + for (i = 0; i < region->num_regs; i++) + { + fprintf(stderr, "%d: (%ld-%ld)\n", i, region->beg[i], region->end[i]); + } + fprintf(stderr, "\n"); + + r = onig_capture_tree_traverse(region, ONIG_TRAVERSE_CALLBACK_AT_FIRST, + node_callback, (void *)0); + fprintf(stderr, "\n"); + + r = onig_capture_tree_traverse(region, ONIG_TRAVERSE_CALLBACK_AT_LAST, + node_callback_last, (void *)0); + fprintf(stderr, "\n"); + } + else if (r == ONIG_MISMATCH) + { + fprintf(stderr, "search fail\n"); + } + else + { /* error */ + OnigUChar s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str(s, r); + return -1; + } + + onig_region_free(region, 1 /* 1:free self, 0:free contents only */); + onig_free(reg); + return 0; +} + +extern int main(int argc, char *argv[]) +{ + int r = 0; + OnigSyntaxType syn; + + static UChar *str1 = (UChar *)"((())())"; + static UChar *pattern1 + = (UChar *)"\\g<p>(?@<p>\\(\\g<s>\\)){0}(?@<s>(?:\\g<p>)*|){0}"; + + static UChar *str2 = (UChar *)"x00x00x00"; + static UChar *pattern2 = (UChar *)"(?@x(?@\\d+))+"; + + static UChar *str3 = (UChar *)"0123"; + static UChar *pattern3 = (UChar *)"(?@.)(?@.)(?@.)(?@.)"; + + static UChar *str4 = (UChar *)"((abc)(abc))"; + static UChar *pattern4 = (UChar *)"\\((?@(?:[^(]|\\g<0>)*)\\)"; + + /* enable capture hostory */ + onig_copy_syntax(&syn, ONIG_SYNTAX_DEFAULT); + onig_set_syntax_op2(&syn, onig_get_syntax_op2(&syn) + | ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY); + + r |= ex(str1, pattern1, &syn); + r |= ex(str2, pattern2, &syn); + r |= ex(str3, pattern3, &syn); + r |= ex(str4, pattern4, &syn); + + onig_end(); + return r; +} diff --git a/lib/edbee-lib/vendor/onig/sample/names.c b/lib/edbee-lib/vendor/onig/sample/names.c new file mode 100644 index 00000000..680bcde0 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/sample/names.c @@ -0,0 +1,78 @@ +/* + * names.c -- example of group name callback. + */ +#include <stdio.h> +#include <string.h> +#include "onigmo.h" + +static int name_callback(const UChar *name, const UChar *name_end, + int ngroup_num, int *group_nums, regex_t *reg, + void *arg) +{ + int i, gn, ref; + char *s; + OnigRegion *region = (OnigRegion *)arg; + + for (i = 0; i < ngroup_num; i++) + { + gn = group_nums[i]; + ref = onig_name_to_backref_number(reg, name, name_end, region); + s = (ref == gn ? "*" : ""); + fprintf(stderr, "%s (%d): ", name, gn); + fprintf(stderr, "(%ld-%ld) %s\n", region->beg[gn], region->end[gn], s); + } + return 0; /* 0: continue */ +} + +extern int main(int argc, char *argv[]) +{ + int r; + unsigned char *start, *range, *end; + regex_t *reg; + OnigErrorInfo einfo; + OnigRegion *region; + + static UChar *pattern = (UChar *)"(?<foo>a*)(?<bar>b*)(?<foo>c*)"; + static UChar *str = (UChar *)"aaabbbbcc"; + + r = onig_new(®, pattern, pattern + strlen((char *)pattern), + ONIG_OPTION_DEFAULT, ONIG_ENCODING_ASCII, ONIG_SYNTAX_DEFAULT, + &einfo); + if (r != ONIG_NORMAL) + { + OnigUChar s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str(s, r, &einfo); + fprintf(stderr, "ERROR: %s\n", s); + return -1; + } + + fprintf(stderr, "number of names: %d\n", onig_number_of_names(reg)); + + region = onig_region_new(); + + end = str + strlen((char *)str); + start = str; + range = end; + r = onig_search(reg, str, end, start, range, region, ONIG_OPTION_NONE); + if (r >= 0) + { + fprintf(stderr, "match at %d\n\n", r); + r = onig_foreach_name(reg, name_callback, (void *)region); + } + else if (r == ONIG_MISMATCH) + { + fprintf(stderr, "search fail\n"); + r = -1; + } + else + { /* error */ + OnigUChar s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str(s, r); + return -1; + } + + onig_region_free(region, 1 /* 1:free self, 0:free contents only */); + onig_free(reg); + onig_end(); + return r; +} diff --git a/lib/edbee-lib/vendor/onig/sample/posix.c b/lib/edbee-lib/vendor/onig/sample/posix.c new file mode 100644 index 00000000..b6843524 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/sample/posix.c @@ -0,0 +1,111 @@ +/* + * posix.c + */ +#include <stdio.h> +#include "onigmoposix.h" + +typedef unsigned char UChar; + +static int x(regex_t *reg, unsigned char *pattern, unsigned char *str) +{ + int r, i; + char buf[200]; + regmatch_t pmatch[20]; + + r = regexec(reg, (char *)str, reg->re_nsub + 1, pmatch, 0); + if (r != 0 && r != REG_NOMATCH) + { + regerror(r, reg, buf, sizeof(buf)); + fprintf(stderr, "ERROR: %s\n", buf); + return -1; + } + + if (r == REG_NOMATCH) + { + fprintf(stderr, "FAIL: /%s/ '%s'\n", pattern, str); + } + else + { + fprintf(stderr, "OK: /%s/ '%s'\n", pattern, str); + for (i = 0; i <= (int)reg->re_nsub; i++) + { + fprintf(stderr, "%d: %d-%d\n", i, pmatch[i].rm_so, pmatch[i].rm_eo); + } + } + return 0; +} + +extern int main(int argc, char *argv[]) +{ + int r; + char buf[200]; + regex_t reg; + UChar *pattern; + + /* default syntax (ONIG_SYNTAX_RUBY) */ + pattern = (UChar *)"^a+b{2,7}[c-f]?$|uuu"; + r = regcomp(®, (char *)pattern, REG_EXTENDED); + if (r) + { + regerror(r, ®, buf, sizeof(buf)); + fprintf(stderr, "ERROR: %s\n", buf); + return -1; + } + x(®, pattern, (UChar *)"aaabbbbd"); + + /* POSIX Basic RE (REG_EXTENDED is not specified.) */ + pattern = (UChar *)"^a+b{2,7}[c-f]?|uuu"; + r = regcomp(®, (char *)pattern, 0); + if (r) + { + regerror(r, ®, buf, sizeof(buf)); + fprintf(stderr, "ERROR: %s\n", buf); + return -1; + } + x(®, pattern, (UChar *)"a+b{2,7}d?|uuu"); + + /* POSIX Basic RE (REG_EXTENDED is not specified.) */ + pattern = (UChar *)"^a*b\\{2,7\\}\\([c-f]\\)$"; + r = regcomp(®, (char *)pattern, 0); + if (r) + { + regerror(r, ®, buf, sizeof(buf)); + fprintf(stderr, "ERROR: %s\n", buf); + return -1; + } + x(®, pattern, (UChar *)"aaaabbbbbbd"); + + /* POSIX Extended RE */ + onig_set_default_syntax(ONIG_SYNTAX_POSIX_EXTENDED); + pattern = (UChar *)"^a+b{2,7}[c-f]?)$|uuu"; + r = regcomp(®, (char *)pattern, REG_EXTENDED); + if (r) + { + regerror(r, ®, buf, sizeof(buf)); + fprintf(stderr, "ERROR: %s\n", buf); + return -1; + } + x(®, pattern, (UChar *)"aaabbbbd)"); + + pattern = (UChar *)"^b."; + r = regcomp(®, (char *)pattern, REG_EXTENDED | REG_NEWLINE); + if (r) + { + regerror(r, ®, buf, sizeof(buf)); + fprintf(stderr, "ERROR: %s\n", buf); + return -1; + } + x(®, pattern, (UChar *)"a\nb\n"); + + /* Error test */ + pattern = (UChar *)" ["; + r = regcomp(®, (char *)pattern, REG_EXTENDED); + if (r) + { + regerror(r, ®, buf, sizeof(buf)); + fprintf(stderr, "OK(E): %s\n", buf); + } + + regfree(®); + return 0; +} diff --git a/lib/edbee-lib/vendor/onig/sample/scan.c b/lib/edbee-lib/vendor/onig/sample/scan.c new file mode 100644 index 00000000..a097157d --- /dev/null +++ b/lib/edbee-lib/vendor/onig/sample/scan.c @@ -0,0 +1,89 @@ +/* + * scan.c + */ +#include <stdio.h> +#include <stdlib.h> +#include "onigmo.h" + +static int scan_callback(OnigPosition n, OnigPosition r, OnigRegion *region, + void *arg) +{ + int i; + + fprintf(stdout, "scan: %ld\n", n); + + fprintf(stdout, "match at %ld\n", r); + for (i = 0; i < region->num_regs; i++) + { + fprintf(stdout, "%d: (%ld-%ld)\n", i, region->beg[i], region->end[i]); + } + + return 0; +} + +static int scan(regex_t *reg, unsigned char *str, unsigned char *end) +{ + int r; + OnigRegion *region; + + region = onig_region_new(); + + r = onig_scan(reg, str, end, region, ONIG_OPTION_NONE, scan_callback, NULL); + if (r >= 0) + { + fprintf(stdout, "total: %d match\n", r); + } + else + { /* error */ + char s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str((OnigUChar *)s, r); + fprintf(stderr, "ERROR: %s\n", s); + return -1; + } + + onig_region_free(region, 1 /* 1:free self, 0:free contents only */); + return 0; +} + +static int exec(OnigEncoding enc, OnigOptionType options, char *apattern, + char *astr) +{ + int r; + unsigned char *end; + regex_t *reg; + OnigErrorInfo einfo; + UChar *pattern_end; + UChar *pattern = (UChar *)apattern; + UChar *str = (UChar *)astr; + + onig_initialize(&enc, 1); + + pattern_end = pattern + onigenc_str_bytelen_null(enc, pattern); + + r = onig_new(®, pattern, pattern_end, options, enc, ONIG_SYNTAX_DEFAULT, + &einfo); + if (r != ONIG_NORMAL) + { + char s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str((OnigUChar *)s, r, &einfo); + fprintf(stderr, "ERROR: %s\n", s); + return -1; + } + + end = str + onigenc_str_bytelen_null(enc, str); + r = scan(reg, str, end); + + onig_free(reg); + onig_end(); + return 0; +} + +extern int main(int argc, char *argv[]) +{ + exec(ONIG_ENCODING_UTF8, ONIG_OPTION_NONE, "\\Ga+\\s*", "a aa aaa baaa"); + + fprintf(stdout, "\n"); + exec(ONIG_ENCODING_UTF8, ONIG_OPTION_NONE, "a+\\s*", "a aa aaa baaa"); + + return 0; +} diff --git a/lib/edbee-lib/vendor/onig/sample/simple.c b/lib/edbee-lib/vendor/onig/sample/simple.c new file mode 100644 index 00000000..d92086eb --- /dev/null +++ b/lib/edbee-lib/vendor/onig/sample/simple.c @@ -0,0 +1,64 @@ +/* + * simple.c + */ +#include <stdio.h> +#include <string.h> +#include "onigmo.h" + +extern int main(int argc, char *argv[]) +{ + int r; + unsigned char *start, *range, *end; + regex_t *reg; + OnigErrorInfo einfo; + OnigRegion *region; + + static UChar *pattern = (UChar *)"a(.*)b|[e-f]+"; + static UChar *str = (UChar *)"zzzzaffffffffb"; + + r = onig_new(®, pattern, pattern + strlen((char *)pattern), + ONIG_OPTION_DEFAULT, ONIG_ENCODING_ASCII, ONIG_SYNTAX_DEFAULT, + &einfo); + if (r != ONIG_NORMAL) + { + OnigUChar s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str(s, r, &einfo); + fprintf(stderr, "ERROR: %s\n", s); + return -1; + } + + region = onig_region_new(); + + end = str + strlen((char *)str); + start = str; + range = end; + r = onig_search(reg, str, end, start, range, region, ONIG_OPTION_NONE); + if (r >= 0) + { + int i; + + fprintf(stderr, "match at %d\n", r); + for (i = 0; i < region->num_regs; i++) + { + fprintf(stderr, "%d: (%ld-%ld)\n", i, region->beg[i], region->end[i]); + } + r = 0; + } + else if (r == ONIG_MISMATCH) + { + fprintf(stderr, "search fail\n"); + r = -1; + } + else + { /* error */ + OnigUChar s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str(s, r); + fprintf(stderr, "ERROR: %s\n", s); + return -1; + } + + onig_region_free(region, 1 /* 1:free self, 0:free contents only */); + onig_free(reg); + onig_end(); + return r; +} diff --git a/lib/edbee-lib/vendor/onig/sample/sql.c b/lib/edbee-lib/vendor/onig/sample/sql.c new file mode 100644 index 00000000..945380d8 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/sample/sql.c @@ -0,0 +1,80 @@ +/* + * sql.c + */ +#include <stdio.h> +#include <string.h> +#include "onigmo.h" + +extern int main(int argc, char *argv[]) +{ + static OnigSyntaxType SQLSyntax; + + int r; + unsigned char *start, *range, *end; + regex_t *reg; + OnigErrorInfo einfo; + OnigRegion *region; + + static UChar *pattern = (UChar *)"\\_%\\\\__zz"; + static UChar *str = (UChar *)"a_abcabcabc\\ppzz"; + + onig_set_syntax_op(&SQLSyntax, ONIG_SYN_OP_VARIABLE_META_CHARACTERS); + onig_set_syntax_op2(&SQLSyntax, 0); + onig_set_syntax_behavior(&SQLSyntax, 0); + onig_set_syntax_options(&SQLSyntax, ONIG_OPTION_MULTILINE); + onig_set_meta_char(&SQLSyntax, ONIG_META_CHAR_ESCAPE, (OnigCodePoint)'\\'); + onig_set_meta_char(&SQLSyntax, ONIG_META_CHAR_ANYCHAR, (OnigCodePoint)'_'); + onig_set_meta_char(&SQLSyntax, ONIG_META_CHAR_ANYTIME, + ONIG_INEFFECTIVE_META_CHAR); + onig_set_meta_char(&SQLSyntax, ONIG_META_CHAR_ZERO_OR_ONE_TIME, + ONIG_INEFFECTIVE_META_CHAR); + onig_set_meta_char(&SQLSyntax, ONIG_META_CHAR_ONE_OR_MORE_TIME, + ONIG_INEFFECTIVE_META_CHAR); + onig_set_meta_char(&SQLSyntax, ONIG_META_CHAR_ANYCHAR_ANYTIME, + (OnigCodePoint)'%'); + + r = onig_new(®, pattern, pattern + strlen((char *)pattern), + ONIG_OPTION_DEFAULT, ONIG_ENCODING_ASCII, &SQLSyntax, &einfo); + if (r != ONIG_NORMAL) + { + OnigUChar s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str(s, r, &einfo); + fprintf(stderr, "ERROR: %s\n", s); + return -1; + } + + region = onig_region_new(); + + end = str + strlen((char *)str); + start = str; + range = end; + r = onig_search(reg, str, end, start, range, region, ONIG_OPTION_NONE); + if (r >= 0) + { + int i; + + fprintf(stderr, "match at %d\n", r); + for (i = 0; i < region->num_regs; i++) + { + fprintf(stderr, "%d: (%ld-%ld)\n", i, region->beg[i], region->end[i]); + } + r = 0; + } + else if (r == ONIG_MISMATCH) + { + fprintf(stderr, "search fail\n"); + r = -1; + } + else + { /* error */ + OnigUChar s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str(s, r); + fprintf(stderr, "ERROR: %s\n", s); + return -1; + } + + onig_region_free(region, 1 /* 1:free self, 0:free contents only */); + onig_free(reg); + onig_end(); + return r; +} diff --git a/lib/edbee-lib/vendor/onig/sample/syntax.c b/lib/edbee-lib/vendor/onig/sample/syntax.c new file mode 100644 index 00000000..ca3dba83 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/sample/syntax.c @@ -0,0 +1,80 @@ +/* + * syntax.c + */ +#include <stdio.h> +#include <string.h> +#include "onigmo.h" + +extern int exec(const OnigSyntaxType *syntax, char *apattern, char *astr) +{ + int r; + unsigned char *start, *range, *end; + regex_t *reg; + OnigErrorInfo einfo; + OnigRegion *region; + UChar *pattern = (UChar *)apattern; + UChar *str = (UChar *)astr; + + r = onig_new(®, pattern, pattern + strlen((char *)pattern), + ONIG_OPTION_DEFAULT, ONIG_ENCODING_ASCII, syntax, &einfo); + if (r != ONIG_NORMAL) + { + OnigUChar s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str(s, r, &einfo); + fprintf(stderr, "ERROR: %s\n", s); + return -1; + } + + region = onig_region_new(); + + end = str + strlen((char *)str); + start = str; + range = end; + r = onig_search(reg, str, end, start, range, region, ONIG_OPTION_NONE); + if (r >= 0) + { + int i; + + fprintf(stderr, "match at %d\n", r); + for (i = 0; i < region->num_regs; i++) + { + fprintf(stderr, "%d: (%ld-%ld)\n", i, region->beg[i], region->end[i]); + } + r = 0; + } + else if (r == ONIG_MISMATCH) + { + fprintf(stderr, "search fail\n"); + r = -1; + } + else + { /* error */ + OnigUChar s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str(s, r); + fprintf(stderr, "ERROR: %s\n", s); + return -1; + } + + onig_region_free(region, 1 /* 1:free self, 0:free contents only */); + onig_free(reg); + onig_end(); + return r; +} + +extern int main(int argc, char *argv[]) +{ + int r = 0; + + r |= exec(ONIG_SYNTAX_PERL, + "\\p{XDigit}\\P{XDigit}\\p{^XDigit}\\P{^XDigit}\\p{XDigit}", + "bgh3a"); + + r |= exec(ONIG_SYNTAX_JAVA, + "\\p{XDigit}\\P{XDigit}[a-c&&b-g]\\u0020[\\u0021]", "bgc !"); + + r |= exec(ONIG_SYNTAX_ASIS, + "abc def* e+ g?ddd[a-rvvv] (vv){3,7}hv\\dvv(?:aczui ss)\\W\\w$", + "abc def* e+ g?ddd[a-rvvv] (vv){3,7}hv\\dvv(?:aczui ss)\\W\\w$"); + onig_end(); + return r; +} diff --git a/lib/edbee-lib/vendor/onig/st.c b/lib/edbee-lib/vendor/onig/st.c new file mode 100644 index 00000000..135921ec --- /dev/null +++ b/lib/edbee-lib/vendor/onig/st.c @@ -0,0 +1,2083 @@ +/* This is a public domain general purpose hash table package + originally written by Peter Moore @ UCB. + + The hash table data structures were redesigned and the package was + rewritten by Vladimir Makarov <vmakarov@redhat.com>. */ + +/* The original package implemented classic bucket-based hash tables + with entries doubly linked for an access by their insertion order. + To decrease pointer chasing and as a consequence to improve a data + locality the current implementation is based on storing entries in + an array and using hash tables with open addressing. The current + entries are more compact in comparison with the original ones and + this also improves the data locality. + + The hash table has two arrays called *bins* and *entries*. + + bins: + ------- + | | entries array: + |-------| -------------------------------- + | index | | | entry: | | | + |-------| | | | | | + | ... | | ... | hash | ... | ... | + |-------| | | key | | | + | empty | | | record | | | + |-------| -------------------------------- + | ... | ^ ^ + |-------| |_ entries start |_ entries bound + |deleted| + ------- + + o The entry array contains table entries in the same order as they + were inserted. + + When the first entry is deleted, a variable containing index of + the current first entry (*entries start*) is changed. In all + other cases of the deletion, we just mark the entry as deleted by + using a reserved hash value. + + Such organization of the entry storage makes operations of the + table shift and the entries traversal very fast. + + o The bins provide access to the entries by their keys. The + key hash is mapped to a bin containing *index* of the + corresponding entry in the entry array. + + The bin array size is always power of two, it makes mapping very + fast by using the corresponding lower bits of the hash. + Generally it is not a good idea to ignore some part of the hash. + But alternative approach is worse. For example, we could use a + modulo operation for mapping and a prime number for the size of + the bin array. Unfortunately, the modulo operation for big + 64-bit numbers are extremely slow (it takes more than 100 cycles + on modern Intel CPUs). + + Still other bits of the hash value are used when the mapping + results in a collision. In this case we use a secondary hash + value which is a result of a function of the collision bin + index and the original hash value. The function choice + guarantees that we can traverse all bins and finally find the + corresponding bin as after several iterations the function + becomes a full cycle linear congruential generator because it + satisfies requirements of the Hull-Dobell theorem. + + When an entry is removed from the table besides marking the + hash in the corresponding entry described above, we also mark + the bin by a special value in order to find entries which had + a collision with the removed entries. + + There are two reserved values for the bins. One denotes an + empty bin, another one denotes a bin for a deleted entry. + + o The length of the bin array is at least two times more than the + entry array length. This keeps the table load factor healthy. + The trigger of rebuilding the table is always a case when we can + not insert an entry anymore at the entries bound. We could + change the entries bound too in case of deletion but than we need + a special code to count bins with corresponding deleted entries + and reset the bin values when there are too many bins + corresponding deleted entries + + Table rebuilding is done by creation of a new entry array and + bins of an appropriate size. We also try to reuse the arrays + in some cases by compacting the array and removing deleted + entries. + + o To save memory very small tables have no allocated arrays + bins. We use a linear search for an access by a key. + + o To save more memory we use 8-, 16-, 32- and 64- bit indexes in + bins depending on the current hash table size. + + This implementation speeds up the Ruby hash table benchmarks in + average by more 40% on Intel Haswell CPU. + +*/ + +#ifdef RUBY +# include "internal.h" +#else +# include "regint.h" +# include "st.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <assert.h> + +#ifdef __GNUC__ +# define PREFETCH(addr, write_p) __builtin_prefetch(addr, write_p) +# define EXPECT(expr, val) __builtin_expect(expr, val) +# define ATTRIBUTE_UNUSED __attribute__((unused)) +#else +# define PREFETCH(addr, write_p) +# define EXPECT(expr, val) (expr) +# define ATTRIBUTE_UNUSED +#endif + +#ifdef ST_DEBUG +# define st_assert(cond) assert(cond) +#else +# define st_assert(cond) ((void)(0 && (cond))) +#endif + +/* The type of hashes. */ +typedef st_index_t st_hash_t; + +struct st_table_entry +{ + st_hash_t hash; + st_data_t key; + st_data_t record; +}; + +#ifdef RUBY +# define type_numhash st_hashtype_num +const struct st_hash_type st_hashtype_num = { + st_numcmp, + st_numhash, +}; + +/* extern int strcmp(const char *, const char *); */ +static st_index_t strhash(st_data_t); +static const struct st_hash_type type_strhash = { + strcmp, + strhash, +}; + +static st_index_t strcasehash(st_data_t); +static const struct st_hash_type type_strcasehash = { + st_locale_insensitive_strcasecmp, + strcasehash, +}; +#endif /* RUBY */ + +/* Value used to catch uninitialized entries/bins during debugging. + There is a possibility for a false alarm, but its probability is + extremely small. */ +#define ST_INIT_VAL 0xafafafafafafafaf +#define ST_INIT_VAL_BYTE 0xafa + +#ifdef RUBY +# undef malloc +# undef realloc +# undef calloc +# undef free +# define malloc ruby_xmalloc +# define calloc ruby_xcalloc +# define realloc ruby_xrealloc +# define free ruby_xfree +#else /* RUBY */ +# define MEMCPY(p1, p2, type, n) memcpy((p1), (p2), sizeof(type) * (n)) +#endif /* RUBY */ + +#define EQUAL(tab, x, y) ((x) == (y) || (*(tab)->type->compare)((x), (y)) == 0) +#define PTR_EQUAL(tab, ptr, hash_val, key_) \ + ((ptr)->hash == (hash_val) && EQUAL((tab), (key_), (ptr)->key)) + +/* Features of a table. */ +struct st_features +{ + /* Power of 2 used for number of allocated entries. */ + unsigned char entry_power; + /* Power of 2 used for number of allocated bins. Depending on the + table size, the number of bins is 2-4 times more than the + number of entries. */ + unsigned char bin_power; + /* Enumeration of sizes of bins (8-bit, 16-bit etc). */ + unsigned char size_ind; + /* Bins are packed in words of type st_index_t. The following is + a size of bins counted by words. */ + st_index_t bins_words; +}; + +/* Features of all possible size tables. */ +#if SIZEOF_ST_INDEX_T == 8 +# define MAX_POWER2 62 +static const struct st_features features[] = { + {0, 1, 0, 0x0}, + {1, 2, 0, 0x1}, + {2, 3, 0, 0x1}, + {3, 4, 0, 0x2}, + {4, 5, 0, 0x4}, + {5, 6, 0, 0x8}, + {6, 7, 0, 0x10}, + {7, 8, 0, 0x20}, + {8, 9, 1, 0x80}, + {9, 10, 1, 0x100}, + {10, 11, 1, 0x200}, + {11, 12, 1, 0x400}, + {12, 13, 1, 0x800}, + {13, 14, 1, 0x1000}, + {14, 15, 1, 0x2000}, + {15, 16, 1, 0x4000}, + {16, 17, 2, 0x10000}, + {17, 18, 2, 0x20000}, + {18, 19, 2, 0x40000}, + {19, 20, 2, 0x80000}, + {20, 21, 2, 0x100000}, + {21, 22, 2, 0x200000}, + {22, 23, 2, 0x400000}, + {23, 24, 2, 0x800000}, + {24, 25, 2, 0x1000000}, + {25, 26, 2, 0x2000000}, + {26, 27, 2, 0x4000000}, + {27, 28, 2, 0x8000000}, + {28, 29, 2, 0x10000000}, + {29, 30, 2, 0x20000000}, + {30, 31, 2, 0x40000000}, + {31, 32, 2, 0x80000000}, + {32, 33, 3, 0x200000000}, + {33, 34, 3, 0x400000000}, + {34, 35, 3, 0x800000000}, + {35, 36, 3, 0x1000000000}, + {36, 37, 3, 0x2000000000}, + {37, 38, 3, 0x4000000000}, + {38, 39, 3, 0x8000000000}, + {39, 40, 3, 0x10000000000}, + {40, 41, 3, 0x20000000000}, + {41, 42, 3, 0x40000000000}, + {42, 43, 3, 0x80000000000}, + {43, 44, 3, 0x100000000000}, + {44, 45, 3, 0x200000000000}, + {45, 46, 3, 0x400000000000}, + {46, 47, 3, 0x800000000000}, + {47, 48, 3, 0x1000000000000}, + {48, 49, 3, 0x2000000000000}, + {49, 50, 3, 0x4000000000000}, + {50, 51, 3, 0x8000000000000}, + {51, 52, 3, 0x10000000000000}, + {52, 53, 3, 0x20000000000000}, + {53, 54, 3, 0x40000000000000}, + {54, 55, 3, 0x80000000000000}, + {55, 56, 3, 0x100000000000000}, + {56, 57, 3, 0x200000000000000}, + {57, 58, 3, 0x400000000000000}, + {58, 59, 3, 0x800000000000000}, + {59, 60, 3, 0x1000000000000000}, + {60, 61, 3, 0x2000000000000000}, + {61, 62, 3, 0x4000000000000000}, + {62, 63, 3, 0x8000000000000000}, +}; + +#else +# define MAX_POWER2 30 + +static const struct st_features features[] = { + {0, 1, 0, 0x1}, {1, 2, 0, 0x1}, {2, 3, 0, 0x2}, + {3, 4, 0, 0x4}, {4, 5, 0, 0x8}, {5, 6, 0, 0x10}, + {6, 7, 0, 0x20}, {7, 8, 0, 0x40}, {8, 9, 1, 0x100}, + {9, 10, 1, 0x200}, {10, 11, 1, 0x400}, {11, 12, 1, 0x800}, + {12, 13, 1, 0x1000}, {13, 14, 1, 0x2000}, {14, 15, 1, 0x4000}, + {15, 16, 1, 0x8000}, {16, 17, 2, 0x20000}, {17, 18, 2, 0x40000}, + {18, 19, 2, 0x80000}, {19, 20, 2, 0x100000}, {20, 21, 2, 0x200000}, + {21, 22, 2, 0x400000}, {22, 23, 2, 0x800000}, {23, 24, 2, 0x1000000}, + {24, 25, 2, 0x2000000}, {25, 26, 2, 0x4000000}, {26, 27, 2, 0x8000000}, + {27, 28, 2, 0x10000000}, {28, 29, 2, 0x20000000}, {29, 30, 2, 0x40000000}, + {30, 31, 2, 0x80000000}, +}; + +#endif + +/* The reserved hash value and its substitution. */ +#define RESERVED_HASH_VAL (~(st_hash_t)0) +#define RESERVED_HASH_SUBSTITUTION_VAL ((st_hash_t)0) + +/* Return hash value of KEY for table TAB. */ +static inline st_hash_t do_hash(st_data_t key, st_table *tab) +{ + st_hash_t hash = (st_hash_t)(tab->type->hash)(key); + + /* RESERVED_HASH_VAL is used for a deleted entry. Map it into + another value. Such mapping should be extremely rare. */ + return hash == RESERVED_HASH_VAL ? RESERVED_HASH_SUBSTITUTION_VAL : hash; +} + +/* Power of 2 defining the minimal number of allocated entries. */ +#define MINIMAL_POWER2 2 + +#if MINIMAL_POWER2 < 2 +# error "MINIMAL_POWER2 should be >= 2" +#endif + +/* If the power2 of the allocated `entries` is less than the following + value, don't allocate bins and use a linear search. */ +#define MAX_POWER2_FOR_TABLES_WITHOUT_BINS 4 + +/* Return smallest n >= MINIMAL_POWER2 such 2^n > SIZE. */ +static int get_power2(st_index_t size) +{ + unsigned int n; + + for (n = 0; size != 0; n++) + size >>= 1; + if (n <= MAX_POWER2) + return n < MINIMAL_POWER2 ? MINIMAL_POWER2 : n; +#ifdef RUBY + /* Ran out of the table entries */ + rb_raise(rb_eRuntimeError, "st_table too big"); +#endif + /* should raise exception */ + return -1; +} + +/* Return value of N-th bin in array BINS of table with bins size + index S. */ +static inline st_index_t get_bin(st_index_t *bins, int s, st_index_t n) +{ + return (s == 0 ? ((unsigned char *)bins)[n] + : s == 1 ? ((unsigned short *)bins)[n] + : s == 2 ? ((unsigned int *)bins)[n] + : ((st_index_t *)bins)[n]); +} + +/* Set up N-th bin in array BINS of table with bins size index S to + value V. */ +static inline void set_bin(st_index_t *bins, int s, st_index_t n, st_index_t v) +{ + if (s == 0) + ((unsigned char *)bins)[n] = (unsigned char)v; + else if (s == 1) + ((unsigned short *)bins)[n] = (unsigned short)v; + else if (s == 2) + ((unsigned int *)bins)[n] = (unsigned int)v; + else + ((st_index_t *)bins)[n] = v; +} + +/* These macros define reserved values for empty table bin and table + bin which contains a deleted entry. We will never use such values + for an entry index in bins. */ +#define EMPTY_BIN 0 +#define DELETED_BIN 1 +/* Base of a real entry index in the bins. */ +#define ENTRY_BASE 2 + +/* Mark I-th bin of table TAB as empty, in other words not + corresponding to any entry. */ +#define MARK_BIN_EMPTY(tab, i) \ + (set_bin((tab)->bins, get_size_ind(tab), i, EMPTY_BIN)) + +/* Values used for not found entry and bin with given + characteristics. */ +#define UNDEFINED_ENTRY_IND (~(st_index_t)0) +#define UNDEFINED_BIN_IND (~(st_index_t)0) + +/* Mark I-th bin of table TAB as corresponding to a deleted table + entry. Update number of entries in the table and number of bins + corresponding to deleted entries. */ +#define MARK_BIN_DELETED(tab, i) \ + do \ + { \ + st_assert(i != UNDEFINED_BIN_IND); \ + st_assert(!IND_EMPTY_OR_DELETED_BIN_P(tab, i)); \ + set_bin((tab)->bins, get_size_ind(tab), i, DELETED_BIN); \ + } while (0) + +/* Macros to check that value B is used empty bins and bins + corresponding deleted entries. */ +#define EMPTY_BIN_P(b) ((b) == EMPTY_BIN) +#define DELETED_BIN_P(b) ((b) == DELETED_BIN) +#define EMPTY_OR_DELETED_BIN_P(b) ((b) <= DELETED_BIN) + +/* Macros to check empty bins and bins corresponding to deleted + entries. Bins are given by their index I in table TAB. */ +#define IND_EMPTY_BIN_P(tab, i) \ + (EMPTY_BIN_P(get_bin((tab)->bins, get_size_ind(tab), i))) +#define IND_DELETED_BIN_P(tab, i) \ + (DELETED_BIN_P(get_bin((tab)->bins, get_size_ind(tab), i))) +#define IND_EMPTY_OR_DELETED_BIN_P(tab, i) \ + (EMPTY_OR_DELETED_BIN_P(get_bin((tab)->bins, get_size_ind(tab), i))) + +/* Macros for marking and checking deleted entries given by their + pointer E_PTR. */ +#define MARK_ENTRY_DELETED(e_ptr) ((e_ptr)->hash = RESERVED_HASH_VAL) +#define DELETED_ENTRY_P(e_ptr) ((e_ptr)->hash == RESERVED_HASH_VAL) + +/* Return bin size index of table TAB. */ +static inline unsigned int get_size_ind(const st_table *tab) +{ + return tab->size_ind; +} + +/* Return the number of allocated bins of table TAB. */ +static inline st_index_t get_bins_num(const st_table *tab) +{ + return ((st_index_t)1) << tab->bin_power; +} + +/* Return mask for a bin index in table TAB. */ +static inline st_index_t bins_mask(const st_table *tab) +{ + return get_bins_num(tab) - 1; +} + +/* Return the index of table TAB bin corresponding to + HASH_VALUE. */ +static inline st_index_t hash_bin(st_hash_t hash_value, st_table *tab) +{ + return hash_value & bins_mask(tab); +} + +/* Return the number of allocated entries of table TAB. */ +static inline st_index_t get_allocated_entries(const st_table *tab) +{ + return ((st_index_t)1) << tab->entry_power; +} + +/* Return size of the allocated bins of table TAB. */ +static inline st_index_t bins_size(const st_table *tab) +{ + return features[tab->entry_power].bins_words * sizeof(st_index_t); +} + +/* Mark all bins of table TAB as empty. */ +static void initialize_bins(st_table *tab) +{ + memset(tab->bins, 0, bins_size(tab)); +} + +/* Make table TAB empty. */ +static void make_tab_empty(st_table *tab) +{ + tab->num_entries = 0; + tab->entries_start = tab->entries_bound = 0; + if (tab->bins != NULL) + initialize_bins(tab); +} + +#ifdef ST_DEBUG +/* Check the table T consistency. It can be extremely slow. So use + it only for debugging. */ +static void st_check(st_table *tab) +{ + st_index_t d, e, i, n, p; + + for (p = get_allocated_entries(tab), i = 0; p > 1; i++, p >>= 1) + ; + p = i; + assert(p >= MINIMAL_POWER2); + assert(tab->entries_bound <= get_allocated_entries(tab) + && tab->entries_start <= tab->entries_bound); + n = 0; + return; + if (tab->entries_bound != 0) + for (i = tab->entries_start; i < tab->entries_bound; i++) + { + assert(tab->entries[i].hash != (st_hash_t)ST_INIT_VAL + && tab->entries[i].key != ST_INIT_VAL + && tab->entries[i].record != ST_INIT_VAL); + if (!DELETED_ENTRY_P(&tab->entries[i])) + n++; + } + assert(n == tab->num_entries); + if (tab->bins == NULL) + assert(p <= MAX_POWER2_FOR_TABLES_WITHOUT_BINS); + else + { + assert(p > MAX_POWER2_FOR_TABLES_WITHOUT_BINS); + for (n = d = i = 0; i < get_bins_num(tab); i++) + { + assert(get_bin(tab->bins, tab->size_ind, i) != ST_INIT_VAL); + if (IND_DELETED_BIN_P(tab, i)) + { + d++; + continue; + } + else if (IND_EMPTY_BIN_P(tab, i)) + continue; + n++; + e = get_bin(tab->bins, tab->size_ind, i) - ENTRY_BASE; + assert(tab->entries_start <= e && e < tab->entries_bound); + assert(!DELETED_ENTRY_P(&tab->entries[e])); + assert(tab->entries[e].hash != (st_hash_t)ST_INIT_VAL + && tab->entries[e].key != ST_INIT_VAL + && tab->entries[e].record != ST_INIT_VAL); + } + assert(n == tab->num_entries); + assert(n + d < get_bins_num(tab)); + } +} +#endif + +#ifdef HASH_LOG +# ifdef HAVE_UNISTD_H +# include <unistd.h> +# endif +static struct +{ + int all, total, num, str, strcase; +} collision; + +/* Flag switching off output of package statistics at the end of + program. */ +static int init_st = 0; + +/* Output overall number of table searches and collisions into a + temporary file. */ +static void stat_col(void) +{ + char fname[10 + sizeof(long) * 3]; + FILE *f; + if (!collision.total) + return; + f = fopen( + (snprintf(fname, sizeof(fname), "/tmp/col%ld", (long)getpid()), fname), + "w"); + if (f == 0) + return; + + fprintf(f, "collision: %d / %d (%6.2f)\n", collision.all, collision.total, + ((double)collision.all / (collision.total)) * 100); + fprintf(f, "num: %d, str: %d, strcase: %d\n", collision.num, collision.str, + collision.strcase); + fclose(f); +} +#endif + +/* Create and return table with TYPE which can hold at least SIZE + entries. The real number of entries which the table can hold is + the nearest power of two for SIZE. */ +st_table *st_init_table_with_size(const struct st_hash_type *type, + st_index_t size) +{ + st_table *tab; + int n; + +#ifdef HASH_LOG +# if HASH_LOG + 0 < 0 + { + const char *e = getenv("ST_HASH_LOG"); + if (!e || !*e) + init_st = 1; + } +# endif + if (init_st == 0) + { + init_st = 1; + atexit(stat_col); + } +#endif + + n = get_power2(size); +#ifndef RUBY + if (n < 0) + return NULL; +#endif + tab = (st_table *)malloc(sizeof(st_table)); + if (tab == NULL) + return NULL; + tab->type = type; + tab->entry_power = n; + tab->bin_power = features[n].bin_power; + tab->size_ind = features[n].size_ind; + if (n <= MAX_POWER2_FOR_TABLES_WITHOUT_BINS) + tab->bins = NULL; + else + { + tab->bins = (st_index_t *)malloc(bins_size(tab)); + if (tab->bins == NULL) + { + free(tab); + return NULL; + } + } + tab->entries = (st_table_entry *)malloc(get_allocated_entries(tab) + * sizeof(st_table_entry)); + if (tab->entries == NULL) + { + st_free_table(tab); + return NULL; + } +#ifdef ST_DEBUG + memset(tab->entries, ST_INIT_VAL_BYTE, + get_allocated_entries(tab) * sizeof(st_table_entry)); + if (tab->bins != NULL) + memset(tab->bins, ST_INIT_VAL_BYTE, bins_size(tab)); +#endif + make_tab_empty(tab); + tab->rebuilds_num = 0; +#ifdef ST_DEBUG + st_check(tab); +#endif + return tab; +} + +#ifdef RUBY +/* Create and return table with TYPE which can hold a minimal number + of entries (see comments for get_power2). */ +st_table *st_init_table(const struct st_hash_type *type) +{ + return st_init_table_with_size(type, 0); +} + +/* Create and return table which can hold a minimal number of + numbers. */ +st_table *st_init_numtable(void) +{ + return st_init_table(&type_numhash); +} + +/* Create and return table which can hold SIZE numbers. */ +st_table *st_init_numtable_with_size(st_index_t size) +{ + return st_init_table_with_size(&type_numhash, size); +} + +/* Create and return table which can hold a minimal number of + strings. */ +st_table *st_init_strtable(void) +{ + return st_init_table(&type_strhash); +} + +/* Create and return table which can hold SIZE strings. */ +st_table *st_init_strtable_with_size(st_index_t size) +{ + return st_init_table_with_size(&type_strhash, size); +} + +/* Create and return table which can hold a minimal number of strings + whose character case is ignored. */ +st_table *st_init_strcasetable(void) +{ + return st_init_table(&type_strcasehash); +} + +/* Create and return table which can hold SIZE strings whose character + case is ignored. */ +st_table *st_init_strcasetable_with_size(st_index_t size) +{ + return st_init_table_with_size(&type_strcasehash, size); +} + +/* Make table TAB empty. */ +void st_clear(st_table *tab) +{ + make_tab_empty(tab); + tab->rebuilds_num++; +# ifdef ST_DEBUG + st_check(tab); +# endif +} +#endif /* RUBY */ + +/* Free table TAB space. */ +void st_free_table(st_table *tab) +{ + if (tab->bins != NULL) + free(tab->bins); + free(tab->entries); + free(tab); +} + +#ifdef RUBY +/* Return byte size of memory allocted for table TAB. */ +size_t st_memsize(const st_table *tab) +{ + return (sizeof(st_table) + (tab->bins == NULL ? 0 : bins_size(tab)) + + get_allocated_entries(tab) * sizeof(st_table_entry)); +} +#endif /* RUBY */ + +static st_index_t find_table_entry_ind(st_table *tab, st_hash_t hash_value, + st_data_t key); + +static st_index_t find_table_bin_ind(st_table *tab, st_hash_t hash_value, + st_data_t key); + +static st_index_t +find_table_bin_ind_direct(st_table *table, st_hash_t hash_value, st_data_t key); + +static st_index_t find_table_bin_ptr_and_reserve(st_table *tab, + st_hash_t *hash_value, + st_data_t key, + st_index_t *bin_ind); + +#ifdef HASH_LOG +static void count_collision(const struct st_hash_type *type) +{ + collision.all++; + if (type == &type_numhash) + { + collision.num++; + } + else if (type == &type_strhash) + { + collision.strcase++; + } + else if (type == &type_strcasehash) + { + collision.str++; + } +} + +# define COLLISION (collision_check ? count_collision(tab->type) : (void)0) +# define FOUND_BIN (collision_check ? collision.total++ : (void)0) +# define collision_check 0 +#else +# define COLLISION +# define FOUND_BIN +#endif + +/* If the number of entries in the table is at least REBUILD_THRESHOLD + times less than the entry array length, decrease the table + size. */ +#define REBUILD_THRESHOLD 4 + +#if REBUILD_THRESHOLD < 2 +# error "REBUILD_THRESHOLD should be >= 2" +#endif + +/* Rebuild table TAB. Rebuilding removes all deleted bins and entries + and can change size of the table entries and bins arrays. + Rebuilding is implemented by creation of a new table or by + compaction of the existing one. */ +static void rebuild_table(st_table *tab) +{ + st_index_t i, ni, bound; + unsigned int size_ind; + st_table *new_tab; + st_table_entry *entries, *new_entries; + st_table_entry *curr_entry_ptr; + st_index_t *bins; + st_index_t bin_ind; + + st_assert(tab != NULL); + bound = tab->entries_bound; + entries = tab->entries; + if ((2 * tab->num_entries <= get_allocated_entries(tab) + && REBUILD_THRESHOLD * tab->num_entries > get_allocated_entries(tab)) + || tab->num_entries < (1 << MINIMAL_POWER2)) + { + /* Compaction: */ + tab->num_entries = 0; + if (tab->bins != NULL) + initialize_bins(tab); + new_tab = tab; + new_entries = entries; + } + else + { + new_tab = st_init_table_with_size(tab->type, 2 * tab->num_entries - 1); + new_entries = new_tab->entries; + } + ni = 0; + bins = new_tab->bins; + size_ind = get_size_ind(new_tab); + for (i = tab->entries_start; i < bound; i++) + { + curr_entry_ptr = &entries[i]; + PREFETCH(entries + i + 1, 0); + if (EXPECT(DELETED_ENTRY_P(curr_entry_ptr), 0)) + continue; + if (&new_entries[ni] != curr_entry_ptr) + new_entries[ni] = *curr_entry_ptr; + if (EXPECT(bins != NULL, 1)) + { + bin_ind = find_table_bin_ind_direct(new_tab, curr_entry_ptr->hash, + curr_entry_ptr->key); + st_assert(bin_ind != UNDEFINED_BIN_IND + && (tab == new_tab || new_tab->rebuilds_num == 0) + && IND_EMPTY_BIN_P(new_tab, bin_ind)); + set_bin(bins, size_ind, bin_ind, ni + ENTRY_BASE); + } + new_tab->num_entries++; + ni++; + } + if (new_tab != tab) + { + tab->entry_power = new_tab->entry_power; + tab->bin_power = new_tab->bin_power; + tab->size_ind = new_tab->size_ind; + st_assert(tab->num_entries == ni && new_tab->num_entries == ni); + if (tab->bins != NULL) + free(tab->bins); + tab->bins = new_tab->bins; + free(tab->entries); + tab->entries = new_tab->entries; + free(new_tab); + } + tab->entries_start = 0; + tab->entries_bound = tab->num_entries; + tab->rebuilds_num++; +#ifdef ST_DEBUG + st_check(tab); +#endif +} + +/* Return the next secondary hash index for table TAB using previous + index IND and PERTERB. Finally modulo of the function becomes a + full *cycle linear congruential generator*, in other words it + guarantees traversing all table bins in extreme case. + + According the Hull-Dobell theorem a generator + "Xnext = (a*Xprev + c) mod m" is a full cycle generator iff + o m and c are relatively prime + o a-1 is divisible by all prime factors of m + o a-1 is divisible by 4 if m is divisible by 4. + + For our case a is 5, c is 1, and m is a power of two. */ +static inline st_index_t secondary_hash(st_index_t ind, st_table *tab, + st_index_t *perterb) +{ + *perterb >>= 11; + ind = (ind << 2) + ind + *perterb + 1; + return hash_bin(ind, tab); +} + +/* Find an entry with HASH_VALUE and KEY in TABLE using a linear + search. Return the index of the found entry in array `entries`. + If it is not found, return UNDEFINED_ENTRY_IND. */ +static inline st_index_t find_entry(st_table *tab, st_hash_t hash_value, + st_data_t key) +{ + st_index_t i, bound; + st_table_entry *entries; + + bound = tab->entries_bound; + entries = tab->entries; + for (i = tab->entries_start; i < bound; i++) + { + if (PTR_EQUAL(tab, &entries[i], hash_value, key)) + return i; + } + return UNDEFINED_ENTRY_IND; +} + +/* Use the quadratic probing. The method has a better data locality + but more collisions than the current approach. In average it + results in a bit slower search. */ +/*#define QUADRATIC_PROBE*/ + +/* Return index of entry with HASH_VALUE and KEY in table TAB. If + there is no such entry, return UNDEFINED_ENTRY_IND. */ +static st_index_t find_table_entry_ind(st_table *tab, st_hash_t hash_value, + st_data_t key) +{ + st_index_t ind; +#ifdef QUADRATIC_PROBE + st_index_t d; +#else + st_index_t peterb; +#endif + st_index_t bin; + st_table_entry *entries = tab->entries; + + st_assert(tab != NULL && tab->bins != NULL); + ind = hash_bin(hash_value, tab); +#ifdef QUADRATIC_PROBE + d = 1; +#else + peterb = hash_value; +#endif + FOUND_BIN; + for (;;) + { + bin = get_bin(tab->bins, get_size_ind(tab), ind); + if (!EMPTY_OR_DELETED_BIN_P(bin) + && PTR_EQUAL(tab, &entries[bin - ENTRY_BASE], hash_value, key)) + break; + else if (EMPTY_BIN_P(bin)) + return UNDEFINED_ENTRY_IND; +#ifdef QUADRATIC_PROBE + ind = hash_bin(ind + d, tab); + d++; +#else + ind = secondary_hash(ind, tab, &peterb); +#endif + COLLISION; + } + return bin; +} + +/* Find and return index of table TAB bin corresponding to an entry + with HASH_VALUE and KEY. If there is no such bin, return + UNDEFINED_BIN_IND. */ +static st_index_t find_table_bin_ind(st_table *tab, st_hash_t hash_value, + st_data_t key) +{ + st_index_t ind; +#ifdef QUADRATIC_PROBE + st_index_t d; +#else + st_index_t peterb; +#endif + st_index_t bin; + st_table_entry *entries = tab->entries; + + st_assert(tab != NULL && tab->bins != NULL); + ind = hash_bin(hash_value, tab); +#ifdef QUADRATIC_PROBE + d = 1; +#else + peterb = hash_value; +#endif + FOUND_BIN; + for (;;) + { + bin = get_bin(tab->bins, get_size_ind(tab), ind); + if (!EMPTY_OR_DELETED_BIN_P(bin) + && PTR_EQUAL(tab, &entries[bin - ENTRY_BASE], hash_value, key)) + break; + else if (EMPTY_BIN_P(bin)) + return UNDEFINED_BIN_IND; +#ifdef QUADRATIC_PROBE + ind = hash_bin(ind + d, tab); + d++; +#else + ind = secondary_hash(ind, tab, &peterb); +#endif + COLLISION; + } + return ind; +} + +/* Find and return index of table TAB bin corresponding to an entry + with HASH_VALUE and KEY. The entry should be in the table + already. */ +static st_index_t find_table_bin_ind_direct(st_table *tab, st_hash_t hash_value, + st_data_t key) +{ + st_index_t ind; +#ifdef QUADRATIC_PROBE + st_index_t d; +#else + st_index_t peterb; +#endif + st_index_t bin; + st_table_entry *entries = tab->entries; + + st_assert(tab != NULL && tab->bins != NULL); + ind = hash_bin(hash_value, tab); +#ifdef QUADRATIC_PROBE + d = 1; +#else + peterb = hash_value; +#endif + FOUND_BIN; + for (;;) + { + bin = get_bin(tab->bins, get_size_ind(tab), ind); + if (EMPTY_OR_DELETED_BIN_P(bin)) + return ind; + st_assert(!PTR_EQUAL(tab, &entries[bin - ENTRY_BASE], hash_value, key)); +#ifdef QUADRATIC_PROBE + ind = hash_bin(ind + d, tab); + d++; +#else + ind = secondary_hash(ind, tab, &peterb); +#endif + COLLISION; + } +} + +/* Return index of table TAB bin for HASH_VALUE and KEY through + BIN_IND and the pointed value as the function result. Reserve the + bin for inclusion of the corresponding entry into the table if it + is not there yet. We always find such bin as bins array length is + bigger entries array. Although we can reuse a deleted bin, the + result bin value is always empty if the table has no entry with + KEY. Return the entries array index of the found entry or + UNDEFINED_ENTRY_IND if it is not found. */ +static st_index_t find_table_bin_ptr_and_reserve(st_table *tab, + st_hash_t *hash_value, + st_data_t key, + st_index_t *bin_ind) +{ + st_index_t ind; + st_hash_t curr_hash_value = *hash_value; +#ifdef QUADRATIC_PROBE + st_index_t d; +#else + st_index_t peterb; +#endif + st_index_t entry_index; + st_index_t first_deleted_bin_ind; + st_table_entry *entries; + + st_assert(tab != NULL && tab->bins != NULL + && tab->entries_bound <= get_allocated_entries(tab) + && tab->entries_start <= tab->entries_bound); + ind = hash_bin(curr_hash_value, tab); +#ifdef QUADRATIC_PROBE + d = 1; +#else + peterb = curr_hash_value; +#endif + FOUND_BIN; + first_deleted_bin_ind = UNDEFINED_BIN_IND; + entries = tab->entries; + for (;;) + { + entry_index = get_bin(tab->bins, get_size_ind(tab), ind); + if (EMPTY_BIN_P(entry_index)) + { + tab->num_entries++; + entry_index = UNDEFINED_ENTRY_IND; + if (first_deleted_bin_ind != UNDEFINED_BIN_IND) + { + /* We can reuse bin of a deleted entry. */ + ind = first_deleted_bin_ind; + MARK_BIN_EMPTY(tab, ind); + } + break; + } + else if (!DELETED_BIN_P(entry_index)) + { + if (PTR_EQUAL(tab, &entries[entry_index - ENTRY_BASE], curr_hash_value, + key)) + break; + } + else if (first_deleted_bin_ind == UNDEFINED_BIN_IND) + first_deleted_bin_ind = ind; +#ifdef QUADRATIC_PROBE + ind = hash_bin(ind + d, tab); + d++; +#else + ind = secondary_hash(ind, tab, &peterb); +#endif + COLLISION; + } + *bin_ind = ind; + return entry_index; +} + +/* Find an entry with KEY in table TAB. Return non-zero if we found + it. Set up *RECORD to the found entry record. */ +int st_lookup(st_table *tab, st_data_t key, st_data_t *value) +{ + st_index_t bin; + st_hash_t hash = do_hash(key, tab); + + if (tab->bins == NULL) + { + bin = find_entry(tab, hash, key); + if (bin == UNDEFINED_ENTRY_IND) + return 0; + } + else + { + bin = find_table_entry_ind(tab, hash, key); + if (bin == UNDEFINED_ENTRY_IND) + return 0; + bin -= ENTRY_BASE; + } + if (value != 0) + *value = tab->entries[bin].record; + return 1; +} + +#ifdef RUBY +/* Find an entry with KEY in table TAB. Return non-zero if we found + it. Set up *RESULT to the found table entry key. */ +int st_get_key(st_table *tab, st_data_t key, st_data_t *result) +{ + st_index_t bin; + st_hash_t hash = do_hash(key, tab); + + if (tab->bins == NULL) + { + bin = find_entry(tab, hash, key); + if (bin == UNDEFINED_ENTRY_IND) + return 0; + } + else + { + bin = find_table_entry_ind(tab, hash, key); + if (bin == UNDEFINED_ENTRY_IND) + return 0; + bin -= ENTRY_BASE; + } + if (result != 0) + *result = tab->entries[bin].key; + return 1; +} +#endif /* RUBY */ + +/* Check the table and rebuild it if it is necessary. */ +static inline void rebuild_table_if_necessary(st_table *tab) +{ + st_index_t bound = tab->entries_bound; + + if (bound == get_allocated_entries(tab)) + rebuild_table(tab); + st_assert(tab->entries_bound < get_allocated_entries(tab)); +} + +/* Insert (KEY, VALUE) into table TAB and return zero. If there is + already entry with KEY in the table, return nonzero and and update + the value of the found entry. */ +int st_insert(st_table *tab, st_data_t key, st_data_t value) +{ + st_table_entry *entry; + st_index_t bin; + st_index_t ind; + st_hash_t hash_value; + st_index_t bin_ind; + int new_p; + + rebuild_table_if_necessary(tab); + hash_value = do_hash(key, tab); + if (tab->bins == NULL) + { + bin = find_entry(tab, hash_value, key); + new_p = bin == UNDEFINED_ENTRY_IND; + if (new_p) + tab->num_entries++; + bin_ind = UNDEFINED_BIN_IND; + } + else + { + bin = find_table_bin_ptr_and_reserve(tab, &hash_value, key, &bin_ind); + new_p = bin == UNDEFINED_ENTRY_IND; + bin -= ENTRY_BASE; + } + if (new_p) + { + st_assert(tab->entries_bound < get_allocated_entries(tab)); + ind = tab->entries_bound++; + entry = &tab->entries[ind]; + entry->hash = hash_value; + entry->key = key; + entry->record = value; + if (bin_ind != UNDEFINED_BIN_IND) + set_bin(tab->bins, get_size_ind(tab), bin_ind, ind + ENTRY_BASE); +#ifdef ST_DEBUG + st_check(tab); +#endif + return 0; + } + tab->entries[bin].record = value; +#ifdef ST_DEBUG + st_check(tab); +#endif + return 1; +} + +#ifdef RUBY +/* Insert (KEY, VALUE, HASH) into table TAB. The table should not have + entry with KEY before the insertion. */ +static inline void st_add_direct_with_hash(st_table *tab, st_data_t key, + st_data_t value, st_hash_t hash) +{ + st_table_entry *entry; + st_index_t ind; + st_index_t bin_ind; + + rebuild_table_if_necessary(tab); + ind = tab->entries_bound++; + entry = &tab->entries[ind]; + entry->hash = hash; + entry->key = key; + entry->record = value; + tab->num_entries++; + if (tab->bins != NULL) + { + bin_ind = find_table_bin_ind_direct(tab, hash, key); + st_assert(bin_ind != UNDEFINED_BIN_IND); + set_bin(tab->bins, get_size_ind(tab), bin_ind, ind + ENTRY_BASE); + } +# ifdef ST_DEBUG + st_check(tab); +# endif +} + +/* Insert (KEY, VALUE) into table TAB. The table should not have + entry with KEY before the insertion. */ +void st_add_direct(st_table *tab, st_data_t key, st_data_t value) +{ + st_hash_t hash_value; + + hash_value = do_hash(key, tab); + st_add_direct_with_hash(tab, key, value, hash_value); +} + +/* Insert (FUNC(KEY), VALUE) into table TAB and return zero. If + there is already entry with KEY in the table, return nonzero and + and update the value of the found entry. */ +int st_insert2(st_table *tab, st_data_t key, st_data_t value, + st_data_t (*func)(st_data_t)) +{ + st_table_entry *entry; + st_index_t bin; + st_index_t ind, check; + st_hash_t hash_value; + st_index_t bin_ind; + int new_p; + + rebuild_table_if_necessary(tab); + hash_value = do_hash(key, tab); + if (tab->bins == NULL) + { + bin = find_entry(tab, hash_value, key); + new_p = bin == UNDEFINED_ENTRY_IND; + bin_ind = UNDEFINED_BIN_IND; + } + else + { + bin = find_table_bin_ptr_and_reserve(tab, &hash_value, key, &bin_ind); + new_p = bin == UNDEFINED_ENTRY_IND; + bin -= ENTRY_BASE; + } + if (new_p) + { + st_assert(tab->entries_bound < get_allocated_entries(tab)); + check = tab->rebuilds_num; + key = (*func)(key); + st_assert(check == tab->rebuilds_num && do_hash(key, tab) == hash_value); + ind = tab->entries_bound++; + entry = &tab->entries[ind]; + entry->hash = hash_value; + entry->key = key; + entry->record = value; + if (bin_ind != UNDEFINED_BIN_IND) + set_bin(tab->bins, get_size_ind(tab), bin_ind, ind + ENTRY_BASE); +# ifdef ST_DEBUG + st_check(tab); +# endif + return 0; + } + tab->entries[bin].record = value; +# ifdef ST_DEBUG + st_check(tab); +# endif + return 1; +} + +/* Create and return a copy of table OLD_TAB. */ +st_table *st_copy(st_table *old_tab) +{ + st_table *new_tab; + + new_tab = (st_table *)malloc(sizeof(st_table)); + if (new_tab == NULL) + return NULL; + *new_tab = *old_tab; + if (old_tab->bins == NULL) + new_tab->bins = NULL; + else + { + new_tab->bins = (st_index_t *)malloc(bins_size(old_tab)); + if (new_tab->bins == NULL) + { + free(new_tab); + return NULL; + } + } + new_tab->entries = (st_table_entry *)malloc(get_allocated_entries(old_tab) + * sizeof(st_table_entry)); + if (new_tab->entries == NULL) + { + st_free_table(new_tab); + return NULL; + } + MEMCPY(new_tab->entries, old_tab->entries, st_table_entry, + get_allocated_entries(old_tab)); + if (old_tab->bins != NULL) + MEMCPY(new_tab->bins, old_tab->bins, char, bins_size(old_tab)); +# ifdef ST_DEBUG + st_check(new_tab); +# endif + return new_tab; +} +#endif /* RUBY */ + +/* Update the entries start of table TAB after removing an entry + with index N in the array entries. */ +static inline void update_range_for_deleted(st_table *tab, st_index_t n) +{ + /* Do not update entries_bound here. Otherwise, we can fill all + bins by deleted entry value before rebuilding the table. */ + if (tab->entries_start == n) + tab->entries_start = n + 1; +} + +#ifdef RUBY +/* Delete entry with KEY from table TAB, set up *VALUE (unless + VALUE is zero) from deleted table entry, and return non-zero. If + there is no entry with KEY in the table, clear *VALUE (unless VALUE + is zero), and return zero. */ +static int st_general_delete(st_table *tab, st_data_t *key, st_data_t *value) +{ + st_table_entry *entry; + st_index_t bin; + st_index_t bin_ind; + st_hash_t hash; + + st_assert(tab != NULL); + hash = do_hash(*key, tab); + if (tab->bins == NULL) + { + bin = find_entry(tab, hash, *key); + if (bin == UNDEFINED_ENTRY_IND) + { + if (value != 0) + *value = 0; + return 0; + } + } + else + { + bin_ind = find_table_bin_ind(tab, hash, *key); + if (bin_ind == UNDEFINED_BIN_IND) + { + if (value != 0) + *value = 0; + return 0; + } + bin = get_bin(tab->bins, get_size_ind(tab), bin_ind) - ENTRY_BASE; + MARK_BIN_DELETED(tab, bin_ind); + } + entry = &tab->entries[bin]; + *key = entry->key; + if (value != 0) + *value = entry->record; + MARK_ENTRY_DELETED(entry); + tab->num_entries--; + update_range_for_deleted(tab, bin); +# ifdef ST_DEBUG + st_check(tab); +# endif + return 1; +} + +int st_delete(st_table *tab, st_data_t *key, st_data_t *value) +{ + return st_general_delete(tab, key, value); +} + +/* The function and other functions with suffix '_safe' or '_check' + are originated from the previous implementation of the hash tables. + It was necessary for correct deleting entries during traversing + tables. The current implementation permits deletion during + traversing without a specific way to do this. */ +int st_delete_safe(st_table *tab, st_data_t *key, st_data_t *value, + st_data_t never ATTRIBUTE_UNUSED) +{ + return st_general_delete(tab, key, value); +} + +/* If table TAB is empty, clear *VALUE (unless VALUE is zero), and + return zero. Otherwise, remove the first entry in the table. + Return its key through KEY and its record through VALUE (unless + VALUE is zero). */ +int st_shift(st_table *tab, st_data_t *key, st_data_t *value) +{ + st_index_t i, bound; + st_index_t bin; + st_table_entry *entries, *curr_entry_ptr; + st_index_t bin_ind; + + entries = tab->entries; + bound = tab->entries_bound; + for (i = tab->entries_start; i < bound; i++) + { + curr_entry_ptr = &entries[i]; + if (!DELETED_ENTRY_P(curr_entry_ptr)) + { + if (value != 0) + *value = curr_entry_ptr->record; + *key = curr_entry_ptr->key; + if (tab->bins == NULL) + { + bin = find_entry(tab, curr_entry_ptr->hash, curr_entry_ptr->key); + st_assert(bin != UNDEFINED_ENTRY_IND + && &entries[bin] == curr_entry_ptr); + } + else + { + bin_ind = find_table_bin_ind(tab, curr_entry_ptr->hash, + curr_entry_ptr->key); + st_assert(bin_ind != UNDEFINED_BIN_IND + && &entries[get_bin(tab->bins, get_size_ind(tab), bin_ind) + - ENTRY_BASE] + == curr_entry_ptr); + MARK_BIN_DELETED(tab, bin_ind); + } + MARK_ENTRY_DELETED(curr_entry_ptr); + tab->num_entries--; + update_range_for_deleted(tab, i); +# ifdef ST_DEBUG + st_check(tab); +# endif + return 1; + } + } + st_assert(tab->num_entries == 0); + tab->entries_start = tab->entries_bound = 0; + if (value != 0) + *value = 0; + return 0; +} + +/* See comments for function st_delete_safe. */ +void st_cleanup_safe(st_table *tab ATTRIBUTE_UNUSED, + st_data_t never ATTRIBUTE_UNUSED) +{ +} + +/* Find entry with KEY in table TAB, call FUNC with the key and the + value of the found entry, and non-zero as the 3rd argument. If the + entry is not found, call FUNC with KEY, and 2 zero arguments. If + the call returns ST_CONTINUE, the table will have an entry with key + and value returned by FUNC through the 1st and 2nd parameters. If + the call of FUNC returns ST_DELETE, the table will not have entry + with KEY. The function returns flag of that the entry with KEY was + in the table before the call. */ +int st_update(st_table *tab, st_data_t key, st_update_callback_func *func, + st_data_t arg) +{ + st_table_entry *entry = NULL; /* to avoid uninitialized value warning */ + st_index_t bin = 0; /* Ditto */ + st_table_entry *entries; + st_index_t bin_ind; + st_data_t value = 0, old_key; + st_index_t check; + int retval, existing; + st_hash_t hash = do_hash(key, tab); + + entries = tab->entries; + if (tab->bins == NULL) + { + bin = find_entry(tab, hash, key); + existing = bin != UNDEFINED_ENTRY_IND; + entry = &entries[bin]; + bin_ind = UNDEFINED_BIN_IND; + } + else + { + bin_ind = find_table_bin_ind(tab, hash, key); + existing = bin_ind != UNDEFINED_BIN_IND; + if (existing) + { + bin = get_bin(tab->bins, get_size_ind(tab), bin_ind) - ENTRY_BASE; + entry = &entries[bin]; + } + } + if (existing) + { + key = entry->key; + value = entry->record; + } + old_key = key; + check = tab->rebuilds_num; + retval = (*func)(&key, &value, arg, existing); + st_assert(check == tab->rebuilds_num); + switch (retval) + { + case ST_CONTINUE: + if (!existing) + { + st_add_direct_with_hash(tab, key, value, hash); + break; + } + if (old_key != key) + { + entry->key = key; + } + entry->record = value; + break; + case ST_DELETE: + if (existing) + { + if (bin_ind != UNDEFINED_BIN_IND) + MARK_BIN_DELETED(tab, bin_ind); + MARK_ENTRY_DELETED(entry); + tab->num_entries--; + update_range_for_deleted(tab, bin); +# ifdef ST_DEBUG + st_check(tab); +# endif + } + break; + } +# ifdef ST_DEBUG + st_check(tab); +# endif + return existing; +} +#endif /* RUBY */ + +/* Traverse all entries in table TAB calling FUNC with current entry + key and value and zero. If the call returns ST_STOP, stop + traversing. If the call returns ST_DELETE, delete the current + entry from the table. In case of ST_CHECK or ST_CONTINUE, continue + traversing. The function returns zero unless an error is found. + CHECK_P is flag of st_foreach_check call. The behavior is a bit + different for ST_CHECK and when the current element is removed + during traversing. */ +static inline int st_general_foreach(st_table *tab, int (*func)(ANYARGS), + st_data_t arg, int check_p) +{ + st_index_t bin; + st_index_t bin_ind; + st_table_entry *entries, *curr_entry_ptr; + enum st_retval retval; + st_index_t i, rebuilds_num; + st_hash_t hash; + st_data_t key; + int error_p, packed_p = tab->bins == NULL; + + st_assert(tab->entries_start <= tab->entries_bound); + entries = tab->entries; + /* The bound can change inside the loop even without rebuilding + the table, e.g. by an entry inesrtion. */ + for (i = tab->entries_start; i < tab->entries_bound; i++) + { + curr_entry_ptr = &entries[i]; + if (EXPECT(DELETED_ENTRY_P(curr_entry_ptr), 0)) + continue; + key = curr_entry_ptr->key; + rebuilds_num = tab->rebuilds_num; + hash = curr_entry_ptr->hash; + retval = (*func)(key, curr_entry_ptr->record, arg, 0); + if (rebuilds_num != tab->rebuilds_num) + { + entries = tab->entries; + packed_p = tab->bins == NULL; + if (packed_p) + { + i = find_entry(tab, hash, key); + error_p = i == UNDEFINED_ENTRY_IND; + } + else + { + i = find_table_entry_ind(tab, hash, key); + error_p = i == UNDEFINED_ENTRY_IND; + i -= ENTRY_BASE; + } + if (error_p && check_p) + { + /* call func with error notice */ + retval = (*func)(0, 0, arg, 1); +#ifdef ST_DEBUG + st_check(tab); +#endif + return 1; + } + curr_entry_ptr = &entries[i]; + } + switch (retval) + { + case ST_CONTINUE: + break; + case ST_CHECK: + if (check_p) + break; + case ST_STOP: +#ifdef ST_DEBUG + st_check(tab); +#endif + return 0; + case ST_DELETE: + if (packed_p) + { + bin = find_entry(tab, hash, curr_entry_ptr->key); + if (bin == UNDEFINED_ENTRY_IND) + break; + } + else + { + bin_ind = find_table_bin_ind(tab, hash, curr_entry_ptr->key); + if (bin_ind == UNDEFINED_BIN_IND) + break; + bin = get_bin(tab->bins, get_size_ind(tab), bin_ind) - ENTRY_BASE; + MARK_BIN_DELETED(tab, bin_ind); + } + st_assert(&entries[bin] == curr_entry_ptr); + MARK_ENTRY_DELETED(curr_entry_ptr); + tab->num_entries--; + update_range_for_deleted(tab, bin); +#ifdef ST_DEBUG + st_check(tab); +#endif + break; + } + } +#ifdef ST_DEBUG + st_check(tab); +#endif + return 0; +} + +int st_foreach(st_table *tab, int (*func)(ANYARGS), st_data_t arg) +{ + return st_general_foreach(tab, func, arg, FALSE); +} + +#ifdef RUBY +/* See comments for function st_delete_safe. */ +int st_foreach_check(st_table *tab, int (*func)(ANYARGS), st_data_t arg, + st_data_t never ATTRIBUTE_UNUSED) +{ + return st_general_foreach(tab, func, arg, TRUE); +} + +/* Set up array KEYS by at most SIZE keys of head table TAB entries. + Return the number of keys set up in array KEYS. */ +static inline st_index_t st_general_keys(st_table *tab, st_data_t *keys, + st_index_t size) +{ + st_index_t i, bound; + st_data_t key, *keys_start, *keys_end; + st_table_entry *curr_entry_ptr, *entries = tab->entries; + + bound = tab->entries_bound; + keys_start = keys; + keys_end = keys + size; + for (i = tab->entries_start; i < bound; i++) + { + if (keys == keys_end) + break; + curr_entry_ptr = &entries[i]; + key = curr_entry_ptr->key; + if (!DELETED_ENTRY_P(curr_entry_ptr)) + *keys++ = key; + } + + return keys - keys_start; +} + +st_index_t st_keys(st_table *tab, st_data_t *keys, st_index_t size) +{ + return st_general_keys(tab, keys, size); +} + +/* See comments for function st_delete_safe. */ +st_index_t st_keys_check(st_table *tab, st_data_t *keys, st_index_t size, + st_data_t never ATTRIBUTE_UNUSED) +{ + return st_general_keys(tab, keys, size); +} + +/* Set up array VALUES by at most SIZE values of head table TAB + entries. Return the number of values set up in array VALUES. */ +static inline st_index_t st_general_values(st_table *tab, st_data_t *values, + st_index_t size) +{ + st_index_t i, bound; + st_data_t *values_start, *values_end; + st_table_entry *curr_entry_ptr, *entries = tab->entries; + + values_start = values; + values_end = values + size; + bound = tab->entries_bound; + st_assert(bound != 0); + for (i = tab->entries_start; i < bound; i++) + { + if (values == values_end) + break; + curr_entry_ptr = &entries[i]; + if (!DELETED_ENTRY_P(curr_entry_ptr)) + *values++ = curr_entry_ptr->record; + } + + return values - values_start; +} + +st_index_t st_values(st_table *tab, st_data_t *values, st_index_t size) +{ + return st_general_values(tab, values, size); +} + +/* See comments for function st_delete_safe. */ +st_index_t st_values_check(st_table *tab, st_data_t *values, st_index_t size, + st_data_t never ATTRIBUTE_UNUSED) +{ + return st_general_values(tab, values, size); +} +#endif /* RUBY */ + +#ifdef RUBY +# define FNV1_32A_INIT 0x811c9dc5 + +/* + * 32 bit magic FNV-1a prime + */ +# define FNV_32_PRIME 0x01000193 + +# ifndef UNALIGNED_WORD_ACCESS +# if defined(__i386) || defined(__i386__) || defined(_M_IX86) \ + || defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) \ + || defined(__powerpc64__) || defined(__mc68020__) +# define UNALIGNED_WORD_ACCESS 1 +# endif +# endif +# ifndef UNALIGNED_WORD_ACCESS +# define UNALIGNED_WORD_ACCESS 0 +# endif + +/* This hash function is quite simplified MurmurHash3 + * Simplification is legal, cause most of magic still happens in finalizator. + * And finalizator is almost the same as in MurmurHash3 */ +# define BIG_CONSTANT(x, y) ((st_index_t)(x) << 32 | (st_index_t)(y)) +# define ROTL(x, n) ((x) << (n) | (x) >> (SIZEOF_ST_INDEX_T * CHAR_BIT - (n))) + +# if ST_INDEX_BITS <= 32 +# define C1 (st_index_t)0xcc9e2d51 +# define C2 (st_index_t)0x1b873593 +# else +# define C1 BIG_CONSTANT(0x87c37b91, 0x114253d5); +# define C2 BIG_CONSTANT(0x4cf5ad43, 0x2745937f); +# endif +static inline st_index_t murmur_step(st_index_t h, st_index_t k) +{ +# if ST_INDEX_BITS <= 32 +# define r1 (17) +# define r2 (11) +# else +# define r1 (33) +# define r2 (24) +# endif + k *= C1; + h ^= ROTL(k, r1); + h *= C2; + h = ROTL(h, r2); + return h; +} +# undef r1 +# undef r2 + +static inline st_index_t murmur_finish(st_index_t h) +{ +# if ST_INDEX_BITS <= 32 +# define r1 (16) +# define r2 (13) +# define r3 (16) + const st_index_t c1 = 0x85ebca6b; + const st_index_t c2 = 0xc2b2ae35; +# else +/* values are taken from Mix13 on + * http://zimbry.blogspot.ru/2011/09/better-bit-mixing-improving-on.html */ +# define r1 (30) +# define r2 (27) +# define r3 (31) + const st_index_t c1 = BIG_CONSTANT(0xbf58476d, 0x1ce4e5b9); + const st_index_t c2 = BIG_CONSTANT(0x94d049bb, 0x133111eb); +# endif +# if ST_INDEX_BITS > 64 + h ^= h >> 64; + h *= c2; + h ^= h >> 65; +# endif + h ^= h >> r1; + h *= c1; + h ^= h >> r2; + h *= c2; + h ^= h >> r3; + return h; +} +# undef r1 +# undef r2 +# undef r3 + +st_index_t st_hash(const void *ptr, size_t len, st_index_t h) +{ + const char *data = ptr; + st_index_t t = 0; + size_t l = len; + +# define data_at(n) (st_index_t)((unsigned char)data[(n)]) +# define UNALIGNED_ADD_4 \ + UNALIGNED_ADD(2); \ + UNALIGNED_ADD(1); \ + UNALIGNED_ADD(0) +# if SIZEOF_ST_INDEX_T > 4 +# define UNALIGNED_ADD_8 \ + UNALIGNED_ADD(6); \ + UNALIGNED_ADD(5); \ + UNALIGNED_ADD(4); \ + UNALIGNED_ADD(3); \ + UNALIGNED_ADD_4 +# if SIZEOF_ST_INDEX_T > 8 +# define UNALIGNED_ADD_16 \ + UNALIGNED_ADD(14); \ + UNALIGNED_ADD(13); \ + UNALIGNED_ADD(12); \ + UNALIGNED_ADD(11); \ + UNALIGNED_ADD(10); \ + UNALIGNED_ADD(9); \ + UNALIGNED_ADD(8); \ + UNALIGNED_ADD(7); \ + UNALIGNED_ADD_8 +# define UNALIGNED_ADD_ALL UNALIGNED_ADD_16 +# endif +# define UNALIGNED_ADD_ALL UNALIGNED_ADD_8 +# else +# define UNALIGNED_ADD_ALL UNALIGNED_ADD_4 +# endif +# undef SKIP_TAIL + if (len >= sizeof(st_index_t)) + { +# if !UNALIGNED_WORD_ACCESS + int align = (int)((st_data_t)data % sizeof(st_index_t)); + if (align) + { + st_index_t d = 0; + int sl, sr, pack; + + switch (align) + { +# ifdef WORDS_BIGENDIAN +# define UNALIGNED_ADD(n) \ + case SIZEOF_ST_INDEX_T - (n) - 1: \ + t |= data_at(n) << CHAR_BIT * (SIZEOF_ST_INDEX_T - (n) - 2) +# else +# define UNALIGNED_ADD(n) \ + case SIZEOF_ST_INDEX_T - (n) - 1: \ + t |= data_at(n) << CHAR_BIT * (n) +# endif + UNALIGNED_ADD_ALL; +# undef UNALIGNED_ADD + } + +# ifdef WORDS_BIGENDIAN + t >>= (CHAR_BIT * align) - CHAR_BIT; +# else + t <<= (CHAR_BIT * align); +# endif + + data += sizeof(st_index_t) - align; + len -= sizeof(st_index_t) - align; + + sl = CHAR_BIT * (SIZEOF_ST_INDEX_T - align); + sr = CHAR_BIT * align; + + while (len >= sizeof(st_index_t)) + { + d = *(st_index_t *)data; +# ifdef WORDS_BIGENDIAN + t = (t << sr) | (d >> sl); +# else + t = (t >> sr) | (d << sl); +# endif + h = murmur_step(h, t); + t = d; + data += sizeof(st_index_t); + len -= sizeof(st_index_t); + } + + pack = len < (size_t)align ? (int)len : align; + d = 0; + switch (pack) + { +# ifdef WORDS_BIGENDIAN +# define UNALIGNED_ADD(n) \ + case (n) + 1: \ + d |= data_at(n) << CHAR_BIT * (SIZEOF_ST_INDEX_T - (n) - 1) +# else +# define UNALIGNED_ADD(n) \ + case (n) + 1: \ + d |= data_at(n) << CHAR_BIT * (n) +# endif + UNALIGNED_ADD_ALL; +# undef UNALIGNED_ADD + } +# ifdef WORDS_BIGENDIAN + t = (t << sr) | (d >> sl); +# else + t = (t >> sr) | (d << sl); +# endif + + if (len < (size_t)align) + goto skip_tail; +# define SKIP_TAIL 1 + h = murmur_step(h, t); + data += pack; + len -= pack; + } + else +# endif + { + do + { + h = murmur_step(h, *(st_index_t *)data); + data += sizeof(st_index_t); + len -= sizeof(st_index_t); + } while (len >= sizeof(st_index_t)); + } + } + + t = 0; + switch (len) + { +# if UNALIGNED_WORD_ACCESS && SIZEOF_ST_INDEX_T <= 8 && CHAR_BIT == 8 + /* in this case byteorder doesn't really matter */ +# if SIZEOF_ST_INDEX_T > 4 + case 7: + t |= data_at(6) << 48; + case 6: + t |= data_at(5) << 40; + case 5: + t |= data_at(4) << 32; + case 4: + t |= (st_index_t) * (uint32_t *)data; + goto skip_tail; +# define SKIP_TAIL 1 +# endif + case 3: + t |= data_at(2) << 16; + case 2: + t |= data_at(1) << 8; + case 1: + t |= data_at(0); +# else +# ifdef WORDS_BIGENDIAN +# define UNALIGNED_ADD(n) \ + case (n) + 1: \ + t |= data_at(n) << CHAR_BIT * (SIZEOF_ST_INDEX_T - (n) - 1) +# else +# define UNALIGNED_ADD(n) \ + case (n) + 1: \ + t |= data_at(n) << CHAR_BIT * (n) +# endif + UNALIGNED_ADD_ALL; +# undef UNALIGNED_ADD +# endif +# ifdef SKIP_TAIL + skip_tail: +# endif + h ^= t; + h -= ROTL(t, 7); + h *= C2; + } + h ^= l; + + return murmur_finish(h); +} + +st_index_t st_hash_uint32(st_index_t h, uint32_t i) +{ + return murmur_step(h, i); +} + +st_index_t st_hash_uint(st_index_t h, st_index_t i) +{ + i += h; +/* no matter if it is BigEndian or LittleEndian, + * we hash just integers */ +# if SIZEOF_ST_INDEX_T * CHAR_BIT > 8 * 8 + h = murmur_step(h, i >> 8 * 8); +# endif + h = murmur_step(h, i); + return h; +} + +st_index_t st_hash_end(st_index_t h) +{ + h = murmur_finish(h); + return h; +} + +# undef st_hash_start +st_index_t st_hash_start(st_index_t h) +{ + return h; +} + +static st_index_t strhash(st_data_t arg) +{ + register const char *string = (const char *)arg; + return st_hash(string, strlen(string), FNV1_32A_INIT); +} + +int st_locale_insensitive_strcasecmp(const char *s1, const char *s2) +{ + unsigned int c1, c2; + + while (1) + { + c1 = (unsigned char)*s1++; + c2 = (unsigned char)*s2++; + if (c1 == '\0' || c2 == '\0') + { + if (c1 != '\0') + return 1; + if (c2 != '\0') + return -1; + return 0; + } + if ((unsigned int)(c1 - 'A') <= ('Z' - 'A')) + c1 += 'a' - 'A'; + if ((unsigned int)(c2 - 'A') <= ('Z' - 'A')) + c2 += 'a' - 'A'; + if (c1 != c2) + { + if (c1 > c2) + return 1; + else + return -1; + } + } +} + +int st_locale_insensitive_strncasecmp(const char *s1, const char *s2, size_t n) +{ + unsigned int c1, c2; + + while (n--) + { + c1 = (unsigned char)*s1++; + c2 = (unsigned char)*s2++; + if (c1 == '\0' || c2 == '\0') + { + if (c1 != '\0') + return 1; + if (c2 != '\0') + return -1; + return 0; + } + if ((unsigned int)(c1 - 'A') <= ('Z' - 'A')) + c1 += 'a' - 'A'; + if ((unsigned int)(c2 - 'A') <= ('Z' - 'A')) + c2 += 'a' - 'A'; + if (c1 != c2) + { + if (c1 > c2) + return 1; + else + return -1; + } + } + return 0; +} + +static st_index_t strcasehash(st_data_t arg) +{ + register const char *string = (const char *)arg; + register st_index_t hval = FNV1_32A_INIT; + + /* + * FNV-1a hash each octet in the buffer + */ + while (*string) + { + unsigned int c = (unsigned char)*string++; + if ((unsigned int)(c - 'A') <= ('Z' - 'A')) + c += 'a' - 'A'; + hval ^= c; + + /* multiply by the 32 bit FNV magic prime mod 2^32 */ + hval *= FNV_32_PRIME; + } + return hval; +} + +int st_numcmp(st_data_t x, st_data_t y) +{ + return x != y; +} + +st_index_t st_numhash(st_data_t n) +{ + enum + { + s1 = 11, + s2 = 3 + }; + return (st_index_t)((n >> s1 | (n << s2)) ^ (n >> s2)); +} +#endif /* RUBY */ diff --git a/lib/edbee-lib/vendor/onig/st.h b/lib/edbee-lib/vendor/onig/st.h new file mode 100644 index 00000000..77013e13 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/st.h @@ -0,0 +1,179 @@ +/* This is a public domain general purpose hash table package + originally written by Peter Moore @ UCB. + + The hash table data strutures were redesigned and the package was + rewritten by Vladimir Makarov <vmakarov@redhat.com>. */ + +#ifndef RUBY_ST_H +#define RUBY_ST_H 1 + +#if defined(__cplusplus) +extern "C" { +# if 0 +} /* satisfy cc-mode */ +# endif +#endif + +#ifdef RUBY +# include "ruby/defines.h" +#else /* RUBY */ +# ifndef RUBY_SYMBOL_EXPORT_BEGIN +# define RUBY_SYMBOL_EXPORT_BEGIN +# define RUBY_SYMBOL_EXPORT_END +# endif +#endif /* RUBY */ + +RUBY_SYMBOL_EXPORT_BEGIN + +#if SIZEOF_LONG == SIZEOF_VOIDP +typedef unsigned long st_data_t; +#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP +typedef unsigned LONG_LONG st_data_t; +#else +# error---->> st.c requires sizeof(void \ + *) == sizeof(long) or sizeof(LONG_LONG) to be compiled. <<---- +#endif +#define ST_DATA_T_DEFINED + +#ifndef CHAR_BIT +# ifdef HAVE_LIMITS_H +# include <limits.h> +# else +# define CHAR_BIT 8 +# endif +#endif +#ifndef _ +# define _(args) args +#endif +#ifndef ANYARGS +# ifdef __cplusplus +# define ANYARGS ... +# else +# define ANYARGS +# endif +#endif + +typedef struct st_table st_table; + +typedef st_data_t st_index_t; + +/* Maximal value of unsigned integer type st_index_t. */ +#define MAX_ST_INDEX_VAL (~(st_index_t)0) + +typedef int st_compare_func(st_data_t, st_data_t); +typedef st_index_t st_hash_func(st_data_t); + +typedef char st_check_for_sizeof_st_index_t + [SIZEOF_VOIDP == (int)sizeof(st_index_t) ? 1 : -1]; +#define SIZEOF_ST_INDEX_T SIZEOF_VOIDP + +struct st_hash_type +{ + int (*compare)(ANYARGS /*st_data_t, st_data_t*/); /* st_compare_func* */ + st_index_t (*hash)(ANYARGS /*st_data_t*/); /* st_hash_func* */ +}; + +#define ST_INDEX_BITS (SIZEOF_ST_INDEX_T * CHAR_BIT) + +#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR) \ + && defined(HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P) +# define ST_DATA_COMPATIBLE_P(type) \ + __builtin_choose_expr(__builtin_types_compatible_p(type, st_data_t), 1, 0) +#else +# define ST_DATA_COMPATIBLE_P(type) 0 +#endif + +typedef struct st_table_entry st_table_entry; + +struct st_table_entry; /* defined in st.c */ + +struct st_table +{ + /* Cached features of the table -- see st.c for more details. */ + unsigned char entry_power, bin_power, size_ind; + /* How many times the table was rebuilt. */ + unsigned int rebuilds_num; + const struct st_hash_type *type; + /* Number of entries currently in the table. */ + st_index_t num_entries; + /* Array of bins used for access by keys. */ + st_index_t *bins; + /* Start and bound index of entries in array entries. + entries_starts and entries_bound are in interval + [0,allocated_entries]. */ + st_index_t entries_start, entries_bound; + /* Array of size 2^entry_power. */ + st_table_entry *entries; +}; + +#define st_is_member(table, key) st_lookup((table), (key), (st_data_t *)0) + +enum st_retval +{ + ST_CONTINUE, + ST_STOP, + ST_DELETE, + ST_CHECK +}; + +st_table *st_init_table(const struct st_hash_type *); +st_table *st_init_table_with_size(const struct st_hash_type *, st_index_t); +st_table *st_init_numtable(void); +st_table *st_init_numtable_with_size(st_index_t); +st_table *st_init_strtable(void); +st_table *st_init_strtable_with_size(st_index_t); +st_table *st_init_strcasetable(void); +st_table *st_init_strcasetable_with_size(st_index_t); +int st_delete(st_table *, st_data_t *, + st_data_t *); /* returns 0:notfound 1:deleted */ +int st_delete_safe(st_table *, st_data_t *, st_data_t *, st_data_t); +int st_shift(st_table *, st_data_t *, + st_data_t *); /* returns 0:notfound 1:deleted */ +int st_insert(st_table *, st_data_t, st_data_t); +int st_insert2(st_table *, st_data_t, st_data_t, st_data_t (*)(st_data_t)); +int st_lookup(st_table *, st_data_t, st_data_t *); +int st_get_key(st_table *, st_data_t, st_data_t *); +typedef int st_update_callback_func(st_data_t *key, st_data_t *value, + st_data_t arg, int existing); +/* *key may be altered, but must equal to the old key, i.e., the + * results of hash() are same and compare() returns 0, otherwise the + * behavior is undefined */ +int st_update(st_table *table, st_data_t key, st_update_callback_func *func, + st_data_t arg); +int st_foreach(st_table *, int (*)(ANYARGS), st_data_t); +int st_foreach_check(st_table *, int (*)(ANYARGS), st_data_t, st_data_t); +st_index_t st_keys(st_table *table, st_data_t *keys, st_index_t size); +st_index_t st_keys_check(st_table *table, st_data_t *keys, st_index_t size, + st_data_t never); +st_index_t st_values(st_table *table, st_data_t *values, st_index_t size); +st_index_t st_values_check(st_table *table, st_data_t *values, st_index_t size, + st_data_t never); +void st_add_direct(st_table *, st_data_t, st_data_t); +void st_free_table(st_table *); +void st_cleanup_safe(st_table *, st_data_t); +void st_clear(st_table *); +st_table *st_copy(st_table *); +int st_numcmp(st_data_t, st_data_t); +st_index_t st_numhash(st_data_t); +int st_locale_insensitive_strcasecmp(const char *s1, const char *s2); +int st_locale_insensitive_strncasecmp(const char *s1, const char *s2, size_t n); +#define st_strcasecmp st_locale_insensitive_strcasecmp +#define st_strncasecmp st_locale_insensitive_strncasecmp +size_t st_memsize(const st_table *); +st_index_t st_hash(const void *ptr, size_t len, st_index_t h); +st_index_t st_hash_uint32(st_index_t h, uint32_t i); +st_index_t st_hash_uint(st_index_t h, st_index_t i); +st_index_t st_hash_end(st_index_t h); +st_index_t st_hash_start(st_index_t h); +#define st_hash_start(h) ((st_index_t)(h)) + +RUBY_SYMBOL_EXPORT_END + +#if defined(__cplusplus) +# if 0 +{ /* satisfy cc-mode */ +# endif +} /* extern "C" { */ +#endif + +#endif /* RUBY_ST_H */ diff --git a/lib/edbee-lib/vendor/onig/test.rb b/lib/edbee-lib/vendor/onig/test.rb new file mode 100644 index 00000000..1f1456b5 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/test.rb @@ -0,0 +1,1108 @@ +# test.rb +# Copyright (C) 2003-2006 K.Kosako (sndgk393 AT ybb DOT ne DOT jp) + +$SILENT = false +if (ARGV.size > 0 and ARGV[0] == '-s') + $SILENT = true +end + +def pr(result, reg, str, n = 0, *range) + printf("%s /%s/:'%s'", result, reg.source, str) + if (n.class == Fixnum) + printf(":%d", n) if n != 0 + if (range.size > 0) + if (range[3].nil?) + printf(" (%d-%d : X-X)", range[0], range[1]) + else + printf(" (%d-%d : %d-%d)", range[0], range[1], range[2], range[3]) + end + end + else + printf(" %s", n) + end + printf("\n") +end + +def rok(result_opt, reg, str, n = 0, *range) + result = "OK" + result_opt + result += " " * (7 - result.length) + pr(result, reg, str, n, *range) unless $SILENT + $rok += 1 +end + +def rfail(result_opt, reg, str, n = 0, *range) + result = "FAIL" + result_opt + result += " " * (7 - result.length) + pr(result, reg, str, n, *range) + $rfail += 1 +end + +def x(reg, str, s, e, n = 0) + m = reg.match(str) + if m + if (m.size() <= n) + rfail("(%d)" % (m.size()-1), reg, str, n) + else + if (m.begin(n) == s && m.end(n) == e) + rok("", reg, str, n) + else + rfail("", reg, str, n, s, e, m.begin(n), m.end(n)) + end + end + else + rfail("", reg, str, n) + end +end + +def n(reg, str) + m = reg.match(str) + if m + rfail("(N)", reg, str, 0) + else + rok("(N)", reg, str, 0) + end +end + +def r(reg, str, index, pos = nil) + if (pos) + res = str.rindex(reg, pos) + else + res = str.rindex(reg) + end + if res + if (res == index) + rok("(r)", reg, str) + else + rfail("(r)", reg, str, [res, '-', index]) + end + else + rfail("(r)", reg, str) + end +end + +def i(reg, str, s = 0, e = 0, n = 0) + # ignore +end + +### main ### +$rok = $rfail = 0 + + +x(/\M-Z/n, "\xDA", 0, 1) + +# from URI::ABS_URI +n(/^ + ([a-zA-Z][-+.a-zA-Z\d]*): (?# 1: scheme) + (?: + ((?:[-_.!~*'()a-zA-Z\d;?:@&=+$,]|%[a-fA-F\d]{2})(?:[-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*) (?# 2: opaque) + | + (?:(?: + \/\/(?: + (?:(?:((?:[-_.!~*'()a-zA-Z\d;:&=+$,]|%[a-fA-F\d]{2})*)@)? (?# 3: userinfo) + (?:((?:(?:(?:[a-zA-Z\d](?:[-a-zA-Z\d]*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:[-a-zA-Z\d]*[a-zA-Z\d])?)\.?|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[(?:(?:[a-fA-F\d]{1,4}:)*(?:[a-fA-F\d]{1,4}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|(?:(?:[a-fA-F\d]{1,4}:)*[a-fA-F\d]{1,4})?::(?:(?:[a-fA-F\d]{1,4}:)*(?:[a-fA-F\d]{1,4}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}))?)\]))(?::(\d*))?))?(?# 4: host, 5: port) + | + ((?:[-_.!~*'()a-zA-Z\d$,;+@&=+]|%[a-fA-F\d]{2})+) (?# 6: registry) + ) + | + (?!\/\/)) (?# XXX: '\/\/' is the mark for hostport) + (\/(?:[-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*(?:;(?:[-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*)*(?:\/(?:[-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*(?:;(?:[-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*)*)*)? (?# 7: path) + )(?:\?((?:[-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*))? (?# 8: query) + ) + (?:\#((?:[-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*))? (?# 9: fragment) + $/xn, "http://example.org/Andr\xC3\xA9") + + +def test_sb(enc) +$KCODE = enc + +x(//, '', 0, 0) +x(/^/, '', 0, 0) +x(/$/, '', 0, 0) +x(/\G/, '', 0, 0) +x(/\A/, '', 0, 0) +x(/\Z/, '', 0, 0) +x(/\z/, '', 0, 0) +x(/^$/, '', 0, 0) +x(/\ca/, "\001", 0, 1) +x(/\C-b/, "\002", 0, 1) +x(/\c\\/, "\034", 0, 1) +x(/q[\c\\]/, "q\034", 0, 2) +x(//, 'a', 0, 0) +x(/a/, 'a', 0, 1) +x(/\x61/, 'a', 0, 1) +x(/aa/, 'aa', 0, 2) +x(/aaa/, 'aaa', 0, 3) +x(/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 0, 35) +x(/ab/, 'ab', 0, 2) +x(/b/, 'ab', 1, 2) +x(/bc/, 'abc', 1, 3) +x(/(?i:#RET#)/, '#INS##RET#', 5, 10) +x(/\17/, "\017", 0, 1) +x(/\x1f/, "\x1f", 0, 1) +x(/a(?#....\\JJJJ)b/, 'ab', 0, 2) +x(Regexp.new("(?x)\ta .\n+b"), '0a123b4', 1, 6) +x(/(?x) G (o O(?-x)oO) g L/, "GoOoOgLe", 0, 7) +x(/./, 'a', 0, 1) +n(/./, '') +x(/../, 'ab', 0, 2) +x(/\w/, 'e', 0, 1) +n(/\W/, 'e') +x(/\s/, ' ', 0, 1) +x(/\S/, 'b', 0, 1) +x(/\d/, '4', 0, 1) +n(/\D/, '4') +x(/\b/, 'z ', 0, 0) +x(/\b/, ' z', 1, 1) +x(/\B/, 'zz ', 1, 1) +x(/\B/, 'z ', 2, 2) +x(/\B/, ' z', 0, 0) +x(/[ab]/, 'b', 0, 1) +n(/[ab]/, 'c') +x(/[a-z]/, 't', 0, 1) +n(/[^a]/, 'a') +x(/[^a]/, "\n", 0, 1) +x(/[]]/, ']', 0, 1) +n(/[^]]/, ']') +x(/[\^]+/, '0^^1', 1, 3) +x(/[b-]/, 'b', 0, 1) +x(/[b-]/, '-', 0, 1) +x(/[\w]/, 'z', 0, 1) +n(/[\w]/, ' ') +x(/[\W]/, 'b$', 1, 2) +x(/[\d]/, '5', 0, 1) +n(/[\d]/, 'e') +x(/[\D]/, 't', 0, 1) +n(/[\D]/, '3') +x(/[\s]/, ' ', 0, 1) +n(/[\s]/, 'a') +x(/[\S]/, 'b', 0, 1) +n(/[\S]/, ' ') +x(/[\w\d]/, '2', 0, 1) +n(/[\w\d]/, ' ') +x(/[[:upper:]]/, 'B', 0, 1) +x(/[*[:xdigit:]+]/, '+', 0, 1) +x(/[*[:xdigit:]+]/, 'GHIKK-9+*', 6, 7) +x(/[*[:xdigit:]+]/, '-@^+', 3, 4) +n(/[[:upper]]/, 'A') +x(/[[:upper]]/, ':', 0, 1) +x(/[\044-\047]/, "\046", 0, 1) +x(/[\x5a-\x5c]/, "\x5b", 0, 1) +x(/[\x6A-\x6D]/, "\x6c", 0, 1) +n(/[\x6A-\x6D]/, "\x6E") +n(/^[0-9A-F]+ 0+ UNDEF /, '75F 00000000 SECT14A notype () External | _rb_apply') +x(/[\[]/, '[', 0, 1) +x(/[\]]/, ']', 0, 1) +x(/[&]/, '&', 0, 1) +x(/[[ab]]/, 'b', 0, 1) +x(/[[ab]c]/, 'c', 0, 1) +n(/[[^a]]/, 'a') +n(/[^[a]]/, 'a') +x(/[[ab]&&bc]/, 'b', 0, 1) +n(/[[ab]&&bc]/, 'a') +n(/[[ab]&&bc]/, 'c') +x(/[a-z&&b-y&&c-x]/, 'w', 0, 1) +n(/[^a-z&&b-y&&c-x]/, 'w') +x(/[[^a&&a]&&a-z]/, 'b', 0, 1) +n(/[[^a&&a]&&a-z]/, 'a') +x(/[[^a-z&&bcdef]&&[^c-g]]/, 'h', 0, 1) +n(/[[^a-z&&bcdef]&&[^c-g]]/, 'c') +x(/[^[^abc]&&[^cde]]/, 'c', 0, 1) +x(/[^[^abc]&&[^cde]]/, 'e', 0, 1) +n(/[^[^abc]&&[^cde]]/, 'f') +x(/[a-&&-a]/, '-', 0, 1) +n(/[a\-&&\-a]/, '&') +n(/\wabc/, ' abc') +x(/a\Wbc/, 'a bc', 0, 4) +x(/a.b.c/, 'aabbc', 0, 5) +x(/.\wb\W..c/, 'abb bcc', 0, 7) +x(/\s\wzzz/, ' zzzz', 0, 5) +x(/aa.b/, 'aabb', 0, 4) +n(/.a/, 'ab') +x(/.a/, 'aa', 0, 2) +x(/^a/, 'a', 0, 1) +x(/^a$/, 'a', 0, 1) +x(/^\w$/, 'a', 0, 1) +n(/^\w$/, ' ') +x(/^\wab$/, 'zab', 0, 3) +x(/^\wabcdef$/, 'zabcdef', 0, 7) +x(/^\w...def$/, 'zabcdef', 0, 7) +x(/\w\w\s\Waaa\d/, 'aa aaa4', 0, 8) +x(/\A\Z/, '', 0, 0) +x(/\Axyz/, 'xyz', 0, 3) +x(/xyz\Z/, 'xyz', 0, 3) +x(/xyz\z/, 'xyz', 0, 3) +x(/a\Z/, 'a', 0, 1) +x(/\Gaz/, 'az', 0, 2) +n(/\Gz/, 'bza') +n(/az\G/, 'az') +n(/az\A/, 'az') +n(/a\Az/, 'az') +x(/\^\$/, '^$', 0, 2) +x(/^x?y/, 'xy', 0, 2) +x(/^(x?y)/, 'xy', 0, 2) +x(/\w/, '_', 0, 1) +n(/\W/, '_') +x(/(?=z)z/, 'z', 0, 1) +n(/(?=z)./, 'a') +x(/(?!z)a/, 'a', 0, 1) +n(/(?!z)a/, 'z') +x(/(?i:a)/, 'a', 0, 1) +x(/(?i:a)/, 'A', 0, 1) +x(/(?i:A)/, 'a', 0, 1) +n(/(?i:A)/, 'b') +x(/(?i:[A-Z])/, 'a', 0, 1) +x(/(?i:[f-m])/, 'H', 0, 1) +x(/(?i:[f-m])/, 'h', 0, 1) +n(/(?i:[f-m])/, 'e') +x(/(?i:[A-c])/, 'D', 0, 1) +#n(/(?i:[a-C])/, 'D') # changed spec.(error) 2003/09/17 +#n(/(?i:[b-C])/, 'A') +#x(/(?i:[a-C])/, 'B', 0, 1) +#n(/(?i:[c-X])/, '[') +n(/(?i:[^a-z])/, 'A') +n(/(?i:[^a-z])/, 'a') +x(/(?i:[!-k])/, 'Z', 0, 1) +x(/(?i:[!-k])/, '7', 0, 1) +x(/(?i:[T-}])/, 'b', 0, 1) +x(/(?i:[T-}])/, '{', 0, 1) +x(/(?i:\?a)/, '?A', 0, 2) +x(/(?i:\*A)/, '*a', 0, 2) +n(/./, "\n") +x(/(?m:.)/, "\n", 0, 1) +x(/(?m:a.)/, "a\n", 0, 2) +x(/(?m:.b)/, "a\nb", 1, 3) +x(/.*abc/, "dddabdd\nddabc", 8, 13) +x(/(?m:.*abc)/, "dddabddabc", 0, 10) +n(/(?i)(?-i)a/, "A") +n(/(?i)(?-i:a)/, "A") +x(/a?/, '', 0, 0) +x(/a?/, 'b', 0, 0) +x(/a?/, 'a', 0, 1) +x(/a*/, '', 0, 0) +x(/a*/, 'a', 0, 1) +x(/a*/, 'aaa', 0, 3) +x(/a*/, 'baaaa', 0, 0) +n(/a+/, '') +x(/a+/, 'a', 0, 1) +x(/a+/, 'aaaa', 0, 4) +x(/a+/, 'aabbb', 0, 2) +x(/a+/, 'baaaa', 1, 5) +x(/.?/, '', 0, 0) +x(/.?/, 'f', 0, 1) +x(/.?/, "\n", 0, 0) +x(/.*/, '', 0, 0) +x(/.*/, 'abcde', 0, 5) +x(/.+/, 'z', 0, 1) +x(/.+/, "zdswer\n", 0, 6) +x(/(.*)a\1f/, "babfbac", 0, 4) +x(/(.*)a\1f/, "bacbabf", 3, 7) +x(/((.*)a\2f)/, "bacbabf", 3, 7) +x(/(.*)a\1f/, "baczzzzzz\nbazz\nzzzzbabf", 19, 23) +x(/a|b/, 'a', 0, 1) +x(/a|b/, 'b', 0, 1) +x(/|a/, 'a', 0, 0) +x(/(|a)/, 'a', 0, 0) +x(/ab|bc/, 'ab', 0, 2) +x(/ab|bc/, 'bc', 0, 2) +x(/z(?:ab|bc)/, 'zbc', 0, 3) +x(/a(?:ab|bc)c/, 'aabc', 0, 4) +x(/ab|(?:ac|az)/, 'az', 0, 2) +x(/a|b|c/, 'dc', 1, 2) +x(/a|b|cd|efg|h|ijk|lmn|o|pq|rstuvwx|yz/, 'pqr', 0, 2) +n(/a|b|cd|efg|h|ijk|lmn|o|pq|rstuvwx|yz/, 'mn') +x(/a|^z/, 'ba', 1, 2) +x(/a|^z/, 'za', 0, 1) +x(/a|\Gz/, 'bza', 2, 3) +x(/a|\Gz/, 'za', 0, 1) +x(/a|\Az/, 'bza', 2, 3) +x(/a|\Az/, 'za', 0, 1) +x(/a|b\Z/, 'ba', 1, 2) +x(/a|b\Z/, 'b', 0, 1) +x(/a|b\z/, 'ba', 1, 2) +x(/a|b\z/, 'b', 0, 1) +x(/\w|\s/, ' ', 0, 1) +n(/\w|\w/, ' ') +x(/\w|%/, '%', 0, 1) +x(/\w|[&$]/, '&', 0, 1) +x(/[b-d]|[^e-z]/, 'a', 0, 1) +x(/(?:a|[c-f])|bz/, 'dz', 0, 1) +x(/(?:a|[c-f])|bz/, 'bz', 0, 2) +x(/abc|(?=zz)..f/, 'zzf', 0, 3) +x(/abc|(?!zz)..f/, 'abf', 0, 3) +x(/(?=za)..a|(?=zz)..a/, 'zza', 0, 3) +n(/(?>a|abd)c/, 'abdc') +x(/(?>abd|a)c/, 'abdc', 0, 4) +x(/a?|b/, 'a', 0, 1) +x(/a?|b/, 'b', 0, 0) +x(/a?|b/, '', 0, 0) +x(/a*|b/, 'aa', 0, 2) +x(/a*|b*/, 'ba', 0, 0) +x(/a*|b*/, 'ab', 0, 1) +x(/a+|b*/, '', 0, 0) +x(/a+|b*/, 'bbb', 0, 3) +x(/a+|b*/, 'abbb', 0, 1) +n(/a+|b+/, '') +x(/(a|b)?/, 'b', 0, 1) +x(/(a|b)*/, 'ba', 0, 2) +x(/(a|b)+/, 'bab', 0, 3) +x(/(ab|ca)+/, 'caabbc', 0, 4) +x(/(ab|ca)+/, 'aabca', 1, 5) +x(/(ab|ca)+/, 'abzca', 0, 2) +x(/(a|bab)+/, 'ababa', 0, 5) +x(/(a|bab)+/, 'ba', 1, 2) +x(/(a|bab)+/, 'baaaba', 1, 4) +x(/(?:a|b)(?:a|b)/, 'ab', 0, 2) +x(/(?:a*|b*)(?:a*|b*)/, 'aaabbb', 0, 3) +x(/(?:a*|b*)(?:a+|b+)/, 'aaabbb', 0, 6) +x(/(?:a+|b+){2}/, 'aaabbb', 0, 6) +x(/h{0,}/, 'hhhh', 0, 4) +x(/(?:a+|b+){1,2}/, 'aaabbb', 0, 6) +n(/ax{2}*a/, '0axxxa1') +n(/a.{0,2}a/, "0aXXXa0") +n(/a.{0,2}?a/, "0aXXXa0") +n(/a.{0,2}?a/, "0aXXXXa0") +x(/^a{2,}?a$/, "aaa", 0, 3) +x(/^[a-z]{2,}?$/, "aaa", 0, 3) +x(/(?:a+|\Ab*)cc/, 'cc', 0, 2) +n(/(?:a+|\Ab*)cc/, 'abcc') +x(/(?:^a+|b+)*c/, 'aabbbabc', 6, 8) +x(/(?:^a+|b+)*c/, 'aabbbbc', 0, 7) +x(/a|(?i)c/, 'C', 0, 1) +x(/(?i)c|a/, 'C', 0, 1) +i(/(?i)c|a/, 'A', 0, 1) # different spec. +x(/(?i:c)|a/, 'C', 0, 1) +n(/(?i:c)|a/, 'A') +x(/[abc]?/, 'abc', 0, 1) +x(/[abc]*/, 'abc', 0, 3) +x(/[^abc]*/, 'abc', 0, 0) +n(/[^abc]+/, 'abc') +x(/a??/, 'aaa', 0, 0) +x(/ba??b/, 'bab', 0, 3) +x(/a*?/, 'aaa', 0, 0) +x(/ba*?/, 'baa', 0, 1) +x(/ba*?b/, 'baab', 0, 4) +x(/a+?/, 'aaa', 0, 1) +x(/ba+?/, 'baa', 0, 2) +x(/ba+?b/, 'baab', 0, 4) +x(/(?:a?)??/, 'a', 0, 0) +x(/(?:a??)?/, 'a', 0, 0) +x(/(?:a?)+?/, 'aaa', 0, 1) +x(/(?:a+)??/, 'aaa', 0, 0) +x(/(?:a+)??b/, 'aaab', 0, 4) +i(/(?:ab)?{2}/, '', 0, 0) # GNU regex bug +x(/(?:ab)?{2}/, 'ababa', 0, 4) +x(/(?:ab)*{0}/, 'ababa', 0, 0) +x(/(?:ab){3,}/, 'abababab', 0, 8) +n(/(?:ab){3,}/, 'abab') +x(/(?:ab){2,4}/, 'ababab', 0, 6) +x(/(?:ab){2,4}/, 'ababababab', 0, 8) +x(/(?:ab){2,4}?/, 'ababababab', 0, 4) +x(/(?:ab){,}/, 'ab{,}', 0, 5) +x(/(?:abc)+?{2}/, 'abcabcabc', 0, 6) +x(/(?:X*)(?i:xa)/, 'XXXa', 0, 4) +x(/(d+)([^abc]z)/, 'dddz', 0, 4) +x(/([^abc]*)([^abc]z)/, 'dddz', 0, 4) +x(/(\w+)(\wz)/, 'dddz', 0, 4) +x(/(a)/, 'a', 0, 1, 1) +x(/(ab)/, 'ab', 0, 2, 1) +x(/((ab))/, 'ab', 0, 2) +x(/((ab))/, 'ab', 0, 2, 1) +x(/((ab))/, 'ab', 0, 2, 2) +x(/((((((((((((((((((((ab))))))))))))))))))))/, 'ab', 0, 2, 20) +x(/(ab)(cd)/, 'abcd', 0, 2, 1) +x(/(ab)(cd)/, 'abcd', 2, 4, 2) +x(/()(a)bc(def)ghijk/, 'abcdefghijk', 3, 6, 3) +x(/(()(a)bc(def)ghijk)/, 'abcdefghijk', 3, 6, 4) +x(/(^a)/, 'a', 0, 1) +x(/(a)|(a)/, 'ba', 1, 2, 1) +x(/(^a)|(a)/, 'ba', 1, 2, 2) +x(/(a?)/, 'aaa', 0, 1, 1) +x(/(a*)/, 'aaa', 0, 3, 1) +x(/(a*)/, '', 0, 0, 1) +x(/(a+)/, 'aaaaaaa', 0, 7, 1) +x(/(a+|b*)/, 'bbbaa', 0, 3, 1) +x(/(a+|b?)/, 'bbbaa', 0, 1, 1) +x(/(abc)?/, 'abc', 0, 3, 1) +x(/(abc)*/, 'abc', 0, 3, 1) +x(/(abc)+/, 'abc', 0, 3, 1) +x(/(xyz|abc)+/, 'abc', 0, 3, 1) +x(/([xyz][abc]|abc)+/, 'abc', 0, 3, 1) +x(/((?i:abc))/, 'AbC', 0, 3, 1) +x(/(abc)(?i:\1)/, 'abcABC', 0, 6) +x(/((?m:a.c))/, "a\nc", 0, 3, 1) +x(/((?=az)a)/, 'azb', 0, 1, 1) +x(/abc|(.abd)/, 'zabd', 0, 4, 1) +x(/(?:abc)|(ABC)/, 'abc', 0, 3) +x(/(?i:(abc))|(zzz)/, 'ABC', 0, 3, 1) +x(/a*(.)/, 'aaaaz', 4, 5, 1) +x(/a*?(.)/, 'aaaaz', 0, 1, 1) +x(/a*?(c)/, 'aaaac', 4, 5, 1) +x(/[bcd]a*(.)/, 'caaaaz', 5, 6, 1) +x(/(\Abb)cc/, 'bbcc', 0, 2, 1) +n(/(\Abb)cc/, 'zbbcc') +x(/(^bb)cc/, 'bbcc', 0, 2, 1) +n(/(^bb)cc/, 'zbbcc') +x(/cc(bb$)/, 'ccbb', 2, 4, 1) +n(/cc(bb$)/, 'ccbbb') +#n(/\1/, 'a') # compile error on Oniguruma +n(/(\1)/, '') +n(/\1(a)/, 'aa') +n(/(a(b)\1)\2+/, 'ababb') +n(/(?:(?:\1|z)(a))+$/, 'zaa') +x(/(?:(?:\1|z)(a))+$/, 'zaaa', 0, 4) +x(/(a)(?=\1)/, 'aa', 0, 1) +n(/(a)$|\1/, 'az') +x(/(a)\1/, 'aa', 0, 2) +n(/(a)\1/, 'ab') +x(/(a?)\1/, 'aa', 0, 2) +x(/(a??)\1/, 'aa', 0, 0) +x(/(a*)\1/, 'aaaaa', 0, 4) +x(/(a*)\1/, 'aaaaa', 0, 2, 1) +x(/a(b*)\1/, 'abbbb', 0, 5) +x(/a(b*)\1/, 'ab', 0, 1) +x(/(a*)(b*)\1\2/, 'aaabbaaabb', 0, 10) +x(/(a*)(b*)\2/, 'aaabbbb', 0, 7) +x(/(((((((a*)b))))))c\7/, 'aaabcaaa', 0, 8) +x(/(((((((a*)b))))))c\7/, 'aaabcaaa', 0, 3, 7) +x(/(a)(b)(c)\2\1\3/, 'abcbac', 0, 6) +x(/([a-d])\1/, 'cc', 0, 2) +x(/(\w\d\s)\1/, 'f5 f5 ', 0, 6) +n(/(\w\d\s)\1/, 'f5 f5') +x(/(who|[a-c]{3})\1/, 'whowho', 0, 6) +x(/...(who|[a-c]{3})\1/, 'abcwhowho', 0, 9) +x(/(who|[a-c]{3})\1/, 'cbccbc', 0, 6) +x(/(^a)\1/, 'aa', 0, 2) +n(/(^a)\1/, 'baa') +n(/(a$)\1/, 'aa') +n(/(ab\Z)\1/, 'ab') +x(/(a*\Z)\1/, 'a', 1, 1) +x(/.(a*\Z)\1/, 'ba', 1, 2) +x(/(.(abc)\2)/, 'zabcabc', 0, 7, 1) +x(/(.(..\d.)\2)/, 'z12341234', 0, 9, 1) +x(/((?i:az))\1/, 'AzAz', 0, 4) +n(/((?i:az))\1/, 'Azaz') +x(/(?<=a)b/, 'ab', 1, 2) +n(/(?<=a)b/, 'bb') +x(/(?<=a|b)b/, 'bb', 1, 2) +x(/(?<=a|bc)b/, 'bcb', 2, 3) +x(/(?<=a|bc)b/, 'ab', 1, 2) +x(/(?<=a|bc||defghij|klmnopq|r)z/, 'rz', 1, 2) +x(/(a)\g<1>/, 'aa', 0, 2) +x(/(?<!a)b/, 'cb', 1, 2) +n(/(?<!a)b/, 'ab') +x(/(?<!a|bc)b/, 'bbb', 0, 1) +n(/(?<!a|bc)z/, 'bcz') +x(/(?<name1>a)/, 'a', 0, 1) +x(/(?<name_2>ab)\g<name_2>/, 'abab', 0, 4) +x(/(?<name_3>.zv.)\k<name_3>/, 'azvbazvb', 0, 8) +x(/(?<=\g<ab>)|-\zEND (?<ab>XyZ)/, 'XyZ', 3, 3) +x(/(?<n>|a\g<n>)+/, '', 0, 0) +x(/(?<n>|\(\g<n>\))+$/, '()(())', 0, 6) +x(/\g<n>(?<n>.){0}/, 'X', 0, 1, 1) +x(/\g<n>(abc|df(?<n>.YZ){2,8}){0}/, 'XYZ', 0, 3) +x(/\A(?<n>(a\g<n>)|)\z/, 'aaaa', 0, 4) +x(/(?<n>|\g<m>\g<n>)\z|\zEND (?<m>a|(b)\g<m>)/, 'bbbbabba', 0, 8) +x(/(?<name1240>\w+\sx)a+\k<name1240>/, ' fg xaaaaaaaafg x', 2, 18) +x(/(z)()()(?<_9>a)\g<_9>/, 'zaa', 2, 3, 1) +x(/(.)(((?<_>a)))\k<_>/, 'zaa', 0, 3) +x(/((?<name1>\d)|(?<name2>\w))(\k<name1>|\k<name2>)/, 'ff', 0, 2) +x(/(?:(?<x>)|(?<x>efg))\k<x>/, '', 0, 0) +x(/(?:(?<x>abc)|(?<x>efg))\k<x>/, 'abcefgefg', 3, 9) +n(/(?:(?<x>abc)|(?<x>efg))\k<x>/, 'abcefg') +x(/(?:(?<n1>.)|(?<n1>..)|(?<n1>...)|(?<n1>....)|(?<n1>.....)|(?<n1>......)|(?<n1>.......)|(?<n1>........)|(?<n1>.........)|(?<n1>..........)|(?<n1>...........)|(?<n1>............)|(?<n1>.............)|(?<n1>..............))\k<n1>$/, 'a-pyumpyum', 2, 10) +x(/(?:(?<n1>.)|(?<n1>..)|(?<n1>...)|(?<n1>....)|(?<n1>.....)|(?<n1>......)|(?<n1>.......)|(?<n1>........)|(?<n1>.........)|(?<n1>..........)|(?<n1>...........)|(?<n1>............)|(?<n1>.............)|(?<n1>..............))\k<n1>$/, 'xxxxabcdefghijklmnabcdefghijklmn', 4, 18, 14) +x(/(?<name1>)(?<name2>)(?<name3>)(?<name4>)(?<name5>)(?<name6>)(?<name7>)(?<name8>)(?<name9>)(?<name10>)(?<name11>)(?<name12>)(?<name13>)(?<name14>)(?<name15>)(?<name16>aaa)(?<name17>)$/, 'aaa', 0, 3, 16) +x(/(?<foo>a|\(\g<foo>\))/, 'a', 0, 1) +x(/(?<foo>a|\(\g<foo>\))/, '((((((a))))))', 0, 13) +x(/(?<foo>a|\(\g<foo>\))/, '((((((((a))))))))', 0, 17, 1) +x(/\g<bar>|\zEND(?<bar>.*abc$)/, 'abcxxxabc', 0, 9) +x(/\g<1>|\zEND(.a.)/, 'bac', 0, 3) +x(/\g<_A>\g<_A>|\zEND(.a.)(?<_A>.b.)/, 'xbxyby', 3, 6, 1) +x(/\A(?:\g<pon>|\g<pan>|\zEND (?<pan>a|c\g<pon>c)(?<pon>b|d\g<pan>d))$/, 'cdcbcdc', 0, 7) +x(/\A(?<n>|a\g<m>)\z|\zEND (?<m>\g<n>)/, 'aaaa', 0, 4) +x(/(?<n>(a|b\g<n>c){3,5})/, 'baaaaca', 1, 5) +x(/(?<n>(a|b\g<n>c){3,5})/, 'baaaacaaaaa', 0, 10) +x(/(?<pare>\(([^\(\)]++|\g<pare>)*+\))/, '((a))', 0, 5) +x(/()*\1/, '', 0, 0) +x(/(?:()|())*\1\2/, '', 0, 0) +x(/(?:\1a|())*/, 'a', 0, 0, 1) +x(/x((.)*)*x/, '0x1x2x3', 1, 6) +x(/x((.)*)*x(?i:\1)\Z/, '0x1x2x1X2', 1, 9) +x(/(?:()|()|()|()|()|())*\2\5/, '', 0, 0) +x(/(?:()|()|()|(x)|()|())*\2b\5/, 'b', 0, 1) + +r(//, '', 0) +r(/a/, 'a', 0) +r(/a/, 'a', 0, 1) +r(/b/, 'abc', 1) +r(/b/, 'abc', 1, 2) +r(/./, 'a', 0) +r(/.*/, 'abcde fgh', 9) +r(/a*/, 'aaabbc', 6) +r(/a+/, 'aaabbc', 2) +r(/a?/, 'bac', 3) +r(/a??/, 'bac', 3) +r(/abcde/, 'abcdeavcd', 0) +r(/\w\d\s/, ' a2 aa $3 ', 2) +r(/[c-f]aa[x-z]/, '3caaycaaa', 1) +r(/(?i:fG)g/, 'fGgFggFgG', 3) +r(/a|b/, 'b', 0) +r(/ab|bc|cd/, 'bcc', 0) +r(/(ffy)\1/, 'ffyffyffy', 3) +r(/|z/, 'z', 1) +r(/^az/, 'azaz', 0) +r(/az$/, 'azaz', 2) +r(/(((.a)))\3/, 'zazaaa', 0) +r(/(ac*?z)\1/, 'aacczacczacz', 1) +r(/aaz{3,4}/, 'bbaabbaazzzaazz', 6) +r(/\000a/, "b\000a", 1) +r(/ff\xfe/, "fff\xfe", 1) +r(/...abcdefghijklmnopqrstuvwxyz/, 'zzzzzabcdefghijklmnopqrstuvwxyz', 2) +end + +def test_euc(enc) +$KCODE = enc + +x(/\xED\xF2/, "\xed\xf2", 0, 2) +x(//, '', 0, 0) +x(//, '', 0, 2) +n(//, '') +x(//, '', 0, 4) +x(//, '', 0, 6) +x(//, '', 0, 70) +x(//, '', 2, 4) +x(//, '', 2, 6) +x(/\xca\xb8/, "\xca\xb8", 0, 2) +x(/./, '', 0, 2) +x(/../, '', 0, 4) +x(/(?u)\w/, '', 0, 2) +n(/(?u)\W/, '') +x(/(?u)[\W]/, '$', 2, 3) +x(/\S/, '', 0, 2) +x(/\S/, '', 0, 2) +x(/\b/, ' ', 0, 0) +x(/\b/, ' ', 1, 1) +x(/\B/, ' ', 2, 2) +x(/\B/, ' ', 3, 3) +x(/\B/, ' ', 0, 0) +x(/[]/, '', 0, 2) +n(/[ʤ]/, '') +x(/[-]/, '', 0, 2) +n(/[^]/, '') +x(/(?u)[\w]/, '', 0, 2) +n(/[\d]/, '') +x(/[\D]/, '', 0, 2) +n(/[\s]/, '') +x(/[\S]/, '', 0, 2) +x(/(?u)[\w\d]/, '', 0, 2) +x(/(?u)[\w\d]/, ' ', 3, 5) +#x(/[\xa4\xcf-\xa4\xd3]/, "\xa4\xd0", 0, 2) # diff spec with GNU regex. +#n(/[\xb6\xe7-\xb6\xef]/, "\xb6\xe5") # diff spec with GNU regex. +n(/(?u)\w/, ' ') +x(/(?u)\W/, ' ', 0, 5) +x(/../, '', 0, 10) +x(/(?u).\w\W../, ' ', 0, 13) +x(/(?u)\s\w/, ' ', 0, 9) +x(/./, '', 0, 8) +n(/./, '') +x(/./, '', 0, 4) +x(/^/, '', 0, 2) +x(/^$/, '', 0, 2) +x(/(?u)^\w$/, '', 0, 2) +x(/(?u)^\w$/, 'z', 0, 11) +x(/(?u)^\w...$/, 'z', 0, 13) +x(/(?u)\w\w\s\W\d/, 'a 4', 0, 12) +x(/\A/, '', 0, 6) +x(/\Z/, '', 0, 6) +x(/\z/, '', 0, 6) +x(/\Z/, "\n", 0, 6) +x(/\Gݤ/, 'ݤ', 0, 4) +n(/\G/, '') +n(/Ȥ\G/, 'Ȥ') +n(/ޤ\A/, 'ޤ') +n(/\A/, 'ޤ') +x(/(?=)/, '', 0, 2) +n(/(?=)./, '') +x(/(?!)/, '', 0, 2) +n(/(?!)/, '') +x(/(?i:)/, '', 0, 2) +x(/(?i:֤)/, '֤', 0, 4) +n(/(?i:)/, '') +x(/(?m:.)/, "\n", 0, 3) +x(/(?m:.)/, "\n", 2, 5) +x(/?/, '', 0, 0) +x(/?/, '', 0, 0) +x(/?/, '', 0, 2) +x(/*/, '', 0, 0) +x(/*/, '', 0, 2) +x(/*/, 'һһ', 0, 6) +x(/*/, '', 0, 0) +n(/+/, '') +x(/+/, '', 0, 2) +x(/+/, '', 0, 8) +x(/+/, '', 0, 4) +x(/+/, '', 2, 10) +x(/.?/, '', 0, 2) +x(/.*/, 'ѤԤפ', 0, 8) +x(/.+/, '', 0, 2) +x(/.+/, "\n", 0, 8) +x(/|/, '', 0, 2) +x(/|/, '', 0, 2) +x(/|/, '', 0, 4) +x(/|/, '', 0, 4) +x(/(?:|)/, '򤫤', 0, 6) +x(/(?:|)/, '򤭤', 0, 8) +x(/|(?:|)/, '', 0, 4) +x(/||/, '', 2, 4) +x(/|||||||||ĤƤȤʤ|̤/, '', 0, 6) +n(/|||||||||ĤƤȤʤ|̤/, '') +x(/|^/, '֤', 2, 4) +x(/|^/, '', 0, 2) +x(/|\G/, 'ֵ', 4, 6) +x(/|\G/, 'ֵ', 0, 2) +x(/|\A/, 'bֵ', 3, 5) +x(/|\A/, '', 0, 2) +x(/|\Z/, 'ֵ', 2, 4) +x(/|\Z/, '', 0, 2) +x(/|\Z/, "\n", 0, 2) +x(/|\z/, 'ֵ', 2, 4) +x(/|\z/, '', 0, 2) +x(/(?u)\w|\s/, '', 0, 2) +x(/(?u)\w|%/, '%', 0, 1) +x(/(?u)\w|[&$]/, '&', 0, 2) +x(/[-]/, '', 0, 2) +x(/[-]|[^-]/, '', 0, 2) +x(/[-]|[^-]/, '', 0, 2) +x(/[^]/, "\n", 0, 1) +x(/(?:|[-])|/, '', 0, 2) +x(/(?:|[-])|/, '', 0, 4) +x(/|(?=)../, '', 0, 6) +x(/|(?!)../, '', 0, 6) +x(/(?=)..|(?=)../, '', 0, 6) +x(/(?<=|)/, '', 4, 6) +n(/(?>|)/, '') +x(/(?>|)/, '', 0, 8) +x(/?|/, '', 0, 2) +x(/?|/, '', 0, 0) +x(/?|/, '', 0, 0) +x(/*|/, '', 0, 4) +x(/*|*/, '', 0, 0) +x(/*|*/, '', 0, 2) +x(/[a]*|*/, 'a', 0, 3) +x(/+|*/, '', 0, 0) +x(/+|*/, '', 0, 6) +x(/+|*/, '', 0, 2) +x(/+|*/, 'a', 0, 0) +n(/+|+/, '') +x(/(|)?/, '', 0, 2) +x(/(|)*/, '', 0, 4) +x(/(|)+/, '', 0, 6) +x(/(|)+/, '', 0, 8) +x(/(|)+/, '', 4, 12) +x(/(|)+/, '', 2, 10) +x(/(|)+/, '򤦤', 0, 4) +x(/(|)+/, '$$zzzz򤦤', 6, 10) +x(/(|)+/, '', 0, 10) +x(/(|)+/, '', 2, 4) +x(/(|)+/, '', 2, 8) +x(/(?:|)(?:|)/, '', 0, 4) +x(/(?:*|*)(?:*|*)/, '', 0, 6) +x(/(?:*|*)(?:+|+)/, '', 0, 12) +x(/(?:+|+){2}/, '', 0, 12) +x(/(?:+|+){1,2}/, '', 0, 12) +x(/(?:+|\A*)/, '', 0, 4) +n(/(?:+|\A*)/, '') +x(/(?:^+|+)*/, '', 12, 16) +x(/(?:^+|+)*/, '', 0, 14) +x(/{0,}/, '', 0, 8) +x(/|(?i)c/, 'C', 0, 1) +x(/(?i)c|/, 'C', 0, 1) +x(/(?i:)|a/, 'a', 0, 1) +n(/(?i:)|a/, 'A') +x(/[]?/, '', 0, 2) +x(/[]*/, '', 0, 6) +x(/[^]*/, '', 0, 0) +n(/[^]+/, '') +x(/??/, '', 0, 0) +x(/??/, '', 0, 6) +x(/*?/, '', 0, 0) +x(/*?/, '', 0, 2) +x(/*?/, '', 0, 8) +x(/+?/, '', 0, 2) +x(/+?/, '', 0, 4) +x(/+?/, '', 0, 8) +x(/(?:ŷ?)??/, 'ŷ', 0, 0) +x(/(?:ŷ??)?/, 'ŷ', 0, 0) +x(/(?:̴?)+?/, '̴̴̴', 0, 2) +x(/(?:+)??/, '', 0, 0) +x(/(?:+)??/, '', 0, 8) +i(/(?:)?{2}/, '', 0, 0) # GNU regex bug +x(/(?:)?{2}/, 'ֵֵ', 0, 8) +x(/(?:)*{0}/, 'ֵֵ', 0, 0) +x(/(?:){3,}/, 'ֵֵֵ', 0, 16) +n(/(?:){3,}/, 'ֵ') +x(/(?:){2,4}/, 'ֵֵ', 0, 12) +x(/(?:){2,4}/, 'ֵֵֵֵ', 0, 16) +x(/(?:){2,4}?/, 'ֵֵֵֵ', 0, 8) +x(/(?:){,}/, '{,}', 0, 7) +x(/(?:)+?{2}/, '', 0, 12) +x(/()/, '', 0, 2, 1) +x(/(п)/, 'п', 0, 4, 1) +x(/(())/, '', 0, 4) +x(/(())/, '', 0, 4, 1) +x(/(())/, '', 0, 4, 2) +x(/((((((((((((((((((((̻))))))))))))))))))))/, '̻', 0, 4, 20) +x(/()()/, '', 0, 4, 1) +x(/()()/, '', 4, 8, 2) +x(/()()()/, '', 6, 12, 3) +x(/(()()())/, '', 6, 12, 4) +x(/.*(ե)󡦥(()奿)/, 'ե󡦥ޥ󥷥奿', 10, 18, 2) +x(/(^)/, '', 0, 2) +x(/()|()/, '', 2, 4, 1) +x(/(^)|()/, '', 2, 4, 2) +x(/(?)/, '', 0, 2, 1) +x(/(*)/, 'ޤޤ', 0, 6, 1) +x(/(*)/, '', 0, 0, 1) +x(/(+)/, '', 0, 14, 1) +x(/(+|*)/, 'դդդؤ', 0, 6, 1) +x(/(+|?)/, '', 0, 2, 1) +x(/()?/, '', 0, 6, 1) +x(/()*/, '', 0, 6, 1) +x(/()+/, '', 0, 6, 1) +x(/(|)+/, '', 0, 6, 1) +x(/([ʤˤ][]|)+/, '', 0, 6, 1) +x(/((?i:))/, '', 0, 6, 1) +x(/((?m:.))/, "\n", 0, 5, 1) +x(/((?=))/, '', 0, 2, 1) +x(/|(.)/, '󤢤', 0, 8, 1) +x(/*(.)/, '', 8, 10, 1) +x(/*?(.)/, '', 0, 2, 1) +x(/*?()/, '', 8, 10, 1) +x(/[]*(.)/, '', 10, 12, 1) +x(/(\A)/, '', 0, 4, 1) +n(/(\A)/, '󤤤') +x(/(^)/, '', 0, 4, 1) +n(/(^)/, '󤤤') +x(/($)/, '', 4, 8, 1) +n(/($)/, '') +x(/(̵)\1/, '̵̵', 0, 4) +n(/(̵)\1/, '̵') +x(/(?)\1/, '', 0, 4) +x(/(??)\1/, '', 0, 0) +x(/(*)\1/, '', 0, 8) +x(/(*)\1/, '', 0, 4, 1) +x(/(*)\1/, '', 0, 10) +x(/(*)\1/, '', 0, 2) +x(/(*)(*)\1\2/, '', 0, 20) +x(/(*)(*)\2/, '', 0, 14) +x(/(*)(*)\2/, '', 6, 10, 2) +x(/(((((((*)))))))\7/, 'ݤݤݤڤԤݤݤ', 0, 16) +x(/(((((((*)))))))\7/, 'ݤݤݤڤԤݤݤ', 0, 6, 7) +x(/()()()\2\1\3/, 'ϤҤդҤϤ', 0, 12) +x(/([-])\1/, '', 0, 4) +x(/(?u)(\w\d\s)\1/, '5 5 ', 0, 8) +n(/(?u)(\w\d\s)\1/, '5 5') +x(/(ï|[-]{3})\1/, 'ïï', 0, 8) +x(/...(ï|[-]{3})\1/, 'aïï', 0, 13) +x(/(ï|[-]{3})\1/, '', 0, 12) +x(/(^)\1/, '', 0, 4) +n(/(^)\1/, '') +n(/($)\1/, '') +n(/(\Z)\1/, '') +x(/(*\Z)\1/, '', 2, 2) +x(/.(*\Z)\1/, '', 2, 4) +x(/(.(䤤)\2)/, 'z䤤䤤', 0, 13, 1) +x(/(.(..\d.)\2)/, '12341234', 0, 10, 1) +x(/((?i:v))\1/, 'vv', 0, 10) +x(/(?<>|\(\g<>\))/, '(((((())))))', 0, 14) +x(/\A(?:\g<_1>|\g<_2>|\zλ (?<_1>|\g<_2>)(?<_2>|\g<_1>))$/, '߼', 0, 26) +x(/[[Ҥ]]/, '', 0, 2) +x(/[[]]/, '', 0, 2) +n(/[[^]]/, '') +n(/[^[]]/, '') +x(/[^[^]]/, '', 0, 2) +x(/[[]&&]/, '', 0, 2) +n(/[[]&&]/, '') +n(/[[]&&]/, '') +x(/[-&&-&&-]/, '', 0, 2) +n(/[^-&&-&&-]/, '') +x(/[[^&&]&&-]/, '', 0, 2) +n(/[[^&&]&&-]/, '') +x(/[[^-&&]&&[^-]]/, '', 0, 2) +n(/[[^-&&]&&[^-]]/, '') +x(/[^[^]&&[^]]/, '', 0, 2) +x(/[^[^]&&[^]]/, '', 0, 2) +n(/[^[^]&&[^]]/, '') +x(/[-&&-]/, '-', 0, 1) +x(/[^[^a-z]&&[^bcdefg]q-w]/, '', 0, 2) +x(/[^[^a-z]&&[^bcdefg]g-w]/, 'f', 0, 1) +x(/[^[^a-z]&&[^bcdefg]g-w]/, 'g', 0, 1) +n(/[^[^a-z]&&[^bcdefg]g-w]/, '2') +x(/a<b>СΥ<\/b>/, 'a<b>СΥ</b>', 0, 32) +x(/.<b>СΥ<\/b>/, 'a<b>СΥ</b>', 0, 32) + +r(//, '', 0) +r(//, '', 0, 2) +r(//, '', 2) +r(//, '', 2, 4) +r(/./, '', 0) +r(/.*/, ' ', 17) +r(/.*/, ' ', 6) +r(/*/, '', 12) +r(/+/, '', 4) +r(/?/, '', 6) +r(/??/, '', 6) +r(/ace/, 'aceavcd', 0) +r(/(?u)\w\d\s/, ' 2 $3 ', 2) +r(/[-][-]/, '3ʤ', 1) +r(/|/, '', 0) +r(/||/, '', 0) +r(/(ȤȤ)\1/, 'ȤȤȤȤȤȤ', 6) +r(/|/, '', 2) +r(/^/, '', 0) +r(/$/, '', 4) +r(/(((.)))\3/, 'zz', 0) +r(/(*?)\1/, '󤢤󤢤', 2) +r(/{3,4}/, 'ƤƤ󤢤󤢤', 12) +r(/\000/, "\000", 2) +r(/Ȥ\xfe\xfe/, "ȤȤ\xfe\xfe", 2) +r(/.../, 'zzzzz', 2) +end + +test_sb('ASCII') +test_sb('EUC') +test_sb('SJIS') +test_sb('UTF-8') +test_euc('EUC') + + +# UTF-8 (by UENO Katsuhiro) +$KCODE = 'UTF-8' + +x(/\w/u, "\xc3\x81", 0, 2) +n(/\W/u, "\xc3\x81") +x(/[\w]/u, "\xc3\x81", 0, 2) +x(/./u, "\xfe", 0, 1) +x(/\xfe/u, "\xfe", 0, 1) +x(/\S*/u, "\xfe", 0, 1) +x(/\s*/u, "\xfe", 0, 0) +n(/\w+/u, "\xfe") +x(/\W+/u, "\xfe\xff", 0, 2) +x(/[\xfe]/u, "aaa\xfe", 3, 4) +x(/[\xff\xfe]/u, "\xff\xfe", 0, 1) +x(/[a-c\xff\xfe]+/u, "\xffabc\xfe", 0, 5) + +s = "\xe3\x81\x82\xe3\x81\x81\xf0\x90\x80\x85\xe3\x81\x8a\xe3\x81\x85" +x(/[\xc2\x80-\xed\x9f\xbf]+/u, s, 0, 6) + +s = "\xf0\x90\x80\x85\xe3\x81\x82" +x(/[\xc2\x80-\xed\x9f\xbf]/u, s, 4, 7) + +s = "\xed\x9f\xbf" +n(/[\xc2\x80-\xed\x9f\xbe]/u, s) + +s = "\xed\x9f\xbf" +n(/[\xc2\x80-\xed\x9f\xbe]/u, s) + +s = "\xed\x9f\xbf" +n(/[\xc2\x80-\xed\x9f\xbe]/u, s) + +s = "\xed\x9f\xbf" +n(/[\xc3\xad\xed\x9f\xbe]/u, s) + +s = "\xed\x9f\xbf" +n(/[\xc4\x80-\xed\x9f\xbe]/u, s) + +s = "\xed\x9f\xbf\xf0\x90\x80\x85\xed\x9f\xbf" +x(/[^\xc2\x80-\xed\x9f\xbe]/u, s, 0, 3) + +s = "\xed\x9f\xbf" +x(/[^\xc3\xad\xed\x9f\xbe]/u, s, 0, 3) + +s = "\xed\x9f\xbf\xf0\x90\x80\x85\xed\x9f\xbf" +x(/[^\xc4\x80-\xed\x9f\xbe]/u, s, 0, 3) + +s = "\xc3\xbe\xc3\xbf" +n(/[\xfe\xff\xc3\x80]/u, s) + +s = "\xc3\xbe" +x(/[\xc2\xa0-\xc3\xbe]/u, s, 0, 2) + +s = "sssss" +x(/s+/iu, s, 0, 5) + +s = "SSSSS" +x(/s+/iu, s, 0, 5) + +reg = Regexp.new("\\x{fb40}", nil, 'u') +x(reg, "\357\255\200", 0, 3) +x(/\A\w\z/u, "\357\255\200", 0, 3) +x(/\A\W\z/u, "\357\255\202", 0, 3) +n(/\A\w\z/u, "\357\255\202") + +x(/\303\200/iu, "\303\240", 0, 2) +x(/\303\247/iu, "\303\207", 0, 2) + + + +# Japanese long text. +$KCODE = 'EUC' + +s = <<EOS +ܤˤƤϡ췳ˤĤƤĴ˴ŤȽĬ +ȤлȬǯʼƤǯϪνäǯǤ뤳ȤäƷڹ +췳ε켰֤ĥɾޤȤäƤ롣 +ͭ̾ԤȤƤϡΡϺ󤲤뤳ȤǤ + +ʼƬȬ ͭơ ë饦 (1998) +EOS + +x(/\((.+)\)/, s, 305, 309, 1) +x(/Ϻ/, s, 229, 239) +x(/$/, s, 202, 204) +x(/(^ʼƬ..Ȭ)/, s, 269, 279, 1) +x(/^$/, s, 268, 268) + + +s = <<EOS +ʤ޻ϰʸǤ +⤷ȤФ򤷤뤹ΤʸǤȤȡϤȤФ򤷤뤹ΤǤϤʤ +ܤbookϤȤФǤ뤬ۥhonϲʤ٤ǡʬñ +ĤΤǤϤʤ +ñȤƤη֤⤿ʤǤ롣 +ַˤפ򥢥ϴФŪʰ̣Ѥ +ΤʤΤϸǤϤꤨʤΤǤ롣 + + ִɴá +EOS + +n(/\((.+)\)/, s) +x(/(.*)/, s, 254, 264, 1) +x(/$/, s, 34, 36) +x(/(book)/, s, 120, 124, 1) +x(/^$/, s, 360, 360) + + +s = <<EOS +बûˤäƤȤСΤӤ̩Ѥ̤ȡ +μι⤵ˤɤˤʤ +γмԤŪʶäĤΤϡưΩäȤ +ݡ ϡɥͤξǯǤϤʤ + +Ϻ ֱûѤŸưˤդĤġ ҥ(1986) +EOS + +x(/\((.+)\)/, s, 290, 296) +x(/(.*)(.+)/, s, 257, 275, 2) +x(/^ݡ /, s, 179, 184) +x(/()/, s, 0, 4, 1) +x(/\w/, s, 30, 34) + + +s = <<EOS +Ȥäơϡⷯ⡢䷯⡢Ƥ⤦ͤοʪ⡢̤ˤʤȤ򡢤輷ǡ¤ʪäƤ롣 +黰ͤξϰԤФƤʤΤ +񤯤ҤޤʤäΤǤ +ֶáפʤȬФĤŤƤ椯ǤȤˤĤƤϡϤ֤ߤʤۤɤγοäƤ롣λˤϡ̳ǽϤʪΤ褦ʿʪͤ⤤롣 +פȡȤɤ©νФ褦ʤ⤤ΤǤ롣 + +Ϻ ֤ʻƤޤ 輷 (1961) +EOS + +x(/\((\d+)\)/, s, 496, 502) +x(/(.+.*)/, s, 449, 479, 1) +x(/(.)/, s, 96, 98, 1) +x(/$/, s, 120, 122) +x(//, s, 209, 217) + + +s = <<EOS +󽽸ܤ̤ۤβйΩƤ˿Ť꤬äΤϡĤäƤͽϲ䲰ΤòʼҤͤä +ϲȤäƤ⡢;󲰤ǼѱȡͻήΤȤƱʪǤϤʤä +⤽⤬ʪȤƹͤ줿ϡ͢ޤ˶ʬϤܸꤷΤǤäˤʤʤǡ;ǼΤϡƤưϤˤѤ߾夲ʬȴƿ˻Ωƾ夲Τä + +° ֻĻ (2000) +EOS + +x(/\((\d+)\)/, s, 506, 512) +x(/(.*)/, s, 493, 505, 1) +x(//, s, 292, 298) + + +s = <<EOS +ܿͤФѤä٤΢ˤϡĤϡ +ӤबƯƤ +ϡ郎ּʼ˸뤫ɤפǤä + +ʼƬȬ ͭơ ë饦 (1998) +EOS + +x(/\((\d+)\)/, s, 185, 191) +x(/(.*)/, s, 108, 138, 1) +x(/^/, s, 90, 96) +x(/^.*$/, s, 0, 58) + +s = <<EOS + ɣϿͤ⿩Ϥλˤ⤷ޤϤˤɣ쾣Ʀ򤿤ƤޤΤ˰Ϥ٤ʹ֤ϾΤΤ򤿤٤Ǥޤ + ʹ֤ϥإӤ򤿤٤ڤǤơǤϤˤꡢڤ򤳤ޤڤꡢڤɣƤޤƤƤ٤äΤƤɣȾ餤ǤäǯˤʤȡɣĤΤؤäơɣƤλʬΰ줯餤ˤʤäإӤˤϱ򾯤줿Ǥ + +ܾ ˺줿ܿ͡ (1960) +EOS + +x(/(ɣƤλʬΰ줯餤)/, s, 357, 381, 1) +x(/ޤ$/, s, 140, 150) +x(/ ʹ(.*)/, s, 157, 423, 1) +x(/إ[Ϥ]/, s, 165, 175) + +s = <<EOS +ȤϤȤ ¢դ˵̤Ȥ α֤ޤº + +ľ αϿ (1859) +EOS + +x(/\((.+)\)/, s, 68, 74) +x(/(.*)/, s, 59, 65, 1) +x(/^(ľ)/, s, 48, 56, 1) + +s = <<EOS +դޤǤʤǽ˴ڤԢ첻ɽͤˤƤ⡢ +Ť˲ȤƤΤªؤƤ𤿤ΤǤꡢĤʸŤ +ɽ벻ʸȤ򤵤Ƥ𤿤櫓Ǥϰɤ +Ȥ̣뤫ȤդȡʸˤĤɽ줿ޤۣ桢 +԰ΤΤǤꤨʤȤդȤ̣ޤˤƤ⡢ +Ԣ첻ʸʡڤԤδطϾΤ餺Ȥ +ʸϻ䤿԰ʲɽΤ˺ǤդϤ԰ʸ +ǤꡢŪʤŤҤϤԢ첻˺ǤŬ礷ɽˡ +ȸؤޤĤޤꡢŪʤŤҤɽŪǤʤȤʿ +餹ޤؤˡ͡ϤޤŤʸɽṲ̆Ȥʿդ٤ +ꡢĤơԢ첻ΤΤɽݤƤ뤳Ȥܤ +٤Ǥޤ + +ʡ¸ ֻԢ춵 +EOS + +x(/Ԣ춵/, s, 800, 808) +x(/𤿤櫓Ǥ/, s, 176, 188) + +s = <<EOS +ȥ󥹥ܳˤĤơˤ줿 +Ǥ롣ˡƻˡͿ줿Ϥ¤ꡢ +ᤫ龡ԲǽäƤ롣 +뤤ϥ˥饤Ф븷ޤĤäΤ +ʤ +ʹߡܳˤĤƤɾϡ +ּˤȯ®١סֲסŰƻѡפʤɤˡ԰򵢤 +褦ˤʤä + +̵ϯ ֺ֡ξαפǤʬʤܳ ڽ˼ (2005) +EOS + +x(/\A(.*)ܳˤĤ/, s, 0, 22, 1) +x(/(.*?)[^]*(.+?)[^]*(?:.*?)/, s, 290, 332) +x(/{1,2}(?=)/, s, 28, 32) + +# result +printf("\n*** SUCCESS: %d, FAIL: %d Ruby %s (%s) [%s] ***\n", + $rok, $rfail, RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PLATFORM) + +# END. diff --git a/lib/edbee-lib/vendor/onig/testc.c b/lib/edbee-lib/vendor/onig/testc.c new file mode 100644 index 00000000..170340d0 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/testc.c @@ -0,0 +1,905 @@ +/* + * This program was generated by testconv.rb. + */ +#include "config.h" +#ifdef ONIG_ESCAPE_UCHAR_COLLISION +# undef ONIG_ESCAPE_UCHAR_COLLISION +#endif +#include <stdio.h> + +#ifdef POSIX_TEST +# include "onigmoposix.h" +#else +# include "onigmo.h" +#endif + +#include <string.h> + +#define SLEN(s) strlen(s) + +static int nsucc = 0; +static int nfail = 0; +static int nerror = 0; + +static FILE *err_file; + +#ifndef POSIX_TEST +static OnigRegion *region; +#endif + +static void xx(char *pattern, char *str, int from, int to, int mem, int not) +{ + int r; + +#ifdef POSIX_TEST + regex_t reg; + char buf[200]; + regmatch_t pmatch[25]; + + r = regcomp(®, pattern, REG_EXTENDED | REG_NEWLINE); + if (r) + { + regerror(r, ®, buf, sizeof(buf)); + fprintf(err_file, "ERROR: %s\n", buf); + nerror++; + return; + } + + r = regexec(®, str, reg.re_nsub + 1, pmatch, 0); + if (r != 0 && r != REG_NOMATCH) + { + regerror(r, ®, buf, sizeof(buf)); + fprintf(err_file, "ERROR: %s\n", buf); + nerror++; + return; + } + + if (r == REG_NOMATCH) + { + if (not) + { + fprintf(stdout, "OK(N): /%s/ '%s'\n", pattern, str); + nsucc++; + } + else + { + fprintf(stdout, "FAIL: /%s/ '%s'\n", pattern, str); + nfail++; + } + } + else + { + if (not) + { + fprintf(stdout, "FAIL(N): /%s/ '%s'\n", pattern, str); + nfail++; + } + else + { + if (pmatch[mem].rm_so == from && pmatch[mem].rm_eo == to) + { + fprintf(stdout, "OK: /%s/ '%s'\n", pattern, str); + nsucc++; + } + else + { + fprintf(stdout, "FAIL: /%s/ '%s' %d-%d : %d-%d\n", pattern, str, + (int)from, (int)to, (int)pmatch[mem].rm_so, + (int)pmatch[mem].rm_eo); + nfail++; + } + } + } + regfree(®); + +#else + regex_t *reg; + OnigErrorInfo einfo; + OnigSyntaxType syn = *ONIG_SYNTAX_DEFAULT; + + /* ONIG_OPTION_OFF(syn.options, ONIG_OPTION_ASCII_RANGE); */ + + r = onig_new(®, (UChar *)pattern, (UChar *)(pattern + SLEN(pattern)), + ONIG_OPTION_DEFAULT, ONIG_ENCODING_EUC_JP, &syn, &einfo); + if (r) + { + char s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str((UChar *)s, r, &einfo); + fprintf(err_file, "ERROR: %s\n", s); + nerror++; + return; + } + + r = onig_search(reg, (UChar *)str, (UChar *)(str + SLEN(str)), (UChar *)str, + (UChar *)(str + SLEN(str)), region, ONIG_OPTION_NONE); + if (r < ONIG_MISMATCH) + { + char s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str((UChar *)s, r); + fprintf(err_file, "ERROR: %s\n", s); + nerror++; + return; + } + + if (r == ONIG_MISMATCH) + { + if (not) + { + fprintf(stdout, "OK(N): /%s/ '%s'\n", pattern, str); + nsucc++; + } + else + { + fprintf(stdout, "FAIL: /%s/ '%s'\n", pattern, str); + nfail++; + } + } + else + { + if (not) + { + fprintf(stdout, "FAIL(N): /%s/ '%s'\n", pattern, str); + nfail++; + } + else + { + if (region->beg[mem] == from && region->end[mem] == to) + { + fprintf(stdout, "OK: /%s/ '%s'\n", pattern, str); + nsucc++; + } + else + { + fprintf(stdout, "FAIL: /%s/ '%s' %d-%d : %d-%d\n", pattern, str, + (int)from, (int)to, (int)region->beg[mem], + (int)region->end[mem]); + nfail++; + } + } + } + onig_free(reg); +#endif +} + +static void x2(char *pattern, char *str, int from, int to) +{ + xx(pattern, str, from, to, 0, 0); +} + +static void x3(char *pattern, char *str, int from, int to, int mem) +{ + xx(pattern, str, from, to, mem, 0); +} + +static void n(char *pattern, char *str) +{ + xx(pattern, str, 0, 0, 0, 1); +} + +extern int main(int argc, char *argv[]) +{ + err_file = stdout; + +#ifdef POSIX_TEST + reg_set_encoding(REG_POSIX_ENCODING_EUC_JP); +#else + region = onig_region_new(); +#endif + + x2("", "", 0, 0); + x2("^", "", 0, 0); + x2("$", "", 0, 0); + x2("\\G", "", 0, 0); + x2("\\A", "", 0, 0); + x2("\\Z", "", 0, 0); + x2("\\z", "", 0, 0); + x2("^$", "", 0, 0); + x2("\\ca", "\001", 0, 1); + x2("\\C-b", "\002", 0, 1); + x2("\\c\\\\", "\034", 0, 1); + x2("q[\\c\\\\]", "q\034", 0, 2); + x2("", "a", 0, 0); + x2("a", "a", 0, 1); + x2("\\x61", "a", 0, 1); + x2("aa", "aa", 0, 2); + x2("aaa", "aaa", 0, 3); + x2("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 0, 35); + x2("ab", "ab", 0, 2); + x2("b", "ab", 1, 2); + x2("bc", "abc", 1, 3); + x2("(?i:#RET#)", "#INS##RET#", 5, 10); + x2("\\17", "\017", 0, 1); + x2("\\x1f", "\x1f", 0, 1); + x2("a(?#....\\\\JJJJ)b", "ab", 0, 2); + x2("(?x) G (o O(?-x)oO) g L", "GoOoOgLe", 0, 7); + x2(".", "a", 0, 1); + n(".", ""); + x2("..", "ab", 0, 2); + x2("\\w", "e", 0, 1); + n("\\W", "e"); + x2("\\s", " ", 0, 1); + x2("\\S", "b", 0, 1); + x2("\\d", "4", 0, 1); + n("\\D", "4"); + x2("\\b", "z ", 0, 0); + x2("\\b", " z", 1, 1); + x2("\\B", "zz ", 1, 1); + x2("\\B", "z ", 2, 2); + x2("\\B", " z", 0, 0); + x2("[ab]", "b", 0, 1); + n("[ab]", "c"); + x2("[a-z]", "t", 0, 1); + n("[^a]", "a"); + x2("[^a]", "\n", 0, 1); + x2("[]]", "]", 0, 1); + n("[^]]", "]"); + x2("[\\^]+", "0^^1", 1, 3); + x2("[b-]", "b", 0, 1); + x2("[b-]", "-", 0, 1); + x2("[\\w]", "z", 0, 1); + n("[\\w]", " "); + x2("[\\W]", "b$", 1, 2); + x2("[\\d]", "5", 0, 1); + n("[\\d]", "e"); + x2("[\\D]", "t", 0, 1); + n("[\\D]", "3"); + x2("[\\s]", " ", 0, 1); + n("[\\s]", "a"); + x2("[\\S]", "b", 0, 1); + n("[\\S]", " "); + x2("[\\w\\d]", "2", 0, 1); + n("[\\w\\d]", " "); + x2("[[:upper:]]", "B", 0, 1); + x2("[*[:xdigit:]+]", "+", 0, 1); + x2("[*[:xdigit:]+]", "GHIKK-9+*", 6, 7); + x2("[*[:xdigit:]+]", "-@^+", 3, 4); + n("[[:upper]]", "A"); + x2("[[:upper]]", ":", 0, 1); + x2("[\\044-\\047]", "\046", 0, 1); + x2("[\\x5a-\\x5c]", "\x5b", 0, 1); + x2("[\\x6A-\\x6D]", "\x6c", 0, 1); + n("[\\x6A-\\x6D]", "\x6E"); + n("^[0-9A-F]+ 0+ UNDEF ", + "75F 00000000 SECT14A notype () External | _rb_apply"); + x2("[\\[]", "[", 0, 1); + x2("[\\]]", "]", 0, 1); + x2("[&]", "&", 0, 1); + x2("[[ab]]", "b", 0, 1); + x2("[[ab]c]", "c", 0, 1); + n("[[^a]]", "a"); + n("[^[a]]", "a"); + x2("[[ab]&&bc]", "b", 0, 1); + n("[[ab]&&bc]", "a"); + n("[[ab]&&bc]", "c"); + x2("[a-z&&b-y&&c-x]", "w", 0, 1); + n("[^a-z&&b-y&&c-x]", "w"); + x2("[[^a&&a]&&a-z]", "b", 0, 1); + n("[[^a&&a]&&a-z]", "a"); + x2("[[^a-z&&bcdef]&&[^c-g]]", "h", 0, 1); + n("[[^a-z&&bcdef]&&[^c-g]]", "c"); + x2("[^[^abc]&&[^cde]]", "c", 0, 1); + x2("[^[^abc]&&[^cde]]", "e", 0, 1); + n("[^[^abc]&&[^cde]]", "f"); + x2("[a-&&-a]", "-", 0, 1); + n("[a\\-&&\\-a]", "&"); + n("\\wabc", " abc"); + x2("a\\Wbc", "a bc", 0, 4); + x2("a.b.c", "aabbc", 0, 5); + x2(".\\wb\\W..c", "abb bcc", 0, 7); + x2("\\s\\wzzz", " zzzz", 0, 5); + x2("aa.b", "aabb", 0, 4); + n(".a", "ab"); + x2(".a", "aa", 0, 2); + x2("^a", "a", 0, 1); + x2("^a$", "a", 0, 1); + x2("^\\w$", "a", 0, 1); + n("^\\w$", " "); + x2("^\\wab$", "zab", 0, 3); + x2("^\\wabcdef$", "zabcdef", 0, 7); + x2("^\\w...def$", "zabcdef", 0, 7); + x2("\\w\\w\\s\\Waaa\\d", "aa aaa4", 0, 8); + x2("\\A\\Z", "", 0, 0); + x2("\\Axyz", "xyz", 0, 3); + x2("xyz\\Z", "xyz", 0, 3); + x2("xyz\\z", "xyz", 0, 3); + x2("a\\Z", "a", 0, 1); + x2("\\Gaz", "az", 0, 2); + n("\\Gz", "bza"); + n("az\\G", "az"); + n("az\\A", "az"); + n("a\\Az", "az"); + x2("\\^\\$", "^$", 0, 2); + x2("^x?y", "xy", 0, 2); + x2("^(x?y)", "xy", 0, 2); + x2("\\w", "_", 0, 1); + n("\\W", "_"); + x2("(?=z)z", "z", 0, 1); + n("(?=z).", "a"); + x2("(?!z)a", "a", 0, 1); + n("(?!z)a", "z"); + x2("(?i:a)", "a", 0, 1); + x2("(?i:a)", "A", 0, 1); + x2("(?i:A)", "a", 0, 1); + n("(?i:A)", "b"); + x2("(?i:[A-Z])", "a", 0, 1); + x2("(?i:[f-m])", "H", 0, 1); + x2("(?i:[f-m])", "h", 0, 1); + n("(?i:[f-m])", "e"); + x2("(?i:[A-c])", "D", 0, 1); + n("(?i:[^a-z])", "A"); + n("(?i:[^a-z])", "a"); + x2("(?i:[!-k])", "Z", 0, 1); + x2("(?i:[!-k])", "7", 0, 1); + x2("(?i:[T-}])", "b", 0, 1); + x2("(?i:[T-}])", "{", 0, 1); + x2("(?i:\\?a)", "?A", 0, 2); + x2("(?i:\\*A)", "*a", 0, 2); + n(".", "\n"); + x2("(?m:.)", "\n", 0, 1); + x2("(?m:a.)", "a\n", 0, 2); + x2("(?m:.b)", "a\nb", 1, 3); + x2(".*abc", "dddabdd\nddabc", 8, 13); + x2("(?m:.*abc)", "dddabddabc", 0, 10); + n("(?i)(?-i)a", "A"); + n("(?i)(?-i:a)", "A"); + x2("a?", "", 0, 0); + x2("a?", "b", 0, 0); + x2("a?", "a", 0, 1); + x2("a*", "", 0, 0); + x2("a*", "a", 0, 1); + x2("a*", "aaa", 0, 3); + x2("a*", "baaaa", 0, 0); + n("a+", ""); + x2("a+", "a", 0, 1); + x2("a+", "aaaa", 0, 4); + x2("a+", "aabbb", 0, 2); + x2("a+", "baaaa", 1, 5); + x2(".?", "", 0, 0); + x2(".?", "f", 0, 1); + x2(".?", "\n", 0, 0); + x2(".*", "", 0, 0); + x2(".*", "abcde", 0, 5); + x2(".+", "z", 0, 1); + x2(".+", "zdswer\n", 0, 6); + x2("(.*)a\\1f", "babfbac", 0, 4); + x2("(.*)a\\1f", "bacbabf", 3, 7); + x2("((.*)a\\2f)", "bacbabf", 3, 7); + x2("(.*)a\\1f", "baczzzzzz\nbazz\nzzzzbabf", 19, 23); + x2("a|b", "a", 0, 1); + x2("a|b", "b", 0, 1); + x2("|a", "a", 0, 0); + x2("(|a)", "a", 0, 0); + x2("ab|bc", "ab", 0, 2); + x2("ab|bc", "bc", 0, 2); + x2("z(?:ab|bc)", "zbc", 0, 3); + x2("a(?:ab|bc)c", "aabc", 0, 4); + x2("ab|(?:ac|az)", "az", 0, 2); + x2("a|b|c", "dc", 1, 2); + x2("a|b|cd|efg|h|ijk|lmn|o|pq|rstuvwx|yz", "pqr", 0, 2); + n("a|b|cd|efg|h|ijk|lmn|o|pq|rstuvwx|yz", "mn"); + x2("a|^z", "ba", 1, 2); + x2("a|^z", "za", 0, 1); + x2("a|\\Gz", "bza", 2, 3); + x2("a|\\Gz", "za", 0, 1); + x2("a|\\Az", "bza", 2, 3); + x2("a|\\Az", "za", 0, 1); + x2("a|b\\Z", "ba", 1, 2); + x2("a|b\\Z", "b", 0, 1); + x2("a|b\\z", "ba", 1, 2); + x2("a|b\\z", "b", 0, 1); + x2("\\w|\\s", " ", 0, 1); + n("\\w|\\w", " "); + x2("\\w|%", "%", 0, 1); + x2("\\w|[&$]", "&", 0, 1); + x2("[b-d]|[^e-z]", "a", 0, 1); + x2("(?:a|[c-f])|bz", "dz", 0, 1); + x2("(?:a|[c-f])|bz", "bz", 0, 2); + x2("abc|(?=zz)..f", "zzf", 0, 3); + x2("abc|(?!zz)..f", "abf", 0, 3); + x2("(?=za)..a|(?=zz)..a", "zza", 0, 3); + n("(?>a|abd)c", "abdc"); + x2("(?>abd|a)c", "abdc", 0, 4); + x2("a?|b", "a", 0, 1); + x2("a?|b", "b", 0, 0); + x2("a?|b", "", 0, 0); + x2("a*|b", "aa", 0, 2); + x2("a*|b*", "ba", 0, 0); + x2("a*|b*", "ab", 0, 1); + x2("a+|b*", "", 0, 0); + x2("a+|b*", "bbb", 0, 3); + x2("a+|b*", "abbb", 0, 1); + n("a+|b+", ""); + x2("(a|b)?", "b", 0, 1); + x2("(a|b)*", "ba", 0, 2); + x2("(a|b)+", "bab", 0, 3); + x2("(ab|ca)+", "caabbc", 0, 4); + x2("(ab|ca)+", "aabca", 1, 5); + x2("(ab|ca)+", "abzca", 0, 2); + x2("(a|bab)+", "ababa", 0, 5); + x2("(a|bab)+", "ba", 1, 2); + x2("(a|bab)+", "baaaba", 1, 4); + x2("(?:a|b)(?:a|b)", "ab", 0, 2); + x2("(?:a*|b*)(?:a*|b*)", "aaabbb", 0, 3); + x2("(?:a*|b*)(?:a+|b+)", "aaabbb", 0, 6); + x2("(?:a+|b+){2}", "aaabbb", 0, 6); + x2("h{0,}", "hhhh", 0, 4); + x2("(?:a+|b+){1,2}", "aaabbb", 0, 6); + n("ax{2}*a", "0axxxa1"); + n("a.{0,2}a", "0aXXXa0"); + n("a.{0,2}?a", "0aXXXa0"); + n("a.{0,2}?a", "0aXXXXa0"); + x2("^a{2,}?a$", "aaa", 0, 3); + x2("^[a-z]{2,}?$", "aaa", 0, 3); + x2("(?:a+|\\Ab*)cc", "cc", 0, 2); + n("(?:a+|\\Ab*)cc", "abcc"); + x2("(?:^a+|b+)*c", "aabbbabc", 6, 8); + x2("(?:^a+|b+)*c", "aabbbbc", 0, 7); + x2("a|(?i)c", "C", 0, 1); + x2("(?i)c|a", "C", 0, 1); + x2("(?i)c|a", "A", 0, 1); + x2("(?i:c)|a", "C", 0, 1); + n("(?i:c)|a", "A"); + x2("[abc]?", "abc", 0, 1); + x2("[abc]*", "abc", 0, 3); + x2("[^abc]*", "abc", 0, 0); + n("[^abc]+", "abc"); + x2("a?\?", "aaa", 0, 0); + x2("ba?\?b", "bab", 0, 3); + x2("a*?", "aaa", 0, 0); + x2("ba*?", "baa", 0, 1); + x2("ba*?b", "baab", 0, 4); + x2("a+?", "aaa", 0, 1); + x2("ba+?", "baa", 0, 2); + x2("ba+?b", "baab", 0, 4); + x2("(?:a?)?\?", "a", 0, 0); + x2("(?:a?\?)?", "a", 0, 0); + x2("(?:a?)+?", "aaa", 0, 1); + x2("(?:a+)?\?", "aaa", 0, 0); + x2("(?:a+)?\?b", "aaab", 0, 4); + x2("(?:ab)?{2}", "", 0, 0); + x2("(?:ab)?{2}", "ababa", 0, 4); + x2("(?:ab)*{0}", "ababa", 0, 0); + x2("(?:ab){3,}", "abababab", 0, 8); + n("(?:ab){3,}", "abab"); + x2("(?:ab){2,4}", "ababab", 0, 6); + x2("(?:ab){2,4}", "ababababab", 0, 8); + x2("(?:ab){2,4}?", "ababababab", 0, 4); + x2("(?:ab){,}", "ab{,}", 0, 5); + x2("(?:abc)+?{2}", "abcabcabc", 0, 6); + x2("(?:X*)(?i:xa)", "XXXa", 0, 4); + x2("(d+)([^abc]z)", "dddz", 0, 4); + x2("([^abc]*)([^abc]z)", "dddz", 0, 4); + x2("(\\w+)(\\wz)", "dddz", 0, 4); + x3("(a)", "a", 0, 1, 1); + x3("(ab)", "ab", 0, 2, 1); + x2("((ab))", "ab", 0, 2); + x3("((ab))", "ab", 0, 2, 1); + x3("((ab))", "ab", 0, 2, 2); + x3("((((((((((((((((((((ab))))))))))))))))))))", "ab", 0, 2, 20); + x3("(ab)(cd)", "abcd", 0, 2, 1); + x3("(ab)(cd)", "abcd", 2, 4, 2); + x3("()(a)bc(def)ghijk", "abcdefghijk", 3, 6, 3); + x3("(()(a)bc(def)ghijk)", "abcdefghijk", 3, 6, 4); + x2("(^a)", "a", 0, 1); + x3("(a)|(a)", "ba", 1, 2, 1); + x3("(^a)|(a)", "ba", 1, 2, 2); + x3("(a?)", "aaa", 0, 1, 1); + x3("(a*)", "aaa", 0, 3, 1); + x3("(a*)", "", 0, 0, 1); + x3("(a+)", "aaaaaaa", 0, 7, 1); + x3("(a+|b*)", "bbbaa", 0, 3, 1); + x3("(a+|b?)", "bbbaa", 0, 1, 1); + x3("(abc)?", "abc", 0, 3, 1); + x3("(abc)*", "abc", 0, 3, 1); + x3("(abc)+", "abc", 0, 3, 1); + x3("(xyz|abc)+", "abc", 0, 3, 1); + x3("([xyz][abc]|abc)+", "abc", 0, 3, 1); + x3("((?i:abc))", "AbC", 0, 3, 1); + x2("(abc)(?i:\\1)", "abcABC", 0, 6); + x3("((?m:a.c))", "a\nc", 0, 3, 1); + x3("((?=az)a)", "azb", 0, 1, 1); + x3("abc|(.abd)", "zabd", 0, 4, 1); + x2("(?:abc)|(ABC)", "abc", 0, 3); + x3("(?i:(abc))|(zzz)", "ABC", 0, 3, 1); + x3("a*(.)", "aaaaz", 4, 5, 1); + x3("a*?(.)", "aaaaz", 0, 1, 1); + x3("a*?(c)", "aaaac", 4, 5, 1); + x3("[bcd]a*(.)", "caaaaz", 5, 6, 1); + x3("(\\Abb)cc", "bbcc", 0, 2, 1); + n("(\\Abb)cc", "zbbcc"); + x3("(^bb)cc", "bbcc", 0, 2, 1); + n("(^bb)cc", "zbbcc"); + x3("cc(bb$)", "ccbb", 2, 4, 1); + n("cc(bb$)", "ccbbb"); + n("(\\1)", ""); + n("\\1(a)", "aa"); + n("(a(b)\\1)\\2+", "ababb"); + n("(?:(?:\\1|z)(a))+$", "zaa"); + x2("(?:(?:\\1|z)(a))+$", "zaaa", 0, 4); + x2("(a)(?=\\1)", "aa", 0, 1); + n("(a)$|\\1", "az"); + x2("(a)\\1", "aa", 0, 2); + n("(a)\\1", "ab"); + x2("(a?)\\1", "aa", 0, 2); + x2("(a?\?)\\1", "aa", 0, 0); + x2("(a*)\\1", "aaaaa", 0, 4); + x3("(a*)\\1", "aaaaa", 0, 2, 1); + x2("a(b*)\\1", "abbbb", 0, 5); + x2("a(b*)\\1", "ab", 0, 1); + x2("(a*)(b*)\\1\\2", "aaabbaaabb", 0, 10); + x2("(a*)(b*)\\2", "aaabbbb", 0, 7); + x2("(((((((a*)b))))))c\\7", "aaabcaaa", 0, 8); + x3("(((((((a*)b))))))c\\7", "aaabcaaa", 0, 3, 7); + x2("(a)(b)(c)\\2\\1\\3", "abcbac", 0, 6); + x2("([a-d])\\1", "cc", 0, 2); + x2("(\\w\\d\\s)\\1", "f5 f5 ", 0, 6); + n("(\\w\\d\\s)\\1", "f5 f5"); + x2("(who|[a-c]{3})\\1", "whowho", 0, 6); + x2("...(who|[a-c]{3})\\1", "abcwhowho", 0, 9); + x2("(who|[a-c]{3})\\1", "cbccbc", 0, 6); + x2("(^a)\\1", "aa", 0, 2); + n("(^a)\\1", "baa"); + n("(a$)\\1", "aa"); + n("(ab\\Z)\\1", "ab"); + x2("(a*\\Z)\\1", "a", 1, 1); + x2(".(a*\\Z)\\1", "ba", 1, 2); + x3("(.(abc)\\2)", "zabcabc", 0, 7, 1); + x3("(.(..\\d.)\\2)", "z12341234", 0, 9, 1); + x2("((?i:az))\\1", "AzAz", 0, 4); + n("((?i:az))\\1", "Azaz"); + x2("(?<=a)b", "ab", 1, 2); + n("(?<=a)b", "bb"); + x2("(?<=a|b)b", "bb", 1, 2); + x2("(?<=a|bc)b", "bcb", 2, 3); + x2("(?<=a|bc)b", "ab", 1, 2); + x2("(?<=a|bc||defghij|klmnopq|r)z", "rz", 1, 2); + x2("(a)\\g<1>", "aa", 0, 2); + x2("(?<!a)b", "cb", 1, 2); + n("(?<!a)b", "ab"); + x2("(?<!a|bc)b", "bbb", 0, 1); + n("(?<!a|bc)z", "bcz"); + x2("(?<name1>a)", "a", 0, 1); + x2("(?<name_2>ab)\\g<name_2>", "abab", 0, 4); + x2("(?<name_3>.zv.)\\k<name_3>", "azvbazvb", 0, 8); + x2("(?<=\\g<ab>)|-\\zEND (?<ab>XyZ)", "XyZ", 3, 3); + x2("(?<n>|a\\g<n>)+", "", 0, 0); + x2("(?<n>|\\(\\g<n>\\))+$", "()(())", 0, 6); + x3("\\g<n>(?<n>.){0}", "X", 0, 1, 1); + x2("\\g<n>(abc|df(?<n>.YZ){2,8}){0}", "XYZ", 0, 3); + x2("\\A(?<n>(a\\g<n>)|)\\z", "aaaa", 0, 4); + x2("(?<n>|\\g<m>\\g<n>)\\z|\\zEND (?<m>a|(b)\\g<m>)", "bbbbabba", 0, 8); + x2("(?<name1240>\\w+\\sx)a+\\k<name1240>", " fg xaaaaaaaafg x", 2, 18); + x3("(z)()()(?<_9>a)\\g<_9>", "zaa", 2, 3, 1); + x2("(.)(((?<_>a)))\\k<_>", "zaa", 0, 3); + x2("((?<name1>\\d)|(?<name2>\\w))(\\k<name1>|\\k<name2>)", "ff", 0, 2); + x2("(?:(?<x>)|(?<x>efg))\\k<x>", "", 0, 0); + x2("(?:(?<x>abc)|(?<x>efg))\\k<x>", "abcefgefg", 3, 9); + n("(?:(?<x>abc)|(?<x>efg))\\k<x>", "abcefg"); + x2("(?:(?<n1>.)|(?<n1>..)|(?<n1>...)|(?<n1>....)|(?<n1>.....)|(?<n1>......)|(" + "?<n1>.......)|(?<n1>........)|(?<n1>.........)|(?<n1>..........)|(?<n1>.." + ".........)|(?<n1>............)|(?<n1>.............)|(?<n1>..............)" + ")\\k<n1>$", + "a-pyumpyum", 2, 10); + x3("(?:(?<n1>.)|(?<n1>..)|(?<n1>...)|(?<n1>....)|(?<n1>.....)|(?<n1>......)|(" + "?<n1>.......)|(?<n1>........)|(?<n1>.........)|(?<n1>..........)|(?<n1>.." + ".........)|(?<n1>............)|(?<n1>.............)|(?<n1>..............)" + ")\\k<n1>$", + "xxxxabcdefghijklmnabcdefghijklmn", 4, 18, 14); + x3("(?<name1>)(?<name2>)(?<name3>)(?<name4>)(?<name5>)(?<name6>)(?<name7>)(?<" + "name8>)(?<name9>)(?<name10>)(?<name11>)(?<name12>)(?<name13>)(?<name14>)(" + "?<name15>)(?<name16>aaa)(?<name17>)$", + "aaa", 0, 3, 16); + x2("(?<foo>a|\\(\\g<foo>\\))", "a", 0, 1); + x2("(?<foo>a|\\(\\g<foo>\\))", "((((((a))))))", 0, 13); + x3("(?<foo>a|\\(\\g<foo>\\))", "((((((((a))))))))", 0, 17, 1); + x2("\\g<bar>|\\zEND(?<bar>.*abc$)", "abcxxxabc", 0, 9); + x2("\\g<1>|\\zEND(.a.)", "bac", 0, 3); + x3("\\g<_A>\\g<_A>|\\zEND(.a.)(?<_A>.b.)", "xbxyby", 3, 6, 1); + x2("\\A(?:\\g<pon>|\\g<pan>|\\zEND " + "(?<pan>a|c\\g<pon>c)(?<pon>b|d\\g<pan>d))$", + "cdcbcdc", 0, 7); + x2("\\A(?<n>|a\\g<m>)\\z|\\zEND (?<m>\\g<n>)", "aaaa", 0, 4); + x2("(?<n>(a|b\\g<n>c){3,5})", "baaaaca", 1, 5); + x2("(?<n>(a|b\\g<n>c){3,5})", "baaaacaaaaa", 0, 10); + x2("(?<pare>\\(([^\\(\\)]++|\\g<pare>)*+\\))", "((a))", 0, 5); + x2("()*\\1", "", 0, 0); + x2("(?:()|())*\\1\\2", "", 0, 0); + x3("(?:\\1a|())*", "a", 0, 0, 1); + x2("x((.)*)*x", "0x1x2x3", 1, 6); + x2("x((.)*)*x(?i:\\1)\\Z", "0x1x2x1X2", 1, 9); + x2("(?:()|()|()|()|()|())*\\2\\5", "", 0, 0); + x2("(?:()|()|()|(x)|()|())*\\2b\\5", "b", 0, 1); + x2("\\xED\\xF2", "\xed\xf2", 0, 2); + x2("", "", 0, 0); + x2("", "", 0, 2); + n("", ""); + x2("", "", 0, 4); + x2("", "", 0, 6); + x2("", + "", + 0, 70); + x2("", "", 2, 4); + x2("", "", 2, 6); + x2("\\xca\\xb8", "\xca\xb8", 0, 2); + x2(".", "", 0, 2); + x2("..", "", 0, 4); + x2("(?u)\\w", "", 0, 2); + n("(?u)\\W", ""); + x2("(?u)[\\W]", "$", 2, 3); + x2("\\S", "", 0, 2); + x2("\\S", "", 0, 2); + x2("\\b", " ", 0, 0); + x2("\\b", " ", 1, 1); + x2("\\B", " ", 2, 2); + x2("\\B", " ", 3, 3); + x2("\\B", " ", 0, 0); + x2("[]", "", 0, 2); + n("[ʤ]", ""); + x2("[-]", "", 0, 2); + n("[^]", ""); + x2("(?u)[\\w]", "", 0, 2); + n("[\\d]", ""); + x2("[\\D]", "", 0, 2); + n("[\\s]", ""); + x2("[\\S]", "", 0, 2); + x2("(?u)[\\w\\d]", "", 0, 2); + x2("(?u)[\\w\\d]", " ", 3, 5); + n("(?u)\\w", " "); + x2("(?u)\\W", " ", 0, 5); + x2("..", "", 0, 10); + x2("(?u).\\w\\W..", " ", 0, 13); + x2("(?u)\\s\\w", " ", 0, 9); + x2(".", "", 0, 8); + n(".", ""); + x2(".", "", 0, 4); + x2("^", "", 0, 2); + x2("^$", "", 0, 2); + x2("(?u)^\\w$", "", 0, 2); + x2("(?u)^\\w$", "z", 0, 11); + x2("(?u)^\\w...$", "z", 0, 13); + x2("(?u)\\w\\w\\s\\W\\d", "a 4", 0, 12); + x2("\\A", "", 0, 6); + x2("\\Z", "", 0, 6); + x2("\\z", "", 0, 6); + x2("\\Z", "\n", 0, 6); + x2("\\Gݤ", "ݤ", 0, 4); + n("\\G", ""); + n("Ȥ\\G", "Ȥ"); + n("ޤ\\A", "ޤ"); + n("\\A", "ޤ"); + x2("(?=)", "", 0, 2); + n("(?=).", ""); + x2("(?!)", "", 0, 2); + n("(?!)", ""); + x2("(?i:)", "", 0, 2); + x2("(?i:֤)", "֤", 0, 4); + n("(?i:)", ""); + x2("(?m:.)", "\n", 0, 3); + x2("(?m:.)", "\n", 2, 5); + x2("?", "", 0, 0); + x2("?", "", 0, 0); + x2("?", "", 0, 2); + x2("*", "", 0, 0); + x2("*", "", 0, 2); + x2("*", "һһ", 0, 6); + x2("*", "", 0, 0); + n("+", ""); + x2("+", "", 0, 2); + x2("+", "", 0, 8); + x2("+", "", 0, 4); + x2("+", "", 2, 10); + x2(".?", "", 0, 2); + x2(".*", "ѤԤפ", 0, 8); + x2(".+", "", 0, 2); + x2(".+", "\n", 0, 8); + x2("|", "", 0, 2); + x2("|", "", 0, 2); + x2("|", "", 0, 4); + x2("|", "", 0, 4); + x2("(?:|)", "򤫤", 0, 6); + x2("(?:|)", "򤭤", 0, 8); + x2("|(?:|)", "", 0, 4); + x2("||", "", 2, 4); + x2("|||||||||ĤƤȤʤ|̤", "", 0, + 6); + n("|||||||||ĤƤȤʤ|̤", ""); + x2("|^", "֤", 2, 4); + x2("|^", "", 0, 2); + x2("|\\G", "ֵ", 4, 6); + x2("|\\G", "ֵ", 0, 2); + x2("|\\A", "bֵ", 3, 5); + x2("|\\A", "", 0, 2); + x2("|\\Z", "ֵ", 2, 4); + x2("|\\Z", "", 0, 2); + x2("|\\Z", "\n", 0, 2); + x2("|\\z", "ֵ", 2, 4); + x2("|\\z", "", 0, 2); + x2("(?u)\\w|\\s", "", 0, 2); + x2("(?u)\\w|%", "%", 0, 1); + x2("(?u)\\w|[&$]", "&", 0, 2); + x2("[-]", "", 0, 2); + x2("[-]|[^-]", "", 0, 2); + x2("[-]|[^-]", "", 0, 2); + x2("[^]", "\n", 0, 1); + x2("(?:|[-])|", "", 0, 2); + x2("(?:|[-])|", "", 0, 4); + x2("|(?=)..", "", 0, 6); + x2("|(?!)..", "", 0, 6); + x2("(?=)..|(?=)..", "", 0, 6); + x2("(?<=|)", "", 4, 6); + n("(?>|)", ""); + x2("(?>|)", "", 0, 8); + x2("?|", "", 0, 2); + x2("?|", "", 0, 0); + x2("?|", "", 0, 0); + x2("*|", "", 0, 4); + x2("*|*", "", 0, 0); + x2("*|*", "", 0, 2); + x2("[a]*|*", "a", 0, 3); + x2("+|*", "", 0, 0); + x2("+|*", "", 0, 6); + x2("+|*", "", 0, 2); + x2("+|*", "a", 0, 0); + n("+|+", ""); + x2("(|)?", "", 0, 2); + x2("(|)*", "", 0, 4); + x2("(|)+", "", 0, 6); + x2("(|)+", "", 0, 8); + x2("(|)+", "", 4, 12); + x2("(|)+", "", 2, 10); + x2("(|)+", "򤦤", 0, 4); + x2("(|)+", "$$zzzz򤦤", 6, 10); + x2("(|)+", "", 0, 10); + x2("(|)+", "", 2, 4); + x2("(|)+", "", 2, 8); + x2("(?:|)(?:|)", "", 0, 4); + x2("(?:*|*)(?:*|*)", "", 0, 6); + x2("(?:*|*)(?:+|+)", "", 0, 12); + x2("(?:+|+){2}", "", 0, 12); + x2("(?:+|+){1,2}", "", 0, 12); + x2("(?:+|\\A*)", "", 0, 4); + n("(?:+|\\A*)", ""); + x2("(?:^+|+)*", "", 12, 16); + x2("(?:^+|+)*", "", 0, 14); + x2("{0,}", "", 0, 8); + x2("|(?i)c", "C", 0, 1); + x2("(?i)c|", "C", 0, 1); + x2("(?i:)|a", "a", 0, 1); + n("(?i:)|a", "A"); + x2("[]?", "", 0, 2); + x2("[]*", "", 0, 6); + x2("[^]*", "", 0, 0); + n("[^]+", ""); + x2("?\?", "", 0, 0); + x2("?\?", "", 0, 6); + x2("*?", "", 0, 0); + x2("*?", "", 0, 2); + x2("*?", "", 0, 8); + x2("+?", "", 0, 2); + x2("+?", "", 0, 4); + x2("+?", "", 0, 8); + x2("(?:ŷ?)?\?", "ŷ", 0, 0); + x2("(?:ŷ?\?)?", "ŷ", 0, 0); + x2("(?:̴?)+?", "̴̴̴", 0, 2); + x2("(?:+)?\?", "", 0, 0); + x2("(?:+)?\?", "", 0, 8); + x2("(?:)?{2}", "", 0, 0); + x2("(?:)?{2}", "ֵֵ", 0, 8); + x2("(?:)*{0}", "ֵֵ", 0, 0); + x2("(?:){3,}", "ֵֵֵ", 0, 16); + n("(?:){3,}", "ֵ"); + x2("(?:){2,4}", "ֵֵ", 0, 12); + x2("(?:){2,4}", "ֵֵֵֵ", 0, 16); + x2("(?:){2,4}?", "ֵֵֵֵ", 0, 8); + x2("(?:){,}", "{,}", 0, 7); + x2("(?:)+?{2}", "", 0, 12); + x3("()", "", 0, 2, 1); + x3("(п)", "п", 0, 4, 1); + x2("(())", "", 0, 4); + x3("(())", "", 0, 4, 1); + x3("(())", "", 0, 4, 2); + x3("((((((((((((((((((((̻))))))))))))))))))))", "̻", 0, 4, 20); + x3("()()", "", 0, 4, 1); + x3("()()", "", 4, 8, 2); + x3("()()()", "", 6, 12, 3); + x3("(()()())", "", 6, 12, 4); + x3(".*(ե)󡦥(()奿)", "ե󡦥ޥ󥷥奿", 10, 18, 2); + x2("(^)", "", 0, 2); + x3("()|()", "", 2, 4, 1); + x3("(^)|()", "", 2, 4, 2); + x3("(?)", "", 0, 2, 1); + x3("(*)", "ޤޤ", 0, 6, 1); + x3("(*)", "", 0, 0, 1); + x3("(+)", "", 0, 14, 1); + x3("(+|*)", "դդդؤ", 0, 6, 1); + x3("(+|?)", "", 0, 2, 1); + x3("()?", "", 0, 6, 1); + x3("()*", "", 0, 6, 1); + x3("()+", "", 0, 6, 1); + x3("(|)+", "", 0, 6, 1); + x3("([ʤˤ][]|)+", "", 0, 6, 1); + x3("((?i:))", "", 0, 6, 1); + x3("((?m:.))", "\n", 0, 5, 1); + x3("((?=))", "", 0, 2, 1); + x3("|(.)", "󤢤", 0, 8, 1); + x3("*(.)", "", 8, 10, 1); + x3("*?(.)", "", 0, 2, 1); + x3("*?()", "", 8, 10, 1); + x3("[]*(.)", "", 10, 12, 1); + x3("(\\A)", "", 0, 4, 1); + n("(\\A)", "󤤤"); + x3("(^)", "", 0, 4, 1); + n("(^)", "󤤤"); + x3("($)", "", 4, 8, 1); + n("($)", ""); + x2("(̵)\\1", "̵̵", 0, 4); + n("(̵)\\1", "̵"); + x2("(?)\\1", "", 0, 4); + x2("(?\?)\\1", "", 0, 0); + x2("(*)\\1", "", 0, 8); + x3("(*)\\1", "", 0, 4, 1); + x2("(*)\\1", "", 0, 10); + x2("(*)\\1", "", 0, 2); + x2("(*)(*)\\1\\2", "", 0, 20); + x2("(*)(*)\\2", "", 0, 14); + x3("(*)(*)\\2", "", 6, 10, 2); + x2("(((((((*)))))))\\7", "ݤݤݤڤԤݤݤ", 0, 16); + x3("(((((((*)))))))\\7", "ݤݤݤڤԤݤݤ", 0, 6, 7); + x2("()()()\\2\\1\\3", "ϤҤդҤϤ", 0, 12); + x2("([-])\\1", "", 0, 4); + x2("(?u)(\\w\\d\\s)\\1", "5 5 ", 0, 8); + n("(?u)(\\w\\d\\s)\\1", "5 5"); + x2("(ï|[-]{3})\\1", "ïï", 0, 8); + x2("...(ï|[-]{3})\\1", "aïï", 0, 13); + x2("(ï|[-]{3})\\1", "", 0, 12); + x2("(^)\\1", "", 0, 4); + n("(^)\\1", ""); + n("($)\\1", ""); + n("(\\Z)\\1", ""); + x2("(*\\Z)\\1", "", 2, 2); + x2(".(*\\Z)\\1", "", 2, 4); + x3("(.(䤤)\\2)", "z䤤䤤", 0, 13, 1); + x3("(.(..\\d.)\\2)", "12341234", 0, 10, 1); + x2("((?i:v))\\1", "vv", 0, 10); + x2("(?<>|\\(\\g<>\\))", "(((((())))))", 0, 14); + x2("\\A(?:\\g<_1>|\\g<_2>|\\zλ " + "(?<_1>|\\g<_2>)(?<_2>|\\g<_1>))$", + "߼", 0, 26); + x2("[[Ҥ]]", "", 0, 2); + x2("[[]]", "", 0, 2); + n("[[^]]", ""); + n("[^[]]", ""); + x2("[^[^]]", "", 0, 2); + x2("[[]&&]", "", 0, 2); + n("[[]&&]", ""); + n("[[]&&]", ""); + x2("[-&&-&&-]", "", 0, 2); + n("[^-&&-&&-]", ""); + x2("[[^&&]&&-]", "", 0, 2); + n("[[^&&]&&-]", ""); + x2("[[^-&&]&&[^-]]", "", 0, 2); + n("[[^-&&]&&[^-]]", ""); + x2("[^[^]&&[^]]", "", 0, 2); + x2("[^[^]&&[^]]", "", 0, 2); + n("[^[^]&&[^]]", ""); + x2("[-&&-]", "-", 0, 1); + x2("[^[^a-z]&&[^bcdefg]q-w]", "", 0, 2); + x2("[^[^a-z]&&[^bcdefg]g-w]", "f", 0, 1); + x2("[^[^a-z]&&[^bcdefg]g-w]", "g", 0, 1); + n("[^[^a-z]&&[^bcdefg]g-w]", "2"); + x2("a<b>СΥ<\\/b>", "a<b>СΥ</b>", + 0, 32); + x2(".<b>СΥ<\\/b>", "a<b>СΥ</b>", + 0, 32); + fprintf(stdout, + "\nRESULT SUCC: %d, FAIL: %d, ERROR: %d (by Onigmo %s)\n", + nsucc, nfail, nerror, onig_version()); + +#ifndef POSIX_TEST + onig_region_free(region, 1); + onig_end(); +#endif + + return ((nfail == 0 && nerror == 0) ? 0 : -1); +} diff --git a/lib/edbee-lib/vendor/onig/testconv.rb b/lib/edbee-lib/vendor/onig/testconv.rb new file mode 100755 index 00000000..5b278732 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/testconv.rb @@ -0,0 +1,242 @@ +#!/usr/local/bin/ruby -Ke +# testconv.rb +# Copyright (C) 2003-2006 K.Kosako (sndgk393 AT ybb DOT ne DOT jp) + +WINDOWS = (ARGV.size > 0 && /^-win/i =~ ARGV[0]) +ARGV.shift if WINDOWS + +if WINDOWS + REGENC = 'ONIG_ENCODING_SJIS' +else + REGENC = 'ONIG_ENCODING_EUC_JP' +end + +def conv_reg(s) + s.gsub!(/\\/, '\\\\\\\\') #' + s.gsub!(/\?\?/, '?\\\\?') # escape ANSI trigraph (??) + s +end + +def conv_str(s) + if (s[0] == ?') + s = s[1..-2] + return s.gsub(/\\/, '\\\\\\\\') #' + else + return s[1..-2] + end +end + +print(<<"EOS") +/* + * This program was generated by testconv.rb. + */ +#include "config.h" +#ifdef ONIG_ESCAPE_UCHAR_COLLISION +#undef ONIG_ESCAPE_UCHAR_COLLISION +#endif +#include <stdio.h> + +#ifdef POSIX_TEST +#include "onigmoposix.h" +#else +#include "onigmo.h" +#endif + +#include <string.h> + +#define SLEN(s) strlen(s) + +static int nsucc = 0; +static int nfail = 0; +static int nerror = 0; + +static FILE* err_file; + +#ifndef POSIX_TEST +static OnigRegion* region; +#endif + +static void xx(char* pattern, char* str, int from, int to, int mem, int not) +{ + int r; + +#ifdef POSIX_TEST + regex_t reg; + char buf[200]; + regmatch_t pmatch[25]; + + r = regcomp(®, pattern, REG_EXTENDED | REG_NEWLINE); + if (r) { + regerror(r, ®, buf, sizeof(buf)); + fprintf(err_file, "ERROR: %s\\n", buf); + nerror++; + return ; + } + + r = regexec(®, str, reg.re_nsub + 1, pmatch, 0); + if (r != 0 && r != REG_NOMATCH) { + regerror(r, ®, buf, sizeof(buf)); + fprintf(err_file, "ERROR: %s\\n", buf); + nerror++; + return ; + } + + if (r == REG_NOMATCH) { + if (not) { + fprintf(stdout, "OK(N): /%s/ '%s'\\n", pattern, str); + nsucc++; + } + else { + fprintf(stdout, "FAIL: /%s/ '%s'\\n", pattern, str); + nfail++; + } + } + else { + if (not) { + fprintf(stdout, "FAIL(N): /%s/ '%s'\\n", pattern, str); + nfail++; + } + else { + if (pmatch[mem].rm_so == from && pmatch[mem].rm_eo == to) { + fprintf(stdout, "OK: /%s/ '%s'\\n", pattern, str); + nsucc++; + } + else { + fprintf(stdout, "FAIL: /%s/ '%s' %d-%d : %d-%d\\n", pattern, str, + (int)from, (int)to, (int)pmatch[mem].rm_so, (int)pmatch[mem].rm_eo); + nfail++; + } + } + } + regfree(®); + +#else + regex_t* reg; + OnigErrorInfo einfo; + OnigSyntaxType syn = *ONIG_SYNTAX_DEFAULT; + + /* ONIG_OPTION_OFF(syn.options, ONIG_OPTION_ASCII_RANGE); */ + + r = onig_new(®, (UChar* )pattern, (UChar* )(pattern + SLEN(pattern)), + ONIG_OPTION_DEFAULT, #{REGENC}, &syn, &einfo); + if (r) { + char s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str((UChar* )s, r, &einfo); + fprintf(err_file, "ERROR: %s\\n", s); + nerror++; + return ; + } + + r = onig_search(reg, (UChar* )str, (UChar* )(str + SLEN(str)), + (UChar* )str, (UChar* )(str + SLEN(str)), + region, ONIG_OPTION_NONE); + if (r < ONIG_MISMATCH) { + char s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str((UChar* )s, r); + fprintf(err_file, "ERROR: %s\\n", s); + nerror++; + return ; + } + + if (r == ONIG_MISMATCH) { + if (not) { + fprintf(stdout, "OK(N): /%s/ '%s'\\n", pattern, str); + nsucc++; + } + else { + fprintf(stdout, "FAIL: /%s/ '%s'\\n", pattern, str); + nfail++; + } + } + else { + if (not) { + fprintf(stdout, "FAIL(N): /%s/ '%s'\\n", pattern, str); + nfail++; + } + else { + if (region->beg[mem] == from && region->end[mem] == to) { + fprintf(stdout, "OK: /%s/ '%s'\\n", pattern, str); + nsucc++; + } + else { + fprintf(stdout, "FAIL: /%s/ '%s' %d-%d : %d-%d\\n", pattern, str, + (int)from, (int)to, (int)region->beg[mem], (int)region->end[mem]); + nfail++; + } + } + } + onig_free(reg); +#endif +} + +static void x2(char* pattern, char* str, int from, int to) +{ + xx(pattern, str, from, to, 0, 0); +} + +static void x3(char* pattern, char* str, int from, int to, int mem) +{ + xx(pattern, str, from, to, mem, 0); +} + +static void n(char* pattern, char* str) +{ + xx(pattern, str, 0, 0, 0, 1); +} + +extern int main(int argc, char* argv[]) +{ + err_file = stdout; + +#ifdef POSIX_TEST + reg_set_encoding(#{REGENC.sub(/\AONIG_/, 'REG_POSIX_')}); +#else + region = onig_region_new(); +#endif + +EOS + +PAT = '\\/([^\\\\\\/]*(?:\\\\.[^\\\\\\/]*)*)\\/' +CM = '\s*,\s*' +RX2 = %r{\Ax\(#{PAT}#{CM}('[^']*'|"[^"]*")#{CM}(\S+)#{CM}(\S+)\)} +RI2 = %r{\Ai\(#{PAT}#{CM}('[^']*'|"[^"]*")#{CM}(\S+)#{CM}(\S+)\)} +RX3 = %r{\Ax\(#{PAT}#{CM}('[^']*'|"[^"]*")#{CM}(\S+)#{CM}(\S+)#{CM}(\S+)\)} +RN = %r{\An\(#{PAT}#{CM}('[^']*'|"[^"]*")\)} #' + +while line = gets() + if (m = RX2.match(line)) + reg = conv_reg(m[1]) + str = conv_str(m[2]) + printf(" x2(\"%s\", \"%s\", %s, %s);\n", reg, str, m[3], m[4]) + elsif (m = RI2.match(line)) + reg = conv_reg(m[1]) + str = conv_str(m[2]) + printf(" x2(\"%s\", \"%s\", %s, %s);\n", reg, str, m[3], m[4]) + elsif (m = RX3.match(line)) + reg = conv_reg(m[1]) + str = conv_str(m[2]) + printf(" x3(\"%s\", \"%s\", %s, %s, %s);\n", reg, str, m[3], m[4], m[5]) + elsif (m = RN.match(line)) + reg = conv_reg(m[1]) + str = conv_str(m[2]) + printf(" n(\"%s\", \"%s\");\n", reg, str) + else + + end +end + +print(<<'EOS') + fprintf(stdout, + "\nRESULT SUCC: %d, FAIL: %d, ERROR: %d (by Onigmo %s)\n", + nsucc, nfail, nerror, onig_version()); + +#ifndef POSIX_TEST + onig_region_free(region, 1); + onig_end(); +#endif + + return ((nfail == 0 && nerror == 0) ? 0 : -1); +} +EOS + +# END OF SCRIPT diff --git a/lib/edbee-lib/vendor/onig/testconvu.rb b/lib/edbee-lib/vendor/onig/testconvu.rb new file mode 100755 index 00000000..384731e0 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/testconvu.rb @@ -0,0 +1,414 @@ +#!/usr/local/bin/ruby +# testconvu.rb +# Copyright (C) 2004-2006 K.Kosako (sndgk393 AT ybb DOT ne DOT jp) + +WINDOWS = (ARGV.size > 0 && /^-win/i =~ ARGV[0]) +ARGV.shift if WINDOWS + +BIG_ENDIAN = 1 +LITTLE_ENDIAN = 2 + +def eucjp_char_pos(s, byte_pos) + pos = 0 + i = 0 + while (i < byte_pos) + x = s[i].ord + if ((x >= 0xa1 && x <= 0xfe) || x == 0x8e) + i += 2 + elsif (x == 0x8f) + i += 3 + else + i += 1 + end + pos += 1 + end + return pos +end + +def utf16_byte_pos(endian, s, char_pos) + i = 0 + while (char_pos > 0) + x = (endian == BIG_ENDIAN ? s[i] : s[i+1]).ord + if (x >= 0xd8 && x <= 0xdb) + i += 4 + else + i += 2 + end + char_pos -= 1 + end + return i +end + +def s_escape(s) + q = '' + s.each_byte { |b| + if (b < 0x20 || b >= 0x7f || b == 0x22 || b == 0x5c) + q << sprintf("\\%03o", b) + else + q << b.chr + end + } + q +end + +def conv_to_utf16(endian, s) + begin + if (endian == BIG_ENDIAN) + q = s.encode('UTF-16BE', 'EUC-JP') + else + q = s.encode('UTF-16LE', 'EUC-JP') + end + q.force_encoding('ASCII-8BIT') + rescue Encoding::InvalidByteSequenceError + q = 'Invalid character' + rescue Encoding::UndefinedConversionError + STDERR.printf("Encoding::UndefinedConversionError: [%s]\n", s) + return '' + end + + q << "\000\000" + s_escape(q) +end + +def conv_reg(endian, s) + s = s.gsub(/\\([0-7]{2,3})\\([0-7]{2,3})/) { + $1.to_i(8).chr + $2.to_i(8).chr + } + + s = s.gsub(/\\x([0-9A-Fa-f]{2})\\x([0-9A-Fa-f]{2})/) { + $1.to_i(16).chr + $2.to_i(16).chr + } + + if (endian == BIG_ENDIAN) + s = s.gsub(/(\\[0-7]{2,3})/) { "\\000" + $1 } + s = s.gsub(/(\\x[0-9A-Fa-f]{2})/) { "\\x00" + $1 } + else + s = s.gsub(/(\\[0-7]{2,3})/) { $1 + "\\000" } + s = s.gsub(/(\\x[0-9A-Fa-f]{2})/) { $1 + "\\x00" } + end + + s = s.gsub(/\\/, '\\\\') #' + + if (WINDOWS) + s = s.gsub(/\?\?/, '?\\?') # escape ANSI trigraph + end + conv_to_utf16(endian, s) +end + +def conv_str(endian, s, from, to) + if (s[0] == ?') + s = s[1..-2] + q = s.gsub(/\\/, '\\\\') #' + else + q = s[1..-2] + q.gsub!(/\\n/, "\x0a") + q.gsub!(/\\t/, "\x09") + q.gsub!(/\\v/, "\x0b") + q.gsub!(/\\r/, "\x0d") + q.gsub!(/\\f/, "\x0c") + q.gsub!(/\\a/, "\x07") + q.gsub!(/\\e/, "\x1b") + + q.gsub!(/\\([0-7]{2,3})/) { $1.to_i(8).chr } + q.gsub!(/\\x([0-9A-Fa-f]{2})/) { $1.to_i(16).chr } + end + + q.force_encoding('ASCII-8BIT') + from = from.to_i + to = to.to_i + eucjp_from = eucjp_char_pos(q, from) + eucjp_to = eucjp_char_pos(q, to) + + s = conv_to_utf16(endian, q) + + from = utf16_byte_pos(endian, s, eucjp_from) + to = utf16_byte_pos(endian, s, eucjp_to) + return s, from, to +end + +print(<<"EOS") +/* + * This program was generated by testconv.rb. + */ +#include<stdio.h> + +#ifdef POSIX_TEST +#include "onigmoposix.h" +#else +#include "onigmo.h" +#endif + +static int nsucc = 0; +static int nfail = 0; +static int nerror = 0; + +static FILE* err_file; + +#ifndef POSIX_TEST +static OnigRegion* region; +static OnigEncoding ENC; +#endif + +#define ulen(p) onigenc_str_bytelen_null(ENC, (UChar* )p) + +static void uconv(char* from, char* to, int len) +{ + int i; + unsigned char c; + char *q; + + q = to; + + for (i = 0; i < len; i += 2) { + c = (unsigned char )from[i]; + if (c == 0) { + c = (unsigned char )from[i+1]; + if (c < 0x20 || c >= 0x7f || c == 0x5c || c == 0x22) { + sprintf(q, "\\\\%03o", c); + q += 4; + } + else { + sprintf(q, "%c", c); + q++; + } + } + else { + sprintf(q, "\\\\%03o", c); + q += 4; + c = (unsigned char )from[i+1]; + sprintf(q, "\\\\%03o", c); + q += 4; + } + } + + *q = 0; +} + +static void xx(char* pattern, char* str, int from, int to, int mem, int not) +{ + int r; + char cpat[4000], cstr[4000]; + +#ifdef POSIX_TEST + regex_t reg; + char buf[200]; + regmatch_t pmatch[20]; + + uconv(pattern, cpat, ulen(pattern)); + uconv(str, cstr, ulen(str)); + + r = regcomp(®, pattern, REG_EXTENDED | REG_NEWLINE); + if (r) { + regerror(r, ®, buf, sizeof(buf)); + fprintf(err_file, "ERROR: %s\\n", buf); + nerror++; + return ; + } + + r = regexec(®, str, reg.re_nsub + 1, pmatch, 0); + if (r != 0 && r != REG_NOMATCH) { + regerror(r, ®, buf, sizeof(buf)); + fprintf(err_file, "ERROR: %s\\n", buf); + nerror++; + return ; + } + + if (r == REG_NOMATCH) { + if (not) { + fprintf(stdout, "OK(N): /%s/ '%s'\\n", cpat, cstr); + nsucc++; + } + else { + fprintf(stdout, "FAIL: /%s/ '%s'\\n", cpat, cstr); + nfail++; + } + } + else { + if (not) { + fprintf(stdout, "FAIL(N): /%s/ '%s'\\n", cpat, cstr); + nfail++; + } + else { + if (pmatch[mem].rm_so == from && pmatch[mem].rm_eo == to) { + fprintf(stdout, "OK: /%s/ '%s'\\n", cpat, cstr); + nsucc++; + } + else { + fprintf(stdout, "FAIL: /%s/ '%s' %d-%d : %d-%d\\n", cpat, cstr, + (int)from, (int)to, (int)pmatch[mem].rm_so, (int)pmatch[mem].rm_eo); + nfail++; + } + } + } + regfree(®); + +#else + regex_t* reg; + OnigCompileInfo ci; + OnigErrorInfo einfo; + OnigSyntaxType syn = *ONIG_SYNTAX_DEFAULT; + + /* ONIG_OPTION_OFF(syn.options, ONIG_OPTION_ASCII_RANGE); */ + + uconv(pattern, cpat, ulen(pattern)); + uconv(str, cstr, ulen(str)); + +#if 0 + r = onig_new(®, (UChar* )pattern, (UChar* )(pattern + ulen(pattern)), + ONIG_OPTION_DEFAULT, ENC, &syn, &einfo); +#else + ci.num_of_elements = 5; + ci.pattern_enc = ENC; + ci.target_enc = ENC; + ci.syntax = &syn; + ci.option = ONIG_OPTION_DEFAULT; + ci.case_fold_flag = ONIGENC_CASE_FOLD_DEFAULT; + + r = onig_new_deluxe(®, (UChar* )pattern, + (UChar* )(pattern + ulen(pattern)), + &ci, &einfo); +#endif + + if (r) { + char s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str((UChar* )s, r, &einfo); + fprintf(err_file, "ERROR: %s\\n", s); + nerror++; + return ; + } + + r = onig_search(reg, (UChar* )str, (UChar* )(str + ulen(str)), + (UChar* )str, (UChar* )(str + ulen(str)), + region, ONIG_OPTION_NONE); + if (r < ONIG_MISMATCH) { + char s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str((UChar* )s, r); + fprintf(err_file, "ERROR: %s\\n", s); + nerror++; + return ; + } + + if (r == ONIG_MISMATCH) { + if (not) { + fprintf(stdout, "OK(N): /%s/ '%s'\\n", cpat, cstr); + nsucc++; + } + else { + fprintf(stdout, "FAIL: /%s/ '%s'\\n", cpat, cstr); + nfail++; + } + } + else { + if (not) { + fprintf(stdout, "FAIL(N): /%s/ '%s'\\n", cpat, cstr); + nfail++; + } + else { + if (region->beg[mem] == from && region->end[mem] == to) { + fprintf(stdout, "OK: /%s/ '%s'\\n", cpat, cstr); + nsucc++; + } + else { + fprintf(stdout, "FAIL: /%s/ '%s' %d-%d : %d-%d\\n", cpat, cstr, + (int)from, (int)to, (int)region->beg[mem], (int)region->end[mem]); + nfail++; + } + } + } + onig_free(reg); +#endif +} + +static void x2(char* pattern, char* str, int from, int to) +{ + xx(pattern, str, from, to, 0, 0); +} + +static void x3(char* pattern, char* str, int from, int to, int mem) +{ + xx(pattern, str, from, to, mem, 0); +} + +static void n(char* pattern, char* str) +{ + xx(pattern, str, 0, 0, 0, 1); +} + +extern int main(int argc, char* argv[]) +{ + err_file = stdout; + +#ifndef POSIX_TEST + region = onig_region_new(); +#endif +EOS + + +PAT = '\\/([^\\\\\\/]*(?:\\\\.[^\\\\\\/]*)*)\\/' +CM = /\s*,\s*/ +RX2 = %r{\Ax\(#{PAT}#{CM}('[^']*'|"[^"]*")#{CM}(\S+)#{CM}(\S+)\)} +RI2 = %r{\Ai\(#{PAT}#{CM}('[^']*'|"[^"]*")#{CM}(\S+)#{CM}(\S+)\)} +RX3 = %r{\Ax\(#{PAT}#{CM}('[^']*'|"[^"]*")#{CM}(\S+)#{CM}(\S+)#{CM}(\S+)\)} +RN = %r{\An\(#{PAT}#{CM}('[^']*'|"[^"]*")\)} #' + +def convert(endian, fp) + + if (endian == BIG_ENDIAN) + se = 'BE' + else + se = 'LE' + end + + print(<<"EOS") +#ifdef POSIX_TEST + reg_set_encoding(REG_POSIX_ENCODING_UTF16_#{se}); +#else + ENC = ONIG_ENCODING_UTF16_#{se}; +#endif +EOS + + while line = fp.gets() + if (m = RX2.match(line)) + reg = conv_reg(endian, m[1]) + str, from, to = conv_str(endian, m[2], m[3], m[4]) + printf(" x2(\"%s\", \"%s\", %s, %s);\n", reg, str, from, to) + elsif (m = RI2.match(line)) + reg = conv_reg(endian, m[1]) + str, from, to = conv_str(endian, m[2], m[3], m[4]) + printf(" x2(\"%s\", \"%s\", %s, %s);\n", reg, str, from, to) + elsif (m = RX3.match(line)) + reg = conv_reg(endian, m[1]) + str, from, to = conv_str(endian, m[2], m[3], m[4]) + printf(" x3(\"%s\", \"%s\", %s, %s, %s);\n", reg, str, from, to, m[5]) + elsif (m = RN.match(line)) + reg = conv_reg(endian, m[1]) + str, from, to = conv_str(endian, m[2], 0, 0) + printf(" n(\"%s\", \"%s\");\n", reg, str) + else + end + end +end + +File::open(ARGV[0]) { |fp| + convert(BIG_ENDIAN, fp) +} + +#File::open(ARGV[0]) { |fp| +# convert(LITTLE_ENDIAN, fp) +#} + +print(<<'EOS') + fprintf(stdout, + "\nRESULT SUCC: %d, FAIL: %d, ERROR: %d (by Onigmo %s)\n", + nsucc, nfail, nerror, onig_version()); + +#ifndef POSIX_TEST + onig_region_free(region, 1); + onig_end(); +#endif + + return ((nfail == 0 && nerror == 0) ? 0 : -1); +} +EOS + +# END OF SCRIPT diff --git a/lib/edbee-lib/vendor/onig/testpy.py b/lib/edbee-lib/vendor/onig/testpy.py new file mode 100755 index 00000000..26d43fef --- /dev/null +++ b/lib/edbee-lib/vendor/onig/testpy.py @@ -0,0 +1,1700 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from __future__ import print_function, unicode_literals +import ctypes +import onigmo +import sys +import io +import locale + +nerror = 0 +nsucc = 0 +nfail = 0 + +# default encoding +onig_encoding = onigmo.ONIG_ENCODING_EUC_JP + +# special syntactic settings +syntax_default = ctypes.byref(onigmo.OnigSyntaxType()) +onigmo.onig_copy_syntax(syntax_default, onigmo.ONIG_SYNTAX_DEFAULT) +onigmo.onig_set_syntax_options(syntax_default, + onigmo.onig_get_syntax_options(syntax_default) + & ~onigmo.ONIG_OPTION_ASCII_RANGE) + + +def get_encoding_name(onigenc): + """Return the name of specified onigmo.OnigEncoding. + + arguments: + enc -- an instance of onigmo.OnigEncoding + """ + name = onigenc[0].name.decode() + encnamemap = {"Windows-31J": "CP932", + "ASCII-8BIT": "ASCII"} + if name in encnamemap: + name = encnamemap[name] + return name + +def is_unicode_encoding(enc): + """Check if the encoding is Unicode encoding. + + arguments: + enc -- encoding name or an instance of onigmo.OnigEncoding + """ + return enc in (onigmo.ONIG_ENCODING_UTF32_LE, + onigmo.ONIG_ENCODING_UTF32_BE, + onigmo.ONIG_ENCODING_UTF16_LE, + onigmo.ONIG_ENCODING_UTF16_BE, + onigmo.ONIG_ENCODING_UTF8, + 'UTF-16LE', 'UTF-16BE', 'UTF-32LE', 'UTF-32BE', 'UTF-8') + +def is_ascii_incompatible_encoding(enc): + """Check if the encoding is ASCII-incompatible encoding. + + arguments: + enc -- encoding name or an instance of onigmo.OnigEncoding + """ + return enc in (onigmo.ONIG_ENCODING_UTF32_LE, + onigmo.ONIG_ENCODING_UTF32_BE, + onigmo.ONIG_ENCODING_UTF16_LE, + onigmo.ONIG_ENCODING_UTF16_BE, + 'UTF-16LE', 'UTF-16BE', 'UTF-32LE', 'UTF-32BE') + + +class strptr: + """a helper class to get a pointer to a string""" + def __init__(self, s): + if not isinstance(s, bytes): + raise TypeError + self._str = s + try: + # CPython 2.x/3.x + self._ptr = ctypes.cast(self._str, ctypes.c_void_p) + except TypeError: + # PyPy 1.x + self._ptr = ctypes.c_void_p(self._str) + + def getptr(self, offset=0): + if offset == -1: # -1 means the end of the string + offset = len(self._str) + elif offset > len(self._str): + raise IndexError + return self._ptr.value + offset + +def cc_to_cb(s, enc, cc): + """convert char count to byte count + + arguments: + s -- unicode string + enc -- encoding name + cc -- char count + """ + if cc == -1: + return -1 + s = s.encode('UTF-32LE') + clen = cc * 4 + if clen > len(s): + raise IndexError + return len(s[:clen].decode('UTF-32LE').encode(enc)) + +def print_result(result, pattern, file=None): + if not file: + file = sys.stdout + print(result + ": ", end='', file=file) + try: + print(pattern, file=file) + except UnicodeEncodeError as e: + print('(' + str(e) + ')') + +def decode_errmsg(msg): + encoding = get_encoding_name(onig_encoding) + if is_ascii_incompatible_encoding(encoding): + encoding = 'ASCII' + return msg.value.decode(encoding, 'replace') + + +class SearchType: + FORWARD = 0 + BACKWARD = 1 + MATCH = 2 + +def xx(pattern, target, s_from, s_to, mem, not_match, + searchtype=SearchType.FORWARD, + gpos=-1, startpos=0, endpos=-1, + syn=syntax_default, opt=onigmo.ONIG_OPTION_DEFAULT, + err=onigmo.ONIG_NORMAL, execerr=onigmo.ONIG_NORMAL): + global nerror + global nsucc + global nfail + + encoding = get_encoding_name(onig_encoding) + + reg = onigmo.OnigRegex() + einfo = onigmo.OnigErrorInfo() + msg = ctypes.create_string_buffer(onigmo.ONIG_MAX_ERROR_MESSAGE_LEN) + + pattern2 = pattern + if not isinstance(pattern, bytes): + pattern2 = pattern.encode(encoding) + patternp = strptr(pattern2) + + target2 = target + if not isinstance(target, bytes): + s_from = cc_to_cb(target, encoding, s_from) + s_to = cc_to_cb(target, encoding, s_to) + gpos = cc_to_cb(target, encoding, gpos) + startpos = cc_to_cb(target, encoding, startpos) + endpos = cc_to_cb(target, encoding, endpos) + target2 = target.encode(encoding) + targetp = strptr(target2) + + # cut very long outputs (used for showing message) + pattern = pattern2.decode(encoding, 'replace') + target = target2.decode(encoding, 'replace') + limit = 100 + if len(pattern) > limit: + pattern = pattern[:limit] + "..." + if len(target) > limit: + target = target[:limit] + "..." + + # Compile + r = onigmo.onig_new(ctypes.byref(reg), + patternp.getptr(), patternp.getptr(-1), + opt, onig_encoding, syn, ctypes.byref(einfo)); + if r != 0: + # Error + onigmo.onig_error_code_to_str(msg, r, ctypes.byref(einfo)) + if r == err: + nsucc += 1 + print_result("OK(E)", "%s (/%s/ '%s')" % \ + (decode_errmsg(msg), pattern, target)) + else: + nerror += 1 + print_result("ERROR", "%s (/%s/ '%s')" % \ + (decode_errmsg(msg), pattern, target), file=sys.stderr) + return + + if err != onigmo.ONIG_NORMAL: + nfail += 1 + print_result("FAIL(E)", "/%s/ '%s'" % (pattern, target)) + onigmo.onig_free(reg) + return + + # Execute + region = onigmo.onig_region_new() + if searchtype == SearchType.FORWARD: + if gpos >= 0: + r = onigmo.onig_search_gpos(reg, + targetp.getptr(), targetp.getptr(-1), + targetp.getptr(gpos), + targetp.getptr(startpos), targetp.getptr(endpos), + region, onigmo.ONIG_OPTION_NONE); + else: + r = onigmo.onig_search(reg, + targetp.getptr(), targetp.getptr(-1), + targetp.getptr(startpos), targetp.getptr(endpos), + region, onigmo.ONIG_OPTION_NONE); + elif searchtype == SearchType.BACKWARD: + if gpos >= 0: + r = onigmo.onig_search_gpos(reg, + targetp.getptr(), targetp.getptr(-1), + targetp.getptr(gpos), + targetp.getptr(endpos), targetp.getptr(startpos), + region, onigmo.ONIG_OPTION_NONE); + else: + r = onigmo.onig_search(reg, + targetp.getptr(), targetp.getptr(-1), + targetp.getptr(endpos), targetp.getptr(startpos), + region, onigmo.ONIG_OPTION_NONE); + elif searchtype == SearchType.MATCH: + r = onigmo.onig_match(reg, targetp.getptr(), targetp.getptr(-1), + targetp.getptr(startpos), + region, onigmo.ONIG_OPTION_NONE); + else: + nerror += 1 + print_result("ERROR", "wrong searchtype", file=sys.stderr) + onigmo.onig_free(reg) + onigmo.onig_region_free(region, 1) + return + + if r < onigmo.ONIG_MISMATCH: + # Error + onigmo.onig_error_code_to_str(msg, r) + if r == execerr: + nsucc += 1 + print_result("OK(E)", "%s (/%s/ '%s')" % \ + (decode_errmsg(msg), pattern, target)) + else: + nerror += 1 + print_result("ERROR", "%s (/%s/ '%s')" % \ + (decode_errmsg(msg), pattern, target), file=sys.stderr) + onigmo.onig_free(reg) + onigmo.onig_region_free(region, 1) + return + + if r == onigmo.ONIG_MISMATCH: + # Not matched + if not_match: + nsucc += 1 + print_result("OK(N)", "/%s/ '%s'" % (pattern, target)) + else: + nfail += 1 + print_result("FAIL", "/%s/ '%s'" % (pattern, target)) + else: + # Matched + if not_match: + nfail += 1 + print_result("FAIL(N)", "/%s/ '%s'" % (pattern, target)) + else: + start = region[0].beg[mem] + end = region[0].end[mem] + if (start == s_from) and (end == s_to): + nsucc += 1 + print_result("OK", "/%s/ '%s'" % (pattern, target)) + else: + nfail += 1 + print_result("FAIL", "/%s/ '%s' %d-%d : %d-%d" % (pattern, target, + s_from, s_to, start, end)) + onigmo.onig_free(reg) + onigmo.onig_region_free(region, 1) + +def x2(pattern, target, s_from, s_to, **kwargs): + xx(pattern, target, s_from, s_to, 0, False, **kwargs) + +def x3(pattern, target, s_from, s_to, mem, **kwargs): + xx(pattern, target, s_from, s_to, mem, False, **kwargs) + +def n(pattern, target, **kwargs): + xx(pattern, target, 0, 0, 0, True, **kwargs) + + +def set_encoding(enc): + """Set the encoding used for testing. + + arguments: + enc -- encoding name or an instance of onigmo.OnigEncoding + """ + global onig_encoding + + if enc == None: + return + if isinstance(enc, onigmo.OnigEncoding): + onig_encoding = enc + else: + encs = {"EUC-JP": onigmo.ONIG_ENCODING_EUC_JP, + "SJIS": onigmo.ONIG_ENCODING_SJIS, + "CP932": onigmo.ONIG_ENCODING_CP932, + "UTF-8": onigmo.ONIG_ENCODING_UTF8, + "UTF-16LE": onigmo.ONIG_ENCODING_UTF16_LE, + "UTF-16BE": onigmo.ONIG_ENCODING_UTF16_BE, + "UTF-32LE": onigmo.ONIG_ENCODING_UTF32_LE, + "UTF-32BE": onigmo.ONIG_ENCODING_UTF32_BE} + onig_encoding = encs[enc.upper()] + +def get_encoding(): + """Get the encoding used for testing.""" + return onig_encoding + +def set_output_encoding(enc=None): + """Set the encoding used for showing the results. + + arguments: + enc -- Encoding name or an instance of onigmo.OnigEncoding. + If omitted, locale.getpreferredencoding() is used. + """ + if enc is None: + enc = locale.getpreferredencoding() + + def get_text_writer(fo, **kwargs): + kw = dict(kwargs) + kw.setdefault('errors', 'backslashreplace') # use \uXXXX style + kw.setdefault('closefd', False) + + if sys.version_info[0] < 3: + # Work around for Python 2.x + # New line conversion isn't needed here. Done in somewhere else. + writer = io.open(fo.fileno(), mode='w', newline='', **kw) + write = writer.write # save the original write() function + enc = locale.getpreferredencoding() + def convwrite(s): + if isinstance(s, bytes): + write(s.decode(enc)) # convert to unistr + else: + write(s) + try: + writer.flush() # needed on Windows + except IOError: + pass + writer.write = convwrite + else: + writer = io.open(fo.fileno(), mode='w', **kw) + return writer + + sys.stdout = get_text_writer(sys.stdout, encoding=enc) + sys.stderr = get_text_writer(sys.stderr, encoding=enc) + + +def set_default_warning_function(): + global _warn_func_ptr + + warning_enc = get_encoding_name(onig_encoding) + if is_ascii_incompatible_encoding(warning_enc): + warning_enc = 'ascii' + def warn_func(str): + print("warning: " + str.decode(warning_enc, 'replace')) + + _warn_func_ptr = onigmo.OnigWarnFunc(warn_func) + onigmo.onig_set_warn_func(_warn_func_ptr) + onigmo.onig_set_verb_warn_func(_warn_func_ptr) + + +def init(enc, outenc=None): + """Setup test target encoding, output encoding and warning function. + + arguments: + enc -- Encoding used for testing. + outenc -- Encoding used for showing messages. + """ + set_encoding(enc) + set_output_encoding(outenc) + set_default_warning_function() + + +def main(): + # encoding of the test target + enc = None + if len(sys.argv) > 1: + enc = sys.argv[1] + + # encoding of stdout/stderr + outenc = None + if len(sys.argv) > 2: + outenc = sys.argv[2] + + # Initialization + try: + init(enc, outenc) + except KeyError: + print("test target encoding error") + print("Usage: python testpy.py [test target encoding] [output encoding]") + sys.exit() + + print(onigmo.onig_copyright()) + + # Copied from onig-5.9.2/testc.c + # '?\?' which is used to avoid trigraph is replaced by '??'. + # Match positions are specified by unit of character instead of byte. + + x2("", "", 0, 0); + x2("^", "", 0, 0); + x2("$", "", 0, 0); + x2("\\G", "", 0, 0); + x2("\\A", "", 0, 0); + x2("\\Z", "", 0, 0); + x2("\\z", "", 0, 0); + x2("^$", "", 0, 0); + x2("\\ca", "\001", 0, 1); + x2("\\C-b", "\002", 0, 1); + x2("\\c\\\\", "\034", 0, 1); + x2("q[\\c\\\\]", "q\034", 0, 2); + x2("", "a", 0, 0); + x2("a", "a", 0, 1); + if onig_encoding == onigmo.ONIG_ENCODING_UTF16_LE: + x2("\\x61\\x00", "a", 0, 1); + elif onig_encoding == onigmo.ONIG_ENCODING_UTF16_BE: + x2("\\x00\\x61", "a", 0, 1); + elif onig_encoding == onigmo.ONIG_ENCODING_UTF32_LE: + x2("\\x61\\x00\\x00\\x00", "a", 0, 1); + elif onig_encoding == onigmo.ONIG_ENCODING_UTF32_BE: + x2("\\x00\\x00\\x00\\x61", "a", 0, 1); + else: + x2("\\x61", "a", 0, 1); + x2("aa", "aa", 0, 2); + x2("aaa", "aaa", 0, 3); + x2("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 0, 35); + x2("ab", "ab", 0, 2); + x2("b", "ab", 1, 2); + x2("bc", "abc", 1, 3); + x2("(?i:#RET#)", "#INS##RET#", 5, 10); + if onig_encoding == onigmo.ONIG_ENCODING_UTF16_LE: + x2("\\17\\00", "\017", 0, 1); + x2("\\x1f\\x00", "\x1f", 0, 1); + elif onig_encoding == onigmo.ONIG_ENCODING_UTF16_BE: + x2("\\00\\17", "\017", 0, 1); + x2("\\x00\\x1f", "\x1f", 0, 1); + elif onig_encoding == onigmo.ONIG_ENCODING_UTF32_LE: + x2("\\17\\00\\00\\00", "\017", 0, 1); + x2("\\x1f\\x00\\x00\\x00", "\x1f", 0, 1); + elif onig_encoding == onigmo.ONIG_ENCODING_UTF32_BE: + x2("\\00\\00\\00\\17", "\017", 0, 1); + x2("\\x00\\x00\\x00\\x1f", "\x1f", 0, 1); + else: + x2("\\17", "\017", 0, 1); + x2("\\x1f", "\x1f", 0, 1); + x2("a(?#....\\\\JJJJ)b", "ab", 0, 2); + x2("(?x) G (o O(?-x)oO) g L", "GoOoOgLe", 0, 7); + x2(".", "a", 0, 1); + n(".", ""); + x2("..", "ab", 0, 2); + x2("\\w", "e", 0, 1); + n("\\W", "e"); + x2("\\s", " ", 0, 1); + x2("\\S", "b", 0, 1); + x2("\\d", "4", 0, 1); + n("\\D", "4"); + x2("\\b", "z ", 0, 0); + x2("\\b", " z", 1, 1); + x2("\\B", "zz ", 1, 1); + x2("\\B", "z ", 2, 2); + x2("\\B", " z", 0, 0); + x2("[ab]", "b", 0, 1); + n("[ab]", "c"); + x2("[a-z]", "t", 0, 1); + n("[^a]", "a"); + x2("[^a]", "\n", 0, 1); + x2("[]]", "]", 0, 1); + n("[^]]", "]"); + x2("[\\^]+", "0^^1", 1, 3); + x2("[b-]", "b", 0, 1); + x2("[b-]", "-", 0, 1); + x2("[\\w]", "z", 0, 1); + n("[\\w]", " "); + x2("[\\W]", "b$", 1, 2); + x2("[\\d]", "5", 0, 1); + n("[\\d]", "e"); + x2("[\\D]", "t", 0, 1); + n("[\\D]", "3"); + x2("[\\s]", " ", 0, 1); + n("[\\s]", "a"); + x2("[\\S]", "b", 0, 1); + n("[\\S]", " "); + x2("[\\w\\d]", "2", 0, 1); + n("[\\w\\d]", " "); + x2("[[:upper:]]", "B", 0, 1); + x2("[*[:xdigit:]+]", "+", 0, 1); + x2("[*[:xdigit:]+]", "GHIKK-9+*", 6, 7); + x2("[*[:xdigit:]+]", "-@^+", 3, 4); + n("[[:upper]]", "A"); + x2("[[:upper]]", ":", 0, 1); + if onig_encoding == onigmo.ONIG_ENCODING_UTF16_LE: + x2("[\\044\\000-\\047\\000]", "\046", 0, 1); + x2("[\\x5a\\x00-\\x5c\\x00]", "\x5b", 0, 1); + x2("[\\x6A\\x00-\\x6D\\x00]", "\x6c", 0, 1); + n("[\\x6A\\x00-\\x6D\\x00]", "\x6E"); + elif onig_encoding == onigmo.ONIG_ENCODING_UTF16_BE: + x2("[\\000\\044-\\000\\047]", "\046", 0, 1); + x2("[\\x00\\x5a-\\x00\\x5c]", "\x5b", 0, 1); + x2("[\\x00\\x6A-\\x00\\x6D]", "\x6c", 0, 1); + n("[\\x00\\x6A-\\x00\\x6D]", "\x6E"); + elif onig_encoding == onigmo.ONIG_ENCODING_UTF32_LE: + x2("[\\044\\000\\000\\000-\\047\\000\\000\\000]", "\046", 0, 1); + x2("[\\x5a\\x00\\x00\\x00-\\x5c\\x00\\x00\\x00]", "\x5b", 0, 1); + x2("[\\x6A\\x00\\x00\\x00-\\x6D\\x00\\x00\\x00]", "\x6c", 0, 1); + n("[\\x6A\\x00\\x00\\x00-\\x6D\\x00\\x00\\x00]", "\x6E"); + elif onig_encoding == onigmo.ONIG_ENCODING_UTF32_BE: + x2("[\\000\\000\\000\\044-\\000\\000\\000\\047]", "\046", 0, 1); + x2("[\\x00\\x00\\x00\\x5a-\\x00\\x00\\x00\\x5c]", "\x5b", 0, 1); + x2("[\\x00\\x00\\x00\\x6A-\\x00\\x00\\x00\\x6D]", "\x6c", 0, 1); + n("[\\x00\\x00\\x00\\x6A-\\x00\\x00\\x00\\x6D]", "\x6E"); + else: + x2("[\\044-\\047]", "\046", 0, 1); + x2("[\\x5a-\\x5c]", "\x5b", 0, 1); + x2("[\\x6A-\\x6D]", "\x6c", 0, 1); + n("[\\x6A-\\x6D]", "\x6E"); + n("^[0-9A-F]+ 0+ UNDEF ", "75F 00000000 SECT14A notype () External | _rb_apply"); + x2("[\\[]", "[", 0, 1); + x2("[\\]]", "]", 0, 1); + x2("[&]", "&", 0, 1); + x2("[[ab]]", "b", 0, 1); + x2("[[ab]c]", "c", 0, 1); + n("[[^a]]", "a"); + n("[^[a]]", "a"); + x2("[[ab]&&bc]", "b", 0, 1); + n("[[ab]&&bc]", "a"); + n("[[ab]&&bc]", "c"); + x2("[a-z&&b-y&&c-x]", "w", 0, 1); + n("[^a-z&&b-y&&c-x]", "w"); + x2("[[^a&&a]&&a-z]", "b", 0, 1); + n("[[^a&&a]&&a-z]", "a"); + x2("[[^a-z&&bcdef]&&[^c-g]]", "h", 0, 1); + n("[[^a-z&&bcdef]&&[^c-g]]", "c"); + x2("[^[^abc]&&[^cde]]", "c", 0, 1); + x2("[^[^abc]&&[^cde]]", "e", 0, 1); + n("[^[^abc]&&[^cde]]", "f"); + x2("[a-&&-a]", "-", 0, 1); + n("[a\\-&&\\-a]", "&"); + n("\\wabc", " abc"); + x2("a\\Wbc", "a bc", 0, 4); + x2("a.b.c", "aabbc", 0, 5); + x2(".\\wb\\W..c", "abb bcc", 0, 7); + x2("\\s\\wzzz", " zzzz", 0, 5); + x2("aa.b", "aabb", 0, 4); + n(".a", "ab"); + x2(".a", "aa", 0, 2); + x2("^a", "a", 0, 1); + x2("^a$", "a", 0, 1); + x2("^\\w$", "a", 0, 1); + n("^\\w$", " "); + x2("^\\wab$", "zab", 0, 3); + x2("^\\wabcdef$", "zabcdef", 0, 7); + x2("^\\w...def$", "zabcdef", 0, 7); + x2("\\w\\w\\s\\Waaa\\d", "aa aaa4", 0, 8); + x2("\\A\\Z", "", 0, 0); + x2("\\Axyz", "xyz", 0, 3); + x2("xyz\\Z", "xyz", 0, 3); + x2("xyz\\z", "xyz", 0, 3); + x2("a\\Z", "a", 0, 1); + x2("\\Gaz", "az", 0, 2); + n("\\Gz", "bza"); + n("az\\G", "az"); + n("az\\A", "az"); + n("a\\Az", "az"); + x2("\\^\\$", "^$", 0, 2); + x2("^x?y", "xy", 0, 2); + x2("^(x?y)", "xy", 0, 2); + x2("\\w", "_", 0, 1); + n("\\W", "_"); + x2("(?=z)z", "z", 0, 1); + n("(?=z).", "a"); + x2("(?!z)a", "a", 0, 1); + n("(?!z)a", "z"); + x2("(?i:a)", "a", 0, 1); + x2("(?i:a)", "A", 0, 1); + x2("(?i:A)", "a", 0, 1); + n("(?i:A)", "b"); + x2("(?i:[A-Z])", "a", 0, 1); + x2("(?i:[f-m])", "H", 0, 1); + x2("(?i:[f-m])", "h", 0, 1); + n("(?i:[f-m])", "e"); + x2("(?i:[A-c])", "D", 0, 1); + n("(?i:[^a-z])", "A"); + n("(?i:[^a-z])", "a"); + x2("(?i:[!-k])", "Z", 0, 1); + x2("(?i:[!-k])", "7", 0, 1); + x2("(?i:[T-}])", "b", 0, 1); + x2("(?i:[T-}])", "{", 0, 1); + x2("(?i:\\?a)", "?A", 0, 2); + x2("(?i:\\*A)", "*a", 0, 2); + n(".", "\n"); + x2("(?m:.)", "\n", 0, 1); + x2("(?m:a.)", "a\n", 0, 2); + x2("(?m:.b)", "a\nb", 1, 3); + x2(".*abc", "dddabdd\nddabc", 8, 13); + x2("(?m:.*abc)", "dddabddabc", 0, 10); + n("(?i)(?-i)a", "A"); + n("(?i)(?-i:a)", "A"); + x2("a?", "", 0, 0); + x2("a?", "b", 0, 0); + x2("a?", "a", 0, 1); + x2("a*", "", 0, 0); + x2("a*", "a", 0, 1); + x2("a*", "aaa", 0, 3); + x2("a*", "baaaa", 0, 0); + n("a+", ""); + x2("a+", "a", 0, 1); + x2("a+", "aaaa", 0, 4); + x2("a+", "aabbb", 0, 2); + x2("a+", "baaaa", 1, 5); + x2(".?", "", 0, 0); + x2(".?", "f", 0, 1); + x2(".?", "\n", 0, 0); + x2(".*", "", 0, 0); + x2(".*", "abcde", 0, 5); + x2(".+", "z", 0, 1); + x2(".+", "zdswer\n", 0, 6); + x2("(.*)a\\1f", "babfbac", 0, 4); + x2("(.*)a\\1f", "bacbabf", 3, 7); + x2("((.*)a\\2f)", "bacbabf", 3, 7); + x2("(.*)a\\1f", "baczzzzzz\nbazz\nzzzzbabf", 19, 23); + x2("a|b", "a", 0, 1); + x2("a|b", "b", 0, 1); + x2("|a", "a", 0, 0); + x2("(|a)", "a", 0, 0); + x2("ab|bc", "ab", 0, 2); + x2("ab|bc", "bc", 0, 2); + x2("z(?:ab|bc)", "zbc", 0, 3); + x2("a(?:ab|bc)c", "aabc", 0, 4); + x2("ab|(?:ac|az)", "az", 0, 2); + x2("a|b|c", "dc", 1, 2); + x2("a|b|cd|efg|h|ijk|lmn|o|pq|rstuvwx|yz", "pqr", 0, 2); + n("a|b|cd|efg|h|ijk|lmn|o|pq|rstuvwx|yz", "mn"); + x2("a|^z", "ba", 1, 2); + x2("a|^z", "za", 0, 1); + x2("a|\\Gz", "bza", 2, 3); + x2("a|\\Gz", "za", 0, 1); + x2("a|\\Az", "bza", 2, 3); + x2("a|\\Az", "za", 0, 1); + x2("a|b\\Z", "ba", 1, 2); + x2("a|b\\Z", "b", 0, 1); + x2("a|b\\z", "ba", 1, 2); + x2("a|b\\z", "b", 0, 1); + x2("\\w|\\s", " ", 0, 1); + n("\\w|\\w", " "); + x2("\\w|%", "%", 0, 1); + x2("\\w|[&$]", "&", 0, 1); + x2("[b-d]|[^e-z]", "a", 0, 1); + x2("(?:a|[c-f])|bz", "dz", 0, 1); + x2("(?:a|[c-f])|bz", "bz", 0, 2); + x2("abc|(?=zz)..f", "zzf", 0, 3); + x2("abc|(?!zz)..f", "abf", 0, 3); + x2("(?=za)..a|(?=zz)..a", "zza", 0, 3); + n("(?>a|abd)c", "abdc"); + x2("(?>abd|a)c", "abdc", 0, 4); + x2("a?|b", "a", 0, 1); + x2("a?|b", "b", 0, 0); + x2("a?|b", "", 0, 0); + x2("a*|b", "aa", 0, 2); + x2("a*|b*", "ba", 0, 0); + x2("a*|b*", "ab", 0, 1); + x2("a+|b*", "", 0, 0); + x2("a+|b*", "bbb", 0, 3); + x2("a+|b*", "abbb", 0, 1); + n("a+|b+", ""); + x2("(a|b)?", "b", 0, 1); + x2("(a|b)*", "ba", 0, 2); + x2("(a|b)+", "bab", 0, 3); + x2("(ab|ca)+", "caabbc", 0, 4); + x2("(ab|ca)+", "aabca", 1, 5); + x2("(ab|ca)+", "abzca", 0, 2); + x2("(a|bab)+", "ababa", 0, 5); + x2("(a|bab)+", "ba", 1, 2); + x2("(a|bab)+", "baaaba", 1, 4); + x2("(?:a|b)(?:a|b)", "ab", 0, 2); + x2("(?:a*|b*)(?:a*|b*)", "aaabbb", 0, 3); + x2("(?:a*|b*)(?:a+|b+)", "aaabbb", 0, 6); + x2("(?:a+|b+){2}", "aaabbb", 0, 6); + x2("h{0,}", "hhhh", 0, 4); + x2("(?:a+|b+){1,2}", "aaabbb", 0, 6); + n("ax{2}*a", "0axxxa1"); + n("a.{0,2}a", "0aXXXa0"); + n("a.{0,2}?a", "0aXXXa0"); + n("a.{0,2}?a", "0aXXXXa0"); + x2("^a{2,}?a$", "aaa", 0, 3); + x2("^[a-z]{2,}?$", "aaa", 0, 3); + x2("(?:a+|\\Ab*)cc", "cc", 0, 2); + n("(?:a+|\\Ab*)cc", "abcc"); + x2("(?:^a+|b+)*c", "aabbbabc", 6, 8); + x2("(?:^a+|b+)*c", "aabbbbc", 0, 7); + x2("a|(?i)c", "C", 0, 1); + x2("(?i)c|a", "C", 0, 1); + x2("(?i)c|a", "A", 0, 1); + x2("(?i:c)|a", "C", 0, 1); + n("(?i:c)|a", "A"); + x2("[abc]?", "abc", 0, 1); + x2("[abc]*", "abc", 0, 3); + x2("[^abc]*", "abc", 0, 0); + n("[^abc]+", "abc"); + x2("a??", "aaa", 0, 0); + x2("ba??b", "bab", 0, 3); + x2("a*?", "aaa", 0, 0); + x2("ba*?", "baa", 0, 1); + x2("ba*?b", "baab", 0, 4); + x2("a+?", "aaa", 0, 1); + x2("ba+?", "baa", 0, 2); + x2("ba+?b", "baab", 0, 4); + x2("(?:a?)??", "a", 0, 0); + x2("(?:a??)?", "a", 0, 0); + x2("(?:a?)+?", "aaa", 0, 1); + x2("(?:a+)??", "aaa", 0, 0); + x2("(?:a+)??b", "aaab", 0, 4); + x2("(?:ab)?{2}", "", 0, 0); + x2("(?:ab)?{2}", "ababa", 0, 4); + x2("(?:ab)*{0}", "ababa", 0, 0); + x2("(?:ab){3,}", "abababab", 0, 8); + n("(?:ab){3,}", "abab"); + x2("(?:ab){2,4}", "ababab", 0, 6); + x2("(?:ab){2,4}", "ababababab", 0, 8); + x2("(?:ab){2,4}?", "ababababab", 0, 4); + x2("(?:ab){,}", "ab{,}", 0, 5); + x2("(?:abc)+?{2}", "abcabcabc", 0, 6); + x2("(?:X*)(?i:xa)", "XXXa", 0, 4); + x2("(d+)([^abc]z)", "dddz", 0, 4); + x2("([^abc]*)([^abc]z)", "dddz", 0, 4); + x2("(\\w+)(\\wz)", "dddz", 0, 4); + x3("(a)", "a", 0, 1, 1); + x3("(ab)", "ab", 0, 2, 1); + x2("((ab))", "ab", 0, 2); + x3("((ab))", "ab", 0, 2, 1); + x3("((ab))", "ab", 0, 2, 2); + x3("((((((((((((((((((((ab))))))))))))))))))))", "ab", 0, 2, 20); + x3("(ab)(cd)", "abcd", 0, 2, 1); + x3("(ab)(cd)", "abcd", 2, 4, 2); + x3("()(a)bc(def)ghijk", "abcdefghijk", 3, 6, 3); + x3("(()(a)bc(def)ghijk)", "abcdefghijk", 3, 6, 4); + x2("(^a)", "a", 0, 1); + x3("(a)|(a)", "ba", 1, 2, 1); + x3("(^a)|(a)", "ba", 1, 2, 2); + x3("(a?)", "aaa", 0, 1, 1); + x3("(a*)", "aaa", 0, 3, 1); + x3("(a*)", "", 0, 0, 1); + x3("(a+)", "aaaaaaa", 0, 7, 1); + x3("(a+|b*)", "bbbaa", 0, 3, 1); + x3("(a+|b?)", "bbbaa", 0, 1, 1); + x3("(abc)?", "abc", 0, 3, 1); + x3("(abc)*", "abc", 0, 3, 1); + x3("(abc)+", "abc", 0, 3, 1); + x3("(xyz|abc)+", "abc", 0, 3, 1); + x3("([xyz][abc]|abc)+", "abc", 0, 3, 1); + x3("((?i:abc))", "AbC", 0, 3, 1); + x2("(abc)(?i:\\1)", "abcABC", 0, 6); + x3("((?m:a.c))", "a\nc", 0, 3, 1); + x3("((?=az)a)", "azb", 0, 1, 1); + x3("abc|(.abd)", "zabd", 0, 4, 1); + x2("(?:abc)|(ABC)", "abc", 0, 3); + x3("(?i:(abc))|(zzz)", "ABC", 0, 3, 1); + x3("a*(.)", "aaaaz", 4, 5, 1); + x3("a*?(.)", "aaaaz", 0, 1, 1); + x3("a*?(c)", "aaaac", 4, 5, 1); + x3("[bcd]a*(.)", "caaaaz", 5, 6, 1); + x3("(\\Abb)cc", "bbcc", 0, 2, 1); + n("(\\Abb)cc", "zbbcc"); + x3("(^bb)cc", "bbcc", 0, 2, 1); + n("(^bb)cc", "zbbcc"); + x3("cc(bb$)", "ccbb", 2, 4, 1); + n("cc(bb$)", "ccbbb"); + n("(\\1)", ""); + n("\\1(a)", "aa"); + n("(a(b)\\1)\\2+", "ababb"); + n("(?:(?:\\1|z)(a))+$", "zaa"); + x2("(?:(?:\\1|z)(a))+$", "zaaa", 0, 4); + x2("(a)(?=\\1)", "aa", 0, 1); + n("(a)$|\\1", "az"); + x2("(a)\\1", "aa", 0, 2); + n("(a)\\1", "ab"); + x2("(a?)\\1", "aa", 0, 2); + x2("(a??)\\1", "aa", 0, 0); + x2("(a*)\\1", "aaaaa", 0, 4); + x3("(a*)\\1", "aaaaa", 0, 2, 1); + x2("a(b*)\\1", "abbbb", 0, 5); + x2("a(b*)\\1", "ab", 0, 1); + x2("(a*)(b*)\\1\\2", "aaabbaaabb", 0, 10); + x2("(a*)(b*)\\2", "aaabbbb", 0, 7); + x2("(((((((a*)b))))))c\\7", "aaabcaaa", 0, 8); + x3("(((((((a*)b))))))c\\7", "aaabcaaa", 0, 3, 7); + x2("(a)(b)(c)\\2\\1\\3", "abcbac", 0, 6); + x2("([a-d])\\1", "cc", 0, 2); + x2("(\\w\\d\\s)\\1", "f5 f5 ", 0, 6); + n("(\\w\\d\\s)\\1", "f5 f5"); + x2("(who|[a-c]{3})\\1", "whowho", 0, 6); + x2("...(who|[a-c]{3})\\1", "abcwhowho", 0, 9); + x2("(who|[a-c]{3})\\1", "cbccbc", 0, 6); + x2("(^a)\\1", "aa", 0, 2); + n("(^a)\\1", "baa"); + n("(a$)\\1", "aa"); + n("(ab\\Z)\\1", "ab"); + x2("(a*\\Z)\\1", "a", 1, 1); + x2(".(a*\\Z)\\1", "ba", 1, 2); + x3("(.(abc)\\2)", "zabcabc", 0, 7, 1); + x3("(.(..\\d.)\\2)", "z12341234", 0, 9, 1); + x2("((?i:az))\\1", "AzAz", 0, 4); + n("((?i:az))\\1", "Azaz"); + x2("(?<=a)b", "ab", 1, 2); + n("(?<=a)b", "bb"); + x2("(?<=a|b)b", "bb", 1, 2); + x2("(?<=a|bc)b", "bcb", 2, 3); + x2("(?<=a|bc)b", "ab", 1, 2); + x2("(?<=a|bc||defghij|klmnopq|r)z", "rz", 1, 2); + x2("(a)\\g<1>", "aa", 0, 2); + x2("(?<!a)b", "cb", 1, 2); + n("(?<!a)b", "ab"); + x2("(?<!a|bc)b", "bbb", 0, 1); + n("(?<!a|bc)z", "bcz"); + x2("(?<name1>a)", "a", 0, 1); + x2("(?<name_2>ab)\\g<name_2>", "abab", 0, 4); + x2("(?<name_3>.zv.)\\k<name_3>", "azvbazvb", 0, 8); + x2("(?<=\\g<ab>)|-\\zEND (?<ab>XyZ)", "XyZ", 3, 3); + x2("(?<n>|a\\g<n>)+", "", 0, 0); + x2("(?<n>|\\(\\g<n>\\))+$", "()(())", 0, 6); + x3("\\g<n>(?<n>.){0}", "X", 0, 1, 1); + x2("\\g<n>(abc|df(?<n>.YZ){2,8}){0}", "XYZ", 0, 3); + x2("\\A(?<n>(a\\g<n>)|)\\z", "aaaa", 0, 4); + x2("(?<n>|\\g<m>\\g<n>)\\z|\\zEND (?<m>a|(b)\\g<m>)", "bbbbabba", 0, 8); + x2("(?<name1240>\\w+\\sx)a+\\k<name1240>", " fg xaaaaaaaafg x", 2, 18); + x3("(z)()()(?<_9>a)\\g<_9>", "zaa", 2, 3, 1); + x2("(.)(((?<_>a)))\\k<_>", "zaa", 0, 3); + x2("((?<name1>\\d)|(?<name2>\\w))(\\k<name1>|\\k<name2>)", "ff", 0, 2); + x2("(?:(?<x>)|(?<x>efg))\\k<x>", "", 0, 0); + x2("(?:(?<x>abc)|(?<x>efg))\\k<x>", "abcefgefg", 3, 9); + n("(?:(?<x>abc)|(?<x>efg))\\k<x>", "abcefg"); + x2("(?:(?<n1>.)|(?<n1>..)|(?<n1>...)|(?<n1>....)|(?<n1>.....)|(?<n1>......)|(?<n1>.......)|(?<n1>........)|(?<n1>.........)|(?<n1>..........)|(?<n1>...........)|(?<n1>............)|(?<n1>.............)|(?<n1>..............))\\k<n1>$", "a-pyumpyum", 2, 10); + x3("(?:(?<n1>.)|(?<n1>..)|(?<n1>...)|(?<n1>....)|(?<n1>.....)|(?<n1>......)|(?<n1>.......)|(?<n1>........)|(?<n1>.........)|(?<n1>..........)|(?<n1>...........)|(?<n1>............)|(?<n1>.............)|(?<n1>..............))\\k<n1>$", "xxxxabcdefghijklmnabcdefghijklmn", 4, 18, 14); + x3("(?<name1>)(?<name2>)(?<name3>)(?<name4>)(?<name5>)(?<name6>)(?<name7>)(?<name8>)(?<name9>)(?<name10>)(?<name11>)(?<name12>)(?<name13>)(?<name14>)(?<name15>)(?<name16>aaa)(?<name17>)$", "aaa", 0, 3, 16); + x2("(?<foo>a|\\(\\g<foo>\\))", "a", 0, 1); + x2("(?<foo>a|\\(\\g<foo>\\))", "((((((a))))))", 0, 13); + x3("(?<foo>a|\\(\\g<foo>\\))", "((((((((a))))))))", 0, 17, 1); + x2("\\g<bar>|\\zEND(?<bar>.*abc$)", "abcxxxabc", 0, 9); + x2("\\g<1>|\\zEND(.a.)", "bac", 0, 3); + x3("\\g<_A>\\g<_A>|\\zEND(.a.)(?<_A>.b.)", "xbxyby", 3, 6, 1); + x2("\\A(?:\\g<pon>|\\g<pan>|\\zEND (?<pan>a|c\\g<pon>c)(?<pon>b|d\\g<pan>d))$", "cdcbcdc", 0, 7); + x2("\\A(?<n>|a\\g<m>)\\z|\\zEND (?<m>\\g<n>)", "aaaa", 0, 4); + x2("(?<n>(a|b\\g<n>c){3,5})", "baaaaca", 1, 5); + x2("(?<n>(a|b\\g<n>c){3,5})", "baaaacaaaaa", 0, 10); + x2("(?<pare>\\(([^\\(\\)]++|\\g<pare>)*+\\))", "((a))", 0, 5); + x2("()*\\1", "", 0, 0); + x2("(?:()|())*\\1\\2", "", 0, 0); + x3("(?:\\1a|())*", "a", 0, 0, 1); + x2("x((.)*)*x", "0x1x2x3", 1, 6); + x2("x((.)*)*x(?i:\\1)\\Z", "0x1x2x1X2", 1, 9); + x2("(?:()|()|()|()|()|())*\\2\\5", "", 0, 0); + x2("(?:()|()|()|(x)|()|())*\\2b\\5", "b", 0, 1); + if onig_encoding == onigmo.ONIG_ENCODING_UTF16_LE: + x2("\\xFA\\x8F", "\u8ffa", 0, 1); + elif onig_encoding == onigmo.ONIG_ENCODING_UTF16_BE: + x2("\\x8F\\xFA", "\u8ffa", 0, 1); + elif onig_encoding == onigmo.ONIG_ENCODING_UTF32_LE: + x2("\\xFA\\x8F\\x00\\x00", "\u8ffa", 0, 1); + elif onig_encoding == onigmo.ONIG_ENCODING_UTF32_BE: + x2("\\x00\\x00\\x8F\\xFA", "\u8ffa", 0, 1); + elif onig_encoding == onigmo.ONIG_ENCODING_UTF8: + x2("\\xE8\\xBF\\xBA", "\u8ffa", 0, 1); + elif onig_encoding == onigmo.ONIG_ENCODING_SJIS or \ + onig_encoding == onigmo.ONIG_ENCODING_CP932: + x2("\\xE7\\x92", "\u8ffa", 0, 1); + elif onig_encoding == onigmo.ONIG_ENCODING_EUC_JP: + x2("\\xED\\xF2", "\u8ffa", 0, 1); # "迺" + x2("", "あ", 0, 0); + x2("あ", "あ", 0, 1); + n("い", "あ"); + x2("うう", "うう", 0, 2); + x2("あいう", "あいう", 0, 3); + x2("こここここここここここここここここここここここここここここここここここ", "こここここここここここここここここここここここここここここここここここ", 0, 35); + x2("あ", "いあ", 1, 2); + x2("いう", "あいう", 1, 3); +# x2(b"\\xca\\xb8", b"\xca\xb8", 0, 2); # "文" + x2(".", "あ", 0, 1); + x2("..", "かき", 0, 2); + x2("\\w", "お", 0, 1); + n("\\W", "あ"); + x2("[\\W]", "う$", 1, 2); + x2("\\S", "そ", 0, 1); + x2("\\S", "漢", 0, 1); + x2("\\b", "気 ", 0, 0); + x2("\\b", " ほ", 1, 1); + x2("\\B", "せそ ", 1, 1); + x2("\\B", "う ", 2, 2); + x2("\\B", " い", 0, 0); + x2("[たち]", "ち", 0, 1); + n("[なに]", "ぬ"); + x2("[う-お]", "え", 0, 1); + n("[^け]", "け"); + x2("[\\w]", "ね", 0, 1); + n("[\\d]", "ふ"); + x2("[\\D]", "は", 0, 1); + n("[\\s]", "く"); + x2("[\\S]", "へ", 0, 1); + x2("[\\w\\d]", "よ", 0, 1); + x2("[\\w\\d]", " よ", 3, 4); + n("\\w鬼車", " 鬼車"); + x2("鬼\\W車", "鬼 車", 0, 3); + x2("あ.い.う", "ああいいう", 0, 5); + x2(".\\wう\\W..ぞ", "えうう うぞぞ", 0, 7); + x2("\\s\\wこここ", " ここここ", 0, 5); + x2("ああ.け", "ああけけ", 0, 4); + n(".い", "いえ"); + x2(".お", "おお", 0, 2); + x2("^あ", "あ", 0, 1); + x2("^む$", "む", 0, 1); + x2("^\\w$", "に", 0, 1); + x2("^\\wかきくけこ$", "zかきくけこ", 0, 6); + x2("^\\w...うえお$", "zあいううえお", 0, 7); + x2("\\w\\w\\s\\Wおおお\\d", "aお おおお4", 0, 8); + x2("\\Aたちつ", "たちつ", 0, 3); + x2("むめも\\Z", "むめも", 0, 3); + x2("かきく\\z", "かきく", 0, 3); + x2("かきく\\Z", "かきく\n", 0, 3); + x2("\\Gぽぴ", "ぽぴ", 0, 2); + n("\\Gえ", "うえお"); + n("とて\\G", "とて"); + n("まみ\\A", "まみ"); + n("ま\\Aみ", "まみ"); + x2("(?=せ)せ", "せ", 0, 1); + n("(?=う).", "い"); + x2("(?!う)か", "か", 0, 1); + n("(?!と)あ", "と"); + x2("(?i:あ)", "あ", 0, 1); + x2("(?i:ぶべ)", "ぶべ", 0, 2); + n("(?i:い)", "う"); + x2("(?m:よ.)", "よ\n", 0, 2); + x2("(?m:.め)", "ま\nめ", 1, 3); + x2("あ?", "", 0, 0); + x2("変?", "化", 0, 0); + x2("変?", "変", 0, 1); + x2("量*", "", 0, 0); + x2("量*", "量", 0, 1); + x2("子*", "子子子", 0, 3); + x2("馬*", "鹿馬馬馬馬", 0, 0); + n("山+", ""); + x2("河+", "河", 0, 1); + x2("時+", "時時時時", 0, 4); + x2("え+", "ええううう", 0, 2); + x2("う+", "おうううう", 1, 5); + x2(".?", "た", 0, 1); + x2(".*", "ぱぴぷぺ", 0, 4); + x2(".+", "ろ", 0, 1); + x2(".+", "いうえか\n", 0, 4); + x2("あ|い", "あ", 0, 1); + x2("あ|い", "い", 0, 1); + x2("あい|いう", "あい", 0, 2); + x2("あい|いう", "いう", 0, 2); + x2("を(?:かき|きく)", "をかき", 0, 3); + x2("を(?:かき|きく)け", "をきくけ", 0, 4); + x2("あい|(?:あう|あを)", "あを", 0, 2); + x2("あ|い|う", "えう", 1, 2); + x2("あ|い|うえ|おかき|く|けこさ|しすせ|そ|たち|つてとなに|ぬね", "しすせ", 0, 3); + n("あ|い|うえ|おかき|く|けこさ|しすせ|そ|たち|つてとなに|ぬね", "すせ"); + x2("あ|^わ", "ぶあ", 1, 2); + x2("あ|^を", "をあ", 0, 1); + x2("鬼|\\G車", "け車鬼", 2, 3); + x2("鬼|\\G車", "車鬼", 0, 1); + x2("鬼|\\A車", "b車鬼", 2, 3); + x2("鬼|\\A車", "車", 0, 1); + x2("鬼|車\\Z", "車鬼", 1, 2); + x2("鬼|車\\Z", "車", 0, 1); + x2("鬼|車\\Z", "車\n", 0, 1); + x2("鬼|車\\z", "車鬼", 1, 2); + x2("鬼|車\\z", "車", 0, 1); + x2("\\w|\\s", "お", 0, 1); + x2("\\w|%", "%お", 0, 1); + x2("\\w|[&$]", "う&", 0, 1); + x2("[い-け]", "う", 0, 1); + x2("[い-け]|[^か-こ]", "あ", 0, 1); + x2("[い-け]|[^か-こ]", "か", 0, 1); + x2("[^あ]", "\n", 0, 1); + x2("(?:あ|[う-き])|いを", "うを", 0, 1); + x2("(?:あ|[う-き])|いを", "いを", 0, 2); + x2("あいう|(?=けけ)..ほ", "けけほ", 0, 3); + x2("あいう|(?!けけ)..ほ", "あいほ", 0, 3); + x2("(?=をあ)..あ|(?=をを)..あ", "ををあ", 0, 3); + x2("(?<=あ|いう)い", "いうい", 2, 3); + n("(?>あ|あいえ)う", "あいえう"); + x2("(?>あいえ|あ)う", "あいえう", 0, 4); + x2("あ?|い", "あ", 0, 1); + x2("あ?|い", "い", 0, 0); + x2("あ?|い", "", 0, 0); + x2("あ*|い", "ああ", 0, 2); + x2("あ*|い*", "いあ", 0, 0); + x2("あ*|い*", "あい", 0, 1); + x2("[aあ]*|い*", "aあいいい", 0, 2); + x2("あ+|い*", "", 0, 0); + x2("あ+|い*", "いいい", 0, 3); + x2("あ+|い*", "あいいい", 0, 1); + x2("あ+|い*", "aあいいい", 0, 0); + n("あ+|い+", ""); + x2("(あ|い)?", "い", 0, 1); + x2("(あ|い)*", "いあ", 0, 2); + x2("(あ|い)+", "いあい", 0, 3); + x2("(あい|うあ)+", "うああいうえ", 0, 4); + x2("(あい|うえ)+", "うああいうえ", 2, 6); + x2("(あい|うあ)+", "ああいうあ", 1, 5); + x2("(あい|うあ)+", "あいをうあ", 0, 2); + x2("(あい|うあ)+", "$$zzzzあいをうあ", 6, 8); + x2("(あ|いあい)+", "あいあいあ", 0, 5); + x2("(あ|いあい)+", "いあ", 1, 2); + x2("(あ|いあい)+", "いあああいあ", 1, 4); + x2("(?:あ|い)(?:あ|い)", "あい", 0, 2); + x2("(?:あ*|い*)(?:あ*|い*)", "あああいいい", 0, 3); + x2("(?:あ*|い*)(?:あ+|い+)", "あああいいい", 0, 6); + x2("(?:あ+|い+){2}", "あああいいい", 0, 6); + x2("(?:あ+|い+){1,2}", "あああいいい", 0, 6); + x2("(?:あ+|\\Aい*)うう", "うう", 0, 2); + n("(?:あ+|\\Aい*)うう", "あいうう"); + x2("(?:^あ+|い+)*う", "ああいいいあいう", 6, 8); + x2("(?:^あ+|い+)*う", "ああいいいいう", 0, 7); + x2("う{0,}", "うううう", 0, 4); + x2("あ|(?i)c", "C", 0, 1); + x2("(?i)c|あ", "C", 0, 1); + x2("(?i:あ)|a", "a", 0, 1); + n("(?i:あ)|a", "A"); + x2("[あいう]?", "あいう", 0, 1); + x2("[あいう]*", "あいう", 0, 3); + x2("[^あいう]*", "あいう", 0, 0); + n("[^あいう]+", "あいう"); + x2("あ??", "あああ", 0, 0); + x2("いあ??い", "いあい", 0, 3); + x2("あ*?", "あああ", 0, 0); + x2("いあ*?", "いああ", 0, 1); + x2("いあ*?い", "いああい", 0, 4); + x2("あ+?", "あああ", 0, 1); + x2("いあ+?", "いああ", 0, 2); + x2("いあ+?い", "いああい", 0, 4); + x2("(?:天?)??", "天", 0, 0); + x2("(?:天??)?", "天", 0, 0); + x2("(?:夢?)+?", "夢夢夢", 0, 1); + x2("(?:風+)??", "風風風", 0, 0); + x2("(?:雪+)??霜", "雪雪雪霜", 0, 4); + x2("(?:あい)?{2}", "", 0, 0); + x2("(?:鬼車)?{2}", "鬼車鬼車鬼", 0, 4); + x2("(?:鬼車)*{0}", "鬼車鬼車鬼", 0, 0); + x2("(?:鬼車){3,}", "鬼車鬼車鬼車鬼車", 0, 8); + n("(?:鬼車){3,}", "鬼車鬼車"); + x2("(?:鬼車){2,4}", "鬼車鬼車鬼車", 0, 6); + x2("(?:鬼車){2,4}", "鬼車鬼車鬼車鬼車鬼車", 0, 8); + x2("(?:鬼車){2,4}?", "鬼車鬼車鬼車鬼車鬼車", 0, 4); + x2("(?:鬼車){,}", "鬼車{,}", 0, 5); + x2("(?:かきく)+?{2}", "かきくかきくかきく", 0, 6); + x3("(火)", "火", 0, 1, 1); + x3("(火水)", "火水", 0, 2, 1); + x2("((時間))", "時間", 0, 2); + x3("((風水))", "風水", 0, 2, 1); + x3("((昨日))", "昨日", 0, 2, 2); + x3("((((((((((((((((((((量子))))))))))))))))))))", "量子", 0, 2, 20); + x3("(あい)(うえ)", "あいうえ", 0, 2, 1); + x3("(あい)(うえ)", "あいうえ", 2, 4, 2); + x3("()(あ)いう(えおか)きくけこ", "あいうえおかきくけこ", 3, 6, 3); + x3("(()(あ)いう(えおか)きくけこ)", "あいうえおかきくけこ", 3, 6, 4); + x3(".*(フォ)ン・マ(ン()シュタ)イン", "フォン・マンシュタイン", 5, 9, 2); + x2("(^あ)", "あ", 0, 1); + x3("(あ)|(あ)", "いあ", 1, 2, 1); + x3("(^あ)|(あ)", "いあ", 1, 2, 2); + x3("(あ?)", "あああ", 0, 1, 1); + x3("(ま*)", "ままま", 0, 3, 1); + x3("(と*)", "", 0, 0, 1); + x3("(る+)", "るるるるるるる", 0, 7, 1); + x3("(ふ+|へ*)", "ふふふへへ", 0, 3, 1); + x3("(あ+|い?)", "いいいああ", 0, 1, 1); + x3("(あいう)?", "あいう", 0, 3, 1); + x3("(あいう)*", "あいう", 0, 3, 1); + x3("(あいう)+", "あいう", 0, 3, 1); + x3("(さしす|あいう)+", "あいう", 0, 3, 1); + x3("([なにぬ][かきく]|かきく)+", "かきく", 0, 3, 1); + x3("((?i:あいう))", "あいう", 0, 3, 1); + x3("((?m:あ.う))", "あ\nう", 0, 3, 1); + x3("((?=あん)あ)", "あんい", 0, 1, 1); + x3("あいう|(.あいえ)", "んあいえ", 0, 4, 1); + x3("あ*(.)", "ああああん", 4, 5, 1); + x3("あ*?(.)", "ああああん", 0, 1, 1); + x3("あ*?(ん)", "ああああん", 4, 5, 1); + x3("[いうえ]あ*(.)", "えああああん", 5, 6, 1); + x3("(\\Aいい)うう", "いいうう", 0, 2, 1); + n("(\\Aいい)うう", "んいいうう"); + x3("(^いい)うう", "いいうう", 0, 2, 1); + n("(^いい)うう", "んいいうう"); + x3("ろろ(るる$)", "ろろるる", 2, 4, 1); + n("ろろ(るる$)", "ろろるるる"); + x2("(無)\\1", "無無", 0, 2); + n("(無)\\1", "無武"); + x2("(空?)\\1", "空空", 0, 2); + x2("(空??)\\1", "空空", 0, 0); + x2("(空*)\\1", "空空空空空", 0, 4); + x3("(空*)\\1", "空空空空空", 0, 2, 1); + x2("あ(い*)\\1", "あいいいい", 0, 5); + x2("あ(い*)\\1", "あい", 0, 1); + x2("(あ*)(い*)\\1\\2", "あああいいあああいい", 0, 10); + x2("(あ*)(い*)\\2", "あああいいいい", 0, 7); + x3("(あ*)(い*)\\2", "あああいいいい", 3, 5, 2); + x2("(((((((ぽ*)ぺ))))))ぴ\\7", "ぽぽぽぺぴぽぽぽ", 0, 8); + x3("(((((((ぽ*)ぺ))))))ぴ\\7", "ぽぽぽぺぴぽぽぽ", 0, 3, 7); + x2("(は)(ひ)(ふ)\\2\\1\\3", "はひふひはふ", 0, 6); + x2("([き-け])\\1", "くく", 0, 2); + x2("(\\w\\d\\s)\\1", "あ5 あ5 ", 0, 6); + n("(\\w\\d\\s)\\1", "あ5 あ5"); + x2("(誰?|[あ-う]{3})\\1", "誰?誰?", 0, 4); + x2("...(誰?|[あ-う]{3})\\1", "あaあ誰?誰?", 0, 7); + x2("(誰?|[あ-う]{3})\\1", "ういうういう", 0, 6); + x2("(^こ)\\1", "ここ", 0, 2); + n("(^む)\\1", "めむむ"); + n("(あ$)\\1", "ああ"); + n("(あい\\Z)\\1", "あい"); + x2("(あ*\\Z)\\1", "あ", 1, 1); + x2(".(あ*\\Z)\\1", "いあ", 1, 2); + x3("(.(やいゆ)\\2)", "zやいゆやいゆ", 0, 7, 1); + x3("(.(..\\d.)\\2)", "あ12341234", 0, 9, 1); + x2("((?i:あvず))\\1", "あvずあvず", 0, 6); + x2("(?<愚か>変|\\(\\g<愚か>\\))", "((((((変))))))", 0, 13); + x2("\\A(?:\\g<阿_1>|\\g<云_2>|\\z終了 (?<阿_1>観|自\\g<云_2>自)(?<云_2>在|菩薩\\g<阿_1>菩薩))$", "菩薩自菩薩自在自菩薩自菩薩", 0, 13); + x2("[[ひふ]]", "ふ", 0, 1); + x2("[[いおう]か]", "か", 0, 1); + n("[[^あ]]", "あ"); + n("[^[あ]]", "あ"); + x2("[^[^あ]]", "あ", 0, 1); + x2("[[かきく]&&きく]", "く", 0, 1); + n("[[かきく]&&きく]", "か"); + n("[[かきく]&&きく]", "け"); + x2("[あ-ん&&い-を&&う-ゑ]", "ゑ", 0, 1); + n("[^あ-ん&&い-を&&う-ゑ]", "ゑ"); + x2("[[^あ&&あ]&&あ-ん]", "い", 0, 1); + n("[[^あ&&あ]&&あ-ん]", "あ"); + x2("[[^あ-ん&&いうえお]&&[^う-か]]", "き", 0, 1); + n("[[^あ-ん&&いうえお]&&[^う-か]]", "い"); + x2("[^[^あいう]&&[^うえお]]", "う", 0, 1); + x2("[^[^あいう]&&[^うえお]]", "え", 0, 1); + n("[^[^あいう]&&[^うえお]]", "か"); + x2("[あ-&&-あ]", "-", 0, 1); + x2("[^[^a-zあいう]&&[^bcdefgうえお]q-w]", "え", 0, 1); + x2("[^[^a-zあいう]&&[^bcdefgうえお]g-w]", "f", 0, 1); + x2("[^[^a-zあいう]&&[^bcdefgうえお]g-w]", "g", 0, 1); + n("[^[^a-zあいう]&&[^bcdefgうえお]g-w]", "2"); + x2("a<b>バージョンのダウンロード<\\/b>", "a<b>バージョンのダウンロード</b>", 0, 20); + x2(".<b>バージョンのダウンロード<\\/b>", "a<b>バージョンのダウンロード</b>", 0, 20); + + + # additional test patterns + if is_unicode_encoding(onig_encoding): + x2("\\x{3042}\\x{3044}", "あい", 0, 2) + elif onig_encoding == onigmo.ONIG_ENCODING_SJIS or \ + onig_encoding == onigmo.ONIG_ENCODING_CP932: + x2("\\x{82a0}\\x{82A2}", "あい", 0, 2) + x2("\\M-\\C-b\x50", "1", 0, 1) # \x8250 + elif onig_encoding == onigmo.ONIG_ENCODING_EUC_JP: + x2("\\x{a4a2}\\x{A4A4}", "あい", 0, 2) + x2("\\p{Hiragana}\\p{Katakana}", "あイ", 0, 2) + x2("(?m)^A.B$", "X\nA\nB\nZ", 2, 5) + n("(?<!(?<=a)b|c)d", "abd") + n("(?<!(?<=a)b|c)d", "cd") + x2("(?<!(?<=a)b|c)d", "bd", 1, 2) + x2("(a){2}z", "aaz", 0, 3) + x2("(?<=a).*b", "aab", 1, 3) + x2("(?!a).*b", "ab", 1, 2) + x2("(?<=(?<!A)B)C", "BBC", 2, 3) + n("(?<=(?<!A)B)C", "ABC") + n("(?i)(?<!aa|b)c", "Aac") + n("(?i)(?<!b|aa)c", "Aac") + x2("(?<=\\babc)d", " abcd", 4, 5) + x2("(?<=\\Babc)d", "aabcd", 4, 5) + x2("a\\b?a", "aa", 0, 2) + x2("[^x]*x", "aaax", 0, 4) + x2("(?i)[\\x{0}-B]+", "\x00\x01\x02\x1f\x20@AaBbC", 0, 10) + x2("(?i)a{2}", "AA", 0, 2) + if is_unicode_encoding(onig_encoding): + # The longest script name + x2("\\p{Other_Default_Ignorable_Code_Point}+", "\u034F\uFFF8\U000E0FFF", 0, 3) + # The longest block name + x2("\\p{In_Unified_Canadian_Aboriginal_Syllabics_Extended}+", "\u18B0\u18FF", 0, 2) + # Unicode case fold + x2("(?i)\u1ffc", "\u2126\u1fbe", 0, 2) + x2("(?i)\u1ffc", "\u1ff3", 0, 1) + x2("(?i)\u0390", "\u03b9\u0308\u0301", 0, 3) + x2("(?i)\u03b9\u0308\u0301", "\u0390", 0, 1) + x2("(?i)ff", "\ufb00", 0, 1) + x2("(?i)\ufb01", "fi", 0, 2) + x2("(?i)\u0149\u0149", "\u0149\u0149", 0, 2) + x2("(?i)(?<=\u0149)a", "\u02bcna", 2, 3) # with look-behind + # Other Unicode tests + x2("\\x{25771}", "\U00025771", 0, 1) + x2("[0-9-a]+", " 0123456789-a ", 1, 13) # same as [0-9\-a] + x2("[0-9-\\s]+", " 0123456789-a ", 0, 12) # same as [0-9\-\s] + n("[0-9-a]", "", syn=onigmo.ONIG_SYNTAX_GREP, err=onigmo.ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS) + x2("[0-9-あ\\\\/\u0001]+", " 0123456789-あ\\/\u0001 ", 1, 16) + x2("[a-b-]+", "ab-", 0, 3) + x2("[a-b-&&-]+", "ab-", 2, 3) + x2("(?i)[a[b-あ]]+", "abあ", 0, 3) + if is_unicode_encoding(onig_encoding): + x2("(?i)[\\d[:^graph:]]+", "0あ", 0, 1) + x2("(?ia)[\\d[:^print:]]+", "0あ", 0, 2) + x2("(?i:a) B", "a B", 0, 3); + x2("(?i:a )B", "a B", 0, 3); + x2("B (?i:a)", "B a", 0, 3); + x2("B(?i: a)", "B a", 0, 3); + if is_unicode_encoding(onig_encoding): + x2("(?a)[\\p{Space}\\d]", "\u00a0", 0, 1) + x2("(?a)[\\d\\p{Space}]", "\u00a0", 0, 1) + n("(?a)[^\\p{Space}\\d]", "\u00a0") + n("(?a)[^\\d\\p{Space}]", "\u00a0") + x2("(?d)[[:space:]\\d]", "\u00a0", 0, 1) + n("(?d)[^\\d[:space:]]", "\u00a0") + n("x.*?\\Z$", "x\ny") + n("x.*?\\Z$", "x\r\ny") + x2("x.*?\\Z$", "x\n", 0, 1) + x2("x.*?\\Z$", "x\r\n", 0, 2) # \Z will match between \r and \n, if + # ONIG_OPTION_NEWLINE_CRLF isn't specified. + x2("(?<=fo).*", "foo", 2, 3) # Issue #15 + x2("(?m)(?<=fo).*", "foo", 2, 3) # Issue #15 + x2("(?m)(?<=fo).+", "foo", 2, 3) # Issue #15 + x2("\\n?\\z", "hello", 5, 5) + x2("\\z", "hello", 5, 5) + x2("\\n?\\z", "こんにちは", 5, 5) + x2("\\z", "こんにちは", 5, 5) + x2("()" * 32767, "", 0, 0) # Issue #24 + n("()" * 32768, "", err=onigmo.ONIGERR_TOO_MANY_CAPTURE_GROUPS) + x2("\\h+ \\H+", " 0123456789aBcDeF gh", 1, 20) + x2("[\\h]+ [\\H]+", " 0123456789aBcDeF gh", 1, 20) + x2("\\A(|.|(?:(.)\\g<1>\\k<2+0>))\\z", "reer", 0, 4) + x2("\\A(?<a>|.|(?:(?<b>.)\\g<a>\\k<b+0>))\\z", "reer", 0, 4) + x2("(?i)\\A(|.|(?:(.)\\g<1>\\k<2+0>))\\z", "reER", 0, 4) + x2("(?i)\\A(?<a>|.|(?:(?<b>.)\\g<a>\\k<b+0>))\\z", "REer", 0, 4) + x2(''' # Extended pattern + (?<element> \g<stag> \g<content>* \g<etag> ){0} + (?<stag> < \g<name> \s* > ){0} + (?<name> [a-zA-Z_:]+ ){0} + (?<content> [^<&]+ (\g<element> | [^<&]+)* ){0} + (?<etag> </ \k<name+1> >){0} + \g<element>''', + "<foo>f<bar>bbb</bar>f</foo>", 0, 27, opt=onigmo.ONIG_OPTION_EXTEND) + x2("(.)(?<a>a)(?<a>b)\\k<a>", "xaba", 0, 4) + x2("\\p{Print}+", "\n a", 1, 3) + x2("\\p{Graph}+", "\n a", 2, 3) + n("a(?!b)", "ab"); + x2("(?:(.)\\1)*", "a" * 300, 0, 300) + x2("\\cA\\C-B\\a[\\b]\\t\\n\\v\\f\\r\\e\\c?", "\x01\x02\x07\x08\x09\x0a\x0b\x0c\x0d\x1b\x7f", 0, 11) + x2("(?<=(?:[a-z]|\\w){3})x", "ab1x", 3, 4) # repeat inside look-behind + x2("(?<n>(a|b\\g<n>c){3,5}?)", "baaaaca", 1, 4) + x2("\\p{WoRd}", "a", 0, 1) # property name is not case sensitive + n("[[:WoRd:]]", "a", err=onigmo.ONIGERR_INVALID_POSIX_BRACKET_TYPE) # POSIX bracket name is case sensitive + n("(\\2)(\\1)", "") # Issue #65 + n("(0?0|(?(1)||)|(?(1)||))?", "", err=onigmo.ONIGERR_INVALID_CONDITION_PATTERN) # Ruby Bug#12418 + n("[\\40000000000", "", err=onigmo.ONIGERR_TOO_BIG_NUMBER) # Ruby Bug#12420 + n("[\\600000000000\n", "", err=onigmo.ONIGERR_TOO_BIG_NUMBER) # Ruby Bug#12423 + n("[]", "", err=onigmo.ONIGERR_EMPTY_CHAR_CLASS) + n("[c-a]", "", err=onigmo.ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS) + x2("[[:ab:\\x{30}]]+", ":ab0x", 0, 4) + x2("[[:x\\]:]+", "[x:]", 0, 4) + x2("[!--x]+", "!-x", 0, 3) + x2(" ]", " ]", 0, 2) # warning: ']' without escape + n("\\x{FFFFFFFF}", "", err=onigmo.ONIGERR_TOO_BIG_WIDE_CHAR_VALUE); + n("\\x{100000000}", "", err=onigmo.ONIGERR_TOO_LONG_WIDE_CHAR_VALUE); + x2("\\u0026", "\u0026", 0, 1) + x2("[\\u0024-\\u0027]", "\u0026", 0, 1) + n("\\u026x", "", err=onigmo.ONIGERR_TOO_SHORT_DIGITS) + n("()(?\\!(?'a')\\1)", "", err=onigmo.ONIGERR_UNDEFINED_GROUP_OPTION) + x2("\\i", "i", 0, 1) # unknown escape warning + n("\\((", "", err=onigmo.ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS) + n("(|", "", err=onigmo.ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS) + x2("%{(.*?)}", "%{HOSTNAME}", 0, 11) + if not is_ascii_incompatible_encoding(onig_encoding): + n(b"'/g\\\xff\xff\xff\xff&))", "", err=onigmo.ONIGERR_UNMATCHED_CLOSE_PARENTHESIS) + n(b"\\\xff0", "") + if onig_encoding == onigmo.ONIG_ENCODING_UTF8: + n(b"[0-0-\xe2 ", "", err=onigmo.ONIGERR_PREMATURE_END_OF_CHAR_CLASS) + n("\\p{foobarbaz}", "", err=onigmo.ONIGERR_INVALID_CHAR_PROPERTY_NAME) + n("\\p{あ}", "", err=onigmo.ONIGERR_INVALID_CHAR_PROPERTY_NAME) + if is_unicode_encoding(onig_encoding): + n("\\p{\U00025771}", "", err=onigmo.ONIGERR_INVALID_CHAR_PROPERTY_NAME) + if onig_encoding == onigmo.ONIG_ENCODING_UTF8: + x2("[\\xce\\xb1\\xce\\xb2]", "β", 0, 1) + elif onig_encoding == onigmo.ONIG_ENCODING_SJIS or \ + onig_encoding == onigmo.ONIG_ENCODING_CP932: + n("[\\x84A]", "", err=onigmo.ONIGERR_TOO_SHORT_MULTI_BYTE_STRING) + elif onig_encoding == onigmo.ONIG_ENCODING_EUC_JP: + n("[\\xAAA]", "", err=onigmo.ONIGERR_TOO_SHORT_MULTI_BYTE_STRING) + elif is_ascii_incompatible_encoding(onig_encoding): + n("[\\x420]", "", err=onigmo.ONIGERR_TOO_SHORT_MULTI_BYTE_STRING) + x2("(?:a?)*", "aa", 0, 2) # tests for reducing nested quantifiers + x2("(?:a?)*?", "aa", 0, 0) + x2("(?:a*)??", "aa", 0, 0) + x2("(?:a+?)*", "aa", 0, 1) + x2("(?:a*){2,3}", "aaa", 0, 3) + n("(?:a+){2,3}", "a") + x2("a{", "a{", 0, 2) # invalid interval is allowed + n("a{100001}", "", err=onigmo.ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE) + n("a{0,100001}", "", err=onigmo.ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE) + n("a{5,1}", "", err=onigmo.ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE) + x2("abc{1}", "abcc", 0, 3) + x3("\\(((?:[^(]|\\g<0>)*)\\)", "(abc)(abc)", 1, 4, 1) # Issue #48 + x3("\\(((?:[^(]|\\g<0>)*)\\)", "((abc)(abc))", 1, 11, 1) + x3("\\(((?:[^(]|(\\g<0>))*)\\)", "((abc)(abc))", 6, 11, 2) + + # ONIG_OPTION_FIND_LONGEST option + x2("foo|foobar", "foobar", 0, 3) + x2("foo|foobar", "foobar", 0, 6, opt=onigmo.ONIG_OPTION_FIND_LONGEST) + x2("a*", "aa aaa aaaa aaaaa ", 12, 17, opt=onigmo.ONIG_OPTION_FIND_LONGEST) + + # ONIG_OPTION_FIND_NOT_EMPTY option + x2("\w*", " a", 0, 0) + x2("\w*", " a", 1, 2, opt=onigmo.ONIG_OPTION_FIND_NOT_EMPTY) + + # ONIG_OPTION_DONT_CAPTURE_GROUP option + x2("(ab|cd)*", "cdab", 0, 4, opt=onigmo.ONIG_OPTION_DONT_CAPTURE_GROUP) + n("(ab|cd)*\\1", "", opt=onigmo.ONIG_OPTION_DONT_CAPTURE_GROUP, err=onigmo.ONIGERR_INVALID_BACKREF) + + # character classes (tests for character class optimization) + x2("[@][a]", "@a", 0, 2); + x2(".*[a][b][c][d][e]", "abcde", 0, 5); + x2("(?i)[A\\x{41}]", "a", 0, 1); + x2("[abA]", "a", 0, 1); + x2("[[ab]&&[ac]]+", "aaa", 0, 3); + x2("[[ab]&&[^b]]+", "aaa", 0, 3); + x2("[[^b]&&[ab]]+", "aaa", 0, 3); + x2("[[あい]&&[あう]]+", "あああ", 0, 3); + x2("[[あい]&&[^い]]+", "あああ", 0, 3); + x2("[[^い]&&[あい]]+", "あああ", 0, 3); + + # possessive quantifiers + n("a?+a", "a") + n("a*+a", "aaaa") + n("a++a", "aaaa") + x2("a{2,3}+a", "aaa", 0, 3) # Not a possessive quantifier in Ruby, + # same as "(?:a{2,3})+a" + n("a{2,3}+a", "aaa", syn=onigmo.ONIG_SYNTAX_PERL) + + # automatic possessification + x2("\\w+\\W", "abc#", 0, 4) + x2("[a-c]+\\W", "abc#", 0, 4) + x2("[a-c#]+\\W", "abc#", 0, 4) + x2("[^a-c]+\\W", "def#", 0, 4) + x2("(?a)[^a-c]+\\W", "def#", 0, 4) + x2("a+\\w", "aaaa", 0, 4) + x2("#+\\w", "###a", 0, 4) + x2("(?a)a+\\w", "aaaa", 0, 4) + x2("(?a)あ+\\w", "あああa", 0, 4) + x2("[a-c]+[d-f]", "abcd", 0, 4) + x2("[^d-f]+[d-f]", "abcd", 0, 4) + x2("[a-cあ]+[d-f]", "abcd", 0, 4) + + # linebreak + x2("\\R", "\n", 0, 1) + x2("\\R", "\r", 0, 1) + x2("\\R{3}", "\r\r\n\n", 0, 4) + + if (is_unicode_encoding(onig_encoding)): + x2("\\R", "\u0085", 0, 1) + x2("\\R", "\u2028", 0, 1) + x2("\\R", "\u2029", 0, 1) + + # extended grapheme cluster + x2("\\X{5}", "あいab\n", 0, 5) + x2("\\X", "\n", 0, 1) + x2("\\X", "\r", 0, 1) + x2("\\X{3}", "\r\r\n\n", 0, 4) + if is_unicode_encoding(onig_encoding): + x2("\\X", "\u306F\u309A\n", 0, 2) + x2("\\A\\X\\z", "\u0020\u200d", 0, 2) + x2("\\A\\X\\z", "\u0600\u0600", 0, 2) + x2("\\A\\X\\z", "\u0600\u0020", 0, 2) + x2("\\A\\X\\z", "\u261d\U0001F3FB", 0, 2) + x2("\\A\\X\\z", "\U0001f600", 0, 1) + x2("\\A\\X\\z", "\u0020\u0308", 0, 2) + x2("\\A\\X\\X\\z", "\u000a\u0308", 0, 2) + x2("\\A\\X\\X\\z", "\u000d\u0308", 0, 2) + x2("\\A\\X\\z", "\U0001F477\U0001F3FF\u200D\u2640\uFE0F", 0, 5) + x2("\\A\\X\\z", "\U0001F468\u200D\U0001F393", 0, 3) + x2("\\A\\X\\z", "\U0001F46F\u200D\u2642\uFE0F", 0, 4) + x2("\\A\\X\\z", "\U0001F469\u200d\u2764\ufe0f\u200d\U0001F469", 0, 6) + + # keep + x2("ab\\Kcd", "abcd", 2, 4) + x2("ab\\Kc(\\Kd|z)", "abcd", 3, 4) + x2("ab\\Kc(\\Kz|d)", "abcd", 2, 4) + x2("(a\\K)*", "aaab", 3, 3) + x3("(a\\K)*", "aaab", 2, 3, 1) +# x2("a\\K?a", "aa", 0, 2) # error: differ from perl + x2("ab(?=c\Kd)", "abcd", 2, 2) # This behaviour is currently not well defined. (see: perlre) + x2("(?<=a\\Kb|aa)cd", "abcd", 1, 4) # This behaviour is currently not well defined. (see: perlre) + x2("(?<=ab|a\\Ka)cd", "abcd", 2, 4) # This behaviour is currently not well defined. (see: perlre) + + # named group and subroutine call + x2("(?<name_2>ab)(?&name_2)", "abab", 0, 4, syn=onigmo.ONIG_SYNTAX_PERL); + x2("(?<name_2>ab)(?1)", "abab", 0, 4, syn=onigmo.ONIG_SYNTAX_PERL); + x2("(?'n'|\\((?&n)\\))+$", "()(())", 0, 6, syn=onigmo.ONIG_SYNTAX_PERL); + x2("(a|x(?-1)x)", "xax", 0, 3, syn=onigmo.ONIG_SYNTAX_PERL); + x2("(a|(x(?-2)x))", "xax", 0, 3, syn=onigmo.ONIG_SYNTAX_PERL); + x2("a|x(?0)x", "xax", 0, 3, syn=onigmo.ONIG_SYNTAX_PERL); + x2("a|x(?R)x", "xax", 0, 3, syn=onigmo.ONIG_SYNTAX_PERL); + x2("(a|x\g<0>x)", "xax", 0, 3); + x2("(a|x\g'0'x)", "xax", 0, 3); + x2("(?-i:(?+1))(?i:(a)){0}", "A", 0, 1, syn=onigmo.ONIG_SYNTAX_PERL); + x2("(?-i:\g<+1>)(?i:(a)){0}", "A", 0, 1); + x2("(?-i:\g'+1')(?i:(a)){0}", "A", 0, 1); + n("(.(?=\\g<1>))", "", err=onigmo.ONIGERR_NEVER_ENDING_RECURSION) + n("(a)(?<n>b)\\g<1>\\g<n>", "abab", err=onigmo.ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED) + x2("(a)(?<n>b)(?1)(?&n)", "abab", 0, 4, syn=onigmo.ONIG_SYNTAX_PERL) + x2("((?<v>)a)|b\\g<0>b", "bbabb", 0, 5) + x2("((?<v>)a)|b(?0)b", "bbabb", 0, 5, syn=onigmo.ONIG_SYNTAX_PERL) + x2("((?<v>)a|b(?1)b)", "bbabb", 0, 5, syn=onigmo.ONIG_SYNTAX_PERL) + x2("((?<v>a|b(?&v)b))", "bbabb", 0, 5, syn=onigmo.ONIG_SYNTAX_PERL) + n("(?<", "", err=onigmo.ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS) + n("(?<>)", "", err=onigmo.ONIGERR_EMPTY_GROUP_NAME) + n("(?<.>)", "", err=onigmo.ONIGERR_INVALID_CHAR_IN_GROUP_NAME) + n("\\g<1->", "", err=onigmo.ONIGERR_INVALID_CHAR_IN_GROUP_NAME) + n("\\k<1/>", "", err=onigmo.ONIGERR_INVALID_GROUP_NAME) + n("\\k<1-1/>", "", err=onigmo.ONIGERR_INVALID_GROUP_NAME) + n("\\k<a/>", "", err=onigmo.ONIGERR_INVALID_CHAR_IN_GROUP_NAME) + + # character set modifiers + x2("(?u)\\w+", "あa#", 0, 2); + x2("(?a)\\w+", "あa#", 1, 2); + x2("(?u)\\W+", "あa#", 2, 3); + x2("(?a)\\W+", "あa#", 0, 1); + + x2("(?a)\\b", "あa", 1, 1); + x2("(?a)\\w\\b", "aあ", 0, 1); + x2("(?a)\\B", "a ああ ", 2, 2); + + x2("(?u)\\B", "あ ", 2, 2); + x2("(?a)\\B", "あ ", 0, 0); + x2("(?a)\\B", "aあ ", 2, 2); + + x2("(?a)a\\b", " a", 1, 2) + x2("(?u)a\\b", " a", 1, 2) + n("(?a)a\\B", " a") + n("(?a)あ\\b", " あ") + x2("(?u)あ\\b", " あ", 1, 2) + x2("(?a)あ\\B", " あ", 1, 2) + n("(?u)あ\\B", " あ") + + x2("(?a)\\p{Alpha}\\P{Alpha}", "a。", 0, 2); + x2("(?u)\\p{Alpha}\\P{Alpha}", "a。", 0, 2); + x2("(?a)[[:word:]]+", "aあ", 0, 1); + x2("(?a)[[:^word:]]+", "aあ", 1, 2); + x2("(?u)[[:word:]]+", "aあ", 0, 2); + n("(?u)[[:^word:]]+", "aあ"); + + x2("(?iu)\\p{lower}\\p{upper}", "Ab", 0, 2); + x2("(?ia)\\p{lower}\\p{upper}", "Ab", 0, 2); + x2("(?iu)[[:lower:]][[:upper:]]", "Ab", 0, 2); + x2("(?ia)[[:lower:]][[:upper:]]", "Ab", 0, 2); + + if is_unicode_encoding(onig_encoding): + n("(?ia)\\w+", "\u212a\u017f"); # KELVIN SIGN, LATIN SMALL LETTER LONG S + n("(?ia)[\\w]+", "\u212a\u017f"); + n("(?ia)[^\\W]+", "\u212a\u017f"); + x2("(?ia)[^\\W]+", "ks", 0, 2); + n("(?iu)\\p{ASCII}", "\u212a"); + n("(?iu)\\P{ASCII}", "s"); + n("(?iu)[\\p{ASCII}]", "\u212a"); + n("(?iu)[\\P{ASCII}]", "s"); + n("(?ia)\\p{ASCII}", "\u212a"); + n("(?ia)\\P{ASCII}", "s"); + n("(?ia)[\\p{ASCII}]", "\u212a"); + n("(?ia)[\\P{ASCII}]", "s"); + x2("(?iu)[s]+", "Ss\u017f ", 0, 3); + x2("(?ia)[s]+", "Ss\u017f ", 0, 3); + x2("(?iu)[^s]+", "Ss\u017f ", 3, 4); + x2("(?ia)[^s]+", "Ss\u017f ", 3, 4); + x2("(?iu)[[:lower:]]", "\u017f", 0, 1); + n("(?ia)[[:lower:]]", "\u017f"); + x2("(?u)[[:upper:]]", "\u212a", 0, 1); + n("(?a)[[:upper:]]", "\u212a"); + + # Grep syntax + # \+, \?, \|, \{n,m\} + x2("a\\+", "aa", 0, 2, syn=onigmo.ONIG_SYNTAX_GREP) + n("a\\+", "b", syn=onigmo.ONIG_SYNTAX_GREP) + x2("a\\?", "", 0, 0, syn=onigmo.ONIG_SYNTAX_GREP) + x2("a\\?", "a", 0, 1, syn=onigmo.ONIG_SYNTAX_GREP) + x2("ab\\|cd", "cd", 0, 2, syn=onigmo.ONIG_SYNTAX_GREP) + x2("a\\{1,2\\}", "aaa", 0, 2, syn=onigmo.ONIG_SYNTAX_GREP) + x2("a\\{2\\}", "aaa", 0, 2, syn=onigmo.ONIG_SYNTAX_GREP) + n("a\\{|", "", syn=onigmo.ONIG_SYNTAX_GREP, err=onigmo.ONIGERR_END_PATTERN_AT_LEFT_BRACE) + # \< and \> + x2("\\<abc\\>", " abc ", 1, 4, syn=onigmo.ONIG_SYNTAX_GREP) + n("\\<abc\\>", "zabc ", syn=onigmo.ONIG_SYNTAX_GREP) + n("\\<abc\\>", " abcd", syn=onigmo.ONIG_SYNTAX_GREP) + n("\\<abc\\>", "あabcい", syn=onigmo.ONIG_SYNTAX_GREP) + x2("\\<abc\\>", "あabcい", 1, 4, syn=onigmo.ONIG_SYNTAX_GREP, opt=onigmo.ONIG_OPTION_ASCII_RANGE) + n("\\<abc\\>", "zabcい", syn=onigmo.ONIG_SYNTAX_GREP, opt=onigmo.ONIG_OPTION_ASCII_RANGE) + n("\\<abc\\>", "あabcd", syn=onigmo.ONIG_SYNTAX_GREP, opt=onigmo.ONIG_OPTION_ASCII_RANGE) + # others + n("[^a]", "\n", syn=onigmo.ONIG_SYNTAX_GREP) + x2("*", "*", 0, 1, syn=onigmo.ONIG_SYNTAX_GREP) + #x2("\\{1\\}", "{1}", 0, 3, syn.onigmo.ONIG_SYNTAX_GREP) # fails + n("*", "", err=onigmo.ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED) + n("{1}", "", err=onigmo.ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED) + + # \g{} backref + x2("((?<name1>\\d)|(?<name2>\\w))(\\g{name1}|\\g{name2})", "ff", 0, 2, syn=onigmo.ONIG_SYNTAX_PERL); + x2("(?:(?<x>)|(?<x>efg))\\g{x}", "", 0, 0, syn=onigmo.ONIG_SYNTAX_PERL); + x2("(?:(?<x>abc)|(?<x>efg))\\g{x}", "efgabcabc", 3, 9, syn=onigmo.ONIG_SYNTAX_PERL); + n("(?:(?<x>abc)|(?<x>efg))\\g{x}", "abcefg", syn=onigmo.ONIG_SYNTAX_PERL); + x2("((.*)a\\g{2}f)", "bacbabf", 3, 7, syn=onigmo.ONIG_SYNTAX_PERL); + x2("(.*)a\\g{1}f", "baczzzzzz\nbazz\nzzzzbabf", 19, 23, syn=onigmo.ONIG_SYNTAX_PERL); + x2("((.*)a\\g{-1}f)", "bacbabf", 3, 7, syn=onigmo.ONIG_SYNTAX_PERL); + x2("(.*)a\\g{-1}f", "baczzzzzz\nbazz\nzzzzbabf", 19, 23, syn=onigmo.ONIG_SYNTAX_PERL); + x2("(あ*)(い*)\\g{-2}\\g{-1}", "あああいいあああいい", 0, 10, syn=onigmo.ONIG_SYNTAX_PERL); + + # Python/PCRE compatible named group + x2("(?P<name_2>ab)(?P>name_2)", "abab", 0, 4, syn=onigmo.ONIG_SYNTAX_PERL); + x2("(?P<n>|\\((?P>n)\\))+$", "()(())", 0, 6, syn=onigmo.ONIG_SYNTAX_PERL); + x2("((?P<name1>\\d)|(?P<name2>\\w))((?P=name1)|(?P=name2))", "ff", 0, 2, syn=onigmo.ONIG_SYNTAX_PERL); + n("(?P", "", syn=onigmo.ONIG_SYNTAX_PERL, err=onigmo.ONIGERR_UNDEFINED_GROUP_OPTION) + n("(?PX", "", syn=onigmo.ONIG_SYNTAX_PERL, err=onigmo.ONIGERR_UNDEFINED_GROUP_OPTION) + + # Fullwidth Alphabet + n("abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + x2("(?i)abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwxyz", 0, 26); + x2("(?i)abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 0, 26); + x2("(?i)ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz", 0, 26); + x2("(?i)ABCDEFGHIJKLMNOPQRSTUVWXYZ", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 0, 26); + + # Greek + n("αβγδεζηθικλμνξοπρστυφχψω", "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ"); + x2("(?i)αβγδεζηθικλμνξοπρστυφχψω", "αβγδεζηθικλμνξοπρστυφχψω", 0, 24); + x2("(?i)αβγδεζηθικλμνξοπρστυφχψω", "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ", 0, 24); + x2("(?i)ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ", "αβγδεζηθικλμνξοπρστυφχψω", 0, 24); + x2("(?i)ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ", "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ", 0, 24); + + # Cyrillic + n("абвгдеёжзийклмнопрстуфхцчшщъыьэюя", "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ"); + x2("(?i)абвгдеёжзийклмнопрстуфхцчшщъыьэюя", "абвгдеёжзийклмнопрстуфхцчшщъыьэюя", 0, 33); + x2("(?i)абвгдеёжзийклмнопрстуфхцчшщъыьэюя", "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ", 0, 33); + x2("(?i)АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ", "абвгдеёжзийклмнопрстуфхцчшщъыьэюя", 0, 33); + x2("(?i)АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ", "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ", 0, 33); + + # multiple name definition + x2("(?<a>a)(?<a>b)\\k<a>", "aba", 0, 3) + x2("(?<a>a)(?<a>b)\\k<a>", "abb", 0, 3) + x2("(?<a>a)(?<a>b)\\g{a}", "aba", 0, 3, syn=onigmo.ONIG_SYNTAX_PERL) + n("(?<a>a)(?<a>b)\\g{a}", "abb", syn=onigmo.ONIG_SYNTAX_PERL) + n("(?<a>a)(?<a>b)\\g<a>", "aba", err=onigmo.ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL) + x2("(?<a>[ac])(?<a>b)(?&a)", "abc", 0, 3, syn=onigmo.ONIG_SYNTAX_PERL) + n("(?<a>[ac])(?<a>b)(?&a)", "abb", syn=onigmo.ONIG_SYNTAX_PERL) + x2("(?:(?<x>abc)|(?<x>efg))(?i:\\k<x>)", "abcefgEFG", 3, 9) + x2("(?<x>a)(?<x>b)(?i:\\k<x>)+", "abAB", 0, 4) + + # branch reset +# x3("(?|(c)|(?:(b)|(a)))", "a", 0, 1, 2) +# x3("(?|(c)|(?|(b)|(a)))", "a", 0, 1, 1) + + # conditional expression + x2("(?:(a)|(b))(?(1)cd)e", "acde", 0, 4) + n("(?:(a)|(b))(?(1)cd)e", "ae") + x2("(?:(a)|(b))(?(2)cd)e", "ae", 0, 2) + n("(?:(a)|(b))(?(2)cd)e", "acde") + x2("(?:(a)|(b))(?(1)c|d)", "ac", 0, 2) + x2("(?:(a)|(b))(?(1)c|d)", "bd", 0, 2) + n("(?:(a)|(b))(?(1)c|d)", "ad") + n("(?:(a)|(b))(?(1)c|d)", "bc") + x2("(?:(a)|(b))(?:(?(1)cd)e|fg)", "acde", 0, 4) + x2("(?:(a)|(b))(?:(?(1)cd|x)e|fg)", "bxe", 0, 3) + n("(?:(a)|(b))(?:(?(2)cd|x)e|fg)", "bxe") + x2("(?:(?<x>a)|(?<y>b))(?:(?(<x>)cd|x)e|fg)", "bxe", 0, 3) + n("(?:(?<x>a)|(?<y>b))(?:(?(<y>)cd|x)e|fg)", "bxe") + x2("((?<=a))?(?(1)b|c)", "abc", 1, 2) + x2("((?<=a))?(?(1)b|c)", "bc", 1, 2) + x2("((?<x>x)|(?<y>y))(?(<x>)y|x)", "xy", 0, 2) + x2("((?<x>x)|(?<y>y))(?(<x>)y|x)", "yx", 0, 2) + n("((?<x>x)|(?<y>y))(?(<x>)y|x)", "xx") + n("((?<x>x)|(?<y>y))(?(<x>)y|x)", "yy") + n("(a)?(?<n>b)?(?(1)a)(?(<n>)b)", "aa", err=onigmo.ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED) + x2("(a)?(?<n>b)?(?(1)a)(?(<n>)b)", "aa", 0, 2, syn=onigmo.ONIG_SYNTAX_PERL) + n("()(?(2))", "", err=onigmo.ONIGERR_INVALID_BACKREF) # Issue #65 + n("(?(700000))", "", err=onigmo.ONIGERR_INVALID_BACKREF) + + # Implicit-anchor optimization + x2("(?m:.*abc)", "dddabdd\nddabc", 0, 13) # optimized /(?m:.*abc)/ ==> /\A(?m:.*abc)/ + x2("(?m:.+abc)", "dddabdd\nddabc", 0, 13) # optimized + x2("(?-m:.*abc)", "dddabdd\nddabc", 8, 13) # optimized /(?-m:.*abc)/ ==> /(?:^|\A)(?m:.*abc)/ + n("(?-m:.*ab[x-z])", "dddabdd\nddabc") # optimized + x2("(?-m:.*(?:abc|\\Gabc))", "dddabdd\nddabc", 8, 13) # optimized + x2("(?-m:.+abc)", "dddabdd\nddabc", 8, 13) # optimized + x2("(?-m:.*abc)", "dddabdd\nabc", 8, 11) # optimized + n("(?-m:.+abc)", "dddabdd\nabc") # optimized + x2("(?m:.*\\Z)", "dddabdd\nddabc", 0, 13) # optimized /(?m:.*\Z)/ ==> /\A(?m:.*\Z)/ + x2("(?-m:.*\\Z)", "dddabdd\nddabc", 8, 13) # optimized /(?-m:.*\Z)/ ==> /(?:^|\A)(?m:.*\Z)/ + x2("(.*)X\\1", "1234X2345", 1, 8) # not optimized + + # Allow options in look-behind + x2("(?<=(?i)ab)cd", "ABcd", 2, 4) + x2("(?<=(?i:ab))cd", "ABcd", 2, 4) + n("(?<=(?i)ab)cd", "ABCD") + n("(?<=(?i:ab))cd", "ABCD") + x2("(?<!(?i)ab)cd", "aacd", 2, 4) + x2("(?<!(?i:ab))cd", "aacd", 2, 4) + n("(?<!(?i)ab)cd", "ABcd") + n("(?<!(?i:ab))cd", "ABcd") + + # Absent operator + x2("<-(?~->)->", "<- ->->", 0, 5) + x2("<-(?~->)->\n", "<-1->2<-3->\n", 6, 12) + x2("<-(?~->)->.*<-(?~->)->", "<-1->2<-3->4<-5->", 0, 17) + x2("<-(?~->)->.*?<-(?~->)->", "<-1->2<-3->4<-5->", 0, 11) + x2("(?~abc)c", "abc", 0, 3) + x2("(?~abc)bc", "abc", 0, 3) + x2("(?~abc)abc", "abc", 0, 3) + n("(?~)", " ") + n("(?~)", "") + n(" (?~)", " ") + n(" (?~)", " ") + x2("(?~(?~))", "abc", 0, 3) + x2("(?~a)", "", 0, 0) + x2("(?~a)a", "a", 0, 1) + x2("(?~a)", "x", 0, 1) + x2("(?~a)a", "xa", 0, 2) + x2("(?~.)", "", 0, 0) + x2("(?~.)a", "a", 0, 1) + x2("(?~.)", "x", 0, 0) + x2("(?~.)a", "xa", 1, 2) + x2("(?~abc)", "abc", 0, 2) + x2("(?~b)", "abc", 0, 1) + x2("(?~abc|b)", "abc", 0, 1) + n("(?~|abc)", "abc") # ??? + x2("(?~abc|)", "abc", 0, 1) # ??? + x2("(?~abc|def)x", "abcx", 1, 4) + x2("(?~abc|def)x", "defx", 1, 4) + x2("^(?~\\S+)TEST", "TEST", 0, 4) + + # Perl syntax + x2("\\Q()\\[a]\\E[b]", "()\\[a]b", 0, 7, syn=onigmo.ONIG_SYNTAX_PERL) + x2("\\Q()\\[a]", "()\\[a]", 0, 6, syn=onigmo.ONIG_SYNTAX_PERL) # no \E + x2("(?a)(?d)\\w+", "あ", 0, 1, syn=onigmo.ONIG_SYNTAX_PERL) # For now (?d) == (?u) + x2("(?a)(?l)\\w+", "あ", 0, 1, syn=onigmo.ONIG_SYNTAX_PERL) # For now (?l) == (?u) + x2("(?a)(?^)\\w+", "あ", 0, 1, syn=onigmo.ONIG_SYNTAX_PERL) + n("(?i)(?^)a", "A", syn=onigmo.ONIG_SYNTAX_PERL) + n("(?m)(?^)a$", "a\nb", syn=onigmo.ONIG_SYNTAX_PERL) + x2("(?s)(?^).*", "a\nb", 0, 1, syn=onigmo.ONIG_SYNTAX_PERL) + x2("\\o{046}", "\046", 0, 1, syn=onigmo.ONIG_SYNTAX_PERL); + x2("[\\o{044}-\\o{047}]", "\046", 0, 1, syn=onigmo.ONIG_SYNTAX_PERL); + n("\\o{40000000000}", "", syn=onigmo.ONIG_SYNTAX_PERL, err=onigmo.ONIGERR_TOO_BIG_WIDE_CHAR_VALUE); + n("\\o{100000000000}", "", syn=onigmo.ONIG_SYNTAX_PERL, err=onigmo.ONIGERR_TOO_LONG_WIDE_CHAR_VALUE); + n("[\\o{40000000000}]", "", syn=onigmo.ONIG_SYNTAX_PERL, err=onigmo.ONIGERR_TOO_BIG_WIDE_CHAR_VALUE); + n("[\\o{100000000000}]", "", syn=onigmo.ONIG_SYNTAX_PERL, err=onigmo.ONIGERR_TOO_LONG_WIDE_CHAR_VALUE); + + # Backward search + x2("abc", "abcabc", 3, 6, searchtype=SearchType.BACKWARD) + x2("あいう", "あいうあいう", 3, 6, searchtype=SearchType.BACKWARD) + x2("(?i)abc", "ABCABC", 3, 6, searchtype=SearchType.BACKWARD) + x2("(?i)abc", "ABCABC", 3, 6, searchtype=SearchType.BACKWARD) + x2("[a-z]{3}$", "abcabc", 3, 6, searchtype=SearchType.BACKWARD) + x2("[あ-ん]{3}$", "あいうあいう", 3, 6, searchtype=SearchType.BACKWARD) + x2(".*[a-z]bc", "abcabc", 3, 6, searchtype=SearchType.BACKWARD) # Issue #69 + x2(".+[a-z]bc", "abcabc", 2, 6, searchtype=SearchType.BACKWARD) # Issue #69 + x2(".{1,3}[a-z]bc", "abcabc", 2, 6, searchtype=SearchType.BACKWARD) + + # onig_match() + x2("abc", "abcabc", 0, 3, searchtype=SearchType.MATCH) + n("abc", " abcabc", searchtype=SearchType.MATCH) + + # onig_search_gpos() + n("\\Gabc", "123abcdef", gpos=2) + x2("\\Gabc", "123abcdef", 3, 6, gpos=3) + x2("\\Gabc", "123abcdef", 3, 6, startpos=3) + n("\\Gabc", "123abcdef", gpos=0, startpos=3) + x2("abc\\G", "abc", 0, 3, searchtype=SearchType.BACKWARD) + n("abc\\G", "abc ", searchtype=SearchType.BACKWARD) + x2("abc\\G", "abc ", 0, 3, searchtype=SearchType.BACKWARD, endpos=3) + x2("abc\\G", "abc ", 0, 3, searchtype=SearchType.BACKWARD, gpos=3) + + # stack size + stack_size = onigmo.onig_get_match_stack_limit_size() + print("Default stack size:", stack_size) + onigmo.onig_set_match_stack_limit_size(1000) + print("New stack size:", onigmo.onig_get_match_stack_limit_size()) + # These patterns need deep stack. + n("^a*$", "a" * 200 + "b") + n("^a*$", "a" * 2000 + "b", execerr=onigmo.ONIGERR_MATCH_STACK_LIMIT_OVER) + onigmo.onig_set_match_stack_limit_size(0) + + # parse depth + parse_depth = onigmo.onig_get_parse_depth_limit() + print("Default parse depth:", parse_depth) + onigmo.onig_set_parse_depth_limit(1000) + print("New parse depth:", onigmo.onig_get_parse_depth_limit()) + # These patterns need deep parse stack. + x2("(" * 200 + "a" + ")" * 200, "a", 0, 1) + n("(" * 2000 + "a" + ")" * 2000, "a", err=onigmo.ONIGERR_PARSE_DEPTH_LIMIT_OVER) + onigmo.onig_set_match_stack_limit_size(0) + + # syntax functions + onigmo.onig_set_syntax_op(syntax_default, + onigmo.onig_get_syntax_op(onigmo.ONIG_SYNTAX_DEFAULT)) + onigmo.onig_set_syntax_op2(syntax_default, + onigmo.onig_get_syntax_op2(onigmo.ONIG_SYNTAX_DEFAULT)) + onigmo.onig_set_syntax_behavior(syntax_default, + onigmo.onig_get_syntax_behavior(onigmo.ONIG_SYNTAX_DEFAULT)) + onigmo.onig_set_default_syntax(None) + + + print("\nEncoding:", get_encoding_name(onig_encoding)) + print("RESULT SUCC: %d, FAIL: %d, ERROR: %d (by Onigmo %s)" % ( + nsucc, nfail, nerror, onigmo.onig_version())) + + onigmo.onig_end() + + if (nfail == 0 and nerror == 0): + exit(0) + else: + exit(-1) + +if __name__ == '__main__': + main() + diff --git a/lib/edbee-lib/vendor/onig/testu.c b/lib/edbee-lib/vendor/onig/testu.c new file mode 100644 index 00000000..0e4619e9 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/testu.c @@ -0,0 +1,1504 @@ +/* + * This program was generated by testconv.rb. + */ +#include <stdio.h> + +#ifdef POSIX_TEST +# include "onigmoposix.h" +#else +# include "onigmo.h" +#endif + +static int nsucc = 0; +static int nfail = 0; +static int nerror = 0; + +static FILE *err_file; + +#ifndef POSIX_TEST +static OnigRegion *region; +static OnigEncoding ENC; +#endif + +#define ulen(p) onigenc_str_bytelen_null(ENC, (UChar *)p) + +static void uconv(char *from, char *to, int len) +{ + int i; + unsigned char c; + char *q; + + q = to; + + for (i = 0; i < len; i += 2) + { + c = (unsigned char)from[i]; + if (c == 0) + { + c = (unsigned char)from[i + 1]; + if (c < 0x20 || c >= 0x7f || c == 0x5c || c == 0x22) + { + sprintf(q, "\\%03o", c); + q += 4; + } + else + { + sprintf(q, "%c", c); + q++; + } + } + else + { + sprintf(q, "\\%03o", c); + q += 4; + c = (unsigned char)from[i + 1]; + sprintf(q, "\\%03o", c); + q += 4; + } + } + + *q = 0; +} + +static void xx(char *pattern, char *str, int from, int to, int mem, int not) +{ + int r; + char cpat[4000], cstr[4000]; + +#ifdef POSIX_TEST + regex_t reg; + char buf[200]; + regmatch_t pmatch[20]; + + uconv(pattern, cpat, ulen(pattern)); + uconv(str, cstr, ulen(str)); + + r = regcomp(®, pattern, REG_EXTENDED | REG_NEWLINE); + if (r) + { + regerror(r, ®, buf, sizeof(buf)); + fprintf(err_file, "ERROR: %s\n", buf); + nerror++; + return; + } + + r = regexec(®, str, reg.re_nsub + 1, pmatch, 0); + if (r != 0 && r != REG_NOMATCH) + { + regerror(r, ®, buf, sizeof(buf)); + fprintf(err_file, "ERROR: %s\n", buf); + nerror++; + return; + } + + if (r == REG_NOMATCH) + { + if (not) + { + fprintf(stdout, "OK(N): /%s/ '%s'\n", cpat, cstr); + nsucc++; + } + else + { + fprintf(stdout, "FAIL: /%s/ '%s'\n", cpat, cstr); + nfail++; + } + } + else + { + if (not) + { + fprintf(stdout, "FAIL(N): /%s/ '%s'\n", cpat, cstr); + nfail++; + } + else + { + if (pmatch[mem].rm_so == from && pmatch[mem].rm_eo == to) + { + fprintf(stdout, "OK: /%s/ '%s'\n", cpat, cstr); + nsucc++; + } + else + { + fprintf(stdout, "FAIL: /%s/ '%s' %d-%d : %d-%d\n", cpat, cstr, + (int)from, (int)to, (int)pmatch[mem].rm_so, + (int)pmatch[mem].rm_eo); + nfail++; + } + } + } + regfree(®); + +#else + regex_t *reg; + OnigCompileInfo ci; + OnigErrorInfo einfo; + OnigSyntaxType syn = *ONIG_SYNTAX_DEFAULT; + + /* ONIG_OPTION_OFF(syn.options, ONIG_OPTION_ASCII_RANGE); */ + + uconv(pattern, cpat, ulen(pattern)); + uconv(str, cstr, ulen(str)); + +# if 0 + r = onig_new(®, (UChar* )pattern, (UChar* )(pattern + ulen(pattern)), + ONIG_OPTION_DEFAULT, ENC, &syn, &einfo); +# else + ci.num_of_elements = 5; + ci.pattern_enc = ENC; + ci.target_enc = ENC; + ci.syntax = &syn; + ci.option = ONIG_OPTION_DEFAULT; + ci.case_fold_flag = ONIGENC_CASE_FOLD_DEFAULT; + + r = onig_new_deluxe(®, (UChar *)pattern, + (UChar *)(pattern + ulen(pattern)), &ci, &einfo); +# endif + + if (r) + { + char s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str((UChar *)s, r, &einfo); + fprintf(err_file, "ERROR: %s\n", s); + nerror++; + return; + } + + r = onig_search(reg, (UChar *)str, (UChar *)(str + ulen(str)), (UChar *)str, + (UChar *)(str + ulen(str)), region, ONIG_OPTION_NONE); + if (r < ONIG_MISMATCH) + { + char s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str((UChar *)s, r); + fprintf(err_file, "ERROR: %s\n", s); + nerror++; + return; + } + + if (r == ONIG_MISMATCH) + { + if (not) + { + fprintf(stdout, "OK(N): /%s/ '%s'\n", cpat, cstr); + nsucc++; + } + else + { + fprintf(stdout, "FAIL: /%s/ '%s'\n", cpat, cstr); + nfail++; + } + } + else + { + if (not) + { + fprintf(stdout, "FAIL(N): /%s/ '%s'\n", cpat, cstr); + nfail++; + } + else + { + if (region->beg[mem] == from && region->end[mem] == to) + { + fprintf(stdout, "OK: /%s/ '%s'\n", cpat, cstr); + nsucc++; + } + else + { + fprintf(stdout, "FAIL: /%s/ '%s' %d-%d : %d-%d\n", cpat, cstr, + (int)from, (int)to, (int)region->beg[mem], + (int)region->end[mem]); + nfail++; + } + } + } + onig_free(reg); +#endif +} + +static void x2(char *pattern, char *str, int from, int to) +{ + xx(pattern, str, from, to, 0, 0); +} + +static void x3(char *pattern, char *str, int from, int to, int mem) +{ + xx(pattern, str, from, to, mem, 0); +} + +static void n(char *pattern, char *str) +{ + xx(pattern, str, 0, 0, 0, 1); +} + +extern int main(int argc, char *argv[]) +{ + err_file = stdout; + +#ifndef POSIX_TEST + region = onig_region_new(); +#endif +#ifdef POSIX_TEST + reg_set_encoding(REG_POSIX_ENCODING_UTF16_BE); +#else + ENC = ONIG_ENCODING_UTF16_BE; +#endif + x2("\000\000", "\000\000", 0, 0); + x2("\000^\000\000", "\000\000", 0, 0); + x2("\000$\000\000", "\000\000", 0, 0); + x2("\000\134\000G\000\000", "\000\000", 0, 0); + x2("\000\134\000A\000\000", "\000\000", 0, 0); + x2("\000\134\000Z\000\000", "\000\000", 0, 0); + x2("\000\134\000z\000\000", "\000\000", 0, 0); + x2("\000^\000$\000\000", "\000\000", 0, 0); + x2("\000\134\000c\000a\000\000", "\000\001\000\000", 0, 2); + x2("\000\134\000C\000-\000b\000\000", "\000\002\000\000", 0, 2); + x2("\000\134\000c\000\134\000\134\000\000", "\000\034\000\000", 0, 2); + x2("\000q\000[\000\134\000c\000\134\000\134\000]\000\000", + "\000q\000\034\000\000", 0, 4); + x2("\000\000", "\000a\000\000", 0, 0); + x2("\000a\000\000", "\000a\000\000", 0, 2); + x2("\000\134\000x\0000\0000\000\134\000x\0006\0001\000\000", "\000a\000\000", + 0, 2); + x2("\000a\000a\000\000", "\000a\000a\000\000", 0, 4); + x2("\000a\000a\000a\000\000", "\000a\000a\000a\000\000", 0, 6); + x2("\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a" + "\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a" + "\000a\000a\000a\000a\000a\000a\000a\000\000", + "\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a" + "\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a" + "\000a\000a\000a\000a\000a\000a\000a\000\000", + 0, 70); + x2("\000a\000b\000\000", "\000a\000b\000\000", 0, 4); + x2("\000b\000\000", "\000a\000b\000\000", 2, 4); + x2("\000b\000c\000\000", "\000a\000b\000c\000\000", 2, 6); + x2("\000(\000?\000i\000:\000#\000R\000E\000T\000#\000)\000\000", + "\000#\000I\000N\000S\000#\000#\000R\000E\000T\000#\000\000", 10, 20); + x2("\000\134\0000\0000\0000\000\134\0001\0007\000\000", "\000\017\000\000", 0, + 2); + x2("\000\134\000x\0000\0000\000\134\000x\0001\000f\000\000", + "\000\037\000\000", 0, 2); + x2("\000a\000(\000?\000#\000.\000.\000.\000." + "\000\134\000\134\000J\000J\000J\000J\000)\000b\000\000", + "\000a\000b\000\000", 0, 4); + x2("\000(\000?\000x\000)\000 \000 \000G\000 \000(\000o\000 " + "\000O\000(\000?\000-\000x\000)\000o\000O\000)\000 \000g\000 " + "\000L\000\000", + "\000G\000o\000O\000o\000O\000g\000L\000e\000\000", 0, 14); + x2("\000.\000\000", "\000a\000\000", 0, 2); + n("\000.\000\000", "\000\000"); + x2("\000.\000.\000\000", "\000a\000b\000\000", 0, 4); + x2("\000\134\000w\000\000", "\000e\000\000", 0, 2); + n("\000\134\000W\000\000", "\000e\000\000"); + x2("\000\134\000s\000\000", "\000 \000\000", 0, 2); + x2("\000\134\000S\000\000", "\000b\000\000", 0, 2); + x2("\000\134\000d\000\000", "\0004\000\000", 0, 2); + n("\000\134\000D\000\000", "\0004\000\000"); + x2("\000\134\000b\000\000", "\000z\000 \000\000", 0, 0); + x2("\000\134\000b\000\000", "\000 \000z\000\000", 2, 2); + x2("\000\134\000B\000\000", "\000z\000z\000 \000\000", 2, 2); + x2("\000\134\000B\000\000", "\000z\000 \000\000", 4, 4); + x2("\000\134\000B\000\000", "\000 \000z\000\000", 0, 0); + x2("\000[\000a\000b\000]\000\000", "\000b\000\000", 0, 2); + n("\000[\000a\000b\000]\000\000", "\000c\000\000"); + x2("\000[\000a\000-\000z\000]\000\000", "\000t\000\000", 0, 2); + n("\000[\000^\000a\000]\000\000", "\000a\000\000"); + x2("\000[\000^\000a\000]\000\000", "\000\012\000\000", 0, 2); + x2("\000[\000]\000]\000\000", "\000]\000\000", 0, 2); + n("\000[\000^\000]\000]\000\000", "\000]\000\000"); + x2("\000[\000\134\000^\000]\000+\000\000", "\0000\000^\000^\0001\000\000", 2, + 6); + x2("\000[\000b\000-\000]\000\000", "\000b\000\000", 0, 2); + x2("\000[\000b\000-\000]\000\000", "\000-\000\000", 0, 2); + x2("\000[\000\134\000w\000]\000\000", "\000z\000\000", 0, 2); + n("\000[\000\134\000w\000]\000\000", "\000 \000\000"); + x2("\000[\000\134\000W\000]\000\000", "\000b\000$\000\000", 2, 4); + x2("\000[\000\134\000d\000]\000\000", "\0005\000\000", 0, 2); + n("\000[\000\134\000d\000]\000\000", "\000e\000\000"); + x2("\000[\000\134\000D\000]\000\000", "\000t\000\000", 0, 2); + n("\000[\000\134\000D\000]\000\000", "\0003\000\000"); + x2("\000[\000\134\000s\000]\000\000", "\000 \000\000", 0, 2); + n("\000[\000\134\000s\000]\000\000", "\000a\000\000"); + x2("\000[\000\134\000S\000]\000\000", "\000b\000\000", 0, 2); + n("\000[\000\134\000S\000]\000\000", "\000 \000\000"); + x2("\000[\000\134\000w\000\134\000d\000]\000\000", "\0002\000\000", 0, 2); + n("\000[\000\134\000w\000\134\000d\000]\000\000", "\000 \000\000"); + x2("\000[\000[\000:\000u\000p\000p\000e\000r\000:\000]\000]\000\000", + "\000B\000\000", 0, 2); + x2("\000[\000*\000[\000:\000x\000d\000i\000g\000i\000t\000:\000]\000+\000]" + "\000\000", + "\000+\000\000", 0, 2); + x2("\000[\000*\000[\000:\000x\000d\000i\000g\000i\000t\000:\000]\000+\000]" + "\000\000", + "\000G\000H\000I\000K\000K\000-\0009\000+\000*\000\000", 12, 14); + x2("\000[\000*\000[\000:\000x\000d\000i\000g\000i\000t\000:\000]\000+\000]" + "\000\000", + "\000-\000@\000^\000+\000\000", 6, 8); + n("\000[\000[\000:\000u\000p\000p\000e\000r\000]\000]\000\000", + "\000A\000\000"); + x2("\000[\000[\000:\000u\000p\000p\000e\000r\000]\000]\000\000", + "\000:\000\000", 0, 2); + x2("\000[\000\134\0000\0000\0000\000\134\0000\0004\0004\000-" + "\000\134\0000\0000\0000\000\134\0000\0004\0007\000]\000\000", + "\000&\000\000", 0, 2); + x2("\000[\000\134\000x\0000\0000\000\134\000x\0005\000a\000-" + "\000\134\000x\0000\0000\000\134\000x\0005\000c\000]\000\000", + "\000[\000\000", 0, 2); + x2("\000[\000\134\000x\0000\0000\000\134\000x\0006\000A\000-" + "\000\134\000x\0000\0000\000\134\000x\0006\000D\000]\000\000", + "\000l\000\000", 0, 2); + n("\000[\000\134\000x\0000\0000\000\134\000x\0006\000A\000-" + "\000\134\000x\0000\0000\000\134\000x\0006\000D\000]\000\000", + "\000n\000\000"); + n("\000^\000[\0000\000-\0009\000A\000-\000F\000]\000+\000 \0000\000+\000 " + "\000U\000N\000D\000E\000F\000 \000\000", + "\0007\0005\000F\000 \0000\0000\0000\0000\0000\0000\0000\0000\000 " + "\000S\000E\000C\000T\0001\0004\000A\000 " + "\000n\000o\000t\000y\000p\000e\000 \000(\000)\000 \000 \000 \000 " + "\000E\000x\000t\000e\000r\000n\000a\000l\000 \000 \000 \000 \000|\000 " + "\000_\000r\000b\000_\000a\000p\000p\000l\000y\000\000"); + x2("\000[\000\134\000[\000]\000\000", "\000[\000\000", 0, 2); + x2("\000[\000\134\000]\000]\000\000", "\000]\000\000", 0, 2); + x2("\000[\000&\000]\000\000", "\000&\000\000", 0, 2); + x2("\000[\000[\000a\000b\000]\000]\000\000", "\000b\000\000", 0, 2); + x2("\000[\000[\000a\000b\000]\000c\000]\000\000", "\000c\000\000", 0, 2); + n("\000[\000[\000^\000a\000]\000]\000\000", "\000a\000\000"); + n("\000[\000^\000[\000a\000]\000]\000\000", "\000a\000\000"); + x2("\000[\000[\000a\000b\000]\000&\000&\000b\000c\000]\000\000", + "\000b\000\000", 0, 2); + n("\000[\000[\000a\000b\000]\000&\000&\000b\000c\000]\000\000", + "\000a\000\000"); + n("\000[\000[\000a\000b\000]\000&\000&\000b\000c\000]\000\000", + "\000c\000\000"); + x2("\000[\000a\000-\000z\000&\000&\000b\000-\000y\000&\000&\000c\000-" + "\000x\000]\000\000", + "\000w\000\000", 0, 2); + n("\000[\000^\000a\000-\000z\000&\000&\000b\000-\000y\000&\000&\000c\000-" + "\000x\000]\000\000", + "\000w\000\000"); + x2("\000[\000[\000^\000a\000&\000&\000a\000]\000&\000&\000a\000-\000z\000]" + "\000\000", + "\000b\000\000", 0, 2); + n("\000[\000[\000^\000a\000&\000&\000a\000]\000&\000&\000a\000-\000z\000]" + "\000\000", + "\000a\000\000"); + x2("\000[\000[\000^\000a\000-\000z\000&\000&\000b\000c\000d\000e\000f\000]" + "\000&\000&\000[\000^\000c\000-\000g\000]\000]\000\000", + "\000h\000\000", 0, 2); + n("\000[\000[\000^\000a\000-\000z\000&\000&\000b\000c\000d\000e\000f\000]" + "\000&\000&\000[\000^\000c\000-\000g\000]\000]\000\000", + "\000c\000\000"); + x2("\000[\000^\000[\000^\000a\000b\000c\000]\000&\000&\000[\000^" + "\000c\000d\000e\000]\000]\000\000", + "\000c\000\000", 0, 2); + x2("\000[\000^\000[\000^\000a\000b\000c\000]\000&\000&\000[\000^" + "\000c\000d\000e\000]\000]\000\000", + "\000e\000\000", 0, 2); + n("\000[\000^\000[\000^\000a\000b\000c\000]\000&\000&\000[\000^" + "\000c\000d\000e\000]\000]\000\000", + "\000f\000\000"); + x2("\000[\000a\000-\000&\000&\000-\000a\000]\000\000", "\000-\000\000", 0, 2); + n("\000[\000a\000\134\000-\000&\000&\000\134\000-\000a\000]\000\000", + "\000&\000\000"); + n("\000\134\000w\000a\000b\000c\000\000", "\000 \000a\000b\000c\000\000"); + x2("\000a\000\134\000W\000b\000c\000\000", "\000a\000 \000b\000c\000\000", 0, + 8); + x2("\000a\000.\000b\000.\000c\000\000", "\000a\000a\000b\000b\000c\000\000", + 0, 10); + x2("\000.\000\134\000w\000b\000\134\000W\000.\000.\000c\000\000", + "\000a\000b\000b\000 \000b\000c\000c\000\000", 0, 14); + x2("\000\134\000s\000\134\000w\000z\000z\000z\000\000", + "\000 \000z\000z\000z\000z\000\000", 0, 10); + x2("\000a\000a\000.\000b\000\000", "\000a\000a\000b\000b\000\000", 0, 8); + n("\000.\000a\000\000", "\000a\000b\000\000"); + x2("\000.\000a\000\000", "\000a\000a\000\000", 0, 4); + x2("\000^\000a\000\000", "\000a\000\000", 0, 2); + x2("\000^\000a\000$\000\000", "\000a\000\000", 0, 2); + x2("\000^\000\134\000w\000$\000\000", "\000a\000\000", 0, 2); + n("\000^\000\134\000w\000$\000\000", "\000 \000\000"); + x2("\000^\000\134\000w\000a\000b\000$\000\000", "\000z\000a\000b\000\000", 0, + 6); + x2("\000^\000\134\000w\000a\000b\000c\000d\000e\000f\000$\000\000", + "\000z\000a\000b\000c\000d\000e\000f\000\000", 0, 14); + x2("\000^\000\134\000w\000.\000.\000.\000d\000e\000f\000$\000\000", + "\000z\000a\000b\000c\000d\000e\000f\000\000", 0, 14); + x2("\000\134\000w\000\134\000w\000\134\000s\000\134\000W\000a\000a\000a\000" + "\134\000d\000\000", + "\000a\000a\000 \000 \000a\000a\000a\0004\000\000", 0, 16); + x2("\000\134\000A\000\134\000Z\000\000", "\000\000", 0, 0); + x2("\000\134\000A\000x\000y\000z\000\000", "\000x\000y\000z\000\000", 0, 6); + x2("\000x\000y\000z\000\134\000Z\000\000", "\000x\000y\000z\000\000", 0, 6); + x2("\000x\000y\000z\000\134\000z\000\000", "\000x\000y\000z\000\000", 0, 6); + x2("\000a\000\134\000Z\000\000", "\000a\000\000", 0, 2); + x2("\000\134\000G\000a\000z\000\000", "\000a\000z\000\000", 0, 4); + n("\000\134\000G\000z\000\000", "\000b\000z\000a\000\000"); + n("\000a\000z\000\134\000G\000\000", "\000a\000z\000\000"); + n("\000a\000z\000\134\000A\000\000", "\000a\000z\000\000"); + n("\000a\000\134\000A\000z\000\000", "\000a\000z\000\000"); + x2("\000\134\000^\000\134\000$\000\000", "\000^\000$\000\000", 0, 4); + x2("\000^\000x\000?\000y\000\000", "\000x\000y\000\000", 0, 4); + x2("\000^\000(\000x\000?\000y\000)\000\000", "\000x\000y\000\000", 0, 4); + x2("\000\134\000w\000\000", "\000_\000\000", 0, 2); + n("\000\134\000W\000\000", "\000_\000\000"); + x2("\000(\000?\000=\000z\000)\000z\000\000", "\000z\000\000", 0, 2); + n("\000(\000?\000=\000z\000)\000.\000\000", "\000a\000\000"); + x2("\000(\000?\000!\000z\000)\000a\000\000", "\000a\000\000", 0, 2); + n("\000(\000?\000!\000z\000)\000a\000\000", "\000z\000\000"); + x2("\000(\000?\000i\000:\000a\000)\000\000", "\000a\000\000", 0, 2); + x2("\000(\000?\000i\000:\000a\000)\000\000", "\000A\000\000", 0, 2); + x2("\000(\000?\000i\000:\000A\000)\000\000", "\000a\000\000", 0, 2); + n("\000(\000?\000i\000:\000A\000)\000\000", "\000b\000\000"); + x2("\000(\000?\000i\000:\000[\000A\000-\000Z\000]\000)\000\000", + "\000a\000\000", 0, 2); + x2("\000(\000?\000i\000:\000[\000f\000-\000m\000]\000)\000\000", + "\000H\000\000", 0, 2); + x2("\000(\000?\000i\000:\000[\000f\000-\000m\000]\000)\000\000", + "\000h\000\000", 0, 2); + n("\000(\000?\000i\000:\000[\000f\000-\000m\000]\000)\000\000", + "\000e\000\000"); + x2("\000(\000?\000i\000:\000[\000A\000-\000c\000]\000)\000\000", + "\000D\000\000", 0, 2); + n("\000(\000?\000i\000:\000[\000^\000a\000-\000z\000]\000)\000\000", + "\000A\000\000"); + n("\000(\000?\000i\000:\000[\000^\000a\000-\000z\000]\000)\000\000", + "\000a\000\000"); + x2("\000(\000?\000i\000:\000[\000!\000-\000k\000]\000)\000\000", + "\000Z\000\000", 0, 2); + x2("\000(\000?\000i\000:\000[\000!\000-\000k\000]\000)\000\000", + "\0007\000\000", 0, 2); + x2("\000(\000?\000i\000:\000[\000T\000-\000}\000]\000)\000\000", + "\000b\000\000", 0, 2); + x2("\000(\000?\000i\000:\000[\000T\000-\000}\000]\000)\000\000", + "\000{\000\000", 0, 2); + x2("\000(\000?\000i\000:\000\134\000?\000a\000)\000\000", + "\000?\000A\000\000", 0, 4); + x2("\000(\000?\000i\000:\000\134\000*\000A\000)\000\000", + "\000*\000a\000\000", 0, 4); + n("\000.\000\000", "\000\012\000\000"); + x2("\000(\000?\000m\000:\000.\000)\000\000", "\000\012\000\000", 0, 2); + x2("\000(\000?\000m\000:\000a\000.\000)\000\000", "\000a\000\012\000\000", 0, + 4); + x2("\000(\000?\000m\000:\000.\000b\000)\000\000", + "\000a\000\012\000b\000\000", 2, 6); + x2("\000.\000*\000a\000b\000c\000\000", + "\000d\000d\000d\000a\000b\000d\000d\000\012\000d\000d\000a\000b\000c\000" + "\000", + 16, 26); + x2("\000(\000?\000m\000:\000.\000*\000a\000b\000c\000)\000\000", + "\000d\000d\000d\000a\000b\000d\000d\000a\000b\000c\000\000", 0, 20); + n("\000(\000?\000i\000)\000(\000?\000-\000i\000)\000a\000\000", + "\000A\000\000"); + n("\000(\000?\000i\000)\000(\000?\000-\000i\000:\000a\000)\000\000", + "\000A\000\000"); + x2("\000a\000?\000\000", "\000\000", 0, 0); + x2("\000a\000?\000\000", "\000b\000\000", 0, 0); + x2("\000a\000?\000\000", "\000a\000\000", 0, 2); + x2("\000a\000*\000\000", "\000\000", 0, 0); + x2("\000a\000*\000\000", "\000a\000\000", 0, 2); + x2("\000a\000*\000\000", "\000a\000a\000a\000\000", 0, 6); + x2("\000a\000*\000\000", "\000b\000a\000a\000a\000a\000\000", 0, 0); + n("\000a\000+\000\000", "\000\000"); + x2("\000a\000+\000\000", "\000a\000\000", 0, 2); + x2("\000a\000+\000\000", "\000a\000a\000a\000a\000\000", 0, 8); + x2("\000a\000+\000\000", "\000a\000a\000b\000b\000b\000\000", 0, 4); + x2("\000a\000+\000\000", "\000b\000a\000a\000a\000a\000\000", 2, 10); + x2("\000.\000?\000\000", "\000\000", 0, 0); + x2("\000.\000?\000\000", "\000f\000\000", 0, 2); + x2("\000.\000?\000\000", "\000\012\000\000", 0, 0); + x2("\000.\000*\000\000", "\000\000", 0, 0); + x2("\000.\000*\000\000", "\000a\000b\000c\000d\000e\000\000", 0, 10); + x2("\000.\000+\000\000", "\000z\000\000", 0, 2); + x2("\000.\000+\000\000", "\000z\000d\000s\000w\000e\000r\000\012\000\000", 0, + 12); + x2("\000(\000.\000*\000)\000a\000\134\0001\000f\000\000", + "\000b\000a\000b\000f\000b\000a\000c\000\000", 0, 8); + x2("\000(\000.\000*\000)\000a\000\134\0001\000f\000\000", + "\000b\000a\000c\000b\000a\000b\000f\000\000", 6, 14); + x2("\000(\000(\000.\000*\000)\000a\000\134\0002\000f\000)\000\000", + "\000b\000a\000c\000b\000a\000b\000f\000\000", 6, 14); + x2("\000(\000.\000*\000)\000a\000\134\0001\000f\000\000", + "\000b\000a\000c\000z\000z\000z\000z\000z\000z\000\012\000b\000a\000z\000z" + "\000\012\000z\000z\000z\000z\000b\000a\000b\000f\000\000", + 38, 46); + x2("\000a\000|\000b\000\000", "\000a\000\000", 0, 2); + x2("\000a\000|\000b\000\000", "\000b\000\000", 0, 2); + x2("\000|\000a\000\000", "\000a\000\000", 0, 0); + x2("\000(\000|\000a\000)\000\000", "\000a\000\000", 0, 0); + x2("\000a\000b\000|\000b\000c\000\000", "\000a\000b\000\000", 0, 4); + x2("\000a\000b\000|\000b\000c\000\000", "\000b\000c\000\000", 0, 4); + x2("\000z\000(\000?\000:\000a\000b\000|\000b\000c\000)\000\000", + "\000z\000b\000c\000\000", 0, 6); + x2("\000a\000(\000?\000:\000a\000b\000|\000b\000c\000)\000c\000\000", + "\000a\000a\000b\000c\000\000", 0, 8); + x2("\000a\000b\000|\000(\000?\000:\000a\000c\000|\000a\000z\000)\000\000", + "\000a\000z\000\000", 0, 4); + x2("\000a\000|\000b\000|\000c\000\000", "\000d\000c\000\000", 2, 4); + x2("\000a\000|\000b\000|\000c\000d\000|\000e\000f\000g\000|\000h\000|" + "\000i\000j\000k\000|\000l\000m\000n\000|\000o\000|\000p\000q\000|" + "\000r\000s\000t\000u\000v\000w\000x\000|\000y\000z\000\000", + "\000p\000q\000r\000\000", 0, 4); + n("\000a\000|\000b\000|\000c\000d\000|\000e\000f\000g\000|\000h\000|" + "\000i\000j\000k\000|\000l\000m\000n\000|\000o\000|\000p\000q\000|" + "\000r\000s\000t\000u\000v\000w\000x\000|\000y\000z\000\000", + "\000m\000n\000\000"); + x2("\000a\000|\000^\000z\000\000", "\000b\000a\000\000", 2, 4); + x2("\000a\000|\000^\000z\000\000", "\000z\000a\000\000", 0, 2); + x2("\000a\000|\000\134\000G\000z\000\000", "\000b\000z\000a\000\000", 4, 6); + x2("\000a\000|\000\134\000G\000z\000\000", "\000z\000a\000\000", 0, 2); + x2("\000a\000|\000\134\000A\000z\000\000", "\000b\000z\000a\000\000", 4, 6); + x2("\000a\000|\000\134\000A\000z\000\000", "\000z\000a\000\000", 0, 2); + x2("\000a\000|\000b\000\134\000Z\000\000", "\000b\000a\000\000", 2, 4); + x2("\000a\000|\000b\000\134\000Z\000\000", "\000b\000\000", 0, 2); + x2("\000a\000|\000b\000\134\000z\000\000", "\000b\000a\000\000", 2, 4); + x2("\000a\000|\000b\000\134\000z\000\000", "\000b\000\000", 0, 2); + x2("\000\134\000w\000|\000\134\000s\000\000", "\000 \000\000", 0, 2); + n("\000\134\000w\000|\000\134\000w\000\000", "\000 \000\000"); + x2("\000\134\000w\000|\000%\000\000", "\000%\000\000", 0, 2); + x2("\000\134\000w\000|\000[\000&\000$\000]\000\000", "\000&\000\000", 0, 2); + x2("\000[\000b\000-\000d\000]\000|\000[\000^\000e\000-\000z\000]\000\000", + "\000a\000\000", 0, 2); + x2("\000(\000?\000:\000a\000|\000[\000c\000-\000f\000]\000)\000|" + "\000b\000z\000\000", + "\000d\000z\000\000", 0, 2); + x2("\000(\000?\000:\000a\000|\000[\000c\000-\000f\000]\000)\000|" + "\000b\000z\000\000", + "\000b\000z\000\000", 0, 4); + x2("\000a\000b\000c\000|\000(\000?\000=\000z\000z\000)\000.\000." + "\000f\000\000", + "\000z\000z\000f\000\000", 0, 6); + x2("\000a\000b\000c\000|\000(\000?\000!\000z\000z\000)\000.\000." + "\000f\000\000", + "\000a\000b\000f\000\000", 0, 6); + x2("\000(\000?\000=\000z\000a\000)\000.\000.\000a\000|\000(\000?\000=" + "\000z\000z\000)\000.\000.\000a\000\000", + "\000z\000z\000a\000\000", 0, 6); + n("\000(\000?\000>\000a\000|\000a\000b\000d\000)\000c\000\000", + "\000a\000b\000d\000c\000\000"); + x2("\000(\000?\000>\000a\000b\000d\000|\000a\000)\000c\000\000", + "\000a\000b\000d\000c\000\000", 0, 8); + x2("\000a\000?\000|\000b\000\000", "\000a\000\000", 0, 2); + x2("\000a\000?\000|\000b\000\000", "\000b\000\000", 0, 0); + x2("\000a\000?\000|\000b\000\000", "\000\000", 0, 0); + x2("\000a\000*\000|\000b\000\000", "\000a\000a\000\000", 0, 4); + x2("\000a\000*\000|\000b\000*\000\000", "\000b\000a\000\000", 0, 0); + x2("\000a\000*\000|\000b\000*\000\000", "\000a\000b\000\000", 0, 2); + x2("\000a\000+\000|\000b\000*\000\000", "\000\000", 0, 0); + x2("\000a\000+\000|\000b\000*\000\000", "\000b\000b\000b\000\000", 0, 6); + x2("\000a\000+\000|\000b\000*\000\000", "\000a\000b\000b\000b\000\000", 0, 2); + n("\000a\000+\000|\000b\000+\000\000", "\000\000"); + x2("\000(\000a\000|\000b\000)\000?\000\000", "\000b\000\000", 0, 2); + x2("\000(\000a\000|\000b\000)\000*\000\000", "\000b\000a\000\000", 0, 4); + x2("\000(\000a\000|\000b\000)\000+\000\000", "\000b\000a\000b\000\000", 0, 6); + x2("\000(\000a\000b\000|\000c\000a\000)\000+\000\000", + "\000c\000a\000a\000b\000b\000c\000\000", 0, 8); + x2("\000(\000a\000b\000|\000c\000a\000)\000+\000\000", + "\000a\000a\000b\000c\000a\000\000", 2, 10); + x2("\000(\000a\000b\000|\000c\000a\000)\000+\000\000", + "\000a\000b\000z\000c\000a\000\000", 0, 4); + x2("\000(\000a\000|\000b\000a\000b\000)\000+\000\000", + "\000a\000b\000a\000b\000a\000\000", 0, 10); + x2("\000(\000a\000|\000b\000a\000b\000)\000+\000\000", "\000b\000a\000\000", + 2, 4); + x2("\000(\000a\000|\000b\000a\000b\000)\000+\000\000", + "\000b\000a\000a\000a\000b\000a\000\000", 2, 8); + x2("\000(\000?\000:\000a\000|\000b\000)\000(\000?\000:\000a\000|\000b\000)" + "\000\000", + "\000a\000b\000\000", 0, 4); + x2("\000(\000?\000:\000a\000*\000|\000b\000*\000)\000(\000?\000:\000a\000*" + "\000|\000b\000*\000)\000\000", + "\000a\000a\000a\000b\000b\000b\000\000", 0, 6); + x2("\000(\000?\000:\000a\000*\000|\000b\000*\000)\000(\000?\000:\000a\000+" + "\000|\000b\000+\000)\000\000", + "\000a\000a\000a\000b\000b\000b\000\000", 0, 12); + x2("\000(\000?\000:\000a\000+\000|\000b\000+\000)\000{\0002\000}\000\000", + "\000a\000a\000a\000b\000b\000b\000\000", 0, 12); + x2("\000h\000{\0000\000,\000}\000\000", "\000h\000h\000h\000h\000\000", 0, 8); + x2("\000(\000?\000:\000a\000+\000|\000b\000+\000)\000{\0001\000,\0002\000}" + "\000\000", + "\000a\000a\000a\000b\000b\000b\000\000", 0, 12); + n("\000a\000x\000{\0002\000}\000*\000a\000\000", + "\0000\000a\000x\000x\000x\000a\0001\000\000"); + n("\000a\000.\000{\0000\000,\0002\000}\000a\000\000", + "\0000\000a\000X\000X\000X\000a\0000\000\000"); + n("\000a\000.\000{\0000\000,\0002\000}\000?\000a\000\000", + "\0000\000a\000X\000X\000X\000a\0000\000\000"); + n("\000a\000.\000{\0000\000,\0002\000}\000?\000a\000\000", + "\0000\000a\000X\000X\000X\000X\000a\0000\000\000"); + x2("\000^\000a\000{\0002\000,\000}\000?\000a\000$\000\000", + "\000a\000a\000a\000\000", 0, 6); + x2("\000^\000[\000a\000-\000z\000]\000{\0002\000,\000}\000?\000$\000\000", + "\000a\000a\000a\000\000", 0, 6); + x2("\000(\000?\000:\000a\000+\000|\000\134\000A\000b\000*\000)" + "\000c\000c\000\000", + "\000c\000c\000\000", 0, 4); + n("\000(\000?\000:\000a\000+\000|\000\134\000A\000b\000*\000)" + "\000c\000c\000\000", + "\000a\000b\000c\000c\000\000"); + x2("\000(\000?\000:\000^\000a\000+\000|\000b\000+\000)\000*\000c\000\000", + "\000a\000a\000b\000b\000b\000a\000b\000c\000\000", 12, 16); + x2("\000(\000?\000:\000^\000a\000+\000|\000b\000+\000)\000*\000c\000\000", + "\000a\000a\000b\000b\000b\000b\000c\000\000", 0, 14); + x2("\000a\000|\000(\000?\000i\000)\000c\000\000", "\000C\000\000", 0, 2); + x2("\000(\000?\000i\000)\000c\000|\000a\000\000", "\000C\000\000", 0, 2); + x2("\000(\000?\000i\000)\000c\000|\000a\000\000", "\000A\000\000", 0, 2); + x2("\000(\000?\000i\000:\000c\000)\000|\000a\000\000", "\000C\000\000", 0, 2); + n("\000(\000?\000i\000:\000c\000)\000|\000a\000\000", "\000A\000\000"); + x2("\000[\000a\000b\000c\000]\000?\000\000", "\000a\000b\000c\000\000", 0, 2); + x2("\000[\000a\000b\000c\000]\000*\000\000", "\000a\000b\000c\000\000", 0, 6); + x2("\000[\000^\000a\000b\000c\000]\000*\000\000", "\000a\000b\000c\000\000", + 0, 0); + n("\000[\000^\000a\000b\000c\000]\000+\000\000", "\000a\000b\000c\000\000"); + x2("\000a\000?\000?\000\000", "\000a\000a\000a\000\000", 0, 0); + x2("\000b\000a\000?\000?\000b\000\000", "\000b\000a\000b\000\000", 0, 6); + x2("\000a\000*\000?\000\000", "\000a\000a\000a\000\000", 0, 0); + x2("\000b\000a\000*\000?\000\000", "\000b\000a\000a\000\000", 0, 2); + x2("\000b\000a\000*\000?\000b\000\000", "\000b\000a\000a\000b\000\000", 0, 8); + x2("\000a\000+\000?\000\000", "\000a\000a\000a\000\000", 0, 2); + x2("\000b\000a\000+\000?\000\000", "\000b\000a\000a\000\000", 0, 4); + x2("\000b\000a\000+\000?\000b\000\000", "\000b\000a\000a\000b\000\000", 0, 8); + x2("\000(\000?\000:\000a\000?\000)\000?\000?\000\000", "\000a\000\000", 0, 0); + x2("\000(\000?\000:\000a\000?\000?\000)\000?\000\000", "\000a\000\000", 0, 0); + x2("\000(\000?\000:\000a\000?\000)\000+\000?\000\000", + "\000a\000a\000a\000\000", 0, 2); + x2("\000(\000?\000:\000a\000+\000)\000?\000?\000\000", + "\000a\000a\000a\000\000", 0, 0); + x2("\000(\000?\000:\000a\000+\000)\000?\000?\000b\000\000", + "\000a\000a\000a\000b\000\000", 0, 8); + x2("\000(\000?\000:\000a\000b\000)\000?\000{\0002\000}\000\000", "\000\000", + 0, 0); + x2("\000(\000?\000:\000a\000b\000)\000?\000{\0002\000}\000\000", + "\000a\000b\000a\000b\000a\000\000", 0, 8); + x2("\000(\000?\000:\000a\000b\000)\000*\000{\0000\000}\000\000", + "\000a\000b\000a\000b\000a\000\000", 0, 0); + x2("\000(\000?\000:\000a\000b\000)\000{\0003\000,\000}\000\000", + "\000a\000b\000a\000b\000a\000b\000a\000b\000\000", 0, 16); + n("\000(\000?\000:\000a\000b\000)\000{\0003\000,\000}\000\000", + "\000a\000b\000a\000b\000\000"); + x2("\000(\000?\000:\000a\000b\000)\000{\0002\000,\0004\000}\000\000", + "\000a\000b\000a\000b\000a\000b\000\000", 0, 12); + x2("\000(\000?\000:\000a\000b\000)\000{\0002\000,\0004\000}\000\000", + "\000a\000b\000a\000b\000a\000b\000a\000b\000a\000b\000\000", 0, 16); + x2("\000(\000?\000:\000a\000b\000)\000{\0002\000,\0004\000}\000?\000\000", + "\000a\000b\000a\000b\000a\000b\000a\000b\000a\000b\000\000", 0, 8); + x2("\000(\000?\000:\000a\000b\000)\000{\000,\000}\000\000", + "\000a\000b\000{\000,\000}\000\000", 0, 10); + x2("\000(\000?\000:\000a\000b\000c\000)\000+\000?\000{\0002\000}\000\000", + "\000a\000b\000c\000a\000b\000c\000a\000b\000c\000\000", 0, 12); + x2("\000(\000?\000:\000X\000*\000)\000(\000?\000i\000:\000x\000a\000)" + "\000\000", + "\000X\000X\000X\000a\000\000", 0, 8); + x2("\000(\000d\000+\000)\000(\000[\000^\000a\000b\000c\000]\000z\000)" + "\000\000", + "\000d\000d\000d\000z\000\000", 0, 8); + x2("\000(\000[\000^\000a\000b\000c\000]\000*\000)\000(\000[\000^" + "\000a\000b\000c\000]\000z\000)\000\000", + "\000d\000d\000d\000z\000\000", 0, 8); + x2("\000(\000\134\000w\000+\000)\000(\000\134\000w\000z\000)\000\000", + "\000d\000d\000d\000z\000\000", 0, 8); + x3("\000(\000a\000)\000\000", "\000a\000\000", 0, 2, 1); + x3("\000(\000a\000b\000)\000\000", "\000a\000b\000\000", 0, 4, 1); + x2("\000(\000(\000a\000b\000)\000)\000\000", "\000a\000b\000\000", 0, 4); + x3("\000(\000(\000a\000b\000)\000)\000\000", "\000a\000b\000\000", 0, 4, 1); + x3("\000(\000(\000a\000b\000)\000)\000\000", "\000a\000b\000\000", 0, 4, 2); + x3("\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(" + "\000(\000(\000(\000(\000(\000(\000a\000b\000)\000)\000)\000)\000)\000)" + "\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)" + "\000\000", + "\000a\000b\000\000", 0, 4, 20); + x3("\000(\000a\000b\000)\000(\000c\000d\000)\000\000", + "\000a\000b\000c\000d\000\000", 0, 4, 1); + x3("\000(\000a\000b\000)\000(\000c\000d\000)\000\000", + "\000a\000b\000c\000d\000\000", 4, 8, 2); + x3("\000(\000)\000(\000a\000)\000b\000c\000(\000d\000e\000f\000)" + "\000g\000h\000i\000j\000k\000\000", + "\000a\000b\000c\000d\000e\000f\000g\000h\000i\000j\000k\000\000", 6, 12, + 3); + x3("\000(\000(\000)\000(\000a\000)\000b\000c\000(\000d\000e\000f\000)" + "\000g\000h\000i\000j\000k\000)\000\000", + "\000a\000b\000c\000d\000e\000f\000g\000h\000i\000j\000k\000\000", 6, 12, + 4); + x2("\000(\000^\000a\000)\000\000", "\000a\000\000", 0, 2); + x3("\000(\000a\000)\000|\000(\000a\000)\000\000", "\000b\000a\000\000", 2, 4, + 1); + x3("\000(\000^\000a\000)\000|\000(\000a\000)\000\000", "\000b\000a\000\000", + 2, 4, 2); + x3("\000(\000a\000?\000)\000\000", "\000a\000a\000a\000\000", 0, 2, 1); + x3("\000(\000a\000*\000)\000\000", "\000a\000a\000a\000\000", 0, 6, 1); + x3("\000(\000a\000*\000)\000\000", "\000\000", 0, 0, 1); + x3("\000(\000a\000+\000)\000\000", + "\000a\000a\000a\000a\000a\000a\000a\000\000", 0, 14, 1); + x3("\000(\000a\000+\000|\000b\000*\000)\000\000", + "\000b\000b\000b\000a\000a\000\000", 0, 6, 1); + x3("\000(\000a\000+\000|\000b\000?\000)\000\000", + "\000b\000b\000b\000a\000a\000\000", 0, 2, 1); + x3("\000(\000a\000b\000c\000)\000?\000\000", "\000a\000b\000c\000\000", 0, 6, + 1); + x3("\000(\000a\000b\000c\000)\000*\000\000", "\000a\000b\000c\000\000", 0, 6, + 1); + x3("\000(\000a\000b\000c\000)\000+\000\000", "\000a\000b\000c\000\000", 0, 6, + 1); + x3("\000(\000x\000y\000z\000|\000a\000b\000c\000)\000+\000\000", + "\000a\000b\000c\000\000", 0, 6, 1); + x3("\000(\000[\000x\000y\000z\000]\000[\000a\000b\000c\000]\000|" + "\000a\000b\000c\000)\000+\000\000", + "\000a\000b\000c\000\000", 0, 6, 1); + x3("\000(\000(\000?\000i\000:\000a\000b\000c\000)\000)\000\000", + "\000A\000b\000C\000\000", 0, 6, 1); + x2("\000(\000a\000b\000c\000)\000(\000?\000i\000:\000\134\0001\000)\000\000", + "\000a\000b\000c\000A\000B\000C\000\000", 0, 12); + x3("\000(\000(\000?\000m\000:\000a\000.\000c\000)\000)\000\000", + "\000a\000\012\000c\000\000", 0, 6, 1); + x3("\000(\000(\000?\000=\000a\000z\000)\000a\000)\000\000", + "\000a\000z\000b\000\000", 0, 2, 1); + x3("\000a\000b\000c\000|\000(\000.\000a\000b\000d\000)\000\000", + "\000z\000a\000b\000d\000\000", 0, 8, 1); + x2("\000(\000?\000:\000a\000b\000c\000)\000|\000(\000A\000B\000C\000)" + "\000\000", + "\000a\000b\000c\000\000", 0, 6); + x3("\000(\000?\000i\000:\000(\000a\000b\000c\000)\000)\000|\000(" + "\000z\000z\000z\000)\000\000", + "\000A\000B\000C\000\000", 0, 6, 1); + x3("\000a\000*\000(\000.\000)\000\000", "\000a\000a\000a\000a\000z\000\000", + 8, 10, 1); + x3("\000a\000*\000?\000(\000.\000)\000\000", + "\000a\000a\000a\000a\000z\000\000", 0, 2, 1); + x3("\000a\000*\000?\000(\000c\000)\000\000", + "\000a\000a\000a\000a\000c\000\000", 8, 10, 1); + x3("\000[\000b\000c\000d\000]\000a\000*\000(\000.\000)\000\000", + "\000c\000a\000a\000a\000a\000z\000\000", 10, 12, 1); + x3("\000(\000\134\000A\000b\000b\000)\000c\000c\000\000", + "\000b\000b\000c\000c\000\000", 0, 4, 1); + n("\000(\000\134\000A\000b\000b\000)\000c\000c\000\000", + "\000z\000b\000b\000c\000c\000\000"); + x3("\000(\000^\000b\000b\000)\000c\000c\000\000", + "\000b\000b\000c\000c\000\000", 0, 4, 1); + n("\000(\000^\000b\000b\000)\000c\000c\000\000", + "\000z\000b\000b\000c\000c\000\000"); + x3("\000c\000c\000(\000b\000b\000$\000)\000\000", + "\000c\000c\000b\000b\000\000", 4, 8, 1); + n("\000c\000c\000(\000b\000b\000$\000)\000\000", + "\000c\000c\000b\000b\000b\000\000"); + n("\000(\000\134\0001\000)\000\000", "\000\000"); + n("\000\134\0001\000(\000a\000)\000\000", "\000a\000a\000\000"); + n("\000(\000a\000(\000b\000)\000\134\0001\000)\000\134\0002\000+\000\000", + "\000a\000b\000a\000b\000b\000\000"); + n("\000(\000?\000:\000(\000?\000:\000\134\0001\000|\000z\000)\000(\000a\000)" + "\000)\000+\000$\000\000", + "\000z\000a\000a\000\000"); + x2("\000(\000?\000:\000(\000?\000:\000\134\0001\000|\000z\000)\000(\000a\000)" + "\000)\000+\000$\000\000", + "\000z\000a\000a\000a\000\000", 0, 8); + x2("\000(\000a\000)\000(\000?\000=\000\134\0001\000)\000\000", + "\000a\000a\000\000", 0, 2); + n("\000(\000a\000)\000$\000|\000\134\0001\000\000", "\000a\000z\000\000"); + x2("\000(\000a\000)\000\134\0001\000\000", "\000a\000a\000\000", 0, 4); + n("\000(\000a\000)\000\134\0001\000\000", "\000a\000b\000\000"); + x2("\000(\000a\000?\000)\000\134\0001\000\000", "\000a\000a\000\000", 0, 4); + x2("\000(\000a\000?\000?\000)\000\134\0001\000\000", "\000a\000a\000\000", 0, + 0); + x2("\000(\000a\000*\000)\000\134\0001\000\000", + "\000a\000a\000a\000a\000a\000\000", 0, 8); + x3("\000(\000a\000*\000)\000\134\0001\000\000", + "\000a\000a\000a\000a\000a\000\000", 0, 4, 1); + x2("\000a\000(\000b\000*\000)\000\134\0001\000\000", + "\000a\000b\000b\000b\000b\000\000", 0, 10); + x2("\000a\000(\000b\000*\000)\000\134\0001\000\000", "\000a\000b\000\000", 0, + 2); + x2("\000(\000a\000*\000)\000(\000b\000*\000)" + "\000\134\0001\000\134\0002\000\000", + "\000a\000a\000a\000b\000b\000a\000a\000a\000b\000b\000\000", 0, 20); + x2("\000(\000a\000*\000)\000(\000b\000*\000)\000\134\0002\000\000", + "\000a\000a\000a\000b\000b\000b\000b\000\000", 0, 14); + x2("\000(\000(\000(\000(\000(\000(\000(\000a\000*\000)\000b\000)\000)\000)" + "\000)\000)\000)\000c\000\134\0007\000\000", + "\000a\000a\000a\000b\000c\000a\000a\000a\000\000", 0, 16); + x3("\000(\000(\000(\000(\000(\000(\000(\000a\000*\000)\000b\000)\000)\000)" + "\000)\000)\000)\000c\000\134\0007\000\000", + "\000a\000a\000a\000b\000c\000a\000a\000a\000\000", 0, 6, 7); + x2("\000(\000a\000)\000(\000b\000)\000(\000c\000)" + "\000\134\0002\000\134\0001\000\134\0003\000\000", + "\000a\000b\000c\000b\000a\000c\000\000", 0, 12); + x2("\000(\000[\000a\000-\000d\000]\000)\000\134\0001\000\000", + "\000c\000c\000\000", 0, 4); + x2("\000(\000\134\000w\000\134\000d\000\134\000s\000)\000\134\0001\000\000", + "\000f\0005\000 \000f\0005\000 \000\000", 0, 12); + n("\000(\000\134\000w\000\134\000d\000\134\000s\000)\000\134\0001\000\000", + "\000f\0005\000 \000f\0005\000\000"); + x2("\000(\000w\000h\000o\000|\000[\000a\000-\000c\000]\000{\0003\000}\000)" + "\000\134\0001\000\000", + "\000w\000h\000o\000w\000h\000o\000\000", 0, 12); + x2("\000.\000.\000.\000(\000w\000h\000o\000|\000[\000a\000-\000c\000]\000{" + "\0003\000}\000)\000\134\0001\000\000", + "\000a\000b\000c\000w\000h\000o\000w\000h\000o\000\000", 0, 18); + x2("\000(\000w\000h\000o\000|\000[\000a\000-\000c\000]\000{\0003\000}\000)" + "\000\134\0001\000\000", + "\000c\000b\000c\000c\000b\000c\000\000", 0, 12); + x2("\000(\000^\000a\000)\000\134\0001\000\000", "\000a\000a\000\000", 0, 4); + n("\000(\000^\000a\000)\000\134\0001\000\000", "\000b\000a\000a\000\000"); + n("\000(\000a\000$\000)\000\134\0001\000\000", "\000a\000a\000\000"); + n("\000(\000a\000b\000\134\000Z\000)\000\134\0001\000\000", + "\000a\000b\000\000"); + x2("\000(\000a\000*\000\134\000Z\000)\000\134\0001\000\000", "\000a\000\000", + 2, 2); + x2("\000.\000(\000a\000*\000\134\000Z\000)\000\134\0001\000\000", + "\000b\000a\000\000", 2, 4); + x3("\000(\000.\000(\000a\000b\000c\000)\000\134\0002\000)\000\000", + "\000z\000a\000b\000c\000a\000b\000c\000\000", 0, 14, 1); + x3("\000(\000.\000(\000.\000.\000\134\000d\000.\000)\000\134\0002\000)" + "\000\000", + "\000z\0001\0002\0003\0004\0001\0002\0003\0004\000\000", 0, 18, 1); + x2("\000(\000(\000?\000i\000:\000a\000z\000)\000)\000\134\0001\000\000", + "\000A\000z\000A\000z\000\000", 0, 8); + n("\000(\000(\000?\000i\000:\000a\000z\000)\000)\000\134\0001\000\000", + "\000A\000z\000a\000z\000\000"); + x2("\000(\000?\000<\000=\000a\000)\000b\000\000", "\000a\000b\000\000", 2, 4); + n("\000(\000?\000<\000=\000a\000)\000b\000\000", "\000b\000b\000\000"); + x2("\000(\000?\000<\000=\000a\000|\000b\000)\000b\000\000", + "\000b\000b\000\000", 2, 4); + x2("\000(\000?\000<\000=\000a\000|\000b\000c\000)\000b\000\000", + "\000b\000c\000b\000\000", 4, 6); + x2("\000(\000?\000<\000=\000a\000|\000b\000c\000)\000b\000\000", + "\000a\000b\000\000", 2, 4); + x2("\000(\000?\000<\000=\000a\000|\000b\000c\000|\000|" + "\000d\000e\000f\000g\000h\000i\000j\000|" + "\000k\000l\000m\000n\000o\000p\000q\000|\000r\000)\000z\000\000", + "\000r\000z\000\000", 2, 4); + x2("\000(\000a\000)\000\134\000g\000<\0001\000>\000\000", + "\000a\000a\000\000", 0, 4); + x2("\000(\000?\000<\000!\000a\000)\000b\000\000", "\000c\000b\000\000", 2, 4); + n("\000(\000?\000<\000!\000a\000)\000b\000\000", "\000a\000b\000\000"); + x2("\000(\000?\000<\000!\000a\000|\000b\000c\000)\000b\000\000", + "\000b\000b\000b\000\000", 0, 2); + n("\000(\000?\000<\000!\000a\000|\000b\000c\000)\000z\000\000", + "\000b\000c\000z\000\000"); + x2("\000(\000?\000<\000n\000a\000m\000e\0001\000>\000a\000)\000\000", + "\000a\000\000", 0, 2); + x2("\000(\000?\000<\000n\000a\000m\000e\000_\0002\000>\000a\000b\000)" + "\000\134\000g\000<\000n\000a\000m\000e\000_\0002\000>\000\000", + "\000a\000b\000a\000b\000\000", 0, 8); + x2("\000(\000?\000<\000n\000a\000m\000e\000_\0003\000>\000.\000z\000v\000." + "\000)\000\134\000k\000<\000n\000a\000m\000e\000_\0003\000>\000\000", + "\000a\000z\000v\000b\000a\000z\000v\000b\000\000", 0, 16); + x2("\000(\000?\000<\000=\000\134\000g\000<\000a\000b\000>\000)\000|\000-" + "\000\134\000z\000E\000N\000D\000 " + "\000(\000?\000<\000a\000b\000>\000X\000y\000Z\000)\000\000", + "\000X\000y\000Z\000\000", 6, 6); + x2("\000(\000?\000<\000n\000>\000|\000a\000\134\000g\000<\000n\000>\000)\000+" + "\000\000", + "\000\000", 0, 0); + x2("\000(\000?\000<\000n\000>\000|\000\134\000(\000\134\000g\000<\000n\000>" + "\000\134\000)\000)\000+\000$\000\000", + "\000(\000)\000(\000(\000)\000)\000\000", 0, 12); + x3("\000\134\000g\000<\000n\000>\000(\000?\000<\000n\000>\000.\000)\000{" + "\0000\000}\000\000", + "\000X\000\000", 0, 2, 1); + x2("\000\134\000g\000<\000n\000>\000(\000a\000b\000c\000|\000d\000f\000(\000?" + "\000<\000n\000>\000.\000Y\000Z\000)\000{\0002\000,\0008\000}\000)\000{" + "\0000\000}\000\000", + "\000X\000Y\000Z\000\000", 0, 6); + x2("\000\134\000A\000(\000?\000<\000n\000>\000(\000a\000\134\000g\000<" + "\000n\000>\000)\000|\000)\000\134\000z\000\000", + "\000a\000a\000a\000a\000\000", 0, 8); + x2("\000(\000?\000<\000n\000>\000|\000\134\000g\000<\000m\000>" + "\000\134\000g\000<\000n\000>\000)\000\134\000z\000|" + "\000\134\000z\000E\000N\000D\000 " + "\000(\000?\000<\000m\000>\000a\000|\000(\000b\000)\000\134\000g\000<" + "\000m\000>\000)\000\000", + "\000b\000b\000b\000b\000a\000b\000b\000a\000\000", 0, 16); + x2("\000(\000?\000<\000n\000a\000m\000e\0001\0002\0004\0000\000>" + "\000\134\000w\000+\000\134\000s\000x\000)\000a\000+\000\134\000k\000<" + "\000n\000a\000m\000e\0001\0002\0004\0000\000>\000\000", + "\000 \000 \000f\000g\000 " + "\000x\000a\000a\000a\000a\000a\000a\000a\000a\000f\000g\000 " + "\000x\000\000", + 4, 36); + x3("\000(\000z\000)\000(\000)\000(\000)\000(\000?\000<\000_\0009\000>" + "\000a\000)\000\134\000g\000<\000_\0009\000>\000\000", + "\000z\000a\000a\000\000", 4, 6, 1); + x2("\000(\000.\000)\000(\000(\000(\000?\000<\000_\000>\000a\000)\000)\000)" + "\000\134\000k\000<\000_\000>\000\000", + "\000z\000a\000a\000\000", 0, 6); + x2("\000(\000(\000?\000<\000n\000a\000m\000e\0001\000>\000\134\000d\000)\000|" + "\000(\000?\000<\000n\000a\000m\000e\0002\000>\000\134\000w\000)\000)\000(" + "\000\134\000k\000<\000n\000a\000m\000e\0001\000>\000|\000\134\000k\000<" + "\000n\000a\000m\000e\0002\000>\000)\000\000", + "\000f\000f\000\000", 0, 4); + x2("\000(\000?\000:\000(\000?\000<\000x\000>\000)\000|\000(\000?\000<" + "\000x\000>\000e\000f\000g\000)\000)\000\134\000k\000<\000x\000>\000\000", + "\000\000", 0, 0); + x2("\000(\000?\000:\000(\000?\000<\000x\000>\000a\000b\000c\000)\000|\000(" + "\000?\000<\000x\000>\000e\000f\000g\000)\000)\000\134\000k\000<\000x\000>" + "\000\000", + "\000a\000b\000c\000e\000f\000g\000e\000f\000g\000\000", 6, 18); + n("\000(\000?\000:\000(\000?\000<\000x\000>\000a\000b\000c\000)\000|\000(" + "\000?\000<\000x\000>\000e\000f\000g\000)\000)\000\134\000k\000<\000x\000>" + "\000\000", + "\000a\000b\000c\000e\000f\000g\000\000"); + x2("\000(\000?\000:\000(\000?\000<\000n\0001\000>\000.\000)\000|\000(\000?" + "\000<\000n\0001\000>\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>" + "\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000." + "\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000." + "\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000." + "\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000." + "\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000." + "\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000." + "\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>" + "\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?" + "\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000." + "\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000." + "\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<" + "\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000." + "\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000." + "\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000)" + "\000\134\000k\000<\000n\0001\000>\000$\000\000", + "\000a\000-\000p\000y\000u\000m\000p\000y\000u\000m\000\000", 4, 20); + x3("\000(\000?\000:\000(\000?\000<\000n\0001\000>\000.\000)\000|\000(\000?" + "\000<\000n\0001\000>\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>" + "\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000." + "\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000." + "\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000." + "\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000." + "\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000." + "\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000." + "\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>" + "\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?" + "\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000." + "\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000." + "\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<" + "\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000." + "\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000." + "\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000)" + "\000\134\000k\000<\000n\0001\000>\000$\000\000", + "\000x\000x\000x\000x\000a\000b\000c\000d\000e\000f\000g\000h\000i\000j" + "\000k\000l\000m\000n\000a\000b\000c\000d\000e\000f\000g\000h\000i\000j" + "\000k\000l\000m\000n\000\000", + 8, 36, 14); + x3("\000(\000?\000<\000n\000a\000m\000e\0001\000>\000)\000(\000?\000<" + "\000n\000a\000m\000e\0002\000>\000)\000(\000?\000<" + "\000n\000a\000m\000e\0003\000>\000)\000(\000?\000<" + "\000n\000a\000m\000e\0004\000>\000)\000(\000?\000<" + "\000n\000a\000m\000e\0005\000>\000)\000(\000?\000<" + "\000n\000a\000m\000e\0006\000>\000)\000(\000?\000<" + "\000n\000a\000m\000e\0007\000>\000)\000(\000?\000<" + "\000n\000a\000m\000e\0008\000>\000)\000(\000?\000<" + "\000n\000a\000m\000e\0009\000>\000)\000(\000?\000<" + "\000n\000a\000m\000e\0001\0000\000>\000)\000(\000?\000<" + "\000n\000a\000m\000e\0001\0001\000>\000)\000(\000?\000<" + "\000n\000a\000m\000e\0001\0002\000>\000)\000(\000?\000<" + "\000n\000a\000m\000e\0001\0003\000>\000)\000(\000?\000<" + "\000n\000a\000m\000e\0001\0004\000>\000)\000(\000?\000<" + "\000n\000a\000m\000e\0001\0005\000>\000)\000(\000?\000<" + "\000n\000a\000m\000e\0001\0006\000>\000a\000a\000a\000)\000(\000?\000<" + "\000n\000a\000m\000e\0001\0007\000>\000)\000$\000\000", + "\000a\000a\000a\000\000", 0, 6, 16); + x2("\000(\000?\000<\000f\000o\000o\000>\000a\000|\000\134\000(" + "\000\134\000g\000<\000f\000o\000o\000>\000\134\000)\000)\000\000", + "\000a\000\000", 0, 2); + x2("\000(\000?\000<\000f\000o\000o\000>\000a\000|\000\134\000(" + "\000\134\000g\000<\000f\000o\000o\000>\000\134\000)\000)\000\000", + "\000(\000(\000(\000(\000(\000(\000a\000)\000)\000)\000)\000)\000)" + "\000\000", + 0, 26); + x3("\000(\000?\000<\000f\000o\000o\000>\000a\000|\000\134\000(" + "\000\134\000g\000<\000f\000o\000o\000>\000\134\000)\000)\000\000", + "\000(\000(\000(\000(\000(\000(\000(\000(\000a\000)\000)\000)\000)\000)" + "\000)\000)\000)\000\000", + 0, 34, 1); + x2("\000\134\000g\000<\000b\000a\000r\000>\000|" + "\000\134\000z\000E\000N\000D\000(\000?\000<\000b\000a\000r\000>\000.\000*" + "\000a\000b\000c\000$\000)\000\000", + "\000a\000b\000c\000x\000x\000x\000a\000b\000c\000\000", 0, 18); + x2("\000\134\000g\000<\0001\000>\000|\000\134\000z\000E\000N\000D\000(\000." + "\000a\000.\000)\000\000", + "\000b\000a\000c\000\000", 0, 6); + x3("\000\134\000g\000<\000_\000A\000>\000\134\000g\000<\000_\000A\000>\000|" + "\000\134\000z\000E\000N\000D\000(\000.\000a\000.\000)\000(\000?\000<\000_" + "\000A\000>\000.\000b\000.\000)\000\000", + "\000x\000b\000x\000y\000b\000y\000\000", 6, 12, 1); + x2("\000\134\000A\000(\000?\000:\000\134\000g\000<\000p\000o\000n\000>\000|" + "\000\134\000g\000<\000p\000a\000n\000>\000|" + "\000\134\000z\000E\000N\000D\000 \000 " + "\000(\000?\000<\000p\000a\000n\000>\000a\000|\000c\000\134\000g\000<" + "\000p\000o\000n\000>\000c\000)\000(\000?\000<\000p\000o\000n\000>" + "\000b\000|\000d\000\134\000g\000<\000p\000a\000n\000>\000d\000)\000)\000$" + "\000\000", + "\000c\000d\000c\000b\000c\000d\000c\000\000", 0, 14); + x2("\000\134\000A\000(\000?\000<\000n\000>\000|\000a\000\134\000g\000<" + "\000m\000>\000)\000\134\000z\000|\000\134\000z\000E\000N\000D\000 " + "\000(\000?\000<\000m\000>\000\134\000g\000<\000n\000>\000)\000\000", + "\000a\000a\000a\000a\000\000", 0, 8); + x2("\000(\000?\000<\000n\000>\000(\000a\000|\000b\000\134\000g\000<\000n\000>" + "\000c\000)\000{\0003\000,\0005\000}\000)\000\000", + "\000b\000a\000a\000a\000a\000c\000a\000\000", 2, 10); + x2("\000(\000?\000<\000n\000>\000(\000a\000|\000b\000\134\000g\000<\000n\000>" + "\000c\000)\000{\0003\000,\0005\000}\000)\000\000", + "\000b\000a\000a\000a\000a\000c\000a\000a\000a\000a\000a\000\000", 0, 20); + x2("\000(\000?\000<\000p\000a\000r\000e\000>\000\134\000(\000(\000[\000^" + "\000\134\000(\000\134\000)\000]\000+\000+\000|\000\134\000g\000<" + "\000p\000a\000r\000e\000>\000)\000*\000+\000\134\000)\000)\000\000", + "\000(\000(\000a\000)\000)\000\000", 0, 10); + x2("\000(\000)\000*\000\134\0001\000\000", "\000\000", 0, 0); + x2("\000(\000?\000:\000(\000)\000|\000(\000)\000)\000*" + "\000\134\0001\000\134\0002\000\000", + "\000\000", 0, 0); + x3("\000(\000?\000:\000\134\0001\000a\000|\000(\000)\000)\000*\000\000", + "\000a\000\000", 0, 0, 1); + x2("\000x\000(\000(\000.\000)\000*\000)\000*\000x\000\000", + "\0000\000x\0001\000x\0002\000x\0003\000\000", 2, 12); + x2("\000x\000(\000(\000.\000)\000*\000)\000*\000x\000(\000?\000i\000:" + "\000\134\0001\000)\000\134\000Z\000\000", + "\0000\000x\0001\000x\0002\000x\0001\000X\0002\000\000", 2, 18); + x2("\000(\000?\000:\000(\000)\000|\000(\000)\000|\000(\000)\000|\000(\000)" + "\000|\000(\000)\000|\000(\000)\000)\000*" + "\000\134\0002\000\134\0005\000\000", + "\000\000", 0, 0); + x2("\000(\000?\000:\000(\000)\000|\000(\000)\000|\000(\000)\000|\000(" + "\000x\000)\000|\000(\000)\000|\000(\000)\000)\000*" + "\000\134\0002\000b\000\134\0005\000\000", + "\000b\000\000", 0, 2); + x2("\217\372\000\000", "\217\372\000\000", 0, 2); + x2("\000\000", "0B\000\000", 0, 0); + x2("0B\000\000", "0B\000\000", 0, 2); + n("0D\000\000", "0B\000\000"); + x2("0F0F\000\000", "0F0F\000\000", 0, 4); + x2("0B0D0F\000\000", "0B0D0F\000\000", 0, 6); + x2("0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S" + "\000\000", + "0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S" + "\000\000", + 0, 70); + x2("0B\000\000", "0D0B\000\000", 2, 4); + x2("0D0F\000\000", "0B0D0F\000\000", 2, 6); + x2("e\207\000\000", "e\207\000\000", 0, 2); + x2("\000.\000\000", "0B\000\000", 0, 2); + x2("\000.\000.\000\000", "0K0M\000\000", 0, 4); + x2("\000(\000?\000u\000)\000\134\000w\000\000", "0J\000\000", 0, 2); + n("\000(\000?\000u\000)\000\134\000W\000\000", "0B\000\000"); + x2("\000(\000?\000u\000)\000[\000\134\000W\000]\000\000", "0F\000$\000\000", + 2, 4); + x2("\000\134\000S\000\000", "0]\000\000", 0, 2); + x2("\000\134\000S\000\000", "o\042\000\000", 0, 2); + x2("\000\134\000b\000\000", "l\027\000 \000\000", 0, 0); + x2("\000\134\000b\000\000", "\000 0{\000\000", 2, 2); + x2("\000\134\000B\000\000", "0[0]\000 \000\000", 2, 2); + x2("\000\134\000B\000\000", "0F\000 \000\000", 4, 4); + x2("\000\134\000B\000\000", "\000 0D\000\000", 0, 0); + x2("\000[0_0a\000]\000\000", "0a\000\000", 0, 2); + n("\000[0j0k\000]\000\000", "0l\000\000"); + x2("\000[0F\000-0J\000]\000\000", "0H\000\000", 0, 2); + n("\000[\000^0Q\000]\000\000", "0Q\000\000"); + x2("\000(\000?\000u\000)\000[\000\134\000w\000]\000\000", "0m\000\000", 0, 2); + n("\000[\000\134\000d\000]\000\000", "0u\000\000"); + x2("\000[\000\134\000D\000]\000\000", "0o\000\000", 0, 2); + n("\000[\000\134\000s\000]\000\000", "0O\000\000"); + x2("\000[\000\134\000S\000]\000\000", "0x\000\000", 0, 2); + x2("\000(\000?\000u\000)\000[\000\134\000w\000\134\000d\000]\000\000", + "0\210\000\000", 0, 2); + x2("\000(\000?\000u\000)\000[\000\134\000w\000\134\000d\000]\000\000", + "\000 \000 \000 0\210\000\000", 6, 8); + n("\000(\000?\000u\000)\000\134\000w\233<\216\312\000\000", + "\000 \233<\216\312\000\000"); + x2("\000(\000?\000u\000)\233<\000\134\000W\216\312\000\000", + "\233<\000 \216\312\000\000", 0, 6); + x2("0B\000.0D\000.0F\000\000", "0B0B0D0D0F\000\000", 0, 10); + x2("\000(\000?\000u\000)\000.\000\134\000w0F\000\134\000W\000.\000.0^" + "\000\000", + "0H0F0F\000 0F0^0^\000\000", 0, 14); + x2("\000(\000?\000u\000)\000\134\000s\000\134\000w0S0S0S\000\000", + "\000 0S0S0S0S\000\000", 0, 10); + x2("0B0B\000.0Q\000\000", "0B0B0Q0Q\000\000", 0, 8); + n("\000.0D\000\000", "0D0H\000\000"); + x2("\000.0J\000\000", "0J0J\000\000", 0, 4); + x2("\000^0B\000\000", "0B\000\000", 0, 2); + x2("\000^0\200\000$\000\000", "0\200\000\000", 0, 2); + x2("\000(\000?\000u\000)\000^\000\134\000w\000$\000\000", "0k\000\000", 0, 2); + x2("\000(\000?\000u\000)\000^\000\134\000w0K0M0O0Q0S\000$\000\000", + "\000z0K0M0O0Q0S\000\000", 0, 12); + x2("\000(\000?\000u\000)\000^\000\134\000w\000.\000.\000.0F0H0J\000$\000\000", + "\000z0B0D0F0F0H0J\000\000", 0, 14); + x2("\000(\000?\000u\000)" + "\000\134\000w\000\134\000w\000\134\000s\000\134\000W0J0J0J\000\134\000d" + "\000\000", + "\000a0J\000 \000 0J0J0J\0004\000\000", 0, 16); + x2("\000\134\000A0_0a0d\000\000", "0_0a0d\000\000", 0, 6); + x2("0\2000\2010\202\000\134\000Z\000\000", "0\2000\2010\202\000\000", 0, 6); + x2("0K0M0O\000\134\000z\000\000", "0K0M0O\000\000", 0, 6); + x2("0K0M0O\000\134\000Z\000\000", "0K0M0O\000\012\000\000", 0, 6); + x2("\000\134\000G0}0t\000\000", "0}0t\000\000", 0, 4); + n("\000\134\000G0H\000\000", "0F0H0J\000\000"); + n("0h0f\000\134\000G\000\000", "0h0f\000\000"); + n("0~0\177\000\134\000A\000\000", "0~0\177\000\000"); + n("0~\000\134\000A0\177\000\000", "0~0\177\000\000"); + x2("\000(\000?\000=0[\000)0[\000\000", "0[\000\000", 0, 2); + n("\000(\000?\000=0F\000)\000.\000\000", "0D\000\000"); + x2("\000(\000?\000!0F\000)0K\000\000", "0K\000\000", 0, 2); + n("\000(\000?\000!0h\000)0B\000\000", "0h\000\000"); + x2("\000(\000?\000i\000:0B\000)\000\000", "0B\000\000", 0, 2); + x2("\000(\000?\000i\000:0v0y\000)\000\000", "0v0y\000\000", 0, 4); + n("\000(\000?\000i\000:0D\000)\000\000", "0F\000\000"); + x2("\000(\000?\000m\000:0\210\000.\000)\000\000", "0\210\000\012\000\000", 0, + 4); + x2("\000(\000?\000m\000:\000.0\201\000)\000\000", "0~\000\0120\201\000\000", + 2, 6); + x2("0B\000?\000\000", "\000\000", 0, 0); + x2("Y\011\000?\000\000", "S\026\000\000", 0, 0); + x2("Y\011\000?\000\000", "Y\011\000\000", 0, 2); + x2("\221\317\000*\000\000", "\000\000", 0, 0); + x2("\221\317\000*\000\000", "\221\317\000\000", 0, 2); + x2("[P\000*\000\000", "[P[P[P\000\000", 0, 6); + x2("\231\254\000*\000\000", + "\236\177\231\254\231\254\231\254\231\254\000\000", 0, 0); + n("\134q\000+\000\000", "\000\000"); + x2("l\263\000+\000\000", "l\263\000\000", 0, 2); + x2("fB\000+\000\000", "fBfBfBfB\000\000", 0, 8); + x2("0H\000+\000\000", "0H0H0F0F0F\000\000", 0, 4); + x2("0F\000+\000\000", "0J0F0F0F0F\000\000", 2, 10); + x2("\000.\000?\000\000", "0_\000\000", 0, 2); + x2("\000.\000*\000\000", "0q0t0w0z\000\000", 0, 8); + x2("\000.\000+\000\000", "0\215\000\000", 0, 2); + x2("\000.\000+\000\000", "0D0F0H0K\000\012\000\000", 0, 8); + x2("0B\000|0D\000\000", "0B\000\000", 0, 2); + x2("0B\000|0D\000\000", "0D\000\000", 0, 2); + x2("0B0D\000|0D0F\000\000", "0B0D\000\000", 0, 4); + x2("0B0D\000|0D0F\000\000", "0D0F\000\000", 0, 4); + x2("0\222\000(\000?\000:0K0M\000|0M0O\000)\000\000", "0\2220K0M\000\000", 0, + 6); + x2("0\222\000(\000?\000:0K0M\000|0M0O\000)0Q\000\000", "0\2220M0O0Q\000\000", + 0, 8); + x2("0B0D\000|\000(\000?\000:0B0F\000|0B0\222\000)\000\000", "0B0\222\000\000", + 0, 4); + x2("0B\000|0D\000|0F\000\000", "0H0F\000\000", 2, 4); + x2("0B\000|0D\000|0F0H\000|0J0K0M\000|0O\000|0Q0S0U\000|0W0Y0[\000|0]\000|0_" + "0a\000|0d0f0h0j0k\000|0l0m\000\000", + "0W0Y0[\000\000", 0, 6); + n("0B\000|0D\000|0F0H\000|0J0K0M\000|0O\000|0Q0S0U\000|0W0Y0[\000|0]\000|0_" + "0a\000|0d0f0h0j0k\000|0l0m\000\000", + "0Y0[\000\000"); + x2("0B\000|\000^0\217\000\000", "0v0B\000\000", 2, 4); + x2("0B\000|\000^0\222\000\000", "0\2220B\000\000", 0, 2); + x2("\233<\000|\000\134\000G\216\312\000\000", "0Q\216\312\233<\000\000", 4, + 6); + x2("\233<\000|\000\134\000G\216\312\000\000", "\216\312\233<\000\000", 0, 2); + x2("\233<\000|\000\134\000A\216\312\000\000", "\000b\216\312\233<\000\000", 4, + 6); + x2("\233<\000|\000\134\000A\216\312\000\000", "\216\312\000\000", 0, 2); + x2("\233<\000|\216\312\000\134\000Z\000\000", "\216\312\233<\000\000", 2, 4); + x2("\233<\000|\216\312\000\134\000Z\000\000", "\216\312\000\000", 0, 2); + x2("\233<\000|\216\312\000\134\000Z\000\000", "\216\312\000\012\000\000", 0, + 2); + x2("\233<\000|\216\312\000\134\000z\000\000", "\216\312\233<\000\000", 2, 4); + x2("\233<\000|\216\312\000\134\000z\000\000", "\216\312\000\000", 0, 2); + x2("\000(\000?\000u\000)\000\134\000w\000|\000\134\000s\000\000", + "0J\000\000", 0, 2); + x2("\000(\000?\000u\000)\000\134\000w\000|\000%\000\000", "\000%0J\000\000", + 0, 2); + x2("\000(\000?\000u\000)\000\134\000w\000|\000[\000&\000$\000]\000\000", + "0F\000&\000\000", 0, 2); + x2("\000[0D\000-0Q\000]\000\000", "0F\000\000", 0, 2); + x2("\000[0D\000-0Q\000]\000|\000[\000^0K\000-0S\000]\000\000", "0B\000\000", + 0, 2); + x2("\000[0D\000-0Q\000]\000|\000[\000^0K\000-0S\000]\000\000", "0K\000\000", + 0, 2); + x2("\000[\000^0B\000]\000\000", "\000\012\000\000", 0, 2); + x2("\000(\000?\000:0B\000|\000[0F\000-0M\000]\000)\000|0D0\222\000\000", + "0F0\222\000\000", 0, 2); + x2("\000(\000?\000:0B\000|\000[0F\000-0M\000]\000)\000|0D0\222\000\000", + "0D0\222\000\000", 0, 4); + x2("0B0D0F\000|\000(\000?\000=0Q0Q\000)\000.\000.0{\000\000", + "0Q0Q0{\000\000", 0, 6); + x2("0B0D0F\000|\000(\000?\000!0Q0Q\000)\000.\000.0{\000\000", + "0B0D0{\000\000", 0, 6); + x2("\000(\000?\000=0\2220B\000)\000.\000.0B\000|\000(\000?\000=" + "0\2220\222\000)\000.\000.0B\000\000", + "0\2220\2220B\000\000", 0, 6); + x2("\000(\000?\000<\000=0B\000|0D0F\000)0D\000\000", "0D0F0D\000\000", 4, 6); + n("\000(\000?\000>0B\000|0B0D0H\000)0F\000\000", "0B0D0H0F\000\000"); + x2("\000(\000?\000>0B0D0H\000|0B\000)0F\000\000", "0B0D0H0F\000\000", 0, 8); + x2("0B\000?\000|0D\000\000", "0B\000\000", 0, 2); + x2("0B\000?\000|0D\000\000", "0D\000\000", 0, 0); + x2("0B\000?\000|0D\000\000", "\000\000", 0, 0); + x2("0B\000*\000|0D\000\000", "0B0B\000\000", 0, 4); + x2("0B\000*\000|0D\000*\000\000", "0D0B\000\000", 0, 0); + x2("0B\000*\000|0D\000*\000\000", "0B0D\000\000", 0, 2); + x2("\000[\000a0B\000]\000*\000|0D\000*\000\000", "\000a0B0D0D0D\000\000", 0, + 4); + x2("0B\000+\000|0D\000*\000\000", "\000\000", 0, 0); + x2("0B\000+\000|0D\000*\000\000", "0D0D0D\000\000", 0, 6); + x2("0B\000+\000|0D\000*\000\000", "0B0D0D0D\000\000", 0, 2); + x2("0B\000+\000|0D\000*\000\000", "\000a0B0D0D0D\000\000", 0, 0); + n("0B\000+\000|0D\000+\000\000", "\000\000"); + x2("\000(0B\000|0D\000)\000?\000\000", "0D\000\000", 0, 2); + x2("\000(0B\000|0D\000)\000*\000\000", "0D0B\000\000", 0, 4); + x2("\000(0B\000|0D\000)\000+\000\000", "0D0B0D\000\000", 0, 6); + x2("\000(0B0D\000|0F0B\000)\000+\000\000", "0F0B0B0D0F0H\000\000", 0, 8); + x2("\000(0B0D\000|0F0H\000)\000+\000\000", "0F0B0B0D0F0H\000\000", 4, 12); + x2("\000(0B0D\000|0F0B\000)\000+\000\000", "0B0B0D0F0B\000\000", 2, 10); + x2("\000(0B0D\000|0F0B\000)\000+\000\000", "0B0D0\2220F0B\000\000", 0, 4); + x2("\000(0B0D\000|0F0B\000)\000+\000\000", + "\000$\000$\000z\000z\000z\000z0B0D0\2220F0B\000\000", 12, 16); + x2("\000(0B\000|0D0B0D\000)\000+\000\000", "0B0D0B0D0B\000\000", 0, 10); + x2("\000(0B\000|0D0B0D\000)\000+\000\000", "0D0B\000\000", 2, 4); + x2("\000(0B\000|0D0B0D\000)\000+\000\000", "0D0B0B0B0D0B\000\000", 2, 8); + x2("\000(\000?\000:0B\000|0D\000)\000(\000?\000:0B\000|0D\000)\000\000", + "0B0D\000\000", 0, 4); + x2("\000(\000?\000:0B\000*\000|0D\000*\000)\000(\000?\000:0B\000*\000|0D\000*" + "\000)\000\000", + "0B0B0B0D0D0D\000\000", 0, 6); + x2("\000(\000?\000:0B\000*\000|0D\000*\000)\000(\000?\000:0B\000+\000|0D\000+" + "\000)\000\000", + "0B0B0B0D0D0D\000\000", 0, 12); + x2("\000(\000?\000:0B\000+\000|0D\000+\000)\000{\0002\000}\000\000", + "0B0B0B0D0D0D\000\000", 0, 12); + x2("\000(\000?\000:0B\000+\000|0D\000+\000)\000{\0001\000,\0002\000}\000\000", + "0B0B0B0D0D0D\000\000", 0, 12); + x2("\000(\000?\000:0B\000+\000|\000\134\000A0D\000*\000)0F0F\000\000", + "0F0F\000\000", 0, 4); + n("\000(\000?\000:0B\000+\000|\000\134\000A0D\000*\000)0F0F\000\000", + "0B0D0F0F\000\000"); + x2("\000(\000?\000:\000^0B\000+\000|0D\000+\000)\000*0F\000\000", + "0B0B0D0D0D0B0D0F\000\000", 12, 16); + x2("\000(\000?\000:\000^0B\000+\000|0D\000+\000)\000*0F\000\000", + "0B0B0D0D0D0D0F\000\000", 0, 14); + x2("0F\000{\0000\000,\000}\000\000", "0F0F0F0F\000\000", 0, 8); + x2("0B\000|\000(\000?\000i\000)\000c\000\000", "\000C\000\000", 0, 2); + x2("\000(\000?\000i\000)\000c\000|0B\000\000", "\000C\000\000", 0, 2); + x2("\000(\000?\000i\000:0B\000)\000|\000a\000\000", "\000a\000\000", 0, 2); + n("\000(\000?\000i\000:0B\000)\000|\000a\000\000", "\000A\000\000"); + x2("\000[0B0D0F\000]\000?\000\000", "0B0D0F\000\000", 0, 2); + x2("\000[0B0D0F\000]\000*\000\000", "0B0D0F\000\000", 0, 6); + x2("\000[\000^0B0D0F\000]\000*\000\000", "0B0D0F\000\000", 0, 0); + n("\000[\000^0B0D0F\000]\000+\000\000", "0B0D0F\000\000"); + x2("0B\000?\000?\000\000", "0B0B0B\000\000", 0, 0); + x2("0D0B\000?\000?0D\000\000", "0D0B0D\000\000", 0, 6); + x2("0B\000*\000?\000\000", "0B0B0B\000\000", 0, 0); + x2("0D0B\000*\000?\000\000", "0D0B0B\000\000", 0, 2); + x2("0D0B\000*\000?0D\000\000", "0D0B0B0D\000\000", 0, 8); + x2("0B\000+\000?\000\000", "0B0B0B\000\000", 0, 2); + x2("0D0B\000+\000?\000\000", "0D0B0B\000\000", 0, 4); + x2("0D0B\000+\000?0D\000\000", "0D0B0B0D\000\000", 0, 8); + x2("\000(\000?\000:Y)\000?\000)\000?\000?\000\000", "Y)\000\000", 0, 0); + x2("\000(\000?\000:Y)\000?\000?\000)\000?\000\000", "Y)\000\000", 0, 0); + x2("\000(\000?\000:Y\042\000?\000)\000+\000?\000\000", + "Y\042Y\042Y\042\000\000", 0, 2); + x2("\000(\000?\000:\230\250\000+\000)\000?\000?\000\000", + "\230\250\230\250\230\250\000\000", 0, 0); + x2("\000(\000?\000:\226\352\000+\000)\000?\000?\227\034\000\000", + "\226\352\226\352\226\352\227\034\000\000", 0, 8); + x2("\000(\000?\000:0B0D\000)\000?\000{\0002\000}\000\000", "\000\000", 0, 0); + x2("\000(\000?\000:\233<\216\312\000)\000?\000{\0002\000}\000\000", + "\233<\216\312\233<\216\312\233<\000\000", 0, 8); + x2("\000(\000?\000:\233<\216\312\000)\000*\000{\0000\000}\000\000", + "\233<\216\312\233<\216\312\233<\000\000", 0, 0); + x2("\000(\000?\000:\233<\216\312\000)\000{\0003\000,\000}\000\000", + "\233<\216\312\233<\216\312\233<\216\312\233<\216\312\000\000", 0, 16); + n("\000(\000?\000:\233<\216\312\000)\000{\0003\000,\000}\000\000", + "\233<\216\312\233<\216\312\000\000"); + x2("\000(\000?\000:\233<\216\312\000)\000{\0002\000,\0004\000}\000\000", + "\233<\216\312\233<\216\312\233<\216\312\000\000", 0, 12); + x2("\000(\000?\000:\233<\216\312\000)\000{\0002\000,\0004\000}\000\000", + "\233<\216\312\233<\216\312\233<\216\312\233<\216\312\233<" + "\216\312\000\000", + 0, 16); + x2("\000(\000?\000:\233<\216\312\000)\000{\0002\000,\0004\000}\000?\000\000", + "\233<\216\312\233<\216\312\233<\216\312\233<\216\312\233<" + "\216\312\000\000", + 0, 8); + x2("\000(\000?\000:\233<\216\312\000)\000{\000,\000}\000\000", + "\233<\216\312\000{\000,\000}\000\000", 0, 10); + x2("\000(\000?\000:0K0M0O\000)\000+\000?\000{\0002\000}\000\000", + "0K0M0O0K0M0O0K0M0O\000\000", 0, 12); + x3("\000(pk\000)\000\000", "pk\000\000", 0, 2, 1); + x3("\000(pkl4\000)\000\000", "pkl4\000\000", 0, 4, 1); + x2("\000(\000(fB\225\223\000)\000)\000\000", "fB\225\223\000\000", 0, 4); + x3("\000(\000(\230\250l4\000)\000)\000\000", "\230\250l4\000\000", 0, 4, 1); + x3("\000(\000(f(e\345\000)\000)\000\000", "f(e\345\000\000", 0, 4, 2); + x3("\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(" + "\000(\000(\000(\000(\000(\000(\221\317[P\000)\000)\000)\000)\000)\000)" + "\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)" + "\000\000", + "\221\317[P\000\000", 0, 4, 20); + x3("\000(0B0D\000)\000(0F0H\000)\000\000", "0B0D0F0H\000\000", 0, 4, 1); + x3("\000(0B0D\000)\000(0F0H\000)\000\000", "0B0D0F0H\000\000", 4, 8, 2); + x3("\000(\000)\000(0B\000)0D0F\000(0H0J0K\000)0M0O0Q0S\000\000", + "0B0D0F0H0J0K0M0O0Q0S\000\000", 6, 12, 3); + x3("\000(\000(\000)\000(0B\000)0D0F\000(0H0J0K\000)0M0O0Q0S\000)\000\000", + "0B0D0F0H0J0K0M0O0Q0S\000\000", 6, 12, 4); + x3("\000.\000*\000(0\3250\251\000)0\3630\3730\336\000(0\363\000(\000)" + "0\2670\3450\277\000)0\2440\363\000\000", + "0\3250\2510\3630\3730\3360\3630\2670\3450\2770\2440\363\000\000", 10, 18, + 2); + x2("\000(\000^0B\000)\000\000", "0B\000\000", 0, 2); + x3("\000(0B\000)\000|\000(0B\000)\000\000", "0D0B\000\000", 2, 4, 1); + x3("\000(\000^0B\000)\000|\000(0B\000)\000\000", "0D0B\000\000", 2, 4, 2); + x3("\000(0B\000?\000)\000\000", "0B0B0B\000\000", 0, 2, 1); + x3("\000(0~\000*\000)\000\000", "0~0~0~\000\000", 0, 6, 1); + x3("\000(0h\000*\000)\000\000", "\000\000", 0, 0, 1); + x3("\000(0\213\000+\000)\000\000", + "0\2130\2130\2130\2130\2130\2130\213\000\000", 0, 14, 1); + x3("\000(0u\000+\000|0x\000*\000)\000\000", "0u0u0u0x0x\000\000", 0, 6, 1); + x3("\000(0B\000+\000|0D\000?\000)\000\000", "0D0D0D0B0B\000\000", 0, 2, 1); + x3("\000(0B0D0F\000)\000?\000\000", "0B0D0F\000\000", 0, 6, 1); + x3("\000(0B0D0F\000)\000*\000\000", "0B0D0F\000\000", 0, 6, 1); + x3("\000(0B0D0F\000)\000+\000\000", "0B0D0F\000\000", 0, 6, 1); + x3("\000(0U0W0Y\000|0B0D0F\000)\000+\000\000", "0B0D0F\000\000", 0, 6, 1); + x3("\000(\000[0j0k0l\000]\000[0K0M0O\000]\000|0K0M0O\000)\000+\000\000", + "0K0M0O\000\000", 0, 6, 1); + x3("\000(\000(\000?\000i\000:0B0D0F\000)\000)\000\000", "0B0D0F\000\000", 0, + 6, 1); + x3("\000(\000(\000?\000m\000:0B\000.0F\000)\000)\000\000", + "0B\000\0120F\000\000", 0, 6, 1); + x3("\000(\000(\000?\000=0B0\223\000)0B\000)\000\000", "0B0\2230D\000\000", 0, + 2, 1); + x3("0B0D0F\000|\000(\000.0B0D0H\000)\000\000", "0\2230B0D0H\000\000", 0, 8, + 1); + x3("0B\000*\000(\000.\000)\000\000", "0B0B0B0B0\223\000\000", 8, 10, 1); + x3("0B\000*\000?\000(\000.\000)\000\000", "0B0B0B0B0\223\000\000", 0, 2, 1); + x3("0B\000*\000?\000(0\223\000)\000\000", "0B0B0B0B0\223\000\000", 8, 10, 1); + x3("\000[0D0F0H\000]0B\000*\000(\000.\000)\000\000", + "0H0B0B0B0B0\223\000\000", 10, 12, 1); + x3("\000(\000\134\000A0D0D\000)0F0F\000\000", "0D0D0F0F\000\000", 0, 4, 1); + n("\000(\000\134\000A0D0D\000)0F0F\000\000", "0\2230D0D0F0F\000\000"); + x3("\000(\000^0D0D\000)0F0F\000\000", "0D0D0F0F\000\000", 0, 4, 1); + n("\000(\000^0D0D\000)0F0F\000\000", "0\2230D0D0F0F\000\000"); + x3("0\2150\215\000(0\2130\213\000$\000)\000\000", + "0\2150\2150\2130\213\000\000", 4, 8, 1); + n("0\2150\215\000(0\2130\213\000$\000)\000\000", + "0\2150\2150\2130\2130\213\000\000"); + x2("\000(q!\000)\000\134\0001\000\000", "q!q!\000\000", 0, 4); + n("\000(q!\000)\000\134\0001\000\000", "q!kf\000\000"); + x2("\000(zz\000?\000)\000\134\0001\000\000", "zzzz\000\000", 0, 4); + x2("\000(zz\000?\000?\000)\000\134\0001\000\000", "zzzz\000\000", 0, 0); + x2("\000(zz\000*\000)\000\134\0001\000\000", "zzzzzzzzzz\000\000", 0, 8); + x3("\000(zz\000*\000)\000\134\0001\000\000", "zzzzzzzzzz\000\000", 0, 4, 1); + x2("0B\000(0D\000*\000)\000\134\0001\000\000", "0B0D0D0D0D\000\000", 0, 10); + x2("0B\000(0D\000*\000)\000\134\0001\000\000", "0B0D\000\000", 0, 2); + x2("\000(0B\000*\000)\000(0D\000*\000)\000\134\0001\000\134\0002\000\000", + "0B0B0B0D0D0B0B0B0D0D\000\000", 0, 20); + x2("\000(0B\000*\000)\000(0D\000*\000)\000\134\0002\000\000", + "0B0B0B0D0D0D0D\000\000", 0, 14); + x3("\000(0B\000*\000)\000(0D\000*\000)\000\134\0002\000\000", + "0B0B0B0D0D0D0D\000\000", 6, 10, 2); + x2("\000(\000(\000(\000(\000(\000(\000(0}\000*\000)0z\000)\000)\000)\000)" + "\000)\000)0t\000\134\0007\000\000", + "0}0}0}0z0t0}0}0}\000\000", 0, 16); + x3("\000(\000(\000(\000(\000(\000(\000(0}\000*\000)0z\000)\000)\000)\000)" + "\000)\000)0t\000\134\0007\000\000", + "0}0}0}0z0t0}0}0}\000\000", 0, 6, 7); + x2("\000(0o\000)\000(0r\000)\000(0u\000)" + "\000\134\0002\000\134\0001\000\134\0003\000\000", + "0o0r0u0r0o0u\000\000", 0, 12); + x2("\000(\000[0M\000-0Q\000]\000)\000\134\0001\000\000", "0O0O\000\000", 0, + 4); + x2("\000(\000?\000u\000)\000(\000\134\000w\000\134\000d\000\134\000s\000)" + "\000\134\0001\000\000", + "0B\0005\000 0B\0005\000 \000\000", 0, 12); + n("\000(\000?\000u\000)\000(\000\134\000w\000\134\000d\000\134\000s\000)" + "\000\134\0001\000\000", + "0B\0005\000 0B\0005\000\000"); + x2("\000(\212\260\377\037\000|\000[0B\000-0F\000]\000{\0003\000}\000)" + "\000\134\0001\000\000", + "\212\260\377\037\212\260\377\037\000\000", 0, 8); + x2("\000.\000.\000.\000(\212\260\377\037\000|\000[0B\000-0F\000]\000{" + "\0003\000}\000)\000\134\0001\000\000", + "0B\000a0B\212\260\377\037\212\260\377\037\000\000", 0, 14); + x2("\000(\212\260\377\037\000|\000[0B\000-0F\000]\000{\0003\000}\000)" + "\000\134\0001\000\000", + "0F0D0F0F0D0F\000\000", 0, 12); + x2("\000(\000^0S\000)\000\134\0001\000\000", "0S0S\000\000", 0, 4); + n("\000(\000^0\200\000)\000\134\0001\000\000", "0\2010\2000\200\000\000"); + n("\000(0B\000$\000)\000\134\0001\000\000", "0B0B\000\000"); + n("\000(0B0D\000\134\000Z\000)\000\134\0001\000\000", "0B0D\000\000"); + x2("\000(0B\000*\000\134\000Z\000)\000\134\0001\000\000", "0B\000\000", 2, 2); + x2("\000.\000(0B\000*\000\134\000Z\000)\000\134\0001\000\000", "0D0B\000\000", + 2, 4); + x3("\000(\000.\000(0\2040D0\206\000)\000\134\0002\000)\000\000", + "\000z0\2040D0\2060\2040D0\206\000\000", 0, 14, 1); + x3("\000(\000.\000(\000.\000.\000\134\000d\000.\000)\000\134\0002\000)" + "\000\000", + "0B\0001\0002\0003\0004\0001\0002\0003\0004\000\000", 0, 18, 1); + x2("\000(\000(\000?\000i\000:0B\000v0Z\000)\000)\000\134\0001\000\000", + "0B\000v0Z0B\000v0Z\000\000", 0, 12); + x2("\000(\000?\000<a\0320K\000>Y\011\000|\000\134\000(\000\134\000g\000<" + "a\0320K\000>\000\134\000)\000)\000\000", + "\000(\000(\000(\000(\000(\000(Y\011\000)\000)\000)\000)\000)\000)" + "\000\000", + 0, 26); + x2("\000\134\000A\000(\000?\000:\000\134\000g\000<\226?\000_\0001\000>\000|" + "\000\134\000g\000<N\221\000_\0002\000>\000|\000\134\000z}BN\206\000 \000 " + "\000(\000?\000<\226?\000_\0001\000>\211\263\000|" + "\201\352\000\134\000g\000<N\221\000_\0002\000>\201\352\000)\000(\000?" + "\000<N\221\000_\0002\000>W(\000|\203\351\205\251\000\134\000g\000<\226?" + "\000_\0001\000>\203\351\205\251\000)\000)\000$\000\000", + "\203\351\205\251\201\352\203\351\205\251\201\352W(" + "\201\352\203\351\205\251\201\352\203\351\205\251\000\000", + 0, 26); + x2("\000[\000[0r0u\000]\000]\000\000", "0u\000\000", 0, 2); + x2("\000[\000[0D0J0F\000]0K\000]\000\000", "0K\000\000", 0, 2); + n("\000[\000[\000^0B\000]\000]\000\000", "0B\000\000"); + n("\000[\000^\000[0B\000]\000]\000\000", "0B\000\000"); + x2("\000[\000^\000[\000^0B\000]\000]\000\000", "0B\000\000", 0, 2); + x2("\000[\000[0K0M0O\000]\000&\000&0M0O\000]\000\000", "0O\000\000", 0, 2); + n("\000[\000[0K0M0O\000]\000&\000&0M0O\000]\000\000", "0K\000\000"); + n("\000[\000[0K0M0O\000]\000&\000&0M0O\000]\000\000", "0Q\000\000"); + x2("\000[0B\000-0\223\000&\000&0D\000-0\222\000&\000&0F\000-0\221\000]" + "\000\000", + "0\221\000\000", 0, 2); + n("\000[\000^0B\000-0\223\000&\000&0D\000-0\222\000&\000&0F\000-0\221\000]" + "\000\000", + "0\221\000\000"); + x2("\000[\000[\000^0B\000&\000&0B\000]\000&\000&0B\000-0\223\000]\000\000", + "0D\000\000", 0, 2); + n("\000[\000[\000^0B\000&\000&0B\000]\000&\000&0B\000-0\223\000]\000\000", + "0B\000\000"); + x2("\000[\000[\000^0B\000-0\223\000&\000&0D0F0H0J\000]\000&\000&\000[\000^" + "0F\000-0K\000]\000]\000\000", + "0M\000\000", 0, 2); + n("\000[\000[\000^0B\000-0\223\000&\000&0D0F0H0J\000]\000&\000&\000[\000^" + "0F\000-0K\000]\000]\000\000", + "0D\000\000"); + x2("\000[\000^\000[\000^0B0D0F\000]\000&\000&\000[\000^0F0H0J\000]\000]" + "\000\000", + "0F\000\000", 0, 2); + x2("\000[\000^\000[\000^0B0D0F\000]\000&\000&\000[\000^0F0H0J\000]\000]" + "\000\000", + "0H\000\000", 0, 2); + n("\000[\000^\000[\000^0B0D0F\000]\000&\000&\000[\000^0F0H0J\000]\000]" + "\000\000", + "0K\000\000"); + x2("\000[0B\000-\000&\000&\000-0B\000]\000\000", "\000-\000\000", 0, 2); + x2("\000[\000^\000[\000^\000a\000-\000z0B0D0F\000]\000&\000&\000[\000^" + "\000b\000c\000d\000e\000f\000g0F0H0J\000]\000q\000-\000w\000]\000\000", + "0H\000\000", 0, 2); + x2("\000[\000^\000[\000^\000a\000-\000z0B0D0F\000]\000&\000&\000[\000^" + "\000b\000c\000d\000e\000f\000g0F0H0J\000]\000g\000-\000w\000]\000\000", + "\000f\000\000", 0, 2); + x2("\000[\000^\000[\000^\000a\000-\000z0B0D0F\000]\000&\000&\000[\000^" + "\000b\000c\000d\000e\000f\000g0F0H0J\000]\000g\000-\000w\000]\000\000", + "\000g\000\000", 0, 2); + n("\000[\000^\000[\000^\000a\000-\000z0B0D0F\000]\000&\000&\000[\000^" + "\000b\000c\000d\000e\000f\000g0F0H0J\000]\000g\000-\000w\000]\000\000", + "\0002\000\000"); + x2("\000a\000<\000b\000>" + "0\3200\3740\2700\3470\3630n0\3000\2460\3630\3550\3740\311\000<" + "\000\134\000/\000b\000>\000\000", + "\000a\000<\000b\000>" + "0\3200\3740\2700\3470\3630n0\3000\2460\3630\3550\3740\311\000<\000/" + "\000b\000>\000\000", + 0, 40); + x2("\000.\000<\000b\000>" + "0\3200\3740\2700\3470\3630n0\3000\2460\3630\3550\3740\311\000<" + "\000\134\000/\000b\000>\000\000", + "\000a\000<\000b\000>" + "0\3200\3740\2700\3470\3630n0\3000\2460\3630\3550\3740\311\000<\000/" + "\000b\000>\000\000", + 0, 40); + fprintf(stdout, + "\nRESULT SUCC: %d, FAIL: %d, ERROR: %d (by Onigmo %s)\n", + nsucc, nfail, nerror, onig_version()); + +#ifndef POSIX_TEST + onig_region_free(region, 1); + onig_end(); +#endif + + return ((nfail == 0 && nerror == 0) ? 0 : -1); +} diff --git a/lib/edbee-lib/vendor/onig/tool/.gitignore b/lib/edbee-lib/vendor/onig/tool/.gitignore new file mode 100644 index 00000000..5658d47a --- /dev/null +++ b/lib/edbee-lib/vendor/onig/tool/.gitignore @@ -0,0 +1,17 @@ +# ignore UCD files +Blocks.txt +CaseFolding.txt +DerivedAge.txt +DerivedCoreProperties.txt +PropList.txt +PropertyAliases.txt +PropertyValueAliases.txt +Scripts.txt +SpecialCasing.txt +UnicodeData.txt +GraphemeBreakProperty.txt + +# ignore generated files +casefold.h +name2ctype.h +name2ctype.kwd diff --git a/lib/edbee-lib/vendor/onig/tool/case-folding.rb b/lib/edbee-lib/vendor/onig/tool/case-folding.rb new file mode 100755 index 00000000..c86eb8d8 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/tool/case-folding.rb @@ -0,0 +1,419 @@ +#!/usr/bin/ruby +require 'stringio' + +# Usage (for case folding only): +# $ wget http://www.unicode.org/Public/UNIDATA/CaseFolding.txt +# $ ruby case-folding.rb CaseFolding.txt -o casefold.h +# or (for case folding and case mapping): +# $ wget http://www.unicode.org/Public/UNIDATA/CaseFolding.txt +# $ wget http://www.unicode.org/Public/UNIDATA/UnicodeData.txt +# $ wget http://www.unicode.org/Public/UNIDATA/SpecialCasing.txt +# $ ruby case-folding.rb -m . -o casefold.h +# using -d or --debug will include UTF-8 characters in comments for debugging + +class CaseFolding + module Util + module_function + + def hex_seq(v) + v.map { |i| "0x%04x" % i }.join(", ") + end + + def print_table_1(dest, type, mapping_data, data) + for k, v in data = data.sort + sk = (Array === k and k.length > 1) ? "{#{hex_seq(k)}}" : ("0x%04x" % k) + if type=='CaseUnfold_11' and v.length>1 + # reorder CaseUnfold_11 entries to avoid special treatment for U+03B9/U+03BC/U+A64B + item = mapping_data.map("%04X" % k[0]) + upper = item.upper if item + v = v.sort_by { |i| ("%04X"%i) == upper ? 0 : 1 } + end + ck = @debug ? ' /* ' + Array(k).pack("U*") + ' */' : '' + cv = @debug ? ' /* ' + Array(v).map{|c|[c].pack("U*")}.join(", ") + ' */' : '' + dest.print(" {#{sk}#{ck}, {#{v.length}#{mapping_data.flags(k, type, v)}, {#{hex_seq(v)}#{cv}}}},\n") + end + data + end + + def print_table(dest, type, mapping_data, data) + dest.print("static const #{type}_Type #{type}_Table[] = {\n") + i = 0 + ret = data.inject([]) do |a, (n, d)| + dest.print("#define #{n} (*(#{type}_Type (*)[#{d.size}])(#{type}_Table+#{i}))\n") + i += d.size + a.concat(print_table_1(dest, type, mapping_data, d)) + end + dest.print("};\n\n") + ret + end + end + + include Util + + attr_reader :fold, :fold_locale, :unfold, :unfold_locale, :version + + def load(filename) + pattern = /([0-9A-F]{4,6}); ([CFT]); ([0-9A-F]{4,6})(?: ([0-9A-F]{4,6}))?(?: ([0-9A-F]{4,6}))?;/ + + @fold = fold = {} + @unfold = unfold = [{}, {}, {}] + @debug = false + @version = nil + turkic = [] + + IO.foreach(filename, mode: "rb") do |line| + @version ||= line[/-([0-9.]+).txt/, 1] + next unless res = pattern.match(line) + ch_from = res[1].to_i(16) + + if res[2] == 'T' + # Turkic case folding + turkic << ch_from + next + end + + # store folding data + ch_to = res[3..6].inject([]) do |a, i| + break a unless i + a << i.to_i(16) + end + fold[ch_from] = ch_to + + # store unfolding data + i = ch_to.length - 1 + (unfold[i][ch_to] ||= []) << ch_from + end + + # move locale dependent data to (un)fold_locale + @fold_locale = fold_locale = {} + @unfold_locale = unfold_locale = [{}, {}] + for ch_from in turkic + key = fold[ch_from] + i = key.length - 1 + unfold_locale[i][i == 0 ? key[0] : key] = unfold[i].delete(key) + fold_locale[ch_from] = fold.delete(ch_from) + end + self + end + + def range_check(code) + "#{code} <= MAX_CODE_VALUE && #{code} >= MIN_CODE_VALUE" + end + + def lookup_hash(key, type, data) + hash = "onigenc_unicode_#{key}_hash" + lookup = "onigenc_unicode_#{key}_lookup" + arity = Array(data[0][0]).size + gperf = %W"gperf -7 -k#{[*1..(arity*3)].join(',')} -F,-1 -c -j1 -i1 -t -T -E -C -H #{hash} -N #{lookup} -n" + argname = arity > 1 ? "codes" : "code" + argdecl = "const OnigCodePoint #{arity > 1 ? "*": ""}#{argname}" + n = 7 + m = (1 << n) - 1 + min, max = data.map {|c, *|c}.flatten.minmax + src = IO.popen(gperf, "r+") {|f| + f << "short\n%%\n" + data.each_with_index {|(k, _), i| + k = Array(k) + ks = k.map {|j| [(j >> n*2) & m, (j >> n) & m, (j) & m]}.flatten.map {|c| "\\x%.2x" % c}.join("") + f.printf "\"%s\", ::::/*%s*/ %d\n", ks, k.map {|c| "0x%.4x" % c}.join(","), i + } + f << "%%\n" + f.close_write + f.read + } + src.sub!(/^(#{hash})\s*\(.*?\).*?\n\{\n(.*)^\}/m) { + name = $1 + body = $2 + body.gsub!(/\(unsigned char\)str\[(\d+)\]/, "bits_#{arity > 1 ? 'at' : 'of'}(#{argname}, \\1)") + "#{name}(#{argdecl})\n{\n#{body}}" + } + src.sub!(/const short *\*\n^(#{lookup})\s*\(.*?\).*?\n\{\n(.*)^\}/m) { + name = $1 + body = $2 + body.sub!(/\benum\s+\{(\n[ \t]+)/, "\\&MIN_CODE_VALUE = 0x#{min.to_s(16)},\\1""MAX_CODE_VALUE = 0x#{max.to_s(16)},\\1") + body.gsub!(/(#{hash})\s*\(.*?\)/, "\\1(#{argname})") + body.gsub!(/\{"",-1}/, "-1") + body.gsub!(/\{"(?:[^"]|\\")+", *::::(.*)\}/, '\1') + body.sub!(/(\s+if\s)\(len\b.*\)/) do + "#$1(" << + (arity > 1 ? (0...arity).map {|i| range_check("#{argname}[#{i}]")}.join(" &&\n ") : range_check(argname)) << + ")" + end + v = nil + body.sub!(/(if\s*\(.*MAX_HASH_VALUE.*\)\n([ \t]*))\{(.*?)\n\2\}/m) { + pre = $1 + indent = $2 + s = $3 + s.sub!(/const char *\* *(\w+)( *= *wordlist\[\w+\]).\w+/, 'short \1 = wordlist[key]') + v = $1 + s.sub!(/\bif *\(.*\)/, "if (#{v} >= 0 && code#{arity}_equal(#{argname}, #{key}_Table[#{v}].from))") + "#{pre}{#{s}\n#{indent}}" + } + body.sub!(/\b(return\s+&)([^;]+);/, '\1'"#{key}_Table[#{v}].to;") + "static const #{type} *\n#{name}(#{argdecl})\n{\n#{body}}" + } + src + end + + def display(dest, mapping_data) + # print the header + dest.print("/* DO NOT EDIT THIS FILE. */\n") + dest.print("/* Generated by tool/case-folding.rb */\n\n") + + versions = version.scan(/\d+/) + dest.print("#if defined ONIG_UNICODE_VERSION_STRING && !( \\\n") + %w[MAJOR MINOR TEENY].zip(versions) do |n, v| + dest.print(" ONIG_UNICODE_VERSION_#{n} == #{v} && \\\n") + end + dest.print(" 1)\n") + dest.print("# error ONIG_UNICODE_VERSION_STRING mismatch\n") + dest.print("#endif\n") + dest.print("#define ONIG_UNICODE_VERSION_STRING #{version.dump}\n") + %w[MAJOR MINOR TEENY].zip(versions) do |n, v| + dest.print("#define ONIG_UNICODE_VERSION_#{n} #{v}\n") + end + dest.print("\n") + + # print folding data + + # CaseFold + CaseFold_Locale + name = "CaseFold_11" + data = print_table(dest, name, mapping_data, "CaseFold"=>fold, "CaseFold_Locale"=>fold_locale) + dest.print lookup_hash(name, "CodePointList3", data) + + # print unfolding data + + # CaseUnfold_11 + CaseUnfold_11_Locale + name = "CaseUnfold_11" + data = print_table(dest, name, mapping_data, name=>unfold[0], "#{name}_Locale"=>unfold_locale[0]) + dest.print lookup_hash(name, "CodePointList3", data) + + # CaseUnfold_12 + CaseUnfold_12_Locale + name = "CaseUnfold_12" + data = print_table(dest, name, mapping_data, name=>unfold[1], "#{name}_Locale"=>unfold_locale[1]) + dest.print lookup_hash(name, "CodePointList2", data) + + # CaseUnfold_13 + name = "CaseUnfold_13" + data = print_table(dest, name, mapping_data, name=>unfold[2]) + dest.print lookup_hash(name, "CodePointList2", data) + + # TitleCase + dest.print mapping_data.specials_output + end + + def debug! + @debug = true + end + + def self.load(*args) + new.load(*args) + end +end + +class MapItem + attr_accessor :upper, :lower, :title, :code + + def initialize(code, upper, lower, title) + @code = code + @upper = upper unless upper == '' + @lower = lower unless lower == '' + @title = title unless title == '' + end +end + +class CaseMapping + attr_reader :filename, :version + + def initialize(mapping_directory) + @mappings = {} + @specials = [] + @specials_length = 0 + @version = nil + IO.foreach(File.join(mapping_directory, 'UnicodeData.txt'), mode: "rb") do |line| + next if line =~ /^</ + code, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11, upper, lower, title = line.chomp.split ';' + unless upper and lower and title and (upper+lower+title)=='' + @mappings[code] = MapItem.new(code, upper, lower, title) + end + end + + @filename = File.join(mapping_directory, 'SpecialCasing.txt') + IO.foreach(@filename, mode: "rb") do |line| + @version ||= line[/-([0-9.]+).txt/, 1] + line.chomp! + line, comment = line.split(/ *#/) + next if not line or line == '' + code, lower, title, upper, conditions = line.split(/ *; */) + unless conditions + item = @mappings[code] + item.lower = lower + item.title = title + item.upper = upper + end + end + end + + def map (from) + @mappings[from] + end + + def flags(from, type, to) + # types: CaseFold_11, CaseUnfold_11, CaseUnfold_12, CaseUnfold_13 + flags = "" + from = Array(from).map {|i| "%04X" % i}.join(" ") + to = Array(to).map {|i| "%04X" % i}.join(" ") + item = map(from) + specials_index = nil + specials = [] + case type + when 'CaseFold_11' + flags += '|F' + if item + flags += '|U' if to==item.upper + flags += '|D' if to==item.lower + unless item.upper == item.title + if item.code == item.title + flags += '|IT' + swap = case item.code + when '01C5' then '0064 017D' + when '01C8' then '006C 004A' + when '01CB' then '006E 004A' + when '01F2' then '0064 005A' + else # Greek + to.split(' ').first + ' 0399' + end + specials << swap + else + flags += '|ST' + specials << item.title + end + end + unless item.lower.nil? or item.lower==from or item.lower==to + specials << item.lower + flags += '|SL' + end + unless item.upper.nil? or item.upper==from or item.upper==to + specials << item.upper + flags += '|SU' + end + end + when 'CaseUnfold_11' + to = to.split(/ /) + if item + case to.first + when item.upper then flags += '|U' + when item.lower then flags += '|D' + else + raise "Unpredicted case 0 in enc/unicode/case_folding.rb. Please contact https://bugs.ruby-lang.org/." + end + unless item.upper == item.title + if item.code == item.title + raise "Unpredicted case 1 in enc/unicode/case_folding.rb. Please contact https://bugs.ruby-lang.org/." + elsif item.title==to[1] + flags += '|ST' + else + raise "Unpredicted case 2 in enc/unicode/case_folding.rb. Please contact https://bugs.ruby-lang.org/." + end + end + end + end + unless specials.empty? + flags += "|I(#{@specials_length})" + @specials_length += specials.map { |s| s.split(/ /).length }.reduce(:+) + @specials << specials + end + flags + end + + def debug! + @debug = true + end + + def specials_output + "static const OnigCodePoint CaseMappingSpecials[] = {\n" + + @specials.map do |sps| + ' ' + sps.map do |sp| + chars = sp.split(/ /) + ct = ' /* ' + Array(chars).map{|c|[c.to_i(16)].pack("U*")}.join(", ") + ' */' if @debug + " L(#{chars.length})|#{chars.map {|c| "0x"+c }.join(', ')}#{ct}," + end.join + "\n" + end.join + "};\n" + end + + def self.load(*args) + new(*args) + end +end + +class CaseMappingDummy + def flags(from, type, to) + "" + end + + def titlecase_output() '' end + def debug!() end +end + +if $0 == __FILE__ + require 'optparse' + dest = nil + mapping_directory = nil + mapping_data = nil + debug = false + fold_1 = false + ARGV.options do |opt| + opt.banner << " [INPUT]" + opt.on("--output-file=FILE", "-o", "output to the FILE instead of STDOUT") {|output| + dest = (output unless output == '-') + } + opt.on('--mapping-data-directory=DIRECTORY', '-m', 'data DIRECTORY of mapping files') { |directory| + mapping_directory = directory + } + opt.on('--debug', '-d') { + debug = true + } + opt.parse! + abort(opt.to_s) if ARGV.size > 1 + end + if mapping_directory + if ARGV[0] + warn "Either specify directory or individual file, but not both." + exit + end + filename = File.join(mapping_directory, 'CaseFolding.txt') + mapping_data = CaseMapping.load(mapping_directory) + end + filename ||= ARGV[0] || 'CaseFolding.txt' + data = CaseFolding.load(filename) + if mapping_data and data.version != mapping_data.version + abort "Unicode data version mismatch\n" \ + " #{filename} = #{data.version}\n" \ + " #{mapping_data.filename} = #{mapping_data.version}" + end + mapping_data ||= CaseMappingDummy.new + + if debug + data.debug! + mapping_data.debug! + end + f = StringIO.new + begin + data.display(f, mapping_data) + rescue Errno::ENOENT => e + raise unless /gperf/ =~ e.message + warn e.message + abort unless dest + File.utime(nil, nil, dest) # assume existing file is OK + exit + else + s = f.string + end + if dest + open(dest, "wb") do |f| + f.print(s) + end + else + STDOUT.print(s) + end +end diff --git a/lib/edbee-lib/vendor/onig/tool/convert-jis-props.sh b/lib/edbee-lib/vendor/onig/tool/convert-jis-props.sh new file mode 100755 index 00000000..5eb008ca --- /dev/null +++ b/lib/edbee-lib/vendor/onig/tool/convert-jis-props.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# Convert props.kwd to props.h using GNU gperf. +# +# Usage: +# ./tool/convert-jis-props.sh enc/jis/props.kwd enc/jis/props.h + +JIS_PROPS_OPTIONS='-k1,3 -7 -c -j1 -i1 -t -C -P -t --ignore-case -H onig_jis_property_hash -Q onig_jis_property_pool -N onig_jis_property' + +gperf $JIS_PROPS_OPTIONS $1 | \ + sed 's/(int)(\(long\|size_t\))&((\([a-zA-Z_0-9 ]*[a-zA-Z_0-9]\) *\*)0)->\([a-zA-Z0-9_]*\),/(char)offsetof(\2, \3),/g' > $2 diff --git a/lib/edbee-lib/vendor/onig/tool/download-ucd.sh b/lib/edbee-lib/vendor/onig/tool/download-ucd.sh new file mode 100755 index 00000000..770fdf74 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/tool/download-ucd.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +files='Blocks.txt CaseFolding.txt DerivedAge.txt DerivedCoreProperties.txt PropertyAliases.txt PropertyValueAliases.txt PropList.txt Scripts.txt SpecialCasing.txt UnicodeData.txt auxiliary/GraphemeBreakProperty.txt' + +if [ -z $1 ]; then + echo "usage: $0 UNICODE_VERSION" + exit 1 +fi +UNICODE_VERSION=$1 + +# remove old files +if [ -d $UNICODE_VERSION ]; then + cd $UNICODE_VERSION + rm -f $files + rm -f GraphemeBreakProperty.txt + cd - +fi + +mkdir -p $UNICODE_VERSION/auxiliary +cd $UNICODE_VERSION + +for i in $files; do + echo http://www.unicode.org/Public/${UNICODE_VERSION}/ucd/$i +done | xargs wget +mv GraphemeBreakProperty.txt auxiliary diff --git a/lib/edbee-lib/vendor/onig/tool/enc-unicode.rb b/lib/edbee-lib/vendor/onig/tool/enc-unicode.rb new file mode 100755 index 00000000..ed45a303 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/tool/enc-unicode.rb @@ -0,0 +1,543 @@ +#!/usr/bin/env ruby + +# Creates the data structures needed by Oniguruma to map Unicode codepoints to +# property names and POSIX character classes +# +# To use this, get UnicodeData.txt, Scripts.txt, PropList.txt, +# PropertyAliases.txt, PropertyValueAliases.txt, DerivedCoreProperties.txt, +# DerivedAge.txt and Blocks.txt from unicode.org. +# (http://unicode.org/Public/UNIDATA/) And run following command. +# ruby1.9 tool/enc-unicode.rb data_dir > enc/unicode/name2ctype.kwd +# You can get source file for gperf. After this, simply make ruby. + +if ARGV[0] == "--header" + header = true + ARGV.shift +end +unless ARGV.size == 1 + abort "Usage: #{$0} data_directory" +end + +$unicode_version = File.basename(ARGV[0])[/\A[.\d]+\z/] + +POSIX_NAMES = %w[NEWLINE Alpha Blank Cntrl Digit Graph Lower Print XPosixPunct Space Upper XDigit Word Alnum ASCII Punct] + +def pair_codepoints(codepoints) + + # We have a sorted Array of codepoints that we wish to partition into + # ranges such that the start- and endpoints form an inclusive set of + # codepoints with property _property_. Note: It is intended that some ranges + # will begin with the value with which they end, e.g. 0x0020 -> 0x0020 + + codepoints.sort! + last_cp = codepoints.first + pairs = [[last_cp, nil]] + codepoints[1..-1].each do |codepoint| + next if last_cp == codepoint + + # If the current codepoint does not follow directly on from the last + # codepoint, the last codepoint represents the end of the current range, + # and the current codepoint represents the start of the next range. + if last_cp.next != codepoint + pairs[-1][-1] = last_cp + pairs << [codepoint, nil] + end + last_cp = codepoint + end + + # The final pair has as its endpoint the last codepoint for this property + pairs[-1][-1] = codepoints.last + pairs +end + +def parse_unicode_data(file) + last_cp = 0 + data = {'Any' => (0x0000..0x10ffff).to_a, 'Assigned' => [], + 'ASCII' => (0..0x007F).to_a, 'NEWLINE' => [0x0a], 'Cn' => []} + beg_cp = nil + IO.foreach(file) do |line| + fields = line.split(';') + cp = fields[0].to_i(16) + + case fields[1] + when /\A<(.*),\s*First>\z/ + beg_cp = cp + next + when /\A<(.*),\s*Last>\z/ + cps = (beg_cp..cp).to_a + else + beg_cp = cp + cps = [cp] + end + + # The Cn category represents unassigned characters. These are not listed in + # UnicodeData.txt so we must derive them by looking for 'holes' in the range + # of listed codepoints. We increment the last codepoint seen and compare it + # with the current codepoint. If the current codepoint is less than + # last_cp.next we have found a hole, so we add the missing codepoint to the + # Cn category. + data['Cn'].concat((last_cp.next...beg_cp).to_a) + + # Assigned - Defined in unicode.c; interpreted as every character in the + # Unicode range minus the unassigned characters + data['Assigned'].concat(cps) + + # The third field denotes the 'General' category, e.g. Lu + (data[fields[2]] ||= []).concat(cps) + + # The 'Major' category is the first letter of the 'General' category, e.g. + # 'Lu' -> 'L' + (data[fields[2][0,1]] ||= []).concat(cps) + last_cp = cp + end + + # The last Cn codepoint should be 0x10ffff. If it's not, append the missing + # codepoints to Cn and C + cn_remainder = (last_cp.next..0x10ffff).to_a + data['Cn'] += cn_remainder + data['C'] += data['Cn'] + + # Special case for LC (Cased_Letter). LC = Ll + Lt + Lu + data['LC'] = data['Ll'] + data['Lt'] + data['Lu'] + + # Define General Category properties + gcps = data.keys.sort - POSIX_NAMES + + # Returns General Category Property names and the data + [gcps, data] +end + +def define_posix_props(data) + # We now derive the character classes (POSIX brackets), e.g. [[:alpha:]] + # + + data['Alpha'] = data['Alphabetic'] + data['Upper'] = data['Uppercase'] + data['Lower'] = data['Lowercase'] + data['Punct'] = data['Punctuation'] + data['XPosixPunct'] = data['Punctuation'] + [0x24, 0x2b, 0x3c, 0x3d, 0x3e, 0x5e, 0x60, 0x7c, 0x7e] + data['Digit'] = data['Decimal_Number'] + data['XDigit'] = (0x0030..0x0039).to_a + (0x0041..0x0046).to_a + + (0x0061..0x0066).to_a + data['Alnum'] = data['Alpha'] + data['Digit'] + data['Space'] = data['White_Space'] + data['Blank'] = data['Space_Separator'] + [0x0009] + data['Cntrl'] = data['Cc'] + data['Word'] = data['Alpha'] + data['Mark'] + data['Digit'] + data['Connector_Punctuation'] + data['Graph'] = data['Any'] - data['Space'] - data['Cntrl'] - + data['Surrogate'] - data['Unassigned'] + data['Print'] = data['Graph'] + data['Space_Separator'] +end + +def parse_scripts(data, categories) + files = [ + {:fn => 'DerivedCoreProperties.txt', :title => 'Derived Property'}, + {:fn => 'Scripts.txt', :title => 'Script'}, + {:fn => 'PropList.txt', :title => 'Binary Property'} + ] + current = nil + cps = [] + names = {} + files.each do |file| + data_foreach(file[:fn]) do |line| + if /^# Total code points: / =~ line + data[current] = cps + categories[current] = file[:title] + (names[file[:title]] ||= []) << current + cps = [] + elsif /^([0-9a-fA-F]+)(?:\.\.([0-9a-fA-F]+))?\s*;\s*(\w+)/ =~ line + current = $3 + $2 ? cps.concat(($1.to_i(16)..$2.to_i(16)).to_a) : cps.push($1.to_i(16)) + end + end + end + # All code points not explicitly listed for Script + # have the value Unknown (Zzzz). + data['Unknown'] = (0..0x10ffff).to_a - data.values_at(*names['Script']).flatten + categories['Unknown'] = 'Script' + names.values.flatten << 'Unknown' +end + +def parse_aliases(data) + kv = {} + data_foreach('PropertyAliases.txt') do |line| + next unless /^(\w+)\s*; (\w+)/ =~ line + data[$1] = data[$2] + kv[normalize_propname($1)] = normalize_propname($2) + end + data_foreach('PropertyValueAliases.txt') do |line| + next unless /^(sc|gc)\s*; (\w+)\s*; (\w+)(?:\s*; (\w+))?/ =~ line + if $1 == 'gc' + data[$3] = data[$2] + data[$4] = data[$2] + kv[normalize_propname($3)] = normalize_propname($2) + kv[normalize_propname($4)] = normalize_propname($2) if $4 + else + data[$2] = data[$3] + data[$4] = data[$3] + kv[normalize_propname($2)] = normalize_propname($3) + kv[normalize_propname($4)] = normalize_propname($3) if $4 + end + end + kv +end + +# According to Unicode6.0.0/ch03.pdf, Section 3.1, "An update version +# never involves any additions to the character repertoire." Versions +# in DerivedAge.txt should always be /\d+\.\d+/ +def parse_age(data) + current = nil + last_constname = nil + cps = [] + ages = [] + data_foreach('DerivedAge.txt') do |line| + if /^# Total code points: / =~ line + constname = constantize_agename(current) + # each version matches all previous versions + cps.concat(data[last_constname]) if last_constname + data[constname] = cps + make_const(constname, cps, "Derived Age #{current}") + ages << current + last_constname = constname + cps = [] + elsif /^([0-9a-fA-F]+)(?:\.\.([0-9a-fA-F]+))?\s*;\s*(\d+\.\d+)/ =~ line + current = $3 + $2 ? cps.concat(($1.to_i(16)..$2.to_i(16)).to_a) : cps.push($1.to_i(16)) + end + end + ages +end + +def parse_GraphemeBreakProperty(data) + current = nil + cps = [] + ages = [] + data_foreach('auxiliary/GraphemeBreakProperty.txt') do |line| + if /^# Total code points: / =~ line + constname = constantize_Grapheme_Cluster_Break(current) + data[constname] = cps + make_const(constname, cps, "Grapheme_Cluster_Break=#{current}") + ages << current + cps = [] + elsif /^([0-9a-fA-F]+)(?:\.\.([0-9a-fA-F]+))?\s*;\s*(\w+)/ =~ line + current = $3 + $2 ? cps.concat(($1.to_i(16)..$2.to_i(16)).to_a) : cps.push($1.to_i(16)) + end + end + ages +end + +def parse_block(data) + current = nil + cps = [] + blocks = [] + data_foreach('Blocks.txt') do |line| + if /^([0-9a-fA-F]+)\.\.([0-9a-fA-F]+);\s*(.*)/ =~ line + cps = ($1.to_i(16)..$2.to_i(16)).to_a + constname = constantize_blockname($3) + data[constname] = cps + make_const(constname, cps, "Block") + blocks << constname + end + end + + # All code points not belonging to any of the named blocks + # have the value No_Block. + no_block = (0..0x10ffff).to_a - data.values_at(*blocks).flatten + constname = constantize_blockname("No_Block") + make_const(constname, no_block, "Block") + blocks << constname +end + +# shim for Ruby 1.8 +unless {}.respond_to?(:key) + class Hash + alias key index + end +end + +$const_cache = {} +# make_const(property, pairs, name): Prints a 'static const' structure for a +# given property, group of paired codepoints, and a human-friendly name for +# the group +def make_const(prop, data, name) + if name.empty? + puts "\n/* '#{prop}' */" + else + puts "\n/* '#{prop}': #{name} */" + end + if origprop = $const_cache.key(data) + puts "#define CR_#{prop} CR_#{origprop}" + else + $const_cache[prop] = data + pairs = pair_codepoints(data) + puts "static const OnigCodePoint CR_#{prop}[] = {" + # The first element of the constant is the number of pairs of codepoints + puts "\t#{pairs.size}," + pairs.each do |pair| + pair.map! { |c| c == 0 ? '0x0000' : sprintf("%0#6x", c) } + puts "\t#{pair.first}, #{pair.last}," + end + puts "}; /* CR_#{prop} */" + end +end + +def normalize_propname(name) + name = name.downcase + name.delete!('- _') + name +end + +def constantize_agename(name) + "Age_#{name.sub(/\./, '_')}" +end + +def constantize_Grapheme_Cluster_Break(name) + "Grapheme_Cluster_Break_#{name}" +end + +def constantize_blockname(name) + "In_#{name.gsub(/\W/, '_')}" +end + +def get_file(name) + File.join(ARGV[0], name) +end + +def data_foreach(name, &block) + fn = get_file(name) + warn "Reading #{name}" + pat = /^# #{File.basename(name).sub(/\./, '-([\\d.]+)\\.')}/ + File.open(fn, 'rb') do |f| + line = f.gets + unless pat =~ line + raise ArgumentError, "#{name}: no Unicode version" + end + if !$unicode_version + $unicode_version = $1 + elsif $unicode_version != $1 + raise ArgumentError, "#{name}: Unicode version mismatch: #$1" + end + f.each(&block) + end +end + +# Write Data +class Unifdef + attr_accessor :output, :top, :stack, :stdout, :kwdonly + def initialize(out) + @top = @output = [] + @stack = [] + $stdout, @stdout = self, out + end + def restore + $stdout = @stdout + end + def ifdef(sym) + if @kwdonly + @stdout.puts "#ifdef #{sym}" + else + @stack << @top + @top << tmp = [sym] + @top = tmp + end + if block_given? + begin + return yield + ensure + endif(sym) + end + end + end + def endif(sym) + if @kwdonly + @stdout.puts "#endif /* #{sym} */" + else + unless sym == @top[0] + restore + raise ArgumentError, "#{sym} unmatch to #{@top[0]}" + end + @top = @stack.pop + end + end + def show(dest, *syms) + _show(dest, @output, syms) + end + def _show(dest, ary, syms) + if Symbol === (sym = ary[0]) + unless syms.include?(sym) + return + end + end + ary.each do |e| + case e + when Array + _show(dest, e, syms) + when String + dest.print e + end + end + end + def write(str) + if @kwdonly + @stdout.write(str) + else + @top << str + end + self + end + alias << write +end + +output = Unifdef.new($stdout) +output.kwdonly = !header + +puts '%{' +props, data = parse_unicode_data(get_file('UnicodeData.txt')) +categories = {} +props.concat parse_scripts(data, categories) +aliases = parse_aliases(data) +ages = blocks = graphemeBreaks = nil +define_posix_props(data) +POSIX_NAMES.each do |name| + if name == 'XPosixPunct' + make_const(name, data[name], "[[:Punct:]]") + elsif name == 'Punct' + make_const(name, data[name], "") + else + make_const(name, data[name], "[[:#{name}:]]") + end +end +output.ifdef :USE_UNICODE_PROPERTIES do + props.each do |name| + category = categories[name] || + case name.size + when 1 then 'Major Category' + when 2 then 'General Category' + else '-' + end + make_const(name, data[name], category) + end + output.ifdef :USE_UNICODE_AGE_PROPERTIES do + ages = parse_age(data) + end + graphemeBreaks = parse_GraphemeBreakProperty(data) + blocks = parse_block(data) +end +puts(<<'__HEREDOC') + +static const OnigCodePoint* const CodeRanges[] = { +__HEREDOC +POSIX_NAMES.each{|name|puts" CR_#{name},"} +output.ifdef :USE_UNICODE_PROPERTIES do + props.each{|name| puts" CR_#{name},"} + output.ifdef :USE_UNICODE_AGE_PROPERTIES do + ages.each{|name| puts" CR_#{constantize_agename(name)},"} + end + graphemeBreaks.each{|name| puts" CR_#{constantize_Grapheme_Cluster_Break(name)},"} + blocks.each{|name|puts" CR_#{name},"} +end + +puts(<<'__HEREDOC') +}; +struct uniname2ctype_struct { + short name; + unsigned short ctype; +}; +#define uniname2ctype_offset(str) offsetof(struct uniname2ctype_pool_t, uniname2ctype_pool_##str) + +static const struct uniname2ctype_struct *uniname2ctype_p(const char *, unsigned int); +%} +struct uniname2ctype_struct; +%% +__HEREDOC + +i = -1 +name_to_index = {} +POSIX_NAMES.each do |name| + i += 1 + next if name == 'NEWLINE' + name = normalize_propname(name) + name_to_index[name] = i + puts"%-40s %3d" % [name + ',', i] +end +output.ifdef :USE_UNICODE_PROPERTIES do + props.each do |name| + i += 1 + name = normalize_propname(name) + name_to_index[name] = i + puts "%-40s %3d" % [name + ',', i] + end + aliases.each_pair do |k, v| + next if name_to_index[k] + next unless v = name_to_index[v] + puts "%-40s %3d" % [k + ',', v] + end + output.ifdef :USE_UNICODE_AGE_PROPERTIES do + ages.each do |name| + i += 1 + name = "age=#{name}" + name_to_index[name] = i + puts "%-40s %3d" % [name + ',', i] + end + end + graphemeBreaks.each do |name| + i += 1 + name = "graphemeclusterbreak=#{name.delete('_').downcase}" + name_to_index[name] = i + puts "%-40s %3d" % [name + ',', i] + end + blocks.each do |name| + i += 1 + name = normalize_propname(name) + name_to_index[name] = i + puts "%-40s %3d" % [name + ',', i] + end +end +puts(<<'__HEREDOC') +%% +static int +uniname2ctype(const UChar *name, unsigned int len) +{ + const struct uniname2ctype_struct *p = uniname2ctype_p((const char *)name, len); + if (p) return p->ctype; + return -1; +} +__HEREDOC +versions = $unicode_version.scan(/\d+/) +print("#if defined ONIG_UNICODE_VERSION_STRING && !( \\\n") +%w[MAJOR MINOR TEENY].zip(versions) do |n, v| + print(" ONIG_UNICODE_VERSION_#{n} == #{v} && \\\n") +end +print(" 1)\n") +print("# error ONIG_UNICODE_VERSION_STRING mismatch\n") +print("#endif\n") +print("#define ONIG_UNICODE_VERSION_STRING #{$unicode_version.dump}\n") +%w[MAJOR MINOR TEENY].zip(versions) do |n, v| + print("#define ONIG_UNICODE_VERSION_#{n} #{v}\n") +end + +output.restore + +if header + require 'tempfile' + + NAME2CTYPE = %w[gperf -7 -c -j1 -i1 -t -C -P -T -H uniname2ctype_hash -Q uniname2ctype_pool -N uniname2ctype_p] + + fds = [] + syms = %i[USE_UNICODE_PROPERTIES USE_UNICODE_AGE_PROPERTIES] + begin + fds << (tmp = Tempfile.new(%w"name2ctype .h")) + IO.popen([*NAME2CTYPE, out: tmp], "w") {|f| output.show(f, *syms)} + end while syms.pop + fds.each(&:close) + IO.popen(%W[diff -DUSE_UNICODE_AGE_PROPERTIES #{fds[1].path} #{fds[0].path}], "r") {|age| + IO.popen(%W[diff -DUSE_UNICODE_PROPERTIES #{fds[2].path} -], "r", in: age) {|f| + f.each {|line| + line.gsub!(/\(int\)\((?:long|size_t)\)&\(\(struct uniname2ctype_pool_t \*\)0\)->uniname2ctype_pool_(str\d+),\s+/, + 'uniname2ctype_offset(\1), ') + puts line + } + } + } +end diff --git a/lib/edbee-lib/vendor/onig/tool/update-doc.py b/lib/edbee-lib/vendor/onig/tool/update-doc.py new file mode 100755 index 00000000..14de0476 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/tool/update-doc.py @@ -0,0 +1,144 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Usage: +# $ python update-doc.py UCD_DIR > ../doc/UnicodeProps.txt + +from __future__ import print_function +import sys +import os +import re +import datetime + +onig_ver = "6.0.0" +ucddir = "." + +def print_list(arr, title): + print() + print("*", title) + for i in arr: + print(" " + i) + +def output_header(): + d = datetime.date.today() + print("Onigmo (Oniguruma-mod) Unicode Properties Version %s %04d/%02d/%02d" + % (onig_ver, d.year, d.month, d.day)) + + posix_brackets = [ + "Alpha", "Blank", "Cntrl", "Digit", "Graph", "Lower", "Print", + "Punct", "Space", "Upper", "XDigit", "Word", "Alnum", "ASCII", + "XPosixPunct" + ] + specials = ["Any", "Assigned"] + + print_list(posix_brackets, "POSIX brackets") + print_list(specials, "Special") + return set(posix_brackets) | set(specials) + +def output_categories(): + categories = set(["LC", "Cn"]) + pattern = re.compile('^.*?;.*?;(..);') + with open(ucddir + os.sep + 'UnicodeData.txt', 'r') as f: + for line in f: + res = pattern.match(line) + if not res: + continue + categories.add(res.group(1)) + categories.add(res.group(1)[0]) # Major category + print_list(sorted(categories), "Major and General Categories") + return categories + +def output_scripts(filename, title, add=[]): + scripts = set(add) + pattern = re.compile('^.*?; (\w+) # ') + with open(filename, 'r') as f: + for line in f: + res = pattern.match(line) + if not res: + continue + scripts.add(res.group(1)) + print_list(sorted(scripts), title) + return scripts + +def output_aliases(scripts): + aliases = set() + pattern = re.compile('^(\w+) *; (\w+)') + with open(ucddir + os.sep + 'PropertyAliases.txt', 'r') as f: + for line in f: + res = pattern.match(line) + if not res: + continue + if (res.group(2) in scripts) and (res.group(1) not in scripts): + aliases.add(res.group(1)) + print_list(sorted(aliases), "PropertyAliases") + return aliases + +def output_valuealiases(scripts): + scripts |= set(["cntrl", "digit", "punct"]) # exclude them + aliases = list() + aliases_sc = list() + pattern = re.compile('^(gc|sc) ; (\w+) *; (\w+)(?: *; (\w+))?') + with open(ucddir + os.sep + 'PropertyValueAliases.txt', 'r') as f: + for line in f: + res = pattern.match(line) + if not res: + continue + if (res.group(1) == "gc"): + if res.group(2) in scripts: + if res.group(3) not in scripts: + aliases.append(res.group(3)) + if res.group(4) and (res.group(4) not in scripts): + aliases.append(res.group(4)) + else: + if res.group(3) in scripts: + if res.group(2) not in scripts: + aliases_sc.append(res.group(2)) + if res.group(4) and (res.group(4) not in scripts): + aliases_sc.append(res.group(4)) + + print_list(aliases, "PropertyValueAliases (General_Category)") + print_list(aliases_sc, "PropertyValueAliases (Script)") + return set(aliases) | set(aliases_sc) + +def output_ages(): + ages = set() + pattern = re.compile('^[\dA-F.]+ *; ([\d.]+)') + with open(ucddir + os.sep + 'DerivedAge.txt', 'r') as f: + for line in f: + res = pattern.match(line) + if not res: + continue + ages.add("Age=" + res.group(1)) + print_list(sorted(ages), "DerivedAges") + return ages + +def output_blocks(): + blocks = list() + pattern = re.compile('^[\dA-F.]+ *; ([-\w ]+)') + with open(ucddir + os.sep + 'Blocks.txt', 'r') as f: + for line in f: + res = pattern.match(line) + if not res: + continue + blocks.append("In_" + re.sub('\W', '_', res.group(1))) + blocks.append("In_No_Block") + print_list(blocks, "Blocks") + return set(blocks) + +def main(): + global ucddir + if len(sys.argv) > 1: + ucddir = sys.argv[1] + scripts = set() + scripts |= output_header() + scripts |= output_categories() + scripts |= output_scripts(ucddir + os.sep + 'Scripts.txt', 'Scripts', ["Unknown"]) + scripts |= output_scripts(ucddir + os.sep + 'DerivedCoreProperties.txt', 'DerivedCoreProperties') + scripts |= output_scripts(ucddir + os.sep + 'PropList.txt', 'PropList') + output_aliases(scripts) + output_valuealiases(scripts) + output_ages() + output_blocks() + +if __name__ == '__main__': + main() diff --git a/lib/edbee-lib/vendor/onig/win32/Makefile.mingw b/lib/edbee-lib/vendor/onig/win32/Makefile.mingw new file mode 100644 index 00000000..041d2839 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/win32/Makefile.mingw @@ -0,0 +1,252 @@ +# Onigmo Makefile for mingw32 + +product_name = onigmo + +# Comment out the next line, if you don't want to use LTCG. +USE_LTCG = 1 + +# Enable the next line, if you want to use a .def file. +#DEFFILE = onig.def + + +# Get the default ARCH. (i686, x86-64, etc.) +ifndef ARCH +ARCH := $(shell $(CC) -dumpmachine | sed -e 's/-.*//' -e 's/_/-/' -e 's/^mingw32$$/i686/') +endif + + +CPPFLAGS = +CFLAGS = -O2 -Wall +LDFLAGS = +LOADLIBES = +ARLIB = ar +ARLIB_FLAGS = cr +ARDLL = gcc +ARDLL_FLAGS = -shared $(LINKFLAGS) +LINKFLAGS = + +INSTALL = install -c +CP = cp +RMDIR = rm -rf +CC = gcc +RC = windres +DEFS = -DHAVE_CONFIG_H -DEXPORT + +ifneq ($(ARCH),x86-64) +PYTHON = py -3.4-32 +else +PYTHON = py -3 +endif + +WORKDIR = build_$(ARCH) + +ifdef DEFFILE +# Use a .def file to export APIs. +CFLAGS = $(CFLAGS) -DONIG_EXTERN=extern +ARDLL_FLAGS = $(ARDLL_FLAGS) $(DEFFILE) +endif + +subdirs = + +libbase = onigmo +libname = $(WORKDIR)/lib$(libbase).a +dllname = $(WORKDIR)/$(libbase).dll +dlllib = $(WORKDIR)/lib$(libbase).dll.a + +onigheaders = onigmo.h regint.h regparse.h regenc.h st.h +posixheaders = onigmoposix.h +headers = $(posixheaders) $(onigheaders) + +onigobjs = $(WORKDIR)/reggnu.o $(WORKDIR)/regerror.o \ + $(WORKDIR)/regparse.o $(WORKDIR)/regext.o \ + $(WORKDIR)/regcomp.o $(WORKDIR)/regexec.o \ + $(WORKDIR)/regenc.o $(WORKDIR)/regsyntax.o \ + $(WORKDIR)/regtrav.o $(WORKDIR)/regversion.o \ + $(WORKDIR)/st.o +posixobjs = $(WORKDIR)/regposix.o $(WORKDIR)/regposerr.o +libobjs = $(onigobjs) $(posixobjs) + +jp_objs = $(WORKDIR)/euc_jp.o $(WORKDIR)/shift_jis.o \ + $(WORKDIR)/windows_31j.o + +iso_8859_objs = $(WORKDIR)/iso_8859_1.o $(WORKDIR)/iso_8859_2.o \ + $(WORKDIR)/iso_8859_3.o $(WORKDIR)/iso_8859_4.o \ + $(WORKDIR)/iso_8859_5.o $(WORKDIR)/iso_8859_6.o \ + $(WORKDIR)/iso_8859_7.o $(WORKDIR)/iso_8859_8.o \ + $(WORKDIR)/iso_8859_9.o $(WORKDIR)/iso_8859_10.o \ + $(WORKDIR)/iso_8859_11.o $(WORKDIR)/iso_8859_13.o \ + $(WORKDIR)/iso_8859_14.o $(WORKDIR)/iso_8859_15.o \ + $(WORKDIR)/iso_8859_16.o + +encobjs = $(WORKDIR)/ascii.o $(WORKDIR)/utf_8.o \ + $(WORKDIR)/unicode.o \ + $(WORKDIR)/utf_16be.o $(WORKDIR)/utf_16le.o \ + $(WORKDIR)/utf_32be.o $(WORKDIR)/utf_32le.o \ + $(jp_objs) $(iso_8859_objs) \ + $(WORKDIR)/euc_tw.o $(WORKDIR)/euc_kr.o $(WORKDIR)/big5.o \ + $(WORKDIR)/gb18030.o \ + $(WORKDIR)/koi8_r.o $(WORKDIR)/koi8_u.o \ + $(WORKDIR)/windows_1250.o $(WORKDIR)/windows_1251.o \ + $(WORKDIR)/windows_1252.o $(WORKDIR)/windows_1253.o \ + $(WORKDIR)/windows_1254.o $(WORKDIR)/windows_1257.o + +resobj = $(WORKDIR)/onigmo.o + +onigsources = regerror.c regparse.c regext.c regcomp.c regexec.c regenc.c \ + regsyntax.c regtrav.c regversion.c reggnu.c st.c +posixsources = regposix.c regposerr.c +libsources = $(posixsources) $(onigsources) + +encdir = enc +distfiles = README COPYING HISTORY \ + Makefile.in configure.in config.h.in configure \ + $(headers) $(libsources) \ + test.rb testconv.rb +testc = testc +testcu = testu +testp = testp + +makeargs = $(MFLAGS) CPPFLAGS='$(CPPFLAGS)' CFLAGS='$(CFLAGS)' CC='$(CC)' + +.SUFFIXES: +.SUFFIXES: .o .c .h .ps .dvi .info .texinfo .res .rc + +$(WORKDIR)/%.o: %.c + $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -Iwin32 -I. -o $@ -c $< + +$(WORKDIR)/%.o: $(encdir)/%.c + $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -Iwin32 -I. -I$(encdir)/unicode -o $@ -c $< + +$(WORKDIR)/%.o: win32/%.rc + $(RC) -O coff -I. $< $@ + +# targets +default: all + +setup: + + +all: lib dll + +lib: $(libname) +dll: $(dllname) + +$(libname): $(WORKDIR) $(libobjs) $(encobjs) + $(ARLIB) $(ARLIB_FLAGS) $@ $(libobjs) $(encobjs) + +$(dllname): $(WORKDIR) $(libobjs) $(encobjs) $(resobj) $(DEFFILE) + $(ARDLL) $(libobjs) $(encobjs) $(resobj) -o $@ $(ARDLL_FLAGS) -Wl,--out-implib,$(dlllib) + +$(WORKDIR): + -mkdir $(WORKDIR) + +$(WORKDIR)/regparse.o: regparse.c $(onigheaders) win32/config.h st.h +$(WORKDIR)/regext.o: regext.c $(onigheaders) win32/config.h +$(WORKDIR)/regtrav.o: regtrav.c $(onigheaders) win32/config.h +$(WORKDIR)/regcomp.o: regcomp.c $(onigheaders) win32/config.h +$(WORKDIR)/regexec.o: regexec.c regint.h regenc.h onigmo.h win32/config.h +$(WORKDIR)/reggnu.o: reggnu.c regint.h regenc.h onigmo.h win32/config.h onigmognu.h +$(WORKDIR)/regerror.o: regerror.c regint.h regenc.h onigmo.h win32/config.h +$(WORKDIR)/regenc.o: regenc.c regint.h regenc.h onigmo.h win32/config.h +$(WORKDIR)/regsyntax.o: regsyntax.c regint.h regenc.h onigmo.h win32/config.h +$(WORKDIR)/regversion.o: regversion.c onigmo.h win32/config.h +$(WORKDIR)/regposix.o: regposix.c $(posixheaders) onigmo.h win32/config.h +$(WORKDIR)/regposerr.o: regposerr.c $(posixheaders) win32/config.h +$(WORKDIR)/st.o: st.c regint.h onigmo.h win32/config.h st.h + +$(WORKDIR)/ascii.o: $(encdir)/ascii.c regenc.h win32/config.h +$(WORKDIR)/unicode.o: $(encdir)/unicode.c regint.h regenc.h win32/config.h $(encdir)/unicode/casefold.h $(encdir)/unicode/name2ctype.h +$(WORKDIR)/utf_8.o: $(encdir)/utf_8.c regenc.h win32/config.h +$(WORKDIR)/utf_16be.o: $(encdir)/utf_16be.c regenc.h win32/config.h +$(WORKDIR)/utf_16le.o: $(encdir)/utf_16le.c regenc.h win32/config.h +$(WORKDIR)/utf_32be.o: $(encdir)/utf_32be.c regenc.h win32/config.h +$(WORKDIR)/utf_32le.o: $(encdir)/utf_32le.c regenc.h win32/config.h +$(WORKDIR)/euc_jp.o: $(encdir)/euc_jp.c regenc.h win32/config.h $(encdir)/jis/props.h +$(WORKDIR)/euc_tw.o: $(encdir)/euc_tw.c regenc.h win32/config.h +$(WORKDIR)/euc_kr.o: $(encdir)/euc_kr.c regenc.h win32/config.h +$(WORKDIR)/shift_jis.o: $(encdir)/shift_jis.c $(encdir)/shift_jis.h regenc.h win32/config.h $(encdir)/jis/props.h +$(WORKDIR)/windows_31j.o: $(encdir)/windows_31j.c $(encdir)/shift_jis.h regenc.h win32/config.h $(encdir)/jis/props.h +$(WORKDIR)/iso_8859_1.o: $(encdir)/iso_8859_1.c regenc.h win32/config.h +$(WORKDIR)/iso_8859_2.o: $(encdir)/iso_8859_2.c regenc.h win32/config.h +$(WORKDIR)/iso_8859_3.o: $(encdir)/iso_8859_3.c regenc.h win32/config.h +$(WORKDIR)/iso_8859_4.o: $(encdir)/iso_8859_4.c regenc.h win32/config.h +$(WORKDIR)/iso_8859_5.o: $(encdir)/iso_8859_5.c regenc.h win32/config.h +$(WORKDIR)/iso_8859_6.o: $(encdir)/iso_8859_6.c regenc.h win32/config.h +$(WORKDIR)/iso_8859_7.o: $(encdir)/iso_8859_7.c regenc.h win32/config.h +$(WORKDIR)/iso_8859_8.o: $(encdir)/iso_8859_8.c regenc.h win32/config.h +$(WORKDIR)/iso_8859_9.o: $(encdir)/iso_8859_9.c regenc.h win32/config.h +$(WORKDIR)/iso_8859_10.o: $(encdir)/iso_8859_10.c regenc.h win32/config.h +$(WORKDIR)/iso_8859_11.o: $(encdir)/iso_8859_11.c regenc.h win32/config.h +$(WORKDIR)/iso_8859_13.o: $(encdir)/iso_8859_13.c regenc.h win32/config.h +$(WORKDIR)/iso_8859_14.o: $(encdir)/iso_8859_14.c regenc.h win32/config.h +$(WORKDIR)/iso_8859_15.o: $(encdir)/iso_8859_15.c regenc.h win32/config.h +$(WORKDIR)/iso_8859_16.o: $(encdir)/iso_8859_16.c regenc.h win32/config.h +#$(WORKDIR)/koi8.o: $(encdir)/koi8.c regenc.h win32/config.h +$(WORKDIR)/koi8_r.o: $(encdir)/koi8_r.c regenc.h win32/config.h +$(WORKDIR)/koi8_u.o: $(encdir)/koi8_u.c regenc.h win32/config.h +$(WORKDIR)/windows_1250.o: $(encdir)/windows_1250.c regenc.h win32/config.h +$(WORKDIR)/windows_1251.o: $(encdir)/windows_1251.c regenc.h win32/config.h +$(WORKDIR)/windows_1252.o: $(encdir)/windows_1252.c regenc.h win32/config.h +$(WORKDIR)/windows_1253.o: $(encdir)/windows_1253.c regenc.h win32/config.h +$(WORKDIR)/windows_1254.o: $(encdir)/windows_1254.c regenc.h win32/config.h +$(WORKDIR)/windows_1257.o: $(encdir)/windows_1257.c regenc.h win32/config.h +$(WORKDIR)/big5.o: $(encdir)/big5.c regenc.h win32/config.h +$(WORKDIR)/gb18030.o: $(encdir)/gb18030.c regenc.h win32/config.h + +$(WORKDIR)/onigmo.o: win32/onigmo.rc onigmo.h + + +# Tests +test: all ctest utest ptest pytest + +# C library test +ctest: $(WORKDIR)/$(testc) + $(WORKDIR)/$(testc) + +# C library test (Unicode) +utest: $(WORKDIR)/$(testcu) + $(WORKDIR)/$(testcu) + +# POSIX C library test +ptest: $(WORKDIR)/$(testp) + $(WORKDIR)/$(testp) + +# Python test +pytest: + cd $(WORKDIR) && $(PYTHON) ../testpy.py EUC-JP + cd $(WORKDIR) && $(PYTHON) ../testpy.py SJIS + cd $(WORKDIR) && $(PYTHON) ../testpy.py UTF-8 + cd $(WORKDIR) && $(PYTHON) ../testpy.py UTF-16LE + cd $(WORKDIR) && $(PYTHON) ../testpy.py UTF-16BE + cd $(WORKDIR) && $(PYTHON) ../testpy.py UTF-32LE + cd $(WORKDIR) && $(PYTHON) ../testpy.py UTF-32BE + + +$(WORKDIR)/$(testc): win32/$(testc).c $(libname) + $(CC) $(CFLAGS) -o $(WORKDIR)/$(testc) -DONIG_EXTERN=extern win32/$(testc).c -I. $(libname) + +$(WORKDIR)/$(testp): win32/$(testc).c $(dlllib) + $(CC) $(CFLAGS) -DPOSIX_TEST -o $(WORKDIR)/$(testp) win32/$(testc).c -I. $(dlllib) + +#$(testc)u.c: test.rb testconvu.rb +# ruby -Ke testconvu.rb test.rb > $@ + +$(WORKDIR)/$(testcu): $(testcu).c $(libname) + $(CC) $(CFLAGS) -o $(WORKDIR)/$(testcu) -DONIG_EXTERN=extern $(testcu).c -I. $(libname) + +$(libbase).def: win32/makedef.py onigmo.h regenc.h onigmognu.h onigmoposix.h + $(PYTHON) win32/makedef.py > $@ + +clean: + -$(RMDIR) $(WORKDIR) + + +samples: all + $(CC) $(CFLAGS) -I. -o $(WORKDIR)/simple sample\simple.c $(dlllib) + $(CC) $(CFLAGS) -I. -o $(WORKDIR)/posix sample\posix.c $(dlllib) + $(CC) $(CFLAGS) -I. -o $(WORKDIR)/names sample\names.c $(dlllib) + $(CC) $(CFLAGS) -I. -o $(WORKDIR)/listcap sample\listcap.c $(dlllib) + $(CC) $(CFLAGS) -I. -o $(WORKDIR)/sql sample\sql.c $(dlllib) + $(CC) $(CFLAGS) -I. -o $(WORKDIR)/encode sample\encode.c $(dlllib) + $(CC) $(CFLAGS) -I. -o $(WORKDIR)/syntax sample\syntax.c $(dlllib) + $(CC) $(CFLAGS) -I. -o $(WORKDIR)/crnl sample\crnl.c $(dlllib) diff --git a/lib/edbee-lib/vendor/onig/win32/config.h b/lib/edbee-lib/vendor/onig/win32/config.h new file mode 100644 index 00000000..1d97ff76 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/win32/config.h @@ -0,0 +1,86 @@ +#define STDC_HEADERS 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRING_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_FLOAT_H 1 +#define HAVE_OFF_T 1 +#define SIZEOF_INT 4 +#define SIZEOF_SHORT 2 +#define SIZEOF_LONG 4 +#define SIZEOF_LONG_LONG 8 +#define SIZEOF___INT64 8 +#define SIZEOF_OFF_T 4 +#ifdef _WIN64 +# define SIZEOF_VOIDP 8 +#else +# define SIZEOF_VOIDP 4 +#endif +#define SIZEOF_FLOAT 4 +#define SIZEOF_DOUBLE 8 +#define TOKEN_PASTE(x, y) x##y +#ifndef NORETURN +# if defined(_MSC_VER) && (_MSC_VER > 1100) +# define NORETURN(x) __declspec(noreturn) x +# else +# define NORETURN(x) x +# endif +#endif +#define HAVE_DECL_SYS_NERR 1 +#define HAVE_LIMITS_H 1 +#define HAVE_FCNTL_H 1 +#define HAVE_SYS_UTIME_H 1 +#if defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER >= 1600) +# define HAVE_STDINT_H 1 +#endif +#if defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER >= 1800) +# define HAVE_INTTYPES_H 1 +#endif +#define uid_t int +#define gid_t int +#define HAVE_STRUCT_STAT_ST_RDEV 1 +#define HAVE_ST_RDEV 1 +#define GETGROUPS_T int +#define RETSIGTYPE void +#define HAVE_ALLOCA 1 +#define HAVE_DUP2 1 +#define HAVE_MEMCMP 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MKDIR 1 +#define HAVE_STRERROR 1 +#define HAVE_STRFTIME 1 +#define HAVE_STRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOD 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_FLOCK 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_FINITE 1 +#define HAVE_FMOD 1 +#define HAVE_FREXP 1 +#define HAVE_HYPOT 1 +#define HAVE_MODF 1 +#define HAVE_WAITPID 1 +#define HAVE_CHSIZE 1 +#define HAVE_TIMES 1 +#define HAVE__SETJMP 1 +#define HAVE_TELLDIR 1 +#define HAVE_SEEKDIR 1 +#define HAVE_MKTIME 1 +#define HAVE_COSH 1 +#define HAVE_SINH 1 +#define HAVE_TANH 1 +#define HAVE_EXECVE 1 +#define HAVE_TZNAME 1 +#define HAVE_DAYLIGHT 1 +#define SETPGRP_VOID 1 +#define inline __inline +#define NEED_IO_SEEK_BETWEEN_RW 1 +#define RSHIFT(x, y) ((x) >> (int)y) +#define FILE_COUNT _cnt +#define FILE_READPTR _ptr +#define DEFAULT_KCODE KCODE_NONE +#define DLEXT ".so" +#define DLEXT2 ".dll" diff --git a/lib/edbee-lib/vendor/onig/win32/makedef.py b/lib/edbee-lib/vendor/onig/win32/makedef.py new file mode 100755 index 00000000..38e8db49 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/win32/makedef.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python + +from __future__ import print_function +import re + +header_files = ( + "onigmo.h", "regenc.h", + "onigmognu.h", "onigmoposix.h" +) + +exclude_symbols = [ + "OnigEncodingKOI8", + + # USE_UPPER_CASE_TABLE + "OnigEncAsciiToUpperCaseTable", + "OnigEncISO_8859_1_ToUpperCaseTable", +] + +features = { + "USE_VARIABLE_META_CHARS": ("onig_set_meta_char",), + "USE_CAPTURE_HISTORY": ("onig_get_capture_tree",) +} + +for v in features.values(): + exclude_symbols += list(v) + +# Check if the features are enabled +with open("regint.h", "r") as f: + e = set() + for line in f: + for k, v in features.items(): + if re.match(r"^#define\s+" + k + r"\b", line): + e |= set(v) + exclude_symbols = list(set(exclude_symbols) - e) + +symbols = set() + +rx1 = re.compile("(ONIG_EXTERN.*)$") +rx2 = re.compile(r"(\w+)( +PV?_\(\(.*\)\)|\[.*\])?;\s*(/\*.*\*/)?$") +for filename in header_files: + with open(filename, "r") as f: + for line in f: + m = rx1.match(line) + if not m: + continue + s = m.group(1) + if s[-1] != ';': + s += ' ' + next(f) + m2 = rx2.search(s) + if m2 and (not m2.group(1) in exclude_symbols): + symbols.add(m2.group(1)) + +print('EXPORTS') +for s in sorted(symbols): + print('\t' + s) diff --git a/lib/edbee-lib/vendor/onig/win32/onigmo.rc b/lib/edbee-lib/vendor/onig/win32/onigmo.rc new file mode 100644 index 00000000..20ef0e57 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/win32/onigmo.rc @@ -0,0 +1,94 @@ +/********************************************************************** + onigmo.rc - Onigmo (Oniguruma-mod) (regular expression library) +**********************************************************************/ +/*- + * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <windows.h> +#include "onigmo.h" + +#define TOSTR_(a) #a +#define ONIG_VERSION_TOSTR_(a,b,c) \ + TOSTR_(a) "." TOSTR_(b) "." TOSTR_(c) +#define ONIG_VERSION_STRING \ + ONIG_VERSION_TOSTR_(ONIGMO_VERSION_MAJOR, ONIGMO_VERSION_MINOR, ONIGMO_VERSION_TEENY) + + +///////////////////////////////////////////////////////////////////////////// +// English resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION ONIGMO_VERSION_MAJOR,ONIGMO_VERSION_MINOR,ONIGMO_VERSION_TEENY,0 + PRODUCTVERSION ONIGMO_VERSION_MAJOR,ONIGMO_VERSION_MINOR,ONIGMO_VERSION_TEENY,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", " \0" + VALUE "FileDescription", "Onigmo (Oniguruma-mod) (regular expression library)\0" + VALUE "FileVersion", ONIG_VERSION_STRING "\0" + VALUE "InternalName", "onigmo.dll\0" + VALUE "LegalCopyright", "Copyright (C) 2002-2016 K.Kosako, 2011-2016 K.Takata\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "onigmo.dll\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "Onigmo (Oniguruma-mod)\0" + VALUE "ProductVersion", ONIG_VERSION_STRING "\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0409, 1200 + END +END + + + +#endif // English resources +///////////////////////////////////////////////////////////////////////////// diff --git a/lib/edbee-lib/vendor/onig/win32/testc.c b/lib/edbee-lib/vendor/onig/win32/testc.c new file mode 100644 index 00000000..f1a65869 --- /dev/null +++ b/lib/edbee-lib/vendor/onig/win32/testc.c @@ -0,0 +1,905 @@ +/* + * This program was generated by testconv.rb. + */ +#include "config.h" +#ifdef ONIG_ESCAPE_UCHAR_COLLISION +# undef ONIG_ESCAPE_UCHAR_COLLISION +#endif +#include <stdio.h> + +#ifdef POSIX_TEST +# include "onigmoposix.h" +#else +# include "onigmo.h" +#endif + +#include <string.h> + +#define SLEN(s) strlen(s) + +static int nsucc = 0; +static int nfail = 0; +static int nerror = 0; + +static FILE *err_file; + +#ifndef POSIX_TEST +static OnigRegion *region; +#endif + +static void xx(char *pattern, char *str, int from, int to, int mem, int not) +{ + int r; + +#ifdef POSIX_TEST + regex_t reg; + char buf[200]; + regmatch_t pmatch[25]; + + r = regcomp(®, pattern, REG_EXTENDED | REG_NEWLINE); + if (r) + { + regerror(r, ®, buf, sizeof(buf)); + fprintf(err_file, "ERROR: %s\n", buf); + nerror++; + return; + } + + r = regexec(®, str, reg.re_nsub + 1, pmatch, 0); + if (r != 0 && r != REG_NOMATCH) + { + regerror(r, ®, buf, sizeof(buf)); + fprintf(err_file, "ERROR: %s\n", buf); + nerror++; + return; + } + + if (r == REG_NOMATCH) + { + if (not) + { + fprintf(stdout, "OK(N): /%s/ '%s'\n", pattern, str); + nsucc++; + } + else + { + fprintf(stdout, "FAIL: /%s/ '%s'\n", pattern, str); + nfail++; + } + } + else + { + if (not) + { + fprintf(stdout, "FAIL(N): /%s/ '%s'\n", pattern, str); + nfail++; + } + else + { + if (pmatch[mem].rm_so == from && pmatch[mem].rm_eo == to) + { + fprintf(stdout, "OK: /%s/ '%s'\n", pattern, str); + nsucc++; + } + else + { + fprintf(stdout, "FAIL: /%s/ '%s' %d-%d : %d-%d\n", pattern, str, + (int)from, (int)to, (int)pmatch[mem].rm_so, + (int)pmatch[mem].rm_eo); + nfail++; + } + } + } + regfree(®); + +#else + regex_t *reg; + OnigErrorInfo einfo; + OnigSyntaxType syn = *ONIG_SYNTAX_DEFAULT; + + /* ONIG_OPTION_OFF(syn.options, ONIG_OPTION_ASCII_RANGE); */ + + r = onig_new(®, (UChar *)pattern, (UChar *)(pattern + SLEN(pattern)), + ONIG_OPTION_DEFAULT, ONIG_ENCODING_SJIS, &syn, &einfo); + if (r) + { + char s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str((UChar *)s, r, &einfo); + fprintf(err_file, "ERROR: %s\n", s); + nerror++; + return; + } + + r = onig_search(reg, (UChar *)str, (UChar *)(str + SLEN(str)), (UChar *)str, + (UChar *)(str + SLEN(str)), region, ONIG_OPTION_NONE); + if (r < ONIG_MISMATCH) + { + char s[ONIG_MAX_ERROR_MESSAGE_LEN]; + onig_error_code_to_str((UChar *)s, r); + fprintf(err_file, "ERROR: %s\n", s); + nerror++; + return; + } + + if (r == ONIG_MISMATCH) + { + if (not) + { + fprintf(stdout, "OK(N): /%s/ '%s'\n", pattern, str); + nsucc++; + } + else + { + fprintf(stdout, "FAIL: /%s/ '%s'\n", pattern, str); + nfail++; + } + } + else + { + if (not) + { + fprintf(stdout, "FAIL(N): /%s/ '%s'\n", pattern, str); + nfail++; + } + else + { + if (region->beg[mem] == from && region->end[mem] == to) + { + fprintf(stdout, "OK: /%s/ '%s'\n", pattern, str); + nsucc++; + } + else + { + fprintf(stdout, "FAIL: /%s/ '%s' %d-%d : %d-%d\n", pattern, str, + (int)from, (int)to, (int)region->beg[mem], + (int)region->end[mem]); + nfail++; + } + } + } + onig_free(reg); +#endif +} + +static void x2(char *pattern, char *str, int from, int to) +{ + xx(pattern, str, from, to, 0, 0); +} + +static void x3(char *pattern, char *str, int from, int to, int mem) +{ + xx(pattern, str, from, to, mem, 0); +} + +static void n(char *pattern, char *str) +{ + xx(pattern, str, 0, 0, 0, 1); +} + +extern int main(int argc, char *argv[]) +{ + err_file = stdout; + +#ifdef POSIX_TEST + reg_set_encoding(REG_POSIX_ENCODING_SJIS); +#else + region = onig_region_new(); +#endif + + x2("", "", 0, 0); + x2("^", "", 0, 0); + x2("$", "", 0, 0); + x2("\\G", "", 0, 0); + x2("\\A", "", 0, 0); + x2("\\Z", "", 0, 0); + x2("\\z", "", 0, 0); + x2("^$", "", 0, 0); + x2("\\ca", "\001", 0, 1); + x2("\\C-b", "\002", 0, 1); + x2("\\c\\\\", "\034", 0, 1); + x2("q[\\c\\\\]", "q\034", 0, 2); + x2("", "a", 0, 0); + x2("a", "a", 0, 1); + x2("\\x61", "a", 0, 1); + x2("aa", "aa", 0, 2); + x2("aaa", "aaa", 0, 3); + x2("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 0, 35); + x2("ab", "ab", 0, 2); + x2("b", "ab", 1, 2); + x2("bc", "abc", 1, 3); + x2("(?i:#RET#)", "#INS##RET#", 5, 10); + x2("\\17", "\017", 0, 1); + x2("\\x1f", "\x1f", 0, 1); + x2("a(?#....\\\\JJJJ)b", "ab", 0, 2); + x2("(?x) G (o O(?-x)oO) g L", "GoOoOgLe", 0, 7); + x2(".", "a", 0, 1); + n(".", ""); + x2("..", "ab", 0, 2); + x2("\\w", "e", 0, 1); + n("\\W", "e"); + x2("\\s", " ", 0, 1); + x2("\\S", "b", 0, 1); + x2("\\d", "4", 0, 1); + n("\\D", "4"); + x2("\\b", "z ", 0, 0); + x2("\\b", " z", 1, 1); + x2("\\B", "zz ", 1, 1); + x2("\\B", "z ", 2, 2); + x2("\\B", " z", 0, 0); + x2("[ab]", "b", 0, 1); + n("[ab]", "c"); + x2("[a-z]", "t", 0, 1); + n("[^a]", "a"); + x2("[^a]", "\n", 0, 1); + x2("[]]", "]", 0, 1); + n("[^]]", "]"); + x2("[\\^]+", "0^^1", 1, 3); + x2("[b-]", "b", 0, 1); + x2("[b-]", "-", 0, 1); + x2("[\\w]", "z", 0, 1); + n("[\\w]", " "); + x2("[\\W]", "b$", 1, 2); + x2("[\\d]", "5", 0, 1); + n("[\\d]", "e"); + x2("[\\D]", "t", 0, 1); + n("[\\D]", "3"); + x2("[\\s]", " ", 0, 1); + n("[\\s]", "a"); + x2("[\\S]", "b", 0, 1); + n("[\\S]", " "); + x2("[\\w\\d]", "2", 0, 1); + n("[\\w\\d]", " "); + x2("[[:upper:]]", "B", 0, 1); + x2("[*[:xdigit:]+]", "+", 0, 1); + x2("[*[:xdigit:]+]", "GHIKK-9+*", 6, 7); + x2("[*[:xdigit:]+]", "-@^+", 3, 4); + n("[[:upper]]", "A"); + x2("[[:upper]]", ":", 0, 1); + x2("[\\044-\\047]", "\046", 0, 1); + x2("[\\x5a-\\x5c]", "\x5b", 0, 1); + x2("[\\x6A-\\x6D]", "\x6c", 0, 1); + n("[\\x6A-\\x6D]", "\x6E"); + n("^[0-9A-F]+ 0+ UNDEF ", + "75F 00000000 SECT14A notype () External | _rb_apply"); + x2("[\\[]", "[", 0, 1); + x2("[\\]]", "]", 0, 1); + x2("[&]", "&", 0, 1); + x2("[[ab]]", "b", 0, 1); + x2("[[ab]c]", "c", 0, 1); + n("[[^a]]", "a"); + n("[^[a]]", "a"); + x2("[[ab]&&bc]", "b", 0, 1); + n("[[ab]&&bc]", "a"); + n("[[ab]&&bc]", "c"); + x2("[a-z&&b-y&&c-x]", "w", 0, 1); + n("[^a-z&&b-y&&c-x]", "w"); + x2("[[^a&&a]&&a-z]", "b", 0, 1); + n("[[^a&&a]&&a-z]", "a"); + x2("[[^a-z&&bcdef]&&[^c-g]]", "h", 0, 1); + n("[[^a-z&&bcdef]&&[^c-g]]", "c"); + x2("[^[^abc]&&[^cde]]", "c", 0, 1); + x2("[^[^abc]&&[^cde]]", "e", 0, 1); + n("[^[^abc]&&[^cde]]", "f"); + x2("[a-&&-a]", "-", 0, 1); + n("[a\\-&&\\-a]", "&"); + n("\\wabc", " abc"); + x2("a\\Wbc", "a bc", 0, 4); + x2("a.b.c", "aabbc", 0, 5); + x2(".\\wb\\W..c", "abb bcc", 0, 7); + x2("\\s\\wzzz", " zzzz", 0, 5); + x2("aa.b", "aabb", 0, 4); + n(".a", "ab"); + x2(".a", "aa", 0, 2); + x2("^a", "a", 0, 1); + x2("^a$", "a", 0, 1); + x2("^\\w$", "a", 0, 1); + n("^\\w$", " "); + x2("^\\wab$", "zab", 0, 3); + x2("^\\wabcdef$", "zabcdef", 0, 7); + x2("^\\w...def$", "zabcdef", 0, 7); + x2("\\w\\w\\s\\Waaa\\d", "aa aaa4", 0, 8); + x2("\\A\\Z", "", 0, 0); + x2("\\Axyz", "xyz", 0, 3); + x2("xyz\\Z", "xyz", 0, 3); + x2("xyz\\z", "xyz", 0, 3); + x2("a\\Z", "a", 0, 1); + x2("\\Gaz", "az", 0, 2); + n("\\Gz", "bza"); + n("az\\G", "az"); + n("az\\A", "az"); + n("a\\Az", "az"); + x2("\\^\\$", "^$", 0, 2); + x2("^x?y", "xy", 0, 2); + x2("^(x?y)", "xy", 0, 2); + x2("\\w", "_", 0, 1); + n("\\W", "_"); + x2("(?=z)z", "z", 0, 1); + n("(?=z).", "a"); + x2("(?!z)a", "a", 0, 1); + n("(?!z)a", "z"); + x2("(?i:a)", "a", 0, 1); + x2("(?i:a)", "A", 0, 1); + x2("(?i:A)", "a", 0, 1); + n("(?i:A)", "b"); + x2("(?i:[A-Z])", "a", 0, 1); + x2("(?i:[f-m])", "H", 0, 1); + x2("(?i:[f-m])", "h", 0, 1); + n("(?i:[f-m])", "e"); + x2("(?i:[A-c])", "D", 0, 1); + n("(?i:[^a-z])", "A"); + n("(?i:[^a-z])", "a"); + x2("(?i:[!-k])", "Z", 0, 1); + x2("(?i:[!-k])", "7", 0, 1); + x2("(?i:[T-}])", "b", 0, 1); + x2("(?i:[T-}])", "{", 0, 1); + x2("(?i:\\?a)", "?A", 0, 2); + x2("(?i:\\*A)", "*a", 0, 2); + n(".", "\n"); + x2("(?m:.)", "\n", 0, 1); + x2("(?m:a.)", "a\n", 0, 2); + x2("(?m:.b)", "a\nb", 1, 3); + x2(".*abc", "dddabdd\nddabc", 8, 13); + x2("(?m:.*abc)", "dddabddabc", 0, 10); + n("(?i)(?-i)a", "A"); + n("(?i)(?-i:a)", "A"); + x2("a?", "", 0, 0); + x2("a?", "b", 0, 0); + x2("a?", "a", 0, 1); + x2("a*", "", 0, 0); + x2("a*", "a", 0, 1); + x2("a*", "aaa", 0, 3); + x2("a*", "baaaa", 0, 0); + n("a+", ""); + x2("a+", "a", 0, 1); + x2("a+", "aaaa", 0, 4); + x2("a+", "aabbb", 0, 2); + x2("a+", "baaaa", 1, 5); + x2(".?", "", 0, 0); + x2(".?", "f", 0, 1); + x2(".?", "\n", 0, 0); + x2(".*", "", 0, 0); + x2(".*", "abcde", 0, 5); + x2(".+", "z", 0, 1); + x2(".+", "zdswer\n", 0, 6); + x2("(.*)a\\1f", "babfbac", 0, 4); + x2("(.*)a\\1f", "bacbabf", 3, 7); + x2("((.*)a\\2f)", "bacbabf", 3, 7); + x2("(.*)a\\1f", "baczzzzzz\nbazz\nzzzzbabf", 19, 23); + x2("a|b", "a", 0, 1); + x2("a|b", "b", 0, 1); + x2("|a", "a", 0, 0); + x2("(|a)", "a", 0, 0); + x2("ab|bc", "ab", 0, 2); + x2("ab|bc", "bc", 0, 2); + x2("z(?:ab|bc)", "zbc", 0, 3); + x2("a(?:ab|bc)c", "aabc", 0, 4); + x2("ab|(?:ac|az)", "az", 0, 2); + x2("a|b|c", "dc", 1, 2); + x2("a|b|cd|efg|h|ijk|lmn|o|pq|rstuvwx|yz", "pqr", 0, 2); + n("a|b|cd|efg|h|ijk|lmn|o|pq|rstuvwx|yz", "mn"); + x2("a|^z", "ba", 1, 2); + x2("a|^z", "za", 0, 1); + x2("a|\\Gz", "bza", 2, 3); + x2("a|\\Gz", "za", 0, 1); + x2("a|\\Az", "bza", 2, 3); + x2("a|\\Az", "za", 0, 1); + x2("a|b\\Z", "ba", 1, 2); + x2("a|b\\Z", "b", 0, 1); + x2("a|b\\z", "ba", 1, 2); + x2("a|b\\z", "b", 0, 1); + x2("\\w|\\s", " ", 0, 1); + n("\\w|\\w", " "); + x2("\\w|%", "%", 0, 1); + x2("\\w|[&$]", "&", 0, 1); + x2("[b-d]|[^e-z]", "a", 0, 1); + x2("(?:a|[c-f])|bz", "dz", 0, 1); + x2("(?:a|[c-f])|bz", "bz", 0, 2); + x2("abc|(?=zz)..f", "zzf", 0, 3); + x2("abc|(?!zz)..f", "abf", 0, 3); + x2("(?=za)..a|(?=zz)..a", "zza", 0, 3); + n("(?>a|abd)c", "abdc"); + x2("(?>abd|a)c", "abdc", 0, 4); + x2("a?|b", "a", 0, 1); + x2("a?|b", "b", 0, 0); + x2("a?|b", "", 0, 0); + x2("a*|b", "aa", 0, 2); + x2("a*|b*", "ba", 0, 0); + x2("a*|b*", "ab", 0, 1); + x2("a+|b*", "", 0, 0); + x2("a+|b*", "bbb", 0, 3); + x2("a+|b*", "abbb", 0, 1); + n("a+|b+", ""); + x2("(a|b)?", "b", 0, 1); + x2("(a|b)*", "ba", 0, 2); + x2("(a|b)+", "bab", 0, 3); + x2("(ab|ca)+", "caabbc", 0, 4); + x2("(ab|ca)+", "aabca", 1, 5); + x2("(ab|ca)+", "abzca", 0, 2); + x2("(a|bab)+", "ababa", 0, 5); + x2("(a|bab)+", "ba", 1, 2); + x2("(a|bab)+", "baaaba", 1, 4); + x2("(?:a|b)(?:a|b)", "ab", 0, 2); + x2("(?:a*|b*)(?:a*|b*)", "aaabbb", 0, 3); + x2("(?:a*|b*)(?:a+|b+)", "aaabbb", 0, 6); + x2("(?:a+|b+){2}", "aaabbb", 0, 6); + x2("h{0,}", "hhhh", 0, 4); + x2("(?:a+|b+){1,2}", "aaabbb", 0, 6); + n("ax{2}*a", "0axxxa1"); + n("a.{0,2}a", "0aXXXa0"); + n("a.{0,2}?a", "0aXXXa0"); + n("a.{0,2}?a", "0aXXXXa0"); + x2("^a{2,}?a$", "aaa", 0, 3); + x2("^[a-z]{2,}?$", "aaa", 0, 3); + x2("(?:a+|\\Ab*)cc", "cc", 0, 2); + n("(?:a+|\\Ab*)cc", "abcc"); + x2("(?:^a+|b+)*c", "aabbbabc", 6, 8); + x2("(?:^a+|b+)*c", "aabbbbc", 0, 7); + x2("a|(?i)c", "C", 0, 1); + x2("(?i)c|a", "C", 0, 1); + x2("(?i)c|a", "A", 0, 1); + x2("(?i:c)|a", "C", 0, 1); + n("(?i:c)|a", "A"); + x2("[abc]?", "abc", 0, 1); + x2("[abc]*", "abc", 0, 3); + x2("[^abc]*", "abc", 0, 0); + n("[^abc]+", "abc"); + x2("a?\?", "aaa", 0, 0); + x2("ba?\?b", "bab", 0, 3); + x2("a*?", "aaa", 0, 0); + x2("ba*?", "baa", 0, 1); + x2("ba*?b", "baab", 0, 4); + x2("a+?", "aaa", 0, 1); + x2("ba+?", "baa", 0, 2); + x2("ba+?b", "baab", 0, 4); + x2("(?:a?)?\?", "a", 0, 0); + x2("(?:a?\?)?", "a", 0, 0); + x2("(?:a?)+?", "aaa", 0, 1); + x2("(?:a+)?\?", "aaa", 0, 0); + x2("(?:a+)?\?b", "aaab", 0, 4); + x2("(?:ab)?{2}", "", 0, 0); + x2("(?:ab)?{2}", "ababa", 0, 4); + x2("(?:ab)*{0}", "ababa", 0, 0); + x2("(?:ab){3,}", "abababab", 0, 8); + n("(?:ab){3,}", "abab"); + x2("(?:ab){2,4}", "ababab", 0, 6); + x2("(?:ab){2,4}", "ababababab", 0, 8); + x2("(?:ab){2,4}?", "ababababab", 0, 4); + x2("(?:ab){,}", "ab{,}", 0, 5); + x2("(?:abc)+?{2}", "abcabcabc", 0, 6); + x2("(?:X*)(?i:xa)", "XXXa", 0, 4); + x2("(d+)([^abc]z)", "dddz", 0, 4); + x2("([^abc]*)([^abc]z)", "dddz", 0, 4); + x2("(\\w+)(\\wz)", "dddz", 0, 4); + x3("(a)", "a", 0, 1, 1); + x3("(ab)", "ab", 0, 2, 1); + x2("((ab))", "ab", 0, 2); + x3("((ab))", "ab", 0, 2, 1); + x3("((ab))", "ab", 0, 2, 2); + x3("((((((((((((((((((((ab))))))))))))))))))))", "ab", 0, 2, 20); + x3("(ab)(cd)", "abcd", 0, 2, 1); + x3("(ab)(cd)", "abcd", 2, 4, 2); + x3("()(a)bc(def)ghijk", "abcdefghijk", 3, 6, 3); + x3("(()(a)bc(def)ghijk)", "abcdefghijk", 3, 6, 4); + x2("(^a)", "a", 0, 1); + x3("(a)|(a)", "ba", 1, 2, 1); + x3("(^a)|(a)", "ba", 1, 2, 2); + x3("(a?)", "aaa", 0, 1, 1); + x3("(a*)", "aaa", 0, 3, 1); + x3("(a*)", "", 0, 0, 1); + x3("(a+)", "aaaaaaa", 0, 7, 1); + x3("(a+|b*)", "bbbaa", 0, 3, 1); + x3("(a+|b?)", "bbbaa", 0, 1, 1); + x3("(abc)?", "abc", 0, 3, 1); + x3("(abc)*", "abc", 0, 3, 1); + x3("(abc)+", "abc", 0, 3, 1); + x3("(xyz|abc)+", "abc", 0, 3, 1); + x3("([xyz][abc]|abc)+", "abc", 0, 3, 1); + x3("((?i:abc))", "AbC", 0, 3, 1); + x2("(abc)(?i:\\1)", "abcABC", 0, 6); + x3("((?m:a.c))", "a\nc", 0, 3, 1); + x3("((?=az)a)", "azb", 0, 1, 1); + x3("abc|(.abd)", "zabd", 0, 4, 1); + x2("(?:abc)|(ABC)", "abc", 0, 3); + x3("(?i:(abc))|(zzz)", "ABC", 0, 3, 1); + x3("a*(.)", "aaaaz", 4, 5, 1); + x3("a*?(.)", "aaaaz", 0, 1, 1); + x3("a*?(c)", "aaaac", 4, 5, 1); + x3("[bcd]a*(.)", "caaaaz", 5, 6, 1); + x3("(\\Abb)cc", "bbcc", 0, 2, 1); + n("(\\Abb)cc", "zbbcc"); + x3("(^bb)cc", "bbcc", 0, 2, 1); + n("(^bb)cc", "zbbcc"); + x3("cc(bb$)", "ccbb", 2, 4, 1); + n("cc(bb$)", "ccbbb"); + n("(\\1)", ""); + n("\\1(a)", "aa"); + n("(a(b)\\1)\\2+", "ababb"); + n("(?:(?:\\1|z)(a))+$", "zaa"); + x2("(?:(?:\\1|z)(a))+$", "zaaa", 0, 4); + x2("(a)(?=\\1)", "aa", 0, 1); + n("(a)$|\\1", "az"); + x2("(a)\\1", "aa", 0, 2); + n("(a)\\1", "ab"); + x2("(a?)\\1", "aa", 0, 2); + x2("(a?\?)\\1", "aa", 0, 0); + x2("(a*)\\1", "aaaaa", 0, 4); + x3("(a*)\\1", "aaaaa", 0, 2, 1); + x2("a(b*)\\1", "abbbb", 0, 5); + x2("a(b*)\\1", "ab", 0, 1); + x2("(a*)(b*)\\1\\2", "aaabbaaabb", 0, 10); + x2("(a*)(b*)\\2", "aaabbbb", 0, 7); + x2("(((((((a*)b))))))c\\7", "aaabcaaa", 0, 8); + x3("(((((((a*)b))))))c\\7", "aaabcaaa", 0, 3, 7); + x2("(a)(b)(c)\\2\\1\\3", "abcbac", 0, 6); + x2("([a-d])\\1", "cc", 0, 2); + x2("(\\w\\d\\s)\\1", "f5 f5 ", 0, 6); + n("(\\w\\d\\s)\\1", "f5 f5"); + x2("(who|[a-c]{3})\\1", "whowho", 0, 6); + x2("...(who|[a-c]{3})\\1", "abcwhowho", 0, 9); + x2("(who|[a-c]{3})\\1", "cbccbc", 0, 6); + x2("(^a)\\1", "aa", 0, 2); + n("(^a)\\1", "baa"); + n("(a$)\\1", "aa"); + n("(ab\\Z)\\1", "ab"); + x2("(a*\\Z)\\1", "a", 1, 1); + x2(".(a*\\Z)\\1", "ba", 1, 2); + x3("(.(abc)\\2)", "zabcabc", 0, 7, 1); + x3("(.(..\\d.)\\2)", "z12341234", 0, 9, 1); + x2("((?i:az))\\1", "AzAz", 0, 4); + n("((?i:az))\\1", "Azaz"); + x2("(?<=a)b", "ab", 1, 2); + n("(?<=a)b", "bb"); + x2("(?<=a|b)b", "bb", 1, 2); + x2("(?<=a|bc)b", "bcb", 2, 3); + x2("(?<=a|bc)b", "ab", 1, 2); + x2("(?<=a|bc||defghij|klmnopq|r)z", "rz", 1, 2); + x2("(a)\\g<1>", "aa", 0, 2); + x2("(?<!a)b", "cb", 1, 2); + n("(?<!a)b", "ab"); + x2("(?<!a|bc)b", "bbb", 0, 1); + n("(?<!a|bc)z", "bcz"); + x2("(?<name1>a)", "a", 0, 1); + x2("(?<name_2>ab)\\g<name_2>", "abab", 0, 4); + x2("(?<name_3>.zv.)\\k<name_3>", "azvbazvb", 0, 8); + x2("(?<=\\g<ab>)|-\\zEND (?<ab>XyZ)", "XyZ", 3, 3); + x2("(?<n>|a\\g<n>)+", "", 0, 0); + x2("(?<n>|\\(\\g<n>\\))+$", "()(())", 0, 6); + x3("\\g<n>(?<n>.){0}", "X", 0, 1, 1); + x2("\\g<n>(abc|df(?<n>.YZ){2,8}){0}", "XYZ", 0, 3); + x2("\\A(?<n>(a\\g<n>)|)\\z", "aaaa", 0, 4); + x2("(?<n>|\\g<m>\\g<n>)\\z|\\zEND (?<m>a|(b)\\g<m>)", "bbbbabba", 0, 8); + x2("(?<name1240>\\w+\\sx)a+\\k<name1240>", " fg xaaaaaaaafg x", 2, 18); + x3("(z)()()(?<_9>a)\\g<_9>", "zaa", 2, 3, 1); + x2("(.)(((?<_>a)))\\k<_>", "zaa", 0, 3); + x2("((?<name1>\\d)|(?<name2>\\w))(\\k<name1>|\\k<name2>)", "ff", 0, 2); + x2("(?:(?<x>)|(?<x>efg))\\k<x>", "", 0, 0); + x2("(?:(?<x>abc)|(?<x>efg))\\k<x>", "abcefgefg", 3, 9); + n("(?:(?<x>abc)|(?<x>efg))\\k<x>", "abcefg"); + x2("(?:(?<n1>.)|(?<n1>..)|(?<n1>...)|(?<n1>....)|(?<n1>.....)|(?<n1>......)|(" + "?<n1>.......)|(?<n1>........)|(?<n1>.........)|(?<n1>..........)|(?<n1>.." + ".........)|(?<n1>............)|(?<n1>.............)|(?<n1>..............)" + ")\\k<n1>$", + "a-pyumpyum", 2, 10); + x3("(?:(?<n1>.)|(?<n1>..)|(?<n1>...)|(?<n1>....)|(?<n1>.....)|(?<n1>......)|(" + "?<n1>.......)|(?<n1>........)|(?<n1>.........)|(?<n1>..........)|(?<n1>.." + ".........)|(?<n1>............)|(?<n1>.............)|(?<n1>..............)" + ")\\k<n1>$", + "xxxxabcdefghijklmnabcdefghijklmn", 4, 18, 14); + x3("(?<name1>)(?<name2>)(?<name3>)(?<name4>)(?<name5>)(?<name6>)(?<name7>)(?<" + "name8>)(?<name9>)(?<name10>)(?<name11>)(?<name12>)(?<name13>)(?<name14>)(" + "?<name15>)(?<name16>aaa)(?<name17>)$", + "aaa", 0, 3, 16); + x2("(?<foo>a|\\(\\g<foo>\\))", "a", 0, 1); + x2("(?<foo>a|\\(\\g<foo>\\))", "((((((a))))))", 0, 13); + x3("(?<foo>a|\\(\\g<foo>\\))", "((((((((a))))))))", 0, 17, 1); + x2("\\g<bar>|\\zEND(?<bar>.*abc$)", "abcxxxabc", 0, 9); + x2("\\g<1>|\\zEND(.a.)", "bac", 0, 3); + x3("\\g<_A>\\g<_A>|\\zEND(.a.)(?<_A>.b.)", "xbxyby", 3, 6, 1); + x2("\\A(?:\\g<pon>|\\g<pan>|\\zEND " + "(?<pan>a|c\\g<pon>c)(?<pon>b|d\\g<pan>d))$", + "cdcbcdc", 0, 7); + x2("\\A(?<n>|a\\g<m>)\\z|\\zEND (?<m>\\g<n>)", "aaaa", 0, 4); + x2("(?<n>(a|b\\g<n>c){3,5})", "baaaaca", 1, 5); + x2("(?<n>(a|b\\g<n>c){3,5})", "baaaacaaaaa", 0, 10); + x2("(?<pare>\\(([^\\(\\)]++|\\g<pare>)*+\\))", "((a))", 0, 5); + x2("()*\\1", "", 0, 0); + x2("(?:()|())*\\1\\2", "", 0, 0); + x3("(?:\\1a|())*", "a", 0, 0, 1); + x2("x((.)*)*x", "0x1x2x3", 1, 6); + x2("x((.)*)*x(?i:\\1)\\Z", "0x1x2x1X2", 1, 9); + x2("(?:()|()|()|()|()|())*\\2\\5", "", 0, 0); + x2("(?:()|()|()|(x)|()|())*\\2b\\5", "b", 0, 1); + x2("\\xED\\xF2", "\xed\xf2", 0, 2); + x2("", "", 0, 0); + x2("", "", 0, 2); + n("", ""); + x2("", "", 0, 4); + x2("", "", 0, 6); + x2("", + "", + 0, 70); + x2("", "", 2, 4); + x2("", "", 2, 6); + x2("\\xca\\xb8", "\xca\xb8", 0, 2); + x2(".", "", 0, 2); + x2("..", "", 0, 4); + x2("(?u)\\w", "", 0, 2); + n("(?u)\\W", ""); + x2("(?u)[\\W]", "$", 2, 3); + x2("\\S", "", 0, 2); + x2("\\S", "", 0, 2); + x2("\\b", "C ", 0, 0); + x2("\\b", " ", 1, 1); + x2("\\B", " ", 2, 2); + x2("\\B", " ", 3, 3); + x2("\\B", " ", 0, 0); + x2("[]", "", 0, 2); + n("[Ȃ]", ""); + x2("[-]", "", 0, 2); + n("[^]", ""); + x2("(?u)[\\w]", "", 0, 2); + n("[\\d]", ""); + x2("[\\D]", "", 0, 2); + n("[\\s]", ""); + x2("[\\S]", "", 0, 2); + x2("(?u)[\\w\\d]", "", 0, 2); + x2("(?u)[\\w\\d]", " ", 3, 5); + n("(?u)\\wS", " S"); + x2("(?u)S\\W", "S ", 0, 5); + x2("..", "", 0, 10); + x2("(?u).\\w\\W..", " ", 0, 13); + x2("(?u)\\s\\w", " ", 0, 9); + x2(".", "", 0, 8); + n(".", ""); + x2(".", "", 0, 4); + x2("^", "", 0, 2); + x2("^$", "", 0, 2); + x2("(?u)^\\w$", "", 0, 2); + x2("(?u)^\\w$", "z", 0, 11); + x2("(?u)^\\w...$", "z", 0, 13); + x2("(?u)\\w\\w\\s\\W\\d", "a 4", 0, 12); + x2("\\A", "", 0, 6); + x2("ނ߂\\Z", "ނ߂", 0, 6); + x2("\\z", "", 0, 6); + x2("\\Z", "\n", 0, 6); + x2("\\Gۂ", "ۂ", 0, 4); + n("\\G", ""); + n("Ƃ\\G", "Ƃ"); + n("܂\\A", "܂"); + n("\\A", "܂"); + x2("(?=)", "", 0, 2); + n("(?=).", ""); + x2("(?!)", "", 0, 2); + n("(?!)", ""); + x2("(?i:)", "", 0, 2); + x2("(?i:Ԃ)", "Ԃ", 0, 4); + n("(?i:)", ""); + x2("(?m:.)", "\n", 0, 3); + x2("(?m:.)", "\n", 2, 5); + x2("?", "", 0, 0); + x2("?", "", 0, 0); + x2("?", "", 0, 2); + x2("*", "", 0, 0); + x2("*", "", 0, 2); + x2("q*", "qqq", 0, 6); + x2("n*", "nnnn", 0, 0); + n("R+", ""); + x2("+", "", 0, 2); + x2("+", "", 0, 8); + x2("+", "", 0, 4); + x2("+", "", 2, 10); + x2(".?", "", 0, 2); + x2(".*", "ς҂Ղ", 0, 8); + x2(".+", "", 0, 2); + x2(".+", "\n", 0, 8); + x2("|", "", 0, 2); + x2("|", "", 0, 2); + x2("|", "", 0, 4); + x2("|", "", 0, 4); + x2("(?:|)", "", 0, 6); + x2("(?:|)", "", 0, 8); + x2("|(?:|)", "", 0, 4); + x2("||", "", 2, 4); + x2("|||||||||‚ĂƂȂ|ʂ", "", 0, + 6); + n("|||||||||‚ĂƂȂ|ʂ", ""); + x2("|^", "Ԃ", 2, 4); + x2("|^", "", 0, 2); + x2("S|\\G", "ԋS", 4, 6); + x2("S|\\G", "ԋS", 0, 2); + x2("S|\\A", "bԋS", 3, 5); + x2("S|\\A", "", 0, 2); + x2("S|\\Z", "ԋS", 2, 4); + x2("S|\\Z", "", 0, 2); + x2("S|\\Z", "\n", 0, 2); + x2("S|\\z", "ԋS", 2, 4); + x2("S|\\z", "", 0, 2); + x2("(?u)\\w|\\s", "", 0, 2); + x2("(?u)\\w|%", "%", 0, 1); + x2("(?u)\\w|[&$]", "&", 0, 2); + x2("[-]", "", 0, 2); + x2("[-]|[^-]", "", 0, 2); + x2("[-]|[^-]", "", 0, 2); + x2("[^]", "\n", 0, 1); + x2("(?:|[-])|", "", 0, 2); + x2("(?:|[-])|", "", 0, 4); + x2("|(?=)..", "", 0, 6); + x2("|(?!)..", "", 0, 6); + x2("(?=)..|(?=)..", "", 0, 6); + x2("(?<=|)", "", 4, 6); + n("(?>|)", ""); + x2("(?>|)", "", 0, 8); + x2("?|", "", 0, 2); + x2("?|", "", 0, 0); + x2("?|", "", 0, 0); + x2("*|", "", 0, 4); + x2("*|*", "", 0, 0); + x2("*|*", "", 0, 2); + x2("[a]*|*", "a", 0, 3); + x2("+|*", "", 0, 0); + x2("+|*", "", 0, 6); + x2("+|*", "", 0, 2); + x2("+|*", "a", 0, 0); + n("+|+", ""); + x2("(|)?", "", 0, 2); + x2("(|)*", "", 0, 4); + x2("(|)+", "", 0, 6); + x2("(|)+", "", 0, 8); + x2("(|)+", "", 4, 12); + x2("(|)+", "", 2, 10); + x2("(|)+", "", 0, 4); + x2("(|)+", "$$zzzz", 6, 10); + x2("(|)+", "", 0, 10); + x2("(|)+", "", 2, 4); + x2("(|)+", "", 2, 8); + x2("(?:|)(?:|)", "", 0, 4); + x2("(?:*|*)(?:*|*)", "", 0, 6); + x2("(?:*|*)(?:+|+)", "", 0, 12); + x2("(?:+|+){2}", "", 0, 12); + x2("(?:+|+){1,2}", "", 0, 12); + x2("(?:+|\\A*)", "", 0, 4); + n("(?:+|\\A*)", ""); + x2("(?:^+|+)*", "", 12, 16); + x2("(?:^+|+)*", "", 0, 14); + x2("{0,}", "", 0, 8); + x2("|(?i)c", "C", 0, 1); + x2("(?i)c|", "C", 0, 1); + x2("(?i:)|a", "a", 0, 1); + n("(?i:)|a", "A"); + x2("[]?", "", 0, 2); + x2("[]*", "", 0, 6); + x2("[^]*", "", 0, 0); + n("[^]+", ""); + x2("?\?", "", 0, 0); + x2("?\?", "", 0, 6); + x2("*?", "", 0, 0); + x2("*?", "", 0, 2); + x2("*?", "", 0, 8); + x2("+?", "", 0, 2); + x2("+?", "", 0, 4); + x2("+?", "", 0, 8); + x2("(?:V?)?\?", "V", 0, 0); + x2("(?:V?\?)?", "V", 0, 0); + x2("(?:?)+?", "", 0, 2); + x2("(?:+)?\?", "", 0, 0); + x2("(?:+)?\?", "ᑚ", 0, 8); + x2("(?:)?{2}", "", 0, 0); + x2("(?:S)?{2}", "SԋSԋS", 0, 8); + x2("(?:S)*{0}", "SԋSԋS", 0, 0); + x2("(?:S){3,}", "SԋSԋSԋS", 0, 16); + n("(?:S){3,}", "SԋS"); + x2("(?:S){2,4}", "SԋSԋS", 0, 12); + x2("(?:S){2,4}", "SԋSԋSԋSԋS", 0, 16); + x2("(?:S){2,4}?", "SԋSԋSԋSԋS", 0, 8); + x2("(?:S){,}", "S{,}", 0, 7); + x2("(?:)+?{2}", "", 0, 12); + x3("()", "", 0, 2, 1); + x3("(ΐ)", "ΐ", 0, 4, 1); + x2("(())", "", 0, 4); + x3("(())", "", 0, 4, 1); + x3("(())", "", 0, 4, 2); + x3("((((((((((((((((((((ʎq))))))))))))))))))))", "ʎq", 0, 4, 20); + x3("()()", "", 0, 4, 1); + x3("()()", "", 4, 8, 2); + x3("()()()", "", 6, 12, 3); + x3("(()()())", "", 6, 12, 4); + x3(".*(tH)E}(()V^)C", "tHE}V^C", 10, 18, 2); + x2("(^)", "", 0, 2); + x3("()|()", "", 2, 4, 1); + x3("(^)|()", "", 2, 4, 2); + x3("(?)", "", 0, 2, 1); + x3("(*)", "܂܂", 0, 6, 1); + x3("(*)", "", 0, 0, 1); + x3("(+)", "", 0, 14, 1); + x3("(+|*)", "ӂӂӂւ", 0, 6, 1); + x3("(+|?)", "", 0, 2, 1); + x3("()?", "", 0, 6, 1); + x3("()*", "", 0, 6, 1); + x3("()+", "", 0, 6, 1); + x3("(|)+", "", 0, 6, 1); + x3("([Ȃɂ][]|)+", "", 0, 6, 1); + x3("((?i:))", "", 0, 6, 1); + x3("((?m:.))", "\n", 0, 5, 1); + x3("((?=))", "", 0, 2, 1); + x3("|(.)", "񂠂", 0, 8, 1); + x3("*(.)", "", 8, 10, 1); + x3("*?(.)", "", 0, 2, 1); + x3("*?()", "", 8, 10, 1); + x3("[]*(.)", "", 10, 12, 1); + x3("(\\A)", "", 0, 4, 1); + n("(\\A)", "񂢂"); + x3("(^)", "", 0, 4, 1); + n("(^)", "񂢂"); + x3("($)", "", 4, 8, 1); + n("($)", ""); + x2("()\\1", "", 0, 4); + n("()\\1", ""); + x2("(?)\\1", "", 0, 4); + x2("(?\?)\\1", "", 0, 0); + x2("(*)\\1", "", 0, 8); + x3("(*)\\1", "", 0, 4, 1); + x2("(*)\\1", "", 0, 10); + x2("(*)\\1", "", 0, 2); + x2("(*)(*)\\1\\2", "", 0, 20); + x2("(*)(*)\\2", "", 0, 14); + x3("(*)(*)\\2", "", 6, 10, 2); + x2("(((((((*)))))))\\7", "ۂۂۂ؂҂ۂۂ", 0, 16); + x3("(((((((*)))))))\\7", "ۂۂۂ؂҂ۂۂ", 0, 6, 7); + x2("()()()\\2\\1\\3", "͂ЂӂЂ͂", 0, 12); + x2("([-])\\1", "", 0, 4); + x2("(?u)(\\w\\d\\s)\\1", "5 5 ", 0, 8); + n("(?u)(\\w\\d\\s)\\1", "5 5"); + x2("(NH|[-]{3})\\1", "NHNH", 0, 8); + x2("...(NH|[-]{3})\\1", "aNHNH", 0, 13); + x2("(NH|[-]{3})\\1", "", 0, 12); + x2("(^)\\1", "", 0, 4); + n("(^)\\1", "߂ނ"); + n("($)\\1", ""); + n("(\\Z)\\1", ""); + x2("(*\\Z)\\1", "", 2, 2); + x2(".(*\\Z)\\1", "", 2, 4); + x3("(.(₢)\\2)", "z₢₢", 0, 13, 1); + x3("(.(..\\d.)\\2)", "12341234", 0, 10, 1); + x2("((?i:v))\\1", "vv", 0, 10); + x2("(?<>|\\(\\g<>\\))", "(((((())))))", 0, 14); + x2("\\A(?:\\g<_1>|\\g<]_2>|\\zI " + "(?<_1>|\\g<]_2>)(?<]_2>|F\\g<_1>F))$", + "FFݎFF", 0, 26); + x2("[[Ђ]]", "", 0, 2); + x2("[[]]", "", 0, 2); + n("[[^]]", ""); + n("[^[]]", ""); + x2("[^[^]]", "", 0, 2); + x2("[[]&&]", "", 0, 2); + n("[[]&&]", ""); + n("[[]&&]", ""); + x2("[-&&-&&-]", "", 0, 2); + n("[^-&&-&&-]", ""); + x2("[[^&&]&&-]", "", 0, 2); + n("[[^&&]&&-]", ""); + x2("[[^-&&]&&[^-]]", "", 0, 2); + n("[[^-&&]&&[^-]]", ""); + x2("[^[^]&&[^]]", "", 0, 2); + x2("[^[^]&&[^]]", "", 0, 2); + n("[^[^]&&[^]]", ""); + x2("[-&&-]", "-", 0, 1); + x2("[^[^a-z]&&[^bcdefg]q-w]", "", 0, 2); + x2("[^[^a-z]&&[^bcdefg]g-w]", "f", 0, 1); + x2("[^[^a-z]&&[^bcdefg]g-w]", "g", 0, 1); + n("[^[^a-z]&&[^bcdefg]g-w]", "2"); + x2("a<b>o[W̃_E[h<\\/b>", "a<b>o[W̃_E[h</b>", + 0, 32); + x2(".<b>o[W̃_E[h<\\/b>", "a<b>o[W̃_E[h</b>", + 0, 32); + fprintf(stdout, + "\nRESULT SUCC: %d, FAIL: %d, ERROR: %d (by Onigmo %s)\n", + nsucc, nfail, nerror, onig_version()); + +#ifndef POSIX_TEST + onig_region_free(region, 1); + onig_end(); +#endif + + return ((nfail == 0 && nerror == 0) ? 0 : -1); +} diff --git a/lib/edbee-lib/vendor/qslog/.gitignore b/lib/edbee-lib/vendor/qslog/.gitignore new file mode 100644 index 00000000..fc7339b3 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/.gitignore @@ -0,0 +1,2 @@ +build-* +*pro.user* diff --git a/lib/edbee-lib/vendor/qslog/CMakeLists.txt b/lib/edbee-lib/vendor/qslog/CMakeLists.txt new file mode 100644 index 00000000..f4c2d835 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/CMakeLists.txt @@ -0,0 +1,118 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 3.1...3.20) + +project(QsLog) + +OPTION(BUILD_WITH_QT5 "Whether to build with Qt5 or Qt6." OFF) + +# Add CMake modules +set(CMAKE_MODULE_PATH + "${QsLog_SOURCE_DIR}/cmake" + "${CMAKE_MODULE_PATH}" +) + +include(QsLogConfigTargets) + +# Add a _d to debug binaries +set(CMAKE_DEBUG_POSTFIX "_d") + +# Qt +if(BUILD_WITH_QT5) + find_package(Qt5 REQUIRED COMPONENTS Core) + set(QT_LIBRARIES Qt5::Core) +else() + find_package(Qt6 REQUIRED COMPONENTS Core) + set(QT_LIBRARIES Qt6::Core) +endif() + +# As moc files are generated in the binary dir, tell to always look for includes there +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +# Specify build paths +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${QsLog_BINARY_DIR}/lib) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QsLog_BINARY_DIR}/lib) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QsLog_BINARY_DIR}/bin) + +set(HEADER_FILES + QsLog.h + QsLogDest.h + QsLogDestConsole.h + QsLogDestFile.h + QsLogDestFunctor.h + QsLogDisableForThisFile.h + QsLogLevel.h + QsLogMessage.h + QsLogSharedLibrary.h + ) + +set(SOURCE_FILES + QsLog.cpp + QsLogDest.cpp + QsLogDestConsole.cpp + QsLogDestFile.cpp + QsLogDestFunctor.cpp + QsLogMessage.cpp + QsLogLevel.cpp + ) + +if(APPLE) + # Apple's compiler will not find standard includes like <thread> or <mutex> with 10.7 target otherwise + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") +endif() + +# Use 11.0 OSX SDK for Qt6 compatibility +set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0") + +option(QS_LOG_LINE_NUMBERS "Automatically writes the file and line for each log message" ON) +if(QS_LOG_LINE_NUMBERS) + add_definitions(-DQS_LOG_LINE_NUMBERS) +endif() + +option(QS_LOG_DISABLE "Logging code is replaced with a no-op" OFF) +if(QS_LOG_DISABLE) + add_definitions(-DQS_LOG_DISABLE) +endif() + +option(QS_LOG_SEPARATE_THREAD "Messages are queued and written from a separate thread" OFF) +if(QS_LOG_SEPARATE_THREAD) + add_definitions(-DQS_LOG_SEPARATE_THREAD) +endif() + +option(QS_LOG_WIN_PRINTF_CONSOLE "Use fprintf instead of OutputDebugString on Windows" OFF) +if(QS_LOG_WIN_PRINTF_CONSOLE) + add_definitions(-DQS_LOG_WIN_PRINTF_CONSOLE) +endif() + +option(QS_LOG_IS_SHARED_LIBRARY "Build shared library" ON) +if(QS_LOG_IS_SHARED_LIBRARY) + set(QS_LOG_LIBRARY_TYPE SHARED) + add_definitions(-DQSLOG_IS_SHARED_LIBRARY) +else(QS_LOG_IS_SHARED_LIBRARY) + set(QS_LOG_LIBRARY_TYPE STATIC) +endif(QS_LOG_IS_SHARED_LIBRARY) + +add_library(QsLog ${QS_LOG_LIBRARY_TYPE} ${HEADER_FILES} ${SOURCE_FILES}) + +set_target_properties(QsLog PROPERTIES AUTOMOC ON) + +option(QS_LOG_BUILD_WINDOW "Build log window, depends on Qt5::Widgets" OFF) +if(QS_LOG_BUILD_WINDOW) + if(BUILD_WITH_QT5) + find_package(Qt5 REQUIRED COMPONENTS Widgets) + list(APPEND ADDITIONAL_LIBRARIES Qt5::Widgets) + else() + find_package(Qt6 REQUIRED COMPONENTS Widgets) + list(APPEND ADDITIONAL_LIBRARIES Qt6::Widgets) + endif() + add_definitions(-DQS_LOG_WINDOW) + set_target_properties(QsLog PROPERTIES AUTOUIC ON AUTORCC ON) +endif() + +target_link_libraries(QsLog ${QT_LIBRARIES} ${ADDITIONAL_LIBRARIES}) + +install(FILES ${HEADER_FILES} DESTINATION include/QsLog) +QsLog_install_target(QsLog "") + +option(QS_LOG_BUILD_TESTS "Build unit tests" OFF) +if(QS_LOG_BUILD_TESTS) + add_subdirectory(unittest) +endif() diff --git a/lib/edbee-lib/vendor/qslog/LICENSE.txt b/lib/edbee-lib/vendor/qslog/LICENSE.txt new file mode 100644 index 00000000..fb53d551 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/LICENSE.txt @@ -0,0 +1,24 @@ +Copyright (c) 2010 - 2016 Razvan Petru +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or other + materials provided with the distribution. +* The name of the contributors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/lib/edbee-lib/vendor/qslog/QsLog.cpp b/lib/edbee-lib/vendor/qslog/QsLog.cpp new file mode 100644 index 00000000..2a9fca49 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLog.cpp @@ -0,0 +1,286 @@ +// Copyright (c) 2013, Razvan Petru +// All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: + +// * Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this +// list of conditions and the following disclaimer in the documentation and/or +// other materials provided with the distribution. +// * The name of the contributors may not be used to endorse or promote products +// derived from this software without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include "QsLog.h" +#include "QsLogDest.h" +#ifdef QS_LOG_SEPARATE_THREAD +# include <QThread> +# include <QWaitCondition> +# include <queue> +#endif +#include <QMutex> +#include <QDateTime> +#include <QLatin1String> +#include <QtGlobal> +#include <cstdlib> +#include <stdexcept> +#include <algorithm> +#include <vector> + +namespace QsLogging +{ +using DestinationList = std::vector<DestinationPtrU>; + +#ifdef QS_LOG_SEPARATE_THREAD +//! Messages can be enqueued from other threads and will be logged one by one. +//! Note: std::queue was used instead of QQueue because it accepts types missing operator=. +class LoggerThread : public QThread +{ +public: + void enqueue(const LogMessage &message) + { + QMutexLocker locker(&mutex); + messageQueue.push(message); + waitCondition.wakeOne(); + } + + void requestStop() + { + QMutexLocker locker(&mutex); + requestInterruption(); + waitCondition.wakeOne(); + } + +protected: + virtual void run() + { + while (true) + { + QMutexLocker locker(&mutex); + if (messageQueue.empty() && !isInterruptionRequested()) + { + waitCondition.wait(&mutex); + } + if (isInterruptionRequested()) + { + break; + } + + const LogMessage msg = messageQueue.front(); + messageQueue.pop(); + locker.unlock(); + Logger::instance().write(msg); + } + } + +private: + QMutex mutex; + QWaitCondition waitCondition; + std::queue<LogMessage> messageQueue; +}; +#endif + +class LoggerImpl +{ +public: + LoggerImpl(); + ~LoggerImpl(); + +#ifdef QS_LOG_SEPARATE_THREAD + bool shutDownLoggerThread(); + + LoggerThread loggerThread; +#endif + QMutex logMutex; + Level level; + DestinationList destList; +}; + +LoggerImpl::LoggerImpl() + : level(InfoLevel) +{ + destList.reserve(2); // assume at least file + console +#ifdef QS_LOG_SEPARATE_THREAD + loggerThread.start(QThread::LowPriority); +#endif +} + +LoggerImpl::~LoggerImpl() +{ +#ifdef QS_LOG_SEPARATE_THREAD +# if defined(Q_OS_WIN) && defined(QSLOG_IS_SHARED_LIBRARY) + // Waiting on the thread here is too late and can lead to deadlocks. More + // details: + // * Another reason not to do anything scary in your DllMain: + // https://blogs.msdn.microsoft.com/oldnewthing/20040128-00/?p=40853 + // * Dynamic Link libraries best practices: + // https://msdn.microsoft.com/en-us/library/windows/desktop/dn633971%28v=vs.85%29.aspx#general_best_practices + Q_ASSERT(loggerThread.isFinished()); + if (!loggerThread.isFinished()) + { + qCritical( + "You must shut down the QsLog thread, otherwise deadlocks can occur!"); + } +# endif + shutDownLoggerThread(); +#endif +} + +#ifdef QS_LOG_SEPARATE_THREAD +bool LoggerImpl::shutDownLoggerThread() +{ + if (loggerThread.isFinished()) + { + return true; + } + + loggerThread.requestStop(); + return loggerThread.wait(); +} +#endif + +Logger &Logger::instance() +{ + static Logger instance; + return instance; +} + +// tries to extract the level from a string log message. If available, +// conversionSucceeded will contain the conversion result. +Level Logger::levelFromLogMessage(const QString &logMessage, + bool *conversionSucceeded) +{ + using namespace QsLogging; + + if (conversionSucceeded) + *conversionSucceeded = true; + + if (logMessage.startsWith(QLatin1String(LevelName(TraceLevel)))) + return TraceLevel; + if (logMessage.startsWith(QLatin1String(LevelName(DebugLevel)))) + return DebugLevel; + if (logMessage.startsWith(QLatin1String(LevelName(InfoLevel)))) + return InfoLevel; + if (logMessage.startsWith(QLatin1String(LevelName(WarnLevel)))) + return WarnLevel; + if (logMessage.startsWith(QLatin1String(LevelName(ErrorLevel)))) + return ErrorLevel; + if (logMessage.startsWith(QLatin1String(LevelName(FatalLevel)))) + return FatalLevel; + + if (conversionSucceeded) + *conversionSucceeded = false; + return OffLevel; +} + +Logger::~Logger() noexcept = default; + +#if defined(Q_OS_WIN) +bool Logger::shutDownLoggerThread() +{ +# ifdef QS_LOG_SEPARATE_THREAD + return d->shutDownLoggerThread(); +# else + return true; +# endif +} +#endif + +void Logger::addDestination(DestinationPtrU &&destination) +{ + Q_ASSERT(destination.get()); + QMutexLocker lock(&d->logMutex); + d->destList.emplace_back(std::move(destination)); +} + +DestinationPtrU Logger::removeDestination(const QString &type) +{ + QMutexLocker lock(&d->logMutex); + + const auto it = std::find_if( + d->destList.begin(), d->destList.end(), + [&type](const DestinationPtrU &dest) { return dest->type() == type; }); + + if (it != d->destList.end()) + { + auto removed = std::move(*it); + d->destList.erase(it); + return removed; + } + + return DestinationPtrU(); +} + +bool Logger::hasDestinationOfType(const char *type) const +{ + QMutexLocker lock(&d->logMutex); + const QLatin1String latin1Type(type); + for (const auto &dest : d->destList) + { + if (dest->type() == latin1Type) + { + return true; + } + } + + return false; +} + +void Logger::setLoggingLevel(Level newLevel) +{ + d->level = newLevel; +} + +Level Logger::loggingLevel() const +{ + return d->level; +} + +Logger::Helper::~Helper() noexcept +{ + const LogMessage msg(buffer, QDateTime::currentDateTimeUtc(), level); + Logger::instance().enqueueWrite(msg); +} + +Logger::Logger() + : d(new LoggerImpl) +{ + qRegisterMetaType<LogMessage>("QsLogging::LogMessage"); +} + +//! directs the message to the task queue or writes it directly +void Logger::enqueueWrite(const LogMessage &message) +{ +#ifdef QS_LOG_SEPARATE_THREAD + d->loggerThread.enqueue(message); +#else + write(message); +#endif +} + +//! Sends the message to all the destinations. The level for this message is passed in case +//! it's useful for processing in the destination. +void Logger::write(const LogMessage &message) +{ + QMutexLocker lock(&d->logMutex); + for (auto &dest : d->destList) + { + dest->write(message); + } +} + +} // namespace QsLogging diff --git a/lib/edbee-lib/vendor/qslog/QsLog.h b/lib/edbee-lib/vendor/qslog/QsLog.h new file mode 100644 index 00000000..3f148820 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLog.h @@ -0,0 +1,205 @@ +// Copyright (c) 2013, Razvan Petru +// All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: + +// * Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this +// list of conditions and the following disclaimer in the documentation and/or +// other materials provided with the distribution. +// * The name of the contributors may not be used to endorse or promote products +// derived from this software without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef QSLOG_H +#define QSLOG_H + +#include "QsLogLevel.h" +#include "QsLogMessage.h" +#include "QsLogSharedLibrary.h" +#include <QDebug> +#include <QString> +#include <memory> + +#define QS_LOG_VERSION "2.1" + +namespace QsLogging +{ + +class Destination; +class LoggerImpl; // d pointer +using DestinationPtrU = std::unique_ptr<Destination>; + +class QSLOG_SHARED_OBJECT Logger +{ +public: + static Logger &instance(); + static Level levelFromLogMessage(const QString &logMessage, + bool *conversionSucceeded = 0); + +public: + Logger(const Logger &) = delete; + Logger &operator=(const Logger &) = delete; + + ~Logger() noexcept; + +#if defined(Q_OS_WIN) + //! When QS_LOG_SEPARATE_THREAD is defined on Windows, and you are using this library as a DLL, + //! this function must be called before your program ends, to ensure a clean shutdown of the logger thread. + //! Failing to call it will result in an assert being triggered, an error message being printed + //! out and most probably a deadlock. + //! Returns the wait result for the thread. When called on a non-threaded logger returns true + //! immediately. + bool shutDownLoggerThread(); +#endif + + //! Adds a log message destination. Don't add null destinations. + void addDestination(DestinationPtrU &&destination); + + //! Removes and returns a previously added destination. Returns null if not found. + DestinationPtrU removeDestination(const QString &type); + + //! Checks if a destination of a specific type has been added. Pass T::Type as parameter. + bool hasDestinationOfType(const char *type) const; + + //! Messages at a level < 'newLevel' will be ignored + void setLoggingLevel(Level newLevel); + + //! The default level is INFO + Level loggingLevel() const; + + //! The helper forwards the streaming to QDebug and builds the final + //! log message. + class QSLOG_SHARED_OBJECT Helper + { + public: + explicit Helper(Level logLevel) + : level(logLevel) + , qtDebug(&buffer) + { + } + ~Helper() noexcept; + QDebug &stream() { return qtDebug; } + + private: + Level level; + QString buffer; + QDebug qtDebug; + }; + +private: + Logger(); + + void enqueueWrite(const LogMessage &message); + void write(const LogMessage &message); + + std::unique_ptr<LoggerImpl> d; + + friend class LoggerThread; +}; + +} // namespace QsLogging + +//! Logging macros: define QS_LOG_LINE_NUMBERS to get the file and line number +//! in the log output. +#ifndef QS_LOG_LINE_NUMBERS +# define QLOG_TRACE() \ + if (QsLogging::Logger::instance().loggingLevel() > QsLogging::TraceLevel) \ + { \ + } \ + else \ + QsLogging::Logger::Helper(QsLogging::TraceLevel).stream() +# define QLOG_DEBUG() \ + if (QsLogging::Logger::instance().loggingLevel() > QsLogging::DebugLevel) \ + { \ + } \ + else \ + QsLogging::Logger::Helper(QsLogging::DebugLevel).stream() +# define QLOG_INFO() \ + if (QsLogging::Logger::instance().loggingLevel() > QsLogging::InfoLevel) \ + { \ + } \ + else \ + QsLogging::Logger::Helper(QsLogging::InfoLevel).stream() +# define QLOG_WARN() \ + if (QsLogging::Logger::instance().loggingLevel() > QsLogging::WarnLevel) \ + { \ + } \ + else \ + QsLogging::Logger::Helper(QsLogging::WarnLevel).stream() +# define QLOG_ERROR() \ + if (QsLogging::Logger::instance().loggingLevel() > QsLogging::ErrorLevel) \ + { \ + } \ + else \ + QsLogging::Logger::Helper(QsLogging::ErrorLevel).stream() +# define QLOG_FATAL() \ + if (QsLogging::Logger::instance().loggingLevel() > QsLogging::FatalLevel) \ + { \ + } \ + else \ + QsLogging::Logger::Helper(QsLogging::FatalLevel).stream() +#else +# define QLOG_TRACE() \ + if (QsLogging::Logger::instance().loggingLevel() > QsLogging::TraceLevel) \ + { \ + } \ + else \ + QsLogging::Logger::Helper(QsLogging::TraceLevel).stream() \ + << __FILE__ << '@' << __LINE__ +# define QLOG_DEBUG() \ + if (QsLogging::Logger::instance().loggingLevel() > QsLogging::DebugLevel) \ + { \ + } \ + else \ + QsLogging::Logger::Helper(QsLogging::DebugLevel).stream() \ + << __FILE__ << '@' << __LINE__ +# define QLOG_INFO() \ + if (QsLogging::Logger::instance().loggingLevel() > QsLogging::InfoLevel) \ + { \ + } \ + else \ + QsLogging::Logger::Helper(QsLogging::InfoLevel).stream() \ + << __FILE__ << '@' << __LINE__ +# define QLOG_WARN() \ + if (QsLogging::Logger::instance().loggingLevel() > QsLogging::WarnLevel) \ + { \ + } \ + else \ + QsLogging::Logger::Helper(QsLogging::WarnLevel).stream() \ + << __FILE__ << '@' << __LINE__ +# define QLOG_ERROR() \ + if (QsLogging::Logger::instance().loggingLevel() > QsLogging::ErrorLevel) \ + { \ + } \ + else \ + QsLogging::Logger::Helper(QsLogging::ErrorLevel).stream() \ + << __FILE__ << '@' << __LINE__ +# define QLOG_FATAL() \ + if (QsLogging::Logger::instance().loggingLevel() > QsLogging::FatalLevel) \ + { \ + } \ + else \ + QsLogging::Logger::Helper(QsLogging::FatalLevel).stream() \ + << __FILE__ << '@' << __LINE__ +#endif + +#ifdef QS_LOG_DISABLE +# include "QsLogDisableForThisFile.h" +#endif + +#endif // QSLOG_H diff --git a/lib/edbee-lib/vendor/qslog/QsLog.pri b/lib/edbee-lib/vendor/qslog/QsLog.pri new file mode 100644 index 00000000..7354db61 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLog.pri @@ -0,0 +1,41 @@ +INCLUDEPATH += $$PWD +DEFINES += QS_LOG_LINE_NUMBERS # automatically writes the file and line for each log message +#DEFINES += QS_LOG_DISABLE # logging code is replaced with a no-op +#DEFINES += QS_LOG_SEPARATE_THREAD # messages are queued and written from a separate thread +#DEFINES += QS_LOG_WIN_PRINTF_CONSOLE # Use fprintf instead of OutputDebugString on Windows +#DEFINES += QS_LOG_WINDOW # allows easily showing log messages in a UI + +contains(DEFINES, QS_LOG_WINDOW) { + message("Will include log window destination") + QT += gui + greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + SOURCES += $$PWD/QsLogWindow.cpp \ + $$PWD/QsLogWindowModel.cpp + HEADERS += $$PWD/QsLogWindow.h \ + $$PWD/QsLogWindowModel.h + FORMS += $$PWD/QsLogWindow.ui + RESOURCES += $$PWD/QsLogWindow.qrc +} + +SOURCES += $$PWD/QsLogDest.cpp \ + $$PWD/QsLog.cpp \ + $$PWD/QsLogDestConsole.cpp \ + $$PWD/QsLogDestFile.cpp \ + $$PWD/QsLogDestFunctor.cpp \ + $$PWD/QsLogMessage.cpp \ + $$PWD/QsLogLevel.cpp + +HEADERS += $$PWD/QsLogDest.h \ + $$PWD/QsLog.h \ + $$PWD/QsLogDestConsole.h \ + $$PWD/QsLogLevel.h \ + $$PWD/QsLogDestFile.h \ + $$PWD/QsLogDisableForThisFile.h \ + $$PWD/QsLogDestFunctor.h \ + $$PWD/QsLogMessage.h \ + $$PWD/QsLogSharedLibrary.h + +OTHER_FILES += \ + $$PWD/QsLogChanges.txt \ + $$PWD/README.md \ + $$PWD/LICENSE.txt diff --git a/lib/edbee-lib/vendor/qslog/QsLogChanges.txt b/lib/edbee-lib/vendor/qslog/QsLogChanges.txt new file mode 100644 index 00000000..cff5a62b --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogChanges.txt @@ -0,0 +1,69 @@ +------------------- +QsLog version 2.1 + +Changes: +* Allowed checking if a destination of a certain type has already been added. +* Allowed using fprintf instead of OutputDebugString on Windows. +* Made building/running the example from QtCreator easier. Unfortunately I couldn't find a +satisfactory way of doing this using pure qmake, so an env var is needed. +* Added support for CMake builds (Qt5 only, courtesy of A.Gembe). + +Fixes: +* Fixed build for Qt < 5.4 (courtesy of P.Hille). + +------------------- +QsLog version 2.0 + +Changes: +* Added possibility to remove destinations. +* Added unit tests for rotation and destination removal. + +Fixes: +* Fixed rare codec error in combination with custom ICU. + +------------------- +QsLog version 2.0b4 + +Fixes: +Fixed file name case error for Linux. + +Misc: +* Moved to separate git repository. + +------------------- +QsLog version 2.0b3 + +Changes: +* added functor logging destination (thanks to Omar Carey for providing a patch) + +------------------- +QsLog version 2.0b2 + +Changes: +* function signature redefinition for file destination creation +* added shared library build configuration. Credit goes to Xavier Lamien <laxathom@fedoraproject.org> +for the Linux-specific config. +* removed Symbian support +* this version does not guarantee support for Nokia N9 devices, although it should in theory still +work with them +* workaround for Issue 8 - when used from an executable and a plugin QsLog only logs from the +executable. +* utility function to parse the level from an existing log message + +Known issues: +* The current version will crash at program exit when using QS_LOG_SEPARATE_THREAD and linking +with QsLog dynamically. + +------------------- +QsLog version 2.0b1 + +Changes: +* destination pointers use shared pointer semantics +* the file destination supports log rotation. As a consequence, log files are encoded as UTF-8 and +the log appends rather than truncating on every startup when rotation is enabled. +* added the posibility of disabling logging either at run time or compile time. +* added the possibility of using a separate thread for writing to the log destinations. + +Fixes: +* renamed the main.cpp example to avoid QtCreator confusion +* offer a way to check if the destination creation has failed (for e.g files) diff --git a/lib/edbee-lib/vendor/qslog/QsLogDest.cpp b/lib/edbee-lib/vendor/qslog/QsLogDest.cpp new file mode 100644 index 00000000..999b30ba --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogDest.cpp @@ -0,0 +1,76 @@ +// Copyright (c) 2013, Razvan Petru +// All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: + +// * Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this +// list of conditions and the following disclaimer in the documentation and/or +// other materials provided with the distribution. +// * The name of the contributors may not be used to endorse or promote products +// derived from this software without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include "QsLogDest.h" +#include "QsLogDestConsole.h" +#include "QsLogDestFile.h" +#include "QsLogDestFunctor.h" +#include <QString> + +namespace QsLogging +{ + +Destination::~Destination() noexcept = default; + +//! destination factory +DestinationPtrU DestinationFactory::MakeFileDestination( + const QString &filePath, LogRotationOption rotation, + const MaxSizeBytes &sizeInBytesToRotateAfter, + const MaxOldLogCount &oldLogsToKeep) +{ + if (LogRotationOption::EnableLogRotation == rotation) + { + std::unique_ptr<SizeRotationStrategy> logRotation(new SizeRotationStrategy); + logRotation->setMaximumSizeInBytes(sizeInBytesToRotateAfter.size); + logRotation->setBackupCount(oldLogsToKeep.count); + + return DestinationPtrU( + new FileDestination(filePath, std::move(logRotation))); + } + + return DestinationPtrU(new FileDestination( + filePath, RotationStrategyPtrU(new NullRotationStrategy))); +} + +DestinationPtrU DestinationFactory::MakeDebugOutputDestination() +{ + return DestinationPtrU(new DebugOutputDestination); +} + +DestinationPtrU DestinationFactory::MakeFunctorDestination( + QsLogging::Destination::LogFunction f) +{ + return DestinationPtrU(new FunctorDestination(f)); +} + +DestinationPtrU DestinationFactory::MakeFunctorDestination(QObject *receiver, + const char *member) +{ + return DestinationPtrU(new FunctorDestination(receiver, member)); +} + +} // namespace QsLogging diff --git a/lib/edbee-lib/vendor/qslog/QsLogDest.h b/lib/edbee-lib/vendor/qslog/QsLogDest.h new file mode 100644 index 00000000..d2a55583 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogDest.h @@ -0,0 +1,122 @@ +// Copyright (c) 2013, Razvan Petru +// All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: + +// * Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this +// list of conditions and the following disclaimer in the documentation and/or +// other materials provided with the distribution. +// * The name of the contributors may not be used to endorse or promote products +// derived from this software without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef QSLOGDEST_H +#define QSLOGDEST_H + +#include "QsLogLevel.h" +#include "QsLogMessage.h" +#include "QsLogSharedLibrary.h" +#include <QtGlobal> +#include <limits> +#include <memory> +#include <functional> +class QString; +class QObject; + +namespace QsLogging +{ + +class QSLOG_SHARED_OBJECT Destination +{ +public: + using LogFunction = std::function<void(const LogMessage &message)>; + +public: + virtual ~Destination() noexcept; + virtual void write(const LogMessage &message) = 0; + //! + //! \brief isValid + //! \return whether the destination was created correctly + //! + virtual bool isValid() = 0; + //! + //! \brief type + //! \return the type as a string e.g: console, file. + //! The returned value may change in different versions of QsLog, but two destinations + //! of the same type will return the same value. + //! + virtual QString type() const = 0; +}; + +using DestinationPtrU = std::unique_ptr<Destination>; + +// a series of "named" paramaters, to make the file destination creation more +// readable +enum class LogRotationOption +{ + DisableLogRotation = 0, + EnableLogRotation = 1 +}; + +struct QSLOG_SHARED_OBJECT MaxSizeBytes +{ + MaxSizeBytes() + : size(0) + { + } + explicit MaxSizeBytes(qint64 size_) + : size(size_) + { + } + qint64 size; +}; + +struct QSLOG_SHARED_OBJECT MaxOldLogCount +{ + MaxOldLogCount() + : count(0) + { + } + explicit MaxOldLogCount(int count_) + : count(count_) + { + } + int count; +}; + +//! Creates logging destinations/sinks. The caller takes ownership of the destinations from the +//! factory and will pass ownership to the logger when adding the destination. +class QSLOG_SHARED_OBJECT DestinationFactory +{ +public: + static DestinationPtrU MakeFileDestination( + const QString &filePath, + LogRotationOption rotation = LogRotationOption::DisableLogRotation, + const MaxSizeBytes &sizeInBytesToRotateAfter = MaxSizeBytes(), + const MaxOldLogCount &oldLogsToKeep = MaxOldLogCount()); + static DestinationPtrU MakeDebugOutputDestination(); + // takes a pointer to a function + static DestinationPtrU MakeFunctorDestination(Destination::LogFunction f); + // takes a QObject + signal/slot + static DestinationPtrU MakeFunctorDestination(QObject *receiver, + const char *member); +}; + +} // namespace QsLogging + +#endif // QSLOGDEST_H diff --git a/lib/edbee-lib/vendor/qslog/QsLogDestConsole.cpp b/lib/edbee-lib/vendor/qslog/QsLogDestConsole.cpp new file mode 100644 index 00000000..43810deb --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogDestConsole.cpp @@ -0,0 +1,65 @@ +// Copyright (c) 2013, Razvan Petru +// All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: + +// * Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this +// list of conditions and the following disclaimer in the documentation and/or +// other materials provided with the distribution. +// * The name of the contributors may not be used to endorse or promote products +// derived from this software without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include "QsLogDestConsole.h" +#include <QString> +#include <QtGlobal> + +#if defined(Q_OS_UNIX) \ + || defined(Q_OS_WIN) && defined(QS_LOG_WIN_PRINTF_CONSOLE) +# include <cstdio> +void QsDebugOutput::output(const QString &message) +{ + fprintf(stderr, "%s\n", qPrintable(message)); + fflush(stderr); +} +#elif defined(Q_OS_WIN) +# define WIN32_LEAN_AND_MEAN +# include <windows.h> +void QsDebugOutput::output(const QString &message) +{ + OutputDebugStringW(reinterpret_cast<const WCHAR *>(message.utf16())); + OutputDebugStringW(L"\n"); +} +#endif + +const char *const QsLogging::DebugOutputDestination::Type = "console"; + +void QsLogging::DebugOutputDestination::write(const LogMessage &message) +{ + QsDebugOutput::output(message.formatted); +} + +bool QsLogging::DebugOutputDestination::isValid() +{ + return true; +} + +QString QsLogging::DebugOutputDestination::type() const +{ + return QString::fromLatin1(Type); +} diff --git a/lib/edbee-lib/vendor/qslog/QsLogDestConsole.h b/lib/edbee-lib/vendor/qslog/QsLogDestConsole.h new file mode 100644 index 00000000..01b0135b --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogDestConsole.h @@ -0,0 +1,56 @@ +// Copyright (c) 2013, Razvan Petru +// All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: + +// * Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this +// list of conditions and the following disclaimer in the documentation and/or +// other materials provided with the distribution. +// * The name of the contributors may not be used to endorse or promote products +// derived from this software without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef QSLOGDESTCONSOLE_H +#define QSLOGDESTCONSOLE_H + +#include "QsLogDest.h" +class QString; + +class QsDebugOutput +{ +public: + static void output(const QString &a_message); +}; + +namespace QsLogging +{ + +// debugger sink +class QSLOG_SHARED_OBJECT DebugOutputDestination : public Destination +{ +public: + static const char *const Type; + + void write(const LogMessage &message) override; + bool isValid() override; + QString type() const override; +}; + +} // namespace QsLogging + +#endif // QSLOGDESTCONSOLE_H diff --git a/lib/edbee-lib/vendor/qslog/QsLogDestFile.cpp b/lib/edbee-lib/vendor/qslog/QsLogDestFile.cpp new file mode 100644 index 00000000..17802674 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogDestFile.cpp @@ -0,0 +1,219 @@ +// Copyright (c) 2013, Razvan Petru +// All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: + +// * Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this +// list of conditions and the following disclaimer in the documentation and/or +// other materials provided with the distribution. +// * The name of the contributors may not be used to endorse or promote products +// derived from this software without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include "QsLogDestFile.h" +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) +# include <QTextCodec> +#endif +#include <QDateTime> +#include <QString> +#include <QtGlobal> +#include <iostream> + +const int QsLogging::SizeRotationStrategy::MaxBackupCount = 10; + +QsLogging::RotationStrategy::~RotationStrategy() noexcept = default; + +void QsLogging::SizeRotationStrategy::setInitialInfo(const QFile &file) +{ + mFileName = file.fileName(); + mCurrentSizeInBytes = file.size(); +} + +void QsLogging::SizeRotationStrategy::setInitialInfo(const QString &filePath, + int fileSize) +{ + mFileName = filePath; + mCurrentSizeInBytes = fileSize; +} + +void QsLogging::SizeRotationStrategy::includeMessageInCalculation( + const QString &message) +{ + includeMessageInCalculation(message.toUtf8()); +} + +void QsLogging::SizeRotationStrategy::includeMessageInCalculation( + const QByteArray &message) +{ + mCurrentSizeInBytes += message.size(); +} + +bool QsLogging::SizeRotationStrategy::shouldRotate() +{ + return mCurrentSizeInBytes > mMaxSizeInBytes; +} + +// Algorithm assumes backups will be named filename.X, where 1 <= X <= +// mBackupsCount. All X's will be shifted up. +void QsLogging::SizeRotationStrategy::rotate() +{ + if (!mBackupsCount) + { + if (!removeFileAtPath(mFileName)) + { + std::cerr << "QsLog: backup delete failed " << qPrintable(mFileName); + } + return; + } + + // 1. find the last existing backup than can be shifted up + const QString logNamePattern = mFileName + QString::fromUtf8(".%1"); + int lastExistingBackupIndex = 0; + for (int i = 1; i <= mBackupsCount; ++i) + { + const QString backupFileName = logNamePattern.arg(i); + if (fileExistsAtPath(backupFileName)) + { + lastExistingBackupIndex = qMin(i, mBackupsCount - 1); + } + else + { + break; + } + } + + // 2. shift up + for (int i = lastExistingBackupIndex; i >= 1; --i) + { + const QString oldName = logNamePattern.arg(i); + const QString newName = logNamePattern.arg(i + 1); + removeFileAtPath(newName); + const bool renamed = renameFileFromTo(oldName, newName); + if (!renamed) + { + std::cerr << "QsLog: could not rename backup " << qPrintable(oldName) + << " to " << qPrintable(newName); + } + } + + // 3. rename current log file + const QString newName = logNamePattern.arg(1); + if (fileExistsAtPath(newName)) + { + removeFileAtPath(newName); + } + if (!renameFileFromTo(mFileName, newName)) + { + std::cerr << "QsLog: could not rename log " << qPrintable(mFileName) + << " to " << qPrintable(newName); + } +} + +QIODevice::OpenMode QsLogging::SizeRotationStrategy::recommendedOpenModeFlag() +{ + return QIODevice::Append; +} + +void QsLogging::SizeRotationStrategy::setMaximumSizeInBytes(qint64 size) +{ + Q_ASSERT(size >= 0); + mMaxSizeInBytes = size; +} + +void QsLogging::SizeRotationStrategy::setBackupCount(int backups) +{ + Q_ASSERT(backups >= 0); + mBackupsCount = qMin(backups, SizeRotationStrategy::MaxBackupCount); +} + +bool QsLogging::SizeRotationStrategy::removeFileAtPath(const QString &path) +{ + return QFile::remove(path); +} + +bool QsLogging::SizeRotationStrategy::fileExistsAtPath(const QString &path) +{ + return QFile::exists(path); +} + +bool QsLogging::SizeRotationStrategy::renameFileFromTo(const QString &from, + const QString &to) +{ + return QFile::rename(from, to); +} + +const char *const QsLogging::FileDestination::Type = "file"; + +QsLogging::FileDestination::FileDestination( + const QString &filePath, RotationStrategyPtrU &&rotationStrategy) + : mRotationStrategy(std::move(rotationStrategy)) +{ + mFile.setFileName(filePath); + if (!mFile.open(QFile::WriteOnly | QFile::Text + | mRotationStrategy->recommendedOpenModeFlag())) + { + std::cerr << "QsLog: could not open log file " << qPrintable(filePath); + } + mOutputStream.setDevice(&mFile); + +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) + mOutputStream.setCodec(QTextCodec::codecForName("UTF-8")); +#else + mOutputStream.setEncoding(QStringConverter::Utf8); +#endif + + mRotationStrategy->setInitialInfo(mFile); +} + +void QsLogging::FileDestination::write(const LogMessage &message) +{ + const QByteArray utf8Message = message.formatted.toUtf8(); + mRotationStrategy->includeMessageInCalculation(utf8Message); + if (mRotationStrategy->shouldRotate()) + { + mOutputStream.setDevice(nullptr); + mFile.close(); + mRotationStrategy->rotate(); + if (!mFile.open(QFile::WriteOnly | QFile::Text + | mRotationStrategy->recommendedOpenModeFlag())) + { + std::cerr << "QsLog: could not reopen log file " + << qPrintable(mFile.fileName()); + } + mRotationStrategy->setInitialInfo(mFile); + mOutputStream.setDevice(&mFile); +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) + mOutputStream.setCodec(QTextCodec::codecForName("UTF-8")); +#else + mOutputStream.setEncoding(QStringConverter::Utf8); +#endif + } + + mOutputStream << utf8Message << '\n'; + mOutputStream.flush(); +} + +bool QsLogging::FileDestination::isValid() +{ + return mFile.isOpen(); +} + +QString QsLogging::FileDestination::type() const +{ + return QString::fromLatin1(Type); +} diff --git a/lib/edbee-lib/vendor/qslog/QsLogDestFile.h b/lib/edbee-lib/vendor/qslog/QsLogDestFile.h new file mode 100644 index 00000000..679344d5 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogDestFile.h @@ -0,0 +1,123 @@ +// Copyright (c) 2013, Razvan Petru +// All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: + +// * Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this +// list of conditions and the following disclaimer in the documentation and/or +// other materials provided with the distribution. +// * The name of the contributors may not be used to endorse or promote products +// derived from this software without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef QSLOGDESTFILE_H +#define QSLOGDESTFILE_H + +#include "QsLogDest.h" +#include <QFile> +#include <QTextStream> +#include <QString> +#include <QByteArray> +#include <QtGlobal> +#include <memory> + +namespace QsLogging +{ +class QSLOG_SHARED_OBJECT RotationStrategy +{ +public: + virtual ~RotationStrategy() noexcept; + + virtual void setInitialInfo(const QFile &file) = 0; + virtual void includeMessageInCalculation(const QString &message) = 0; + virtual void includeMessageInCalculation(const QByteArray &message) = 0; + virtual bool shouldRotate() = 0; + virtual void rotate() = 0; + virtual QIODevice::OpenMode recommendedOpenModeFlag() = 0; +}; + +// Never rotates file, overwrites existing file. +class QSLOG_SHARED_OBJECT NullRotationStrategy : public RotationStrategy +{ +public: + void setInitialInfo(const QFile &) override {} + void includeMessageInCalculation(const QString &) override {} + void includeMessageInCalculation(const QByteArray &) override {} + bool shouldRotate() override { return false; } + void rotate() override {} + QIODevice::OpenMode recommendedOpenModeFlag() override + { + return QIODevice::Truncate; + } +}; + +// Rotates after a size is reached, keeps a number of <= 10 backups, appends to +// existing file. +class QSLOG_SHARED_OBJECT SizeRotationStrategy : public RotationStrategy +{ +public: + SizeRotationStrategy() = default; + static const int MaxBackupCount; + + void setInitialInfo(const QFile &file) override; + void setInitialInfo(const QString &filePath, int fileSize); + void includeMessageInCalculation(const QString &message) override; + void includeMessageInCalculation(const QByteArray &message) override; + bool shouldRotate() override; + void rotate() override; + QIODevice::OpenMode recommendedOpenModeFlag() override; + + void setMaximumSizeInBytes(qint64 size); + void setBackupCount(int backups); + +protected: + // can be overridden for testing + virtual bool removeFileAtPath(const QString &path); + virtual bool fileExistsAtPath(const QString &path); + virtual bool renameFileFromTo(const QString &from, const QString &to); + +private: + QString mFileName; + qint64 mCurrentSizeInBytes{0}; + qint64 mMaxSizeInBytes{0}; + int mBackupsCount{0}; +}; + +using RotationStrategyPtrU = std::unique_ptr<RotationStrategy>; + +// file message sink +class QSLOG_SHARED_OBJECT FileDestination : public Destination +{ +public: + static const char *const Type; + + FileDestination(const QString &filePath, + RotationStrategyPtrU &&rotationStrategy); + void write(const LogMessage &message) override; + bool isValid() override; + QString type() const override; + +private: + QFile mFile; + QTextStream mOutputStream; + RotationStrategyPtrU mRotationStrategy; +}; + +} // namespace QsLogging + +#endif // QSLOGDESTFILE_H diff --git a/lib/edbee-lib/vendor/qslog/QsLogDestFunctor.cpp b/lib/edbee-lib/vendor/qslog/QsLogDestFunctor.cpp new file mode 100644 index 00000000..549fa362 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogDestFunctor.cpp @@ -0,0 +1,68 @@ +// Copyright (c) 2014, Razvan Petru +// Copyright (c) 2014, Omar Carey +// All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: + +// * Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this +// list of conditions and the following disclaimer in the documentation and/or +// other materials provided with the distribution. +// * The name of the contributors may not be used to endorse or promote products +// derived from this software without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include "QsLogDestFunctor.h" +#include <cstddef> +#include <QtGlobal> +#include <QString> + +const char *const QsLogging::FunctorDestination::Type = "functor"; + +QsLogging::FunctorDestination::FunctorDestination(LogFunction f) + : QObject(nullptr) + , mLogFunction(f) +{ +} + +QsLogging::FunctorDestination::FunctorDestination(QObject *receiver, + const char *member) + : QObject(nullptr) + , mLogFunction(nullptr) +{ + connect(this, SIGNAL(logMessageReady(QsLogging::LogMessage)), receiver, + member, Qt::QueuedConnection); +} + +void QsLogging::FunctorDestination::write(const LogMessage &message) +{ + if (mLogFunction) + mLogFunction(message); + + if (message.level > QsLogging::TraceLevel) + emit logMessageReady(message); +} + +bool QsLogging::FunctorDestination::isValid() +{ + return true; +} + +QString QsLogging::FunctorDestination::type() const +{ + return QString::fromLatin1(Type); +} diff --git a/lib/edbee-lib/vendor/qslog/QsLogDestFunctor.h b/lib/edbee-lib/vendor/qslog/QsLogDestFunctor.h new file mode 100644 index 00000000..94cd3e96 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogDestFunctor.h @@ -0,0 +1,66 @@ +// Copyright (c) 2014, Razvan Petru +// Copyright (c) 2014, Omar Carey +// All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: + +// * Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this +// list of conditions and the following disclaimer in the documentation and/or +// other materials provided with the distribution. +// * The name of the contributors may not be used to endorse or promote products +// derived from this software without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef QSLOGDESTFUNCTOR_H +#define QSLOGDESTFUNCTOR_H + +#include "QsLogDest.h" +#include <QObject> + +namespace QsLogging +{ +// Offers various types of function-like sinks. +// This is an advanced destination type. Depending on your configuration, +// LogFunction might be called from a different thread or even a different +// binary. You should not access QsLog from inside LogFunction and should not +// perform any time-consuming operations. logMessageReady is connected through a +// queued connection and trace messages are not included +class QSLOG_SHARED_OBJECT FunctorDestination : public QObject, + public Destination +{ + Q_OBJECT +public: + static const char *const Type; + + explicit FunctorDestination(LogFunction f); + FunctorDestination(QObject *receiver, const char *member); + + void write(const LogMessage &message) override; + bool isValid() override; + QString type() const override; + +protected: + // int used to avoid registering a new enum type + Q_SIGNAL void logMessageReady(const QsLogging::LogMessage &message); + +private: + LogFunction mLogFunction; +}; +} // namespace QsLogging + +#endif // QSLOGDESTFUNCTOR_H diff --git a/lib/edbee-lib/vendor/qslog/QsLogDisableForThisFile.h b/lib/edbee-lib/vendor/qslog/QsLogDisableForThisFile.h new file mode 100644 index 00000000..aed01114 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogDisableForThisFile.h @@ -0,0 +1,58 @@ +#ifndef QSLOGDISABLEFORTHISFILE_H +#define QSLOGDISABLEFORTHISFILE_H + +// When included after all includes of QsLog.h (direct and indirect includes +// through other headers) this file will disable logging in that translation +// unit. + +#ifndef QLOG_TRACE +# error "This file must be included after QsLog.h" +#endif + +#include <QtDebug> + +#undef QLOG_TRACE +#undef QLOG_DEBUG +#undef QLOG_INFO +#undef QLOG_WARN +#undef QLOG_ERROR +#undef QLOG_FATAL + +#define QLOG_TRACE() \ + if (1) \ + { \ + } \ + else \ + qDebug() +#define QLOG_DEBUG() \ + if (1) \ + { \ + } \ + else \ + qDebug() +#define QLOG_INFO() \ + if (1) \ + { \ + } \ + else \ + qDebug() +#define QLOG_WARN() \ + if (1) \ + { \ + } \ + else \ + qDebug() +#define QLOG_ERROR() \ + if (1) \ + { \ + } \ + else \ + qDebug() +#define QLOG_FATAL() \ + if (1) \ + { \ + } \ + else \ + qDebug() + +#endif // QSLOGDISABLEFORTHISFILE_H diff --git a/lib/edbee-lib/vendor/qslog/QsLogLevel.cpp b/lib/edbee-lib/vendor/qslog/QsLogLevel.cpp new file mode 100644 index 00000000..09a5c78b --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogLevel.cpp @@ -0,0 +1,57 @@ +#include "QsLogLevel.h" +#include <QString> +#include <QObject> +#include <cassert> + +static const char TraceString[] = "TRACE"; +static const char DebugString[] = "DEBUG"; +static const char InfoString[] = "INFO "; +static const char WarnString[] = "WARN "; +static const char ErrorString[] = "ERROR"; +static const char FatalString[] = "FATAL"; + +const char *QsLogging::LevelName(QsLogging::Level theLevel) +{ + switch (theLevel) + { + case QsLogging::TraceLevel: + return TraceString; + case QsLogging::DebugLevel: + return DebugString; + case QsLogging::InfoLevel: + return InfoString; + case QsLogging::WarnLevel: + return WarnString; + case QsLogging::ErrorLevel: + return ErrorString; + case QsLogging::FatalLevel: + return FatalString; + case QsLogging::OffLevel: + return ""; + default: { + Q_ASSERT(!"bad log level"); + return InfoString; + } + } +} + +QString QsLogging::LocalizedLevelName(QsLogging::Level theLevel) +{ + switch (theLevel) + { + case QsLogging::TraceLevel: + return QObject::tr("Trace"); + case QsLogging::DebugLevel: + return QObject::tr("Debug"); + case QsLogging::InfoLevel: + return QObject::tr("Info"); + case QsLogging::WarnLevel: + return QObject::tr("Warning"); + case QsLogging::ErrorLevel: + return QObject::tr("Error"); + case QsLogging::FatalLevel: + return QObject::tr("Fatal"); + default: + return QString(); + } +} diff --git a/lib/edbee-lib/vendor/qslog/QsLogLevel.h b/lib/edbee-lib/vendor/qslog/QsLogLevel.h new file mode 100644 index 00000000..22c2e1e6 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogLevel.h @@ -0,0 +1,50 @@ +// Copyright (c) 2013, Razvan Petru +// All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: + +// * Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this +// list of conditions and the following disclaimer in the documentation and/or +// other materials provided with the distribution. +// * The name of the contributors may not be used to endorse or promote products +// derived from this software without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef QSLOGLEVEL_H +#define QSLOGLEVEL_H +class QString; + +namespace QsLogging +{ +enum Level +{ + TraceLevel = 0, + DebugLevel, + InfoLevel, + WarnLevel, + ErrorLevel, + FatalLevel, + OffLevel +}; + +const char *LevelName(Level theLevel); +QString LocalizedLevelName(Level theLevel); + +} // namespace QsLogging + +#endif // QSLOGLEVEL_H diff --git a/lib/edbee-lib/vendor/qslog/QsLogMessage.cpp b/lib/edbee-lib/vendor/qslog/QsLogMessage.cpp new file mode 100644 index 00000000..41fda05a --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogMessage.cpp @@ -0,0 +1,48 @@ +// Copyright (c) 2015, Axel Gembe <axel@gembe.net> +// All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: + +// * Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this +// list of conditions and the following disclaimer in the documentation and/or +// other materials provided with the distribution. +// * The name of the contributors may not be used to endorse or promote products +// derived from this software without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include "QsLogMessage.h" +#include "QsLogLevel.h" + +namespace QsLogging +{ + +// not using Qt::ISODate because we need the milliseconds too +static const char DateTimePattern[] = "yyyy-MM-ddThh:mm:ss.zzz"; + +LogMessage::LogMessage(const QString &m, const QDateTime &t, const Level l) + : message(m) + , time(t) + , level(l) + , formatted(QString("%1 %2 %3") + .arg(LevelName(level)) + .arg(t.toLocalTime().toString(DateTimePattern)) + .arg(message)) +{ +} + +} // namespace QsLogging diff --git a/lib/edbee-lib/vendor/qslog/QsLogMessage.h b/lib/edbee-lib/vendor/qslog/QsLogMessage.h new file mode 100644 index 00000000..c8efc126 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogMessage.h @@ -0,0 +1,60 @@ +// Copyright (c) 2015, Axel Gembe <axel@gembe.net> +// All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: + +// * Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this +// list of conditions and the following disclaimer in the documentation and/or +// other materials provided with the distribution. +// * The name of the contributors may not be used to endorse or promote products +// derived from this software without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef QSLOGMESSAGE_H +#define QSLOGMESSAGE_H + +#include "QsLogLevel.h" + +#include <QString> +#include <QDateTime> + +namespace QsLogging +{ + +struct LogMessage +{ + LogMessage() = default; // Needs to be accessible for qRegisterMetaType + LogMessage(const QString &m, const QDateTime &t, + const Level l); // Construct and format message + + //! Log message + QString message; + + //! Time stamp in UTC, use .toLocalTime() to get local time + QDateTime time; + + //! Log level + Level level; + + //! Formatted log message ([level] [time] [message]) + const QString formatted; +}; + +} // namespace QsLogging + +#endif // QSLOGMESSAGE_H diff --git a/lib/edbee-lib/vendor/qslog/QsLogSharedLibrary.h b/lib/edbee-lib/vendor/qslog/QsLogSharedLibrary.h new file mode 100644 index 00000000..e9dbea64 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogSharedLibrary.h @@ -0,0 +1,12 @@ +#ifndef QSSHAREDLIBRARY_H +#define QSSHAREDLIBRARY_H + +#ifdef QSLOG_IS_SHARED_LIBRARY +# define QSLOG_SHARED_OBJECT Q_DECL_EXPORT +#elif QSLOG_IS_SHARED_LIBRARY_IMPORT +# define QSLOG_SHARED_OBJECT Q_DECL_IMPORT +#else +# define QSLOG_SHARED_OBJECT +#endif + +#endif // QSSHAREDLIBRARY_H diff --git a/lib/edbee-lib/vendor/qslog/QsLogSharedLibrary.pro b/lib/edbee-lib/vendor/qslog/QsLogSharedLibrary.pro new file mode 100644 index 00000000..8d34111d --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogSharedLibrary.pro @@ -0,0 +1,46 @@ +# This pro file will build QsLog as a shared library +TARGET = QsLog +VERSION = "2.1.0" +QT -= gui +CONFIG -= console +CONFIG -= app_bundle +CONFIG += shared +CONFIG += c++11 +TEMPLATE = lib + +QSLOG_DESTDIR=$$(QSLOG_DESTDIR) +!isEmpty(QSLOG_DESTDIR) { + message(Will use $${QSLOG_DESTDIR} as destdir.) + DESTDIR = $${QSLOG_DESTDIR}/bin + OBJECTS_DIR = $${QSLOG_DESTDIR} + MOC_DIR = $${QSLOG_DESTDIR} + UI_DIR = $${QSLOG_DESTDIR} + RCC_DIR = $${QSLOG_DESTDIR} +} + +win32 { + DEFINES += QSLOG_IS_SHARED_LIBRARY +} + +include(QsLog.pri) + +unix:!macx { + DISTRO = $$system(uname -a) + + # make install will install the shared object in the appropriate folders + headers.files = QsLog.h QsLogDest.h QsLogLevel.h + headers.path = /usr/include/$(QMAKE_TARGET) + + other_files.files = LICENSE.txt QsLogChanges.txt README.md + other_files.path = /usr/local/share/$(QMAKE_TARGET) + contains(DISTRO, .*ARCH): other_files.path = /usr/share/$(QMAKE_TARGET) + + contains(QT_ARCH, x86_64) { + target.path = /usr/lib64 + contains(DISTRO, .*ARCH): target.path = /usr/lib + } else { + target.path = /usr/lib + } + + INSTALLS += headers target other_files +} diff --git a/lib/edbee-lib/vendor/qslog/QsLogWindow.cpp b/lib/edbee-lib/vendor/qslog/QsLogWindow.cpp new file mode 100644 index 00000000..c00422b2 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogWindow.cpp @@ -0,0 +1,309 @@ +// Copyright (c) 2015, Axel Gembe <axel@gembe.net> +// All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: + +// * Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this +// list of conditions and the following disclaimer in the documentation and/or +// other materials provided with the distribution. +// * The name of the contributors may not be used to endorse or promote products +// derived from this software without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include "QsLogWindow.h" +#include "QsLogWindowModel.h" +#include "QsLog.h" +#include "QsLogMessage.h" +#include "ui_QsLogWindow.h" + +#include <QIcon> +#include <QSortFilterProxyModel> +#include <QClipboard> +#include <QKeyEvent> +#include <QFileDialog> +#include <QtGlobal> +#include <cstddef> + +static const QIcon &pauseIcon() +{ + static QIcon icon( + QString::fromLatin1(":/QsLogWindow/images/icon-pause-16.png")); + return icon; +} + +static const QIcon &playIcon() +{ + static QIcon icon( + QString::fromLatin1(":/QsLogWindow/images/icon-resume-16.png")); + return icon; +} + +class QsLogging::WindowLogFilterProxyModel : public QSortFilterProxyModel +{ + Q_OBJECT + +public: + WindowLogFilterProxyModel(Level level, QObject *parent = 0) + : QSortFilterProxyModel(parent) + , mLevel(level) + , mLastVisibleRow(0) + { + } + + Level level() const { return mLevel; } + + void setLevel(const Level level) + { + mLevel = level; + invalidateFilter(); + } + + void setPaused(bool paused) + { + mLastVisibleRow = paused ? rowCount() : 0; + if (!paused) + { + invalidateFilter(); + } + } + +protected: + virtual bool filterAcceptsRow(int source_row, + const QModelIndex &source_parent) const + { + Q_UNUSED(source_parent); + if (!mLastVisibleRow) + { + LogWindowModel *model = dynamic_cast<LogWindowModel *>(sourceModel()); + const LogMessage &d = model->at(source_row); + return d.level >= mLevel; + } + + return source_row <= mLastVisibleRow; + } + +private: + Level mLevel; + int mLastVisibleRow; +}; + +QsLogging::Window::Window(QWidget *parent) + : QDialog(parent) + , mUi(nullptr) + , mProxyModel(nullptr) + , mIsPaused(false) + , mHasAutoScroll(true) +{ + mUi.reset(new Ui::LogWindow()); + mUi->setupUi(this); + + connect(mUi->toolButtonPause, SIGNAL(clicked()), SLOT(OnPauseClicked())); + connect(mUi->toolButtonSave, SIGNAL(clicked()), SLOT(OnSaveClicked())); + connect(mUi->toolButtonClear, SIGNAL(clicked()), SLOT(OnClearClicked())); + connect(mUi->toolButtonCopy, SIGNAL(clicked()), SLOT(OnCopyClicked())); + connect(mUi->comboBoxLevel, SIGNAL(currentIndexChanged(int)), + SLOT(OnLevelChanged(int))); + connect(mUi->checkBoxAutoScroll, SIGNAL(toggled(bool)), + SLOT(OnAutoScrollChanged(bool))); + connect(&mModel, SIGNAL(rowsInserted(const QModelIndex &, int, int)), + SLOT(ModelRowsInserted(const QModelIndex &, int, int))); + + // Install the sort / filter model + mProxyModel.reset(new WindowLogFilterProxyModel(InfoLevel, this)); + mProxyModel->setSourceModel(&mModel); + mUi->tableViewMessages->setModel(mProxyModel.get()); + + mUi->tableViewMessages->installEventFilter(this); + + mUi->tableViewMessages->setSelectionBehavior(QAbstractItemView::SelectRows); +#if QT_VERSION >= 0x050000 + mUi->tableViewMessages->horizontalHeader()->setSectionResizeMode( + LogWindowModel::TimeColumn, QHeaderView::ResizeToContents); + mUi->tableViewMessages->horizontalHeader()->setSectionResizeMode( + LogWindowModel::LevelNameColumn, QHeaderView::ResizeToContents); + mUi->tableViewMessages->horizontalHeader()->setSectionResizeMode( + LogWindowModel::MessageColumn, QHeaderView::Stretch); + mUi->tableViewMessages->verticalHeader()->setSectionResizeMode( + QHeaderView::ResizeToContents); +#else + mUi->tableViewMessages->horizontalHeader()->setResizeMode( + LogWindowModel::TimeColumn, QHeaderView::ResizeToContents); + mUi->tableViewMessages->horizontalHeader()->setResizeMode( + LogWindowModel::LevelNameColumn, QHeaderView::ResizeToContents); + mUi->tableViewMessages->horizontalHeader()->setResizeMode( + LogWindowModel::MessageColumn, QHeaderView::Stretch); + mUi->tableViewMessages->verticalHeader()->setResizeMode( + QHeaderView::ResizeToContents); +#endif + + // Initialize log level selection + for (int l = TraceLevel; l < OffLevel; l++) + { + const QString ln = LocalizedLevelName(static_cast<Level>(l)); + mUi->comboBoxLevel->addItem(ln, l); + } + mUi->comboBoxLevel->setCurrentIndex(InfoLevel); +} + +QsLogging::Window::~Window() noexcept = default; + +bool QsLogging::Window::eventFilter(QObject *obj, QEvent *event) +{ + if (obj == mUi->tableViewMessages) + { + if (event->type() == QEvent::KeyPress) + { + QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event); + if (keyEvent->key() == Qt::Key_C + && (keyEvent->modifiers() & Qt::ControlModifier)) + { + copySelection(); + return true; + } + } + + return false; + } + else + { + return QDialog::eventFilter(obj, event); + } +} + +void QsLogging::Window::addLogMessage(const QsLogging::LogMessage &m) +{ + mModel.addEntry(m); +} + +void QsLogging::Window::OnPauseClicked() +{ + mUi->toolButtonPause->setIcon(mIsPaused ? pauseIcon() : playIcon()); + mUi->toolButtonPause->setText(mIsPaused ? tr("&Pause") : tr("&Resume")); + + mIsPaused = !mIsPaused; + + mProxyModel->setPaused(mIsPaused); +} + +void QsLogging::Window::OnSaveClicked() +{ + saveSelection(); +} + +void QsLogging::Window::OnClearClicked() +{ + mModel.clear(); +} + +void QsLogging::Window::OnCopyClicked() +{ + copySelection(); +} + +void QsLogging::Window::OnLevelChanged(int value) +{ + mProxyModel->setLevel(static_cast<Level>(value)); +} + +void QsLogging::Window::OnAutoScrollChanged(bool checked) +{ + mHasAutoScroll = checked; +} + +void QsLogging::Window::ModelRowsInserted(const QModelIndex &parent, int start, + int last) +{ + Q_UNUSED(parent); + Q_UNUSED(start); + Q_UNUSED(last); + if (mHasAutoScroll && !mIsPaused) + { + mUi->tableViewMessages->scrollToBottom(); + } +} + +void QsLogging::Window::copySelection() const +{ + const QString text = getSelectionText(); + if (text.isEmpty()) + { + return; + } + + QApplication::clipboard()->setText(text); +} + +void QsLogging::Window::saveSelection() +{ + const QString text = getSelectionText(); + if (text.isEmpty()) + { + return; + } + + QFileDialog dialog(this); + dialog.setWindowTitle(tr("Save log")); + dialog.setNameFilter(tr("Log file (*.log)")); + dialog.setAcceptMode(QFileDialog::AcceptSave); + dialog.setDefaultSuffix("log"); + dialog.exec(); + + const QStringList sel = dialog.selectedFiles(); + if (sel.size() < 1) + { + return; + } + + QFile file(sel.at(0)); + if (file.open(QIODevice::WriteOnly)) + { + QTextStream stream(&file); + stream << text; + file.close(); + } +} + +QString QsLogging::Window::getSelectionText() const +{ + QModelIndexList rows + = mUi->tableViewMessages->selectionModel()->selectedRows(); + std::sort(rows.begin(), rows.end()); + + QString text; + + if (rows.count() == 0) + { + for (int i = 0; i < mProxyModel->rowCount(); i++) + { + const int srow = mProxyModel->mapToSource(mProxyModel->index(i, 0)).row(); + text += mModel.at(srow).formatted + "\n"; + } + } + else + { + for (QModelIndexList::const_iterator i = rows.begin(); i != rows.end(); ++i) + { + const int srow = mProxyModel->mapToSource(*i).row(); + text += mModel.at(srow).formatted + "\n"; + } + } + + return text; +} + +#include "QsLogWindow.moc" diff --git a/lib/edbee-lib/vendor/qslog/QsLogWindow.h b/lib/edbee-lib/vendor/qslog/QsLogWindow.h new file mode 100644 index 00000000..f97d3afb --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogWindow.h @@ -0,0 +1,82 @@ +// Copyright (c) 2015, Axel Gembe <axel@gembe.net> +// All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: + +// * Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this +// list of conditions and the following disclaimer in the documentation and/or +// other materials provided with the distribution. +// * The name of the contributors may not be used to endorse or promote products +// derived from this software without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef QSLOGWINDOW_H +#define QSLOGWINDOW_H + +#include "QsLogWindowModel.h" +#include <QDialog> +#include <memory> +class QModelIndex; + +namespace Ui +{ +class LogWindow; +class LogMessage; +} // namespace Ui + +namespace QsLogging +{ + +class WindowLogFilterProxyModel; + +class QSLOG_SHARED_OBJECT Window : public QDialog +{ + Q_OBJECT + +public: + explicit Window(QWidget *parent = nullptr); + virtual ~Window() noexcept; + + virtual bool eventFilter(QObject *obj, QEvent *event); + +private slots: + void addLogMessage(const QsLogging::LogMessage &m); + + void OnPauseClicked(); + void OnSaveClicked(); + void OnClearClicked(); + void OnCopyClicked(); + void OnLevelChanged(int value); + void OnAutoScrollChanged(bool checked); + void ModelRowsInserted(const QModelIndex &parent, int start, int last); + +private: + void copySelection() const; + void saveSelection(); + QString getSelectionText() const; + + LogWindowModel mModel; + std::unique_ptr<Ui::LogWindow> mUi; + std::unique_ptr<WindowLogFilterProxyModel> mProxyModel; + bool mIsPaused; + bool mHasAutoScroll; +}; + +} // namespace QsLogging + +#endif // QSLOGWINDOW_H diff --git a/lib/edbee-lib/vendor/qslog/QsLogWindow.qrc b/lib/edbee-lib/vendor/qslog/QsLogWindow.qrc new file mode 100644 index 00000000..11b0b33c --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogWindow.qrc @@ -0,0 +1,9 @@ +<RCC> + <qresource prefix="/QsLogWindow"> + <file>images/icon-clear-16.png</file> + <file>images/icon-save-16.png</file> + <file>images/icon-copy-16.png</file> + <file>images/icon-pause-16.png</file> + <file>images/icon-resume-16.png</file> + </qresource> +</RCC> diff --git a/lib/edbee-lib/vendor/qslog/QsLogWindow.ui b/lib/edbee-lib/vendor/qslog/QsLogWindow.ui new file mode 100644 index 00000000..35b021ff --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogWindow.ui @@ -0,0 +1,173 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>LogWindow</class> + <widget class="QDialog" name="LogWindow"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>599</width> + <height>539</height> + </rect> + </property> + <property name="windowTitle"> + <string>Log window</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QToolButton" name="toolButtonPause"> + <property name="text"> + <string>&Pause</string> + </property> + <property name="icon"> + <iconset resource="QsLogWindow.qrc"> + <normaloff>:/QsLogWindow/images/icon-pause-16.png</normaloff>:/QsLogWindow/images/icon-pause-16.png</iconset> + </property> + <property name="toolButtonStyle"> + <enum>Qt::ToolButtonTextBesideIcon</enum> + </property> + <property name="autoRaise"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="toolButtonSave"> + <property name="text"> + <string>&Save</string> + </property> + <property name="icon"> + <iconset resource="QsLogWindow.qrc"> + <normaloff>:/QsLogWindow/images/icon-save-16.png</normaloff>:/QsLogWindow/images/icon-save-16.png</iconset> + </property> + <property name="toolButtonStyle"> + <enum>Qt::ToolButtonTextBesideIcon</enum> + </property> + <property name="autoRaise"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="toolButtonClear"> + <property name="text"> + <string>C&lear</string> + </property> + <property name="icon"> + <iconset resource="QsLogWindow.qrc"> + <normaloff>:/QsLogWindow/images/icon-clear-16.png</normaloff>:/QsLogWindow/images/icon-clear-16.png</iconset> + </property> + <property name="toolButtonStyle"> + <enum>Qt::ToolButtonTextBesideIcon</enum> + </property> + <property name="autoRaise"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="toolButtonCopy"> + <property name="text"> + <string>&Copy</string> + </property> + <property name="icon"> + <iconset resource="QsLogWindow.qrc"> + <normaloff>:/QsLogWindow/images/icon-copy-16.png</normaloff>:/QsLogWindow/images/icon-copy-16.png</iconset> + </property> + <property name="toolButtonStyle"> + <enum>Qt::ToolButtonTextBesideIcon</enum> + </property> + <property name="autoRaise"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Level:</string> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="comboBoxLevel"/> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <widget class="QTableView" name="tableViewMessages"> + <property name="autoScroll"> + <bool>false</bool> + </property> + <property name="alternatingRowColors"> + <bool>true</bool> + </property> + <property name="showGrid"> + <bool>false</bool> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + <attribute name="verticalHeaderVisible"> + <bool>false</bool> + </attribute> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <widget class="QCheckBox" name="checkBoxAutoScroll"> + <property name="text"> + <string>&Auto scroll</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </widget> + <tabstops> + <tabstop>toolButtonPause</tabstop> + <tabstop>toolButtonSave</tabstop> + <tabstop>toolButtonClear</tabstop> + <tabstop>toolButtonCopy</tabstop> + <tabstop>comboBoxLevel</tabstop> + <tabstop>tableViewMessages</tabstop> + <tabstop>checkBoxAutoScroll</tabstop> + </tabstops> + <resources> + <include location="QsLogWindow.qrc"/> + </resources> + <connections/> +</ui> diff --git a/lib/edbee-lib/vendor/qslog/QsLogWindowModel.cpp b/lib/edbee-lib/vendor/qslog/QsLogWindowModel.cpp new file mode 100644 index 00000000..42415032 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogWindowModel.cpp @@ -0,0 +1,165 @@ +// Copyright (c) 2015, Axel Gembe <axel@gembe.net> +// All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: + +// * Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this +// list of conditions and the following disclaimer in the documentation and/or +// other materials provided with the distribution. +// * The name of the contributors may not be used to endorse or promote products +// derived from this software without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include "QsLogWindowModel.h" +#include "QsLog.h" + +#include <QColor> + +QsLogging::LogWindowModel::LogWindowModel(size_t max_items) + : mMaxItems(max_items) +{ +} + +QsLogging::LogWindowModel::~LogWindowModel() noexcept = default; + +void QsLogging::LogWindowModel::addEntry(const LogMessage &message) +{ + const int next_idx = static_cast<int>(mLogMessages.size()); + beginInsertRows(QModelIndex(), next_idx, next_idx); + { + QWriteLocker lock(&mMessagesLock); + mLogMessages.push_back(message); + } + endInsertRows(); + + if (mMaxItems < std::numeric_limits<size_t>::max() + && mLogMessages.size() > mMaxItems) + { + { + QWriteLocker lock(&mMessagesLock); + mLogMessages.pop_front(); + } + // Every item changed + const QModelIndex idx1 = index(0, 0); + const QModelIndex idx2 + = index(static_cast<int>(mLogMessages.size()), rowCount()); + emit dataChanged(idx1, idx2); + } +} + +void QsLogging::LogWindowModel::clear() +{ + beginResetModel(); + { + QWriteLocker lock(&mMessagesLock); + mLogMessages.clear(); + } + endResetModel(); +} + +QsLogging::LogMessage QsLogging::LogWindowModel::at(size_t index) const +{ + return mLogMessages[index]; +} + +int QsLogging::LogWindowModel::columnCount(const QModelIndex &parent) const +{ + Q_UNUSED(parent); + return 3; +} + +int QsLogging::LogWindowModel::rowCount(const QModelIndex &parent) const +{ + Q_UNUSED(parent); + QReadLocker lock(&mMessagesLock); + + return static_cast<int>(mLogMessages.size()); +} + +QVariant QsLogging::LogWindowModel::data(const QModelIndex &index, + int role) const +{ + if (!index.isValid()) + return QVariant(); + + if (role == Qt::DisplayRole) + { + QReadLocker lock(&mMessagesLock); + + const LogMessage &item = mLogMessages.at(index.row()); + + switch (index.column()) + { + case TimeColumn: + return item.time.toLocalTime().toString(); + case LevelNameColumn: + return LocalizedLevelName(item.level); + case MessageColumn: + return item.message; + case FormattedMessageColumn: + return item.formatted; + default: + return QVariant(); + } + + return QString(); + } + + if (role == Qt::BackgroundColorRole) + { + QReadLocker lock(&mMessagesLock); + + const LogMessage &item = mLogMessages.at(index.row()); + + switch (item.level) + { + case QsLogging::WarnLevel: + return QVariant(QColor(255, 255, 128)); + case QsLogging::ErrorLevel: + return QVariant(QColor(255, 128, 128)); + case QsLogging::FatalLevel: + return QVariant(QColor(255, 0, 0)); + default: + break; + } + } + + return QVariant(); +} + +QVariant QsLogging::LogWindowModel::headerData(int section, + Qt::Orientation orientation, + int role) const +{ + if (role == Qt::DisplayRole && orientation == Qt::Horizontal) + { + switch (section) + { + case TimeColumn: + return tr("Time"); + case LevelNameColumn: + return tr("Level"); + case MessageColumn: + return tr("Message"); + default: + break; + } + } + + return QVariant(); +} diff --git a/lib/edbee-lib/vendor/qslog/QsLogWindowModel.h b/lib/edbee-lib/vendor/qslog/QsLogWindowModel.h new file mode 100644 index 00000000..0a605764 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/QsLogWindowModel.h @@ -0,0 +1,77 @@ +// Copyright (c) 2015, Axel Gembe <axel@gembe.net> +// All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: + +// * Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this +// list of conditions and the following disclaimer in the documentation and/or +// other materials provided with the distribution. +// * The name of the contributors may not be used to endorse or promote products +// derived from this software without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef QSLOGWINDOWMODEL_H +#define QSLOGWINDOWMODEL_H + +#include "QsLogSharedLibrary.h" +#include "QsLogMessage.h" +#include <QAbstractTableModel> +#include <QReadWriteLock> + +#include <limits> +#include <deque> + +namespace QsLogging +{ +class QSLOG_SHARED_OBJECT LogWindowModel : public QAbstractTableModel +{ + Q_OBJECT +public: + enum Column + { + TimeColumn = 0, + LevelNameColumn = 1, + MessageColumn = 2, + FormattedMessageColumn = 100 + }; + + explicit LogWindowModel(size_t max_items + = std::numeric_limits<size_t>::max()); + virtual ~LogWindowModel() noexcept; + + void addEntry(const LogMessage &message); + void clear(); + LogMessage at(size_t index) const; + + // QAbstractTableModel overrides + int columnCount(const QModelIndex &parent = QModelIndex()) const override; + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + QVariant data(const QModelIndex &index, + int role = Qt::DisplayRole) const override; + QVariant headerData(int section, Qt::Orientation orientation, + int role = Qt::DisplayRole) const override; + +private: + std::deque<LogMessage> mLogMessages; + mutable QReadWriteLock mMessagesLock; + size_t mMaxItems; +}; + +} // namespace QsLogging + +#endif // QSLOGWINDOWMODEL_H diff --git a/lib/edbee-lib/vendor/qslog/README.md b/lib/edbee-lib/vendor/qslog/README.md new file mode 100644 index 00000000..63ebd541 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/README.md @@ -0,0 +1,57 @@ +## QsLog - the simple Qt logger ## +QsLog is an easy to use logger that is based on Qt's QDebug class. QsLog is released as open source, under the BSD license. + +###Contribution policy### +Bug fixes are welcome, larger changes however are not encouraged at this point due to the lack of time on my side for reviewing and integrating them. Your best bet in this case would be to open a ticket for your change or forking the project and implementing your change there, with the possibility of having it integrated in the future. +All contributions will be credited, license of the contributions should be 3-clause BSD. + +### Features ### +* Six logging levels (from trace to fatal) +* Logging level threshold configurable at runtime. +* Minimum overhead when logging is turned off. +* Supports multiple destinations, comes with file and debug destinations. +* Thread-safe +* Supports logging of common Qt types out of the box. +* Small dependency: just drop it in your project directly. + +### Usage ### +Directly including the QsLog source code in a project: + +1. Include QsLog.pri in your pro file +2. Include QsLog.h in your C++ files. Include QsLogDest.h only where you create/add destinations. +3. Get the instance of the logger by calling QsLogging::Logger::instance(); +4. Optionally set the logging level. Info is default. +5. Create as many destinations as you want by using the QsLogging::DestinationFactory. +6. Add the destinations to the logger instance by calling addDestination. +7. Start logging! + +Linking to QsLog dynamically: + +1. Build QsLog using the QsLogSharedLibrary.pro. +2. Add the QsLog shared library to your LIBS project dependencies. +3. Follow the steps in "directly including QsLog in your project" starting with step 2. + +Note: when you want to use QsLog both from an executable and a shared library you have to + link QsLog dynamically due to a limitation with static variables. + +### Configuration ### +QsLog has several configurable parameters in its .pri file: + +* defining QS_LOG_LINE_NUMBERS in the .pri file enables writing the file and line number + automatically for each logging call +* defining QS_LOG_SEPARATE_THREAD will route all log messages to a separate thread. +* defining QS_LOG_WIN_PRINTF_CONSOLE will use fprintf instead of OutputDebugString on Windows + +Sometimes it's necessary to turn off logging. This can be done in several ways: + +* globally, at compile time, by enabling the QS_LOG_DISABLE macro in the supplied .pri file. +* globally, at run time, by setting the log level to "OffLevel". +* per file, at compile time, by including QsLogDisableForThisFile.h in the target file. + +### Thread safety ### +The Qt docs say: +A **thread-safe** function can be called simultaneously from multiple threads, even when the invocations use shared data, because all references to the shared data are serialized. +A **reentrant** function can also be called simultaneously from multiple threads, but only if each invocation uses its own data. + +Since sending the log message to the destinations is protected by a mutex, the logging macros are thread-safe provided that the log has been initialized - i.e: instance() has been called. Adding and removing destinations and the instance function are likewise thread-safe. +The setup functions (e.g: setLoggingLevel) are NOT thread-safe and are NOT reentrant, they must be called at program startup. \ No newline at end of file diff --git a/lib/edbee-lib/vendor/qslog/cmake/FindPkgMacros.cmake b/lib/edbee-lib/vendor/qslog/cmake/FindPkgMacros.cmake new file mode 100644 index 00000000..53111e07 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/cmake/FindPkgMacros.cmake @@ -0,0 +1,165 @@ +#------------------------------------------------------------------- +# This file is part of the CMake build system for OGRE +# (Object-oriented Graphics Rendering Engine) +# For the latest info, see http://www.ogre3d.org/ +# +# The contents of this file are placed in the public domain. Feel +# free to make use of it in any way you like. +#------------------------------------------------------------------- + +################################################################## +# Provides some common functionality for the FindPackage modules +################################################################## + +# Begin processing of package +macro(findpkg_begin PREFIX) + if (NOT ${PREFIX}_FIND_QUIETLY) + message(STATUS "Looking for ${PREFIX}...") + endif () +endmacro(findpkg_begin) + +# Display a status message unless FIND_QUIETLY is set +macro(pkg_message PREFIX) + if (NOT ${PREFIX}_FIND_QUIETLY) + message(STATUS ${ARGN}) + endif () +endmacro(pkg_message) + +# Get environment variable, define it as ENV_$var and make sure backslashes are converted to forward slashes +macro(getenv_path VAR) + set(ENV_${VAR} $ENV{${VAR}}) + # replace won't work if var is blank + if (ENV_${VAR}) + string( REGEX REPLACE "\\\\" "/" ENV_${VAR} ${ENV_${VAR}} ) + endif () +endmacro(getenv_path) + +# Construct search paths for includes and libraries from a PREFIX_PATH +macro(create_search_paths PREFIX) + foreach(dir ${${PREFIX}_PREFIX_PATH}) + set(${PREFIX}_INC_SEARCH_PATH ${${PREFIX}_INC_SEARCH_PATH} + ${dir}/include ${dir}/Include ${dir}/include/${PREFIX} ${dir}/Headers) + set(${PREFIX}_LIB_SEARCH_PATH ${${PREFIX}_LIB_SEARCH_PATH} + ${dir}/lib ${dir}/Lib ${dir}/lib/${PREFIX} ${dir}/Libs) + set(${PREFIX}_BIN_SEARCH_PATH ${${PREFIX}_BIN_SEARCH_PATH} + ${dir}/bin) + endforeach(dir) + if(ANDROID) + set(${PREFIX}_LIB_SEARCH_PATH ${${PREFIX}_LIB_SEARCH_PATH} ${OGRE_DEPENDENCIES_DIR}/lib/${ANDROID_ABI}) + endif() + set(${PREFIX}_FRAMEWORK_SEARCH_PATH ${${PREFIX}_PREFIX_PATH}) +endmacro(create_search_paths) + +# clear cache variables if a certain variable changed +macro(clear_if_changed TESTVAR) + # test against internal check variable + # HACK: Apparently, adding a variable to the cache cleans up the list + # a bit. We need to also remove any empty strings from the list, but + # at the same time ensure that we are actually dealing with a list. + list(APPEND ${TESTVAR} "") + list(REMOVE_ITEM ${TESTVAR} "") + if (NOT "${${TESTVAR}}" STREQUAL "${${TESTVAR}_INT_CHECK}") + message(STATUS "${TESTVAR} changed.") + foreach(var ${ARGN}) + set(${var} "NOTFOUND" CACHE STRING "x" FORCE) + endforeach(var) + endif () + set(${TESTVAR}_INT_CHECK ${${TESTVAR}} CACHE INTERNAL "x" FORCE) +endmacro(clear_if_changed) + +# Try to get some hints from pkg-config, if available +macro(use_pkgconfig PREFIX PKGNAME) + if(NOT ANDROID) + find_package(PkgConfig) + if (PKG_CONFIG_FOUND) + pkg_check_modules(${PREFIX} ${PKGNAME}) + endif () + endif() +endmacro (use_pkgconfig) + +# Couple a set of release AND debug libraries (or frameworks) +macro(make_library_set PREFIX) + if (${PREFIX}_FWK) + set(${PREFIX} ${${PREFIX}_FWK}) + elseif (${PREFIX}_REL AND ${PREFIX}_DBG) + set(${PREFIX} optimized ${${PREFIX}_REL} debug ${${PREFIX}_DBG}) + elseif (${PREFIX}_REL) + set(${PREFIX} ${${PREFIX}_REL}) + elseif (${PREFIX}_DBG) + set(${PREFIX} ${${PREFIX}_DBG}) + endif () +endmacro(make_library_set) + +# Generate debug names from given release names +macro(get_debug_names PREFIX) + foreach(i ${${PREFIX}}) + set(${PREFIX}_DBG ${${PREFIX}_DBG} ${i}d ${i}D ${i}_d ${i}_D ${i}_debug ${i}) + endforeach(i) +endmacro(get_debug_names) + +# Add the parent dir from DIR to VAR +macro(add_parent_dir VAR DIR) + get_filename_component(${DIR}_TEMP "${${DIR}}/.." ABSOLUTE) + set(${VAR} ${${VAR}} ${${DIR}_TEMP}) +endmacro(add_parent_dir) + +# Do the final processing for the package find. +macro(findpkg_finish PREFIX) + # skip if already processed during this run + if (NOT ${PREFIX}_FOUND) + if (${PREFIX}_INCLUDE_DIR AND ${PREFIX}_LIBRARY) + set(${PREFIX}_FOUND TRUE) + set(${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIR}) + set(${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARY}) + if (NOT ${PREFIX}_FIND_QUIETLY) + message(STATUS "Found ${PREFIX}: ${${PREFIX}_LIBRARIES}") + endif () + else () + if (NOT ${PREFIX}_FIND_QUIETLY) + message(STATUS "Could not locate ${PREFIX}") + endif () + if (${PREFIX}_FIND_REQUIRED) + message(FATAL_ERROR "Required library ${PREFIX} not found! Install the library (including dev packages) and try again. If the library is already installed, set the missing variables manually in cmake.") + endif () + endif () + + mark_as_advanced(${PREFIX}_INCLUDE_DIR ${PREFIX}_LIBRARY ${PREFIX}_LIBRARY_REL ${PREFIX}_LIBRARY_DBG ${PREFIX}_LIBRARY_FWK) + endif () +endmacro(findpkg_finish) + + +# Slightly customised framework finder +macro(findpkg_framework fwk) + if(APPLE) + set(${fwk}_FRAMEWORK_PATH + ${${fwk}_FRAMEWORK_SEARCH_PATH} + ${CMAKE_FRAMEWORK_PATH} + ~/Library/Frameworks + /Library/Frameworks + /System/Library/Frameworks + /Network/Library/Frameworks + ${CMAKE_CURRENT_SOURCE_DIR}/lib/macosx/Release + ${CMAKE_CURRENT_SOURCE_DIR}/lib/macosx/Debug + ) + # These could be arrays of paths, add each individually to the search paths + foreach(i ${OGRE_PREFIX_PATH}) + set(${fwk}_FRAMEWORK_PATH ${${fwk}_FRAMEWORK_PATH} ${i}/lib/macosx/Release ${i}/lib/macosx/Debug) + endforeach(i) + + foreach(i ${OGRE_PREFIX_BUILD}) + set(${fwk}_FRAMEWORK_PATH ${${fwk}_FRAMEWORK_PATH} ${i}/lib/macosx/Release ${i}/lib/macosx/Debug) + endforeach(i) + + foreach(dir ${${fwk}_FRAMEWORK_PATH}) + set(fwkpath ${dir}/${fwk}.framework) + if(EXISTS ${fwkpath}) + set(${fwk}_FRAMEWORK_INCLUDES ${${fwk}_FRAMEWORK_INCLUDES} + ${fwkpath}/Headers ${fwkpath}/PrivateHeaders) + set(${fwk}_FRAMEWORK_PATH ${dir}) + if (NOT ${fwk}_LIBRARY_FWK) + set(${fwk}_LIBRARY_FWK "-framework ${fwk}") + endif () + endif(EXISTS ${fwkpath}) + endforeach(dir) + endif(APPLE) +endmacro(findpkg_framework) diff --git a/lib/edbee-lib/vendor/qslog/cmake/FindQsLog.cmake b/lib/edbee-lib/vendor/qslog/cmake/FindQsLog.cmake new file mode 100644 index 00000000..6e991980 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/cmake/FindQsLog.cmake @@ -0,0 +1,50 @@ +#------------------------------------------------------------------- +# CMake build support courtesy of A.Gembe +# The contents of this file are placed in the public domain. Feel +# free to make use of it in any way you like. +#------------------------------------------------------------------- + +# - Try to find QsLog +# Once done, this will define +# +# QsLog_FOUND - system has QsLog +# QsLog_INCLUDE_DIRS - the QsLog include directories +# QsLog_LIBRARIES - link these to use QsLog +# QsLog_BINARY_REL +# QsLog_BINARY_DBG + +include(FindPkgMacros) +findpkg_begin(QsLog) + +# Get path, convert backslashes as ${ENV_${var}} +getenv_path(QsLog_HOME) + +# construct search paths +set(QsLog_PREFIX_PATH ${QsLog_HOME} ${ENV_QsLog_HOME}) + +create_search_paths(QsLog) + +# redo search if prefix path changed +clear_if_changed( + QsLog_PREFIX_PATH + QsLog_LIBRARY_REL + QsLog_LIBRARY_DBG + QsLog_BINARY_REL + QsLog_BINARY_DBG + QsLog_INCLUDE_DIR +) + +set(QsLog_LIBRARY_NAMES QsLog) +get_debug_names(QsLog_LIBRARY_NAMES) + +use_pkgconfig(QsLog_PKGC QsLog) + +find_path(QsLog_INCLUDE_DIR NAMES QsLog.h HINTS ${QsLog_INC_SEARCH_PATH} ${QsLog_PKGC_INCLUDE_DIRS} PATH_SUFFIXES QsLog) +find_library(QsLog_LIBRARY_REL NAMES ${QsLog_LIBRARY_NAMES} HINTS ${QsLog_LIB_SEARCH_PATH} ${QsLog_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" release relwithdebinfo minsizerel) +find_library(QsLog_LIBRARY_DBG NAMES ${QsLog_LIBRARY_NAMES_DBG} HINTS ${QsLog_LIB_SEARCH_PATH} ${QsLog_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" debug) +find_file(QsLog_BINARY_REL NAMES QsLog.dll HINTS ${QsLog_PREFIX_PATH}/bin PATH_SUFFIXES "" release relwithdebinfo minsizerel) +find_file(QsLog_BINARY_DBG NAMES QsLog_d.dll HINTS ${QsLog_PREFIX_PATH}/bin PATH_SUFFIXES "" debug) +make_library_set(QsLog_LIBRARY) + +findpkg_finish(QsLog) +add_parent_dir(QsLog_INCLUDE_DIRS QsLog_INCLUDE_DIR) diff --git a/lib/edbee-lib/vendor/qslog/cmake/QsLogConfigTargets.cmake b/lib/edbee-lib/vendor/qslog/cmake/QsLogConfigTargets.cmake new file mode 100644 index 00000000..590207f6 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/cmake/QsLogConfigTargets.cmake @@ -0,0 +1,52 @@ +# CMake build support courtesy of A.Gembe + +if (WIN32) + set(QSLOG_RELEASE_PATH "/Release") + set(QSLOG_RELWDBG_PATH "/RelWithDebInfo") + set(QSLOG_MINSIZE_PATH "/MinSizeRel") + set(QSLOG_DEBUG_PATH "/Debug") + set(QSLOG_LIB_RELEASE_PATH "/Release") + set(QSLOG_LIB_RELWDBG_PATH "/RelWithDebInfo") + set(QSLOG_LIB_MINSIZE_PATH "/MinSizeRel") + set(QSLOG_LIB_DEBUG_PATH "/Debug") +elseif (UNIX) + set(QSLOG_RELEASE_PATH "") + set(QSLOG_RELWDBG_PATH "") + set(QSLOG_MINSIZE_PATH "") + set(QSLOG_DEBUG_PATH "/debug") + set(QSLOG_LIB_RELEASE_PATH "") + set(QSLOG_LIB_RELWDBG_PATH "") + set(QSLOG_LIB_MINSIZE_PATH "") + set(QSLOG_LIB_DEBUG_PATH "") +endif () +if (APPLE) + set(QSLOG_FRAMEWORK_PATH /Library/Frameworks) +endif () + +# install targets according to current build type +function(QsLog_install_target TARGETNAME SUFFIX) + install(TARGETS ${TARGETNAME} + RUNTIME DESTINATION "bin${QSLOG_RELEASE_PATH}" CONFIGURATIONS Release None "" + LIBRARY DESTINATION "lib${QSLOG_LIB_RELEASE_PATH}${SUFFIX}" CONFIGURATIONS Release None "" + ARCHIVE DESTINATION "lib${QSLOG_LIB_RELEASE_PATH}${SUFFIX}" CONFIGURATIONS Release None "" + FRAMEWORK DESTINATION "${QSLOG_FRAMEWORK_PATH}" CONFIGURATIONS Release None "" + ) + install(TARGETS ${TARGETNAME} + RUNTIME DESTINATION "bin${QSLOG_RELWDBG_PATH}" CONFIGURATIONS RelWithDebInfo + LIBRARY DESTINATION "lib${QSLOG_LIB_RELWDBG_PATH}${SUFFIX}" CONFIGURATIONS RelWithDebInfo + ARCHIVE DESTINATION "lib${QSLOG_LIB_RELWDBG_PATH}${SUFFIX}" CONFIGURATIONS RelWithDebInfo + FRAMEWORK DESTINATION "${QSLOG_FRAMEWORK_PATH}" CONFIGURATIONS RelWithDebInfo + ) + install(TARGETS ${TARGETNAME} + RUNTIME DESTINATION "bin${QSLOG_MINSIZE_PATH}" CONFIGURATIONS MinSizeRel + LIBRARY DESTINATION "lib${QSLOG_LIB_MINSIZE_PATH}${SUFFIX}" CONFIGURATIONS MinSizeRel + ARCHIVE DESTINATION "lib${QSLOG_LIB_MINSIZE_PATH}${SUFFIX}" CONFIGURATIONS MinSizeRel + FRAMEWORK DESTINATION "${QSLOG_FRAMEWORK_PATH}" CONFIGURATIONS MinSizeRel + ) + install(TARGETS ${TARGETNAME} + RUNTIME DESTINATION "bin${QSLOG_DEBUG_PATH}" CONFIGURATIONS Debug + LIBRARY DESTINATION "lib${QSLOG_LIB_DEBUG_PATH}${SUFFIX}" CONFIGURATIONS Debug + ARCHIVE DESTINATION "lib${QSLOG_LIB_DEBUG_PATH}${SUFFIX}" CONFIGURATIONS Debug + FRAMEWORK DESTINATION "${QSLOG_FRAMEWORK_PATH}" CONFIGURATIONS Debug + ) +endfunction(QsLog_install_target) diff --git a/lib/edbee-lib/vendor/qslog/images/icon-clear-16.png b/lib/edbee-lib/vendor/qslog/images/icon-clear-16.png new file mode 100644 index 0000000000000000000000000000000000000000..e4c3a2c85c8cddb7aec7faee5e0013fd5093095c GIT binary patch literal 231 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`>pWc?Lo80Oo$SliY#`9e`*YzA z0r5vmZCyUf#HOjPv+YpNxZlDOw=nnEs{_hLlYh>s%(xsQV!TD}${7aFHvu78=WX*F zDiR+35PdLbw`8)~oLbGQ_qXS~Ud6Dp<1wc$6Q|;qiaHOzt<|ClYo~74VGWwKkaz1w zt`pe?DyGWjm;T;okehuyknxBCkUGd!E9#)OY-6SD)Xqx^;wLwx<ecNx;urZSSnw*? e?yvD*S^az4vvk=*YVHGF&fw|l=d#Wzp$P!z)mh#E literal 0 HcmV?d00001 diff --git a/lib/edbee-lib/vendor/qslog/images/icon-copy-16.png b/lib/edbee-lib/vendor/qslog/images/icon-copy-16.png new file mode 100644 index 0000000000000000000000000000000000000000..abd5b5692535c3aaeb4374153757bee941ee912f GIT binary patch literal 310 zcmV-60m=S}P)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV0002}Nkl<ZILl*T zU|{%93g+SA;bTApAc?a;+)n_X#AiT10|CIu$k<G@0YF6@+}zwe$QWoqCrB-jErBeK zVgOJh7f_)G5c>hSzljVNgaPvM@=QSLE;BQ;3dkTJyBQBYiD3W~Yz5-yOiWA;1cId> zs{ufbZcwqmKv&FVVPTO2irE0M9YF*5`T5y^8u)-3mm>KQ6c+b^_#i<8pi#7vot>Qv zNbg4vFrX`3a2Ws!kY-p^0qHC@HZ~3*Jsa5oAb&kB1OB5aY(`2zb3uU$r1L<AVi<sy zU?k8D07hv5D=RA(zF0s`fqdu&5EG3U20+7vQ06*|&j6w^00Du13eKk!aR2}S07*qo IM6N<$f-RPA&;S4c literal 0 HcmV?d00001 diff --git a/lib/edbee-lib/vendor/qslog/images/icon-pause-16.png b/lib/edbee-lib/vendor/qslog/images/icon-pause-16.png new file mode 100644 index 0000000000000000000000000000000000000000..a4f66c406ad33bfae366a658dc680fc5749bcffb GIT binary patch literal 269 zcmV+o0rLKdP)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV0002gNkl<ZILl*T zKm$xnObS4%5r_{0@k1yEu^XXs*a0gmD+`cn2jZVV{2z#~0`XcXz6uos$+bh(qG)CV zQd^;l)&p(Qz~VBH*m|g%tx!F1FcBod$jDg5Kmb71{D<lR3+Mo;zd*bg$+jS%cpZ>7 zVrFL60I`8M2FV<d+P_e}3{!#lH&C$@k}b=jE=mE42S9Dyjbs5x?Qf`FhMPdVAI+I~ z4S<6EP`%)gol1rQQ=xh(H-KU<P!@>Ph(^j15(rQuDKoIKu@Rk_plY!LQnNDvN=9Sf TUQSQ+00000NkvXXu0mjf_E2V= literal 0 HcmV?d00001 diff --git a/lib/edbee-lib/vendor/qslog/images/icon-resume-16.png b/lib/edbee-lib/vendor/qslog/images/icon-resume-16.png new file mode 100644 index 0000000000000000000000000000000000000000..e966cb51b4671d80f37599536fd971a9135f43ce GIT binary patch literal 316 zcmV-C0mJ@@P)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV00034Nkl<ZILob5 zy9&ZU5WKuD1X5UvSXf&41(tq}SXtVovbIPemeyirEq;Q9h^4iKg_TH%vtbZ&Tr`Rc z!-n0N-P_HbQii#%+ks1f9dIV(J7LalK@j+GQ{WEdzyVkh2gW2fCATEja2t}==+w2G zOk!(tHq^XqCJD!JChCKclT%X!dT<%AG&+vLFw_-wgqu;TQs4nW%OG8VBjN+gIKq8U zt4_ey(&fUV%4kd9_nSt3OKq{)^j!hsibBIUj$P(cYHJsenHSi8!z}P|1YnQ3`&A>n zTjC8}$59lOE>3BQRlgDOx#xN9I=@lu_lqR<kE^V-*0moKxpw>ZIX?k~!Czig%<ljI O0000<MNUMnLSTXb=!;AM literal 0 HcmV?d00001 diff --git a/lib/edbee-lib/vendor/qslog/images/icon-save-16.png b/lib/edbee-lib/vendor/qslog/images/icon-save-16.png new file mode 100644 index 0000000000000000000000000000000000000000..e601edd84e8823ef9d4713b4595991d9ba166c94 GIT binary patch literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jh-%!Ar_~T6H-!a&Kx-KVZO_p z;|(kmcq@31MC~xRu*o2&O+os@97b-2tUWwO(r3<?(Q_eYlIs*khXUaa{ba)j23L72 zP98g^*4k%jVR6M_#>|;Fn<p?XNqQw!ARuvR?vaEEQ8{cOh64Pn+;|V<9jHm**e%%X lnDvlt!pyk`C6<UYtm2(uapR@P0ia_TJYD@<);T3K0RZ^(M412p literal 0 HcmV?d00001 diff --git a/lib/edbee-lib/vendor/qslog/source.txt b/lib/edbee-lib/vendor/qslog/source.txt new file mode 100644 index 00000000..5f4d770c --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/source.txt @@ -0,0 +1 @@ +Commit: https://bitbucket.org/codeimproved/qslog/commits/46b643d5bcbc diff --git a/lib/edbee-lib/vendor/qslog/unittest/CMakeLists.txt b/lib/edbee-lib/vendor/qslog/unittest/CMakeLists.txt new file mode 100644 index 00000000..fa5ebc32 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/unittest/CMakeLists.txt @@ -0,0 +1,37 @@ +set(PROJECTNAME QsLogUnitTest) +project(${PROJECTNAME}) + +if(BUILD_WITH_QT5) + find_package(Qt5 REQUIRED COMPONENTS Test) + set(QT_LIBRARIES Qt5::Core Qt5::Test) +else() + find_package(Qt6 REQUIRED COMPONENTS Test) + set(QT_LIBRARIES Qt6::Core Qt6::Test) +endif() + +include_directories(${QsLogUnitTest_SOURCE_DIR} ${QsLog_SOURCE_DIR}) + +if(QS_LOG_IS_SHARED_LIBRARY) + # Ugh, ugly hack + add_definitions(-UQSLOG_IS_SHARED_LIBRARY) + add_definitions(-DQSLOG_IS_SHARED_LIBRARY_IMPORT) +endif() + +set(HEADER_FILES + TestLog.h + QtTestUtil/QtTestUtil.h + QtTestUtil/TestRegistration.h + QtTestUtil/TestRegistry.h + ) + +set(SOURCE_FILES + TestLog.cpp + QtTestUtil/SimpleChecker.cpp + QtTestUtil/TestRegistry.cpp + ) + +add_executable(${PROJECTNAME} ${SOURCE_FILES} ${HEADER_FILES}) + +set_target_properties(${PROJECTNAME} PROPERTIES AUTOMOC ON) + +target_link_libraries(${PROJECTNAME} QsLog ${QT_LIBRARIES}) diff --git a/lib/edbee-lib/vendor/qslog/unittest/QtTestUtil/QtTestUtil.h b/lib/edbee-lib/vendor/qslog/unittest/QtTestUtil/QtTestUtil.h new file mode 100644 index 00000000..9d311fe3 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/unittest/QtTestUtil/QtTestUtil.h @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2008 Remko Troncon + * Licensed under the MIT license. + * See COPYING for license details. + */ + +#ifndef QtTestUtil_H +#define QtTestUtil_H + +#include <QObject> +#include <QtTest/QtTest> +#include "QtTestUtil/TestRegistration.h" + +/** + * A macro to register a test class. + * + * This macro will create a static variable which registers the + * testclass with the TestRegistry, and creates an instance of the + * test class. + * + * Execute this macro in the body of your unit test's .cpp file, e.g. + * class MyTest { + * ... + * }; + * + * QTTESTUTIL_REGISTER_TEST(MyTest) + */ +#define QTTESTUTIL_REGISTER_TEST(TestClass) \ + static QtTestUtil::TestRegistration<TestClass> TestClass##Registration + +#endif diff --git a/lib/edbee-lib/vendor/qslog/unittest/QtTestUtil/SimpleChecker.cpp b/lib/edbee-lib/vendor/qslog/unittest/QtTestUtil/SimpleChecker.cpp new file mode 100644 index 00000000..dd714efc --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/unittest/QtTestUtil/SimpleChecker.cpp @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2008 Remko Troncon + * Licensed under the MIT license. + * See COPYING for license details. + */ + +#include <QCoreApplication> + +#include "QtTestUtil/TestRegistry.h" + +/** + * Runs all tests registered with the QtTestUtil registry. + */ +int main(int argc, char *argv[]) +{ + QCoreApplication application(argc, argv); + return QtTestUtil::TestRegistry::getInstance()->runTests(argc, argv); +} diff --git a/lib/edbee-lib/vendor/qslog/unittest/QtTestUtil/TestRegistration.h b/lib/edbee-lib/vendor/qslog/unittest/QtTestUtil/TestRegistration.h new file mode 100644 index 00000000..1110ef37 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/unittest/QtTestUtil/TestRegistration.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2008 Remko Troncon + * Licensed under the MIT license. + * See COPYING for license details. + */ + +#ifndef QtTestUtil_TestRegistration_H +#define QtTestUtil_TestRegistration_H + +#include "QtTestUtil/TestRegistry.h" + +namespace QtTestUtil +{ + +/** + * A wrapper class around a test to manage registration and static + * creation of an instance of the test class. + * This class is used by QTTESTUTIL_REGISTER_TEST(), and you should not + * use this class directly. + */ +template<typename TestClass> +class TestRegistration +{ +public: + TestRegistration() + { + test_ = new TestClass(); + TestRegistry::getInstance()->registerTest(test_); + } + + ~TestRegistration() { delete test_; } + +private: + TestClass *test_; +}; + +} // namespace QtTestUtil + +#endif diff --git a/lib/edbee-lib/vendor/qslog/unittest/QtTestUtil/TestRegistry.cpp b/lib/edbee-lib/vendor/qslog/unittest/QtTestUtil/TestRegistry.cpp new file mode 100644 index 00000000..422ef750 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/unittest/QtTestUtil/TestRegistry.cpp @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2008 Remko Troncon + * Licensed under the MIT license. + * See COPYING for license details. + */ + +#include "QtTestUtil/TestRegistry.h" + +#include <QtTest/QtTest> + +namespace QtTestUtil +{ + +TestRegistry *TestRegistry::getInstance() +{ + static TestRegistry registry; + return ®istry; +} + +void TestRegistry::registerTest(QObject *test) +{ + tests_ += test; +} + +int TestRegistry::runTests(int argc, char *argv[]) +{ + int result = 0; + foreach (QObject *test, tests_) + { + result |= QTest::qExec(test, argc, argv); + } + return result; +} + +} // namespace QtTestUtil diff --git a/lib/edbee-lib/vendor/qslog/unittest/QtTestUtil/TestRegistry.h b/lib/edbee-lib/vendor/qslog/unittest/QtTestUtil/TestRegistry.h new file mode 100644 index 00000000..44d7ac92 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/unittest/QtTestUtil/TestRegistry.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2008 Remko Troncon + * Licensed under the MIT license. + * See COPYING for license details. + */ + +#ifndef QtTestUtil_TestRegistry_H +#define QtTestUtil_TestRegistry_H + +#include <QList> + +class QObject; + +namespace QtTestUtil +{ + +/** + * A registry of QtTest test classes. + * All test classes registered with QTTESTUTIL_REGISTER_TEST add + * themselves to this registry. All registered tests can then be run at + * once using runTests(). + */ +class TestRegistry +{ +public: + /** + * Retrieve the single instance of the registry. + */ + static TestRegistry *getInstance(); + + /** + * Register a QtTest test. + * This method is called by QTTESTUTIL_REGISTER_TEST, and you should + * not use this method directly. + */ + void registerTest(QObject *); + + /** + * Run all registered tests using QTest::qExec() + */ + int runTests(int argc, char *argv[]); + +private: + TestRegistry() {} + +private: + QList<QObject *> tests_; +}; +} // namespace QtTestUtil + +#endif diff --git a/lib/edbee-lib/vendor/qslog/unittest/TestLog.cpp b/lib/edbee-lib/vendor/qslog/unittest/TestLog.cpp new file mode 100644 index 00000000..0a4e5d1b --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/unittest/TestLog.cpp @@ -0,0 +1,349 @@ +#include "TestLog.h" +#include "QtTestUtil/QtTestUtil.h" +#include "QsLog.h" +#include "QsLogDest.h" +#include "QsLogDestFile.h" +#include "QsLogDestConsole.h" +#include "QsLogDestFile.h" +#include "QsLogDestFunctor.h" +#include <QTest> +#include <QSharedPointer> +#include <QtGlobal> + +const QLatin1String destinationName1("mock1"); +const QLatin1String destinationName2("mock2"); +using MockDestinationPtrU = std::unique_ptr<MockDestination>; + +// Needed to convert from removeDestination return value to the type that we +// initially added. +MockDestinationPtrU unique_cast(QsLogging::DestinationPtrU &&d) +{ + MockDestinationPtrU md(dynamic_cast<MockDestination *>(d.release())); + Q_ASSERT(md.get()); + return md; +} + +void DummyLogFunction(const QsLogging::LogMessage &) {} + +// Autotests for QsLog. +// These tests are based on using a mock destination to check what was logged. +// Destinations are owned by the log, that's why the add/remove ping-pong is +// needed in the tests. +class TestLog : public QObject +{ + Q_OBJECT +public: + TestLog() {} + +private slots: + void initTestCase(); + void testAllLevels(); + void testMessageText(); + void testLevelChanges(); + void testLevelParsing(); + void testDestinationRemove(); + void testWillRotate(); + void testRotation_data(); + void testRotation(); + void testRotationNoBackup(); + void testDestinationType(); + +private: +}; + +void TestLog::initTestCase() +{ + using namespace QsLogging; + QCOMPARE(Logger::instance().loggingLevel(), InfoLevel); + Logger::instance().setLoggingLevel(TraceLevel); + QCOMPARE(Logger::instance().loggingLevel(), TraceLevel); +} + +void TestLog::testAllLevels() +{ + using namespace QsLogging; + MockDestinationPtrU mockDest(new MockDestination(destinationName1)); + Logger::instance().addDestination(std::move(mockDest)); + + QLOG_TRACE() << "trace level"; + QLOG_DEBUG() << "debug level"; + QLOG_INFO() << "info level"; + QLOG_WARN() << "warn level"; + QLOG_ERROR() << "error level"; + QLOG_FATAL() << "fatal level"; + + mockDest + = unique_cast(Logger::instance().removeDestination(destinationName1)); + QCOMPARE(mockDest->messageCount(), 6); + QCOMPARE(mockDest->messageCountForLevel(TraceLevel), 1); + QCOMPARE(mockDest->messageCountForLevel(DebugLevel), 1); + QCOMPARE(mockDest->messageCountForLevel(InfoLevel), 1); + QCOMPARE(mockDest->messageCountForLevel(WarnLevel), 1); + QCOMPARE(mockDest->messageCountForLevel(ErrorLevel), 1); + QCOMPARE(mockDest->messageCountForLevel(FatalLevel), 1); +} + +void TestLog::testMessageText() +{ + using namespace QsLogging; + MockDestinationPtrU mockDest(new MockDestination(destinationName1)); + Logger::instance().addDestination(std::move(mockDest)); + + QLOG_DEBUG() << "foobar"; + QLOG_WARN() << "eiszeit"; + QLOG_FATAL() << "ruh-roh!"; + + mockDest + = unique_cast(Logger::instance().removeDestination(destinationName1)); + QVERIFY(mockDest->hasMessage("foobar", DebugLevel)); + QVERIFY(mockDest->hasMessage("eiszeit", WarnLevel)); + QVERIFY(mockDest->hasMessage("ruh-roh!", FatalLevel)); + QCOMPARE(mockDest->messageCount(), 3); +} + +void TestLog::testLevelChanges() +{ + using namespace QsLogging; + MockDestinationPtrU mockDest1(new MockDestination(destinationName1)); + MockDestinationPtrU mockDest2(new MockDestination(destinationName2)); + Logger::instance().addDestination(std::move(mockDest1)); + Logger::instance().addDestination(std::move(mockDest2)); + + using namespace QsLogging; + Logger::instance().setLoggingLevel(WarnLevel); + QCOMPARE(Logger::instance().loggingLevel(), WarnLevel); + + QLOG_TRACE() << "one"; + QLOG_DEBUG() << "two"; + QLOG_INFO() << "three"; + + mockDest1 + = unique_cast(Logger::instance().removeDestination(destinationName1)); + mockDest2 + = unique_cast(Logger::instance().removeDestination(destinationName2)); + + QCOMPARE(mockDest1->messageCount(), 0); + QCOMPARE(mockDest2->messageCount(), 0); + + Logger::instance().addDestination(std::move(mockDest1)); + Logger::instance().addDestination(std::move(mockDest2)); + + QLOG_WARN() << "warning"; + QLOG_ERROR() << "error"; + QLOG_FATAL() << "fatal"; + + mockDest1 + = unique_cast(Logger::instance().removeDestination(destinationName1)); + mockDest2 + = unique_cast(Logger::instance().removeDestination(destinationName2)); + + QCOMPARE(mockDest1->messageCountForLevel(WarnLevel), 1); + QCOMPARE(mockDest1->messageCountForLevel(ErrorLevel), 1); + QCOMPARE(mockDest1->messageCountForLevel(FatalLevel), 1); + QCOMPARE(mockDest1->messageCount(), 3); + QCOMPARE(mockDest2->messageCountForLevel(WarnLevel), 1); + QCOMPARE(mockDest2->messageCountForLevel(ErrorLevel), 1); + QCOMPARE(mockDest2->messageCountForLevel(FatalLevel), 1); + QCOMPARE(mockDest2->messageCount(), 3); +} + +void TestLog::testLevelParsing() +{ + using namespace QsLogging; + MockDestinationPtrU mockDest(new MockDestination(destinationName1)); + Logger::instance().addDestination(std::move(mockDest)); + + QLOG_TRACE() << "one"; + QLOG_DEBUG() << "two"; + QLOG_INFO() << "three"; + QLOG_WARN() << "warning"; + QLOG_ERROR() << "error"; + QLOG_FATAL() << "fatal"; + + mockDest + = unique_cast(Logger::instance().removeDestination(destinationName1)); + + using namespace QsLogging; + for (int i = 0; i < mockDest->messageCount(); ++i) + { + bool conversionOk = false; + const MockDestination::Message &m = mockDest->messageAt(i); + QCOMPARE(Logger::levelFromLogMessage(m.text, &conversionOk), m.level); + QCOMPARE(Logger::levelFromLogMessage(m.text), m.level); + QCOMPARE(conversionOk, true); + } +} + +void TestLog::testDestinationRemove() +{ + using namespace QsLogging; + MockDestinationPtrU mockDest(new MockDestination(destinationName1)); + MockDestinationPtrU toAddAndRemove(new MockDestination(destinationName2)); + Logger::instance().addDestination(std::move(mockDest)); + Logger::instance().addDestination(std::move(toAddAndRemove)); + Logger::instance().setLoggingLevel(DebugLevel); + QLOG_INFO() << "one for all"; + + mockDest + = unique_cast(Logger::instance().removeDestination(destinationName1)); + toAddAndRemove + = unique_cast(Logger::instance().removeDestination(destinationName2)); + QCOMPARE(mockDest->messageCount(), 1); + QCOMPARE(toAddAndRemove->messageCount(), 1); + + Logger::instance().addDestination(std::move(mockDest)); + QLOG_INFO() << "one for (almost) all"; + + mockDest + = unique_cast(Logger::instance().removeDestination(destinationName1)); + QCOMPARE(mockDest->messageCount(), 2); + QCOMPARE(toAddAndRemove->messageCount(), 1); + QCOMPARE(toAddAndRemove->messageCountForLevel(InfoLevel), 1); + + Logger::instance().addDestination(std::move(mockDest)); + Logger::instance().addDestination(std::move(toAddAndRemove)); + QLOG_INFO() << "another one for all"; + + mockDest + = unique_cast(Logger::instance().removeDestination(destinationName1)); + toAddAndRemove + = unique_cast(Logger::instance().removeDestination(destinationName2)); + QCOMPARE(mockDest->messageCount(), 3); + QCOMPARE(toAddAndRemove->messageCount(), 2); + QCOMPARE(toAddAndRemove->messageCountForLevel(InfoLevel), 2); +} + +void TestLog::testWillRotate() +{ + using namespace QsLogging; + MockSizeRotationStrategy rotationStrategy; + rotationStrategy.setBackupCount(1); + rotationStrategy.setMaximumSizeInBytes(10); + QCOMPARE(rotationStrategy.shouldRotate(), false); + + rotationStrategy.includeMessageInCalculation(QLatin1String("12345")); + QCOMPARE(rotationStrategy.shouldRotate(), false); + + rotationStrategy.includeMessageInCalculation(QLatin1String("12345")); + QCOMPARE(rotationStrategy.shouldRotate(), false); + + rotationStrategy.includeMessageInCalculation(QLatin1String("1")); + QCOMPARE(rotationStrategy.shouldRotate(), true); +} + +void TestLog::testRotation_data() +{ + QTest::addColumn<int>("backupCount"); + + QTest::newRow("one backup") << 1; + QTest::newRow("three backups") << 3; + QTest::newRow("five backups") << 5; + QTest::newRow("ten backups") << 10; +} + +void TestLog::testRotation() +{ + using namespace QsLogging; + + QFETCH(int, backupCount); + MockSizeRotationStrategy rotationStrategy; + rotationStrategy.setBackupCount(backupCount); + for (int i = 0; i < backupCount; ++i) + { + rotationStrategy.rotate(); + QCOMPARE(rotationStrategy.filesList().size(), + 1 + i + 1); // 1 log + "rotation count" backups + } + + rotationStrategy.rotate(); + QCOMPARE(rotationStrategy.filesList().size(), + backupCount + 1); // 1 log + backup count +} + +void TestLog::testRotationNoBackup() +{ + using namespace QsLogging; + MockSizeRotationStrategy rotationStrategy; + rotationStrategy.setBackupCount(0); + rotationStrategy.setMaximumSizeInBytes(10); + + rotationStrategy.rotate(); + QCOMPARE(rotationStrategy.filesList().size(), 1); // log +} + +void TestLog::testDestinationType() +{ + using namespace QsLogging; + + DestinationPtrU console = DestinationFactory::MakeDebugOutputDestination(); + DestinationPtrU file = DestinationFactory::MakeFileDestination( + "test.log", LogRotationOption::DisableLogRotation, MaxSizeBytes(5000), + MaxOldLogCount(1)); + DestinationPtrU func + = DestinationFactory::MakeFunctorDestination(&DummyLogFunction); + + QCOMPARE( + Logger::instance().hasDestinationOfType(DebugOutputDestination::Type), + false); + QCOMPARE(Logger::instance().hasDestinationOfType(FileDestination::Type), + false); + QCOMPARE(Logger::instance().hasDestinationOfType(FunctorDestination::Type), + false); + + Logger::instance().addDestination(std::move(console)); + QCOMPARE( + Logger::instance().hasDestinationOfType(DebugOutputDestination::Type), + true); + QCOMPARE(Logger::instance().hasDestinationOfType(FileDestination::Type), + false); + QCOMPARE(Logger::instance().hasDestinationOfType(FunctorDestination::Type), + false); + + Logger::instance().addDestination(std::move(file)); + QCOMPARE( + Logger::instance().hasDestinationOfType(DebugOutputDestination::Type), + true); + QCOMPARE(Logger::instance().hasDestinationOfType(FileDestination::Type), + true); + QCOMPARE(Logger::instance().hasDestinationOfType(FunctorDestination::Type), + false); + + Logger::instance().addDestination(std::move(func)); + QCOMPARE( + Logger::instance().hasDestinationOfType(DebugOutputDestination::Type), + true); + QCOMPARE(Logger::instance().hasDestinationOfType(FileDestination::Type), + true); + QCOMPARE(Logger::instance().hasDestinationOfType(FunctorDestination::Type), + true); + + Logger::instance().removeDestination(DebugOutputDestination::Type); + QCOMPARE( + Logger::instance().hasDestinationOfType(DebugOutputDestination::Type), + false); + QCOMPARE(Logger::instance().hasDestinationOfType(FileDestination::Type), + true); + QCOMPARE(Logger::instance().hasDestinationOfType(FunctorDestination::Type), + true); + + Logger::instance().removeDestination(FileDestination::Type); + QCOMPARE( + Logger::instance().hasDestinationOfType(DebugOutputDestination::Type), + false); + QCOMPARE(Logger::instance().hasDestinationOfType(FileDestination::Type), + false); + QCOMPARE(Logger::instance().hasDestinationOfType(FunctorDestination::Type), + true); + + Logger::instance().removeDestination(FunctorDestination::Type); + QCOMPARE( + Logger::instance().hasDestinationOfType(DebugOutputDestination::Type), + false); + QCOMPARE(Logger::instance().hasDestinationOfType(FileDestination::Type), + false); + QCOMPARE(Logger::instance().hasDestinationOfType(FunctorDestination::Type), + false); +} + +QTTESTUTIL_REGISTER_TEST(TestLog); +#include "TestLog.moc" diff --git a/lib/edbee-lib/vendor/qslog/unittest/TestLog.h b/lib/edbee-lib/vendor/qslog/unittest/TestLog.h new file mode 100644 index 00000000..4bd89ab7 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/unittest/TestLog.h @@ -0,0 +1,160 @@ +#ifndef TESTLOG_H +#define TESTLOG_H + +#include "QsLogDest.h" +#include "QsLogDestFile.h" +#include <QHash> +#include <QList> +#include <QString> +#include <QStringList> +#include <QDir> + +// A destination that tracks log messages +class MockDestination : public QsLogging::Destination +{ +public: + struct Message + { + Message() + : level(QsLogging::TraceLevel) + { + } + QString text; + QsLogging::Level level; + }; + +public: + explicit MockDestination(const QLatin1String &myType = QLatin1String("mock")) + : mMyType(myType) + { + } + + void write(const QsLogging::LogMessage &message) override + { + Message m; + m.text = message.formatted; + m.level = message.level; + mMessages.push_back(m); + ++mCountByLevel[message.level]; + } + + bool isValid() override { return true; } + + QString type() const override { return mMyType; } + + void clear() + { + mMessages.clear(); + mCountByLevel.clear(); + } + + int messageCount() const { return mMessages.count(); } + + int messageCountForLevel(QsLogging::Level level) const + { + return mCountByLevel.value(level); + } + + bool hasMessage(const QString &messageContent, QsLogging::Level level) const + { + Q_FOREACH (const Message &m, mMessages) + { + if (m.level == level && m.text.contains(messageContent)) + return true; + } + + return false; + } + + const Message &messageAt(int index) + { + Q_ASSERT(index >= 0 && index < messageCount()); + return mMessages.at(index); + } + +private: + QHash<QsLogging::Level, int> mCountByLevel; + QList<Message> mMessages; + QLatin1String mMyType; +}; + +// A rotation strategy that simulates file rotations. +// Stores a "file system" inside a string list and can perform some operations +// on it. +class MockSizeRotationStrategy : public QsLogging::SizeRotationStrategy +{ +public: + MockSizeRotationStrategy() + : fakePath("FAKEPATH") + , logName("QsLog.txt") + { + setInitialInfo(QDir(fakePath).filePath(logName), 0); + files.append(logName); + } + + const QStringList &filesList() { return files; } + + void rotate() override + { + SizeRotationStrategy::rotate(); + files.append(logName); + } + +protected: + bool removeFileAtPath(const QString &path) override + { + QString editedPath = path; + if (editedPath.startsWith(fakePath)) + { + editedPath.remove(0, fakePath.size() + 1); + const int indexOfPath = files.indexOf(editedPath); + if (indexOfPath != -1) + { + files.removeAt(indexOfPath); + return true; + } + } + + return false; + } + + bool fileExistsAtPath(const QString &path) override + { + QString editedPath = path; + if (editedPath.startsWith(fakePath)) + { + editedPath.remove(0, fakePath.size() + 1); + return files.indexOf(editedPath) != -1; + } + return false; + } + + bool renameFileFromTo(const QString &from, const QString &to) override + { + QString editedFromPath = from; + QString editedToPath = to; + + if (editedFromPath.startsWith(fakePath) + && editedToPath.startsWith(fakePath)) + { + editedFromPath.remove(0, fakePath.size() + 1); + editedToPath.remove(0, fakePath.size() + 1); + const int ind = files.indexOf(editedFromPath); + if (ind != -1) + { + files.removeAll(editedFromPath); + files.append(editedToPath); + return true; + } + } + + return false; + } + +private: + QStringList files; + const QString fakePath; + const QString logName; +}; + +#endif // TESTLOG_H diff --git a/lib/edbee-lib/vendor/qslog/unittest/unittest.pro b/lib/edbee-lib/vendor/qslog/unittest/unittest.pro new file mode 100644 index 00000000..b59b8a93 --- /dev/null +++ b/lib/edbee-lib/vendor/qslog/unittest/unittest.pro @@ -0,0 +1,29 @@ +QT += core + +TARGET = QsLogUnitTest +CONFIG += console qtestlib c++11 +CONFIG -= app_bundle +TEMPLATE = app + +# optionally enable address sanitizer +linux-g++|macx { + QMAKE_CXXFLAGS += -fsanitize=address + QMAKE_LFLAGS += -fsanitize=address +} + +# test-case sources +SOURCES += TestLog.cpp + +HEADERS += TestLog.h + +# component sources +include(../QsLog.pri) + +SOURCES += \ + ./QtTestUtil/TestRegistry.cpp \ + ./QtTestUtil/SimpleChecker.cpp + +HEADERS += \ + ./QtTestUtil/TestRegistry.h \ + ./QtTestUtil/TestRegistration.h \ + ./QtTestUtil/QtTestUtil.h diff --git a/lib/simde/CMakeLists.txt b/lib/simde/CMakeLists.txt index 81208234..73954173 100644 --- a/lib/simde/CMakeLists.txt +++ b/lib/simde/CMakeLists.txt @@ -68,6 +68,20 @@ else() endif() +# +# macOS OpenMP (use homebrew port) +# +if(APPLE) + include_directories( + "/opt/homebrew/opt/libomp/include" + "/opt/homebrew/opt/llvm/include" + ) + link_directories( + "/opt/homebrew/opt/libomp/lib" + "/opt/homebrew/opt/llvm/lib" + ) +endif() + # # Enable OpenMP SIMD support globally #