@@ -1933,10 +1933,22 @@ func (p *Parser) parseBeginAtomicBlockStatement() (*ast.BeginEndAtomicBlockState
19331933 p .nextToken () // consume =
19341934 }
19351935 }
1936- // Parse the isolation level identifier
1936+ // Parse the isolation level identifier - may be multi-word like "READ COMMITTED"
1937+ levelValue := strings .ToUpper (p .curTok .Literal )
1938+ p .nextToken ()
1939+ // Check for two-word isolation levels
1940+ nextWord := strings .ToUpper (p .curTok .Literal )
1941+ if (levelValue == "READ" && (nextWord == "COMMITTED" || nextWord == "UNCOMMITTED" )) ||
1942+ (levelValue == "REPEATABLE" && nextWord == "READ" ) {
1943+ levelValue = levelValue + " " + nextWord
1944+ p .nextToken ()
1945+ }
19371946 opt := & ast.IdentifierAtomicBlockOption {
19381947 OptionKind : "IsolationLevel" ,
1939- Value : p .parseIdentifier (),
1948+ Value : & ast.Identifier {
1949+ Value : levelValue ,
1950+ QuoteType : "NotQuoted" ,
1951+ },
19401952 }
19411953 stmt .Options = append (stmt .Options , opt )
19421954 case "LANGUAGE" :
@@ -1970,10 +1982,48 @@ func (p *Parser) parseBeginAtomicBlockStatement() (*ast.BeginEndAtomicBlockState
19701982 }
19711983 stmt .Options = append (stmt .Options , opt )
19721984 }
1973- case "DATEFIRST" , "DATEFORMAT" :
1974- opt := & ast.IdentifierAtomicBlockOption {
1975- OptionKind : optName ,
1976- Value : p .parseIdentifier (),
1985+ case "DATEFIRST" :
1986+ // Parse as integer literal
1987+ intLit := & ast.IntegerLiteral {
1988+ LiteralType : "Integer" ,
1989+ Value : p .curTok .Literal ,
1990+ }
1991+ p .nextToken ()
1992+ opt := & ast.LiteralAtomicBlockOption {
1993+ OptionKind : "DateFirst" ,
1994+ Value : intLit ,
1995+ }
1996+ stmt .Options = append (stmt .Options , opt )
1997+ case "DATEFORMAT" :
1998+ // Parse as string literal
1999+ value := p .curTok .Literal
2000+ // Strip quotes if present
2001+ if len (value ) >= 2 && value [0 ] == '\'' && value [len (value )- 1 ] == '\'' {
2002+ value = value [1 : len (value )- 1 ]
2003+ }
2004+ strLit := & ast.StringLiteral {
2005+ LiteralType : "String" ,
2006+ Value : value ,
2007+ IsNational : false ,
2008+ IsLargeObject : false ,
2009+ }
2010+ p .nextToken ()
2011+ opt := & ast.LiteralAtomicBlockOption {
2012+ OptionKind : "DateFormat" ,
2013+ Value : strLit ,
2014+ }
2015+ stmt .Options = append (stmt .Options , opt )
2016+ case "DELAYED_DURABILITY" :
2017+ // Parse ON/OFF as OnOffAtomicBlockOption
2018+ stateUpper := strings .ToUpper (p .curTok .Literal )
2019+ optState := "Off"
2020+ if stateUpper == "ON" {
2021+ optState = "On"
2022+ }
2023+ p .nextToken ()
2024+ opt := & ast.OnOffAtomicBlockOption {
2025+ OptionKind : "DelayedDurability" ,
2026+ OptionState : optState ,
19772027 }
19782028 stmt .Options = append (stmt .Options , opt )
19792029 default :
@@ -4190,6 +4240,12 @@ func (p *Parser) parseCreateProcedureStatement() (*ast.CreateProcedureStatement,
41904240 } else if upperLit == "ENCRYPTION" {
41914241 stmt .Options = append (stmt .Options , & ast.ProcedureOption {OptionKind : "Encryption" })
41924242 p .nextToken ()
4243+ } else if upperLit == "NATIVE_COMPILATION" {
4244+ stmt .Options = append (stmt .Options , & ast.ProcedureOption {OptionKind : "NativeCompilation" })
4245+ p .nextToken ()
4246+ } else if upperLit == "SCHEMABINDING" {
4247+ stmt .Options = append (stmt .Options , & ast.ProcedureOption {OptionKind : "SchemaBinding" })
4248+ p .nextToken ()
41934249 } else if upperLit == "EXECUTE" {
41944250 p .nextToken () // consume EXECUTE
41954251 if p .curTok .Type == TokenAs {
0 commit comments