Permalink
Browse files

semdiff: drop metadata directive on the floor

Summary:
the .metadata directive allows us to persist
arbitrary information into the repo. This is used for things
like storing the compiler version (and possibly other things)

Reviewed By: nbenton

Differential Revision: D6982353

fbshipit-source-id: f8c580ca512202043608f40400597ac93c2095fa
  • Loading branch information...
Greg Nisbet authored and hhvm-bot committed Feb 14, 2018
1 parent 7c3f922 commit dadce53fd29eee9b8d515cf7de25376c56de6b8a
@@ -93,6 +93,7 @@ rule read =
| ".require" {REQUIREDIRECTIVE}
| ".srcloc" {SRCLOCDIRECTIVE}
| assertconstraint {ASSERTCONSTRAINT (Lexing.lexeme lexbuf)}
| ".metadata" {METADATADIRECTIVE}
| id {ID (Lexing.lexeme lexbuf)}
| triplequoted as lxm {TRIPLEQUOTEDSTRING (String.sub lxm 3 (String.length lxm - 6))}
| escapequote {read_php_escaped_string (Buffer.create 17) lexbuf}
@@ -29,6 +29,7 @@ open Hhas_parser_actions
%token TRYFAULTDIRECTIVE PROPERTYDIRECTIVE FILEPATHDIRECTIVE
%token ISMEMOIZEWRAPPERDIRECTIVE STATICDIRECTIVE REQUIREDIRECTIVE
%token SRCLOCDIRECTIVE
%token METADATADIRECTIVE
%token LANGLE
%token RANGLE
%token COLONCOLON
@@ -290,6 +291,13 @@ srcloc:
| SRCLOCDIRECTIVE INT COLON INT COMMA INT COLON INT SEMI
{ (($2, $4), ($6, $8)) }
;
metadata:
| METADATADIRECTIVE ID EQUALS ID SEMI nl { (* do nothing *) }
| METADATADIRECTIVE ID EQUALS STRING SEMI nl { (* do nothing *) }
| METADATADIRECTIVE ID EQUALS TRIPLEQUOTEDSTRING SEMI nl { (* do nothing *) }
;
staticdirective:
| STATICDIRECTIVE VNAME EQUALS ID
{ ($2, $4) }
@@ -561,6 +569,7 @@ decllist:
| FILEPATHDIRECTIVE STRING SEMI nl decllist {$5}
| STRICTDIRECTIVE INT SEMI nl decllist { StrictTypes_decl ($2 = 1L) :: $5}
| HHFILE INT SEMI nl decllist { HHFile_decl ($2 = 1L) :: $5 }
| metadata decllist { $2 }
;
includesdecl:
| INCLUDESDIRECTIVE {
@@ -0,0 +1,14 @@
# starts here
.filepath "/data/users/gregorynisbet/fbsource/fbcode/hphp/hack/test/semdiff/ignore_metadata_directive.1.hhas";
.metadata a = b;
.hh_file 1;
.main {
Int 1
RetC
}
# /data/users/gregorynisbet/fbsource/fbcode/hphp/hack/test/semdiff/ignore_metadata_directive.1.hhas
@@ -0,0 +1,12 @@
# starts here
.filepath "/data/users/gregorynisbet/fbsource/fbcode/hphp/hack/test/semdiff/ignore_metadata_directive.2.hhas";
.hh_file 1;
.main {
Int 1
RetC
}
# /data/users/gregorynisbet/fbsource/fbcode/hphp/hack/test/semdiff/ignore_metadata_directive.2.hhas

0 comments on commit dadce53

Please sign in to comment.