diff --git a/hphp/compiler/analysis/alias_manager.cpp b/hphp/compiler/analysis/alias_manager.cpp index a1208db15..13e27cc0c 100644 --- a/hphp/compiler/analysis/alias_manager.cpp +++ b/hphp/compiler/analysis/alias_manager.cpp @@ -2003,6 +2003,9 @@ StatementPtr AliasManager::canonicalizeRecur(StatementPtr s, int &ret) { break; } + case Statement::KindOfTypedefStatement: + break; + case Statement::KindOfCatchStatement: clear(); ret = Converge; diff --git a/hphp/compiler/analysis/control_flow.cpp b/hphp/compiler/analysis/control_flow.cpp index 3eb9ba558..5ff53ca68 100644 --- a/hphp/compiler/analysis/control_flow.cpp +++ b/hphp/compiler/analysis/control_flow.cpp @@ -498,6 +498,7 @@ int ControlFlowBuilder::before(ConstructRawPtr cp) { } case Statement::KindOfEchoStatement: + case Statement::KindOfTypedefStatement: break; default: diff --git a/hphp/compiler/option.cpp b/hphp/compiler/option.cpp index e4149adee..20edc596c 100644 --- a/hphp/compiler/option.cpp +++ b/hphp/compiler/option.cpp @@ -278,6 +278,11 @@ void Option::Load(Hdf &config) { EnableShortTags = config["EnableShortTags"].getBool(true); if (EnableShortTags) ScannerType |= Scanner::AllowShortTags; else ScannerType &= ~Scanner::AllowShortTags; + if (EnableHipHopExperimentalSyntax) { + ScannerType |= Scanner::EnableHipHopKeywords; + } else { + ScannerType &= ~Scanner::EnableHipHopKeywords; + } EnableAspTags = config["EnableAspTags"].getBool(); if (EnableAspTags) ScannerType |= Scanner::AllowAspTags; diff --git a/hphp/test/quick/hphp_opts.hip_hop_syntax b/hphp/test/quick/hphp_opts.hip_hop_syntax new file mode 100644 index 000000000..1ccf66361 --- /dev/null +++ b/hphp/test/quick/hphp_opts.hip_hop_syntax @@ -0,0 +1 @@ +-vEnableHipHopSyntax=1 -vEnableHipHopExperimentalSyntax=1 diff --git a/hphp/test/quick/parse_fail_shapes.php.hphp_opts b/hphp/test/quick/parse_fail_shapes.php.hphp_opts new file mode 120000 index 000000000..b194e26af --- /dev/null +++ b/hphp/test/quick/parse_fail_shapes.php.hphp_opts @@ -0,0 +1 @@ +hphp_opts.hip_hop_syntax \ No newline at end of file diff --git a/hphp/test/quick/parse_fail_shapes2.php.hphp_opts b/hphp/test/quick/parse_fail_shapes2.php.hphp_opts new file mode 120000 index 000000000..b194e26af --- /dev/null +++ b/hphp/test/quick/parse_fail_shapes2.php.hphp_opts @@ -0,0 +1 @@ +hphp_opts.hip_hop_syntax \ No newline at end of file diff --git a/hphp/test/quick/parse_shapes.php.hphp_opts b/hphp/test/quick/parse_shapes.php.hphp_opts new file mode 120000 index 000000000..b194e26af --- /dev/null +++ b/hphp/test/quick/parse_shapes.php.hphp_opts @@ -0,0 +1 @@ +hphp_opts.hip_hop_syntax \ No newline at end of file diff --git a/hphp/test/quick/typedef_class.php.hphp_opts b/hphp/test/quick/typedef_class.php.hphp_opts new file mode 120000 index 000000000..b194e26af --- /dev/null +++ b/hphp/test/quick/typedef_class.php.hphp_opts @@ -0,0 +1 @@ +hphp_opts.hip_hop_syntax \ No newline at end of file diff --git a/hphp/test/quick/typedef_class_fail1.php.hphp_opts b/hphp/test/quick/typedef_class_fail1.php.hphp_opts new file mode 120000 index 000000000..b194e26af --- /dev/null +++ b/hphp/test/quick/typedef_class_fail1.php.hphp_opts @@ -0,0 +1 @@ +hphp_opts.hip_hop_syntax \ No newline at end of file diff --git a/hphp/test/quick/typedef_class_fail2.php.hphp_opts b/hphp/test/quick/typedef_class_fail2.php.hphp_opts new file mode 120000 index 000000000..b194e26af --- /dev/null +++ b/hphp/test/quick/typedef_class_fail2.php.hphp_opts @@ -0,0 +1 @@ +hphp_opts.hip_hop_syntax \ No newline at end of file diff --git a/hphp/test/quick/typedef_cyclic.php.hphp_opts b/hphp/test/quick/typedef_cyclic.php.hphp_opts new file mode 120000 index 000000000..b194e26af --- /dev/null +++ b/hphp/test/quick/typedef_cyclic.php.hphp_opts @@ -0,0 +1 @@ +hphp_opts.hip_hop_syntax \ No newline at end of file diff --git a/hphp/test/quick/typedef_duplicate.php.hphp_opts b/hphp/test/quick/typedef_duplicate.php.hphp_opts new file mode 120000 index 000000000..b194e26af --- /dev/null +++ b/hphp/test/quick/typedef_duplicate.php.hphp_opts @@ -0,0 +1 @@ +hphp_opts.hip_hop_syntax \ No newline at end of file diff --git a/hphp/test/quick/typedef_duplicate2.php.hphp_opts b/hphp/test/quick/typedef_duplicate2.php.hphp_opts new file mode 120000 index 000000000..b194e26af --- /dev/null +++ b/hphp/test/quick/typedef_duplicate2.php.hphp_opts @@ -0,0 +1 @@ +hphp_opts.hip_hop_syntax \ No newline at end of file diff --git a/hphp/test/quick/typedef_duplicate3.php.hphp_opts b/hphp/test/quick/typedef_duplicate3.php.hphp_opts new file mode 120000 index 000000000..b194e26af --- /dev/null +++ b/hphp/test/quick/typedef_duplicate3.php.hphp_opts @@ -0,0 +1 @@ +hphp_opts.hip_hop_syntax \ No newline at end of file diff --git a/hphp/test/quick/typedef_duplicate4.php.hphp_opts b/hphp/test/quick/typedef_duplicate4.php.hphp_opts new file mode 120000 index 000000000..b194e26af --- /dev/null +++ b/hphp/test/quick/typedef_duplicate4.php.hphp_opts @@ -0,0 +1 @@ +hphp_opts.hip_hop_syntax \ No newline at end of file diff --git a/hphp/test/quick/typedef_duplicate_ok.php.hphp_opts b/hphp/test/quick/typedef_duplicate_ok.php.hphp_opts new file mode 120000 index 000000000..b194e26af --- /dev/null +++ b/hphp/test/quick/typedef_duplicate_ok.php.hphp_opts @@ -0,0 +1 @@ +hphp_opts.hip_hop_syntax \ No newline at end of file diff --git a/hphp/test/quick/typedef_invalid_name.php.hphp_opts b/hphp/test/quick/typedef_invalid_name.php.hphp_opts new file mode 120000 index 000000000..b194e26af --- /dev/null +++ b/hphp/test/quick/typedef_invalid_name.php.hphp_opts @@ -0,0 +1 @@ +hphp_opts.hip_hop_syntax \ No newline at end of file diff --git a/hphp/test/quick/typedef_mixed_case.php.hphp_opts b/hphp/test/quick/typedef_mixed_case.php.hphp_opts new file mode 120000 index 000000000..b194e26af --- /dev/null +++ b/hphp/test/quick/typedef_mixed_case.php.hphp_opts @@ -0,0 +1 @@ +hphp_opts.hip_hop_syntax \ No newline at end of file diff --git a/hphp/test/quick/typedef_newtype.php.hphp_opts b/hphp/test/quick/typedef_newtype.php.hphp_opts new file mode 120000 index 000000000..b194e26af --- /dev/null +++ b/hphp/test/quick/typedef_newtype.php.hphp_opts @@ -0,0 +1 @@ +hphp_opts.hip_hop_syntax \ No newline at end of file diff --git a/hphp/test/quick/typedef_non_class.php.hphp_opts b/hphp/test/quick/typedef_non_class.php.hphp_opts new file mode 120000 index 000000000..b194e26af --- /dev/null +++ b/hphp/test/quick/typedef_non_class.php.hphp_opts @@ -0,0 +1 @@ +hphp_opts.hip_hop_syntax \ No newline at end of file diff --git a/hphp/test/quick/typedef_non_class_fail1.php.hphp_opts b/hphp/test/quick/typedef_non_class_fail1.php.hphp_opts new file mode 120000 index 000000000..b194e26af --- /dev/null +++ b/hphp/test/quick/typedef_non_class_fail1.php.hphp_opts @@ -0,0 +1 @@ +hphp_opts.hip_hop_syntax \ No newline at end of file diff --git a/hphp/test/quick/typedef_non_class_fail2.php.hphp_opts b/hphp/test/quick/typedef_non_class_fail2.php.hphp_opts new file mode 120000 index 000000000..b194e26af --- /dev/null +++ b/hphp/test/quick/typedef_non_class_fail2.php.hphp_opts @@ -0,0 +1 @@ +hphp_opts.hip_hop_syntax \ No newline at end of file diff --git a/hphp/test/quick/typedef_shape.php.hphp_opts b/hphp/test/quick/typedef_shape.php.hphp_opts new file mode 120000 index 000000000..b194e26af --- /dev/null +++ b/hphp/test/quick/typedef_shape.php.hphp_opts @@ -0,0 +1 @@ +hphp_opts.hip_hop_syntax \ No newline at end of file diff --git a/hphp/test/quick/typedef_to_typedef.php.hphp_opts b/hphp/test/quick/typedef_to_typedef.php.hphp_opts new file mode 120000 index 000000000..b194e26af --- /dev/null +++ b/hphp/test/quick/typedef_to_typedef.php.hphp_opts @@ -0,0 +1 @@ +hphp_opts.hip_hop_syntax \ No newline at end of file