Skip to content

Commit

Permalink
Merge branch 'master' into fix/ParseJson_global_callable
Browse files Browse the repository at this point in the history
  • Loading branch information
TwitchBronBron committed May 14, 2021
2 parents a11d588 + 3bf2286 commit 36509b2
Show file tree
Hide file tree
Showing 36 changed files with 2,041 additions and 1,335 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -12,4 +12,6 @@ graph.svg
.history
*.tgz
benchmarks/*.json
benchmarks/*.brs
benchmarks/*.brs
isolate-*
v8*.log
38 changes: 38 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0



## [0.38.0] - 2021-05-04
### Adds
- warning for mismatched class method accessibility ([#402](https://github.com/rokucommunity/brighterscript/pull/402))
- allow class field overrides in child classes as long as they are the same type ([#394](https://github.com/rokucommunity/brighterscript/pull/394))



## [0.37.4] - 2021-04-20
### Fixed
- bug validating namespace function calls ([#390](https://github.com/rokucommunity/brighterscript/pull/390))



## [0.37.3] - 2021-04-12
### Fixed
- bug where having multiple components with the same name would cause issues in the program, normally requiring a language server or watcher restart. ([#353](https://github.com/rokucommunity/brighterscript/pull/353))
- bug in xml file ignoring `needsTranspiled` flag when set by plugins ([#384](https://github.com/rokucommunity/brighterscript/pull/384))



## [0.37.2] - 2021-04-08
### Fixed
- erraneous syntax issue when concatenating a template string and a regular string. ([#383](https://github.com/rokucommunity/brighterscript/pull/383))
- prevent circular import causing stack overflow crash. ([#381](https://github.com/rokucommunity/brighterscript/pull/381))



## [0.37.1] - 2021-03-30
### Fixed
- bug when transpiling print statements that wouldn't retain the existing separators (semicolon, comma, no separator) which all have unique uses ([#373](https://github.com/rokucommunity/brighterscript/pull/373))



## [0.37.0] - 2021-03-18
### Added
- support for `bs:disable` comments in xml files ([#363](https://github.com/rokucommunity/brighterscript/pull/363))
Expand Down Expand Up @@ -1061,3 +1094,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[0.35.0]: https://github.com/rokucommunity/brighterscript/compare/v0.34.3...v0.35.0
[0.36.0]: https://github.com/rokucommunity/brighterscript/compare/v0.35.0...v0.36.0
[0.37.0]: https://github.com/rokucommunity/brighterscript/compare/v0.36.0...v0.37.0
[0.37.1]: https://github.com/rokucommunity/brighterscript/compare/v0.37.0...v0.37.1
[0.37.2]: https://github.com/rokucommunity/brighterscript/compare/v0.37.1...v0.37.2
[0.37.3]: https://github.com/rokucommunity/brighterscript/compare/v0.37.2...v0.37.3
[0.37.4]: https://github.com/rokucommunity/brighterscript/compare/v0.37.3...v0.37.4
[0.38.0]: https://github.com/rokucommunity/brighterscript/compare/v0.37.4...v0.38.0
35 changes: 33 additions & 2 deletions benchmarks/index.js
@@ -1,10 +1,11 @@

const fsExtra = require('fs-extra');
const syncRequest = require('sync-request');
const path = require('path');
const { spawnSync, execSync } = require('child_process');
const yargs = require('yargs');
const readline = require('readline');
const rimraf = require('rimraf');
const glob = require('glob');

class Runner {
constructor(options) {
Expand All @@ -13,6 +14,7 @@ class Runner {
this.noprepare = options.noprepare;
this.project = options.project;
this.quick = options.quick;
this.profile = options.profile;
}
run() {
this.downloadFiles();
Expand Down Expand Up @@ -120,17 +122,40 @@ class Runner {
return curr.length > acc ? curr.length : acc;
}, 0);

if (this.profile) {
console.log('Deleting previous profile runs\n');
rimraf.sync(path.join(__dirname, 'isolate-*'));
}

//run one target at a time
for (const target of this.targets) {
//run each of the versions within this target
for (let versionIndex = 0; versionIndex < this.versions.length; versionIndex++) {
const version = this.versions[versionIndex];
process.stdout.write(`Benchmarking ${target}@${version}`);
const alias = `brighterscript${versionIndex + 1}`;

//get the list of current profiler logs
const beforeLogs = glob.sync('isolate-*.log', {
cwd: __dirname
});

execSync(`node target-runner.js "${version}" "${maxVersionLength}" "${target}" "${maxTargetLength}" "brighterscript${versionIndex + 1}" "${this.project}" "${this.quick}"`, {
execSync(`node ${this.profile ? '--prof ' : ''}target-runner.js "${version}" "${maxVersionLength}" "${target}" "${maxTargetLength}" "${alias}" "${this.project}" "${this.quick}"`, {
cwd: path.join(__dirname),
stdio: 'inherit'
});
if (this.profile) {
const logFile = glob.sync('isolate-*.log', {
cwd: __dirname
}).filter(x => !beforeLogs.includes(x))[0];

execSync(`node --prof-process ${logFile} > "${logFile.replace(/\.log$/, '')} (${target} ${version}).txt"`, {
cwd: path.join(__dirname)
});
execSync(`node --prof-process --preprocess -j ${logFile} > "${logFile.replace(/\.log$/, '')} (${target} ${version}).json"`, {
cwd: path.join(__dirname)
});
}
}
//print a newline to separate the targets
console.log('');
Expand Down Expand Up @@ -171,6 +196,12 @@ let options = yargs
description: 'run a quick benchmark rather than the lower more precise version',
default: false
})
.option('profile', {
type: 'boolean',
alias: 'prof',
description: 'Enable nodejs profiling of each benchmark run',
default: false
})
.strict()
.check(argv => {
const idx = argv.versions.indexOf('latest');
Expand Down
2 changes: 1 addition & 1 deletion bsconfig.schema.json
Expand Up @@ -165,7 +165,7 @@
"items": {
"anyOf": [
{
"type": "number",
"type": ["number", "string"],
"description": "A code of diagnostics that should be filtered out from the files matched in 'src'"
}
]
Expand Down
9 changes: 7 additions & 2 deletions docs/source-literals.md
Expand Up @@ -14,9 +14,11 @@ print SOURCE_FILE_PATH
transpiles to:

```BrightScript
print "file:///c:/projects/roku/brighterscript/scripts/rootDir/source/main.bs"
print "file" + ":///c:/projects/roku/brighterscript/scripts/rootDir/source/main.bs"
```

_note: the literal is concatenated to keep the roku static analysis tool happy_

## SOURCE_LINE_NUM
The 1-based line number of the source file.

Expand Down Expand Up @@ -153,10 +155,13 @@ transpiles to:

```BrightScript
function main()
print "file:///c:/projects/roku/brighterscript/scripts/rootDir/source/main.bs:2"
print "file" + ":///c:/projects/roku/brighterscript/scripts/rootDir/source/main.bs:2"
end function
```

_note: the literal is concatenated to keep the roku static analysis tool happy_


## PKG_PATH
The pkg path of the file.

Expand Down

0 comments on commit 36509b2

Please sign in to comment.