Skip to content

Commit 021f40c

Browse files
committed
Add BOM handling and enable DropExternalLanguage tests
- Skip UTF-8 BOM at start of input - Fix JSON field name from Authorization to Owner 86 tests now passing (was 84)
1 parent 63aaad3 commit 021f40c

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

parser/lexer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ type Lexer struct {
206206

207207
// NewLexer creates a new Lexer for the given input.
208208
func NewLexer(input string) *Lexer {
209+
// Skip UTF-8 BOM if present
210+
if len(input) >= 3 && input[0] == 0xEF && input[1] == 0xBB && input[2] == 0xBF {
211+
input = input[3:]
212+
}
209213
l := &Lexer{input: input}
210214
l.readChar()
211215
return l

parser/parser.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5089,14 +5089,13 @@ func dropCredentialStatementToJSON(s *ast.DropCredentialStatement) jsonNode {
50895089

50905090
func dropExternalLanguageStatementToJSON(s *ast.DropExternalLanguageStatement) jsonNode {
50915091
node := jsonNode{
5092-
"$type": "DropExternalLanguageStatement",
5093-
"IsIfExists": s.IsIfExists,
5092+
"$type": "DropExternalLanguageStatement",
50945093
}
50955094
if s.Name != nil {
50965095
node["Name"] = identifierToJSON(s.Name)
50975096
}
50985097
if s.Authorization != nil {
5099-
node["Authorization"] = identifierToJSON(s.Authorization)
5098+
node["Owner"] = identifierToJSON(s.Authorization)
51005099
}
51015100
return node
51025101
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"skip": true}
1+
{"skip": false}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"skip": true}
1+
{"skip": false}

0 commit comments

Comments
 (0)