Skip to content

Commit

Permalink
Add code:yytarget_elem to syntax files.
Browse files Browse the repository at this point in the history
code:yytarget_elem specifies the how the table elements for computed
goto tables are generated.  If cgoto:relative = 1, then the table
entries contain an offset from a calculated base address.

Bootstrap code has been regenerate.
  • Loading branch information
caffe3 committed Mar 2, 2025
1 parent afabf6e commit dfe47cc
Show file tree
Hide file tree
Showing 27 changed files with 3,112 additions and 2,974 deletions.
2 changes: 2 additions & 0 deletions bootstrap/src/default_syntax_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,4 +442,6 @@ static constexpr const char* DEFAULT_SYNTAX_C =
"code:yybm_filter = yych \" & ~0xFF\";\n"
"\n"
"code:yybm_match = yybm \"[\" offset \"+\" yych \"] & \" mask;\n"
"\n"
"code:yytarget_elem = (.cgoto.relative ? \"(int)((char*)&&\" : \"&&\") label (.cgoto.relative ? \" - (char*)&&\" base \")\");\n"
;
2 changes: 2 additions & 0 deletions bootstrap/src/default_syntax_d.h
Original file line number Diff line number Diff line change
Expand Up @@ -422,4 +422,6 @@ static constexpr const char* DEFAULT_SYNTAX_D =
"code:yybm_filter = yych \" & ~0xFF\";\n"
"\n"
"code:yybm_match = \"(\" yybm \"[\" offset \"+\" yych \"] & \" mask \") != 0\";\n"
"\n"
"code:yytarget_elem = <undefined>;\n"
;
2 changes: 2 additions & 0 deletions bootstrap/src/default_syntax_go.h
Original file line number Diff line number Diff line change
Expand Up @@ -404,4 +404,6 @@ static constexpr const char* DEFAULT_SYNTAX_GO =
"code:yybm_filter = yych \" & ~0xFF\";\n"
"\n"
"code:yybm_match = \"(\" yybm \"[\" offset \"+\" yych \"] & \" mask \") != 0\";\n"
"\n"
"code:yytarget_elem = <undefined>;\n"
;
2 changes: 2 additions & 0 deletions bootstrap/src/default_syntax_haskell.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,4 +416,6 @@ static constexpr const char* DEFAULT_SYNTAX_HASKELL =
"code:yybm_filter = \"(\" yych \" .&. complement 0xFF) /= 0\";\n"
"\n"
"code:yybm_match = \"(\" yybm \" ! (\" offset \" + fromIntegral \" yych \") .&. \" mask \") /= 0\";\n"
"\n"
"code:yytarget_elem = <undefined>;\n"
;
2 changes: 2 additions & 0 deletions bootstrap/src/default_syntax_java.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,4 +380,6 @@ static constexpr const char* DEFAULT_SYNTAX_JAVA =
"code:yybm_filter = yych \" & ~0xFF\";\n"
"\n"
"code:yybm_match = \"(\" yybm \"[\" offset \"+\" yych \"] & \" mask \") != 0\";\n"
"\n"
"code:yytarget_elem = <undefined>;\n"
;
2 changes: 2 additions & 0 deletions bootstrap/src/default_syntax_js.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,4 +382,6 @@ static constexpr const char* DEFAULT_SYNTAX_JS =
"code:yybm_filter = yych \" & ~0xFF\";\n"
"\n"
"code:yybm_match = \"(\" yybm \"[\" offset \"+\" yych \"] & \" mask \") !== 0\";\n"
"\n"
"code:yytarget_elem = <undefined>;\n"
;
2 changes: 2 additions & 0 deletions bootstrap/src/default_syntax_ocaml.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,4 +395,6 @@ static constexpr const char* DEFAULT_SYNTAX_OCAML =
"code:yybm_filter = yych \" land ~0xFF\";\n"
"\n"
"code:yybm_match = \"(\" yybm \".(\" offset \" + Char.code \" yych \") land \" mask \") != 0\";\n"
"\n"
"code:yytarget_elem = <undefined>;\n"
;
2 changes: 2 additions & 0 deletions bootstrap/src/default_syntax_python.h
Original file line number Diff line number Diff line change
Expand Up @@ -388,4 +388,6 @@ static constexpr const char* DEFAULT_SYNTAX_PYTHON =
"code:yybm_filter = yych \" & ~0xFF\";\n"
"\n"
"code:yybm_match = \"(\" yybm \"[\" offset \"+\" yych \"] & \" mask \") != 0\";\n"
"\n"
"code:yytarget_elem = <undefined>;\n"
;
2 changes: 2 additions & 0 deletions bootstrap/src/default_syntax_rust.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,4 +406,6 @@ static constexpr const char* DEFAULT_SYNTAX_RUST =
"code:yybm_filter = yych \" & ~0xFF\";\n"
"\n"
"code:yybm_match = \"(\" yybm \"[\" offset \"+\" yych \" as usize] & \" mask \") != 0\";\n"
"\n"
"code:yytarget_elem = <undefined>;\n"
;
2 changes: 2 additions & 0 deletions bootstrap/src/default_syntax_v.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,6 @@ static constexpr const char* DEFAULT_SYNTAX_V =
"code:yybm_filter = yych \" & ~0xFF\";\n"
"\n"
"code:yybm_match = \"(\" yybm \"[\" offset \"+\" yych \"] & \" mask \") != 0\";\n"
"\n"
"code:yytarget_elem = <undefined>;\n"
;
2 changes: 2 additions & 0 deletions bootstrap/src/default_syntax_zig.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,4 +418,6 @@ static constexpr const char* DEFAULT_SYNTAX_ZIG =
"code:yybm_filter = yych \" & ~0xFF\";\n"
"\n"
"code:yybm_match = \"(\" yybm \"[\" offset \"+\" yych \"] & \" mask \") != 0\";\n"
"\n"
"code:yytarget_elem = <undefined>;\n"
;
Loading

0 comments on commit dfe47cc

Please sign in to comment.