summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/database.cpp8
-rw-r--r--lib/filter.cpp118
-rw-r--r--lib/filter.h10
-rw-r--r--lib/form.cpp10
-rw-r--r--lib/frame.cpp6
-rw-r--r--lib/notion.cpp12
-rw-r--r--lib/part.cpp26
-rw-r--r--lib/part.h6
-rw-r--r--lib/pronunciation.cpp14
-rw-r--r--lib/statement.cpp56
-rw-r--r--lib/statement.h10
-rw-r--r--lib/token.cpp40
-rw-r--r--lib/token.h6
-rw-r--r--lib/word.cpp14
14 files changed, 168 insertions, 168 deletions
diff --git a/lib/database.cpp b/lib/database.cpp index 96eed45..d5ff37e 100644 --- a/lib/database.cpp +++ b/lib/database.cpp
@@ -12,8 +12,8 @@ namespace verbly {
12 hatkirby::row version = 12 hatkirby::row version =
13 ppdb_.queryFirst("SELECT major, minor FROM version"); 13 ppdb_.queryFirst("SELECT major, minor FROM version");
14 14
15 major_ = mpark::get<int>(version[0]); 15 major_ = std::get<int>(version[0]);
16 minor_ = mpark::get<int>(version[1]); 16 minor_ = std::get<int>(version[1]);
17 17
18 if (major_ != DATABASE_MAJOR_VERSION) 18 if (major_ != DATABASE_MAJOR_VERSION)
19 { 19 {
@@ -62,7 +62,7 @@ namespace verbly {
62 62
63 for (hatkirby::row& r : rows) 63 for (hatkirby::row& r : rows)
64 { 64 {
65 result.emplace(std::move(mpark::get<std::string>(r[0]))); 65 result.emplace(std::move(std::get<std::string>(r[0])));
66 } 66 }
67 67
68 return result; 68 return result;
@@ -79,7 +79,7 @@ namespace verbly {
79 79
80 for (hatkirby::row& r : rows) 80 for (hatkirby::row& r : rows)
81 { 81 {
82 result.emplace(std::move(mpark::get<std::string>(r[0]))); 82 result.emplace(std::move(std::get<std::string>(r[0])));
83 } 83 }
84 84
85 return result; 85 return result;
diff --git a/lib/filter.cpp b/lib/filter.cpp index 592b190..e3174ce 100644 --- a/lib/filter.cpp +++ b/lib/filter.cpp
@@ -377,7 +377,7 @@ namespace verbly {
377 throw std::domain_error("This filter does not have a field"); 377 throw std::domain_error("This filter does not have a field");
378 } 378 }
379 379
380 return mpark::get<singleton_type>(variant_).filterField; 380 return std::get<singleton_type>(variant_).filterField;
381 } 381 }
382 382
383 filter::comparison filter::getComparison() const 383 filter::comparison filter::getComparison() const
@@ -387,7 +387,7 @@ namespace verbly {
387 throw std::domain_error("This filter does not have a comparison"); 387 throw std::domain_error("This filter does not have a comparison");
388 } 388 }
389 389
390 return mpark::get<singleton_type>(variant_).filterType; 390 return std::get<singleton_type>(variant_).filterType;
391 } 391 }
392 392
393 filter filter::getJoinCondition() const 393 filter filter::getJoinCondition() const
@@ -397,7 +397,7 @@ namespace verbly {
397 throw std::domain_error("This filter does not have a join condition"); 397 throw std::domain_error("This filter does not have a join condition");
398 } 398 }
399 399
400 const singleton_type& ss = mpark::get<singleton_type>(variant_); 400 const singleton_type& ss = std::get<singleton_type>(variant_);
401 401
402 switch (ss.filterType) 402 switch (ss.filterType)
403 { 403 {
@@ -406,7 +406,7 @@ namespace verbly {
406 case comparison::hierarchally_matches: 406 case comparison::hierarchally_matches:
407 case comparison::does_not_hierarchally_match: 407 case comparison::does_not_hierarchally_match:
408 { 408 {
409 return *mpark::get<rec_filter>(ss.data); 409 return *std::get<rec_filter>(ss.data);
410 } 410 }
411 411
412 case comparison::string_equals: 412 case comparison::string_equals:
@@ -437,7 +437,7 @@ namespace verbly {
437 throw std::domain_error("This filter does not have a string argument"); 437 throw std::domain_error("This filter does not have a string argument");
438 } 438 }
439 439
440 const singleton_type& ss = mpark::get<singleton_type>(variant_); 440 const singleton_type& ss = std::get<singleton_type>(variant_);
441 441
442 switch (ss.filterType) 442 switch (ss.filterType)
443 { 443 {
@@ -446,7 +446,7 @@ namespace verbly {
446 case comparison::string_is_like: 446 case comparison::string_is_like:
447 case comparison::string_is_not_like: 447 case comparison::string_is_not_like:
448 { 448 {
449 return mpark::get<std::string>(ss.data); 449 return std::get<std::string>(ss.data);
450 } 450 }
451 451
452 case comparison::int_equals: 452 case comparison::int_equals:
@@ -477,7 +477,7 @@ namespace verbly {
477 throw std::domain_error("This filter does not have an integer argument"); 477 throw std::domain_error("This filter does not have an integer argument");
478 } 478 }
479 479
480 const singleton_type& ss = mpark::get<singleton_type>(variant_); 480 const singleton_type& ss = std::get<singleton_type>(variant_);
481 481
482 switch (ss.filterType) 482 switch (ss.filterType)
483 { 483 {
@@ -488,7 +488,7 @@ namespace verbly {
488 case comparison::int_is_at_most: 488 case comparison::int_is_at_most:
489 case comparison::int_is_less_than: 489 case comparison::int_is_less_than:
490 { 490 {
491 return mpark::get<int>(ss.data); 491 return std::get<int>(ss.data);
492 } 492 }
493 493
494 case comparison::string_equals: 494 case comparison::string_equals:
@@ -514,13 +514,13 @@ namespace verbly {
514 bool filter::getBooleanArgument() const 514 bool filter::getBooleanArgument() const
515 { 515 {
516 if ((type_ != type::singleton) || 516 if ((type_ != type::singleton) ||
517 (mpark::get<singleton_type>(variant_).filterType != 517 (std::get<singleton_type>(variant_).filterType !=
518 comparison::boolean_equals)) 518 comparison::boolean_equals))
519 { 519 {
520 throw std::domain_error("This filter does not have a boolean argument"); 520 throw std::domain_error("This filter does not have a boolean argument");
521 } 521 }
522 522
523 return mpark::get<bool>(mpark::get<singleton_type>(variant_).data); 523 return std::get<bool>(std::get<singleton_type>(variant_).data);
524 } 524 }
525 525
526 field filter::getCompareField() const 526 field filter::getCompareField() const
@@ -530,14 +530,14 @@ namespace verbly {
530 throw std::domain_error("This filter does not have a compare field"); 530 throw std::domain_error("This filter does not have a compare field");
531 } 531 }
532 532
533 const singleton_type& ss = mpark::get<singleton_type>(variant_); 533 const singleton_type& ss = std::get<singleton_type>(variant_);
534 534
535 switch (ss.filterType) 535 switch (ss.filterType)
536 { 536 {
537 case comparison::field_equals: 537 case comparison::field_equals:
538 case comparison::field_does_not_equal: 538 case comparison::field_does_not_equal:
539 { 539 {
540 return mpark::get<field>(ss.data); 540 return std::get<field>(ss.data);
541 541
542 break; 542 break;
543 } 543 }
@@ -579,7 +579,7 @@ namespace verbly {
579 throw std::domain_error("This filter is not a group filter"); 579 throw std::domain_error("This filter is not a group filter");
580 } 580 }
581 581
582 return mpark::get<group_type>(variant_).orlogic; 582 return std::get<group_type>(variant_).orlogic;
583 } 583 }
584 584
585 filter filter::operator+(filter condition) const 585 filter filter::operator+(filter condition) const
@@ -597,7 +597,7 @@ namespace verbly {
597 throw std::domain_error("Children can only be added to group filters"); 597 throw std::domain_error("Children can only be added to group filters");
598 } 598 }
599 599
600 mpark::get<group_type>(variant_).children.push_back(std::move(condition)); 600 std::get<group_type>(variant_).children.push_back(std::move(condition));
601 601
602 return *this; 602 return *this;
603 } 603 }
@@ -609,7 +609,7 @@ namespace verbly {
609 throw std::domain_error("This filter has no children"); 609 throw std::domain_error("This filter has no children");
610 } 610 }
611 611
612 return std::begin(mpark::get<group_type>(variant_).children); 612 return std::begin(std::get<group_type>(variant_).children);
613 } 613 }
614 614
615 filter::const_iterator filter::end() const 615 filter::const_iterator filter::end() const
@@ -619,7 +619,7 @@ namespace verbly {
619 throw std::domain_error("This filter has no children"); 619 throw std::domain_error("This filter has no children");
620 } 620 }
621 621
622 return std::end(mpark::get<group_type>(variant_).children); 622 return std::end(std::get<group_type>(variant_).children);
623 } 623 }
624 624
625 filter::filter( 625 filter::filter(
@@ -642,7 +642,7 @@ namespace verbly {
642 throw std::domain_error("This filter is not a mask filter"); 642 throw std::domain_error("This filter is not a mask filter");
643 } 643 }
644 644
645 return mpark::get<mask_type>(variant_).name; 645 return std::get<mask_type>(variant_).name;
646 } 646 }
647 647
648 bool filter::isMaskInternal() const 648 bool filter::isMaskInternal() const
@@ -652,7 +652,7 @@ namespace verbly {
652 throw std::domain_error("This filter is not a mask filter"); 652 throw std::domain_error("This filter is not a mask filter");
653 } 653 }
654 654
655 return mpark::get<mask_type>(variant_).internal; 655 return std::get<mask_type>(variant_).internal;
656 } 656 }
657 657
658 const filter& filter::getMaskFilter() const 658 const filter& filter::getMaskFilter() const
@@ -662,7 +662,7 @@ namespace verbly {
662 throw std::domain_error("This filter is not a mask filter"); 662 throw std::domain_error("This filter is not a mask filter");
663 } 663 }
664 664
665 return *mpark::get<mask_type>(variant_).subfilter; 665 return *std::get<mask_type>(variant_).subfilter;
666 } 666 }
667 667
668 filter filter::operator!() const 668 filter filter::operator!() const
@@ -676,7 +676,7 @@ namespace verbly {
676 676
677 case type::singleton: 677 case type::singleton:
678 { 678 {
679 const singleton_type& ss = mpark::get<singleton_type>(variant_); 679 const singleton_type& ss = std::get<singleton_type>(variant_);
680 680
681 switch (ss.filterType) 681 switch (ss.filterType)
682 { 682 {
@@ -685,7 +685,7 @@ namespace verbly {
685 return filter( 685 return filter(
686 ss.filterField, 686 ss.filterField,
687 comparison::int_does_not_equal, 687 comparison::int_does_not_equal,
688 mpark::get<int>(ss.data)); 688 std::get<int>(ss.data));
689 } 689 }
690 690
691 case comparison::int_does_not_equal: 691 case comparison::int_does_not_equal:
@@ -693,7 +693,7 @@ namespace verbly {
693 return filter( 693 return filter(
694 ss.filterField, 694 ss.filterField,
695 comparison::int_equals, 695 comparison::int_equals,
696 mpark::get<int>(ss.data)); 696 std::get<int>(ss.data));
697 } 697 }
698 698
699 case comparison::int_is_at_least: 699 case comparison::int_is_at_least:
@@ -701,7 +701,7 @@ namespace verbly {
701 return filter( 701 return filter(
702 ss.filterField, 702 ss.filterField,
703 comparison::int_is_less_than, 703 comparison::int_is_less_than,
704 mpark::get<int>(ss.data)); 704 std::get<int>(ss.data));
705 } 705 }
706 706
707 case comparison::int_is_greater_than: 707 case comparison::int_is_greater_than:
@@ -709,7 +709,7 @@ namespace verbly {
709 return filter( 709 return filter(
710 ss.filterField, 710 ss.filterField,
711 comparison::int_is_at_most, 711 comparison::int_is_at_most,
712 mpark::get<int>(ss.data)); 712 std::get<int>(ss.data));
713 } 713 }
714 714
715 case comparison::int_is_at_most: 715 case comparison::int_is_at_most:
@@ -717,7 +717,7 @@ namespace verbly {
717 return filter( 717 return filter(
718 ss.filterField, 718 ss.filterField,
719 comparison::int_is_greater_than, 719 comparison::int_is_greater_than,
720 mpark::get<int>(ss.data)); 720 std::get<int>(ss.data));
721 } 721 }
722 722
723 case comparison::int_is_less_than: 723 case comparison::int_is_less_than:
@@ -725,7 +725,7 @@ namespace verbly {
725 return filter( 725 return filter(
726 ss.filterField, 726 ss.filterField,
727 comparison::int_is_at_least, 727 comparison::int_is_at_least,
728 mpark::get<int>(ss.data)); 728 std::get<int>(ss.data));
729 } 729 }
730 730
731 case comparison::boolean_equals: 731 case comparison::boolean_equals:
@@ -733,7 +733,7 @@ namespace verbly {
733 return filter( 733 return filter(
734 ss.filterField, 734 ss.filterField,
735 comparison::boolean_equals, 735 comparison::boolean_equals,
736 !mpark::get<int>(ss.data)); 736 !std::get<int>(ss.data));
737 } 737 }
738 738
739 case comparison::string_equals: 739 case comparison::string_equals:
@@ -741,7 +741,7 @@ namespace verbly {
741 return filter( 741 return filter(
742 ss.filterField, 742 ss.filterField,
743 comparison::string_does_not_equal, 743 comparison::string_does_not_equal,
744 mpark::get<std::string>(ss.data)); 744 std::get<std::string>(ss.data));
745 } 745 }
746 746
747 case comparison::string_does_not_equal: 747 case comparison::string_does_not_equal:
@@ -749,7 +749,7 @@ namespace verbly {
749 return filter( 749 return filter(
750 ss.filterField, 750 ss.filterField,
751 comparison::string_equals, 751 comparison::string_equals,
752 mpark::get<std::string>(ss.data)); 752 std::get<std::string>(ss.data));
753 } 753 }
754 754
755 case comparison::string_is_like: 755 case comparison::string_is_like:
@@ -757,7 +757,7 @@ namespace verbly {
757 return filter( 757 return filter(
758 ss.filterField, 758 ss.filterField,
759 comparison::string_is_not_like, 759 comparison::string_is_not_like,
760 mpark::get<std::string>(ss.data)); 760 std::get<std::string>(ss.data));
761 } 761 }
762 762
763 case comparison::string_is_not_like: 763 case comparison::string_is_not_like:
@@ -765,7 +765,7 @@ namespace verbly {
765 return filter( 765 return filter(
766 ss.filterField, 766 ss.filterField,
767 comparison::string_is_like, 767 comparison::string_is_like,
768 mpark::get<std::string>(ss.data)); 768 std::get<std::string>(ss.data));
769 } 769 }
770 770
771 case comparison::is_null: 771 case comparison::is_null:
@@ -787,7 +787,7 @@ namespace verbly {
787 return filter( 787 return filter(
788 ss.filterField, 788 ss.filterField,
789 comparison::does_not_match, 789 comparison::does_not_match,
790 *mpark::get<rec_filter>(ss.data)); 790 *std::get<rec_filter>(ss.data));
791 } 791 }
792 792
793 case comparison::does_not_match: 793 case comparison::does_not_match:
@@ -795,7 +795,7 @@ namespace verbly {
795 return filter( 795 return filter(
796 ss.filterField, 796 ss.filterField,
797 comparison::matches, 797 comparison::matches,
798 *mpark::get<rec_filter>(ss.data)); 798 *std::get<rec_filter>(ss.data));
799 } 799 }
800 800
801 case comparison::hierarchally_matches: 801 case comparison::hierarchally_matches:
@@ -803,7 +803,7 @@ namespace verbly {
803 return filter( 803 return filter(
804 ss.filterField, 804 ss.filterField,
805 comparison::does_not_hierarchally_match, 805 comparison::does_not_hierarchally_match,
806 *mpark::get<rec_filter>(ss.data)); 806 *std::get<rec_filter>(ss.data));
807 } 807 }
808 808
809 case comparison::does_not_hierarchally_match: 809 case comparison::does_not_hierarchally_match:
@@ -811,7 +811,7 @@ namespace verbly {
811 return filter( 811 return filter(
812 ss.filterField, 812 ss.filterField,
813 comparison::hierarchally_matches, 813 comparison::hierarchally_matches,
814 *mpark::get<rec_filter>(ss.data)); 814 *std::get<rec_filter>(ss.data));
815 } 815 }
816 816
817 case comparison::field_equals: 817 case comparison::field_equals:
@@ -819,7 +819,7 @@ namespace verbly {
819 return filter( 819 return filter(
820 ss.filterField, 820 ss.filterField,
821 comparison::field_does_not_equal, 821 comparison::field_does_not_equal,
822 mpark::get<field>(ss.data)); 822 std::get<field>(ss.data));
823 } 823 }
824 824
825 case comparison::field_does_not_equal: 825 case comparison::field_does_not_equal:
@@ -827,14 +827,14 @@ namespace verbly {
827 return filter( 827 return filter(
828 ss.filterField, 828 ss.filterField,
829 comparison::field_equals, 829 comparison::field_equals,
830 mpark::get<field>(ss.data)); 830 std::get<field>(ss.data));
831 } 831 }
832 } 832 }
833 } 833 }
834 834
835 case type::group: 835 case type::group:
836 { 836 {
837 const group_type& gg = mpark::get<group_type>(variant_); 837 const group_type& gg = std::get<group_type>(variant_);
838 838
839 filter result(!gg.orlogic); 839 filter result(!gg.orlogic);
840 840
@@ -848,7 +848,7 @@ namespace verbly {
848 848
849 case type::mask: 849 case type::mask:
850 { 850 {
851 const mask_type& mm = mpark::get<mask_type>(variant_); 851 const mask_type& mm = std::get<mask_type>(variant_);
852 852
853 return {mm.name, mm.internal, !*mm.subfilter}; 853 return {mm.name, mm.internal, !*mm.subfilter};
854 } 854 }
@@ -879,7 +879,7 @@ namespace verbly {
879 { 879 {
880 filter result(false); 880 filter result(false);
881 881
882 group_type& gg = mpark::get<group_type>(result.variant_); 882 group_type& gg = std::get<group_type>(result.variant_);
883 883
884 gg.children.push_back(*this); 884 gg.children.push_back(*this);
885 gg.children.push_back(std::move(condition)); 885 gg.children.push_back(std::move(condition));
@@ -889,13 +889,13 @@ namespace verbly {
889 889
890 case type::group: 890 case type::group:
891 { 891 {
892 const group_type& og = mpark::get<group_type>(variant_); 892 const group_type& og = std::get<group_type>(variant_);
893 893
894 if (og.orlogic) 894 if (og.orlogic)
895 { 895 {
896 filter result(false); 896 filter result(false);
897 897
898 group_type& gg = mpark::get<group_type>(result.variant_); 898 group_type& gg = std::get<group_type>(result.variant_);
899 899
900 gg.children.push_back(*this); 900 gg.children.push_back(*this);
901 gg.children.push_back(std::move(condition)); 901 gg.children.push_back(std::move(condition));
@@ -904,7 +904,7 @@ namespace verbly {
904 } else { 904 } else {
905 filter result(*this); 905 filter result(*this);
906 906
907 group_type& gg = mpark::get<group_type>(result.variant_); 907 group_type& gg = std::get<group_type>(result.variant_);
908 908
909 gg.children.push_back(std::move(condition)); 909 gg.children.push_back(std::move(condition));
910 910
@@ -928,7 +928,7 @@ namespace verbly {
928 { 928 {
929 filter result(true); 929 filter result(true);
930 930
931 group_type& gg = mpark::get<group_type>(result.variant_); 931 group_type& gg = std::get<group_type>(result.variant_);
932 932
933 gg.children.push_back(*this); 933 gg.children.push_back(*this);
934 gg.children.push_back(std::move(condition)); 934 gg.children.push_back(std::move(condition));
@@ -938,13 +938,13 @@ namespace verbly {
938 938
939 case type::group: 939 case type::group:
940 { 940 {
941 const group_type& og = mpark::get<group_type>(variant_); 941 const group_type& og = std::get<group_type>(variant_);
942 942
943 if (!og.orlogic) 943 if (!og.orlogic)
944 { 944 {
945 filter result(true); 945 filter result(true);
946 946
947 group_type& gg = mpark::get<group_type>(result.variant_); 947 group_type& gg = std::get<group_type>(result.variant_);
948 948
949 gg.children.push_back(*this); 949 gg.children.push_back(*this);
950 gg.children.push_back(std::move(condition)); 950 gg.children.push_back(std::move(condition));
@@ -953,7 +953,7 @@ namespace verbly {
953 } else { 953 } else {
954 filter result(*this); 954 filter result(*this);
955 955
956 group_type& gg = mpark::get<group_type>(result.variant_); 956 group_type& gg = std::get<group_type>(result.variant_);
957 957
958 gg.children.push_back(std::move(condition)); 958 gg.children.push_back(std::move(condition));
959 959
@@ -980,7 +980,7 @@ namespace verbly {
980 980
981 case type::singleton: 981 case type::singleton:
982 { 982 {
983 const singleton_type& ss = mpark::get<singleton_type>(variant_); 983 const singleton_type& ss = std::get<singleton_type>(variant_);
984 984
985 // First, switch on the normalized context, and then switch on the 985 // First, switch on the normalized context, and then switch on the
986 // current context. We recursively recontextualize by using the 986 // current context. We recursively recontextualize by using the
@@ -1147,7 +1147,7 @@ namespace verbly {
1147 1147
1148 case type::group: 1148 case type::group:
1149 { 1149 {
1150 const group_type& gg = mpark::get<group_type>(variant_); 1150 const group_type& gg = std::get<group_type>(variant_);
1151 1151
1152 filter result(gg.orlogic); 1152 filter result(gg.orlogic);
1153 std::map<field, filter> positiveJoins; 1153 std::map<field, filter> positiveJoins;
@@ -1166,7 +1166,7 @@ namespace verbly {
1166 case type::singleton: 1166 case type::singleton:
1167 { 1167 {
1168 singleton_type& normSing = 1168 singleton_type& normSing =
1169 mpark::get<singleton_type>(normalized.variant_); 1169 std::get<singleton_type>(normalized.variant_);
1170 1170
1171 switch (normalized.getComparison()) 1171 switch (normalized.getComparison())
1172 { 1172 {
@@ -1178,7 +1178,7 @@ namespace verbly {
1178 } 1178 }
1179 1179
1180 positiveJoins.at(normalized.getField()) += 1180 positiveJoins.at(normalized.getField()) +=
1181 std::move(*mpark::get<rec_filter>(normSing.data)); 1181 std::move(*std::get<rec_filter>(normSing.data));
1182 1182
1183 break; 1183 break;
1184 } 1184 }
@@ -1192,7 +1192,7 @@ namespace verbly {
1192 } 1192 }
1193 1193
1194 negativeJoins.at(normalized.getField()) += 1194 negativeJoins.at(normalized.getField()) +=
1195 std::move(*mpark::get<rec_filter>(normSing.data)); 1195 std::move(*std::get<rec_filter>(normSing.data));
1196 1196
1197 break; 1197 break;
1198 } 1198 }
@@ -1202,7 +1202,7 @@ namespace verbly {
1202 if (gg.orlogic) 1202 if (gg.orlogic)
1203 { 1203 {
1204 positiveJoins[normalized.getField()] |= 1204 positiveJoins[normalized.getField()] |=
1205 std::move(*mpark::get<rec_filter>(normSing.data)); 1205 std::move(*std::get<rec_filter>(normSing.data));
1206 } else { 1206 } else {
1207 result += std::move(normalized); 1207 result += std::move(normalized);
1208 } 1208 }
@@ -1215,7 +1215,7 @@ namespace verbly {
1215 if (!gg.orlogic) 1215 if (!gg.orlogic)
1216 { 1216 {
1217 negativeJoins[normalized.getField()] |= 1217 negativeJoins[normalized.getField()] |=
1218 std::move(*mpark::get<rec_filter>(normSing.data)); 1218 std::move(*std::get<rec_filter>(normSing.data));
1219 } else { 1219 } else {
1220 result += std::move(normalized); 1220 result += std::move(normalized);
1221 } 1221 }
@@ -1259,7 +1259,7 @@ namespace verbly {
1259 case type::mask: 1259 case type::mask:
1260 { 1260 {
1261 mask_type& normMask = 1261 mask_type& normMask =
1262 mpark::get<mask_type>(normalized.variant_); 1262 std::get<mask_type>(normalized.variant_);
1263 1263
1264 auto maskId = 1264 auto maskId =
1265 std::tie( 1265 std::tie(
@@ -1310,7 +1310,7 @@ namespace verbly {
1310 1310
1311 case type::mask: 1311 case type::mask:
1312 { 1312 {
1313 const mask_type& mm = mpark::get<mask_type>(variant_); 1313 const mask_type& mm = std::get<mask_type>(variant_);
1314 1314
1315 return { 1315 return {
1316 mm.name, 1316 mm.name,
@@ -1333,7 +1333,7 @@ namespace verbly {
1333 1333
1334 case type::group: 1334 case type::group:
1335 { 1335 {
1336 const group_type& gg = mpark::get<group_type>(variant_); 1336 const group_type& gg = std::get<group_type>(variant_);
1337 1337
1338 filter result(gg.orlogic); 1338 filter result(gg.orlogic);
1339 for (const filter& child : gg.children) 1339 for (const filter& child : gg.children)
@@ -1345,7 +1345,7 @@ namespace verbly {
1345 } 1345 }
1346 } 1346 }
1347 1347
1348 group_type& resGroup = mpark::get<group_type>(result.variant_); 1348 group_type& resGroup = std::get<group_type>(result.variant_);
1349 1349
1350 if (resGroup.children.empty()) 1350 if (resGroup.children.empty())
1351 { 1351 {
@@ -1362,7 +1362,7 @@ namespace verbly {
1362 1362
1363 case type::mask: 1363 case type::mask:
1364 { 1364 {
1365 const mask_type& mm = mpark::get<mask_type>(variant_); 1365 const mask_type& mm = std::get<mask_type>(variant_);
1366 1366
1367 filter subfilter = mm.subfilter->compact(); 1367 filter subfilter = mm.subfilter->compact();
1368 1368
diff --git a/lib/filter.h b/lib/filter.h index 7db2773..6da30dd 100644 --- a/lib/filter.h +++ b/lib/filter.h
@@ -4,7 +4,7 @@
4#include <list> 4#include <list>
5#include <string> 5#include <string>
6#include <memory> 6#include <memory>
7#include "../vendor/hkutil/vendor/variant.hpp" 7#include <variant>
8#include "../vendor/hkutil/hkutil/recptr.h" 8#include "../vendor/hkutil/hkutil/recptr.h"
9#include "field.h" 9#include "field.h"
10#include "enums.h" 10#include "enums.h"
@@ -133,8 +133,8 @@ namespace verbly {
133 field filterField; 133 field filterField;
134 comparison filterType; 134 comparison filterType;
135 135
136 mpark::variant< 136 std::variant<
137 mpark::monostate, 137 std::monostate,
138 rec_filter, 138 rec_filter,
139 std::string, 139 std::string,
140 int, 140 int,
@@ -154,8 +154,8 @@ namespace verbly {
154 }; 154 };
155 155
156 using variant_type = 156 using variant_type =
157 mpark::variant< 157 std::variant<
158 mpark::monostate, 158 std::monostate,
159 singleton_type, 159 singleton_type,
160 group_type, 160 group_type,
161 mask_type>; 161 mask_type>;
diff --git a/lib/form.cpp b/lib/form.cpp index 06a00b9..256dc59 100644 --- a/lib/form.cpp +++ b/lib/form.cpp
@@ -30,11 +30,11 @@ namespace verbly {
30 30
31 form::form(const database& db, hatkirby::row row) : valid_(true) 31 form::form(const database& db, hatkirby::row row) : valid_(true)
32 { 32 {
33 id_ = mpark::get<int>(row[0]); 33 id_ = std::get<int>(row[0]);
34 text_ = mpark::get<std::string>(row[1]); 34 text_ = std::get<std::string>(row[1]);
35 complexity_ = mpark::get<int>(row[2]); 35 complexity_ = std::get<int>(row[2]);
36 proper_ = (mpark::get<int>(row[3]) == 1); 36 proper_ = (std::get<int>(row[3]) == 1);
37 length_ = mpark::get<int>(row[4]); 37 length_ = std::get<int>(row[4]);
38 38
39 pronunciations_ = db.pronunciations(*this, pronunciation::id, -1).all(); 39 pronunciations_ = db.pronunciations(*this, pronunciation::id, -1).all();
40 } 40 }
diff --git a/lib/frame.cpp b/lib/frame.cpp index 51d6936..2a07e5f 100644 --- a/lib/frame.cpp +++ b/lib/frame.cpp
@@ -25,9 +25,9 @@ namespace verbly {
25 25
26 frame::frame(const database& db, hatkirby::row row) : valid_(true) 26 frame::frame(const database& db, hatkirby::row row) : valid_(true)
27 { 27 {
28 id_ = mpark::get<int>(row[0]); 28 id_ = std::get<int>(row[0]);
29 groupId_ = mpark::get<int>(row[1]); 29 groupId_ = std::get<int>(row[1]);
30 length_ = mpark::get<int>(row[2]); 30 length_ = std::get<int>(row[2]);
31 31
32 parts_ = db.parts(*this, verbly::part::index, -1).all(); 32 parts_ = db.parts(*this, verbly::part::index, -1).all();
33 } 33 }
diff --git a/lib/notion.cpp b/lib/notion.cpp index 733c852..94a5194 100644 --- a/lib/notion.cpp +++ b/lib/notion.cpp
@@ -60,19 +60,19 @@ namespace verbly {
60 60
61 notion::notion(const database& db, hatkirby::row row) : valid_(true) 61 notion::notion(const database& db, hatkirby::row row) : valid_(true)
62 { 62 {
63 id_ = mpark::get<int>(row[0]); 63 id_ = std::get<int>(row[0]);
64 partOfSpeech_ = static_cast<part_of_speech>(mpark::get<int>(row[1])); 64 partOfSpeech_ = static_cast<part_of_speech>(std::get<int>(row[1]));
65 65
66 if (!mpark::holds_alternative<std::nullptr_t>(row[2])) 66 if (!std::holds_alternative<std::nullptr_t>(row[2]))
67 { 67 {
68 hasWnid_ = true; 68 hasWnid_ = true;
69 wnid_ = mpark::get<int>(row[2]); 69 wnid_ = std::get<int>(row[2]);
70 } 70 }
71 71
72 if (!mpark::holds_alternative<std::nullptr_t>(row[3])) 72 if (!std::holds_alternative<std::nullptr_t>(row[3]))
73 { 73 {
74 hasNumOfImages_ = true; 74 hasNumOfImages_ = true;
75 numOfImages_ = mpark::get<int>(row[3]); 75 numOfImages_ = std::get<int>(row[3]);
76 } 76 }
77 } 77 }
78 78
diff --git a/lib/part.cpp b/lib/part.cpp index bd8501a..2f9db87 100644 --- a/lib/part.cpp +++ b/lib/part.cpp
@@ -76,16 +76,16 @@ namespace verbly {
76 76
77 part::part(const database& db, hatkirby::row row) 77 part::part(const database& db, hatkirby::row row)
78 { 78 {
79 int id = mpark::get<int>(row[0]); 79 int id = std::get<int>(row[0]);
80 80
81 type_ = static_cast<part_type>(mpark::get<int>(row[3])); 81 type_ = static_cast<part_type>(std::get<int>(row[3]));
82 82
83 switch (type_) 83 switch (type_)
84 { 84 {
85 case part_type::noun_phrase: 85 case part_type::noun_phrase:
86 { 86 {
87 variant_ = np_type { 87 variant_ = np_type {
88 mpark::get<std::string>(row[4]), 88 std::get<std::string>(row[4]),
89 db.selrestrs(id), 89 db.selrestrs(id),
90 db.synrestrs(id) 90 db.synrestrs(id)
91 }; 91 };
@@ -96,7 +96,7 @@ namespace verbly {
96 case part_type::preposition: 96 case part_type::preposition:
97 { 97 {
98 hatkirby::blob_type raw = 98 hatkirby::blob_type raw =
99 mpark::get<hatkirby::blob_type>(row[5]); 99 std::get<hatkirby::blob_type>(row[5]);
100 100
101 std::string serializedChoices( 101 std::string serializedChoices(
102 std::begin(raw), 102 std::begin(raw),
@@ -106,7 +106,7 @@ namespace verbly {
106 hatkirby::split<std::vector<std::string>>( 106 hatkirby::split<std::vector<std::string>>(
107 std::move(serializedChoices), 107 std::move(serializedChoices),
108 ","), 108 ","),
109 (mpark::get<int>(row[6]) == 1) 109 (std::get<int>(row[6]) == 1)
110 }; 110 };
111 111
112 break; 112 break;
@@ -114,7 +114,7 @@ namespace verbly {
114 114
115 case part_type::literal: 115 case part_type::literal:
116 { 116 {
117 variant_ = mpark::get<std::string>(row[7]); 117 variant_ = std::get<std::string>(row[7]);
118 118
119 break; 119 break;
120 } 120 }
@@ -136,7 +136,7 @@ namespace verbly {
136 throw std::domain_error("part is not a noun phrase"); 136 throw std::domain_error("part is not a noun phrase");
137 } 137 }
138 138
139 return mpark::get<np_type>(variant_).role; 139 return std::get<np_type>(variant_).role;
140 } 140 }
141 141
142 const std::set<std::string>& part::getNounSelrestrs() const 142 const std::set<std::string>& part::getNounSelrestrs() const
@@ -146,7 +146,7 @@ namespace verbly {
146 throw std::domain_error("part is not a noun phrase"); 146 throw std::domain_error("part is not a noun phrase");
147 } 147 }
148 148
149 return mpark::get<np_type>(variant_).selrestrs; 149 return std::get<np_type>(variant_).selrestrs;
150 } 150 }
151 151
152 const std::set<std::string>& part::getNounSynrestrs() const 152 const std::set<std::string>& part::getNounSynrestrs() const
@@ -156,7 +156,7 @@ namespace verbly {
156 throw std::domain_error("part is not a noun phrase"); 156 throw std::domain_error("part is not a noun phrase");
157 } 157 }
158 158
159 return mpark::get<np_type>(variant_).synrestrs; 159 return std::get<np_type>(variant_).synrestrs;
160 } 160 }
161 161
162 bool part::nounHasSynrestr(std::string synrestr) const 162 bool part::nounHasSynrestr(std::string synrestr) const
@@ -166,7 +166,7 @@ namespace verbly {
166 throw std::domain_error("part is not a noun phrase"); 166 throw std::domain_error("part is not a noun phrase");
167 } 167 }
168 168
169 return mpark::get<np_type>(variant_).synrestrs.count(synrestr); 169 return std::get<np_type>(variant_).synrestrs.count(synrestr);
170 } 170 }
171 171
172 const std::vector<std::string>& part::getPrepositionChoices() const 172 const std::vector<std::string>& part::getPrepositionChoices() const
@@ -176,7 +176,7 @@ namespace verbly {
176 throw std::domain_error("part is not a preposition"); 176 throw std::domain_error("part is not a preposition");
177 } 177 }
178 178
179 return mpark::get<prep_type>(variant_).choices; 179 return std::get<prep_type>(variant_).choices;
180 } 180 }
181 181
182 bool part::isPrepositionLiteral() const 182 bool part::isPrepositionLiteral() const
@@ -186,7 +186,7 @@ namespace verbly {
186 throw std::domain_error("part is not a preposition"); 186 throw std::domain_error("part is not a preposition");
187 } 187 }
188 188
189 return mpark::get<prep_type>(variant_).literal; 189 return std::get<prep_type>(variant_).literal;
190 } 190 }
191 191
192 const std::string& part::getLiteralValue() const 192 const std::string& part::getLiteralValue() const
@@ -196,7 +196,7 @@ namespace verbly {
196 throw std::domain_error("part is not a literal"); 196 throw std::domain_error("part is not a literal");
197 } 197 }
198 198
199 return mpark::get<std::string>(variant_); 199 return std::get<std::string>(variant_);
200 } 200 }
201 201
202 filter part::synrestr_field::operator%=(std::string synrestr) const 202 filter part::synrestr_field::operator%=(std::string synrestr) const
diff --git a/lib/part.h b/lib/part.h index 7783a61..a2d3667 100644 --- a/lib/part.h +++ b/lib/part.h
@@ -6,7 +6,7 @@
6#include <set> 6#include <set>
7#include <list> 7#include <list>
8#include <hkutil/database.h> 8#include <hkutil/database.h>
9#include <variant.hpp> 9#include <variant>
10#include "field.h" 10#include "field.h"
11#include "filter.h" 11#include "filter.h"
12#include "enums.h" 12#include "enums.h"
@@ -129,8 +129,8 @@ namespace verbly {
129 }; 129 };
130 130
131 using variant_type = 131 using variant_type =
132 mpark::variant< 132 std::variant<
133 mpark::monostate, 133 std::monostate,
134 np_type, 134 np_type,
135 prep_type, 135 prep_type,
136 std::string>; 136 std::string>;
diff --git a/lib/pronunciation.cpp b/lib/pronunciation.cpp index 856f891..b039da8 100644 --- a/lib/pronunciation.cpp +++ b/lib/pronunciation.cpp
@@ -31,22 +31,22 @@ namespace verbly {
31 hatkirby::row row) : 31 hatkirby::row row) :
32 valid_(true) 32 valid_(true)
33 { 33 {
34 id_ = mpark::get<int>(row[0]); 34 id_ = std::get<int>(row[0]);
35 35
36 phonemes_ = 36 phonemes_ =
37 hatkirby::split<std::vector<std::string>>( 37 hatkirby::split<std::vector<std::string>>(
38 mpark::get<std::string>(row[1]), 38 std::get<std::string>(row[1]),
39 " "); 39 " ");
40 40
41 syllables_ = mpark::get<int>(row[2]); 41 syllables_ = std::get<int>(row[2]);
42 stress_ = mpark::get<std::string>(row[3]); 42 stress_ = std::get<std::string>(row[3]);
43 43
44 if (!mpark::holds_alternative<std::nullptr_t>(row[5])) 44 if (!std::holds_alternative<std::nullptr_t>(row[5]))
45 { 45 {
46 hasRhyme_ = true; 46 hasRhyme_ = true;
47 47
48 prerhyme_ = mpark::get<std::string>(row[4]); 48 prerhyme_ = std::get<std::string>(row[4]);
49 rhyme_ = mpark::get<std::string>(row[5]); 49 rhyme_ = std::get<std::string>(row[5]);
50 } 50 }
51 } 51 }
52 52
diff --git a/lib/statement.cpp b/lib/statement.cpp index 669dc2a..3440acb 100644 --- a/lib/statement.cpp +++ b/lib/statement.cpp
@@ -800,7 +800,7 @@ namespace verbly {
800 800
801 case type::singleton: 801 case type::singleton:
802 { 802 {
803 const singleton_type& singleton = mpark::get<singleton_type>(variant_); 803 const singleton_type& singleton = std::get<singleton_type>(variant_);
804 804
805 sql << singleton.table << "." << singleton.column; 805 sql << singleton.table << "." << singleton.column;
806 806
@@ -816,20 +816,20 @@ namespace verbly {
816 sql << " != "; 816 sql << " != ";
817 } 817 }
818 818
819 if (mpark::holds_alternative<field_binding>(singleton.value)) 819 if (std::holds_alternative<field_binding>(singleton.value))
820 { 820 {
821 sql << std::get<0>(mpark::get<field_binding>(singleton.value)) 821 sql << std::get<0>(std::get<field_binding>(singleton.value))
822 << "." 822 << "."
823 << std::get<1>(mpark::get<field_binding>(singleton.value)); 823 << std::get<1>(std::get<field_binding>(singleton.value));
824 } else if (debug) 824 } else if (debug)
825 { 825 {
826 if (mpark::holds_alternative<std::string>(singleton.value)) 826 if (std::holds_alternative<std::string>(singleton.value))
827 { 827 {
828 sql << "\"" << mpark::get<std::string>(singleton.value) << "\""; 828 sql << "\"" << std::get<std::string>(singleton.value) << "\"";
829 } 829 }
830 else if (mpark::holds_alternative<int>(singleton.value)) 830 else if (std::holds_alternative<int>(singleton.value))
831 { 831 {
832 sql << mpark::get<int>(singleton.value); 832 sql << std::get<int>(singleton.value);
833 } 833 }
834 } else { 834 } else {
835 sql << "?"; 835 sql << "?";
@@ -844,7 +844,7 @@ namespace verbly {
844 844
845 if (debug) 845 if (debug)
846 { 846 {
847 sql << mpark::get<int>(singleton.value); 847 sql << std::get<int>(singleton.value);
848 } else { 848 } else {
849 sql << "?"; 849 sql << "?";
850 } 850 }
@@ -858,7 +858,7 @@ namespace verbly {
858 858
859 if (debug) 859 if (debug)
860 { 860 {
861 sql << mpark::get<int>(singleton.value); 861 sql << std::get<int>(singleton.value);
862 } else { 862 } else {
863 sql << "?"; 863 sql << "?";
864 } 864 }
@@ -872,7 +872,7 @@ namespace verbly {
872 872
873 if (debug) 873 if (debug)
874 { 874 {
875 sql << mpark::get<int>(singleton.value); 875 sql << std::get<int>(singleton.value);
876 } else { 876 } else {
877 sql << "?"; 877 sql << "?";
878 } 878 }
@@ -886,7 +886,7 @@ namespace verbly {
886 886
887 if (debug) 887 if (debug)
888 { 888 {
889 sql << mpark::get<int>(singleton.value); 889 sql << std::get<int>(singleton.value);
890 } else { 890 } else {
891 sql << "?"; 891 sql << "?";
892 } 892 }
@@ -900,7 +900,7 @@ namespace verbly {
900 900
901 if (debug) 901 if (debug)
902 { 902 {
903 sql << "\"" << mpark::get<std::string>(singleton.value) << "\""; 903 sql << "\"" << std::get<std::string>(singleton.value) << "\"";
904 } else { 904 } else {
905 sql << "?"; 905 sql << "?";
906 } 906 }
@@ -914,7 +914,7 @@ namespace verbly {
914 914
915 if (debug) 915 if (debug)
916 { 916 {
917 sql << "\"" << mpark::get<std::string>(singleton.value) << "\""; 917 sql << "\"" << std::get<std::string>(singleton.value) << "\"";
918 } else { 918 } else {
919 sql << "?"; 919 sql << "?";
920 } 920 }
@@ -942,7 +942,7 @@ namespace verbly {
942 942
943 case type::group: 943 case type::group:
944 { 944 {
945 const group_type& group = mpark::get<group_type>(variant_); 945 const group_type& group = std::get<group_type>(variant_);
946 946
947 std::list<std::string> clauses; 947 std::list<std::string> clauses;
948 for (const condition& cond : group.children) 948 for (const condition& cond : group.children)
@@ -990,14 +990,14 @@ namespace verbly {
990 990
991 case type::singleton: 991 case type::singleton:
992 { 992 {
993 const singleton_type& singleton = mpark::get<singleton_type>(variant_); 993 const singleton_type& singleton = std::get<singleton_type>(variant_);
994 994
995 if (mpark::holds_alternative<std::string>(singleton.value)) 995 if (std::holds_alternative<std::string>(singleton.value))
996 { 996 {
997 return {{ mpark::get<std::string>(singleton.value) }}; 997 return {{ std::get<std::string>(singleton.value) }};
998 } else if (mpark::holds_alternative<int>(singleton.value)) 998 } else if (std::holds_alternative<int>(singleton.value))
999 { 999 {
1000 return {{ mpark::get<int>(singleton.value) }}; 1000 return {{ std::get<int>(singleton.value) }};
1001 } else { 1001 } else {
1002 return {}; 1002 return {};
1003 } 1003 }
@@ -1005,7 +1005,7 @@ namespace verbly {
1005 1005
1006 case type::group: 1006 case type::group:
1007 { 1007 {
1008 const group_type& group = mpark::get<group_type>(variant_); 1008 const group_type& group = std::get<group_type>(variant_);
1009 1009
1010 std::list<hatkirby::binding> bindings; 1010 std::list<hatkirby::binding> bindings;
1011 for (const condition& cond : group.children) 1011 for (const condition& cond : group.children)
@@ -1035,7 +1035,7 @@ namespace verbly {
1035 throw std::domain_error("Cannot add condition to non-group condition"); 1035 throw std::domain_error("Cannot add condition to non-group condition");
1036 } 1036 }
1037 1037
1038 group_type& group = mpark::get<group_type>(variant_); 1038 group_type& group = std::get<group_type>(variant_);
1039 group.children.emplace_back(std::move(n)); 1039 group.children.emplace_back(std::move(n));
1040 1040
1041 return *this; 1041 return *this;
@@ -1082,7 +1082,7 @@ namespace verbly {
1082 throw std::domain_error("Cannot get children of non-group condition"); 1082 throw std::domain_error("Cannot get children of non-group condition");
1083 } 1083 }
1084 1084
1085 const group_type& group = mpark::get<group_type>(variant_); 1085 const group_type& group = std::get<group_type>(variant_);
1086 1086
1087 return group.children; 1087 return group.children;
1088 } 1088 }
@@ -1099,7 +1099,7 @@ namespace verbly {
1099 1099
1100 case type::group: 1100 case type::group:
1101 { 1101 {
1102 const group_type& group = mpark::get<group_type>(variant_); 1102 const group_type& group = std::get<group_type>(variant_);
1103 1103
1104 condition result(group.orlogic); 1104 condition result(group.orlogic);
1105 1105
@@ -1110,7 +1110,7 @@ namespace verbly {
1110 if (newChild.type_ == type::group) 1110 if (newChild.type_ == type::group)
1111 { 1111 {
1112 group_type& childGroup = 1112 group_type& childGroup =
1113 mpark::get<group_type>(newChild.variant_); 1113 std::get<group_type>(newChild.variant_);
1114 1114
1115 if (childGroup.orlogic == group.orlogic) 1115 if (childGroup.orlogic == group.orlogic)
1116 { 1116 {
@@ -1144,7 +1144,7 @@ namespace verbly {
1144 1144
1145 case type::singleton: 1145 case type::singleton:
1146 { 1146 {
1147 const singleton_type& singleton = mpark::get<singleton_type>(variant_); 1147 const singleton_type& singleton = std::get<singleton_type>(variant_);
1148 1148
1149 if (singleton.parentObject != object::undefined && 1149 if (singleton.parentObject != object::undefined &&
1150 singleton.parentObject == context) 1150 singleton.parentObject == context)
@@ -1155,7 +1155,7 @@ namespace verbly {
1155 singleton.comparison, 1155 singleton.comparison,
1156 field_binding { 1156 field_binding {
1157 tableName, 1157 tableName,
1158 std::get<1>(mpark::get<field_binding>(singleton.value)) 1158 std::get<1>(std::get<field_binding>(singleton.value))
1159 } 1159 }
1160 }; 1160 };
1161 } else { 1161 } else {
@@ -1165,7 +1165,7 @@ namespace verbly {
1165 1165
1166 case type::group: 1166 case type::group:
1167 { 1167 {
1168 const group_type& group = mpark::get<group_type>(variant_); 1168 const group_type& group = std::get<group_type>(variant_);
1169 1169
1170 condition result(group.orlogic); 1170 condition result(group.orlogic);
1171 for (const condition& cond : group.children) 1171 for (const condition& cond : group.children)
diff --git a/lib/statement.h b/lib/statement.h index 6c2e42e..632807f 100644 --- a/lib/statement.h +++ b/lib/statement.h
@@ -5,7 +5,7 @@
5#include <list> 5#include <list>
6#include <map> 6#include <map>
7#include <hkutil/database.h> 7#include <hkutil/database.h>
8#include <variant.hpp> 8#include <variant>
9#include "enums.h" 9#include "enums.h"
10#include "field.h" 10#include "field.h"
11#include "filter.h" 11#include "filter.h"
@@ -19,8 +19,8 @@ namespace verbly {
19 std::tuple<std::string, std::string>; 19 std::tuple<std::string, std::string>;
20 20
21 using binding = 21 using binding =
22 mpark::variant< 22 std::variant<
23 mpark::monostate, 23 std::monostate,
24 std::string, 24 std::string,
25 int, 25 int,
26 field_binding>; 26 field_binding>;
@@ -185,8 +185,8 @@ namespace verbly {
185 }; 185 };
186 186
187 using variant_type = 187 using variant_type =
188 mpark::variant< 188 std::variant<
189 mpark::monostate, 189 std::monostate,
190 singleton_type, 190 singleton_type,
191 group_type>; 191 group_type>;
192 192
diff --git a/lib/token.cpp b/lib/token.cpp index b3c7062..6b78f53 100644 --- a/lib/token.cpp +++ b/lib/token.cpp
@@ -23,7 +23,7 @@ namespace verbly {
23 23
24 case type::utterance: 24 case type::utterance:
25 { 25 {
26 const utterance_type& utterance = mpark::get<utterance_type>(variant_); 26 const utterance_type& utterance = std::get<utterance_type>(variant_);
27 27
28 return std::all_of( 28 return std::all_of(
29 std::begin(utterance), 29 std::begin(utterance),
@@ -35,7 +35,7 @@ namespace verbly {
35 35
36 case type::transform: 36 case type::transform:
37 { 37 {
38 const transform_type& transform = mpark::get<transform_type>(variant_); 38 const transform_type& transform = std::get<transform_type>(variant_);
39 39
40 return transform.inner->isComplete(); 40 return transform.inner->isComplete();
41 } 41 }
@@ -56,7 +56,7 @@ namespace verbly {
56 { 56 {
57 case type::word: 57 case type::word:
58 { 58 {
59 const word_type& w = mpark::get<word_type>(variant_); 59 const word_type& w = std::get<word_type>(variant_);
60 60
61 const form& wordForm = w.value.getInflections(w.category).front(); 61 const form& wordForm = w.value.getInflections(w.category).front();
62 62
@@ -108,7 +108,7 @@ namespace verbly {
108 108
109 case type::literal: 109 case type::literal:
110 { 110 {
111 std::string result = mpark::get<literal_type>(variant_); 111 std::string result = std::get<literal_type>(variant_);
112 112
113 if (indefiniteArticle && std::isalpha(result[0])) 113 if (indefiniteArticle && std::isalpha(result[0]))
114 { 114 {
@@ -164,7 +164,7 @@ namespace verbly {
164 164
165 case type::utterance: 165 case type::utterance:
166 { 166 {
167 const utterance_type& utterance = mpark::get<utterance_type>(variant_); 167 const utterance_type& utterance = std::get<utterance_type>(variant_);
168 168
169 bool first = true; 169 bool first = true;
170 std::list<std::string> compiled; 170 std::list<std::string> compiled;
@@ -192,7 +192,7 @@ namespace verbly {
192 192
193 case type::transform: 193 case type::transform:
194 { 194 {
195 const transform_type& transform = mpark::get<transform_type>(variant_); 195 const transform_type& transform = std::get<transform_type>(variant_);
196 196
197 switch (transform.type) 197 switch (transform.type)
198 { 198 {
@@ -257,7 +257,7 @@ namespace verbly {
257 throw std::domain_error("Token is not a word"); 257 throw std::domain_error("Token is not a word");
258 } 258 }
259 259
260 return mpark::get<word_type>(variant_).value; 260 return std::get<word_type>(variant_).value;
261 } 261 }
262 262
263 token token::inflect(inflection category) const 263 token token::inflect(inflection category) const
@@ -268,7 +268,7 @@ namespace verbly {
268 } 268 }
269 269
270 return { 270 return {
271 mpark::get<word_type>(variant_).value, 271 std::get<word_type>(variant_).value,
272 category 272 category
273 }; 273 };
274 } 274 }
@@ -293,7 +293,7 @@ namespace verbly {
293 throw std::domain_error("Token is not a literal"); 293 throw std::domain_error("Token is not a literal");
294 } 294 }
295 295
296 return mpark::get<literal_type>(variant_); 296 return std::get<literal_type>(variant_);
297 } 297 }
298 298
299 token::token( 299 token::token(
@@ -310,7 +310,7 @@ namespace verbly {
310 throw std::domain_error("Token is not a part"); 310 throw std::domain_error("Token is not a part");
311 } 311 }
312 312
313 return mpark::get<part>(variant_); 313 return std::get<part>(variant_);
314 } 314 }
315 315
316 token::token( 316 token::token(
@@ -327,7 +327,7 @@ namespace verbly {
327 throw std::domain_error("Token is not a fillin"); 327 throw std::domain_error("Token is not a fillin");
328 } 328 }
329 329
330 return mpark::get<fillin_type>(variant_); 330 return std::get<fillin_type>(variant_);
331 } 331 }
332 332
333 bool token::hasSynrestr(std::string synrestr) const 333 bool token::hasSynrestr(std::string synrestr) const
@@ -337,7 +337,7 @@ namespace verbly {
337 throw std::domain_error("Token is not a fillin"); 337 throw std::domain_error("Token is not a fillin");
338 } 338 }
339 339
340 return mpark::get<fillin_type>(variant_).count(synrestr); 340 return std::get<fillin_type>(variant_).count(synrestr);
341 } 341 }
342 342
343 void token::addSynrestr(std::string synrestr) 343 void token::addSynrestr(std::string synrestr)
@@ -347,7 +347,7 @@ namespace verbly {
347 throw std::domain_error("Token is not a fillin"); 347 throw std::domain_error("Token is not a fillin");
348 } 348 }
349 349
350 fillin_type& fillin = mpark::get<fillin_type>(variant_); 350 fillin_type& fillin = std::get<fillin_type>(variant_);
351 fillin.insert(std::move(synrestr)); 351 fillin.insert(std::move(synrestr));
352 } 352 }
353 353
@@ -378,7 +378,7 @@ namespace verbly {
378 throw std::domain_error("Token is not an utterance"); 378 throw std::domain_error("Token is not an utterance");
379 } 379 }
380 380
381 return std::begin(mpark::get<utterance_type>(variant_)); 381 return std::begin(std::get<utterance_type>(variant_));
382 } 382 }
383 383
384 token::const_iterator token::begin() const 384 token::const_iterator token::begin() const
@@ -388,7 +388,7 @@ namespace verbly {
388 throw std::domain_error("Token is not an utterance"); 388 throw std::domain_error("Token is not an utterance");
389 } 389 }
390 390
391 return std::begin(mpark::get<utterance_type>(variant_)); 391 return std::begin(std::get<utterance_type>(variant_));
392 } 392 }
393 393
394 token::iterator token::end() 394 token::iterator token::end()
@@ -398,7 +398,7 @@ namespace verbly {
398 throw std::domain_error("Token is not an utterance"); 398 throw std::domain_error("Token is not an utterance");
399 } 399 }
400 400
401 return std::end(mpark::get<utterance_type>(variant_)); 401 return std::end(std::get<utterance_type>(variant_));
402 } 402 }
403 403
404 token::const_iterator token::end() const 404 token::const_iterator token::end() const
@@ -408,7 +408,7 @@ namespace verbly {
408 throw std::domain_error("Token is not an utterance"); 408 throw std::domain_error("Token is not an utterance");
409 } 409 }
410 410
411 return std::end(mpark::get<utterance_type>(variant_)); 411 return std::end(std::get<utterance_type>(variant_));
412 } 412 }
413 413
414 token& token::operator<<(token arg) 414 token& token::operator<<(token arg)
@@ -418,7 +418,7 @@ namespace verbly {
418 throw std::domain_error("Token is not an utterance"); 418 throw std::domain_error("Token is not an utterance");
419 } 419 }
420 420
421 utterance_type& utterance = mpark::get<utterance_type>(variant_); 421 utterance_type& utterance = std::get<utterance_type>(variant_);
422 utterance.push_back(std::move(arg)); 422 utterance.push_back(std::move(arg));
423 423
424 return *this; 424 return *this;
@@ -460,7 +460,7 @@ namespace verbly {
460 throw std::domain_error("Invalid access on non-tranform token"); 460 throw std::domain_error("Invalid access on non-tranform token");
461 } 461 }
462 462
463 return *mpark::get<transform_type>(variant_).inner; 463 return *std::get<transform_type>(variant_).inner;
464 } 464 }
465 465
466 const token& token::getInnerToken() const 466 const token& token::getInnerToken() const
@@ -470,7 +470,7 @@ namespace verbly {
470 throw std::domain_error("Invalid access on non-tranform token"); 470 throw std::domain_error("Invalid access on non-tranform token");
471 } 471 }
472 472
473 return *mpark::get<transform_type>(variant_).inner; 473 return *std::get<transform_type>(variant_).inner;
474 } 474 }
475 475
476 token::token( 476 token::token(
diff --git a/lib/token.h b/lib/token.h index 910a465..a18fe42 100644 --- a/lib/token.h +++ b/lib/token.h
@@ -5,7 +5,7 @@
5#include <string> 5#include <string>
6#include <list> 6#include <list>
7#include <set> 7#include <set>
8#include <variant.hpp> 8#include <variant>
9#include <hkutil/recptr.h> 9#include <hkutil/recptr.h>
10#include "enums.h" 10#include "enums.h"
11#include "word.h" 11#include "word.h"
@@ -38,7 +38,7 @@ namespace verbly {
38 bool isEmpty() const 38 bool isEmpty() const
39 { 39 {
40 return (type_ == type::utterance && 40 return (type_ == type::utterance &&
41 mpark::get<utterance_type>(variant_).empty()); 41 std::get<utterance_type>(variant_).empty());
42 } 42 }
43 43
44 // Word 44 // Word
@@ -153,7 +153,7 @@ namespace verbly {
153 }; 153 };
154 154
155 using variant_type = 155 using variant_type =
156 mpark::variant< 156 std::variant<
157 word_type, 157 word_type,
158 literal_type, 158 literal_type,
159 part, 159 part,
diff --git a/lib/word.cpp b/lib/word.cpp index 2fccb9f..5df9ba1 100644 --- a/lib/word.cpp +++ b/lib/word.cpp
@@ -46,22 +46,22 @@ namespace verbly {
46 46
47 word::word(const database& db, hatkirby::row row) : db_(&db), valid_(true) 47 word::word(const database& db, hatkirby::row row) : db_(&db), valid_(true)
48 { 48 {
49 id_ = mpark::get<int>(row[0]); 49 id_ = std::get<int>(row[0]);
50 50
51 notion_ = db.notions(notion::id == mpark::get<int>(row[1])).first(); 51 notion_ = db.notions(notion::id == std::get<int>(row[1])).first();
52 52
53 if (!mpark::holds_alternative<std::nullptr_t>(row[3])) 53 if (!std::holds_alternative<std::nullptr_t>(row[3]))
54 { 54 {
55 hasTagCount_ = true; 55 hasTagCount_ = true;
56 tagCount_ = mpark::get<int>(row[3]); 56 tagCount_ = std::get<int>(row[3]);
57 } 57 }
58 58
59 if (!mpark::holds_alternative<std::nullptr_t>(row[4])) 59 if (!std::holds_alternative<std::nullptr_t>(row[4]))
60 { 60 {
61 adjectivePosition_ = static_cast<positioning>(mpark::get<int>(row[4])); 61 adjectivePosition_ = static_cast<positioning>(std::get<int>(row[4]));
62 } 62 }
63 63
64 if (!mpark::holds_alternative<std::nullptr_t>(row[5])) 64 if (!std::holds_alternative<std::nullptr_t>(row[5]))
65 { 65 {
66 frames_ = db.frames(*this).all(); 66 frames_ = db.frames(*this).all();
67 } 67 }