-
Notifications
You must be signed in to change notification settings - Fork 439
VersionTupleSyntax should be parsed as (up to) 3 integer literals #1434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The structure of children: [
Child(name: "Major",
kind: .token(choices: [.token(tokenKind: "IntegerToken")])),
Child(name: "PeriodBeforeMinor",
kind: .token(choices: [.token(tokenKind: "PeriodToken")]),
isOptional: true),
Child(name: "Minor",
kind: .token(choices: [.token(tokenKind: "IntegerToken")]),
isOptional: true),
Child(name: "PeriodBeforePatch",
kind: .token(choices: [.token(tokenKind: "PeriodToken")]),
isOptional: true),
Child(name: "Patch",
kind: .token(choices: [.token(tokenKind: "IntegerToken")]),
isOptional: true),
] And the parser should reject integer literals with non-decimal characters e.g. |
I imagine "1." or "1.2." should also be rejected, so it's more like |
rdar://107152155 |
Right, or more like |
Gotcha. Okay, works for me! Thanks for taking a look at this. |
Previously, internals from the lexer leaked through by representing the major and minor part of the version as a float literal. Also, we accepted non-decimal numbers (eg. hex) for version number, which we don’t want. Fixes swiftlang#1434 rdar://107152155
Previously, internals from the lexer leaked through by representing the major and minor part of the version as a float literal. Also, we accepted non-decimal numbers (eg. hex) for version number, which we don’t want. Fixes swiftlang#1434 rdar://107152155
Previously, internals from the lexer leaked through by representing the major and minor part of the version as a float literal. Also, we accepted non-decimal numbers (eg. hex) for version number, which we don’t want. Fixes swiftlang#1434 rdar://107152155
Previously, internals from the lexer leaked through by representing the major and minor part of the version as a float literal. Also, we accepted non-decimal numbers (eg. hex) for version number, which we don’t want. Fixes swiftlang#1434 rdar://107152155
Previously, internals from the lexer leaked through by representing the major and minor part of the version as a float literal. Also, we accepted non-decimal numbers (eg. hex) for version number, which we don’t want. Fixes swiftlang#1434 rdar://107152155
Previously, internals from the lexer leaked through by representing the major and minor part of the version as a float literal. Also, we accepted non-decimal numbers (eg. hex) for version number, which we don’t want. Fixes swiftlang#1434 rdar://107152155
Issue Kind
Other
Source Code
@available(macOS 10.4p2.1, *)
Description
The given source should produce an error, rather than a valid parse with
10.4.p2
as themajorMinor
and1
as thepatch
onVersionTupleSyntax
. IdeallyVersionTupleSyntax
would containmajor
,minor
, andpatch
.The text was updated successfully, but these errors were encountered: