1
1
mirror of https://github.com/github/semantic.git synced 2024-12-27 00:44:57 +03:00

Merge pull request #2126 from github/update-haskell-tree-sitter

Update haskell tree sitter
This commit is contained in:
Josh Vera 2018-08-13 16:24:38 -04:00 committed by GitHub
commit 2c5c8e624b
295 changed files with 789 additions and 1320 deletions

View File

@ -98,33 +98,34 @@ message PythonSyntax {
String string = 45;
TextElement textElement = 46;
Tuple tuple = 47;
Redirect redirect = 48;
Assignment assignment = 49;
Break break = 50;
Catch catch = 51;
Continue continue = 52;
Else else = 53;
Finally finally = 54;
ForEach forEach = 55;
If if = 56;
Let let = 57;
NoOp noOp = 58;
Return return = 59;
Statements statements = 60;
Throw throw = 61;
Try try = 62;
While while = 63;
Yield yield = 64;
Ellipsis ellipsis = 65;
Import import = 66;
QualifiedImport qualifiedImport = 67;
QualifiedAliasedImport qualifiedAliasedImport = 68;
Context context = 69;
Empty empty = 70;
Error error = 71;
Identifier identifier = 72;
Annotation annotation = 73;
List list = 74;
Ellipsis ellipsis = 48;
FutureImport futureImport = 49;
Import import = 50;
QualifiedImport qualifiedImport = 51;
QualifiedAliasedImport qualifiedAliasedImport = 52;
Redirect redirect = 53;
Assignment assignment = 54;
Break break = 55;
Catch catch = 56;
Continue continue = 57;
Else else = 58;
Finally finally = 59;
ForEach forEach = 60;
If if = 61;
Let let = 62;
NoOp noOp = 63;
Return return = 64;
Statements statements = 65;
Throw throw = 66;
Try try = 67;
While while = 68;
Yield yield = 69;
Context context = 70;
Empty empty = 71;
Error error = 72;
Identifier identifier = 73;
Annotation annotation = 74;
List list = 75;
}
}
@ -448,6 +449,10 @@ message Import {
repeated Alias importSymbols = 2;
}
message FutureImport {
repeated Alias futureImportSymbols = 1;
}
message QualifiedImport {
repeated string qualifiedImportFrom = 1;
}

View File

@ -80,33 +80,34 @@ message PythonSyntax {
String string = 45;
TextElement textElement = 46;
Tuple tuple = 47;
Redirect redirect = 48;
Assignment assignment = 49;
Break break = 50;
Catch catch = 51;
Continue continue = 52;
Else else = 53;
Finally finally = 54;
ForEach forEach = 55;
If if = 56;
Let let = 57;
NoOp noOp = 58;
Return return = 59;
Statements statements = 60;
Throw throw = 61;
Try try = 62;
While while = 63;
Yield yield = 64;
Ellipsis ellipsis = 65;
Import import = 66;
QualifiedImport qualifiedImport = 67;
QualifiedAliasedImport qualifiedAliasedImport = 68;
Context context = 69;
Empty empty = 70;
Error error = 71;
Identifier identifier = 72;
Annotation annotation = 73;
List list = 74;
Ellipsis ellipsis = 48;
FutureImport futureImport = 49;
Import import = 50;
QualifiedImport qualifiedImport = 51;
QualifiedAliasedImport qualifiedAliasedImport = 52;
Redirect redirect = 53;
Assignment assignment = 54;
Break break = 55;
Catch catch = 56;
Continue continue = 57;
Else else = 58;
Finally finally = 59;
ForEach forEach = 60;
If if = 61;
Let let = 62;
NoOp noOp = 63;
Return return = 64;
Statements statements = 65;
Throw throw = 66;
Try try = 67;
While while = 68;
Yield yield = 69;
Context context = 70;
Empty empty = 71;
Error error = 72;
Identifier identifier = 73;
Annotation annotation = 74;
List list = 75;
}
}
@ -424,6 +425,10 @@ message Import {
repeated Alias importSymbols = 2;
}
message FutureImport {
repeated Alias futureImportSymbols = 1;
}
message QualifiedImport {
repeated string qualifiedImportFrom = 1;
}

View File

@ -242,6 +242,10 @@ message Complex {
string value = 1;
}
message EscapeSequence {
string value = 1;
}
message Float {
string floatContent = 1;
}
@ -415,89 +419,90 @@ message RubySyntax {
oneof syntax {
Comment comment = 1;
Function function = 2;
Boolean boolean = 3;
Method method = 4;
File file = 5;
Line line = 6;
Plus plus = 7;
Minus minus = 8;
Times times = 9;
DividedBy dividedBy = 10;
Modulo modulo = 11;
Power power = 12;
Negate negate = 13;
FloorDivision floorDivision = 14;
BAnd bAnd = 15;
BOr bOr = 16;
BXOr bXOr = 17;
LShift lShift = 18;
RShift rShift = 19;
Complement complement = 20;
And and = 21;
Not not = 22;
Or or = 23;
XOr xOr = 24;
Call call = 25;
LessThan lessThan = 26;
LessThanEqual lessThanEqual = 27;
GreaterThan greaterThan = 28;
GreaterThanEqual greaterThanEqual = 29;
Equal equal = 30;
StrictEqual strictEqual = 31;
Comparison comparison = 32;
Enumeration enumeration = 33;
Matches matches = 34;
NotMatches notMatches = 35;
MemberAccess memberAccess = 36;
ScopeResolution scopeResolution = 37;
Subscript subscript = 38;
Member member = 39;
This this = 40;
Array array = 41;
Method method = 3;
File file = 4;
Line line = 5;
Plus plus = 6;
Minus minus = 7;
Times times = 8;
DividedBy dividedBy = 9;
Modulo modulo = 10;
Power power = 11;
Negate negate = 12;
FloorDivision floorDivision = 13;
BAnd bAnd = 14;
BOr bOr = 15;
BXOr bXOr = 16;
LShift lShift = 17;
RShift rShift = 18;
Complement complement = 19;
And and = 20;
Not not = 21;
Or or = 22;
XOr xOr = 23;
Call call = 24;
LessThan lessThan = 25;
LessThanEqual lessThanEqual = 26;
GreaterThan greaterThan = 27;
GreaterThanEqual greaterThanEqual = 28;
Equal equal = 29;
StrictEqual strictEqual = 30;
Comparison comparison = 31;
Enumeration enumeration = 32;
Matches matches = 33;
NotMatches notMatches = 34;
MemberAccess memberAccess = 35;
ScopeResolution scopeResolution = 36;
Subscript subscript = 37;
Member member = 38;
This this = 39;
Array array = 40;
Boolean boolean = 41;
Character character = 42;
Complex complex = 43;
Float float = 44;
Hash hash = 45;
Integer integer = 46;
InterpolationElement interpolationElement = 47;
KeyValue keyValue = 48;
Null null = 49;
Rational rational = 50;
Regex regex = 51;
String string = 52;
Symbol symbol = 53;
SymbolElement symbolElement = 54;
TextElement textElement = 55;
Assignment assignment = 56;
Break break = 57;
Catch catch = 58;
Continue continue = 59;
Else else = 60;
Finally finally = 61;
ForEach forEach = 62;
If if = 63;
Match match = 64;
Pattern pattern = 65;
Retry retry = 66;
Return return = 67;
ScopeEntry scopeEntry = 68;
ScopeExit scopeExit = 69;
Statements statements = 70;
Try try = 71;
While while = 72;
Yield yield = 73;
Context context = 74;
Empty empty = 75;
Error error = 76;
Identifier identifier = 77;
Class class = 78;
Load load = 79;
LowPrecedenceAnd lowPrecedenceAnd = 80;
LowPrecedenceOr lowPrecedenceOr = 81;
Module module = 82;
Require require = 83;
Send send = 84;
List list = 85;
EscapeSequence escapeSequence = 44;
Float float = 45;
Hash hash = 46;
Integer integer = 47;
InterpolationElement interpolationElement = 48;
KeyValue keyValue = 49;
Null null = 50;
Rational rational = 51;
Regex regex = 52;
String string = 53;
Symbol symbol = 54;
SymbolElement symbolElement = 55;
TextElement textElement = 56;
Assignment assignment = 57;
Break break = 58;
Catch catch = 59;
Continue continue = 60;
Else else = 61;
Finally finally = 62;
ForEach forEach = 63;
If if = 64;
Match match = 65;
Pattern pattern = 66;
Retry retry = 67;
Return return = 68;
ScopeEntry scopeEntry = 69;
ScopeExit scopeExit = 70;
Statements statements = 71;
Try try = 72;
While while = 73;
Yield yield = 74;
Context context = 75;
Empty empty = 76;
Error error = 77;
Identifier identifier = 78;
Class class = 79;
Load load = 80;
LowPrecedenceAnd lowPrecedenceAnd = 81;
LowPrecedenceOr lowPrecedenceOr = 82;
Module module = 83;
Require require = 84;
Send send = 85;
List list = 86;
}
}

View File

@ -224,6 +224,10 @@ message Complex {
string value = 1;
}
message EscapeSequence {
string value = 1;
}
message Float {
string floatContent = 1;
}
@ -397,89 +401,90 @@ message RubySyntax {
oneof syntax {
Comment comment = 1;
Function function = 2;
Boolean boolean = 3;
Method method = 4;
File file = 5;
Line line = 6;
Plus plus = 7;
Minus minus = 8;
Times times = 9;
DividedBy dividedBy = 10;
Modulo modulo = 11;
Power power = 12;
Negate negate = 13;
FloorDivision floorDivision = 14;
BAnd bAnd = 15;
BOr bOr = 16;
BXOr bXOr = 17;
LShift lShift = 18;
RShift rShift = 19;
Complement complement = 20;
And and = 21;
Not not = 22;
Or or = 23;
XOr xOr = 24;
Call call = 25;
LessThan lessThan = 26;
LessThanEqual lessThanEqual = 27;
GreaterThan greaterThan = 28;
GreaterThanEqual greaterThanEqual = 29;
Equal equal = 30;
StrictEqual strictEqual = 31;
Comparison comparison = 32;
Enumeration enumeration = 33;
Matches matches = 34;
NotMatches notMatches = 35;
MemberAccess memberAccess = 36;
ScopeResolution scopeResolution = 37;
Subscript subscript = 38;
Member member = 39;
This this = 40;
Array array = 41;
Method method = 3;
File file = 4;
Line line = 5;
Plus plus = 6;
Minus minus = 7;
Times times = 8;
DividedBy dividedBy = 9;
Modulo modulo = 10;
Power power = 11;
Negate negate = 12;
FloorDivision floorDivision = 13;
BAnd bAnd = 14;
BOr bOr = 15;
BXOr bXOr = 16;
LShift lShift = 17;
RShift rShift = 18;
Complement complement = 19;
And and = 20;
Not not = 21;
Or or = 22;
XOr xOr = 23;
Call call = 24;
LessThan lessThan = 25;
LessThanEqual lessThanEqual = 26;
GreaterThan greaterThan = 27;
GreaterThanEqual greaterThanEqual = 28;
Equal equal = 29;
StrictEqual strictEqual = 30;
Comparison comparison = 31;
Enumeration enumeration = 32;
Matches matches = 33;
NotMatches notMatches = 34;
MemberAccess memberAccess = 35;
ScopeResolution scopeResolution = 36;
Subscript subscript = 37;
Member member = 38;
This this = 39;
Array array = 40;
Boolean boolean = 41;
Character character = 42;
Complex complex = 43;
Float float = 44;
Hash hash = 45;
Integer integer = 46;
InterpolationElement interpolationElement = 47;
KeyValue keyValue = 48;
Null null = 49;
Rational rational = 50;
Regex regex = 51;
String string = 52;
Symbol symbol = 53;
SymbolElement symbolElement = 54;
TextElement textElement = 55;
Assignment assignment = 56;
Break break = 57;
Catch catch = 58;
Continue continue = 59;
Else else = 60;
Finally finally = 61;
ForEach forEach = 62;
If if = 63;
Match match = 64;
Pattern pattern = 65;
Retry retry = 66;
Return return = 67;
ScopeEntry scopeEntry = 68;
ScopeExit scopeExit = 69;
Statements statements = 70;
Try try = 71;
While while = 72;
Yield yield = 73;
Context context = 74;
Empty empty = 75;
Error error = 76;
Identifier identifier = 77;
Class class = 78;
Load load = 79;
LowPrecedenceAnd lowPrecedenceAnd = 80;
LowPrecedenceOr lowPrecedenceOr = 81;
Module module = 82;
Require require = 83;
Send send = 84;
List list = 85;
EscapeSequence escapeSequence = 44;
Float float = 45;
Hash hash = 46;
Integer integer = 47;
InterpolationElement interpolationElement = 48;
KeyValue keyValue = 49;
Null null = 50;
Rational rational = 51;
Regex regex = 52;
String string = 53;
Symbol symbol = 54;
SymbolElement symbolElement = 55;
TextElement textElement = 56;
Assignment assignment = 57;
Break break = 58;
Catch catch = 59;
Continue continue = 60;
Else else = 61;
Finally finally = 62;
ForEach forEach = 63;
If if = 64;
Match match = 65;
Pattern pattern = 66;
Retry retry = 67;
Return return = 68;
ScopeEntry scopeEntry = 69;
ScopeExit scopeExit = 70;
Statements statements = 71;
Try try = 72;
While while = 73;
Yield yield = 74;
Context context = 75;
Empty empty = 76;
Error error = 77;
Identifier identifier = 78;
Class class = 79;
Load load = 80;
LowPrecedenceAnd lowPrecedenceAnd = 81;
LowPrecedenceOr lowPrecedenceOr = 82;
Module module = 83;
Require require = 84;
Send send = 85;
List list = 86;
}
}

View File

@ -130,6 +130,17 @@ instance Show1 TextElement where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable TextElement where
eval (TextElement x) = rvalBox (string x)
-- | A sequence of textual contents within a string literal.
newtype EscapeSequence a = EscapeSequence { value :: Text }
deriving (Diffable, Eq, Foldable, Functor, Generic1, Hashable1, Ord, Show, Traversable, FreeVariables1, Declarations1, ToJSONFields1, Named1, Message1)
instance Eq1 EscapeSequence where liftEq = genericLiftEq
instance Ord1 EscapeSequence where liftCompare = genericLiftCompare
instance Show1 EscapeSequence where liftShowsPrec = genericLiftShowsPrec
-- TODO: Implement Eval instance for EscapeSequence
instance Evaluatable EscapeSequence
data Null a = Null
deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Diffable, FreeVariables1, Declarations1, ToJSONFields1, Named1, Message1)

View File

@ -129,6 +129,8 @@ type Syntax =
, Type.Pointer
, Type.Slice
, []
, Literal.String
, Literal.EscapeSequence
]
type Term = Term.Term (Sum Syntax) (Record Location)
@ -272,7 +274,11 @@ imaginaryLiteral :: Assignment Term
imaginaryLiteral = makeTerm <$> symbol ImaginaryLiteral <*> (Literal.Complex <$> source)
interpretedStringLiteral :: Assignment Term
interpretedStringLiteral = makeTerm <$> symbol InterpretedStringLiteral <*> (Literal.TextElement <$> source)
interpretedStringLiteral = makeTerm' <$> symbol InterpretedStringLiteral <*> children ( (inject . Literal.String <$> some escapeSequence)
<|> (inject . Literal.TextElement <$> source))
escapeSequence :: Assignment Term
escapeSequence = makeTerm <$> symbol EscapeSequence <*> (Literal.EscapeSequence <$> source)
intLiteral :: Assignment Term
intLiteral = makeTerm <$> symbol IntLiteral <*> (Literal.Integer <$> source)
@ -324,7 +330,8 @@ fieldDeclarationList :: Assignment Term
fieldDeclarationList = symbol FieldDeclarationList *> children expressions
functionType :: Assignment Term
functionType = makeTerm <$> symbol FunctionType <*> children (Type.Function <$> manyTerm parameters <*> (expression <|> emptyTerm))
functionType = makeTerm <$> symbol FunctionType <*> children (Type.Function <$> params <*> (expression <|> emptyTerm))
where params = symbol ParameterList *> children (manyTerm expression)
implicitLengthArrayType :: Assignment Term
implicitLengthArrayType = makeTerm <$> symbol ImplicitLengthArrayType <*> children (Type.Array Nothing <$> expression)
@ -414,9 +421,12 @@ fallThroughStatement :: Assignment Term
fallThroughStatement = makeTerm <$> symbol FallthroughStatement <*> (Statement.Pattern <$> (makeTerm <$> location <*> (Syntax.Identifier . name <$> source)) <*> emptyTerm)
functionDeclaration :: Assignment Term
functionDeclaration = makeTerm <$> (symbol FunctionDeclaration <|> symbol FuncLiteral) <*> children (mkFunctionDeclaration <$> (term identifier <|> emptyTerm) <*> manyTerm parameters <*> (term types <|> term identifier <|> term returnParameters <|> emptyTerm) <*> (term block <|> emptyTerm))
functionDeclaration = makeTerm <$> (symbol FunctionDeclaration <|> symbol FuncLiteral) <*> children (mkFunctionDeclaration <$> (term identifier <|> emptyTerm) <*> params <*> returnTypes <*> (term block <|> emptyTerm))
where
mkFunctionDeclaration name' params' types' block' = Declaration.Function [types'] name' params' block'
returnTypes = pure <$> (term types <|> term identifier <|> term returnParameters)
<|> pure []
params = symbol ParameterList *> children (manyTerm expression)
mkFunctionDeclaration name' params' types' block' = Declaration.Function types' name' params' block'
returnParameters = makeTerm <$> symbol ParameterList <*> children (manyTerm expression)
importDeclaration :: Assignment Term
@ -433,10 +443,12 @@ importDeclaration = makeTerm'' <$> symbol ImportDeclaration <*> children (manyTe
from <- importPath <$> source
let alias = makeTerm loc (Syntax.Identifier (defaultAlias from)) -- Go takes `import "lib/Math"` and uses `Math` as the qualified name (e.g. `Math.Sin()`)
pure $! Go.Syntax.QualifiedImport from alias)
interpretedStringLiteral' = symbol InterpretedStringLiteral *> children ( (inject . Literal.String <$> some escapeSequence)
<|> (inject . Literal.TextElement <$> source))
rawStringLiteral' = symbol RawStringLiteral *> (inject . Literal.TextElement <$> source)
dot = makeTerm <$> symbol Dot <*> (Literal.TextElement <$> source)
underscore = makeTerm <$> symbol BlankIdentifier <*> (Literal.TextElement <$> source)
importSpec = makeTerm' <$> symbol ImportSpec <*> children (sideEffectImport <|> dotImport <|> namedImport <|> plainImport)
importSpec = makeTerm' <$> symbol ImportSpec <*> children (sideEffectImport <|> dotImport <|> namedImport <|> plainImport <|> interpretedStringLiteral' <|> rawStringLiteral')
importSpecList = makeTerm <$> symbol ImportSpecList <*> children (manyTerm (importSpec <|> comment))
importFromPath = symbol InterpretedStringLiteral *> (importPath <$> source)
@ -444,15 +456,20 @@ indexExpression :: Assignment Term
indexExpression = makeTerm <$> symbol IndexExpression <*> children (Expression.Subscript <$> expression <*> manyTerm expression)
methodDeclaration :: Assignment Term
methodDeclaration = makeTerm <$> symbol MethodDeclaration <*> children (mkTypedMethodDeclaration <$> receiver <*> term fieldIdentifier <*> manyTerm parameters <*> ((makeTerm <$> location <*> manyTermsTill expression (void (symbol Block))) <|> emptyTerm) <*> (term block <|> emptyTerm))
methodDeclaration = makeTerm <$> symbol MethodDeclaration <*> children (mkTypedMethodDeclaration <$> receiver <*> term fieldIdentifier <*> params <*> returnParameters <*> (term block <|> emptyTerm))
where
receiver = symbol ParameterList *> children ((symbol ParameterDeclaration *> children expressions) <|> expressions)
mkTypedMethodDeclaration receiver' name' parameters' type'' body' = Declaration.Method [type''] receiver' name' parameters' body'
params = symbol ParameterList *> children (manyTerm expression)
receiver = symbol ParameterList *> children expressions
mkTypedMethodDeclaration receiver' name' parameters' type'' body' = Declaration.Method type'' receiver' name' parameters' body'
returnParameters = (symbol ParameterList *> children (manyTerm expression))
<|> pure <$> expression
<|> pure []
methodSpec :: Assignment Term
methodSpec = makeTerm <$> symbol MethodSpec <*> children (mkMethodSpec <$> expression <*> parameters <*> (expression <|> emptyTerm))
methodSpec = makeTerm <$> symbol MethodSpec <*> children (mkMethodSpec <$> expression <*> params <*> (expression <|> emptyTerm))
where
mkMethodSpec name' params optionalTypeLiteral = Declaration.MethodSignature [optionalTypeLiteral] name' [params]
params = symbol ParameterList *> children (manyTerm expression)
mkMethodSpec name' params optionalTypeLiteral = Declaration.MethodSignature [optionalTypeLiteral] name' params
methodSpecList :: Assignment Term
methodSpecList = symbol MethodSpecList *> children expressions

View File

@ -90,6 +90,11 @@ type Syntax =
, Literal.String
, Literal.TextElement
, Literal.Tuple
, Python.Syntax.Ellipsis
, Python.Syntax.FutureImport
, Python.Syntax.Import
, Python.Syntax.QualifiedImport
, Python.Syntax.QualifiedAliasedImport
, Python.Syntax.Redirect
, Statement.Assignment
, Statement.Break
@ -107,10 +112,6 @@ type Syntax =
, Statement.Try
, Statement.While
, Statement.Yield
, Python.Syntax.Ellipsis
, Python.Syntax.Import
, Python.Syntax.QualifiedImport
, Python.Syntax.QualifiedAliasedImport
, Syntax.Context
, Syntax.Empty
, Syntax.Error
@ -407,6 +408,7 @@ comment = makeTerm <$> symbol Comment <*> (Comment.Comment <$> source)
import' :: Assignment Term
import' = makeTerm'' <$> symbol ImportStatement <*> children (manyTerm (aliasedImport <|> plainImport))
<|> makeTerm <$> symbol ImportFromStatement <*> children (Python.Syntax.Import <$> importPath <*> (wildcard <|> some (aliasImportSymbol <|> importSymbol)))
<|> makeTerm <$> symbol FutureImportStatement <*> children (Python.Syntax.FutureImport <$> some (aliasImportSymbol <|> importSymbol))
where
-- `import a as b`
aliasedImport = makeTerm <$> symbol AliasedImport <*> children (Python.Syntax.QualifiedAliasedImport <$> importPath <*> expression)

View File

@ -109,6 +109,15 @@ instance Eq1 Import where liftEq = genericLiftEq
instance Ord1 Import where liftCompare = genericLiftCompare
instance Show1 Import where liftShowsPrec = genericLiftShowsPrec
newtype FutureImport a = FutureImport { futureImportSymbols :: [Alias] }
deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Message1, Named1, Ord, Show, ToJSONFields1, Traversable)
instance Eq1 FutureImport where liftEq = genericLiftEq
instance Ord1 FutureImport where liftCompare = genericLiftCompare
instance Show1 FutureImport where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable FutureImport where
data Alias = Alias { aliasValue :: Name, aliasName :: Name }
deriving (Eq, Generic, Hashable, Ord, Show, Message, Named, ToJSON)

View File

@ -44,7 +44,6 @@ import Proto3.Suite (Named (..), Named1 (..))
type Syntax = '[
Comment.Comment
, Declaration.Function
, Literal.Boolean
, Declaration.Method
, Directive.File
, Directive.Line
@ -83,8 +82,10 @@ type Syntax = '[
, Expression.Member
, Expression.This
, Literal.Array
, Literal.Boolean
, Literal.Character
, Literal.Complex
, Literal.EscapeSequence
, Literal.Float
, Literal.Hash
, Literal.Integer
@ -270,7 +271,7 @@ literal =
where
string :: Assignment Term
string = makeTerm' <$> (symbol String <|> symbol BareString) <*>
(children (inject . Literal.String <$> some interpolation) <|> inject . Literal.TextElement <$> source)
(children (inject . Literal.String <$> some (interpolation <|> escapeSequence)) <|> inject . Literal.TextElement <$> source)
symbol' :: Assignment Term
symbol' = makeTerm' <$> (symbol Symbol <|> symbol Symbol' <|> symbol BareSymbol) <*>
@ -279,9 +280,12 @@ literal =
interpolation :: Assignment Term
interpolation = makeTerm <$> symbol Interpolation <*> children (Literal.InterpolationElement <$> expression)
escapeSequence :: Assignment Term
escapeSequence = makeTerm <$> symbol EscapeSequence <*> (Literal.EscapeSequence <$> source)
heredoc :: Assignment Term
heredoc = makeTerm <$> symbol HeredocBeginning <*> (Literal.TextElement <$> source)
<|> makeTerm <$> symbol HeredocBody <*> children (some (interpolation <|> heredocEnd))
<|> makeTerm <$> symbol HeredocBody <*> children (some (interpolation <|> escapeSequence <|> heredocEnd))
where heredocEnd = makeTerm <$> symbol HeredocEnd <*> (Literal.TextElement <$> source)
beginBlock :: Assignment Term

View File

@ -329,7 +329,7 @@ anonymousClass :: Assignment Term
anonymousClass = makeTerm <$> symbol Grammar.AnonymousClass <*> children (Declaration.Class [] <$> emptyTerm <*> (classHeritage' <|> pure []) <*> classBodyStatements)
abstractClass :: Assignment Term
abstractClass = makeTerm <$> symbol Grammar.AbstractClass <*> children (TypeScript.Syntax.AbstractClass <$> term identifier <*> (term typeParameters <|> emptyTerm) <*> (classHeritage' <|> pure []) <*> classBodyStatements)
abstractClass = makeTerm <$> symbol Grammar.AbstractClass <*> children (TypeScript.Syntax.AbstractClass <$> term typeIdentifier <*> (term typeParameters <|> emptyTerm) <*> (classHeritage' <|> pure []) <*> classBodyStatements)
abstractMethodSignature :: Assignment Term
abstractMethodSignature = makeSignature <$> symbol Grammar.AbstractMethodSignature <*> children ((,,) <$> (term accessibilityModifier' <|> emptyTerm) <*> term propertyName <*> callSignatureParts)
@ -384,7 +384,7 @@ identifier :: Assignment Term
identifier = makeTerm <$> (symbol Identifier <|> symbol Identifier') <*> (Syntax.Identifier . name <$> source)
class' :: Assignment Term
class' = makeClass <$> symbol Class <*> children ((,,,,) <$> manyTerm decorator <*> term identifier <*> (symbol TypeParameters *> children (manyTerm typeParameter') <|> pure []) <*> (classHeritage' <|> pure []) <*> classBodyStatements)
class' = makeClass <$> symbol Class <*> children ((,,,,) <$> manyTerm decorator <*> term typeIdentifier <*> (symbol TypeParameters *> children (manyTerm typeParameter') <|> pure []) <*> (classHeritage' <|> pure []) <*> classBodyStatements)
where makeClass loc (decorators, expression, typeParams, classHeritage, statements) = makeTerm loc (Declaration.Class (decorators <> typeParams) expression classHeritage statements)
object :: Assignment Term
@ -446,10 +446,9 @@ expressions :: Assignment Term
expressions = expression <|> sequenceExpression
parameter :: Assignment Term
parameter =
requiredParameter
<|> restParameter
<|> optionalParameter
parameter = requiredParameter
<|> restParameter
<|> optionalParameter
accessibilityModifier' :: Assignment Term
accessibilityModifier' = makeTerm <$> symbol AccessibilityModifier <*> children (Syntax.Identifier . name <$> source)
@ -471,9 +470,9 @@ methodDefinition = makeMethod <$>
makeMethod loc (modifier, readonly, receiver, propertyName', (typeParameters', params, ty'), statements) = makeTerm loc (Declaration.Method [modifier, readonly, typeParameters', ty'] receiver propertyName' params statements)
callSignatureParts :: Assignment (Term, [Term], Term)
callSignatureParts = contextualize' <$> Assignment.manyThrough comment (postContextualize'
<$> (symbol Grammar.CallSignature *> children ((,,) <$> (fromMaybe <$> emptyTerm <*> optional (term typeParameters)) <*> formalParameters <*> (fromMaybe <$> emptyTerm <*> optional (term typeAnnotation')))) <*> many comment)
callSignatureParts = contextualize' <$> Assignment.manyThrough comment (postContextualize' <$> callSignature' <*> many comment)
where
callSignature' = symbol Grammar.CallSignature *> children ((,,) <$> (term typeParameters <|> emptyTerm) <*> formalParameters <*> (term typeAnnotation' <|> emptyTerm))
contextualize' (cs, (typeParams, formalParams, annotation)) = case nonEmpty cs of
Just cs -> (makeTerm1 (Syntax.Context cs typeParams), formalParams, annotation)
Nothing -> (typeParams, formalParams, annotation)
@ -536,7 +535,22 @@ ty :: Assignment Term
ty = primaryType <|> unionType <|> intersectionType <|> functionTy <|> constructorTy
primaryType :: Assignment Term
primaryType = parenthesizedTy <|> predefinedTy <|> typeIdentifier <|> nestedTypeIdentifier <|> genericType <|> typePredicate <|> objectType <|> arrayTy <|> tupleType <|> flowMaybeTy <|> typeQuery <|> indexTypeQuery <|> thisType <|> existentialType <|> literalType <|> lookupType
primaryType = arrayTy
<|> existentialType
<|> flowMaybeTy
<|> genericType
<|> indexTypeQuery
<|> literalType
<|> lookupType
<|> nestedTypeIdentifier
<|> objectType
<|> parenthesizedTy
<|> predefinedTy
<|> thisType
<|> tupleType
<|> typeIdentifier
<|> typePredicate
<|> typeQuery
parenthesizedTy :: Assignment Term
parenthesizedTy = makeTerm <$> symbol Grammar.ParenthesizedType <*> children (TypeScript.Syntax.ParenthesizedType <$> term ty)
@ -569,7 +583,7 @@ arrayTy :: Assignment Term
arrayTy = makeTerm <$> symbol Grammar.ArrayType <*> children (TypeScript.Syntax.ArrayType <$> term ty)
lookupType :: Assignment Term
lookupType = makeTerm <$> symbol Grammar.LookupType <*> children (TypeScript.Syntax.LookupType <$> term (identifier <|> nestedTypeIdentifier) <*> term ty)
lookupType = makeTerm <$> symbol Grammar.LookupType <*> children (TypeScript.Syntax.LookupType <$> term (typeIdentifier <|> nestedTypeIdentifier) <*> term ty)
flowMaybeTy :: Assignment Term
flowMaybeTy = makeTerm <$> symbol Grammar.FlowMaybeType <*> children (TypeScript.Syntax.FlowMaybeType <$> term primaryType)
@ -578,7 +592,7 @@ typeQuery :: Assignment Term
typeQuery = makeTerm <$> symbol Grammar.TypeQuery <*> children (TypeScript.Syntax.TypeQuery <$> term (identifier <|> nestedIdentifier))
indexTypeQuery :: Assignment Term
indexTypeQuery = makeTerm <$> symbol Grammar.IndexTypeQuery <*> children (TypeScript.Syntax.IndexTypeQuery <$> term (identifier <|> nestedIdentifier))
indexTypeQuery = makeTerm <$> symbol Grammar.IndexTypeQuery <*> children (TypeScript.Syntax.IndexTypeQuery <$> term (typeIdentifier <|> nestedIdentifier))
thisType :: Assignment Term
thisType = makeTerm <$> symbol Grammar.ThisType <*> (TypeScript.Syntax.ThisType <$> source)
@ -743,7 +757,7 @@ declaration = everything
]
typeAliasDeclaration :: Assignment Term
typeAliasDeclaration = makeTypeAliasDecl <$> symbol Grammar.TypeAliasDeclaration <*> children ((,,) <$> term identifier <*> (term typeParameters <|> emptyTerm) <*> term ty)
typeAliasDeclaration = makeTypeAliasDecl <$> symbol Grammar.TypeAliasDeclaration <*> children ((,,) <$> term typeIdentifier <*> (term typeParameters <|> emptyTerm) <*> term ty)
where makeTypeAliasDecl loc (identifier, typeParams, body) = makeTerm loc (Declaration.TypeAlias [typeParams] identifier body)
enumDeclaration :: Assignment Term
@ -753,7 +767,7 @@ enumAssignment :: Assignment Term
enumAssignment = makeTerm <$> symbol Grammar.EnumAssignment <*> children (Statement.Assignment [] <$> term propertyName <*> term expression)
interfaceDeclaration :: Assignment Term
interfaceDeclaration = makeInterfaceDecl <$> symbol Grammar.InterfaceDeclaration <*> children ((,,,) <$> term identifier <*> (term typeParameters <|> emptyTerm) <*> optional (term extendsClause) <*> term objectType)
interfaceDeclaration = makeInterfaceDecl <$> symbol Grammar.InterfaceDeclaration <*> children ((,,,) <$> term typeIdentifier <*> (term typeParameters <|> emptyTerm) <*> optional (term extendsClause) <*> term objectType)
where makeInterfaceDecl loc (identifier, typeParams, clause, objectType) = makeTerm loc (Declaration.InterfaceDeclaration [typeParams] identifier (toList clause) objectType)
ambientDeclaration :: Assignment Term
@ -790,8 +804,16 @@ shorthandPropertyIdentifier :: Assignment Term
shorthandPropertyIdentifier = makeTerm <$> symbol Grammar.ShorthandPropertyIdentifier <*> (TypeScript.Syntax.ShorthandPropertyIdentifier <$> source)
requiredParameter :: Assignment Term
requiredParameter = makeRequiredParameter <$> symbol Grammar.RequiredParameter <*> children ((,,,,) <$> (term accessibilityModifier' <|> emptyTerm) <*> (term readonly' <|> emptyTerm) <*> term (identifier <|> destructuringPattern <|> this) <*> (term typeAnnotation' <|> emptyTerm) <*> (term expression <|> emptyTerm))
where makeRequiredParameter loc (modifier, readonly, identifier, annotation, initializer) = makeTerm loc (TypeScript.Syntax.RequiredParameter [modifier, readonly, annotation] (makeTerm loc (Statement.Assignment [] identifier initializer)))
requiredParameter = makeRequiredParameter
<$> symbol Grammar.RequiredParameter
<*> children ( (,,,,)
<$> (term accessibilityModifier' <|> emptyTerm)
<*> (term readonly' <|> emptyTerm)
<*> term (identifier <|> destructuringPattern <|> this)
<*> (term typeAnnotation' <|> emptyTerm)
<*> (term expression <|> emptyTerm))
where
makeRequiredParameter loc (modifier, readonly, identifier, annotation, initializer) = makeTerm loc (TypeScript.Syntax.RequiredParameter [modifier, readonly, annotation] (makeTerm loc (Statement.Assignment [] identifier initializer)))
restParameter :: Assignment Term
restParameter = makeRestParameter <$> symbol Grammar.RestParameter <*> children ((,) <$> term identifier <*> (term typeAnnotation' <|> emptyTerm))

View File

@ -281,6 +281,9 @@ instance Listable1 Literal.Null where
instance Listable1 Literal.TextElement where
liftTiers tiers = cons1 Literal.TextElement
instance Listable1 Literal.EscapeSequence where
liftTiers tiers = cons1 Literal.EscapeSequence
instance Listable1 Literal.InterpolationElement where
liftTiers tiers = liftCons1 tiers Literal.InterpolationElement
@ -420,7 +423,7 @@ instance Listable1 Literal.String where
liftTiers tiers = liftCons1 (liftTiers tiers) Literal.String
instance Listable1 Literal.Symbol where
liftTiers tiers = liftCons1 (liftTiers tiers) Literal.Symbol
liftTiers tiers = liftCons1 (liftTiers tiers) Literal.Symbol
instance Listable1 Literal.SymbolElement where
liftTiers tiers = cons1 Literal.SymbolElement

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Statements
(Type

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Statements
(Type

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Statements
(Type

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Statements
(Type

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Assignment
(Identifier)
(Composite

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Assignment
(Identifier)
(Composite

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Assignment
(Identifier)
(Composite

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Assignment
(Identifier)
(Composite

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Assignment
{ (Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Assignment
{ (Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Assignment
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Assignment
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Context
(Comment)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Context
(Comment)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Context
(Comment)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Context
(Comment)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Call
{ (Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Call
{ (Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Call
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Call
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
{ (Match
{-(Empty)-}
{-(Statements)-})

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
{ (Statements
{-(Match
{-(Statements)-}

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Match
(Empty)
(Statements))))

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Match
(Statements)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
{+(Type
{+(Identifier)+}

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
{+(Type
{+(Identifier)+}

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Type
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Type
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Context
{ (Comment)
->(Comment) }

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Context
{ (Comment)
->(Comment) }

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Context
(Comment)
(Empty))))

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Context
(Comment)
(Empty))))

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Assignment
(Annotation
(Statements

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Assignment
(Annotation
(Statements

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Assignment
(Annotation
(Statements

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Assignment
(Annotation
(Statements

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Assignment
{ (Identifier)
->(Statements

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Assignment
{ (Statements
{-(Identifier)-}

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Assignment
(Identifier)
(Integer))))

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Assignment
(Statements
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
{+(Assignment
{+(Identifier)+}

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
{+(Assignment
{+(Identifier)+}

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Assignment
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Assignment
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Call
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Call
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Call
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Call
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Assignment
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Assignment
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Assignment
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Assignment
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(For
(Empty)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(For
(Empty)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(For
(Empty)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(For
(Empty)

View File

@ -2,46 +2,35 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements))
(Function
(Empty)
{ (Identifier)
->(Identifier) }
(Statements)
(Statements))
(Function
(Identifier)
{ (Identifier)
->(Identifier) }
(Statements
(Statements
(Identifier)
(Identifier))
(Statements
(Identifier)
(Identifier)
(Identifier)
(Identifier)))
(Identifier)
(Identifier))
(Statements
(Identifier)
(Identifier)
(Identifier)
(Identifier))
(Statements))
(Function
(Empty)
{ (Identifier)
->(Identifier) }
(Statements)
(Statements
(Statements
(Identifier))
(Statements
(Identifier)))
(Statements))
(Function
(Empty)
{ (Identifier)
->(Identifier) }
(Statements)
(Statements))
(Function
(Statements
(Statements
(Identifier)
@ -49,30 +38,29 @@
(Statements
(Identifier)
(Identifier)))
{ (Identifier)
->(Identifier) }
(Statements))
(Function
{+(Statements)+}
{-(Identifier)-}
{ (Identifier)
->(Identifier) }
{ (Empty)
->(NoOp
{+(Empty)+}) })
{+(Function
{+(Empty)+}
{+(Identifier)+}
{+(Statements)+}
{+(Statements)+}
{+(NoOp
{+(Empty)+})+})+}
{+(Identifier)+}
{+(Empty)+})+}
(Function
{ (Identifier)
->(Identifier) }
{ (Identifier)
->(Identifier) }
(Statements)
(Empty))
(Function
(Empty)
(Context
(Comment)
(Empty))
{ (Identifier)
->(Identifier) }
(Statements
(Identifier)
(Pointer
(Identifier)))
(Context
(Comment)
(Empty))
(Statements)))

View File

@ -2,46 +2,35 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements))
(Function
(Empty)
{ (Identifier)
->(Identifier) }
(Statements)
(Statements))
(Function
(Identifier)
{ (Identifier)
->(Identifier) }
(Statements
(Statements
(Identifier)
(Identifier))
(Statements
(Identifier)
(Identifier)
(Identifier)
(Identifier)))
(Identifier)
(Identifier))
(Statements
(Identifier)
(Identifier)
(Identifier)
(Identifier))
(Statements))
(Function
(Empty)
{ (Identifier)
->(Identifier) }
(Statements)
(Statements
(Statements
(Identifier))
(Statements
(Identifier)))
(Statements))
(Function
(Empty)
{ (Identifier)
->(Identifier) }
(Statements)
(Statements))
(Function
(Statements
(Statements
(Identifier)
@ -49,43 +38,38 @@
(Statements
(Identifier)
(Identifier)))
{ (Identifier)
->(Identifier) }
(Statements))
{+(Function
(Function
{+(Identifier)+}
{+(Identifier)+}
{+(Statements)+}
{+(Empty)+})+}
{-(Statements)-}
{ (Identifier)
->(Identifier) }
{ (NoOp
{-(Empty)-})
->(Empty) })
{+(Function
{+(Empty)+}
{+(Context
{+(Comment)+}
{+(Empty)+})+}
{+(Identifier)+}
{+(Statements
{+(Identifier)+}
{+(Pointer
{+(Identifier)+})+})+}
{+(Context
{+(Comment)+}
{+(Empty)+})+}
{+(Statements)+})+}
{-(Function
{-(Empty)-}
{-(Identifier)-}
{-(Statements)-}
{-(Statements)-}
{-(NoOp
{-(Empty)-})-})-}
{-(Function
{-(Identifier)-}
{-(Identifier)-}
{-(Statements)-}
{-(Empty)-})-}
{-(Function
{-(Empty)-}
{-(Context
{-(Comment)-}
{-(Empty)-})-}
{-(Identifier)-}
{-(Statements
{-(Identifier)-}
{-(Pointer
{-(Identifier)-})-})-}
{-(Context
{-(Comment)-}
{-(Empty)-})-}
{-(Statements)-})-})

View File

@ -2,42 +2,32 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements))
(Function
(Empty)
(Identifier)
(Statements)
(Statements))
(Function
(Identifier)
(Identifier)
(Statements
(Statements
(Identifier)
(Identifier))
(Statements
(Identifier)
(Identifier)
(Identifier)
(Identifier)))
(Identifier)
(Identifier))
(Statements
(Identifier)
(Identifier)
(Identifier)
(Identifier))
(Statements))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Statements
(Identifier))
(Statements
(Identifier)))
(Identifier)
(Statements))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Statements
(Identifier)
@ -45,20 +35,19 @@
(Statements
(Identifier)
(Identifier)))
(Identifier)
(Statements))
(Function
(Identifier)
(Identifier)
(Statements)
(Empty))
(Function
(Empty)
(Context
(Comment)
(Empty))
(Identifier)
(Statements
(Identifier)
(Pointer
(Identifier)))
(Context
(Comment)
(Empty))
(Statements)))

View File

@ -2,42 +2,32 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements))
(Function
(Empty)
(Identifier)
(Statements)
(Statements))
(Function
(Identifier)
(Identifier)
(Statements
(Statements
(Identifier)
(Identifier))
(Statements
(Identifier)
(Identifier)
(Identifier)
(Identifier)))
(Identifier)
(Identifier))
(Statements
(Identifier)
(Identifier)
(Identifier)
(Identifier))
(Statements))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Statements
(Identifier))
(Statements
(Identifier)))
(Identifier)
(Statements))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Statements
(Identifier)
@ -45,27 +35,24 @@
(Statements
(Identifier)
(Identifier)))
(Identifier)
(Statements))
(Function
(Empty)
(Statements)
(Identifier)
(Statements)
(Statements)
(NoOp
(Empty)))
(Function
(Identifier)
(Identifier)
(Statements)
(Empty))
(Function
(Empty)
(Context
(Comment)
(Empty))
(Identifier)
(Statements
(Identifier)
(Pointer
(Identifier)))
(Context
(Comment)
(Empty))
(Statements)))

View File

@ -2,19 +2,10 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Assignment
(Identifier)
(Function
(Empty)
(Empty)
(Statements
{ (Identifier)
->(Identifier) }
{ (Identifier)
->(Identifier) })
(Statements
(Statements
{ (Identifier)
@ -22,6 +13,12 @@
(Statements
{ (Identifier)
->(Identifier) }))
(Empty)
(Statements
{ (Identifier)
->(Identifier) }
{ (Identifier)
->(Identifier) })
(Return
(Statements
(Integer)

View File

@ -2,19 +2,10 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Assignment
(Identifier)
(Function
(Empty)
(Empty)
(Statements
{ (Identifier)
->(Identifier) }
{ (Identifier)
->(Identifier) })
(Statements
(Statements
{ (Identifier)
@ -22,6 +13,12 @@
(Statements
{ (Identifier)
->(Identifier) }))
(Empty)
(Statements
{ (Identifier)
->(Identifier) }
{ (Identifier)
->(Identifier) })
(Return
(Statements
(Integer)

View File

@ -2,22 +2,19 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Assignment
(Identifier)
(Function
(Empty)
(Empty)
(Statements
(Identifier)
(Identifier))
(Statements
(Statements
(Identifier))
(Statements
(Identifier)))
(Empty)
(Statements
(Identifier)
(Identifier))
(Return
(Statements
(Integer)

View File

@ -2,22 +2,19 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Assignment
(Identifier)
(Function
(Empty)
(Empty)
(Statements
(Identifier)
(Identifier))
(Statements
(Statements
(Identifier))
(Statements
(Identifier)))
(Empty)
(Statements
(Identifier)
(Identifier))
(Return
(Statements
(Integer)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Type
{ (Identifier)
@ -19,18 +17,16 @@
{ (Identifier)
->(Identifier) }
(Function
{-(Statements
{-(Identifier)-})-}
(Statements
{-(Statements
{-(Identifier)-})-}
(Statements
(Identifier))
{+(Statements
{+(Identifier)+})+})
(Identifier))
{+(Statements
{+(Identifier)+})+}
(Statements
(Statements
{+(BidirectionalChannel
{+(Identifier)+})+}
{-(Identifier)-})
(Statements
(Identifier)))
(Empty))))))
(Identifier))))))))

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Type
{ (Identifier)
@ -19,18 +17,16 @@
{ (Identifier)
->(Identifier) }
(Function
{-(Statements
{-(Identifier)-})-}
(Statements
{-(Statements
{-(Identifier)-})-}
(Statements
(Identifier))
{+(Statements
{+(Identifier)+})+})
(Identifier))
{+(Statements
{+(Identifier)+})+}
(Statements
(Statements
{+(Identifier)+}
{-(BidirectionalChannel
{-(Identifier)-})-})
(Statements
(Identifier)))
(Empty))))))
(Identifier))))))))

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Type
(Identifier)
@ -16,13 +14,11 @@
(Identifier)
(Function
(Statements
(Statements
(Identifier))
(Statements
(Identifier)))
(Identifier))
(Statements
(Identifier))
(Statements
(Statements
(Identifier))
(Statements
(Identifier)))
(Empty))))))
(Identifier))))))))

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Type
(Identifier)
@ -16,14 +14,12 @@
(Identifier)
(Function
(Statements
(Statements
(Identifier))
(Statements
(Identifier)))
(Identifier))
(Statements
(Identifier))
(Statements
(Statements
(BidirectionalChannel
(Identifier)))
(Statements
(Identifier)))
(Empty))))))
(Identifier))))))))

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Defer
(Call

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Defer
(Call

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Defer
(Call

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Defer
(Call

View File

@ -15,7 +15,5 @@
{-(QualifiedImport
{-(Identifier)-})-})
(Function
(Empty)
(Identifier)
(Statements)
(Statements)))

View File

@ -15,7 +15,5 @@
{-(QualifiedImport
{-(Identifier)-})-})
(Function
(Empty)
(Identifier)
(Statements)
(Statements)))

View File

@ -9,7 +9,5 @@
(QualifiedImport
(Identifier)))
(Function
(Empty)
(Identifier)
(Statements)
(Statements)))

View File

@ -9,7 +9,5 @@
(QualifiedImport
(Identifier)))
(Function
(Empty)
(Identifier)
(Statements)
(Statements)))

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Assignment
{ (Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Assignment
{ (Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Assignment
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Assignment
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(If
(Statements

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(If
(Statements

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(If
(Statements

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(If
(Statements

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Assignment
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Assignment
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Assignment
(Identifier)

View File

@ -2,9 +2,7 @@
(Package
(Identifier))
(Function
(Empty)
(Identifier)
(Statements)
(Statements
(Assignment
(Identifier)

View File

@ -10,7 +10,5 @@
{+(Identifier)+}) }
(Comment))
(Function
(Empty)
(Identifier)
(Statements)
(Statements)))

Some files were not shown because too many files have changed in this diff Show More