-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from georgejecook/fix/update-to-bsc-0.59.0
Fix/update to bsc 0.60.5
- Loading branch information
Showing
6 changed files
with
348 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
{ | ||
"files.exclude": { | ||
"**/.git": true, | ||
"**/.svn": true, | ||
"**/.hg": true, | ||
"**/CVS": true, | ||
"**/.DS_Store": true, | ||
"**/node_modules": true, | ||
"**/.nyc_output": true, | ||
"**/coverage": true, | ||
"**/dist": true | ||
"**/.git": true, | ||
"**/.svn": true, | ||
"**/.hg": true, | ||
"**/CVS": true, | ||
"**/.DS_Store": true, | ||
"**/node_modules": true, | ||
"**/.nyc_output": true, | ||
"**/coverage": true, | ||
"**/dist": true | ||
}, | ||
"search.exclude": { | ||
"**/node_modules": true, | ||
"**/bower_components": true, | ||
"**/dist": true | ||
"**/node_modules": true, | ||
"**/bower_components": true, | ||
"**/dist": true | ||
}, | ||
"editor.tabSize": 4, | ||
"editor.insertSpaces": true, | ||
"typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": true, | ||
"files.trimTrailingWhitespace": true | ||
} | ||
"files.trimTrailingWhitespace": true, | ||
"cSpell.words": ["undent"] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import type { | ||
BscFile, | ||
WalkOptions, | ||
WalkVisitor | ||
} from 'brighterscript'; | ||
import { | ||
Range, | ||
Statement | ||
} from 'brighterscript'; | ||
|
||
import { SourceNode } from 'source-map'; | ||
|
||
import type { BrsTranspileState } from 'brighterscript/dist/parser/BrsTranspileState'; | ||
|
||
export class RawCodeStatement extends Statement { | ||
constructor( | ||
public source: string, | ||
public sourceFile?: BscFile, | ||
public range: Range = Range.create(1, 1, 1, 99999) | ||
) { | ||
super(); | ||
} | ||
|
||
public transpile(state: BrsTranspileState) { | ||
//indent every line with the current transpile indent level (except the first line, because that's pre-indented by bsc) | ||
let source = this.source.replace(/\r?\n/g, (match, newline) => { | ||
return state.newline + state.indent(); | ||
}); | ||
|
||
return [new SourceNode( | ||
this.range.start.line + 1, | ||
this.range.start.character, | ||
this.sourceFile ? this.sourceFile.pathAbsolute : state.srcPath, | ||
source | ||
)]; | ||
} | ||
public walk(visitor: WalkVisitor, options: WalkOptions) { | ||
//nothing to walk | ||
} | ||
} |
Oops, something went wrong.