hclsyntax: update generators to use HCL package path
Since these have Go source code embedded in strings, they were not found during the original big zcl to HCL rename.
This commit is contained in:
parent
678f7e6781
commit
88bf362f0c
@ -89,7 +89,7 @@ const outputPreamble = `package hclsyntax
|
|||||||
// Run 'go generate' on this package to update the set of functions here.
|
// Run 'go generate' on this package to update the set of functions here.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/zclconf/go-zcl/zcl"
|
"github.com/hashicorp/hcl2/hcl"
|
||||||
)`
|
)`
|
||||||
|
|
||||||
const outputMethodFmt = `
|
const outputMethodFmt = `
|
||||||
|
@ -3,7 +3,7 @@ package hclsyntax
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
|
||||||
"github.com/zclconf/go-zcl/zcl"
|
"github.com/hashicorp/hcl2/hcl"
|
||||||
)
|
)
|
||||||
|
|
||||||
// This file is generated from scan_tokens.rl. DO NOT EDIT.
|
// This file is generated from scan_tokens.rl. DO NOT EDIT.
|
||||||
@ -62,15 +62,13 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To
|
|||||||
("/*" any* "*/")
|
("/*" any* "*/")
|
||||||
);
|
);
|
||||||
|
|
||||||
# Tabs are not valid, but we accept them in the scanner and mark them
|
|
||||||
# as tokens so that we can produce diagnostics advising the user to
|
|
||||||
# use spaces instead.
|
|
||||||
Tabs = 0x09+;
|
|
||||||
|
|
||||||
# Note: zclwrite assumes that only ASCII spaces appear between tokens,
|
# Note: zclwrite assumes that only ASCII spaces appear between tokens,
|
||||||
# and uses this assumption to recreate the spaces between tokens by
|
# and uses this assumption to recreate the spaces between tokens by
|
||||||
# looking at byte offset differences.
|
# looking at byte offset differences. This means it will produce
|
||||||
Spaces = ' '+;
|
# incorrect results in the presence of tabs, but that's acceptable
|
||||||
|
# because the canonical style (which zclwrite itself can impose
|
||||||
|
# automatically is to never use tabs).
|
||||||
|
Spaces = (' ' | 0x09)+;
|
||||||
|
|
||||||
action beginStringTemplate {
|
action beginStringTemplate {
|
||||||
token(TokenOQuote);
|
token(TokenOQuote);
|
||||||
@ -264,7 +262,6 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To
|
|||||||
BeginStringTmpl => beginStringTemplate;
|
BeginStringTmpl => beginStringTemplate;
|
||||||
BeginHeredocTmpl => beginHeredocTemplate;
|
BeginHeredocTmpl => beginHeredocTemplate;
|
||||||
|
|
||||||
Tabs => { token(TokenTabs) };
|
|
||||||
BrokenUTF8 => { token(TokenBadUTF8) };
|
BrokenUTF8 => { token(TokenBadUTF8) };
|
||||||
AnyUTF8 => { token(TokenInvalid) };
|
AnyUTF8 => { token(TokenInvalid) };
|
||||||
*|;
|
*|;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
package hclsyntax
|
package hclsyntax
|
||||||
|
|
||||||
import "fmt"
|
import "strconv"
|
||||||
|
|
||||||
const _TokenType_name = "TokenNilTokenNewlineTokenBangTokenPercentTokenBitwiseAndTokenOParenTokenCParenTokenStarTokenPlusTokenCommaTokenMinusTokenDotTokenSlashTokenColonTokenSemicolonTokenLessThanTokenEqualTokenGreaterThanTokenQuestionTokenCommentTokenOHeredocTokenIdentTokenNumberLitTokenQuotedLitTokenStringLitTokenOBrackTokenCBrackTokenBitwiseXorTokenBacktickTokenCHeredocTokenOBraceTokenBitwiseOrTokenCBraceTokenBitwiseNotTokenOQuoteTokenCQuoteTokenTemplateControlTokenEllipsisTokenFatArrowTokenTemplateSeqEndTokenAndTokenOrTokenTemplateInterpTokenEqualOpTokenNotEqualTokenLessThanEqTokenGreaterThanEqTokenEOFTokenTabsTokenStarStarTokenInvalidTokenBadUTF8"
|
const _TokenType_name = "TokenNilTokenNewlineTokenBangTokenPercentTokenBitwiseAndTokenOParenTokenCParenTokenStarTokenPlusTokenCommaTokenMinusTokenDotTokenSlashTokenColonTokenSemicolonTokenLessThanTokenEqualTokenGreaterThanTokenQuestionTokenCommentTokenOHeredocTokenIdentTokenNumberLitTokenQuotedLitTokenStringLitTokenOBrackTokenCBrackTokenBitwiseXorTokenBacktickTokenCHeredocTokenOBraceTokenBitwiseOrTokenCBraceTokenBitwiseNotTokenOQuoteTokenCQuoteTokenTemplateControlTokenEllipsisTokenFatArrowTokenTemplateSeqEndTokenAndTokenOrTokenTemplateInterpTokenEqualOpTokenNotEqualTokenLessThanEqTokenGreaterThanEqTokenEOFTokenTabsTokenStarStarTokenInvalidTokenBadUTF8"
|
||||||
|
|
||||||
@ -65,5 +65,5 @@ func (i TokenType) String() string {
|
|||||||
if str, ok := _TokenType_map[i]; ok {
|
if str, ok := _TokenType_map[i]; ok {
|
||||||
return str
|
return str
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("TokenType(%d)", i)
|
return "TokenType(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user