Skip to content
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

[PORT] Treat '@{' an error instead of text in LG #1768

Merged
merged 1 commit into from
Feb 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/botbuilder-lg/src/LGFileLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fragment STRING_LITERAL : ('\'' (~['\r\n])* '\'') | ('"' (~["\r\n])* '"');

fragment STRING_INTERPOLATION : '`' ('\\`' | ~'`')* '`';

fragment EXPRESSION_FRAGMENT : '$' '{' (STRING_LITERAL|STRING_INTERPOLATION|EMPTY_OBJECT|~[\r\n{}'"`])*? '}';
fragment EXPRESSION_FRAGMENT : '$' '{' (STRING_LITERAL | STRING_INTERPOLATION | EMPTY_OBJECT | ~[\r\n{}'"`] )+ '}'?;

fragment ESCAPE_CHARACTER_FRAGMENT : '\\' ~[\r\n]?;

Expand Down
4 changes: 2 additions & 2 deletions libraries/botbuilder-lg/src/evaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export class Evaluator extends AbstractParseTreeVisitor<any> implements LGFilePa
private readonly strictMode: boolean;

// to support broswer, use look-ahead replace look-behind
// original:/(?<!\\)$\{((\'[^\'\r\n]*\')|(\"[^\"\r\n]*\")|(\`(\\\`|[^\`])*\`)|[^\r\n\{\}\'\"\`])*?\}/g;
public static readonly expressionRecognizeReverseRegex: RegExp = new RegExp(/\}((\'[^\'\r\n]*\')|(\"[^\"\r\n]*\")|(\`(\\\`|[^\`])*\`)|([^\r\n\{\}\'\"\`]))*?\{\$(?!\\)/g);
// original:/(?<!\\)$\{((\'[^\'\r\n]*\')|(\"[^\"\r\n]*\")|(\`(\\\`|[^\`])*\`)|[^\r\n\{\}\'\"\`])+\}?/g;
public static readonly expressionRecognizeReverseRegex: RegExp = new RegExp(/\}?((\'[^\'\r\n]*\')|(\"[^\"\r\n]*\")|(\`(\\\`|[^\`])*\`)|([^\r\n\{\}\'\"\`]))+\{\$(?!\\)/g);

public static readonly LGType = 'lgType';
public static readonly activityAttachmentFunctionName = 'ActivityAttachment';
Expand Down
Loading